query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
030a6288a61bd26bade8b59a1994b418
controller.js collection of functions to put in html onclick Copyright 2015. verev. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. / source:
[ { "docid": "4a7b880b32e801e3b69d8cad0c52fe34", "score": "0.0", "text": "function relMouseCoords(event){\r\n var totalOffsetX = 0;\r\n var totalOffsetY = 0;\r\n var canvasX = 0;\r\n var canvasY = 0;\r\n var currentElement = this;\r\n\r\n do{\r\n totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft;\r\n totalOffsetY += currentElement.offsetTop - currentElement.scrollTop;\r\n }\r\n while(currentElement = currentElement.offsetParent)\r\n\r\n canvasX = event.pageX - totalOffsetX;\r\n canvasY = event.pageY - totalOffsetY;\r\n\r\n return {x:canvasX, y:canvasY}\r\n}", "title": "" } ]
[ { "docid": "28b016feac2326ff70cfc28d1cbcc822", "score": "0.68923205", "text": "function angularController () {\n var click = this;\n click.message = function ($event) {\n //Event where message prints to the console\n //console.log(\"The button was clicked!\");\n //Event where the H1 text shows in button\n click.messageShow = false;\n };\n click.messageShow = true;\n click.list = function () {\n click.listShow = false;\n };\n click.listShow = true;\n \n }", "title": "" }, { "docid": "a36edc1682cbf13eb3d586788f67f4c9", "score": "0.6546192", "text": "function controller() { }", "title": "" }, { "docid": "a36edc1682cbf13eb3d586788f67f4c9", "score": "0.6546192", "text": "function controller() { }", "title": "" }, { "docid": "a36edc1682cbf13eb3d586788f67f4c9", "score": "0.6546192", "text": "function controller() { }", "title": "" }, { "docid": "a36edc1682cbf13eb3d586788f67f4c9", "score": "0.6546192", "text": "function controller() { }", "title": "" }, { "docid": "a36edc1682cbf13eb3d586788f67f4c9", "score": "0.6546192", "text": "function controller() { }", "title": "" }, { "docid": "27ff994355e6cca5bfd1d645b0809285", "score": "0.635631", "text": "listener() {\r\n // menu button\r\n document.querySelector('.drop-btn').onclick = function() {\r\n view.buttonVisible();\r\n }\r\n // admin button\r\n document.querySelector('.admin-btn').onclick = function() {\r\n view.admin(); // hide/unhide admin form\r\n view.updateAdmin() // update active cat's property values\r\n }\r\n // submit button\r\n document.querySelector('#submit').onclick = function(e) {\r\n e.preventDefault();\r\n if (model.activeCat !== '') {\r\n //let self = controller;\r\n view.checkForm(); // check for empty fields in admin form\r\n this.submit(); // update active cat object values\r\n view.renderCat(); // add selected cat to html\r\n view.listFresh(); // update cat name in menu list\r\n this.clickListener(); // add event listener to cat's rerendered picture\r\n }\r\n }.bind(this);\r\n \r\n // name list in the menu\r\n for (let i in model.catNames) { \r\n model.catNames[i].onclick = function(event) {\r\n view.showCard(); // unhide card if hidden\r\n this.catSelector(event); // add selected cat to html \r\n this.listSelector(event); // style list when clicked\r\n this.clickListener(); // add event listener to active cat's picture\r\n view.updateAdmin(); // update active cat's property values if changed by admin form\r\n }.bind(this);\r\n }\r\n }", "title": "" }, { "docid": "2678d56c0b5d69d01cac0ac8862d9499", "score": "0.6113934", "text": "function Controller(model){\n function click(){\n// console.log(\"click!\");\n// console.log(\"value:\",model.get_value());\n model.increment();\n }\n return {click:click}\n }", "title": "" }, { "docid": "6581a59c1fa149ad609a4028ea9a5787", "score": "0.60296077", "text": "function InstructionsModalController() {\n}", "title": "" }, { "docid": "cd50b8d5072302f7a867edc0aa46f968", "score": "0.59835017", "text": "onclick(){}", "title": "" }, { "docid": "a152bc5e9fd5d765947f9422f1874f1e", "score": "0.59535104", "text": "function onclick_handler(ev) {\n}", "title": "" }, { "docid": "6a9f8f588eb263d80c72e62b4ced43e4", "score": "0.5945923", "text": "function Controller(){\r\n this.tttGameModel = new Model(3,3);\r\n //SETS EVENT HANDLER FOR EACH CELL\r\nfunction addEventListenerToCell(m,i,j){\r\n\r\n document.documentElement.getElementsByTagName(\"tr\")[i].getElementsByTagName(\"td\")[j].addEventListener(\"click\", function() {\r\n //if(event.onClick){\r\n //if(m.isValidMove){\r\n //setCellText(row, column, m.players[m.currentPlayerIndex]);\r\n m.makeMove(i,j);\r\n //}\r\n //}\r\n });\r\n}\r\nthis.v = new View(this.tttGameModel, this.tttGameModel.rowTotal, this.tttGameModel.columnTotal, addEventListenerToCell);\r\n}", "title": "" }, { "docid": "a464b48a37190ecbbcf27ec8112f7075", "score": "0.5925835", "text": "click(){\n\t\tthis.sendAction('action', this.get('content'));\n\t}", "title": "" }, { "docid": "9962bd31b5d6a5a2e36c48864c25cbef", "score": "0.5912899", "text": "function fns(def) {\n var removing = def?def:false;\n return {\n removing: function() { return removing },\n toggleRemove: function() { removing = !removing },\n btnClass: function(x) {\n if($scope.isDeleting)\n if(removing)\n return 'center class-button button-lg';\n else\n return 'center class-button button-lg faded';\n else\n return 'center class-button button-lg';\n },\n handleClick: function(id, $event) {\n if($scope.isDeleting)\n {\n this.toggleRemove();\n hasDeletes = true;\n //console.log(this);\n }\n else\n window.location.href = '../classedit/?id=' + id;\n }\n }\n }", "title": "" }, { "docid": "407764a4c3a18c8ebd22e0ebce84323f", "score": "0.5900014", "text": "function WelcomeController(){\n this.full_name = \"Stephen Dangerfield\";\n this.age = 20;\n this.city = \"Springville\";\n this.state = \"Utah \";\n this.shout = function(selectedElement){\n return selectedElement.toUpperCase() + \"!\";\n };\n}", "title": "" }, { "docid": "a9714c733a1f0526129edf2d8cbf92e7", "score": "0.5874679", "text": "function clickHandler(e){\n\n}", "title": "" }, { "docid": "f57aaf16b441752480ad8b8242ecc74a", "score": "0.58443815", "text": "function register_event_handlers()\n {\n \n \n $(\".uib_w_2\").click(function(evt)\n {\n window.location.href = 'index.html'; \n });\n}", "title": "" }, { "docid": "de3df6666e4e05626304caf9f659624f", "score": "0.58026534", "text": "function ContextMenuController(){}", "title": "" }, { "docid": "07ff451d3ed68e646b6ab76d355917da", "score": "0.5775729", "text": "onButtonClick(e) {\n\t}", "title": "" }, { "docid": "ee7837c5ed4390039260f66a58929c6f", "score": "0.57659066", "text": "function MainController() {}", "title": "" }, { "docid": "028cbeaf984f36844440fc67319e2d67", "score": "0.5764097", "text": "function doClick(method) {\n\t\t\t\t$scope.$eval(method);\n\t\t\t}", "title": "" }, { "docid": "028cbeaf984f36844440fc67319e2d67", "score": "0.5764097", "text": "function doClick(method) {\n\t\t\t\t$scope.$eval(method);\n\t\t\t}", "title": "" }, { "docid": "07bfff3912629638ea7fb8cd3fa10331", "score": "0.5751806", "text": "function Controller() { \n\n}", "title": "" }, { "docid": "0327f247f5b0aa3eab9a62dc65b4cee8", "score": "0.5745851", "text": "function viewController() {\n\n var session = document.getElementsByTagName('body')[0].getAttribute('data-session'); // get the boolean whether or not user is logged in\n\n function sessionSave(pathname) { // saving to localStorage as the session saves to the database\n localStorage.setItem('section', pathname);\n return true;\n }\n\n function localSaveGo(pathname) { // save to localStorage and go there\n localStorage.setItem('section', pathname);\n window.location = pathname;\n return true;\n }\n\n function targetFilter(event) { // filter through the different properties of event that are sent\n event.preventDefault();\n\n if (event.target.nodeName === \"A\") { // if the target falls on the anchor element\n localSaveGo(event.target.pathname);\n } else if (event.target.nodeName === 'svg') { // if the target falls on the svg element\n localSaveGo(event.target.parentNode.pathname);\n } else if (event.target.nodeName === 'use') { // if the target falls on the use element\n localSaveGo(event.target.parentNode.parentNode.pathname);\n } else {\n return false;\n }\n\n }\n\n function keyNav(event) {\n if (event.keyCode === 39) {\n var pathname = document.getElementById('nextNav').getAttribute('href');\n localStorage.setItem('section', pathname);\n window.location.pathname = pathname;\n } else if (event.keyCode === 37) {\n var pathname = document.getElementById('prevNav').getAttribute('href');\n localStorage.setItem('section', pathname);\n window.location.pathname = pathname;\n } else {\n return false;\n }\n }\n\n if (\"localStorage\" in window && window.localStorage !== null) { // if the browser supports localStorage\n\n if (typeof session !== 'undefined' && session === 'true') { // if the user is logged in (a session is present)\n\n sessionSave(window.location.pathname); // save the session's progress to localStorage\n\n document.addEventListener('keydown', keyNav); // keyboard nav while in session (which also saves to localStorage)\n\n } else { // user is not logged in\n document.getElementById('js-saveProgress').addEventListener('click', targetFilter); // if localStorage exists in the browser, set event listener to call the save function\n document.getElementById('js-allQuestions').addEventListener('click', targetFilter); // if localStorage exists in the browser, set event listener to call the save function\n document.addEventListener('keydown', keyNav); // if localStorage exists in the browser, set event listener to call the save function\n\n if (typeof localStorage.section !== 'undefined' && window.location.pathname !== localStorage.getItem('section')) { // if section is set and the query and localStorage disagree\n window.location.pathname = localStorage.getItem('section'); // set the pathname to what's in localStorage\n }\n }\n }\n }", "title": "" }, { "docid": "39143ef7aa473dcfda60fea781d9b9a8", "score": "0.57374424", "text": "buttonClick (e) {\n\n }", "title": "" }, { "docid": "c7aef3e4d649fcd08712c61014765cd1", "score": "0.5722175", "text": "function ListCtrl($scope) {\n $scope.id = \"10001\";\n $scope.message = \"This works!\"\n $scope.cool = function() {\n //this will have to direct to trip detail screen\n $scope.message = \"I've been clicked!\"\n };\n}", "title": "" }, { "docid": "206c0efde723947486f380f26ba1eb1d", "score": "0.57192904", "text": "click() {}", "title": "" }, { "docid": "7c177b34c6e011cb4501d5c2aff0290e", "score": "0.5712263", "text": "jsFunction(action) {\n \n }", "title": "" }, { "docid": "3d60a64c1d5ad9ace9030662701110b3", "score": "0.5697123", "text": "function Controller() {}", "title": "" }, { "docid": "3d60a64c1d5ad9ace9030662701110b3", "score": "0.5697123", "text": "function Controller() {}", "title": "" }, { "docid": "3d60a64c1d5ad9ace9030662701110b3", "score": "0.5697123", "text": "function Controller() {}", "title": "" }, { "docid": "bdb449cb077435c4378c1983354f1a3c", "score": "0.56962967", "text": "function switchViewControls() {\n console.log(\"switchViewControls registering handlers\");\n $(\".switch-view\").live(\"click\", function() {\n params.index = parseInt($(this).attr(\"data-index\"));\n console.log(\"Switching to canvas view with params \" + JSON.stringify(params));\n gadgets.views.requestNavigateTo(\"canvas\", params);\n });\n $(\"#banner\").click(function() {\n $(\".banner-div\").hide();\n $(\".h_view\").show();\n $(\".buttons\").show();\n loadQuotes();\n });\n}", "title": "" }, { "docid": "214be502fccdd698aecf885ad728cf54", "score": "0.56845874", "text": "function indexController() {\n\n }", "title": "" }, { "docid": "5e9fd55c813562b271f0031d72228297", "score": "0.5678817", "text": "onClick() {}", "title": "" }, { "docid": "b2f557488c9d1f75deefbecd7c8fd6f8", "score": "0.56733227", "text": "function view(url, controller, method, element_id, result_id, modal_view_id){\n var parameters = {\n \"element_id\": element_id \n };\n $.ajax({\n data: parameters,\n url: url+'index.php/'+controller+'/'+method,\n type: 'post',\n beforeSend: function () { \n },\n success: function (response) {\n $(\"#\"+result_id).html(response);\n $(\"#\"+modal_view_id ).trigger( \"click\" );\n }\n });\n}", "title": "" }, { "docid": "4c906b32ff164213aa0e44816836efdd", "score": "0.56714517", "text": "function register_event_handlers()\n {\n \n /* button .uib_w_65 */\n $(document).on(\"click\", \".uib_w_65\", function(evt)\n {\n window.open(\"../index.html\");\n return false;\n });\n \n }", "title": "" }, { "docid": "6814eb728f98ad7e9b1fb6583288ed70", "score": "0.56711096", "text": "function addButtonControllers() {\n var nearestGas;\n\n $(\".A-wegKnop\").click(function () {\n nearestGas = ol.proj.fromLonLat(startPositionRoute, 'EPSG:28992');\n\n setEndPosition('http://localhost:8080/geoserver/Engi/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Engi:afstand_tot_ts_a_weg&maxFeatures=50&outputFormat=application%2Fjson' + '&viewparams=x:' + nearestGas[0].toString().split(\".\")[0] + ';y:' + nearestGas[1].toString().split(\".\")[0]);\n });\n\n $(\".B-wegKnop\").click(function () {\n nearestGas = ol.proj.fromLonLat(startPositionRoute, 'EPSG:28992');\n setEndPosition('http://localhost:8080/geoserver/Engi/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Engi:afstand_tot_ts_b_weg&maxFeatures=50&outputFormat=application%2Fjson' + '&viewparams=x:' + nearestGas[0].toString().split(\".\")[0] + ';y:' + nearestGas[1].toString().split(\".\")[0]);\n });\n}", "title": "" }, { "docid": "3811658029db318bdf7279a8e0e01424", "score": "0.5669413", "text": "onClick(e) { }", "title": "" }, { "docid": "101c5baaa2a6cd77931ac1a6205a998d", "score": "0.5641585", "text": "function clicked(){\n console.log('Hello subrata, the button was clicked javascript line 396');\n}", "title": "" }, { "docid": "e5de8f9716220343c92f1fcc40e6a843", "score": "0.5626518", "text": "function deleteBtnModel(id) {\r\n return `<button id=\"${id}Delete\" class='deleteModel' onclick='deleteModel(\"${id}\")'></button>`;\r\n}", "title": "" }, { "docid": "83c263543ee8329563647fd3759ed480", "score": "0.56180465", "text": "static button() {\n\n document.querySelector(\"#loginBTN\").setAttribute(\"onclick\", \"programa.login();\");\n //document.querySelector(\"#buttonBRR\").setAttribute(\"onclick\",\"programa.borrar();\");\n document.querySelector(\"#salir\").setAttribute(\"onclick\", \"programa.salir();\");\n document.querySelector(\"#consultarCuenta\").setAttribute(\"onclick\", \"cuenta.consultarTpl();\");\n document.querySelector(\"#extraer\").setAttribute(\"onclick\", \"cuenta.extraerTpl()\");\n document.querySelector(\"#extraerBTN\").setAttribute(\"onclick\",\"cuenta.extraerCalculo();\");\n document.querySelector(\"#depositar\").setAttribute(\"onclick\", \"cuenta.depositarTpl();\");\n }", "title": "" }, { "docid": "76c629d529917a97d78fdbe27809871a", "score": "0.55968034", "text": "function FunctionController(dom) {\n this.dom = dom;\n}", "title": "" }, { "docid": "18681845ca3666e7d4c38c6d54a4a90d", "score": "0.55948716", "text": "onClick() {\n }", "title": "" }, { "docid": "832f9795ee3165c65e4a7bdb7aaab495", "score": "0.55829394", "text": "handleClick(method) {\n /* if (method.click != \"login\") {\n this.colorService.handleClickHeader(method);\n }\n */\n this.routeToService.handleClick(method.click); //pick the current side!!!!\n }", "title": "" }, { "docid": "a1fd0e09e5e4363f8f38ebc6a7b407ca", "score": "0.5582318", "text": "function helpController() {\n\n }", "title": "" }, { "docid": "e3e9606e71f9c6c15b3b3ba422b71094", "score": "0.5572419", "text": "function registerClickHandler()\n{\n $(\"body\").on(\"click\", \"a.linkDetailView\", function (e)\n {\n showDetailView(e.currentTarget)\n });\n\n $(\"body\").on(\"click\", \".switch\", function ()\n {\n switchView();\n });\n\n $(\"body\").on(\"click\", \".deleteButton\", function (e)\n {\n deleteShoppingList(e.currentTarget);\n });\n\n $(\"body\").on(\"click\", \".editButton\", function (e)\n {\n showEditSymbols(e.currentTarget);\n });\n\n $(\"body\").on(\"click\", \".deleteIcon\", function (e)\n {\n deleteArticle(e.currentTarget);\n });\n\n $(\"body\").on(\"click\", \".takeOverButton\", function (e)\n {\n takeOverList(e.currentTarget);\n });\n\n $(\"body\").on(\"click\", \".submitButton\", function (e)\n {\n finishList(e.currentTarget);\n });\n\n $(\"body\").on(\"click\", \".editIcon.editArticle\", function (e)\n {\n editArticle(e.currentTarget);\n });\n\n $(\"body\").on(\"click\", \".editList.editIcon\", function (e)\n {\n editList(e.currentTarget)\n });\n\n $(\"body\").on(\"click\", \".submitForm\", function (e)\n {\n e.preventDefault();\n createNewList();\n });\n}", "title": "" }, { "docid": "38d228902901149c5fffb03b136c582e", "score": "0.5565829", "text": "onItemClicked(id, ev, html) {\n }", "title": "" }, { "docid": "49b47142ac13f5f5c7f6f5cdd1ad015a", "score": "0.55624187", "text": "function View(div, model, controller) {\n \n //Define all visual containers\n var displayArea = $(\"<div class='displayArea'></div>\");\n\n //Adds all visual containers\n div.append(displayArea);\n\n var searchBtn = $('<button id=\"search-btn\" class=\"btn btn-info btn-lg\" type=\"button\"><i class=\"glyphicon glyphicon-search\"></i></button>');\n $(\".input-group-btn\").append(searchBtn);\n searchBtn.on('click', controller.searchArticles);\n\n $(\"#search-txt\").keyup(function(event){\n if(event.keyCode == 13){\n searchBtn.click();\n }\n });\n\n \n }", "title": "" }, { "docid": "1f99cde91d42e979896fff44c13e2a7f", "score": "0.55589116", "text": "function createView () {\n var label = prompt('What is the view called? (Capitalize)');\n var cont = document.getElementById('cont');\n var temp = document.createElement('div');\n temp.setAttribute('name',label);\n var id = uuidv4();\n temp.setAttribute('id',id);\n temp.setAttribute('class','axiom');\n var text = document.createTextNode(label);\n temp.appendChild(text);\n\n var span = document.createElement('span');\n span.innerHTML = 'Create Concept';\n span.setAttribute('class','button');\n span.setAttribute('onclick','createConcept(\"'+id+'\")');\n temp.appendChild(span);\n\n var span = document.createElement('span');\n span.innerHTML = 'Create Relation';\n span.setAttribute('class','button');\n span.setAttribute('onclick','createRelation(\"'+id+'\")');\n temp.appendChild(span);\n\n var span = document.createElement('span');\n span.innerHTML = 'Save Axiom';\n span.setAttribute('class','button');\n span.setAttribute('onclick','saveAxiom(\"'+id+'\")');\n temp.appendChild(span);\n\n cont.appendChild(temp);\n}", "title": "" }, { "docid": "749d3711f27351042a8496f6fa0518a1", "score": "0.5557877", "text": "function index(){\n // ...\n }", "title": "" }, { "docid": "80c62a34744759af588996d7aa20a833", "score": "0.5546105", "text": "function bindings() \n\n{\n\n\tvar btn = document.getElementById('btn');\n\tbtn.onclick = displayResult;\n\n}", "title": "" }, { "docid": "1f1bd4cfee29a553a3fe633f755fae1d", "score": "0.55412644", "text": "function ss$st$honorControllerBase$openMain(json){\n //No javascript because of invoking the native common services\n}", "title": "" }, { "docid": "e2f08e48750e5bcacc9ac4d5b7fec10b", "score": "0.5533822", "text": "function bindClickEvents() {\n document.getElementById(\"btnRegister\").onclick = function() { sipRegister(); };\n document.getElementById(\"btnUnRegister\").onclick = function() { sipUnRegister(); };\n document.getElementById(\"btnCall\").onclick = function() { sipCall(); };\n document.getElementById(\"btnHangUp\").onclick = function() { sipHangUp(); };\n document.getElementById(\"btnFullScreen\").onclick = function() { toggleFullScreen(); };\n document.getElementById(\"btnHoldResume\").onclick = function() { sipToggleHoldResume(); };\n document.getElementById(\"btnTransfer\").onclick = function() { sipTransfer(); };\n \n }", "title": "" }, { "docid": "b6014ed144d70db9721b25f41e355e17", "score": "0.5531433", "text": "setTableClickEvent(controllerRef) {\n $('#symbol-table').click(() => {\n\n let currentActive = View.getCurrentActivePageId();\n let wb = controllerRef.view[currentActive].whiteBoard;\n this.drawTable(wb);\n })\n }", "title": "" }, { "docid": "37e1ac86c19cf7b6542979be8092a9e7", "score": "0.5516969", "text": "function beforeClick(){}", "title": "" }, { "docid": "6d49ec37fc74105ed91516ea5258d54b", "score": "0.55136734", "text": "function eventBindings(){\n \n $(document).on(\"keyup\",\".sBar\", function() {\n controller.autoCompleteSearch($(this).val());\n });\n $(document).on(\"click\", \".uriButtondefault\", function(){\n\t\tcontroller.updateMappings(wikiMap);\n controller.describeURI($(this).attr('uri'));\n $.mobile.navigate(\"#describePage\", {transition : \"slide\"});\n\t\t$(\"#logo\").html(\"<img src='img/wikipedia_icon.png'>Wikipedia</img>\")\n return false;\n });\n\n $(document).on(\"click\", \".uriButtoning\", function(){\n\t\tcontroller.updateMappings(ingMap);\n controller.describeING($(this).attr('uri'));\n\t\t$(\"#logo\").html(\"<img src='img/dpd_icon.png'>DPD</img>\")\n $.mobile.navigate(\"#describePage\", {transition : \"slide\"});\n return false;\n });\n $(document).on(\"click\", \".uriButtondin\", function(){\n\t\tcontroller.updateMappings(dinMap);\n controller.describeDIN($(this).attr('uri'));\n $.mobile.navigate(\"#describePage\", {transition : \"slide\"});\n\t\t$(\"#logo\").html(\"<img src='img/dpd_icon.png'>DPD</img>\")\n return false;\n });\n $(document).on(\"click\", \".uriButtondrugBank\", function(){\n\t\tcontroller.updateMappings(drugBankMap);\n controller.describeDrugBank($(this).attr('uri'));\n\t\t$(\"#logo\").html(\"<img src='img/drugBank_icon.png'>DrugBank</img>\")\n $.mobile.navigate(\"#describePage\", {transition : \"slide\"});\n return false;\n });\n\n}", "title": "" }, { "docid": "4aa4db28ac0f222ff5c1c0f3f9a758e6", "score": "0.55060947", "text": "function __lib_menulink_get_buttons(index, up, down, myid){\r\nvar HTMLContent = \"<input type='button' class='bt' style='width:65px;text-align:center' onclick='javascript:\"+this.name+\".remove(\"+index+\",\\\"\"+myid+\"\\\");\\' value='Remove'>\";\r\n\tHTMLContent += \"<input type='button' class='bt' style='width:55px;text-align:center' onclick='javascript:\"+this.name+\".edit(\\\"\"+myid+\"\\\");' value='Edit'>\";\r\n\tif(index==0){\r\n\t\tHTMLContent += \"<input type='button' disabled='true' class='bt' style='display:inline;width:55px;text-align:center;color:#999999' value=\\\"Up\\\">\";\r\n\t} else {\r\n\t\tHTMLContent += \"<input type='button' class='bt' style='width:55px;text-align:center' onclick='javascript:\"+this.name+\".up(\"+index+\");' value=\\\"Up\\\">\";\r\n\t}\r\n\tif(down==0){\r\n\t\tHTMLContent += \"<input type='button' disabled='true' class='bt' style='display:inline;width:55px;text-align:center;color:#999999' value=\\\"Down\\\">\";\r\n\t} else {\r\n\t\tHTMLContent += \"<input type='button' class='bt' style='width:55px;text-align:center;' onclick='javascript:\"+this.name+\".down(\"+index+\");' value=\\\"Down\\\">\";\r\n\t}\r\n\treturn HTMLContent;\r\n\t\r\n}", "title": "" }, { "docid": "a45d388ce77af6d30e189356f75e5359", "score": "0.5505205", "text": "handleClick(method) {\n /* if (method.click != \"login\") {\n this.colorService.handleClickHeader(method);\n } */\n this.routeToService.handleClick(method.click);\n this.onSidebarClose();\n }", "title": "" }, { "docid": "10cbaa5ded64f1ed18b691517d2e3f60", "score": "0.5494554", "text": "initButtons() {\n const self = this;\n const actions = [\n {\n name: 'Load',\n run: () => {\n self.load();\n },\n },\n {\n name: 'Step',\n run: () => {\n self.step();\n },\n },\n {\n name: 'Start',\n run: () => {\n self.start();\n },\n },\n {\n name: 'Stop',\n run: () => {\n self.stop();\n },\n },\n {\n name: 'Reset',\n run: () => {\n self.reset();\n },\n },\n ];\n\n for (let i = 0; i < actions.length; i++) {\n const action = actions[i];\n\n const button = document.createElement('button');\n button.innerText = action.name;\n button.addEventListener('click', action.run);\n this.controls.appendChild(button);\n this.views[action.name] = button;\n }\n }", "title": "" }, { "docid": "0e3c3f9f908bbffe2a57f5272513ab39", "score": "0.5491979", "text": "function SamActions() {\r\n this.funcMap = {};\r\n this.funcMap['sa-repaint'] = function(model,evt) {\r\n //console.log(\"sa-repaint %s %o\",model.samName,{evt:evt,model:model});\r\n return {render:true};\r\n }\r\n}", "title": "" }, { "docid": "8761dfa6ca131ac4c26b0513369f4ebe", "score": "0.5486335", "text": "clickHandler() {\n\t\tApp.Vent.trigger(this.options.globalEvent, {\n\t\t\tel: this.el,\n\t\t\tisActive: this.active,\n\t\t\toptions: this.options\n\t\t});\n\t}", "title": "" }, { "docid": "7684f8bd6204761b7abb8c48a8ca8dca", "score": "0.54832643", "text": "function bindEvent() {\n items\n .click(function(e){\n e.preventDefault();\n\n var index = $(this).attr('index');\n $.publish(\"/toggle/direct\", index);\n });\n }", "title": "" }, { "docid": "ca1cb909634e6c3a494bdb2133b3bbd0", "score": "0.5476478", "text": "function ListCtrl (){\n\n}", "title": "" }, { "docid": "56707d783d514c6f3218fa37871fa3e3", "score": "0.54732394", "text": "function handleClick() {\n\n }", "title": "" }, { "docid": "7713d8bb05c1436067ca5d646d50f034", "score": "0.54508215", "text": "function register_event_handlers()\n {\n \n \n /* button Back */\n $(document).on(\"click\", \".uib_w_9\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button .uib_w_1 */\n $(document).on(\"click\", \".uib_w_1\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#info\"); \n return false;\n });\n \n /* button Login */\n $(document).on(\"click\", \".uib_w_4\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Dashboard\"); \n return false;\n });\n \n /* button Create Account */\n $(document).on(\"click\", \".uib_w_6\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Create_account\"); \n return false;\n });\n \n /* button .uib_w_17 */\n $(document).on(\"click\", \".uib_w_17\", function(evt)\n {\n /*global uib_sb */\n /* Other possible functions are: \n uib_sb.open_sidebar($sb)\n uib_sb.close_sidebar($sb)\n uib_sb.toggle_sidebar($sb)\n uib_sb.close_all_sidebars()\n See js/sidebar.js for the full sidebar API */\n \n uib_sb.toggle_sidebar($(\".uib_w_26\")); \n return false;\n });\n \n /* button Information */\n $(document).on(\"click\", \".uib_w_19\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Information\"); \n return false;\n });\n \n /* button Feedback Form */\n $(document).on(\"click\", \".uib_w_20\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#FeedbackForm\"); \n return false;\n });\n \n /* button Location Maps */\n $(document).on(\"click\", \".uib_w_21\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#LocationMaps\"); \n return false;\n });\n \n /* button Videos */\n $(document).on(\"click\", \".uib_w_22\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Videos\"); \n return false;\n });\n \n /* button Charts */\n $(document).on(\"click\", \".uib_w_23\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Charts\"); \n return false;\n });\n \n /* button Others */\n $(document).on(\"click\", \".uib_w_24\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Others\"); \n return false;\n });\n \n /* button .uib_w_32 */\n $(document).on(\"click\", \".uib_w_32\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Dashboard\"); \n return false;\n });\n \n /* button .uib_w_35 */\n $(document).on(\"click\", \".uib_w_35\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Dashboard\"); \n return false;\n });\n \n /* button .uib_w_38 */\n $(document).on(\"click\", \".uib_w_38\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Dashboard\"); \n return false;\n });\n \n /* button .uib_w_41 */\n $(document).on(\"click\", \".uib_w_41\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Dashboard\"); \n return false;\n });\n \n /* button .uib_w_44 */\n $(document).on(\"click\", \".uib_w_44\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Dashboard\"); \n return false;\n });\n \n /* button .uib_w_47 */\n $(document).on(\"click\", \".uib_w_47\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Dashboard\"); \n return false;\n });\n \n /* button Close */\n $(document).on(\"click\", \".uib_w_49\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Dashboard\"); \n return false;\n });\n \n }", "title": "" }, { "docid": "d58ca2b4b9acfcde8d63ec11650fa3af", "score": "0.5441681", "text": "function get_onclick() {\n //Call search function\n setval();\n doFind();\n //Show results on grid. This function is in index.html\n \n}", "title": "" }, { "docid": "7d2adb5533df5e721029b5fdcce987c6", "score": "0.5438881", "text": "function clicked() {\n // console.log(\"the button was clicked\")\n // alert(\"button is clicked\")\n }", "title": "" }, { "docid": "07c5f0a3440f79a2ad90d2e294a46065", "score": "0.5432782", "text": "function win(eventWhenClicked) {}", "title": "" }, { "docid": "cbb937dd9f67b73bac14293f1eb39965", "score": "0.5419623", "text": "function Widget() {\n\t\t\t\n\t\t\tvar button = document.getElementById('es5');\n\t\t\tbutton.addEventListener('click', function() {\n\t\t\t this.doSomething();\n\t\t\t});\n\n\t\t}", "title": "" }, { "docid": "ae2548f4794588962bc92b7fba81f10a", "score": "0.5416759", "text": "function attachExampleHandlers() {\n\t$('.btnEdit').click(function(event) {\n\t\tvar el = event.target.id;\n\t\tel = el.slice(7);\n\t\tgetExampleForm(createExampleForm, el);\n\t});\n\t$('.btnDelete').click(function(event) {\n\t\tvar el = event.target.id;\n\t\tel = el.slice(9);\n\t\tdeleteExample(el);\n\t});\n}", "title": "" }, { "docid": "26b827f90eaaca5ad6d9b846b4691342", "score": "0.5413335", "text": "function clickHandlers () {\n $('#btn-next').on('click',next);\n $('#btn-back').on('click',back);\n $('#navbar').on('click','.icon',jump);\n}", "title": "" }, { "docid": "f56c07ea8834741a73fad3728e41ac67", "score": "0.54019004", "text": "function clickhandler(){\r\n\r\n console.log('Click Event');\r\n}", "title": "" }, { "docid": "1c503d260aba1c2e1b374d34620d4d5e", "score": "0.5393928", "text": "function fnPostLink ($scope, $element, $attrs, $ctrls){'use strict';\r\n\r\n\r\n var $element = $w($element);\r\n var controller = $ctrls[0];\r\n var $btns = $element.find('button');\r\n\r\n /*var btnHelperQuery = $btns.eq(19);\r\n\r\n btnHelperQuery.popover({\r\n html: true, \r\n placement: 'left',\r\n template : '<div class=\"popover fx-popover-s\">'+\r\n '<div class=\"arrow\"></div>'+\r\n '<div class=\"popover-content no-padding\"></div>'+\r\n '</div>',\r\n content: function () {\r\n return $(this).next('.query-popover-content').html();\r\n }\r\n });*/\r\n\r\n $scope.api.ActionGetClasses = fnActionGetClasses;\r\n for ( var i = 0, leni = $btns.length; i < leni; i++ ){\r\n var key = $btns.eq(i).attr('data-uxfwk-table-action');\r\n var $btn = $btns.eq(i);\r\n\r\n switch ( key ){\r\n case 'form-edit':{\r\n if ( true == $scope.controller.settings.hasTableFormEdition ){\r\n $btn.on('click', function (event){\r\n //$scope.api.DataSubmitConfigEntry($scope);\r\n //$scope.$apply();\r\n });\r\n }else{ $btn.hide(); }\r\n }break;\r\n\r\n case 'form-clone':{\r\n if ( true == $scope.controller.settings.hasTableFormClone ){\r\n $btn.on('click', function (event){\r\n //$scope.api.DataSubmitConfigEntry($scope);\r\n //$scope.$apply();\r\n });\r\n }else{ $btn.hide(); }\r\n }break;\r\n\r\n case 'apply-all':{\r\n if ( true == $scope.controller.settings.hasTableApplyAll ){\r\n $btn.on('click', function (event){\r\n $scope.api.DataSubmitConfigEntry($scope);\r\n $scope.$apply();\r\n });\r\n }else{ $btn.hide(); }\r\n }break;\r\n\r\n case 'cancel-all':{\r\n if ( true == $scope.controller.settings.hasTableCancelAll ){\r\n $btn.on('click', function (event){\r\n $scope.api.DataResetConfigEntry($scope);\r\n $scope.$apply();\r\n });\r\n }else{ $btn.hide(); }\r\n }break;\r\n\r\n case 'add-inline':{\r\n if ( true == $scope.controller.settings.hasTableAddInline ){\r\n $btn.on('click', function (event){\r\n $scope.api.DataAddCandidateEntry($scope);\r\n $scope.$apply();\r\n });\r\n }else{ $btn.hide(); }\r\n }break;\r\n\r\n case 'add-form':{\r\n if ( true == $scope.controller.settings.hasTableAddForm ){\r\n }else{ $btn.hide(); }\r\n }break; \r\n\r\n case 'refresh':{\r\n $btn.on('click', function (event){\r\n if ( $scope.actionGetData ){\r\n $scope.actionGetData();\r\n $scope.$apply();\r\n }\r\n });\r\n }break;\r\n\r\n case 'search':{\r\n break;\r\n var $as = $element.find('a');\r\n \r\n var searchOptionsTable = $w($element).children('div').eq(1).children('div').eq(0);\r\n var table = $w($element).parent('div').parent('div').children('div').eq(1);\r\n var internalActionsTableTotal = $w($element).children('div').eq(1);\r\n var internalActionsTableTotalHeight = internalActionsTableTotal.box().outerHeight;\r\n var searchOptionsTableHeight = $w($element).children('div').eq(0).box().outerHeight;\r\n\r\n internalActionsTableTotal.removeClass('in');\r\n table.data('expandedHeight', internalActionsTableTotalHeight + searchOptionsTableHeight);\r\n $btn.on('click', function (event){\r\n if( internalActionsTableTotal.hasClass('in') ){\r\n table.animate({paddingTop: searchOptionsTableHeight}, 'slow');\r\n }\r\n else{\r\n table.animate({paddingTop: table.data('expandedHeight') }, 'slow');\r\n }\r\n });\r\n //$btn.hide();\r\n }break; \r\n\r\n }\r\n }\r\n\r\n $btns = $btn = null;\r\n\r\n return;\r\n\r\n for ( var i = 0, leni = $as.length; i < leni; i++ ){\r\n var key = $as.eq(i).attr('data-uxfwk-table-action');\r\n var $a = $as.eq(i);\r\n \r\n var btnAdvancedSearch = $as.eq(4);\r\n var btnSimpleSearch = $as.eq(5);\r\n\r\n switch ( key ){\r\n case 'advanced-search':{ break;\r\n\r\n var simpleSearchContainerHeight = $w($element).children('div').eq(1).children('div').eq(0).children('div').eq(1);\r\n var advancedSearchContainerHeight = $w($element).children('div').eq(1).children('div').eq(0).children('div').eq(2);\r\n\r\n $a.on('click', function (event){\r\n\r\n btnAdvancedSearch.toggleClass('hidden');\r\n btnSimpleSearch.toggleClass('hidden');\r\n simpleSearchContainerHeight.addClass('hidden');\r\n advancedSearchContainerHeight.removeClass('hidden');\r\n\r\n var internalActionsTableTotalHeight2 = $w($element).children('div').eq(1).box().outerHeight;\r\n var searchOptionsTableHeight2 = $w($element).children('div').eq(0).box().outerHeight;\r\n \r\n table.data('expandedHeight', internalActionsTableTotalHeight2 + searchOptionsTableHeight2);\r\n table.animate({paddingTop: (internalActionsTableTotalHeight2 + searchOptionsTableHeight2) }, 'slow');\r\n\r\n });\r\n }break;\r\n case 'simple-search':{ break;\r\n $a.on('click', function (event){\r\n \r\n btnAdvancedSearch.toggleClass('hidden');\r\n btnSimpleSearch.toggleClass('hidden');\r\n simpleSearchContainerHeight.removeClass('hidden');\r\n advancedSearchContainerHeight.addClass('hidden');\r\n \r\n table.data('expandedHeight', internalActionsTableTotalHeight + searchOptionsTableHeight);\r\n table.animate({paddingTop: (internalActionsTableTotalHeight + searchOptionsTableHeight) }, 'slow');\r\n });\r\n }break; \r\n\r\n }\r\n }\r\n\r\n $as = $a = null;\r\n\r\n\r\n }", "title": "" }, { "docid": "1e7fa58453fe6e9091158d5a478c2205", "score": "0.5388758", "text": "function register_event_handlers()\n {\n \n \n /* button Back */\n $(document).on(\"click\", \".uib_w_9\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button .uib_w_1 */\n $(document).on(\"click\", \".uib_w_1\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#info\"); \n return false;\n });\n \n /* button .uib_w_10 */\n $(document).on(\"click\", \".uib_w_10\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button .uib_w_2 */\n $(document).on(\"click\", \".uib_w_2\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#aboutus\"); \n return false;\n });\n \n /* button .uib_w_17 */\n \n \n /* button .uib_w_18 */\n $(document).on(\"click\", \".uib_w_18\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button .uib_w_11 */\n $(document).on(\"click\", \".uib_w_11\", function(evt)\n {\n /*global uib_sb */\n /* Other possible functions are: \n uib_sb.open_sidebar($sb)\n uib_sb.close_sidebar($sb)\n uib_sb.toggle_sidebar($sb)\n uib_sb.close_all_sidebars()\n See js/sidebar.js for the full sidebar API */\n \n uib_sb.toggle_sidebar($(\".uib_w_14\")); \n return false;\n });\n \n /* button .uib_w_3 */\n $(document).on(\"click\", \".uib_w_3\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#googglechart\"); \n return false;\n });\n \n /* button .uib_w_23 */\n $(document).on(\"click\", \".uib_w_23\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button .uib_w_22 */\n $(document).on(\"click\", \".uib_w_22\", function(evt)\n {\n /*global uib_sb */\n /* Other possible functions are: \n uib_sb.open_sidebar($sb)\n uib_sb.close_sidebar($sb)\n uib_sb.toggle_sidebar($sb)\n uib_sb.close_all_sidebars()\n See js/sidebar.js for the full sidebar API */\n \n uib_sb.toggle_sidebar($(\".uib_w_24\")); \n return false;\n });\n \n /* button .uib_w_17 */\n $(document).on(\"click\", \".uib_w_17\", function(evt)\n {\n /*global uib_sb */\n /* Other possible functions are: \n uib_sb.open_sidebar($sb)\n uib_sb.close_sidebar($sb)\n uib_sb.toggle_sidebar($sb)\n uib_sb.close_all_sidebars()\n See js/sidebar.js for the full sidebar API */\n \n uib_sb.toggle_sidebar($(\".uib_w_25\")); \n return false;\n });\n \n /* button .uib_w_30 */\n $(document).on(\"click\", \".uib_w_30\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button .uib_w_4 */\n $(document).on(\"click\", \".uib_w_4\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#video\"); \n return false;\n });\n \n /* button .uib_w_5 */\n $(document).on(\"click\", \".uib_w_5\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#form\"); \n return false;\n });\n \n /* button .uib_w_36 */\n $(document).on(\"click\", \".uib_w_36\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button .uib_w_7 */\n $(document).on(\"click\", \".uib_w_7\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#locateus\"); \n return false;\n });\n \n /* button .uib_w_6 - azrin - create call us */\n $(document).on(\"click\", \".uib_w_6\", function(evt)\n {\n document.location.href = 'tel:+60386567228';\n /* your code goes here */ \n return false;\n });\n \n /* button .uib_w_39 - azrin display alert */\n $(document).on(\"click\", \".uib_w_39\", function(evt)\n {\n \t\n alert(\"Mobile App Training\\nMU DOT MY PLT\\nwww.mu.my\");\n\n /* your code goes here */ \n return false;\n });\n \n /* button .uib_w_39 */\n $(document).on(\"click\", \".uib_w_39\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* button .uib_w_40 */\n $(document).on(\"click\", \".uib_w_40\", function(evt)\n {\n /* Other options: .modal(\"show\") .modal(\"hide\") .modal(\"toggle\")\n See full API here: http://getbootstrap.com/javascript/#modals \n */\n \n $(\".uib_w_41\").modal(\"toggle\"); \n return false;\n });\n \n }", "title": "" }, { "docid": "9ba3dcd138ebcb42b390e9cc8cdd5776", "score": "0.5386875", "text": "function headerController() {\r\n var animation = 'rubberBand';\r\n $('.header-controller .icon , #topSidebar .icon').on('click', function () {\r\n var sidebar_toggle = $('.header-controller .icon , #topSidebar .icon'),\r\n body = $('body');\r\n sidebar_toggle.toggleClass('icon--active');\r\n if (sidebar_toggle.hasClass('icon--active')) {\r\n body.css('overflow', 'hidden');\r\n } else {\r\n body.css('overflow', '');\r\n }\r\n\r\n $('#topSidebar .sidebar').toggleClass('sidebar-width');\r\n $('#mainContent').toggleClass('sidebar-margin-left');\r\n $(this).addClass('animated ' + animation).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {\r\n $(this).removeClass('animated ' + animation);\r\n });\r\n });\r\n\r\n $('.sidebar-overlay').on('click', function () {\r\n $('.header-controller .icon').click();\r\n });\r\n}", "title": "" }, { "docid": "85ab1fcbc3e1649e362162bd3adfa52e", "score": "0.53858995", "text": "function displayController() {\n //searchbar event listener\n const searchbar = document.getElementById('searchbar');\n searchbar.addEventListener(\"keyup\", e => {\n const searchString = e.target.value;\n searchEvent(searchString);\n });\n //modal event listeners\n const addNewButton = document.querySelector('.addnew-button');\n addNewButton.addEventListener('click', () => {\n isEdit = false;\n showModal();\n });\n\n document.querySelector('.close-modal').addEventListener('click', () => {\n resetForm();\n closeModal();\n });\n\n //details event listener\n document.querySelector('.close-details').addEventListener('click', closeDetails);\n\n //store colour chosen by adding class on div\n let colours = document.querySelector('.colour-div').childNodes;\n colours.forEach(colour => {\n colour.addEventListener('click', () => {\n resetColour();\n colour.classList.add('selected');\n });\n });\n //add new todo and render list of recently added\n document.querySelector('.form').addEventListener('submit', (e) => {\n addEditTodo(e, isEdit, objTarget);\n })\n\n}", "title": "" }, { "docid": "c1cfd98c4a3d346c0763a119813693da", "score": "0.5385757", "text": "function Controller() {\n \n }", "title": "" }, { "docid": "9e3a727ed27a0d398ee11b883253076b", "score": "0.5377033", "text": "function addClick() {\r\n}", "title": "" }, { "docid": "57575da67da30d7e6ba02d72507d2a71", "score": "0.537509", "text": "handleClick() {\n alert('hello')\n }", "title": "" }, { "docid": "c1226bef05b737178832f7751fbfed85", "score": "0.5369794", "text": "function MainCtrl() {\n\n }", "title": "" }, { "docid": "5d8ec340929e625b61d97bf621e963bb", "score": "0.5369065", "text": "clickListener() {\r\n document.querySelector('.cat').onclick = function() {\r\n model.activeCat.click++; // increment click count\r\n view.displayClick(); // update click value on screen\r\n view.clickFresh(); // update click value in admin form\r\n };\r\n }", "title": "" }, { "docid": "ec1597976ce54f6329df070474fa3327", "score": "0.5363844", "text": "function aboutController() {\n\n\n }", "title": "" }, { "docid": "eb9695e85d668d71de1ab29de5fb24bc", "score": "0.5363445", "text": "addEventHandlers() {\n\t\t$(\"#addButton\").on(\"click\",this.handleAdd);\n\t\t$(\"#cancelButton\").on(\"click\",this.handleCancel);\n\t\t$(\"#retrieveData\").on(\"click\",this.retrieveStudentDataFromServer);\n\t}", "title": "" }, { "docid": "156e4c90166f35e81eeec4a70d2a3e9f", "score": "0.5362396", "text": "function register_event_handlers()\n {\n \n \n $(\".uib_w_13\").click(function(evt)\n {\n activate_subpage(\"#uib_page_signin\"); \n });\n $(\"#go_btn\").click(function(evt)\n {\n activate_subpage(\"#uib_page_signin\"); \n });\n $(\".uib_w_27\").click(function(evt)\n {\n activate_subpage(\"#uib_page_signup\"); \n });\n $(\".uib_w_28\").click(function(evt)\n {\n activate_subpage(\"#uib_page_signin\"); \n });\n}", "title": "" }, { "docid": "8663c2b2059ee290a303e5b18e80b280", "score": "0.5352913", "text": "clickListAction() {\n return new listActions();\n }", "title": "" }, { "docid": "24b758e277ec27f15886a6520e17dfc9", "score": "0.5352368", "text": "function initializePage() {\n\n // example: $(\"#div-id\").click(functionToCall);\n //$(\".record-btn\").click(addProjectDetails); //TODO\n\n}", "title": "" }, { "docid": "a32e5573e48ba78614f77954a327b3ad", "score": "0.53484476", "text": "function handleButtons() {\n\t$('#buttons button').click(function() {\n\t\tbuttonPath($(this).data('section'))\n\t})\n}", "title": "" }, { "docid": "6d8cec0def39077c3930bb1d59cc3fdf", "score": "0.5340021", "text": "function bindClickEvents(){\n\n\t$(\".operand\").click(bindOperandClickedEvent);\n\t$(\".operator\").click(bindOperatorClickedEvent);\n\t$(\"#result\").click(bindResultClickedEvent);\n\t$(\"#clearLast\").click(clearLast);\n\t$(\"#clearAll\").click(clearAll);\n\t$(\"#toggleSign\").click(bindToggleSign);\n}", "title": "" }, { "docid": "c62258b24ce7f25d526636a80d802051", "score": "0.5338316", "text": "function onPencilClick() {\n\n}", "title": "" }, { "docid": "363a9431ff7d8325da98f3c6a74e19f4", "score": "0.5337916", "text": "function AvatarView(model, elements) {\n this._model = model;\n\n var _this = this;\n\n this.skinIncrementClicked = new Event(this);\n this.skinDecrementClicked = new Event(this);\n\n this.eyeIncrementClicked = new Event(this);\n this.eyeDecrementClicked = new Event(this);\n\n this.mouthIncrementClicked = new Event(this);\n this.mouthDecrementClicked = new Event(this);\n\n this.hairIncrementClicked = new Event(this);\n this.hairDecrementClicked = new Event(this);\n\n this.hairColourIncrementClicked = new Event(this);\n this.hairColourDecrementClicked = new Event(this);\n\n this.glassesIncrementClicked = new Event(this);\n this.glassesDecrementClicked = new Event(this);\n\n this.genderIncrementClicked = new Event(this);\n this.genderDecrementClicked = new Event(this);\n\n this.shirtIncrementClicked = new Event(this);\n this.shirtDecrementClicked = new Event(this);\n\n this.pantsIncrementClicked = new Event(this);\n this.pantsDecrementClicked = new Event(this);\n\n this.beltsIncrementClicked = new Event(this);\n this.beltsDecrementClicked = new Event(this);\n\n this.hatIncrementClicked = new Event(this);\n this.hatDecrementClicked = new Event(this);\n\n this.randomiseClicked = new Event(this);\n this.resetClicked = new Event(this)\n this.saveClicked = new Event(this)\n\n\n // attach listeners to HTML controls\n this._model._skinSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.skinDecrementClicked.notify(event)\n });\n this._model._skinSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.skinIncrementClicked.notify(event)\n });\n\n this._model._eyeSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.eyeDecrementClicked.notify(event)\n });\n this._model._eyeSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.eyeIncrementClicked.notify(event)\n });\n\n this._model._mouthSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.mouthDecrementClicked.notify(event)\n });\n this._model._mouthSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.mouthIncrementClicked.notify(event)\n });\n this._model._hairSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.hairDecrementClicked.notify(event)\n });\n this._model._hairSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.hairIncrementClicked.notify(event)\n });\n this._model._hairColourSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.hairColourDecrementClicked.notify(event)\n });\n this._model._hairColourSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.hairColourIncrementClicked.notify(event)\n });\n\n this._model._glassesSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.glassesDecrementClicked.notify(event)\n });\n this._model._glassesSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.glassesIncrementClicked.notify(event)\n });\n\n this._model._genderSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.genderIncrementClicked.notify(event)\n });\n this._model._genderSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.genderDecrementClicked.notify(event)\n });\n\n this._model._shirtSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.shirtIncrementClicked.notify(event)\n });\n this._model._shirtSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.shirtDecrementClicked.notify(event)\n });\n\n this._model._pantsSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.pantsIncrementClicked.notify(event)\n });\n this._model._pantsSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.pantsDecrementClicked.notify(event)\n });\n this._model._beltSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.beltsIncrementClicked.notify(event)\n });\n this._model._beltSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.beltsDecrementClicked.notify(event)\n });\n this._model._hatSelector.find('.selector-left').bind(\"click\", function(event) { \n _this.hatIncrementClicked.notify(event)\n });\n this._model._hatSelector.find('.selector-right').bind(\"click\", function(event) { \n _this.hatDecrementClicked.notify(event)\n });\n\n $('.btn-randomise').bind(\"click\", function(event) { \n _this.randomiseClicked.notify(event)\n })\n\n $('.btn-reset').bind(\"click\", function(event) { \n _this.resetClicked.notify(event)\n })\n\n $('.btn-save').bind(\"click\", function(event) { \n _this.saveClicked.notify(event)\n })\n}", "title": "" }, { "docid": "937b7cedc104008640f395dcd6239410", "score": "0.53342485", "text": "function register_event_handlers()\n {\n \n \n /* button #btnChamada */\n $(document).on(\"click\", \"#btnChamada\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* button #btnConversa */\n $(document).on(\"click\", \"#btnConversa\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* button #btnContato */\n $(document).on(\"click\", \"#btnContato\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* listitem Roubo */\n $(document).on(\"click\", \".uib_w_14\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* listitem É */\n $(document).on(\"click\", \".uib_w_13\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* listitem Imposto */\n $(document).on(\"click\", \".uib_w_12\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* listitem Relámpago Marquinhos */\n $(document).on(\"click\", \".uib_w_11\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* listitem Roger */\n $(document).on(\"click\", \".uib_w_10\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* listitem porno */\n $(document).on(\"click\", \".uib_w_9\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* listitem Cremosa <3 */\n $(document).on(\"click\", \".uib_w_8\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* listitem Rodofo */\n $(document).on(\"click\", \".uib_w_7\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* button #btnChamada */\n $(document).on(\"click\", \"#btnChamada\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#uib_Chamada\"); \n return false;\n });\n \n /* button #btnConversa */\n $(document).on(\"click\", \"#btnConversa\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#uib_Conversa\"); \n return false;\n });\n \n /* button #btnContato */\n $(document).on(\"click\", \"#btnContato\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#page_45_0\"); \n return false;\n });\n \n /* listitem Imposto */\n $(document).on(\"click\", \".uib_w_12\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#uib_Imposto\"); \n return false;\n });\n \n }", "title": "" }, { "docid": "3928d4225670ff4e3d4e4e1345bd5f08", "score": "0.53330916", "text": "function clicked(cmd, element){\n\n functionMap[cmd](element);\n\n}", "title": "" }, { "docid": "ad93e5091b1ede20564c55c5f19f3251", "score": "0.53311986", "text": "function IndexCtrl() {\n this.model = new IndexModel();\n this.view = new IndexView();\n\t\tvar that = this;\n\t\tthis.IndexAction = function() {\n this.initialize();\n Log(\"IndexAction's Called complete!\");\n\t\t};\n\t\tthis.bindEventHandler = function(){\n\t\t\t\tthat.view.bindEventHandler();\n\t\t\t\tthat.model.bindEventHandler();\n\t\t\t\tLog(\"点击下方的开始按钮,开始加载游戏吧!\",mfgConfig.toUserLevel);\n\t\t};\n\t\tthis.initialize = function() {\n\t\t\ttry {\n\t\t\t\tif (typeof(window.MFG) === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(AssetModel.isReadyToLoad){\n\t\t\t\t\tthis.bindEventHandler();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tMFGEvent.addEvent(mfgEvents.resDescReady,this.bindEventHandler);\n\t\t\t\t}\n\t\t\t\tthis.view.initialize();\n\t\t\t\tthis.model.initialize();\n\t\t\t} catch (e) {\n\t\t\t\tLog(e.message);\n\t\t\t}\n\t\t};\n\t\tthis.destroy = function(){\n\t\t\tthis.model.destroy();\n\t\t\tthis.view.destroy();\n\t\t};\n }", "title": "" }, { "docid": "e595aad6e5d11a3ef24b868122e3994f", "score": "0.5328498", "text": "function bindBtns() {\r\n\t// element.onevent = handler\r\n\t// this approach is old and deprecated\r\n\t/*fooBtn.onclick = foo;\r\n\tfooBtn.onclick = foo2;*/\r\n\r\n\t// modern approach :D\r\n\t// ****************************************************\r\n\t// subscribe listeners to events on given elements\r\n\t// el.addEventListener(event:string, listener:function)\r\n // ****************************************************\r\n\tfooBtn.addEventListener(\"click\", foo);\r\n\tfooBtn.addEventListener(\"click\", foo2);\r\n\r\n\tsmileyBtn.addEventListener(\"click\", changePic);\r\n\r\n reduceBtn.addEventListener(\"click\", reduceFont);\r\n normaliseBtn.addEventListener(\"click\", normaliseFont);\r\n enlargeBtn.addEventListener(\"click\", enlargeFont);\r\n redBtn.addEventListener(\"click\", makeTextRed);\r\n blackBtn.addEventListener(\"click\", makeTextBlack);\r\n moveRightBtn.addEventListener(\"click\", moveRight);\r\n moveLeftBtn.addEventListener(\"click\", moveLeft);\r\n\r\n nextBtn.addEventListener(\"click\", function(){\r\n \tmoveGallery(\"next\");\r\n });\r\n prevBtn.addEventListener(\"click\", function(){\r\n \tmoveGallery(\"prev\");\r\n });\r\n\r\n}// bindBtns", "title": "" }, { "docid": "8cdff7793808b1ca65f1381a898efc38", "score": "0.53281534", "text": "function ss$st$honorControllerBase$openLinkus(json){\n //No javascript because of invoking the native common services\n}", "title": "" }, { "docid": "c639e969f03c974e9f476bddf15b1856", "score": "0.5324333", "text": "function onClick(id) {\r\n\t// alert('On click : ' + id + ', ' + tree);\r\n\tvar klassName = tree.getUserData(id, 'klass');\r\n\tif (!id || !klassName) {\r\n\t\treturn;\r\n\t}\r\n\tloadFrames(klassName, id);\r\n}", "title": "" }, { "docid": "1ba035a7f451d1310ec160e475c98c88", "score": "0.5320731", "text": "function onClick(elm, func) { (typeof elm === 'string' ? $('#'+elm) : elm).addEventListener('click', func, false); }", "title": "" }, { "docid": "700a066df69168be4b6221f023b033fb", "score": "0.5319576", "text": "function createButtons() {\n // When the addClass1 button is pressed, add the current frame to class \"Up\"\n buttonA = select('#addClass1');\n buttonA.mousePressed(function() {\n addExample('Up');\n });\n\n // When the addClass2 button is pressed, add the current frame to class \"Right\"\n // buttonB = select('#addClass2');\n // buttonB.mousePressed(function() {\n // addExample('Right');\n // });\n\n // When the addClass3 button is pressed, add the current frame to class \"Down\"\n buttonC = select('#addClass3');\n buttonC.mousePressed(function() {\n addExample('Down');\n });\n\n // // When the addClass4 button is pressed, add the current frame to class \"Left\"\n // buttonC = select('#addClass4');\n // buttonC.mousePressed(function() {\n // addExample('Left');\n // });\n\n // Predict button\n buttonPredict = select('#buttonPredict');\n buttonPredict.mousePressed(classify);\n\n // Clear all classes button\n buttonClearAll = select('#clearAll');\n buttonClearAll.mousePressed(clearAllLabels);\n}", "title": "" }, { "docid": "3c05ac7b493cdc2a1364a51ca3ebbdf6", "score": "0.5314623", "text": "function greenBtnClicked() {\n\t//your code..\n}", "title": "" }, { "docid": "cc76dc688b7a6708a295f72f5df9ca72", "score": "0.5308251", "text": "function createOnClickEvents() {\n $('#opties').click( function(){MeerMinderOpties(); return false;} );\n $('#closedrawlocation').click( function(){$('#geocodeerresult').fadeOut('fast');} );\n $('#closedrawlocationhref').click( function(){return false;} );\n $('#searchlocationbutton').click( function(){searchLocationChanged();return false;} );\n $('#goto1').click( function() {return goTo(1); } );\n $('#goto2').click( function() {return goTo(2); } );\n $('#goto3').click( function() {return goTo(3); } );\n $('#goto4').click( function() {return goTo(4); } );\n $('#goto5').click( function() {createApiLinksAndCode();return goTo(5); } );\n $('#getpdokkaarturl').click( function() { reload_wizard_based_on_url();return false; } );\n $('#mapsize1').click( function() { pdok_api_map_resize('small'); } );\n $('#mapsize2').click( function() { pdok_api_map_resize('medium'); } );\n $('#mapsize3').click( function() { pdok_api_map_resize('big'); } );\n $('#maplayerswitcher').click( function() { setLayerSwitcherVisible($('#maplayerswitcher').is(':checked')); } );\n $('#mapzoom').click( function() { setZoomVisible($('#mapzoom').is(':checked')); } );\n $('#mapnavigation').click( function() { setNavigation($('#mapnavigation').is(':checked')); } );\n $('#mapscaleline').click( function() { setScaleLineVisible($('#mapscaleline').is(':checked')); } );\n $('#mapmouseposition').click( function() { setMousePositionVisible($('#mapmouseposition').is(':checked')); } );\n $('#mapsearch').click( function() { setMapsearchVisible($('#mapsearch').is(':checked')); } );\n $('#addpdoklayerbutton').click( function() { addPdokLayer();return false; } );\n $('#addwmslayerbutton').click( function() { addWmsLayer();return false; } );\n $('#addwmtslayerbutton').click( function() { addWmtsLayer();return false; } );\n $('#deletelayers').click( function() { api.deleteLayers();return false; } );\n $('#kmlservicelink').click( function() { api.kmlToService();return false; } );\n}", "title": "" }, { "docid": "5bf329560e61b4bc300d56ffe81718ce", "score": "0.5305497", "text": "function Click() {\n console.log(\"clicked!\");\n}", "title": "" } ]
28c4bb226648db58e819611adbcbabde
! Adapted from jQuery UI core Copyright 2014 jQuery Foundation and other contributors Released under the MIT license.
[ { "docid": "972539628b7b64da22fa601e5b997ebe", "score": "0.0", "text": "function n(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:\"a\"===n?e.href||t:t)&&a(e)}", "title": "" } ]
[ { "docid": "46deb1a5dba83a3a85230ebdcbfe4c1d", "score": "0.63611937", "text": "function jQueryUIInit() {\n createDatePickers();\n drawTabs();\n addMenuTab();\n jQueryUIStyling()\n}", "title": "" }, { "docid": "bd9ed0609261ea03af5d572046bc0eb1", "score": "0.6231279", "text": "function overrideJqueryUI()\r\n{\r\n $.widget(\"ui.dialog\", $.extend({}, $.ui.dialog.prototype, {\r\n _title: function(title) {\r\n if (!this.options.title ) {\r\n title.html(\"&#160;\");\r\n } else {\r\n title.html(this.options.title);\r\n }\r\n }\r\n }))\r\n}", "title": "" }, { "docid": "37d6e08597e7265f04eafba9f7e2d955", "score": "0.60021645", "text": "function ui() {}", "title": "" }, { "docid": "b5b90fae9f271df00665f501f5145a21", "score": "0.5716393", "text": "function setupJQueryUI() {\n // add resizability to wafer list in left info panel\n $(\"#waferList\")\n .resizable({\n handles: \"s\",\n })\n .on(\"resize\", function () {\n $(\"#elementsTree\").outerHeight($(\"#waferList\").height() - 15);\n });\n // initialize\n $(\"#elementsTree\").outerHeight($(\"#waferList\").height() - 15);\n // add resizability to routes list in left info panel\n $(\"#routesList\")\n .resizable({\n handles: \"s\",\n }).on(\"resize\", function () {\n $(\"#routesTree\").outerHeight($(\"#routesList\").height() - 15);\n });\n // initialize\n $(\"#routesTree\").outerHeight($(\"#routesList\").height() - 15);\n // route width slider\n $(\"#routeWidthSlider\")\n .slider({\n slide: function (event, ui) {\n routesOnStage.handleRouteWidthSlider(ui.value);\n },\n min: 1,\n max: 5\n });\n // initialize\n $(\"#routeWidthSlider\").slider(\"value\", 4);\n}", "title": "" }, { "docid": "7acf09e1ca93d09d6017c4d6dc516dbd", "score": "0.567276", "text": "function b(){\n// jQuery doesn't support the element.text attribute in MSIE 8\n// http://stackoverflow.com/questions/2692770/style-style-textcss-appendtohead-does-not-work-in-ie\nvar b=a('<style id=\"__dragtable_disable_text_selection__\" type=\"text/css\">body { -ms-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;user-select:none; }</style>');a(document.head).append(b),a(document.body).attr(\"onselectstart\",\"return false;\").attr(\"unselectable\",\"on\"),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.55436647", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.55436647", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.55436647", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.55436647", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.55436647", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.55436647", "text": "function UI() {}", "title": "" }, { "docid": "988bef4fa005f126c173fc8c4a8186e4", "score": "0.5510024", "text": "function hideRangeCalendar(){\n/* 97 */ \t\te.input.removeClass('visible');\n/* 98 */ \t\te.trigger.removeClass(\"clicked\");\n/* 99 */ \t\t\te.menu.removeClass('visible');\n/* 100 */ \t\t\t\n\n/* datepickerrange.js */\n\n/* 101 */ \t\t\t//evento ao fechar\n/* 102 */ \t\t\te.input.trigger(\"close\", [e.changed]); //passando flag de alteração\n/* 103 */ \t\t\t\n/* 104 */ \t\t\te.changed \t\t= false;\n/* 105 */ \t\t\te.curVal\t\t= e.input.val();\n/* 106 */ \t}", "title": "" }, { "docid": "106b1b18f25a909dfc155a51d0dcfe81", "score": "0.5504403", "text": "function UI() { }", "title": "" }, { "docid": "7ef7256f1989f4ddabec4ea8cff9dce2", "score": "0.54147923", "text": "function preventDialogInteraction() {\n $('.ui-dialog, .ui-dialog *').addClass('no-interact');\n}", "title": "" }, { "docid": "fe01c21d0100a648ea4f13e11bd8df2c", "score": "0.54128045", "text": "function showRangeCalendar(){\n/* 71 */ \t\t\tvar wasVisible \t= e.trigger.hasClass('clicked');\n/* 72 */ \t\t\te.changed \t\t= false;\n/* 73 */ \t\t\te.curVal\t\t= e.input.val();\n/* 74 */ \t\t\te.cur_start\t\t= e.i_start.val();\n/* 75 */ \t\t\te.cur_end\t\t= e.i_end.val();\n/* 76 */ \t\t\t\n/* 77 */ \t\t\te.input.removeClass('visible');\n/* 78 */ \t\t\te.menu.removeClass('visible');\n/* 79 */ \t\t\te.trigger.removeClass(\"clicked\");\n/* 80 */ \t\t\t\n/* 81 */ \t\t\tif(!wasVisible){\n/* 82 */ \t\t\t\te.input.addClass('visible');\n/* 83 */ \t\t\t\te.menu.addClass('visible');\n/* 84 */ \t\t\t\te.trigger.addClass(\"clicked\");\n/* 85 */ \t\t\t\tupdate_picks(); //atualiza picks\n/* 86 */ \t\t\t\tupdate_position(); //atualiza posição\n/* 87 */ \t\t\t\t\n/* 88 */ \t\t\t\t//evento ao abrir\n/* 89 */ \t\t\t\te.input.trigger(\"open\");\n/* 90 */ \t\t\t}\n/* 91 */ \t}", "title": "" }, { "docid": "97f7a7541e83b69fc770a196674f2f7d", "score": "0.5411405", "text": "function r(e, n) {\n\n function t(e) {\n return - 1 !== fe.containers.indexOf(e) || ae.isContainer(e)\n }\n function r(e) {\n var n = e ? \"remove\": \"add\";\n o(S, n, \"mousedown\", O),\n o(S, n, \"mouseup\", I)\n }\n function c(e) {\n var n = e ? \"remove\": \"add\";\n o(S, n, \"mousemove\", N)\n }\n function m(e) {\n var n = e ? \"remove\": \"add\";\n w[n](S, \"selectstart\", C),\n w[n](S, \"click\", C)\n }\n function h() {\n r(!0),\n I({})\n }\n function C(e) {\n ue && e.preventDefault()\n }\n function O(e) {\n ee = e.clientX,\n ne = e.clientY;\n var n = 1 !== i(e) || e.metaKey || e.ctrlKey;\n if (!n) {\n var t = e.target,\n r = T(t);\n r && (ue = r, c(), \"mousedown\" === e.type && (p(t) ? t.focus() : e.preventDefault()))\n //alert(G.getAttribute('id'))//\n }\n }\n function N(e) {\n if (ue) {\n if (0 === i(e)) return void I({});\n if (void 0 === e.clientX || e.clientX !== ee || void 0 === e.clientY || e.clientY !== ne) {\n if (ae.ignoreInputTextSelection) {\n var n = y(\"clientX\", e),\n t = y(\"clientY\", e),\n r = x.elementFromPoint(n, t);\n if (p(r)) return\n }\n var o = ue;\n c(!0),\n m(),\n P(),\n Y(o);\n var a = u(Q);\n W = y(\"pageX\", e) - a.left,\n Z = y(\"pageY\", e) - a.top,\n E.add(oe || Q, \"gu-transit\"),\n F(),\n q(e)\n }\n }\n }\n function T(e) {\n if (! (fe.dragging && G || t(e))) {\n for (var n = e; v(e) && t(v(e)) === !1;) {\n if (ae.invalid(e, n)) return;\n if (e = v(e), !e) return\n }\n var r = v(e);\n if (r && !ae.invalid(e, n)) {\n var o = ae.moves(e, r, n, g(e));\n if (o) return {\n item: e,\n source: r\n }\n }\n }\n }\n function X(e) {\n var n = T(e);\n n && Y(n)\n }\n function Y(e) {\n V(e.item, e.source) && (oe = e.item.cloneNode(!0), fe.emit(\"cloned\", oe, e.item, \"copy\")),\n J = e.source,\n Q = e.item,\n te = re = g(e.item),\n fe.dragging = !0,\n fe.emit(\"drag\", Q, J)\n }\n function B() {\n return ! 1\n }\n function P() {\n if (fe.dragging) {\n var e = oe || Q;\n L(e, v(e))\n }\n }\n function D() {\n ue = !1,\n c(!0),\n m(!0)\n }\n function I(e) {\n if (D(), fe.dragging) {\n var n = oe || Q,\n t = y(\"clientX\", e),\n r = y(\"clientY\", e),\n o = a(G, t, r),\n i = k(o, t, r);\n i && (oe && ae.copySortSource || !oe || i !== J) ? L(n, i) : ae.removeOnSpill ? R() : A()\n }\n }\n function L(e, n) {\n var t = v(e);\n oe && ae.copySortSource && n === J && t.removeChild(Q),\n j(n) ? fe.emit(\"cancel\", e, J, J) : fe.emit(\"drop\", e, n, J, re),\n M()\n\n }\n function R() {\n if (fe.dragging) {\n var e = oe || Q,\n n = v(e);\n n && n.removeChild(e),\n fe.emit(oe ? \"cancel\": \"remove\", e, n, J),\n M()\n }\n }\n function A(e) {\n if (fe.dragging) {\n var n = arguments.length > 0 ? e: ae.revertOnSpill,\n t = oe || Q,\n r = v(t);\n r === J && oe && r.removeChild(oe);\n var o = j(r);\n o === !1 && !oe && n && J.insertBefore(t, te),\n o || n ? fe.emit(\"cancel\", t, J, J) : fe.emit(\"drop\", t, r, J, re),\n M()\n\n }\n }\n function M() {\n var e = oe || Q;\n D(),\n K(),\n e && E.rm(e, \"gu-transit\"),\n ie && clearTimeout(ie),\n fe.dragging = !1,\n ce && fe.emit(\"out\", e, ce, J),\n fe.emit(\"dragend\", e),\n J = Q = oe = te = re = ie = ce = null\n }\n function j(e, n) {\n var t;\n return t = void 0 !== n ? n: G ? re: g(oe || Q),\n e === J && t === te\n }\n function k(e, n, r) {\n function o() {\n var o = t(i);\n if (o === !1) return ! 1;\n var u = z(i, e),\n c = H(i, u, n, r),\n a = j(i, c);\n return a ? !0 : ae.accepts(Q, i, J, c)\n }\n for (var i = e; i && !o();) i = v(i);\n return i\n }\n function q(e) {\n function n(e) {\n fe.emit(e, f, ce, J)\n }\n function t() {\n s && n(\"over\")\n }\n function r() {\n ce && n(\"out\")\n }\n if (G) {\n e.preventDefault();\n var o = y(\"clientX\", e),\n i = y(\"clientY\", e),\n u = o - W,\n c = i - Z;\n G.style.left = u + \"px\",\n G.style.top = c + \"px\";\n var f = oe || Q,\n l = a(G, o, i),\n d = k(l, o, i),\n s = null !== d && d !== ce; (s || null === d) && (r(), ce = d, t());\n var p = v(f);\n if (d === J && oe && !ae.copySortSource) return void(p && p.removeChild(f));\n var m, h = z(d, l);\n if (null !== h) m = H(d, h, o, i);\n else {\n if (ae.revertOnSpill !== !0 || oe) return void(oe && p && p.removeChild(f));\n m = te,\n d = J\n } (null === m && s || m !== f && m !== g(f) && m !== re) && (re = m, d.insertBefore(f, m), fe.emit(\"shadow\", f, d, J))\n }\n }\n function U(e) {\n E.rm(e, \"gu-hide\")\n }\n function _(e) {\n fe.dragging && E.add(e, \"gu-hide\")\n }\n function F() {\n if (!G) {\n var e = Q.getBoundingClientRect();\n G = Q.cloneNode(!0),\n G.style.width = d(e) + \"px\",\n G.style.height = s(e) + \"px\",\n E.rm(G, \"gu-transit\"),\n E.add(G, \"gu-mirror\"),\n ae.mirrorContainer.appendChild(G),\n o(S, \"add\", \"mousemove\", q),\n E.add(ae.mirrorContainer, \"gu-unselectable\"),\n fe.emit(\"cloned\", G, Q, \"mirror\")\n }\n window.old_status_id = document.getElementById(G.getAttribute('id')).parentNode.getAttribute('status_id')//\n window.old_status_name = document.getElementById(G.getAttribute('id')).parentNode.getAttribute('status_name')//\n }\n\n function K() {//2016/09/21 lly\n var task_id = G.getAttribute('id');//\n var new_status_id = document.getElementById(task_id).parentNode.getAttribute('status_id')//\n G && (E.rm(ae.mirrorContainer, \"gu-unselectable\"), o(S, \"remove\", \"mousemove\", q), v(G).removeChild(G), G = null)\n if(old_status_id!=new_status_id){//\n document.getElementById('change_task_status').value=task_id;\n document.getElementById('change_task_status').setAttribute('old_status_name',old_status_name);\n document.getElementById('change_task_status').click();\n }\n }\n function z(e, n) {\n for (var t = n; t !== e && v(t) !== e;) t = v(t);\n return t === S ? null: t\n }\n function H(e, n, t, r) {\n function o() {\n var n, o, i, u = e.children.length;\n for (n = 0; u > n; n++) {\n if (o = e.children[n], i = o.getBoundingClientRect(), c && i.left > t) return o;\n if (!c && i.top > r) return o\n }\n return null\n }\n function i() {\n var e = n.getBoundingClientRect();\n return u(c ? t > e.left + d(e) / 2 : r > e.top + s(e) / 2)\n }\n function u(e) {\n return e ? g(n) : n\n }\n var c = \"horizontal\" === ae.direction,\n a = n !== e ? i() : o();\n\n return a\n }\n function V(e, n) {\n return \"boolean\" == typeof ae.copy ? ae.copy: ae.copy(e, n)\n }\n var $ = arguments.length;\n 1 === $ && Array.isArray(e) === !1 && (n = e, e = []);\n var G, J, Q, W, Z, ee, ne, te, re, oe, ie, ue, ce = null,\n ae = n || {};\n void 0 === ae.moves && (ae.moves = l),\n void 0 === ae.accepts && (ae.accepts = l),\n void 0 === ae.invalid && (ae.invalid = B),\n void 0 === ae.containers && (ae.containers = e || []),\n void 0 === ae.isContainer && (ae.isContainer = f),\n void 0 === ae.copy && (ae.copy = !1),\n void 0 === ae.copySortSource && (ae.copySortSource = !1),\n void 0 === ae.revertOnSpill && (ae.revertOnSpill = !1),\n void 0 === ae.removeOnSpill && (ae.removeOnSpill = !1),\n void 0 === ae.direction && (ae.direction = \"vertical\"),\n void 0 === ae.ignoreInputTextSelection && (ae.ignoreInputTextSelection = !0),\n void 0 === ae.mirrorContainer && (ae.mirrorContainer = x.body);\n var fe = b({\n containers: ae.containers,\n start: X,\n end: P,\n cancel: A,\n remove: R,\n destroy: h,\n dragging: !1\n });\n return ae.removeOnSpill === !0 && fe.on(\"over\", U).on(\"out\", _),\n r(),\n fe\n }", "title": "" }, { "docid": "1fb239cd182b44d61be3971e6b42169e", "score": "0.539053", "text": "function updateUI() {\n $.when(el.jq.css('position'), el.jq.css('z-index')).then(function(position, zIndex) {\n self.update({\n left: $('#vwo-move-x').val(),\n top: $('#vwo-move-y').val(),\n position: position,\n zIndex: zIndex\n }, true);\n });\n }", "title": "" }, { "docid": "43157c986264d46bf8ac71f55cffc0e0", "score": "0.5352499", "text": "function onSelect(){\r\n\tvar sel = timeline.getSelection();\r\n\tif(sel.length){\r\n\t\tif(sel[0].row != undefined){\r\n\t\t\tvar row = sel[0].row;\r\n\t\t\tvar element = bigData[row+1];\r\n\t\t\t$(\"#dialog\").html(\"<img src='\"+ element.original+\"'/>\");\r\n\t\t\t$(\"#dialog\").dialog( \"option\", { title: element.description } );\r\n\t\t\t$(\"#dialog\").dialog(\"open\");\r\n\t\t\t$(\"#dialog\").dialog(\"moveToTop\");\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "ba489b8bb134cec5cd905b12ac54ec55", "score": "0.534097", "text": "function UI(){}", "title": "" }, { "docid": "ba489b8bb134cec5cd905b12ac54ec55", "score": "0.534097", "text": "function UI(){}", "title": "" }, { "docid": "ba489b8bb134cec5cd905b12ac54ec55", "score": "0.534097", "text": "function UI(){}", "title": "" }, { "docid": "41285dab7e7c01f9712bba82b2aae223", "score": "0.5328404", "text": "mousedown() { }", "title": "" }, { "docid": "97e43ea2139089205161d6b7de1c78d2", "score": "0.53264713", "text": "function loadUIControls() {\n jQuery(function () {\n jQuery(\"#locationCheck\").button();\n jQuery(\"#downloadLinkContainer\").draggable();\n jQuery(\"#rerunlast\").button().click(function () {\n scaleImage('Document');\n return false;\n })\n .next()\n .button({\n text: false,\n icons: {\n primary: \"ui-icon-triangle-1-s\"\n }\n })\n .click(function () {\n var menu = jQuery(this).parent().next().show().position({\n my: \"left top\",\n at: \"left bottom\",\n of: this\n });\n\n jQuery(document).one(\"click\", function () {\n menu.hide();\n });\n\n return false;\n })\n .parent()\n .buttonset()\n .next()\n .hide()\n .menu();\n\n jQuery(\"#ctl00_onetidHeadbnnr2\").attr('src', '../Images/AppIcon.png');\n jQuery(\"#ctl00_onetidHeadbnnr2\").removeClass('ms-siteicon-img');\n jQuery(\"#ctl00_onetidHeadbnnr2\").width(80);\n });\n}", "title": "" }, { "docid": "212b98704819666f0d9ce6032ea7472d", "score": "0.5298517", "text": "appendTo(container) { container.append(this.ui); }", "title": "" }, { "docid": "201749622fe4f2d39e1d766d2e18177f", "score": "0.52737", "text": "function updateUI() {\n $.when(el.jq.css('position'), el.jq.css('display'), el.jq.css('z-index'), el.jq.width(), el.jq.outerWidth(), el.jq.height(), el.jq.outerHeight(), el.jq.css('box-sizing')).then(function(position, display, zIndex, width, outerWidth, height, outerHeight, boxSizing) {\n var diffH = outerHeight - height\n , diffW = outerWidth - width;\n\n if (boxSizing === 'border-box') {\n diffH = diffW = 0;\n }\n\n height = $('#vwo-resize-height').val().replace(/-?([\\d]*)/, (parseInt($('#vwo-resize-height').val(), 10) || 0) - diffH);\n width = $('#vwo-resize-width').val().replace(/-?([\\d]*)/, (parseInt($('#vwo-resize-width').val(), 10) || 0) - diffW);\n\n var smartUpdate = {\n left: $('#vwo-move-x').val(),\n top: $('#vwo-move-y').val(),\n height: height,\n width: width,\n zIndex: zIndex,\n position: (position === 'static' ? 'relative' : position),\n display: display\n };\n\n if (el.tag !== 'IMG') {\n if (parseInt(height, 10) === parseInt(el.uiParams.height, 10)) {\n delete smartUpdate.height;\n }\n\n if (parseInt(width, 10) === parseInt(el.uiParams.width, 10)) {\n delete smartUpdate.width;\n }\n }\n\n self.update(smartUpdate, true);\n });\n }", "title": "" }, { "docid": "d809c39fe7feb53f4623b556db046860", "score": "0.52644676", "text": "function JCb(){ var mCb; mCb = document.getElementById('rwDrag').style; if (mCb == null) { return; } if(!Sca) { var x; var y; if(typeof(eba_override_x) !='undefined'&& typeof(eba_override_y) !='undefined') { x = eba_override_x; y = eba_override_y; } else { var wd = rw_getDisplayWidth(); var ht = rw_getDisplayHeight(); if(Nca) { pea = 1; qea = 0; lea = 0; } x = wd * pea; y = ht * qea; if ((x + sea + lea) > rw_getDisplayWidthAdjusted()) { x = rw_getDisplayWidthAdjusted() - sea - lea; } if (x < lea) { x = lea; } if ((y + tea + lea) > rw_getDisplayHeightAdjusted()) { y = rw_getDisplayHeightAdjusted() - tea - lea; } if (y < lea) { y = lea; } x = rw_getScreenOffsetLeft() + x; y = rw_getScreenOffsetTop() + y; if(Nca) { y = 0; } } mCb.left = x +'px'; mCb.top = y +'px'; } if(xca) { return; } mCb.visibility ='visible'; mCb.display =\"inline\"; var Vhb = document.getElementById(\"rwMainOutline\"); if(Vhb != null) { Vhb.style.visibility ='visible'; Vhb.style.display =\"block\"; } Vhb = document.getElementById(\"rwMainNoOutline\"); if(Vhb != null) { Vhb.style.visibility ='visible'; Vhb.style.display =\"block\"; }}", "title": "" }, { "docid": "202a0de420e66225d01b300710e64381", "score": "0.52540064", "text": "uiEvtMouseInPerformed() {\r\n return false;\r\n }", "title": "" }, { "docid": "202a0de420e66225d01b300710e64381", "score": "0.52540064", "text": "uiEvtMouseInPerformed() {\r\n return false;\r\n }", "title": "" }, { "docid": "56bc68542417d2aa5e73070a2dbcedd2", "score": "0.5227735", "text": "function UI() {} // Empty function, everything else will go inside the prototype", "title": "" }, { "docid": "563f442bd19591205474985984e2500a", "score": "0.5225201", "text": "function dragStartInnerHandler(event) {\n old_data = $(\".drop\").contents().find(\"body\").clone();\n $('#select-box').css({\n visibility: 'hidden',\n });\n $('#select-box #drag-content').css({\n visibility: 'visible',\n });\n\n $(selectTarget).css({\n display: 'none',\n });\n }", "title": "" }, { "docid": "2aff363d05786b1ab546922bd46f3759", "score": "0.5221373", "text": "function loadJQueryPlugins($) {\n //requireJS, these are not the plugins you are looking for\n //TRUST ME. THIS IS GOOD. PLEASE DON'T REMOVE THIS.\n var define = undefined;\n\n /*! jQuery UI - v1.10.4 - 2015-07-10\n * http://jqueryui.com\n * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.sortable.js, jquery.ui.slider.js\n * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */\n\n if (HawkSearch.loadPlugins.jQueryUI == true) {\n (function (e, t) { function i(t, i) { var n, a, o, r = t.nodeName.toLowerCase(); return \"area\" === r ? (n = t.parentNode, a = n.name, t.href && a && \"map\" === n.nodeName.toLowerCase() ? (o = e(\"img[usemap=#\" + a + \"]\")[0], !!o && s(o)) : !1) : (/input|select|textarea|button|object/.test(r) ? !t.disabled : \"a\" === r ? t.href || i : i) && s(t) } function s(t) { return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function () { return \"hidden\" === e.css(this, \"visibility\") }).length } var n = 0, a = /^ui-id-\\d+$/; e.ui = e.ui || {}, e.extend(e.ui, { version: \"1.10.4\", keyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 } }), e.fn.extend({ focus: function (t) { return function (i, s) { return \"number\" == typeof i ? this.each(function () { var t = this; setTimeout(function () { e(t).focus(), s && s.call(t) }, i) }) : t.apply(this, arguments) } }(e.fn.focus), scrollParent: function () { var t; return t = e.ui.ie && /(static|relative)/.test(this.css(\"position\")) || /absolute/.test(this.css(\"position\")) ? this.parents().filter(function () { return /(relative|absolute|fixed)/.test(e.css(this, \"position\")) && /(auto|scroll)/.test(e.css(this, \"overflow\") + e.css(this, \"overflow-y\") + e.css(this, \"overflow-x\")) }).eq(0) : this.parents().filter(function () { return /(auto|scroll)/.test(e.css(this, \"overflow\") + e.css(this, \"overflow-y\") + e.css(this, \"overflow-x\")) }).eq(0), /fixed/.test(this.css(\"position\")) || !t.length ? e(document) : t }, zIndex: function (i) { if (i !== t) return this.css(\"zIndex\", i); if (this.length) for (var s, n, a = e(this[0]); a.length && a[0] !== document;) { if (s = a.css(\"position\"), (\"absolute\" === s || \"relative\" === s || \"fixed\" === s) && (n = parseInt(a.css(\"zIndex\"), 10), !isNaN(n) && 0 !== n)) return n; a = a.parent() } return 0 }, uniqueId: function () { return this.each(function () { this.id || (this.id = \"ui-id-\" + ++n) }) }, removeUniqueId: function () { return this.each(function () { a.test(this.id) && e(this).removeAttr(\"id\") }) } }), e.extend(e.expr[\":\"], { data: e.expr.createPseudo ? e.expr.createPseudo(function (t) { return function (i) { return !!e.data(i, t) } }) : function (t, i, s) { return !!e.data(t, s[3]) }, focusable: function (t) { return i(t, !isNaN(e.attr(t, \"tabindex\"))) }, tabbable: function (t) { var s = e.attr(t, \"tabindex\"), n = isNaN(s); return (n || s >= 0) && i(t, !n) } }), e(\"<a>\").outerWidth(1).jquery || e.each([\"Width\", \"Height\"], function (i, s) { function n(t, i, s, n) { return e.each(a, function () { i -= parseFloat(e.css(t, \"padding\" + this)) || 0, s && (i -= parseFloat(e.css(t, \"border\" + this + \"Width\")) || 0), n && (i -= parseFloat(e.css(t, \"margin\" + this)) || 0) }), i } var a = \"Width\" === s ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"], o = s.toLowerCase(), r = { innerWidth: e.fn.innerWidth, innerHeight: e.fn.innerHeight, outerWidth: e.fn.outerWidth, outerHeight: e.fn.outerHeight }; e.fn[\"inner\" + s] = function (i) { return i === t ? r[\"inner\" + s].call(this) : this.each(function () { e(this).css(o, n(this, i) + \"px\") }) }, e.fn[\"outer\" + s] = function (t, i) { return \"number\" != typeof t ? r[\"outer\" + s].call(this, t) : this.each(function () { e(this).css(o, n(this, t, !0, i) + \"px\") }) } }), e.fn.addBack || (e.fn.addBack = function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) }), e(\"<a>\").data(\"a-b\", \"a\").removeData(\"a-b\").data(\"a-b\") && (e.fn.removeData = function (t) { return function (i) { return arguments.length ? t.call(this, e.camelCase(i)) : t.call(this) } }(e.fn.removeData)), e.ui.ie = !!/msie [\\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = \"onselectstart\" in document.createElement(\"div\"), e.fn.extend({ disableSelection: function () { return this.bind((e.support.selectstart ? \"selectstart\" : \"mousedown\") + \".ui-disableSelection\", function (e) { e.preventDefault() }) }, enableSelection: function () { return this.unbind(\".ui-disableSelection\") } }), e.extend(e.ui, { plugin: { add: function (t, i, s) { var n, a = e.ui[t].prototype; for (n in s) a.plugins[n] = a.plugins[n] || [], a.plugins[n].push([i, s[n]]) }, call: function (e, t, i) { var s, n = e.plugins[t]; if (n && e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType) for (s = 0; n.length > s; s++) e.options[n[s][0]] && n[s][1].apply(e.element, i) } }, hasScroll: function (t, i) { if (\"hidden\" === e(t).css(\"overflow\")) return !1; var s = i && \"left\" === i ? \"scrollLeft\" : \"scrollTop\", n = !1; return t[s] > 0 ? !0 : (t[s] = 1, n = t[s] > 0, t[s] = 0, n) } }) })(jQuery); (function (e, t) { var i = 0, s = Array.prototype.slice, n = e.cleanData; e.cleanData = function (t) { for (var i, s = 0; null != (i = t[s]); s++) try { e(i).triggerHandler(\"remove\") } catch (a) { } n(t) }, e.widget = function (i, s, n) { var a, o, r, h, l = {}, u = i.split(\".\")[0]; i = i.split(\".\")[1], a = u + \"-\" + i, n || (n = s, s = e.Widget), e.expr[\":\"][a.toLowerCase()] = function (t) { return !!e.data(t, a) }, e[u] = e[u] || {}, o = e[u][i], r = e[u][i] = function (e, i) { return this._createWidget ? (arguments.length && this._createWidget(e, i), t) : new r(e, i) }, e.extend(r, o, { version: n.version, _proto: e.extend({}, n), _childConstructors: [] }), h = new s, h.options = e.widget.extend({}, h.options), e.each(n, function (i, n) { return e.isFunction(n) ? (l[i] = function () { var e = function () { return s.prototype[i].apply(this, arguments) }, t = function (e) { return s.prototype[i].apply(this, e) }; return function () { var i, s = this._super, a = this._superApply; return this._super = e, this._superApply = t, i = n.apply(this, arguments), this._super = s, this._superApply = a, i } }(), t) : (l[i] = n, t) }), r.prototype = e.widget.extend(h, { widgetEventPrefix: o ? h.widgetEventPrefix || i : i }, l, { constructor: r, namespace: u, widgetName: i, widgetFullName: a }), o ? (e.each(o._childConstructors, function (t, i) { var s = i.prototype; e.widget(s.namespace + \".\" + s.widgetName, r, i._proto) }), delete o._childConstructors) : s._childConstructors.push(r), e.widget.bridge(i, r) }, e.widget.extend = function (i) { for (var n, a, o = s.call(arguments, 1), r = 0, h = o.length; h > r; r++) for (n in o[r]) a = o[r][n], o[r].hasOwnProperty(n) && a !== t && (i[n] = e.isPlainObject(a) ? e.isPlainObject(i[n]) ? e.widget.extend({}, i[n], a) : e.widget.extend({}, a) : a); return i }, e.widget.bridge = function (i, n) { var a = n.prototype.widgetFullName || i; e.fn[i] = function (o) { var r = \"string\" == typeof o, h = s.call(arguments, 1), l = this; return o = !r && h.length ? e.widget.extend.apply(null, [o].concat(h)) : o, r ? this.each(function () { var s, n = e.data(this, a); return n ? e.isFunction(n[o]) && \"_\" !== o.charAt(0) ? (s = n[o].apply(n, h), s !== n && s !== t ? (l = s && s.jquery ? l.pushStack(s.get()) : s, !1) : t) : e.error(\"no such method '\" + o + \"' for \" + i + \" widget instance\") : e.error(\"cannot call methods on \" + i + \" prior to initialization; \" + \"attempted to call method '\" + o + \"'\") }) : this.each(function () { var t = e.data(this, a); t ? t.option(o || {})._init() : e.data(this, a, new n(o, this)) }), l } }, e.Widget = function () { }, e.Widget._childConstructors = [], e.Widget.prototype = { widgetName: \"widget\", widgetEventPrefix: \"\", defaultElement: \"<div>\", options: { disabled: !1, create: null }, _createWidget: function (t, s) { s = e(s || this.defaultElement || this)[0], this.element = e(s), this.uuid = i++ , this.eventNamespace = \".\" + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this.bindings = e(), this.hoverable = e(), this.focusable = e(), s !== this && (e.data(s, this.widgetFullName, this), this._on(!0, this.element, { remove: function (e) { e.target === s && this.destroy() } }), this.document = e(s.style ? s.ownerDocument : s.document || s), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger(\"create\", null, this._getCreateEventData()), this._init() }, _getCreateOptions: e.noop, _getCreateEventData: e.noop, _create: e.noop, _init: e.noop, destroy: function () { this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr(\"aria-disabled\").removeClass(this.widgetFullName + \"-disabled \" + \"ui-state-disabled\"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass(\"ui-state-hover\"), this.focusable.removeClass(\"ui-state-focus\") }, _destroy: e.noop, widget: function () { return this.element }, option: function (i, s) { var n, a, o, r = i; if (0 === arguments.length) return e.widget.extend({}, this.options); if (\"string\" == typeof i) if (r = {}, n = i.split(\".\"), i = n.shift(), n.length) { for (a = r[i] = e.widget.extend({}, this.options[i]), o = 0; n.length - 1 > o; o++) a[n[o]] = a[n[o]] || {}, a = a[n[o]]; if (i = n.pop(), 1 === arguments.length) return a[i] === t ? null : a[i]; a[i] = s } else { if (1 === arguments.length) return this.options[i] === t ? null : this.options[i]; r[i] = s } return this._setOptions(r), this }, _setOptions: function (e) { var t; for (t in e) this._setOption(t, e[t]); return this }, _setOption: function (e, t) { return this.options[e] = t, \"disabled\" === e && (this.widget().toggleClass(this.widgetFullName + \"-disabled ui-state-disabled\", !!t).attr(\"aria-disabled\", t), this.hoverable.removeClass(\"ui-state-hover\"), this.focusable.removeClass(\"ui-state-focus\")), this }, enable: function () { return this._setOption(\"disabled\", !1) }, disable: function () { return this._setOption(\"disabled\", !0) }, _on: function (i, s, n) { var a, o = this; \"boolean\" != typeof i && (n = s, s = i, i = !1), n ? (s = a = e(s), this.bindings = this.bindings.add(s)) : (n = s, s = this.element, a = this.widget()), e.each(n, function (n, r) { function h() { return i || o.options.disabled !== !0 && !e(this).hasClass(\"ui-state-disabled\") ? (\"string\" == typeof r ? o[r] : r).apply(o, arguments) : t } \"string\" != typeof r && (h.guid = r.guid = r.guid || h.guid || e.guid++); var l = n.match(/^(\\w+)\\s*(.*)$/), u = l[1] + o.eventNamespace, d = l[2]; d ? a.delegate(d, u, h) : s.bind(u, h) }) }, _off: function (e, t) { t = (t || \"\").split(\" \").join(this.eventNamespace + \" \") + this.eventNamespace, e.unbind(t).undelegate(t) }, _delay: function (e, t) { function i() { return (\"string\" == typeof e ? s[e] : e).apply(s, arguments) } var s = this; return setTimeout(i, t || 0) }, _hoverable: function (t) { this.hoverable = this.hoverable.add(t), this._on(t, { mouseenter: function (t) { e(t.currentTarget).addClass(\"ui-state-hover\") }, mouseleave: function (t) { e(t.currentTarget).removeClass(\"ui-state-hover\") } }) }, _focusable: function (t) { this.focusable = this.focusable.add(t), this._on(t, { focusin: function (t) { e(t.currentTarget).addClass(\"ui-state-focus\") }, focusout: function (t) { e(t.currentTarget).removeClass(\"ui-state-focus\") } }) }, _trigger: function (t, i, s) { var n, a, o = this.options[t]; if (s = s || {}, i = e.Event(i), i.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), i.target = this.element[0], a = i.originalEvent) for (n in a) n in i || (i[n] = a[n]); return this.element.trigger(i, s), !(e.isFunction(o) && o.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented()) } }, e.each({ show: \"fadeIn\", hide: \"fadeOut\" }, function (t, i) { e.Widget.prototype[\"_\" + t] = function (s, n, a) { \"string\" == typeof n && (n = { effect: n }); var o, r = n ? n === !0 || \"number\" == typeof n ? i : n.effect || i : t; n = n || {}, \"number\" == typeof n && (n = { duration: n }), o = !e.isEmptyObject(n), n.complete = a, n.delay && s.delay(n.delay), o && e.effects && e.effects.effect[r] ? s[t](n) : r !== t && s[r] ? s[r](n.duration, n.easing, a) : s.queue(function (i) { e(this)[t](), a && a.call(s[0]), i() }) } }) })(jQuery); (function (e) { var t = !1; e(document).mouseup(function () { t = !1 }), e.widget(\"ui.mouse\", { version: \"1.10.4\", options: { cancel: \"input,textarea,button,select,option\", distance: 1, delay: 0 }, _mouseInit: function () { var t = this; this.element.bind(\"mousedown.\" + this.widgetName, function (e) { return t._mouseDown(e) }).bind(\"click.\" + this.widgetName, function (i) { return !0 === e.data(i.target, t.widgetName + \".preventClickEvent\") ? (e.removeData(i.target, t.widgetName + \".preventClickEvent\"), i.stopImmediatePropagation(), !1) : undefined }), this.started = !1 }, _mouseDestroy: function () { this.element.unbind(\".\" + this.widgetName), this._mouseMoveDelegate && e(document).unbind(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).unbind(\"mouseup.\" + this.widgetName, this._mouseUpDelegate) }, _mouseDown: function (i) { if (!t) { this._mouseStarted && this._mouseUp(i), this._mouseDownEvent = i; var s = this, n = 1 === i.which, a = \"string\" == typeof this.options.cancel && i.target.nodeName ? e(i.target).closest(this.options.cancel).length : !1; return n && !a && this._mouseCapture(i) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () { s.mouseDelayMet = !0 }, this.options.delay)), this._mouseDistanceMet(i) && this._mouseDelayMet(i) && (this._mouseStarted = this._mouseStart(i) !== !1, !this._mouseStarted) ? (i.preventDefault(), !0) : (!0 === e.data(i.target, this.widgetName + \".preventClickEvent\") && e.removeData(i.target, this.widgetName + \".preventClickEvent\"), this._mouseMoveDelegate = function (e) { return s._mouseMove(e) }, this._mouseUpDelegate = function (e) { return s._mouseUp(e) }, e(document).bind(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).bind(\"mouseup.\" + this.widgetName, this._mouseUpDelegate), i.preventDefault(), t = !0, !0)) : !0 } }, _mouseMove: function (t) { return e.ui.ie && (!document.documentMode || 9 > document.documentMode) && !t.button ? this._mouseUp(t) : this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted) }, _mouseUp: function (t) { return e(document).unbind(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).unbind(\"mouseup.\" + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + \".preventClickEvent\", !0), this._mouseStop(t)), !1 }, _mouseDistanceMet: function (e) { return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return !0 } }) })(jQuery); (function (e) { function t(e, t, i) { return e > t && t + i > e } function i(e) { return /left|right/.test(e.css(\"float\")) || /inline|table-cell/.test(e.css(\"display\")) } e.widget(\"ui.sortable\", e.ui.mouse, { version: \"1.10.4\", widgetEventPrefix: \"sort\", ready: !1, options: { appendTo: \"parent\", axis: !1, connectWith: !1, containment: !1, cursor: \"auto\", cursorAt: !1, dropOnEmpty: !0, forcePlaceholderSize: !1, forceHelperSize: !1, grid: !1, handle: !1, helper: \"original\", items: \"> *\", opacity: !1, placeholder: !1, revert: !1, scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, scope: \"default\", tolerance: \"intersect\", zIndex: 1e3, activate: null, beforeStop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null }, _create: function () { var e = this.options; this.containerCache = {}, this.element.addClass(\"ui-sortable\"), this.refresh(), this.floating = this.items.length ? \"x\" === e.axis || i(this.items[0].item) : !1, this.offset = this.element.offset(), this._mouseInit(), this.ready = !0 }, _destroy: function () { this.element.removeClass(\"ui-sortable ui-sortable-disabled\"), this._mouseDestroy(); for (var e = this.items.length - 1; e >= 0; e--) this.items[e].item.removeData(this.widgetName + \"-item\"); return this }, _setOption: function (t, i) { \"disabled\" === t ? (this.options[t] = i, this.widget().toggleClass(\"ui-sortable-disabled\", !!i)) : e.Widget.prototype._setOption.apply(this, arguments) }, _mouseCapture: function (t, i) { var s = null, n = !1, a = this; return this.reverting ? !1 : this.options.disabled || \"static\" === this.options.type ? !1 : (this._refreshItems(t), e(t.target).parents().each(function () { return e.data(this, a.widgetName + \"-item\") === a ? (s = e(this), !1) : undefined }), e.data(t.target, a.widgetName + \"-item\") === a && (s = e(t.target)), s ? !this.options.handle || i || (e(this.options.handle, s).find(\"*\").addBack().each(function () { this === t.target && (n = !0) }), n) ? (this.currentItem = s, this._removeCurrentsFromItems(), !0) : !1 : !1) }, _mouseStart: function (t, i, s) { var n, a, o = this.options; if (this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(t), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, e.extend(this.offset, { click: { left: t.pageX - this.offset.left, top: t.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.helper.css(\"position\", \"absolute\"), this.cssPosition = this.helper.css(\"position\"), this.originalPosition = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt), this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), o.containment && this._setContainment(), o.cursor && \"auto\" !== o.cursor && (a = this.document.find(\"body\"), this.storedCursor = a.css(\"cursor\"), a.css(\"cursor\", o.cursor), this.storedStylesheet = e(\"<style>*{ cursor: \" + o.cursor + \" !important; }</style>\").appendTo(a)), o.opacity && (this.helper.css(\"opacity\") && (this._storedOpacity = this.helper.css(\"opacity\")), this.helper.css(\"opacity\", o.opacity)), o.zIndex && (this.helper.css(\"zIndex\") && (this._storedZIndex = this.helper.css(\"zIndex\")), this.helper.css(\"zIndex\", o.zIndex)), this.scrollParent[0] !== document && \"HTML\" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger(\"start\", t, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !s) for (n = this.containers.length - 1; n >= 0; n--) this.containers[n]._trigger(\"activate\", t, this._uiHash(this)); return e.ui.ddmanager && (e.ui.ddmanager.current = this), e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this.dragging = !0, this.helper.addClass(\"ui-sortable-helper\"), this._mouseDrag(t), !0 }, _mouseDrag: function (t) { var i, s, n, a, o = this.options, r = !1; for (this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo(\"absolute\"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== document && \"HTML\" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - t.pageY < o.scrollSensitivity ? this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop + o.scrollSpeed : t.pageY - this.overflowOffset.top < o.scrollSensitivity && (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop - o.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - t.pageX < o.scrollSensitivity ? this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft + o.scrollSpeed : t.pageX - this.overflowOffset.left < o.scrollSensitivity && (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft - o.scrollSpeed)) : (t.pageY - e(document).scrollTop() < o.scrollSensitivity ? r = e(document).scrollTop(e(document).scrollTop() - o.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < o.scrollSensitivity && (r = e(document).scrollTop(e(document).scrollTop() + o.scrollSpeed)), t.pageX - e(document).scrollLeft() < o.scrollSensitivity ? r = e(document).scrollLeft(e(document).scrollLeft() - o.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < o.scrollSensitivity && (r = e(document).scrollLeft(e(document).scrollLeft() + o.scrollSpeed))), r !== !1 && e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t)), this.positionAbs = this._convertPositionTo(\"absolute\"), this.options.axis && \"y\" === this.options.axis || (this.helper[0].style.left = this.position.left + \"px\"), this.options.axis && \"x\" === this.options.axis || (this.helper[0].style.top = this.position.top + \"px\"), i = this.items.length - 1; i >= 0; i--) if (s = this.items[i], n = s.item[0], a = this._intersectsWithPointer(s), a && s.instance === this.currentContainer && n !== this.currentItem[0] && this.placeholder[1 === a ? \"next\" : \"prev\"]()[0] !== n && !e.contains(this.placeholder[0], n) && (\"semi-dynamic\" === this.options.type ? !e.contains(this.element[0], n) : !0)) { if (this.direction = 1 === a ? \"down\" : \"up\", \"pointer\" !== this.options.tolerance && !this._intersectsWithSides(s)) break; this._rearrange(t, s), this._trigger(\"change\", t, this._uiHash()); break } return this._contactContainers(t), e.ui.ddmanager && e.ui.ddmanager.drag(this, t), this._trigger(\"sort\", t, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1 }, _mouseStop: function (t, i) { if (t) { if (e.ui.ddmanager && !this.options.dropBehaviour && e.ui.ddmanager.drop(this, t), this.options.revert) { var s = this, n = this.placeholder.offset(), a = this.options.axis, o = {}; a && \"x\" !== a || (o.left = n.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft)), a && \"y\" !== a || (o.top = n.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, e(this.helper).animate(o, parseInt(this.options.revert, 10) || 500, function () { s._clear(t) }) } else this._clear(t, i); return !1 } }, cancel: function () { if (this.dragging) { this._mouseUp({ target: null }), \"original\" === this.options.helper ? this.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\") : this.currentItem.show(); for (var t = this.containers.length - 1; t >= 0; t--) this.containers[t]._trigger(\"deactivate\", null, this._uiHash(this)), this.containers[t].containerCache.over && (this.containers[t]._trigger(\"out\", null, this._uiHash(this)), this.containers[t].containerCache.over = 0) } return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), \"original\" !== this.options.helper && this.helper && this.helper[0].parentNode && this.helper.remove(), e.extend(this, { helper: null, dragging: !1, reverting: !1, _noFinalSort: null }), this.domPosition.prev ? e(this.domPosition.prev).after(this.currentItem) : e(this.domPosition.parent).prepend(this.currentItem)), this }, serialize: function (t) { var i = this._getItemsAsjQuery(t && t.connected), s = []; return t = t || {}, e(i).each(function () { var i = (e(t.item || this).attr(t.attribute || \"id\") || \"\").match(t.expression || /(.+)[\\-=_](.+)/); i && s.push((t.key || i[1] + \"[]\") + \"=\" + (t.key && t.expression ? i[1] : i[2])) }), !s.length && t.key && s.push(t.key + \"=\"), s.join(\"&\") }, toArray: function (t) { var i = this._getItemsAsjQuery(t && t.connected), s = []; return t = t || {}, i.each(function () { s.push(e(t.item || this).attr(t.attribute || \"id\") || \"\") }), s }, _intersectsWith: function (e) { var t = this.positionAbs.left, i = t + this.helperProportions.width, s = this.positionAbs.top, n = s + this.helperProportions.height, a = e.left, o = a + e.width, r = e.top, h = r + e.height, l = this.offset.click.top, u = this.offset.click.left, d = \"x\" === this.options.axis || s + l > r && h > s + l, c = \"y\" === this.options.axis || t + u > a && o > t + u, p = d && c; return \"pointer\" === this.options.tolerance || this.options.forcePointerForContainers || \"pointer\" !== this.options.tolerance && this.helperProportions[this.floating ? \"width\" : \"height\"] > e[this.floating ? \"width\" : \"height\"] ? p : t + this.helperProportions.width / 2 > a && o > i - this.helperProportions.width / 2 && s + this.helperProportions.height / 2 > r && h > n - this.helperProportions.height / 2 }, _intersectsWithPointer: function (e) { var i = \"x\" === this.options.axis || t(this.positionAbs.top + this.offset.click.top, e.top, e.height), s = \"y\" === this.options.axis || t(this.positionAbs.left + this.offset.click.left, e.left, e.width), n = i && s, a = this._getDragVerticalDirection(), o = this._getDragHorizontalDirection(); return n ? this.floating ? o && \"right\" === o || \"down\" === a ? 2 : 1 : a && (\"down\" === a ? 2 : 1) : !1 }, _intersectsWithSides: function (e) { var i = t(this.positionAbs.top + this.offset.click.top, e.top + e.height / 2, e.height), s = t(this.positionAbs.left + this.offset.click.left, e.left + e.width / 2, e.width), n = this._getDragVerticalDirection(), a = this._getDragHorizontalDirection(); return this.floating && a ? \"right\" === a && s || \"left\" === a && !s : n && (\"down\" === n && i || \"up\" === n && !i) }, _getDragVerticalDirection: function () { var e = this.positionAbs.top - this.lastPositionAbs.top; return 0 !== e && (e > 0 ? \"down\" : \"up\") }, _getDragHorizontalDirection: function () { var e = this.positionAbs.left - this.lastPositionAbs.left; return 0 !== e && (e > 0 ? \"right\" : \"left\") }, refresh: function (e) { return this._refreshItems(e), this.refreshPositions(), this }, _connectWith: function () { var e = this.options; return e.connectWith.constructor === String ? [e.connectWith] : e.connectWith }, _getItemsAsjQuery: function (t) { function i() { r.push(this) } var s, n, a, o, r = [], h = [], l = this._connectWith(); if (l && t) for (s = l.length - 1; s >= 0; s--) for (a = e(l[s]), n = a.length - 1; n >= 0; n--) o = e.data(a[n], this.widgetFullName), o && o !== this && !o.options.disabled && h.push([e.isFunction(o.options.items) ? o.options.items.call(o.element) : e(o.options.items, o.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), o]); for (h.push([e.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : e(this.options.items, this.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), this]), s = h.length - 1; s >= 0; s--) h[s][0].each(i); return e(r) }, _removeCurrentsFromItems: function () { var t = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\"); this.items = e.grep(this.items, function (e) { for (var i = 0; t.length > i; i++) if (t[i] === e.item[0]) return !1; return !0 }) }, _refreshItems: function (t) { this.items = [], this.containers = [this]; var i, s, n, a, o, r, h, l, u = this.items, d = [[e.isFunction(this.options.items) ? this.options.items.call(this.element[0], t, { item: this.currentItem }) : e(this.options.items, this.element), this]], c = this._connectWith(); if (c && this.ready) for (i = c.length - 1; i >= 0; i--) for (n = e(c[i]), s = n.length - 1; s >= 0; s--) a = e.data(n[s], this.widgetFullName), a && a !== this && !a.options.disabled && (d.push([e.isFunction(a.options.items) ? a.options.items.call(a.element[0], t, { item: this.currentItem }) : e(a.options.items, a.element), a]), this.containers.push(a)); for (i = d.length - 1; i >= 0; i--) for (o = d[i][1], r = d[i][0], s = 0, l = r.length; l > s; s++) h = e(r[s]), h.data(this.widgetName + \"-item\", o), u.push({ item: h, instance: o, width: 0, height: 0, left: 0, top: 0 }) }, refreshPositions: function (t) { this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); var i, s, n, a; for (i = this.items.length - 1; i >= 0; i--) s = this.items[i], s.instance !== this.currentContainer && this.currentContainer && s.item[0] !== this.currentItem[0] || (n = this.options.toleranceElement ? e(this.options.toleranceElement, s.item) : s.item, t || (s.width = n.outerWidth(), s.height = n.outerHeight()), a = n.offset(), s.left = a.left, s.top = a.top); if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (i = this.containers.length - 1; i >= 0; i--) a = this.containers[i].element.offset(), this.containers[i].containerCache.left = a.left, this.containers[i].containerCache.top = a.top, this.containers[i].containerCache.width = this.containers[i].element.outerWidth(), this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); return this }, _createPlaceholder: function (t) { t = t || this; var i, s = t.options; s.placeholder && s.placeholder.constructor !== String || (i = s.placeholder, s.placeholder = { element: function () { var s = t.currentItem[0].nodeName.toLowerCase(), n = e(\"<\" + s + \">\", t.document[0]).addClass(i || t.currentItem[0].className + \" ui-sortable-placeholder\").removeClass(\"ui-sortable-helper\"); return \"tr\" === s ? t.currentItem.children().each(function () { e(\"<td>&#160;</td>\", t.document[0]).attr(\"colspan\", e(this).attr(\"colspan\") || 1).appendTo(n) }) : \"img\" === s && n.attr(\"src\", t.currentItem.attr(\"src\")), i || n.css(\"visibility\", \"hidden\"), n }, update: function (e, n) { (!i || s.forcePlaceholderSize) && (n.height() || n.height(t.currentItem.innerHeight() - parseInt(t.currentItem.css(\"paddingTop\") || 0, 10) - parseInt(t.currentItem.css(\"paddingBottom\") || 0, 10)), n.width() || n.width(t.currentItem.innerWidth() - parseInt(t.currentItem.css(\"paddingLeft\") || 0, 10) - parseInt(t.currentItem.css(\"paddingRight\") || 0, 10))) } }), t.placeholder = e(s.placeholder.element.call(t.element, t.currentItem)), t.currentItem.after(t.placeholder), s.placeholder.update(t, t.placeholder) }, _contactContainers: function (s) { var n, a, o, r, h, l, u, d, c, p, f = null, m = null; for (n = this.containers.length - 1; n >= 0; n--) if (!e.contains(this.currentItem[0], this.containers[n].element[0])) if (this._intersectsWith(this.containers[n].containerCache)) { if (f && e.contains(this.containers[n].element[0], f.element[0])) continue; f = this.containers[n], m = n } else this.containers[n].containerCache.over && (this.containers[n]._trigger(\"out\", s, this._uiHash(this)), this.containers[n].containerCache.over = 0); if (f) if (1 === this.containers.length) this.containers[m].containerCache.over || (this.containers[m]._trigger(\"over\", s, this._uiHash(this)), this.containers[m].containerCache.over = 1); else { for (o = 1e4, r = null, p = f.floating || i(this.currentItem), h = p ? \"left\" : \"top\", l = p ? \"width\" : \"height\", u = this.positionAbs[h] + this.offset.click[h], a = this.items.length - 1; a >= 0; a--) e.contains(this.containers[m].element[0], this.items[a].item[0]) && this.items[a].item[0] !== this.currentItem[0] && (!p || t(this.positionAbs.top + this.offset.click.top, this.items[a].top, this.items[a].height)) && (d = this.items[a].item.offset()[h], c = !1, Math.abs(d - u) > Math.abs(d + this.items[a][l] - u) && (c = !0, d += this.items[a][l]), o > Math.abs(d - u) && (o = Math.abs(d - u), r = this.items[a], this.direction = c ? \"up\" : \"down\")); if (!r && !this.options.dropOnEmpty) return; if (this.currentContainer === this.containers[m]) return; r ? this._rearrange(s, r, null, !0) : this._rearrange(s, null, this.containers[m].element, !0), this._trigger(\"change\", s, this._uiHash()), this.containers[m]._trigger(\"change\", s, this._uiHash(this)), this.currentContainer = this.containers[m], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[m]._trigger(\"over\", s, this._uiHash(this)), this.containers[m].containerCache.over = 1 } }, _createHelper: function (t) { var i = this.options, s = e.isFunction(i.helper) ? e(i.helper.apply(this.element[0], [t, this.currentItem])) : \"clone\" === i.helper ? this.currentItem.clone() : this.currentItem; return s.parents(\"body\").length || e(\"parent\" !== i.appendTo ? i.appendTo : this.currentItem[0].parentNode)[0].appendChild(s[0]), s[0] === this.currentItem[0] && (this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css(\"position\"), top: this.currentItem.css(\"top\"), left: this.currentItem.css(\"left\") }), (!s[0].style.width || i.forceHelperSize) && s.width(this.currentItem.width()), (!s[0].style.height || i.forceHelperSize) && s.height(this.currentItem.height()), s }, _adjustOffsetFromHelper: function (t) { \"string\" == typeof t && (t = t.split(\" \")), e.isArray(t) && (t = { left: +t[0], top: +t[1] || 0 }), \"left\" in t && (this.offset.click.left = t.left + this.margins.left), \"right\" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), \"top\" in t && (this.offset.click.top = t.top + this.margins.top), \"bottom\" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var t = this.offsetParent.offset(); return \"absolute\" === this.cssPosition && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && \"html\" === this.offsetParent[0].tagName.toLowerCase() && e.ui.ie) && (t = { top: 0, left: 0 }), { top: t.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"), 10) || 0), left: t.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"), 10) || 0) } }, _getRelativeOffset: function () { if (\"relative\" === this.cssPosition) { var e = this.currentItem.position(); return { top: e.top - (parseInt(this.helper.css(\"top\"), 10) || 0) + this.scrollParent.scrollTop(), left: e.left - (parseInt(this.helper.css(\"left\"), 10) || 0) + this.scrollParent.scrollLeft() } } return { top: 0, left: 0 } }, _cacheMargins: function () { this.margins = { left: parseInt(this.currentItem.css(\"marginLeft\"), 10) || 0, top: parseInt(this.currentItem.css(\"marginTop\"), 10) || 0 } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () { var t, i, s, n = this.options; \"parent\" === n.containment && (n.containment = this.helper[0].parentNode), (\"document\" === n.containment || \"window\" === n.containment) && (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, e(\"document\" === n.containment ? document : window).width() - this.helperProportions.width - this.margins.left, (e(\"document\" === n.containment ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(n.containment) || (t = e(n.containment)[0], i = e(n.containment).offset(), s = \"hidden\" !== e(t).css(\"overflow\"), this.containment = [i.left + (parseInt(e(t).css(\"borderLeftWidth\"), 10) || 0) + (parseInt(e(t).css(\"paddingLeft\"), 10) || 0) - this.margins.left, i.top + (parseInt(e(t).css(\"borderTopWidth\"), 10) || 0) + (parseInt(e(t).css(\"paddingTop\"), 10) || 0) - this.margins.top, i.left + (s ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) - (parseInt(e(t).css(\"borderLeftWidth\"), 10) || 0) - (parseInt(e(t).css(\"paddingRight\"), 10) || 0) - this.helperProportions.width - this.margins.left, i.top + (s ? Math.max(t.scrollHeight, t.offsetHeight) : t.offsetHeight) - (parseInt(e(t).css(\"borderTopWidth\"), 10) || 0) - (parseInt(e(t).css(\"paddingBottom\"), 10) || 0) - this.helperProportions.height - this.margins.top]) }, _convertPositionTo: function (t, i) { i || (i = this.position); var s = \"absolute\" === t ? 1 : -1, n = \"absolute\" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, a = /(html|body)/i.test(n[0].tagName); return { top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollTop() : a ? 0 : n.scrollTop()) * s, left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollLeft() : a ? 0 : n.scrollLeft()) * s } }, _generatePosition: function (t) { var i, s, n = this.options, a = t.pageX, o = t.pageY, r = \"absolute\" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, h = /(html|body)/i.test(r[0].tagName); return \"relative\" !== this.cssPosition || this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (t.pageX - this.offset.click.left < this.containment[0] && (a = this.containment[0] + this.offset.click.left), t.pageY - this.offset.click.top < this.containment[1] && (o = this.containment[1] + this.offset.click.top), t.pageX - this.offset.click.left > this.containment[2] && (a = this.containment[2] + this.offset.click.left), t.pageY - this.offset.click.top > this.containment[3] && (o = this.containment[3] + this.offset.click.top)), n.grid && (i = this.originalPageY + Math.round((o - this.originalPageY) / n.grid[1]) * n.grid[1], o = this.containment ? i - this.offset.click.top >= this.containment[1] && i - this.offset.click.top <= this.containment[3] ? i : i - this.offset.click.top >= this.containment[1] ? i - n.grid[1] : i + n.grid[1] : i, s = this.originalPageX + Math.round((a - this.originalPageX) / n.grid[0]) * n.grid[0], a = this.containment ? s - this.offset.click.left >= this.containment[0] && s - this.offset.click.left <= this.containment[2] ? s : s - this.offset.click.left >= this.containment[0] ? s - n.grid[0] : s + n.grid[0] : s)), { top: o - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollTop() : h ? 0 : r.scrollTop()), left: a - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollLeft() : h ? 0 : r.scrollLeft()) } }, _rearrange: function (e, t, i, s) { i ? i[0].appendChild(this.placeholder[0]) : t.item[0].parentNode.insertBefore(this.placeholder[0], \"down\" === this.direction ? t.item[0] : t.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1; var n = this.counter; this._delay(function () { n === this.counter && this.refreshPositions(!s) }) }, _clear: function (e, t) { function i(e, t, i) { return function (s) { i._trigger(e, s, t._uiHash(t)) } } this.reverting = !1; var s, n = []; if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) { for (s in this._storedCSS) (\"auto\" === this._storedCSS[s] || \"static\" === this._storedCSS[s]) && (this._storedCSS[s] = \"\"); this.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\") } else this.currentItem.show(); for (this.fromOutside && !t && n.push(function (e) { this._trigger(\"receive\", e, this._uiHash(this.fromOutside)) }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(\".ui-sortable-helper\")[0] && this.domPosition.parent === this.currentItem.parent()[0] || t || n.push(function (e) { this._trigger(\"update\", e, this._uiHash()) }), this !== this.currentContainer && (t || (n.push(function (e) { this._trigger(\"remove\", e, this._uiHash()) }), n.push(function (e) { return function (t) { e._trigger(\"receive\", t, this._uiHash(this)) } }.call(this, this.currentContainer)), n.push(function (e) { return function (t) { e._trigger(\"update\", t, this._uiHash(this)) } }.call(this, this.currentContainer)))), s = this.containers.length - 1; s >= 0; s--) t || n.push(i(\"deactivate\", this, this.containers[s])), this.containers[s].containerCache.over && (n.push(i(\"out\", this, this.containers[s])), this.containers[s].containerCache.over = 0); if (this.storedCursor && (this.document.find(\"body\").css(\"cursor\", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css(\"opacity\", this._storedOpacity), this._storedZIndex && this.helper.css(\"zIndex\", \"auto\" === this._storedZIndex ? \"\" : this._storedZIndex), this.dragging = !1, this.cancelHelperRemoval) { if (!t) { for (this._trigger(\"beforeStop\", e, this._uiHash()), s = 0; n.length > s; s++) n[s].call(this, e); this._trigger(\"stop\", e, this._uiHash()) } return this.fromOutside = !1, !1 } if (t || this._trigger(\"beforeStop\", e, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null, !t) { for (s = 0; n.length > s; s++) n[s].call(this, e); this._trigger(\"stop\", e, this._uiHash()) } return this.fromOutside = !1, !0 }, _trigger: function () { e.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() }, _uiHash: function (t) { var i = t || this; return { helper: i.helper, placeholder: i.placeholder || e([]), position: i.position, originalPosition: i.originalPosition, offset: i.positionAbs, item: i.currentItem, sender: t ? t.element : null } } }) })(jQuery); (function (e) { var t = 5; e.widget(\"ui.slider\", e.ui.mouse, { version: \"1.10.4\", widgetEventPrefix: \"slide\", options: { animate: !1, distance: 0, max: 100, min: 0, orientation: \"horizontal\", range: !1, step: 1, value: 0, values: null, change: null, slide: null, start: null, stop: null }, _create: function () { this._keySliding = !1, this._mouseSliding = !1, this._animateOff = !0, this._handleIndex = null, this._detectOrientation(), this._mouseInit(), this.element.addClass(\"ui-slider ui-slider-\" + this.orientation + \" ui-widget\" + \" ui-widget-content\" + \" ui-corner-all\"), this._refresh(), this._setOption(\"disabled\", this.options.disabled), this._animateOff = !1 }, _refresh: function () { this._createRange(), this._createHandles(), this._setupEvents(), this._refreshValue() }, _createHandles: function () { var t, i, s = this.options, n = this.element.find(\".ui-slider-handle\").addClass(\"ui-state-default ui-corner-all\"), a = \"<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>\", o = []; for (i = s.values && s.values.length || 1, n.length > i && (n.slice(i).remove(), n = n.slice(0, i)), t = n.length; i > t; t++) o.push(a); this.handles = n.add(e(o.join(\"\")).appendTo(this.element)), this.handle = this.handles.eq(0), this.handles.each(function (t) { e(this).data(\"ui-slider-handle-index\", t) }) }, _createRange: function () { var t = this.options, i = \"\"; t.range ? (t.range === !0 && (t.values ? t.values.length && 2 !== t.values.length ? t.values = [t.values[0], t.values[0]] : e.isArray(t.values) && (t.values = t.values.slice(0)) : t.values = [this._valueMin(), this._valueMin()]), this.range && this.range.length ? this.range.removeClass(\"ui-slider-range-min ui-slider-range-max\").css({ left: \"\", bottom: \"\" }) : (this.range = e(\"<div></div>\").appendTo(this.element), i = \"ui-slider-range ui-widget-header ui-corner-all\"), this.range.addClass(i + (\"min\" === t.range || \"max\" === t.range ? \" ui-slider-range-\" + t.range : \"\"))) : (this.range && this.range.remove(), this.range = null) }, _setupEvents: function () { var e = this.handles.add(this.range).filter(\"a\"); this._off(e), this._on(e, this._handleEvents), this._hoverable(e), this._focusable(e) }, _destroy: function () { this.handles.remove(), this.range && this.range.remove(), this.element.removeClass(\"ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all\"), this._mouseDestroy() }, _mouseCapture: function (t) { var i, s, n, a, o, r, h, l, u = this, d = this.options; return d.disabled ? !1 : (this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }, this.elementOffset = this.element.offset(), i = { x: t.pageX, y: t.pageY }, s = this._normValueFromMouse(i), n = this._valueMax() - this._valueMin() + 1, this.handles.each(function (t) { var i = Math.abs(s - u.values(t)); (n > i || n === i && (t === u._lastChangedValue || u.values(t) === d.min)) && (n = i, a = e(this), o = t) }), r = this._start(t, o), r === !1 ? !1 : (this._mouseSliding = !0, this._handleIndex = o, a.addClass(\"ui-state-active\").focus(), h = a.offset(), l = !e(t.target).parents().addBack().is(\".ui-slider-handle\"), this._clickOffset = l ? { left: 0, top: 0 } : { left: t.pageX - h.left - a.width() / 2, top: t.pageY - h.top - a.height() / 2 - (parseInt(a.css(\"borderTopWidth\"), 10) || 0) - (parseInt(a.css(\"borderBottomWidth\"), 10) || 0) + (parseInt(a.css(\"marginTop\"), 10) || 0) }, this.handles.hasClass(\"ui-state-hover\") || this._slide(t, o, s), this._animateOff = !0, !0)) }, _mouseStart: function () { return !0 }, _mouseDrag: function (e) { var t = { x: e.pageX, y: e.pageY }, i = this._normValueFromMouse(t); return this._slide(e, this._handleIndex, i), !1 }, _mouseStop: function (e) { return this.handles.removeClass(\"ui-state-active\"), this._mouseSliding = !1, this._stop(e, this._handleIndex), this._change(e, this._handleIndex), this._handleIndex = null, this._clickOffset = null, this._animateOff = !1, !1 }, _detectOrientation: function () { this.orientation = \"vertical\" === this.options.orientation ? \"vertical\" : \"horizontal\" }, _normValueFromMouse: function (e) { var t, i, s, n, a; return \"horizontal\" === this.orientation ? (t = this.elementSize.width, i = e.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)) : (t = this.elementSize.height, i = e.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)), s = i / t, s > 1 && (s = 1), 0 > s && (s = 0), \"vertical\" === this.orientation && (s = 1 - s), n = this._valueMax() - this._valueMin(), a = this._valueMin() + s * n, this._trimAlignValue(a) }, _start: function (e, t) { var i = { handle: this.handles[t], value: this.value() }; return this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._trigger(\"start\", e, i) }, _slide: function (e, t, i) { var s, n, a; this.options.values && this.options.values.length ? (s = this.values(t ? 0 : 1), 2 === this.options.values.length && this.options.range === !0 && (0 === t && i > s || 1 === t && s > i) && (i = s), i !== this.values(t) && (n = this.values(), n[t] = i, a = this._trigger(\"slide\", e, { handle: this.handles[t], value: i, values: n }), s = this.values(t ? 0 : 1), a !== !1 && this.values(t, i))) : i !== this.value() && (a = this._trigger(\"slide\", e, { handle: this.handles[t], value: i }), a !== !1 && this.value(i)) }, _stop: function (e, t) { var i = { handle: this.handles[t], value: this.value() }; this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._trigger(\"stop\", e, i) }, _change: function (e, t) { if (!this._keySliding && !this._mouseSliding) { var i = { handle: this.handles[t], value: this.value() }; this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._lastChangedValue = t, this._trigger(\"change\", e, i) } }, value: function (e) { return arguments.length ? (this.options.value = this._trimAlignValue(e), this._refreshValue(), this._change(null, 0), undefined) : this._value() }, values: function (t, i) { var s, n, a; if (arguments.length > 1) return this.options.values[t] = this._trimAlignValue(i), this._refreshValue(), this._change(null, t), undefined; if (!arguments.length) return this._values(); if (!e.isArray(arguments[0])) return this.options.values && this.options.values.length ? this._values(t) : this.value(); for (s = this.options.values, n = arguments[0], a = 0; s.length > a; a += 1) s[a] = this._trimAlignValue(n[a]), this._change(null, a); this._refreshValue() }, _setOption: function (t, i) { var s, n = 0; switch (\"range\" === t && this.options.range === !0 && (\"min\" === i ? (this.options.value = this._values(0), this.options.values = null) : \"max\" === i && (this.options.value = this._values(this.options.values.length - 1), this.options.values = null)), e.isArray(this.options.values) && (n = this.options.values.length), e.Widget.prototype._setOption.apply(this, arguments), t) { case \"orientation\": this._detectOrientation(), this.element.removeClass(\"ui-slider-horizontal ui-slider-vertical\").addClass(\"ui-slider-\" + this.orientation), this._refreshValue(); break; case \"value\": this._animateOff = !0, this._refreshValue(), this._change(null, 0), this._animateOff = !1; break; case \"values\": for (this._animateOff = !0, this._refreshValue(), s = 0; n > s; s += 1) this._change(null, s); this._animateOff = !1; break; case \"min\": case \"max\": this._animateOff = !0, this._refreshValue(), this._animateOff = !1; break; case \"range\": this._animateOff = !0, this._refresh(), this._animateOff = !1 } }, _value: function () { var e = this.options.value; return e = this._trimAlignValue(e) }, _values: function (e) { var t, i, s; if (arguments.length) return t = this.options.values[e], t = this._trimAlignValue(t); if (this.options.values && this.options.values.length) { for (i = this.options.values.slice(), s = 0; i.length > s; s += 1) i[s] = this._trimAlignValue(i[s]); return i } return [] }, _trimAlignValue: function (e) { if (this._valueMin() >= e) return this._valueMin(); if (e >= this._valueMax()) return this._valueMax(); var t = this.options.step > 0 ? this.options.step : 1, i = (e - this._valueMin()) % t, s = e - i; return 2 * Math.abs(i) >= t && (s += i > 0 ? t : -t), parseFloat(s.toFixed(5)) }, _valueMin: function () { return this.options.min }, _valueMax: function () { return this.options.max }, _refreshValue: function () { var t, i, s, n, a, o = this.options.range, r = this.options, h = this, l = this._animateOff ? !1 : r.animate, u = {}; this.options.values && this.options.values.length ? this.handles.each(function (s) { i = 100 * ((h.values(s) - h._valueMin()) / (h._valueMax() - h._valueMin())), u[\"horizontal\" === h.orientation ? \"left\" : \"bottom\"] = i + \"%\", e(this).stop(1, 1)[l ? \"animate\" : \"css\"](u, r.animate), h.options.range === !0 && (\"horizontal\" === h.orientation ? (0 === s && h.range.stop(1, 1)[l ? \"animate\" : \"css\"]({ left: i + \"%\" }, r.animate), 1 === s && h.range[l ? \"animate\" : \"css\"]({ width: i - t + \"%\" }, { queue: !1, duration: r.animate })) : (0 === s && h.range.stop(1, 1)[l ? \"animate\" : \"css\"]({ bottom: i + \"%\" }, r.animate), 1 === s && h.range[l ? \"animate\" : \"css\"]({ height: i - t + \"%\" }, { queue: !1, duration: r.animate }))), t = i }) : (s = this.value(), n = this._valueMin(), a = this._valueMax(), i = a !== n ? 100 * ((s - n) / (a - n)) : 0, u[\"horizontal\" === this.orientation ? \"left\" : \"bottom\"] = i + \"%\", this.handle.stop(1, 1)[l ? \"animate\" : \"css\"](u, r.animate), \"min\" === o && \"horizontal\" === this.orientation && this.range.stop(1, 1)[l ? \"animate\" : \"css\"]({ width: i + \"%\" }, r.animate), \"max\" === o && \"horizontal\" === this.orientation && this.range[l ? \"animate\" : \"css\"]({ width: 100 - i + \"%\" }, { queue: !1, duration: r.animate }), \"min\" === o && \"vertical\" === this.orientation && this.range.stop(1, 1)[l ? \"animate\" : \"css\"]({ height: i + \"%\" }, r.animate), \"max\" === o && \"vertical\" === this.orientation && this.range[l ? \"animate\" : \"css\"]({ height: 100 - i + \"%\" }, { queue: !1, duration: r.animate })) }, _handleEvents: { keydown: function (i) { var s, n, a, o, r = e(i.target).data(\"ui-slider-handle-index\"); switch (i.keyCode) { case e.ui.keyCode.HOME: case e.ui.keyCode.END: case e.ui.keyCode.PAGE_UP: case e.ui.keyCode.PAGE_DOWN: case e.ui.keyCode.UP: case e.ui.keyCode.RIGHT: case e.ui.keyCode.DOWN: case e.ui.keyCode.LEFT: if (i.preventDefault(), !this._keySliding && (this._keySliding = !0, e(i.target).addClass(\"ui-state-active\"), s = this._start(i, r), s === !1)) return } switch (o = this.options.step, n = a = this.options.values && this.options.values.length ? this.values(r) : this.value(), i.keyCode) { case e.ui.keyCode.HOME: a = this._valueMin(); break; case e.ui.keyCode.END: a = this._valueMax(); break; case e.ui.keyCode.PAGE_UP: a = this._trimAlignValue(n + (this._valueMax() - this._valueMin()) / t); break; case e.ui.keyCode.PAGE_DOWN: a = this._trimAlignValue(n - (this._valueMax() - this._valueMin()) / t); break; case e.ui.keyCode.UP: case e.ui.keyCode.RIGHT: if (n === this._valueMax()) return; a = this._trimAlignValue(n + o); break; case e.ui.keyCode.DOWN: case e.ui.keyCode.LEFT: if (n === this._valueMin()) return; a = this._trimAlignValue(n - o) } this._slide(i, r, a) }, click: function (e) { e.preventDefault() }, keyup: function (t) { var i = e(t.target).data(\"ui-slider-handle-index\"); this._keySliding && (this._keySliding = !1, this._stop(t, i), this._change(t, i), e(t.target).removeClass(\"ui-state-active\")) } } }) })(jQuery);\n }\n\n\n /*! nouislider - 9.0.0 - 2016-09-29 21:44:02 */\n if (HawkSearch.loadPlugins.slider == true) {\n !function (a) { \"function\" == typeof define && define.amd ? define([], a) : \"object\" == typeof exports ? module.exports = a() : window.noUiSlider = a() }(function () { \"use strict\"; function a(a, b) { var c = document.createElement(\"div\"); return j(c, b), a.appendChild(c), c } function b(a) { return a.filter(function (a) { return !this[a] && (this[a] = !0) }, {}) } function c(a, b) { return Math.round(a / b) * b } function d(a, b) { var c = a.getBoundingClientRect(), d = a.ownerDocument, e = d.documentElement, f = m(); return /webkit.*Chrome.*Mobile/i.test(navigator.userAgent) && (f.x = 0), b ? c.top + f.y - e.clientTop : c.left + f.x - e.clientLeft } function e(a) { return \"number\" == typeof a && !isNaN(a) && isFinite(a) } function f(a, b, c) { c > 0 && (j(a, b), setTimeout(function () { k(a, b) }, c)) } function g(a) { return Math.max(Math.min(a, 100), 0) } function h(a) { return Array.isArray(a) ? a : [a] } function i(a) { a = String(a); var b = a.split(\".\"); return b.length > 1 ? b[1].length : 0 } function j(a, b) { a.classList ? a.classList.add(b) : a.className += \" \" + b } function k(a, b) { a.classList ? a.classList.remove(b) : a.className = a.className.replace(new RegExp(\"(^|\\\\b)\" + b.split(\" \").join(\"|\") + \"(\\\\b|$)\", \"gi\"), \" \") } function l(a, b) { return a.classList ? a.classList.contains(b) : new RegExp(\"\\\\b\" + b + \"\\\\b\").test(a.className) } function m() { var a = void 0 !== window.pageXOffset, b = \"CSS1Compat\" === (document.compatMode || \"\"), c = a ? window.pageXOffset : b ? document.documentElement.scrollLeft : document.body.scrollLeft, d = a ? window.pageYOffset : b ? document.documentElement.scrollTop : document.body.scrollTop; return { x: c, y: d } } function n() { return window.navigator.pointerEnabled ? { start: \"pointerdown\", move: \"pointermove\", end: \"pointerup\" } : window.navigator.msPointerEnabled ? { start: \"MSPointerDown\", move: \"MSPointerMove\", end: \"MSPointerUp\" } : { start: \"mousedown touchstart\", move: \"mousemove touchmove\", end: \"mouseup touchend\" } } function o(a, b) { return 100 / (b - a) } function p(a, b) { return 100 * b / (a[1] - a[0]) } function q(a, b) { return p(a, a[0] < 0 ? b + Math.abs(a[0]) : b - a[0]) } function r(a, b) { return b * (a[1] - a[0]) / 100 + a[0] } function s(a, b) { for (var c = 1; a >= b[c];) c += 1; return c } function t(a, b, c) { if (c >= a.slice(-1)[0]) return 100; var d, e, f, g, h = s(c, a); return d = a[h - 1], e = a[h], f = b[h - 1], g = b[h], f + q([d, e], c) / o(f, g) } function u(a, b, c) { if (c >= 100) return a.slice(-1)[0]; var d, e, f, g, h = s(c, b); return d = a[h - 1], e = a[h], f = b[h - 1], g = b[h], r([d, e], (c - f) * o(f, g)) } function v(a, b, d, e) { if (100 === e) return e; var f, g, h = s(e, a); return d ? (f = a[h - 1], g = a[h], e - f > (g - f) / 2 ? g : f) : b[h - 1] ? a[h - 1] + c(e - a[h - 1], b[h - 1]) : e } function w(a, b, c) { var d; if (\"number\" == typeof b && (b = [b]), \"[object Array]\" !== Object.prototype.toString.call(b)) throw new Error(\"noUiSlider: 'range' contains invalid value.\"); if (d = \"min\" === a ? 0 : \"max\" === a ? 100 : parseFloat(a), !e(d) || !e(b[0])) throw new Error(\"noUiSlider: 'range' value isn't numeric.\"); c.xPct.push(d), c.xVal.push(b[0]), d ? c.xSteps.push(!isNaN(b[1]) && b[1]) : isNaN(b[1]) || (c.xSteps[0] = b[1]), c.xHighestCompleteStep.push(0) } function x(a, b, c) { if (!b) return !0; c.xSteps[a] = p([c.xVal[a], c.xVal[a + 1]], b) / o(c.xPct[a], c.xPct[a + 1]); var d = (c.xVal[a + 1] - c.xVal[a]) / c.xNumSteps[a], e = Math.ceil(Number(d.toFixed(3)) - 1), f = c.xVal[a] + c.xNumSteps[a] * e; c.xHighestCompleteStep[a] = f } function y(a, b, c, d) { this.xPct = [], this.xVal = [], this.xSteps = [d || !1], this.xNumSteps = [!1], this.xHighestCompleteStep = [], this.snap = b, this.direction = c; var e, f = []; for (e in a) a.hasOwnProperty(e) && f.push([a[e], e]); for (f.length && \"object\" == typeof f[0][0] ? f.sort(function (a, b) { return a[0][0] - b[0][0] }) : f.sort(function (a, b) { return a[0] - b[0] }), e = 0; e < f.length; e++) w(f[e][1], f[e][0], this); for (this.xNumSteps = this.xSteps.slice(0), e = 0; e < this.xNumSteps.length; e++) x(e, this.xNumSteps[e], this) } function z(a, b) { if (!e(b)) throw new Error(\"noUiSlider: 'step' is not numeric.\"); a.singleStep = b } function A(a, b) { if (\"object\" != typeof b || Array.isArray(b)) throw new Error(\"noUiSlider: 'range' is not an object.\"); if (void 0 === b.min || void 0 === b.max) throw new Error(\"noUiSlider: Missing 'min' or 'max' in 'range'.\"); if (b.min === b.max) throw new Error(\"noUiSlider: 'range' 'min' and 'max' cannot be equal.\"); a.spectrum = new y(b, a.snap, a.dir, a.singleStep) } function B(a, b) { if (b = h(b), !Array.isArray(b) || !b.length) throw new Error(\"noUiSlider: 'start' option is incorrect.\"); a.handles = b.length, a.start = b } function C(a, b) { if (a.snap = b, \"boolean\" != typeof b) throw new Error(\"noUiSlider: 'snap' option must be a boolean.\") } function D(a, b) { if (a.animate = b, \"boolean\" != typeof b) throw new Error(\"noUiSlider: 'animate' option must be a boolean.\") } function E(a, b) { if (a.animationDuration = b, \"number\" != typeof b) throw new Error(\"noUiSlider: 'animationDuration' option must be a number.\") } function F(a, b) { var c, d = [!1]; if (b === !0 || b === !1) { for (c = 1; c < a.handles; c++) d.push(b); d.push(!1) } else { if (!Array.isArray(b) || !b.length || b.length !== a.handles + 1) throw new Error(\"noUiSlider: 'connect' option doesn't match handle count.\"); d = b } a.connect = d } function G(a, b) { switch (b) { case \"horizontal\": a.ort = 0; break; case \"vertical\": a.ort = 1; break; default: throw new Error(\"noUiSlider: 'orientation' option is invalid.\") } } function H(a, b) { if (!e(b)) throw new Error(\"noUiSlider: 'margin' option must be numeric.\"); if (0 !== b && (a.margin = a.spectrum.getMargin(b), !a.margin)) throw new Error(\"noUiSlider: 'margin' option is only supported on linear sliders.\") } function I(a, b) { if (!e(b)) throw new Error(\"noUiSlider: 'limit' option must be numeric.\"); if (a.limit = a.spectrum.getMargin(b), !a.limit || a.handles < 2) throw new Error(\"noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.\") } function J(a, b) { switch (b) { case \"ltr\": a.dir = 0; break; case \"rtl\": a.dir = 1; break; default: throw new Error(\"noUiSlider: 'direction' option was not recognized.\") } } function K(a, b) { if (\"string\" != typeof b) throw new Error(\"noUiSlider: 'behaviour' must be a string containing options.\"); var c = b.indexOf(\"tap\") >= 0, d = b.indexOf(\"drag\") >= 0, e = b.indexOf(\"fixed\") >= 0, f = b.indexOf(\"snap\") >= 0, g = b.indexOf(\"hover\") >= 0; if (e) { if (2 !== a.handles) throw new Error(\"noUiSlider: 'fixed' behaviour must be used with 2 handles\"); H(a, a.start[1] - a.start[0]) } a.events = { tap: c || f, drag: d, fixed: e, snap: f, hover: g } } function L(a, b) { if (b !== !1) if (b === !0) { a.tooltips = []; for (var c = 0; c < a.handles; c++) a.tooltips.push(!0) } else { if (a.tooltips = h(b), a.tooltips.length !== a.handles) throw new Error(\"noUiSlider: must pass a formatter for all handles.\"); a.tooltips.forEach(function (a) { if (\"boolean\" != typeof a && (\"object\" != typeof a || \"function\" != typeof a.to)) throw new Error(\"noUiSlider: 'tooltips' must be passed a formatter or 'false'.\") }) } } function M(a, b) { if (a.format = b, \"function\" == typeof b.to && \"function\" == typeof b.from) return !0; throw new Error(\"noUiSlider: 'format' requires 'to' and 'from' methods.\") } function N(a, b) { if (void 0 !== b && \"string\" != typeof b && b !== !1) throw new Error(\"noUiSlider: 'cssPrefix' must be a string or `false`.\"); a.cssPrefix = b } function O(a, b) { if (void 0 !== b && \"object\" != typeof b) throw new Error(\"noUiSlider: 'cssClasses' must be an object.\"); if (\"string\" == typeof a.cssPrefix) { a.cssClasses = {}; for (var c in b) b.hasOwnProperty(c) && (a.cssClasses[c] = a.cssPrefix + b[c]) } else a.cssClasses = b } function P(a, b) { if (b !== !0 && b !== !1) throw new Error(\"noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.\"); a.useRequestAnimationFrame = b } function Q(a) { var b, c = { margin: 0, limit: 0, animate: !0, animationDuration: 300, format: T }; b = { step: { r: !1, t: z }, start: { r: !0, t: B }, connect: { r: !0, t: F }, direction: { r: !0, t: J }, snap: { r: !1, t: C }, animate: { r: !1, t: D }, animationDuration: { r: !1, t: E }, range: { r: !0, t: A }, orientation: { r: !1, t: G }, margin: { r: !1, t: H }, limit: { r: !1, t: I }, behaviour: { r: !0, t: K }, format: { r: !1, t: M }, tooltips: { r: !1, t: L }, cssPrefix: { r: !1, t: N }, cssClasses: { r: !1, t: O }, useRequestAnimationFrame: { r: !1, t: P } }; var d = { connect: !1, direction: \"ltr\", behaviour: \"tap\", orientation: \"horizontal\", cssPrefix: \"noUi-\", cssClasses: { target: \"target\", base: \"base\", origin: \"origin\", handle: \"handle\", horizontal: \"horizontal\", vertical: \"vertical\", background: \"background\", connect: \"connect\", ltr: \"ltr\", rtl: \"rtl\", draggable: \"draggable\", drag: \"state-drag\", tap: \"state-tap\", active: \"active\", tooltip: \"tooltip\", pips: \"pips\", pipsHorizontal: \"pips-horizontal\", pipsVertical: \"pips-vertical\", marker: \"marker\", markerHorizontal: \"marker-horizontal\", markerVertical: \"marker-vertical\", markerNormal: \"marker-normal\", markerLarge: \"marker-large\", markerSub: \"marker-sub\", value: \"value\", valueHorizontal: \"value-horizontal\", valueVertical: \"value-vertical\", valueNormal: \"value-normal\", valueLarge: \"value-large\", valueSub: \"value-sub\" }, useRequestAnimationFrame: !0 }; Object.keys(b).forEach(function (e) { if (void 0 === a[e] && void 0 === d[e]) { if (b[e].r) throw new Error(\"noUiSlider: '\" + e + \"' is required.\"); return !0 } b[e].t(c, void 0 === a[e] ? d[e] : a[e]) }), c.pips = a.pips; var e = [[\"left\", \"top\"], [\"right\", \"bottom\"]]; return c.style = e[c.dir][c.ort], c.styleOposite = e[c.dir ? 0 : 1][c.ort], c } function R(c, e, i) { function o(b, c) { var d = a(b, e.cssClasses.origin), f = a(d, e.cssClasses.handle); return f.setAttribute(\"data-handle\", c), d } function p(b, c) { return !!c && a(b, e.cssClasses.connect) } function q(a, b) { ba = [], ca = [], ca.push(p(b, a[0])); for (var c = 0; c < e.handles; c++) ba.push(o(b, c)), ha[c] = c, ca.push(p(b, a[c + 1])) } function r(b) { j(b, e.cssClasses.target), 0 === e.dir ? j(b, e.cssClasses.ltr) : j(b, e.cssClasses.rtl), 0 === e.ort ? j(b, e.cssClasses.horizontal) : j(b, e.cssClasses.vertical), aa = a(b, e.cssClasses.base) } function s(b, c) { return !!e.tooltips[c] && a(b.firstChild, e.cssClasses.tooltip) } function t() { var a = ba.map(s); Z(\"update\", function (b, c, d) { if (a[c]) { var f = b[c]; e.tooltips[c] !== !0 && (f = e.tooltips[c].to(d[c])), a[c].innerHTML = f } }) } function u(a, b, c) { if (\"range\" === a || \"steps\" === a) return ia.xVal; if (\"count\" === a) { var d, e = 100 / (b - 1), f = 0; for (b = []; (d = f++ * e) <= 100;) b.push(d); a = \"positions\" } return \"positions\" === a ? b.map(function (a) { return ia.fromStepping(c ? ia.getStep(a) : a) }) : \"values\" === a ? c ? b.map(function (a) { return ia.fromStepping(ia.getStep(ia.toStepping(a))) }) : b : void 0 } function v(a, c, d) { function e(a, b) { return (a + b).toFixed(7) / 1 } var f = {}, g = ia.xVal[0], h = ia.xVal[ia.xVal.length - 1], i = !1, j = !1, k = 0; return d = b(d.slice().sort(function (a, b) { return a - b })), d[0] !== g && (d.unshift(g), i = !0), d[d.length - 1] !== h && (d.push(h), j = !0), d.forEach(function (b, g) { var h, l, m, n, o, p, q, r, s, t, u = b, v = d[g + 1]; if (\"steps\" === c && (h = ia.xNumSteps[g]), h || (h = v - u), u !== !1 && void 0 !== v) for (h = Math.max(h, 1e-7), l = u; l <= v; l = e(l, h)) { for (n = ia.toStepping(l), o = n - k, r = o / a, s = Math.round(r), t = o / s, m = 1; m <= s; m += 1) p = k + m * t, f[p.toFixed(5)] = [\"x\", 0]; q = d.indexOf(l) > -1 ? 1 : \"steps\" === c ? 2 : 0, !g && i && (q = 0), l === v && j || (f[n.toFixed(5)] = [l, q]), k = n } }), f } function w(a, b, c) { function d(a, b) { var c = b === e.cssClasses.value, d = c ? m : n, f = c ? k : l; return b + \" \" + d[e.ort] + \" \" + f[a] } function f(a, b, c) { return 'class=\"' + d(c[1], b) + '\" style=\"' + e.style + \": \" + a + '%\"' } function g(a, d) { d[1] = d[1] && b ? b(d[0], d[1]) : d[1], i += \"<div \" + f(a, e.cssClasses.marker, d) + \"></div>\", d[1] && (i += \"<div \" + f(a, e.cssClasses.value, d) + \">\" + c.to(d[0]) + \"</div>\") } var h = document.createElement(\"div\"), i = \"\", k = [e.cssClasses.valueNormal, e.cssClasses.valueLarge, e.cssClasses.valueSub], l = [e.cssClasses.markerNormal, e.cssClasses.markerLarge, e.cssClasses.markerSub], m = [e.cssClasses.valueHorizontal, e.cssClasses.valueVertical], n = [e.cssClasses.markerHorizontal, e.cssClasses.markerVertical]; return j(h, e.cssClasses.pips), j(h, 0 === e.ort ? e.cssClasses.pipsHorizontal : e.cssClasses.pipsVertical), Object.keys(a).forEach(function (b) { g(b, a[b]) }), h.innerHTML = i, h } function x(a) { var b = a.mode, c = a.density || 1, d = a.filter || !1, e = a.values || !1, f = a.stepped || !1, g = u(b, e, f), h = v(c, b, g), i = a.format || { to: Math.round }; return fa.appendChild(w(h, d, i)) } function y() { var a = aa.getBoundingClientRect(), b = \"offset\" + [\"Width\", \"Height\"][e.ort]; return 0 === e.ort ? a.width || aa[b] : a.height || aa[b] } function z(a, b, c, d) { var f = function (b) { return !fa.hasAttribute(\"disabled\") && (!l(fa, e.cssClasses.tap) && (b = A(b, d.pageOffset), !(a === ea.start && void 0 !== b.buttons && b.buttons > 1) && ((!d.hover || !b.buttons) && (b.calcPoint = b.points[e.ort], void c(b, d))))) }, g = []; return a.split(\" \").forEach(function (a) { b.addEventListener(a, f, !1), g.push([a, f]) }), g } function A(a, b) { a.preventDefault(); var c, d, e = 0 === a.type.indexOf(\"touch\"), f = 0 === a.type.indexOf(\"mouse\"), g = 0 === a.type.indexOf(\"pointer\"), h = a; if (0 === a.type.indexOf(\"MSPointer\") && (g = !0), e) { if (h.touches.length > 1) return !1; c = a.changedTouches[0].pageX, d = a.changedTouches[0].pageY } return b = b || m(), (f || g) && (c = a.clientX + b.x, d = a.clientY + b.y), h.pageOffset = b, h.points = [c, d], h.cursor = f || g, h } function B(a) { var b = a - d(aa, e.ort), c = 100 * b / y(); return e.dir ? 100 - c : c } function C(a) { var b = 100, c = !1; return ba.forEach(function (d, e) { if (!d.hasAttribute(\"disabled\")) { var f = Math.abs(ga[e] - a); f < b && (c = e, b = f) } }), c } function D(a, b, c, d) { var e = c.slice(), f = [!a, a], g = [a, !a]; d = d.slice(), a && d.reverse(), d.length > 1 ? d.forEach(function (a, c) { var d = M(e, a, e[a] + b, f[c], g[c]); d === !1 ? b = 0 : (b = d - e[a], e[a] = d) }) : f = g = [!0]; var h = !1; d.forEach(function (a, d) { h = R(a, c[a] + b, f[d], g[d]) || h }), h && d.forEach(function (a) { E(\"update\", a), E(\"slide\", a) }) } function E(a, b, c) { Object.keys(ka).forEach(function (d) { var f = d.split(\".\")[0]; a === f && ka[d].forEach(function (a) { a.call(da, ja.map(e.format.to), b, ja.slice(), c || !1, ga.slice()) }) }) } function F(a, b) { \"mouseout\" === a.type && \"HTML\" === a.target.nodeName && null === a.relatedTarget && H(a, b) } function G(a, b) { if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && 0 === a.buttons && 0 !== b.buttonsProperty) return H(a, b); var c = (e.dir ? -1 : 1) * (a.calcPoint - b.startCalcPoint), d = 100 * c / b.baseSize; D(c > 0, d, b.locations, b.handleNumbers) } function H(a, b) { var c = aa.querySelector(\".\" + e.cssClasses.active); null !== c && k(c, e.cssClasses.active), a.cursor && (document.body.style.cursor = \"\", document.body.removeEventListener(\"selectstart\", document.body.noUiListener)), document.documentElement.noUiListeners.forEach(function (a) { document.documentElement.removeEventListener(a[0], a[1]) }), k(fa, e.cssClasses.drag), P(), b.handleNumbers.forEach(function (a) { E(\"set\", a), E(\"change\", a), E(\"end\", a) }) } function I(a, b) { if (1 === b.handleNumbers.length) { var c = ba[b.handleNumbers[0]]; if (c.hasAttribute(\"disabled\")) return !1; j(c.children[0], e.cssClasses.active) } a.preventDefault(), a.stopPropagation(); var d = z(ea.move, document.documentElement, G, { startCalcPoint: a.calcPoint, baseSize: y(), pageOffset: a.pageOffset, handleNumbers: b.handleNumbers, buttonsProperty: a.buttons, locations: ga.slice() }), f = z(ea.end, document.documentElement, H, { handleNumbers: b.handleNumbers }), g = z(\"mouseout\", document.documentElement, F, { handleNumbers: b.handleNumbers }); if (document.documentElement.noUiListeners = d.concat(f, g), a.cursor) { document.body.style.cursor = getComputedStyle(a.target).cursor, ba.length > 1 && j(fa, e.cssClasses.drag); var h = function () { return !1 }; document.body.noUiListener = h, document.body.addEventListener(\"selectstart\", h, !1) } b.handleNumbers.forEach(function (a) { E(\"start\", a) }) } function J(a) { a.stopPropagation(); var b = B(a.calcPoint), c = C(b); return c !== !1 && (e.events.snap || f(fa, e.cssClasses.tap, e.animationDuration), R(c, b, !0, !0), P(), E(\"slide\", c, !0), E(\"set\", c, !0), E(\"change\", c, !0), E(\"update\", c, !0), void (e.events.snap && I(a, { handleNumbers: [c] }))) } function K(a) { var b = B(a.calcPoint), c = ia.getStep(b), d = ia.fromStepping(c); Object.keys(ka).forEach(function (a) { \"hover\" === a.split(\".\")[0] && ka[a].forEach(function (a) { a.call(da, d) }) }) } function L(a) { a.fixed || ba.forEach(function (a, b) { z(ea.start, a.children[0], I, { handleNumbers: [b] }) }), a.tap && z(ea.start, aa, J, {}), a.hover && z(ea.move, aa, K, { hover: !0 }), a.drag && ca.forEach(function (b, c) { if (b !== !1 && 0 !== c && c !== ca.length - 1) { var d = ba[c - 1], f = ba[c], g = [b]; j(b, e.cssClasses.draggable), a.fixed && (g.push(d.children[0]), g.push(f.children[0])), g.forEach(function (a) { z(ea.start, a, I, { handles: [d, f], handleNumbers: [c - 1, c] }) }) } }) } function M(a, b, c, d, f) { return ba.length > 1 && (d && b > 0 && (c = Math.max(c, a[b - 1] + e.margin)), f && b < ba.length - 1 && (c = Math.min(c, a[b + 1] - e.margin))), ba.length > 1 && e.limit && (d && b > 0 && (c = Math.min(c, a[b - 1] + e.limit)), f && b < ba.length - 1 && (c = Math.max(c, a[b + 1] - e.limit))), c = ia.getStep(c), c = g(c), c !== a[b] && c } function N(a) { return a + \"%\" } function O(a, b) { ga[a] = b, ja[a] = ia.fromStepping(b); var c = function () { ba[a].style[e.style] = N(b), S(a), S(a + 1) }; window.requestAnimationFrame && e.useRequestAnimationFrame ? window.requestAnimationFrame(c) : c() } function P() { ha.forEach(function (a) { var b = ga[a] > 50 ? -1 : 1, c = 3 + (ba.length + b * a); ba[a].childNodes[0].style.zIndex = c }) } function R(a, b, c, d) { return b = M(ga, a, b, c, d), b !== !1 && (O(a, b), !0) } function S(a) { if (ca[a]) { var b = 0, c = 100; 0 !== a && (b = ga[a - 1]), a !== ca.length - 1 && (c = ga[a]), ca[a].style[e.style] = N(b), ca[a].style[e.styleOposite] = N(100 - c) } } function T(a, b) { null !== a && a !== !1 && (\"number\" == typeof a && (a = String(a)), a = e.format.from(a), a === !1 || isNaN(a) || R(b, ia.toStepping(a), !1, !1)) } function U(a, b) { var c = h(a), d = void 0 === ga[0]; b = void 0 === b || !!b, c.forEach(T), e.animate && !d && f(fa, e.cssClasses.tap, e.animationDuration), ha.forEach(function (a) { R(a, ga[a], !0, !1) }), P(), ha.forEach(function (a) { E(\"update\", a), null !== c[a] && b && E(\"set\", a) }) } function V(a) { U(e.start, a) } function W() { var a = ja.map(e.format.to); return 1 === a.length ? a[0] : a } function X() { for (var a in e.cssClasses) e.cssClasses.hasOwnProperty(a) && k(fa, e.cssClasses[a]); for (; fa.firstChild;) fa.removeChild(fa.firstChild); delete fa.noUiSlider } function Y() { return ga.map(function (a, b) { var c = ia.getNearbySteps(a), d = ja[b], e = c.thisStep.step, f = null; e !== !1 && d + e > c.stepAfter.startValue && (e = c.stepAfter.startValue - d), f = d > c.thisStep.startValue ? c.thisStep.step : c.stepBefore.step !== !1 && d - c.stepBefore.highestStep, 100 === a ? e = null : 0 === a && (f = null); var g = ia.countStepDecimals(); return null !== e && e !== !1 && (e = Number(e.toFixed(g))), null !== f && f !== !1 && (f = Number(f.toFixed(g))), [f, e] }) } function Z(a, b) { ka[a] = ka[a] || [], ka[a].push(b), \"update\" === a.split(\".\")[0] && ba.forEach(function (a, b) { E(\"update\", b) }) } function $(a) { var b = a && a.split(\".\")[0], c = b && a.substring(b.length); Object.keys(ka).forEach(function (a) { var d = a.split(\".\")[0], e = a.substring(d.length); b && b !== d || c && c !== e || delete ka[a] }) } function _(a, b) { var c = W(), d = [\"margin\", \"limit\", \"range\", \"animate\", \"snap\", \"step\", \"format\"]; d.forEach(function (b) { void 0 !== a[b] && (i[b] = a[b]) }); var f = Q(i); d.forEach(function (b) { void 0 !== a[b] && (e[b] = f[b]) }), f.spectrum.direction = ia.direction, ia = f.spectrum, e.margin = f.margin, e.limit = f.limit, ga = [], U(a.start || c, b) } var aa, ba, ca, da, ea = n(), fa = c, ga = [], ha = [], ia = e.spectrum, ja = [], ka = {}; if (fa.noUiSlider) throw new Error(\"Slider was already initialized.\"); return r(fa), q(e.connect, aa), da = { destroy: X, steps: Y, on: Z, off: $, get: W, set: U, reset: V, __moveHandles: function (a, b, c) { D(a, b, ga, c) }, options: i, updateOptions: _, target: fa, pips: x }, L(e.events), U(e.start), e.pips && x(e.pips), e.tooltips && t(), da } function S(a, b) { if (!a.nodeName) throw new Error(\"noUiSlider.create requires a single element.\"); var c = Q(b, a), d = R(a, c, b); return a.noUiSlider = d, d } y.prototype.getMargin = function (a) { var b = this.xNumSteps[0]; if (b && a % b) throw new Error(\"noUiSlider: 'limit' and 'margin' must be divisible by step.\"); return 2 === this.xPct.length && p(this.xVal, a) }, y.prototype.toStepping = function (a) { return a = t(this.xVal, this.xPct, a) }, y.prototype.fromStepping = function (a) { return u(this.xVal, this.xPct, a) }, y.prototype.getStep = function (a) { return a = v(this.xPct, this.xSteps, this.snap, a) }, y.prototype.getNearbySteps = function (a) { var b = s(a, this.xPct); return { stepBefore: { startValue: this.xVal[b - 2], step: this.xNumSteps[b - 2], highestStep: this.xHighestCompleteStep[b - 2] }, thisStep: { startValue: this.xVal[b - 1], step: this.xNumSteps[b - 1], highestStep: this.xHighestCompleteStep[b - 1] }, stepAfter: { startValue: this.xVal[b - 0], step: this.xNumSteps[b - 0], highestStep: this.xHighestCompleteStep[b - 0] } } }, y.prototype.countStepDecimals = function () { var a = this.xNumSteps.map(i); return Math.max.apply(null, a) }, y.prototype.convert = function (a) { return this.getStep(this.toStepping(a)) }; var T = { to: function (a) { return void 0 !== a && a.toFixed(2) }, from: Number }; return { create: S } });\n }\n\n /* wNumb.js*/\n if (HawkSearch.loadPlugins.wNumb == true) {\n !function () { \"use strict\"; function b(a) { return a.split(\"\").reverse().join(\"\") } function c(a, b) { return a.substring(0, b.length) === b } function d(a, b) { return a.slice(-1 * b.length) === b } function e(a, b, c) { if ((a[b] || a[c]) && a[b] === a[c]) throw new Error(b) } function f(a) { return \"number\" == typeof a && isFinite(a) } function g(a, b) { var c = Math.pow(10, b); return (Math.round(a * c) / c).toFixed(b) } function h(a, c, d, e, h, i, j, k, l, m, n, o) { var q, r, s, p = o, t = \"\", u = \"\"; return i && (o = i(o)), !!f(o) && (a !== !1 && 0 === parseFloat(o.toFixed(a)) && (o = 0), o < 0 && (q = !0, o = Math.abs(o)), a !== !1 && (o = g(o, a)), o = o.toString(), o.indexOf(\".\") !== -1 ? (r = o.split(\".\"), s = r[0], d && (t = d + r[1])) : s = o, c && (s = b(s).match(/.{1,3}/g), s = b(s.join(b(c)))), q && k && (u += k), e && (u += e), q && l && (u += l), u += s, u += t, h && (u += h), m && (u = m(u, p)), u) } function i(a, b, e, g, h, i, j, k, l, m, n, o) { var q, r = \"\"; return n && (o = n(o)), !(!o || \"string\" != typeof o) && (k && c(o, k) && (o = o.replace(k, \"\"), q = !0), g && c(o, g) && (o = o.replace(g, \"\")), l && c(o, l) && (o = o.replace(l, \"\"), q = !0), h && d(o, h) && (o = o.slice(0, -1 * h.length)), b && (o = o.split(b).join(\"\")), e && (o = o.replace(e, \".\")), q && (r += \"-\"), r += o, r = r.replace(/[^0-9\\.\\-.]/g, \"\"), \"\" !== r && (r = Number(r), j && (r = j(r)), !!f(r) && r)) } function j(b) { var c, d, f, g = {}; for (c = 0; c < a.length; c += 1) if (d = a[c], f = b[d], void 0 === f) \"negative\" !== d || g.negativeBefore ? \"mark\" === d && \".\" !== g.thousand ? g[d] = \".\" : g[d] = !1 : g[d] = \"-\"; else if (\"decimals\" === d) { if (!(f >= 0 && f < 8)) throw new Error(d); g[d] = f } else if (\"encoder\" === d || \"decoder\" === d || \"edit\" === d || \"undo\" === d) { if (\"function\" != typeof f) throw new Error(d); g[d] = f } else { if (\"string\" != typeof f) throw new Error(d); g[d] = f } return e(g, \"mark\", \"thousand\"), e(g, \"prefix\", \"negative\"), e(g, \"prefix\", \"negativeBefore\"), g } function k(b, c, d) { var e, f = []; for (e = 0; e < a.length; e += 1) f.push(b[a[e]]); return f.push(d), c.apply(\"\", f) } function l(a) { return this instanceof l ? void (\"object\" == typeof a && (a = j(a), this.to = function (b) { return k(a, h, b) }, this.from = function (b) { return k(a, i, b) })) : new l(a) } var a = [\"decimals\", \"thousand\", \"mark\", \"prefix\", \"postfix\", \"encoder\", \"decoder\", \"negativeBefore\", \"negative\", \"edit\", \"undo\"]; window.wNumb = l }();\n }\n\n /*!\n\t\t * jQuery blockUI plugin\n\t\t * Version 2.66.0-2013.10.09\n\t\t * Requires jQuery v1.7 or later\n\t\t *\n\t\t * Examples at: http://malsup.com/jquery/block/\n\t\t * Copyright (c) 2007-2013 M. Alsup\n\t\t * Dual licensed under the MIT and GPL licenses:\n\t\t * http://www.opensource.org/licenses/mit-license.php\n\t\t * http://www.gnu.org/licenses/gpl.html\n\t\t *\n\t\t * Thanks to Amir-Hossein Sobhi for some excellent contributions!\n\t\t */\n if (HawkSearch.loadPlugins.blockUI == true) {\n\n (function () {\n function p(b) {\n function p(c, a) {\n var f, h, e = c == window, g = a && void 0 !== a.message ? a.message : void 0; a = b.extend({}, b.blockUI.defaults, a || {}); if (!a.ignoreIfBlocked || !b(c).data(\"blockUI.isBlocked\")) {\n a.overlayCSS = b.extend({}, b.blockUI.defaults.overlayCSS, a.overlayCSS || {}); f = b.extend({}, b.blockUI.defaults.css, a.css || {}); a.onOverlayClick && (a.overlayCSS.cursor = \"pointer\"); h = b.extend({}, b.blockUI.defaults.themedCSS, a.themedCSS || {}); g = void 0 === g ? a.message : g; e && l && s(window, { fadeOut: 0 }); if (g && \"string\" != typeof g &&\n (g.parentNode || g.jquery)) {\n var k = g.jquery ? g[0] : g, d = {}; b(c).data(\"blockUI.history\", d); d.el = k; d.parent = k.parentNode; d.display = k.style.display; d.position = k.style.position; d.parent && d.parent.removeChild(k)\n } b(c).data(\"blockUI.onUnblock\", a.onUnblock); var d = a.baseZ, m; m = t || a.forceIframe ? b('<iframe class=\"blockUI\" style=\"z-index:' + d++ + ';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0\" src=\"' + a.iframeSrc + '\"></iframe>') : b('<div class=\"blockUI\" style=\"display:none\"></div>');\n k = a.theme ? b('<div class=\"blockUI blockOverlay ui-widget-overlay\" style=\"z-index:' + d++ + ';display:none\"></div>') : b('<div class=\"blockUI blockOverlay\" style=\"z-index:' + d++ + ';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0\"></div>'); a.theme && e ? (d = '<div class=\"blockUI ' + a.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all\" style=\"z-index:' + (d + 10) + ';display:none;position:fixed\">', a.title && (d += '<div class=\"ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle\">' +\n (a.title || \"&nbsp;\") + \"</div>\"), d += '<div class=\"ui-widget-content ui-dialog-content\"></div></div>') : a.theme ? (d = '<div class=\"blockUI ' + a.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all\" style=\"z-index:' + (d + 10) + ';display:none;position:absolute\">', a.title && (d += '<div class=\"ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle\">' + (a.title || \"&nbsp;\") + \"</div>\"), d += '<div class=\"ui-widget-content ui-dialog-content\"></div>', d += \"</div>\") : d = e ? '<div class=\"blockUI ' + a.blockMsgClass + ' blockPage\" style=\"z-index:' +\n (d + 10) + ';display:none;position:fixed\"></div>' : '<div class=\"blockUI ' + a.blockMsgClass + ' blockElement\" style=\"z-index:' + (d + 10) + ';display:none;position:absolute\"></div>'; d = b(d); g && (a.theme ? (d.css(h), d.addClass(\"ui-widget-content\")) : d.css(f)); a.theme || k.css(a.overlayCSS); k.css(\"position\", e ? \"fixed\" : \"absolute\"); (t || a.forceIframe) && m.css(\"opacity\", 0); f = [m, k, d]; var r = e ? b(\"body\") : b(c); b.each(f, function () { this.appendTo(r) }); a.theme && a.draggable && b.fn.draggable && d.draggable({ handle: \".ui-dialog-titlebar\", cancel: \"li\" });\n h = A && (!b.support.boxModel || 0 < b(\"object,embed\", e ? null : c).length); if (v || h) {\n e && a.allowBodyStretch && b.support.boxModel && b(\"html,body\").css(\"height\", \"100%\"); if ((v || !b.support.boxModel) && !e) {\n h = parseInt(b.css(c, \"borderTopWidth\"), 10) || 0; var q = parseInt(b.css(c, \"borderLeftWidth\"), 10) || 0, w = h ? \"(0 - \" + h + \")\" : 0, x = q ? \"(0 - \" + q + \")\" : 0\n } b.each(f, function (b, c) {\n var d = c[0].style; d.position = \"absolute\"; if (2 > b) e ? d.setExpression(\"height\", \"Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:\" +\n a.quirksmodeOffsetHack + ') + \"px\"') : d.setExpression(\"height\", 'this.parentNode.offsetHeight + \"px\"'), e ? d.setExpression(\"width\", 'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + \"px\"') : d.setExpression(\"width\", 'this.parentNode.offsetWidth + \"px\"'), x && d.setExpression(\"left\", x), w && d.setExpression(\"top\", w); else if (a.centerY) e && d.setExpression(\"top\", '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + \"px\"'),\n d.marginTop = 0; else if (!a.centerY && e) {\n var f = \"((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + \" + (a.css && a.css.top ? parseInt(a.css.top, 10) : 0) + ') + \"px\"'; d.setExpression(\"top\", f)\n }\n })\n } g && (a.theme ? d.find(\".ui-widget-content\").append(g) : d.append(g), (g.jquery || g.nodeType) && b(g).show()); (t || a.forceIframe) && a.showOverlay && m.show(); if (a.fadeIn) f = a.onBlock ? a.onBlock : u, m = a.showOverlay && !g ? f : u, f = g ? f : u, a.showOverlay && k._fadeIn(a.fadeIn, m), g && d._fadeIn(a.fadeIn,\n f); else if (a.showOverlay && k.show(), g && d.show(), a.onBlock) a.onBlock(); y(1, c, a); e ? (l = d[0], n = b(a.focusableElements, l), a.focusInput && setTimeout(z, 20)) : B(d[0], a.centerX, a.centerY); a.timeout && (g = setTimeout(function () { e ? b.unblockUI(a) : b(c).unblock(a) }, a.timeout), b(c).data(\"blockUI.timeout\", g))\n }\n } function s(c, a) {\n var f, h = c == window, e = b(c), g = e.data(\"blockUI.history\"), k = e.data(\"blockUI.timeout\"); k && (clearTimeout(k), e.removeData(\"blockUI.timeout\")); a = b.extend({}, b.blockUI.defaults, a || {}); y(0, c, a); null === a.onUnblock &&\n (a.onUnblock = e.data(\"blockUI.onUnblock\"), e.removeData(\"blockUI.onUnblock\")); var d; d = h ? b(\"body\").children().filter(\".blockUI\").add(\"body > .blockUI\") : e.find(\">.blockUI\"); a.cursorReset && (1 < d.length && (d[1].style.cursor = a.cursorReset), 2 < d.length && (d[2].style.cursor = a.cursorReset)); h && (l = n = null); a.fadeOut ? (f = d.length, d.stop().fadeOut(a.fadeOut, function () { 0 === --f && r(d, g, a, c) })) : r(d, g, a, c)\n } function r(c, a, f, h) {\n var e = b(h); if (!e.data(\"blockUI.isBlocked\")) {\n c.each(function (a, b) { this.parentNode && this.parentNode.removeChild(this) });\n a && a.el && (a.el.style.display = a.display, a.el.style.position = a.position, a.parent && a.parent.appendChild(a.el), e.removeData(\"blockUI.history\")); e.data(\"blockUI.static\") && e.css(\"position\", \"static\"); if (\"function\" == typeof f.onUnblock) f.onUnblock(h, f); c = b(document.body); a = c.width(); f = c[0].style.width; c.width(a - 1).width(a); c[0].style.width = f\n }\n } function y(c, a, f) {\n var h = a == window; a = b(a); if (c || (!h || l) && (h || a.data(\"blockUI.isBlocked\"))) a.data(\"blockUI.isBlocked\", c), h && f.bindEvents && (!c || f.showOverlay) && (c ? b(document).bind(\"mousedown mouseup keydown keypress keyup touchstart touchend touchmove\",\n f, q) : b(document).unbind(\"mousedown mouseup keydown keypress keyup touchstart touchend touchmove\", q))\n } function q(c) {\n if (\"keydown\" === c.type && c.keyCode && 9 == c.keyCode && l && c.data.constrainTabKey) { var a = n, f = c.shiftKey && c.target === a[0]; if (!c.shiftKey && c.target === a[a.length - 1] || f) return setTimeout(function () { z(f) }, 10), !1 } var a = c.data, h = b(c.target); if (h.hasClass(\"blockOverlay\") && a.onOverlayClick) a.onOverlayClick(c); return 0 < h.parents(\"div.\" + a.blockMsgClass).length ? !0 : 0 === h.parents().children().filter(\"div.blockUI\").length\n }\n function z(b) {\n n && (b = n[!0 === b ? n.length - 1 : 0]) && b.focus()\n } function B(c, a, f) {\n var h = c.parentNode, e = c.style, g = (h.offsetWidth - c.offsetWidth) / 2 - (parseInt(b.css(h, \"borderLeftWidth\"), 10) || 0); c = (h.offsetHeight - c.offsetHeight) / 2 - (parseInt(b.css(h, \"borderTopWidth\"), 10) || 0); a && (e.left = 0 < g ? g + \"px\" : \"0\"); f && (e.top = 0 < c ? c + \"px\" : \"0\")\n } b.fn._fadeIn = b.fn.fadeIn; var u = b.noop || function () { }, t = /MSIE/.test(navigator.userAgent), v = /MSIE 6.0/.test(navigator.userAgent) && !/MSIE 8.0/.test(navigator.userAgent), A = b.isFunction(document.createElement(\"div\").style.setExpression);\n b.blockUI = function (b) {\n p(window, b)\n }; b.unblockUI = function (b) {\n s(window, b)\n }; b.growlUI = function (c, a, f, h) {\n var e = b('<div class=\"growlUI\"></div>'); c && e.append(\"<h1>\" + c + \"</h1>\"); a && e.append(\"<h2>\" + a + \"</h2>\"); void 0 === f && (f = 3E3); var g = function (a) {\n a = a || {}; b.blockUI({ message: e, fadeIn: \"undefined\" !== typeof a.fadeIn ? a.fadeIn : 700, fadeOut: \"undefined\" !== typeof a.fadeOut ? a.fadeOut : 1E3, timeout: \"undefined\" !== typeof a.timeout ? a.timeout : f, centerY: !1, showOverlay: !1, onUnblock: h, css: b.blockUI.defaults.growlCSS })\n }; g(); e.css(\"opacity\");\n e.mouseover(function () { g({ fadeIn: 0, timeout: 3E4 }); var a = b(\".blockMsg\"); a.stop(); a.fadeTo(300, 1) }).mouseout(function () { b(\".blockMsg\").fadeOut(1E3) })\n }; b.fn.block = function (c) {\n if (this[0] === window) return b.blockUI(c), this; var a = b.extend({}, b.blockUI.defaults, c || {}); this.each(function () { var c = b(this); a.ignoreIfBlocked && c.data(\"blockUI.isBlocked\") || c.unblock({ fadeOut: 0 }) }); return this.each(function () {\n \"static\" == b.css(this, \"position\") && (this.style.position = \"relative\", b(this).data(\"blockUI.static\", !0)); this.style.zoom =\n 1; p(this, c)\n })\n }; b.fn.unblock = function (c) {\n return this[0] === window ? (b.unblockUI(c), this) : this.each(function () { s(this, c) })\n }; b.blockUI.version = 2.66; b.blockUI.defaults = {\n message: \"<h1>Please wait...</h1>\", title: null, draggable: !0, theme: !1, css: {\n padding: 0, margin: 0, width: \"30%\", top: \"40%\", left: \"35%\", textAlign: \"center\", color: \"#000\", border: \"3px solid #aaa\", backgroundColor: \"#fff\", cursor: \"wait\"\n }, themedCSS: {\n width: \"30%\", top: \"40%\", left: \"35%\"\n }, overlayCSS: {\n backgroundColor: \"#000\", opacity: 0.6, cursor: \"wait\"\n }, cursorReset: \"default\",\n growlCSS: {\n width: \"350px\", top: \"10px\", left: \"\", right: \"10px\", border: \"none\", padding: \"5px\", opacity: 0.6, cursor: \"default\", color: \"#fff\", backgroundColor: \"#000\", \"-webkit-border-radius\": \"10px\", \"-moz-border-radius\": \"10px\", \"border-radius\": \"10px\"\n }, iframeSrc: /^https/i.test(window.location.href || \"\") ? \"javascript:false\" : \"about:blank\", forceIframe: !1, baseZ: 1E3, centerX: !0, centerY: !0, allowBodyStretch: !0, bindEvents: !0, constrainTabKey: !0, fadeIn: 200, fadeOut: 400, timeout: 0, showOverlay: !0, focusInput: !0, focusableElements: \":input:enabled:visible\",\n onBlock: null, onUnblock: null, onOverlayClick: null, quirksmodeOffsetHack: 4, blockMsgClass: \"blockMsg\", ignoreIfBlocked: !1\n }; var l = null, n = []\n } \"function\" === typeof define && define.amd && define.amd.jQuery ? define([\"jquery\"], p) : p(jQuery)\n })();\n }\n\n /*\n\t\t * Match Heights jQuery Plugin\n\t\t *\n\t\t * Version 1.7.2 (Updated 7/31/2013)\n\t\t * Copyright (c) 2010-2013 Mike Avello\n\t\t * Dual licensed under the MIT and GPL licenses:\n\t\t * http://www.opensource.org/licenses/mit-license.php\n\t\t * http://www.gnu.org/licenses/gpl.html\n\t\t *\n\t\t */\n if (HawkSearch.loadPlugins.matchHeights == true) {\n (function (d) { d.fn.matchHeights = function (a) { a = jQuery.extend(this, { minHeight: null, maxHeight: null, extension: 0, overflow: null, includeMargin: !1 }, a); var e = a.extension, b = a.minHeight ? a.minHeight : 0; this.each(function () { b = Math.max(b, d(this).outerHeight()) }); a.maxHeight && b > a.maxHeight && (b = a.maxHeight); return this.each(function () { var c = d(this), f = c.innerHeight() - c.height() + (c.outerHeight(a.includeMargin) - c.innerHeight()); a.overflow ? c.css({ height: b - f + e, overflow: a.overflow }) : c.css({ \"min-height\": b - f + e }) }) } })(jQuery);\n }\n\n /*!\n * imagesLoaded v4.1.1\n * JavaScript is all like \"You images are done yet or what?\"\n * MIT License\n */\n if (HawkSearch.loadPlugins.imagesLoaded == true) {\n !function (a, b) { \"function\" == typeof define && define.amd ? define(\"ev-emitter/ev-emitter\", b) : \"object\" == typeof module && module.exports ? module.exports = b() : a.EvEmitter = b() }(\"undefined\" != typeof window ? window : this, function () { function a() { } var b = a.prototype; return b.on = function (a, b) { if (a && b) { var c = this._events = this._events || {}, d = c[a] = c[a] || []; return d.indexOf(b) == -1 && d.push(b), this } }, b.once = function (a, b) { if (a && b) { this.on(a, b); var c = this._onceEvents = this._onceEvents || {}, d = c[a] = c[a] || {}; return d[b] = !0, this } }, b.off = function (a, b) { var c = this._events && this._events[a]; if (c && c.length) { var d = c.indexOf(b); return d != -1 && c.splice(d, 1), this } }, b.emitEvent = function (a, b) { var c = this._events && this._events[a]; if (c && c.length) { var d = 0, e = c[d]; b = b || []; for (var f = this._onceEvents && this._onceEvents[a]; e;) { var g = f && f[e]; g && (this.off(a, e), delete f[e]), e.apply(this, b), d += g ? 0 : 1, e = c[d] } return this } }, a }), function (a, b) { \"use strict\"; \"function\" == typeof define && define.amd ? define([\"ev-emitter/ev-emitter\"], function (c) { return b(a, c) }) : \"object\" == typeof module && module.exports ? module.exports = b(a, require(\"ev-emitter\")) : a.imagesLoaded = b(a, a.EvEmitter) }(window, function (b, c) { function f(a, b) { for (var c in b) a[c] = b[c]; return a } function g(a) { var b = []; if (Array.isArray(a)) b = a; else if (\"number\" == typeof a.length) for (var c = 0; c < a.length; c++) b.push(a[c]); else b.push(a); return b } function h(a, b, c) { return this instanceof h ? (\"string\" == typeof a && (a = document.querySelectorAll(a)), this.elements = g(a), this.options = f({}, this.options), \"function\" == typeof b ? c = b : f(this.options, b), c && this.on(\"always\", c), this.getImages(), d && (this.jqDeferred = new d.Deferred), void setTimeout(function () { this.check() }.bind(this))) : new h(a, b, c) } function j(a) { this.img = a } function k(a, b) { this.url = a, this.element = b, this.img = new Image } var d = d, e = b.console; h.prototype = Object.create(c.prototype), h.prototype.options = {}, h.prototype.getImages = function () { this.images = [], this.elements.forEach(this.addElementImages, this) }, h.prototype.addElementImages = function (a) { \"IMG\" == a.nodeName && this.addImage(a), this.options.background === !0 && this.addElementBackgroundImages(a); var b = a.nodeType; if (b && i[b]) { for (var c = a.querySelectorAll(\"img\"), d = 0; d < c.length; d++) { var e = c[d]; this.addImage(e) } if (\"string\" == typeof this.options.background) { var f = a.querySelectorAll(this.options.background); for (d = 0; d < f.length; d++) { var g = f[d]; this.addElementBackgroundImages(g) } } } }; var i = { 1: !0, 9: !0, 11: !0 }; return h.prototype.addElementBackgroundImages = function (a) { var b = getComputedStyle(a); if (b) for (var c = /url\\((['\"])?(.*?)\\1\\)/gi, d = c.exec(b.backgroundImage); null !== d;) { var e = d && d[2]; e && this.addBackground(e, a), d = c.exec(b.backgroundImage) } }, h.prototype.addImage = function (a) { var b = new j(a); this.images.push(b) }, h.prototype.addBackground = function (a, b) { var c = new k(a, b); this.images.push(c) }, h.prototype.check = function () { function b(b, c, d) { setTimeout(function () { a.progress(b, c, d) }) } var a = this; return this.progressedCount = 0, this.hasAnyBroken = !1, this.images.length ? void this.images.forEach(function (a) { a.once(\"progress\", b), a.check() }) : void this.complete() }, h.prototype.progress = function (a, b, c) { this.progressedCount++ , this.hasAnyBroken = this.hasAnyBroken || !a.isLoaded, this.emitEvent(\"progress\", [this, a, b]), this.jqDeferred && this.jqDeferred.notify && this.jqDeferred.notify(this, a), this.progressedCount == this.images.length && this.complete(), this.options.debug && e && e.log(\"progress: \" + c, a, b) }, h.prototype.complete = function () { var a = this.hasAnyBroken ? \"fail\" : \"done\"; if (this.isComplete = !0, this.emitEvent(a, [this]), this.emitEvent(\"always\", [this]), this.jqDeferred) { var b = this.hasAnyBroken ? \"reject\" : \"resolve\"; this.jqDeferred[b](this) } }, j.prototype = Object.create(c.prototype), j.prototype.check = function () { var a = this.getIsImageComplete(); return a ? void this.confirm(0 !== this.img.naturalWidth, \"naturalWidth\") : (this.proxyImage = new Image, this.proxyImage.addEventListener(\"load\", this), this.proxyImage.addEventListener(\"error\", this), this.img.addEventListener(\"load\", this), this.img.addEventListener(\"error\", this), void (this.proxyImage.src = this.img.src)) }, j.prototype.getIsImageComplete = function () { return this.img.complete && void 0 !== this.img.naturalWidth }, j.prototype.confirm = function (a, b) { this.isLoaded = a, this.emitEvent(\"progress\", [this, this.img, b]) }, j.prototype.handleEvent = function (a) { var b = \"on\" + a.type; this[b] && this[b](a) }, j.prototype.onload = function () { this.confirm(!0, \"onload\"), this.unbindEvents() }, j.prototype.onerror = function () { this.confirm(!1, \"onerror\"), this.unbindEvents() }, j.prototype.unbindEvents = function () { this.proxyImage.removeEventListener(\"load\", this), this.proxyImage.removeEventListener(\"error\", this), this.img.removeEventListener(\"load\", this), this.img.removeEventListener(\"error\", this) }, k.prototype = Object.create(j.prototype), k.prototype.check = function () { this.img.addEventListener(\"load\", this), this.img.addEventListener(\"error\", this), this.img.src = this.url; var a = this.getIsImageComplete(); a && (this.confirm(0 !== this.img.naturalWidth, \"naturalWidth\"), this.unbindEvents()) }, k.prototype.unbindEvents = function () { this.img.removeEventListener(\"load\", this), this.img.removeEventListener(\"error\", this) }, k.prototype.confirm = function (a, b) { this.isLoaded = a, this.emitEvent(\"progress\", [this, this.element, b]) }, h.makeJQueryPlugin = function (a) { a = a || d, a && (d = a, d.fn.imagesLoaded = function (a, b) { var c = new h(this, a, b); return c.jqDeferred.promise(d(this)) }) }, h.makeJQueryPlugin(), h });\n }\n\n /*\n * jQuery cookie\n */\n if (HawkSearch.loadPlugins.jQueryCookie == true) {\n HawkSearch.jQuery.cookie = function (name, value, options) {\n if (typeof value != 'undefined') { // name and value given, set cookie\n options = options || {\n };\n if (value === null) {\n value = '';\n options.expires = -1;\n }\n var expires = '';\n if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {\n var date;\n if (typeof options.expires == 'number') {\n date = new Date();\n date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));\n } else {\n date = options.expires;\n }\n expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE\n }\n // CAUTION: Needed to parenthesize options.path and options.domain\n // in the following expressions, otherwise they evaluate to undefined\n // in the packed version for some reason...\n var path = options.path ? '; path=' + (options.path) : '';\n var domain = options.domain ? '; domain=' + (options.domain) : '';\n var secure = options.secure ? '; secure' : '';\n document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');\n } else { // only name given, get cookie\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n\n var cookie = cookies[i].trim();\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }\n };\n }\n\n\n\n // register indexOf() method if browser does not natively support it\n // this algorithm is exactly as specified in ECMA-262 standard, 5th edition, assuming Object, TypeError, Number, Math.floor, Math.abs, and Math.max have their original value.\n // see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf for more details\n if (HawkSearch.loadPlugins.indexOf == true) {\n if (!Array.prototype.indexOf) {\n Array.prototype.indexOf = function (searchElement /*, fromIndex */) {\n \"use strict\";\n if (this == null) {\n throw new TypeError();\n }\n var t = Object(this);\n var len = t.length >>> 0;\n if (len === 0) {\n return -1;\n }\n var n = 0;\n if (arguments.length > 0) {\n n = Number(arguments[1]);\n if (n != n) { // shortcut for verifying if it's NaN\n n = 0;\n } else if (n != 0 && n != Infinity && n != -Infinity) {\n n = (n > 0 || -1) * Math.floor(Math.abs(n));\n }\n }\n if (n >= len) {\n return -1;\n }\n var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\n for (; k < len; k++) {\n if (k in t && t[k] === searchElement) {\n return k;\n }\n }\n return -1;\n }\n }\n }\n\n /*\n * WebUI-Popover\n * Version: 1.2.1\n *\n */\n if (HawkSearch.loadPlugins.webUIPopover == true) {\n !function (a, b, c) { \"use strict\"; !function (a) { \"function\" == typeof define && define.amd ? define([\"jquery\"], a) : \"object\" == typeof exports ? module.exports = a(require(\"jquery\")) : a(HawkSearch.jQuery) }(function (d) { function v(a, b) { return this.$element = d(a), b && (\"string\" !== d.type(b.delay) && \"number\" !== d.type(b.delay) || (b.delay = { show: b.delay, hide: b.delay })), this.options = d.extend({}, h, b), this._defaults = h, this._name = e, this._targetclick = !1, this.init(), j.push(this.$element), this } var e = \"webuiPopover\", f = \"webui-popover\", g = \"webui.popover\", h = { placement: \"auto\", container: null, width: \"auto\", height: \"auto\", trigger: \"click\", style: \"\", selector: !1, delay: { show: null, hide: 300 }, async: { type: \"GET\", before: null, success: null, error: null }, cache: !0, multi: !1, arrow: !0, title: \"\", content: \"\", closeable: !1, padding: !0, url: \"\", type: \"html\", direction: \"\", animation: null, template: '<div class=\"webui-popover\"><div class=\"webui-arrow\"></div><div class=\"webui-popover-inner\"><a href=\"#\" class=\"close\"></a><h3 class=\"webui-popover-title\"></h3><div class=\"webui-popover-content\"><i class=\"icon-refresh\"></i> <p>&nbsp;</p></div></div></div>', backdrop: !1, dismissible: !0, onShow: null, onHide: null, abortXHR: !0, autoHide: !1, offsetTop: 0, offsetLeft: 0, iframeOptions: { frameborder: \"0\", allowtransparency: \"true\", id: \"\", name: \"\", scrolling: \"\", onload: \"\", height: \"\", width: \"\" }, hideEmpty: !1 }, i = f + \"-rtl\", j = [], k = d('<div class=\"webui-popover-backdrop\"></div>'), l = 0, m = !1, n = -2e3, o = d(b), p = function (a, b) { return isNaN(a) ? b || 0 : Number(a) }, q = function (a) { return a.data(\"plugin_\" + e) }, r = function () { for (var a = null, b = 0; b < j.length; b++) a = q(j[b]), a && a.hide(!0); o.trigger(\"hiddenAll.\" + g) }, s = function (a) { for (var b = null, c = 0; c < j.length; c++) b = q(j[c]), b && b.id !== a.id && b.hide(!0); o.trigger(\"hiddenAll.\" + g) }, t = \"ontouchstart\" in b.documentElement && /Mobi/.test(navigator.userAgent), u = function (a) { var b = { x: 0, y: 0 }; if (\"touchstart\" === a.type || \"touchmove\" === a.type || \"touchend\" === a.type || \"touchcancel\" === a.type) { var c = a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]; b.x = c.pageX, b.y = c.pageY } else \"mousedown\" !== a.type && \"mouseup\" !== a.type && \"click\" !== a.type || (b.x = a.pageX, b.y = a.pageY); return b }; v.prototype = { init: function () { if (this.$element[0] instanceof b.constructor && !this.options.selector) throw new Error(\"`selector` option must be specified when initializing \" + this.type + \" on the window.document object!\"); \"manual\" !== this.getTrigger() && (\"click\" === this.getTrigger() || t ? this.$element.off(\"click touchend\", this.options.selector).on(\"click touchend\", this.options.selector, d.proxy(this.toggle, this)) : \"hover\" === this.getTrigger() && this.$element.off(\"mouseenter mouseleave click\", this.options.selector).on(\"mouseenter\", this.options.selector, d.proxy(this.mouseenterHandler, this)).on(\"mouseleave\", this.options.selector, d.proxy(this.mouseleaveHandler, this))), this._poped = !1, this._inited = !0, this._opened = !1, this._idSeed = l, this.id = e + this._idSeed, this.options.container = d(this.options.container || b.body).first(), this.options.backdrop && k.appendTo(this.options.container).hide(), l++ , \"sticky\" === this.getTrigger() && this.show(), this.options.selector && (this._options = d.extend({}, this.options, { selector: \"\" })) }, destroy: function () { for (var a = -1, b = 0; b < j.length; b++) if (j[b] === this.$element) { a = b; break } j.splice(a, 1), this.hide(), this.$element.data(\"plugin_\" + e, null), \"click\" === this.getTrigger() ? this.$element.off(\"click\") : \"hover\" === this.getTrigger() && this.$element.off(\"mouseenter mouseleave\"), this.$target && this.$target.remove() }, getDelegateOptions: function () { var a = {}; return this._options && d.each(this._options, function (b, c) { h[b] !== c && (a[b] = c) }), a }, hide: function (a, b) { if ((a || \"sticky\" !== this.getTrigger()) && this._opened) { b && (b.preventDefault(), b.stopPropagation()), this.xhr && this.options.abortXHR === !0 && (this.xhr.abort(), this.xhr = null); var c = d.Event(\"hide.\" + g); if (this.$element.trigger(c, [this.$target]), this.$target) { this.$target.removeClass(\"in\").addClass(this.getHideAnimation()); var e = this; setTimeout(function () { e.$target.hide(), e.getCache() || e.$target.remove() }, e.getHideDelay()) } this.options.backdrop && k.hide(), this._opened = !1, this.$element.trigger(\"hidden.\" + g, [this.$target]), this.options.onHide && this.options.onHide(this.$target) } }, resetAutoHide: function () { var a = this, b = a.getAutoHide(); b && (a.autoHideHandler && clearTimeout(a.autoHideHandler), a.autoHideHandler = setTimeout(function () { a.hide() }, b)) }, delegate: function (a) { var b = d(a).data(\"plugin_\" + e); return b || (b = new v(a, this.getDelegateOptions()), d(a).data(\"plugin_\" + e, b)), b }, toggle: function (a) { var b = this; a && (a.preventDefault(), a.stopPropagation(), this.options.selector && (b = this.delegate(a.currentTarget))), b[b.getTarget().hasClass(\"in\") ? \"hide\" : \"show\"]() }, hideAll: function () { r() }, hideOthers: function () { s(this) }, show: function () { if (!this._opened) { var a = this.getTarget().removeClass().addClass(f).addClass(this._customTargetClass); if (this.options.multi || this.hideOthers(), !this.getCache() || !this._poped || \"\" === this.content) { if (this.content = \"\", this.setTitle(this.getTitle()), this.options.closeable || a.find(\".close\").off(\"click\").remove(), this.isAsync() ? this.setContentASync(this.options.content) : this.setContent(this.getContent()), this.canEmptyHide() && \"\" === this.content) return; a.show() } this.displayContent(), this.options.onShow && this.options.onShow(a), this.bindBodyEvents(), this.options.backdrop && k.show(), this._opened = !0, this.resetAutoHide() } }, displayContent: function () { var a = this.getElementPosition(), b = this.getTarget().removeClass().addClass(f).addClass(this._customTargetClass), c = this.getContentElement(), e = b[0].offsetWidth, h = b[0].offsetHeight, j = \"bottom\", k = d.Event(\"show.\" + g); if (this.canEmptyHide()) { var l = c.children().html(); if (null !== l && 0 === l.trim().length) return } this.$element.trigger(k, [b]); var m = this.$element.data(\"width\") || this.options.width; \"\" === m && (m = this._defaults.width), \"auto\" !== m && b.width(m); var o = this.$element.data(\"height\") || this.options.height; \"\" === o && (o = this._defaults.height), \"auto\" !== o && c.height(o), this.options.style && this.$target.addClass(f + \"-\" + this.options.style), \"rtl\" !== this.options.direction || c.hasClass(i) || c.addClass(i), this.options.arrow || b.find(\".webui-arrow\").remove(), b.detach().css({ top: n, left: n, display: \"block\" }), this.getAnimation() && b.addClass(this.getAnimation()), b.appendTo(this.options.container), j = this.getPlacement(a), this.$element.trigger(\"added.\" + g), this.initTargetEvents(), this.options.padding || (\"auto\" !== this.options.height && c.css(\"height\", c.outerHeight()), this.$target.addClass(\"webui-no-padding\")), e = b[0].offsetWidth, h = b[0].offsetHeight; var p = this.getTargetPositin(a, j, e, h); if (this.$target.css(p.position).addClass(j).addClass(\"in\"), \"iframe\" === this.options.type) { var q = b.find(\"iframe\"), r = b.width(), s = q.parent().height(); \"\" !== this.options.iframeOptions.width && \"auto\" !== this.options.iframeOptions.width && (r = this.options.iframeOptions.width), \"\" !== this.options.iframeOptions.height && \"auto\" !== this.options.iframeOptions.height && (s = this.options.iframeOptions.height), q.width(r).height(s) } if (this.options.arrow || this.$target.css({ margin: 0 }), this.options.arrow) { var t = this.$target.find(\".webui-arrow\"); t.removeAttr(\"style\"), \"left\" === j || \"right\" === j ? t.css({ top: this.$target.height() / 2 }) : \"top\" !== j && \"bottom\" !== j || t.css({ left: this.$target.width() / 2 }), p.arrowOffset && (p.arrowOffset.left === -1 || p.arrowOffset.top === -1 ? t.hide() : t.css(p.arrowOffset)) } this._poped = !0, this.$element.trigger(\"shown.\" + g, [this.$target]) }, isTargetLoaded: function () { return 0 === this.getTarget().find(\"i.glyphicon-refresh\").length }, getTriggerElement: function () { return this.$element }, getTarget: function () { if (!this.$target) { var a = e + this._idSeed; this.$target = d(this.options.template).attr(\"id\", a), this._customTargetClass = this.$target.attr(\"class\") !== f ? this.$target.attr(\"class\") : null, this.getTriggerElement().attr(\"data-target\", a) } return this.$target.data(\"trigger-element\") || this.$target.data(\"trigger-element\", this.getTriggerElement()), this.$target }, removeTarget: function () { this.$target.remove(), this.$target = null, this.$contentElement = null }, getTitleElement: function () { return this.getTarget().find(\".\" + f + \"-title\") }, getContentElement: function () { return this.$contentElement || (this.$contentElement = this.getTarget().find(\".\" + f + \"-content\")), this.$contentElement }, getTitle: function () { return this.$element.attr(\"data-title\") || this.options.title || this.$element.attr(\"title\") }, getUrl: function () { return this.$element.attr(\"data-url\") || this.options.url }, getAutoHide: function () { return this.$element.attr(\"data-auto-hide\") || this.options.autoHide }, getOffsetTop: function () { return p(this.$element.attr(\"data-offset-top\")) || this.options.offsetTop }, getOffsetLeft: function () { return p(this.$element.attr(\"data-offset-left\")) || this.options.offsetLeft }, getCache: function () { var a = this.$element.attr(\"data-cache\"); if (\"undefined\" != typeof a) switch (a.toLowerCase()) { case \"true\": case \"yes\": case \"1\": return !0; case \"false\": case \"no\": case \"0\": return !1 } return this.options.cache }, getTrigger: function () { return this.$element.attr(\"data-trigger\") || this.options.trigger }, getDelayShow: function () { var a = this.$element.attr(\"data-delay-show\"); return \"undefined\" != typeof a ? a : 0 === this.options.delay.show ? 0 : this.options.delay.show || 100 }, getHideDelay: function () { var a = this.$element.attr(\"data-delay-hide\"); return \"undefined\" != typeof a ? a : 0 === this.options.delay.hide ? 0 : this.options.delay.hide || 100 }, getAnimation: function () { var a = this.$element.attr(\"data-animation\"); return a || this.options.animation }, getHideAnimation: function () { var a = this.getAnimation(); return a ? a + \"-out\" : \"out\" }, setTitle: function (a) { var b = this.getTitleElement(); a ? (\"rtl\" !== this.options.direction || b.hasClass(i) || b.addClass(i), b.html(a)) : b.remove() }, hasContent: function () { return this.getContent() }, canEmptyHide: function () { return this.options.hideEmpty && \"html\" === this.options.type }, getIframe: function () { var a = d(\"<iframe></iframe>\").attr(\"src\", this.getUrl()), b = this; return d.each(this._defaults.iframeOptions, function (c) { \"undefined\" != typeof b.options.iframeOptions[c] && a.attr(c, b.options.iframeOptions[c]) }), a }, getContent: function () { if (this.getUrl()) switch (this.options.type) { case \"iframe\": this.content = this.getIframe(); break; case \"html\": try { this.content = d(this.getUrl()), this.content.is(\":visible\") || this.content.show() } catch (a) { throw new Error(\"Unable to get popover content. Invalid selector specified.\") } } else if (!this.content) { var a = \"\"; if (a = d.isFunction(this.options.content) ? this.options.content.apply(this.$element[0], [this]) : this.options.content, this.content = this.$element.attr(\"data-content\") || a, !this.content) { var b = this.$element.next(); b && b.hasClass(f + \"-content\") && (this.content = b) } } return this.content }, setContent: function (a) { var b = this.getTarget(), c = this.getContentElement(); \"string\" == typeof a ? c.html(a) : a instanceof d && (c.html(\"\"), this.options.cache ? a.removeClass(f + \"-content\").appendTo(c) : a.clone(!0, !0).removeClass(f + \"-content\").appendTo(c)), this.$target = b }, isAsync: function () { return \"async\" === this.options.type }, setContentASync: function (a) { var b = this; this.xhr || (this.xhr = d.ajax({ url: this.getUrl(), type: this.options.async.type, cache: this.getCache(), beforeSend: function (a) { b.options.async.before && b.options.async.before(b, a) }, success: function (c) { b.bindBodyEvents(), a && d.isFunction(a) ? b.content = a.apply(b.$element[0], [c]) : b.content = c, b.setContent(b.content); var e = b.getContentElement(); e.removeAttr(\"style\"), b.displayContent(), b.options.async.success && b.options.async.success(b, c) }, complete: function () { b.xhr = null }, error: function (a, c) { b.options.async.error && b.options.async.error(b, a, c) } })) }, bindBodyEvents: function () { m || (this.options.dismissible && \"click\" === this.getTrigger() ? (o.off(\"keyup.webui-popover\").on(\"keyup.webui-popover\", d.proxy(this.escapeHandler, this)), o.off(\"click.webui-popover touchend.webui-popover\").on(\"click.webui-popover touchend.webui-popover\", d.proxy(this.bodyClickHandler, this))) : \"hover\" === this.getTrigger() && o.off(\"touchend.webui-popover\").on(\"touchend.webui-popover\", d.proxy(this.bodyClickHandler, this))) }, mouseenterHandler: function (a) { var b = this; a && this.options.selector && (b = this.delegate(a.currentTarget)), b._timeout && clearTimeout(b._timeout), b._enterTimeout = setTimeout(function () { b.getTarget().is(\":visible\") || b.show() }, this.getDelayShow()) }, mouseleaveHandler: function () { var a = this; clearTimeout(a._enterTimeout), a._timeout = setTimeout(function () { a.hide() }, this.getHideDelay()) }, escapeHandler: function (a) { 27 === a.keyCode && this.hideAll() }, bodyClickHandler: function (a) { m = !0; for (var b = !0, c = 0; c < j.length; c++) { var d = q(j[c]); if (d && d._opened) { var e = d.getTarget().offset(), f = e.left, g = e.top, h = e.left + d.getTarget().width(), i = e.top + d.getTarget().height(), k = u(a), l = k.x >= f && k.x <= h && k.y >= g && k.y <= i; if (l) { b = !1; break } } } b && r() }, initTargetEvents: function () { \"hover\" === this.getTrigger() && this.$target.off(\"mouseenter mouseleave\").on(\"mouseenter\", d.proxy(this.mouseenterHandler, this)).on(\"mouseleave\", d.proxy(this.mouseleaveHandler, this)), this.$target.find(\".close\").off(\"click\").on(\"click\", d.proxy(this.hide, this, !0)) }, getPlacement: function (a) { var b, c = this.options.container, d = c.innerWidth(), e = c.innerHeight(), f = c.scrollTop(), g = c.scrollLeft(), h = Math.max(0, a.left - g), i = Math.max(0, a.top - f); b = \"function\" == typeof this.options.placement ? this.options.placement.call(this, this.getTarget()[0], this.$element[0]) : this.$element.data(\"placement\") || this.options.placement; var j = \"horizontal\" === b, k = \"vertical\" === b, l = \"auto\" === b || j || k; return l ? b = h < d / 3 ? i < e / 3 ? j ? \"right-bottom\" : \"bottom-right\" : i < 2 * e / 3 ? k ? i <= e / 2 ? \"bottom-right\" : \"top-right\" : \"right\" : j ? \"right-top\" : \"top-right\" : h < 2 * d / 3 ? i < e / 3 ? j ? h <= d / 2 ? \"right-bottom\" : \"left-bottom\" : \"bottom\" : i < 2 * e / 3 ? j ? h <= d / 2 ? \"right\" : \"left\" : i <= e / 2 ? \"bottom\" : \"top\" : j ? h <= d / 2 ? \"right-top\" : \"left-top\" : \"top\" : i < e / 3 ? j ? \"left-bottom\" : \"bottom-left\" : i < 2 * e / 3 ? k ? i <= e / 2 ? \"bottom-left\" : \"top-left\" : \"left\" : j ? \"left-top\" : \"top-left\" : \"auto-top\" === b ? b = h < d / 3 ? \"top-right\" : h < 2 * d / 3 ? \"top\" : \"top-left\" : \"auto-bottom\" === b ? b = h < d / 3 ? \"bottom-right\" : h < 2 * d / 3 ? \"bottom\" : \"bottom-left\" : \"auto-left\" === b ? b = i < e / 3 ? \"left-top\" : i < 2 * e / 3 ? \"left\" : \"left-bottom\" : \"auto-right\" === b && (b = i < e / 3 ? \"right-bottom\" : i < 2 * e / 3 ? \"right\" : \"right-top\"), b }, getElementPosition: function () { var a = this.$element[0].getBoundingClientRect(), c = this.options.container, e = c.css(\"position\"); if (c.is(b.body) || \"static\" === e) return d.extend({}, this.$element.offset(), { width: this.$element[0].offsetWidth || a.width, height: this.$element[0].offsetHeight || a.height }); if (\"fixed\" === e) { var f = c[0].getBoundingClientRect(); return { top: a.top - f.top + c.scrollTop(), left: a.left - f.left + c.scrollLeft(), width: a.width, height: a.height } } return \"relative\" === e ? { top: this.$element.offset().top - c.offset().top, left: this.$element.offset().left - c.offset().left, width: this.$element[0].offsetWidth || a.width, height: this.$element[0].offsetHeight || a.height } : void 0 }, getTargetPositin: function (a, c, d, e) { var f = a, g = this.options.container, h = this.$element.outerWidth(), i = this.$element.outerHeight(), j = b.documentElement.scrollTop + g.scrollTop(), k = b.documentElement.scrollLeft + g.scrollLeft(), l = {}, m = null, o = this.options.arrow ? 20 : 0, p = 10, q = h < o + p ? o : 0, r = i < o + p ? o : 0, s = 0, t = b.documentElement.clientHeight + j, u = b.documentElement.clientWidth + k, v = f.left + f.width / 2 - q > 0, w = f.left + f.width / 2 + q < u, x = f.top + f.height / 2 - r > 0, y = f.top + f.height / 2 + r < t; switch (c) { case \"bottom\": l = { top: f.top + f.height, left: f.left + f.width / 2 - d / 2 }; break; case \"top\": l = { top: f.top - e, left: f.left + f.width / 2 - d / 2 }; break; case \"left\": l = { top: f.top + f.height / 2 - e / 2, left: f.left - d }; break; case \"right\": l = { top: f.top + f.height / 2 - e / 2, left: f.left + f.width }; break; case \"top-right\": l = { top: f.top - e, left: v ? f.left - q : p }, m = { left: v ? Math.min(h, d) / 2 + q : n }; break; case \"top-left\": s = w ? q : -p, l = { top: f.top - e, left: f.left - d + f.width + s }, m = { left: w ? d - Math.min(h, d) / 2 - q : n }; break; case \"bottom-right\": l = { top: f.top + f.height, left: v ? f.left - q : p }, m = { left: v ? Math.min(h, d) / 2 + q : n }; break; case \"bottom-left\": s = w ? q : -p, l = { top: f.top + f.height, left: f.left - d + f.width + s }, m = { left: w ? d - Math.min(h, d) / 2 - q : n }; break; case \"right-top\": s = y ? r : -p, l = { top: f.top - e + f.height + s, left: f.left + f.width }, m = { top: y ? e - Math.min(i, e) / 2 - r : n }; break; case \"right-bottom\": l = { top: x ? f.top - r : p, left: f.left + f.width }, m = { top: x ? Math.min(i, e) / 2 + r : n }; break; case \"left-top\": s = y ? r : -p, l = { top: f.top - e + f.height + s, left: f.left - d }, m = { top: y ? e - Math.min(i, e) / 2 - r : n }; break; case \"left-bottom\": l = { top: x ? f.top - r : p, left: f.left - d }, m = { top: x ? Math.min(i, e) / 2 + r : n } } return l.top += this.getOffsetTop(), l.left += this.getOffsetLeft(), { position: l, arrowOffset: m } } }, d.fn[e] = function (a, b) { var c = [], f = this.each(function () { var f = d.data(this, \"plugin_\" + e); f ? \"destroy\" === a ? f.destroy() : \"string\" == typeof a && c.push(f[a]()) : (a ? \"string\" == typeof a ? \"destroy\" !== a && (b || (f = new v(this, null), c.push(f[a]()))) : \"object\" == typeof a && (f = new v(this, a)) : f = new v(this, null), d.data(this, \"plugin_\" + e, f)) }); return c.length ? c : f }; var w = function () { var a = function () { r() }, b = function (a, b) { b = b || {}, d(a).webuiPopover(b) }, f = function (a) { var b = !0; return d(a).each(function (a) { b = b && d(a).data(\"plugin_\" + e) !== c }), b }, g = function (a, b) { b ? d(a).webuiPopover(b).webuiPopover(\"show\") : d(a).webuiPopover(\"show\") }, h = function (a) { d(a).webuiPopover(\"hide\") }, i = function (a, b) { var c = d(a).data(\"plugin_\" + e); if (c) { var f = c.getCache(); c.options.cache = !1, c.options.content = b, c._opened ? (c._opened = !1, c.show()) : c.isAsync() ? c.setContentASync(b) : c.setContent(b), c.options.cache = f } }; return { show: g, hide: h, create: b, isCreated: f, hideAll: a, updateContent: i } }(); a.WebuiPopovers = w }) }(window, document);\n }\n /*\n * debouncedresize: special jQuery event that happens once after a window resize\n *\n * latest version and complete README available on Github:\n * https://github.com/louisremi/jquery-smartresize\n *\n * Copyright 2012 @louis_remi\n * Licensed under the MIT license.\n *\n * This saved you an hour of work?\n * Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON\n */\n if (HawkSearch.loadPlugins.debounce == true) {\n (function ($) {\n\n var $event = $.event,\n $special,\n resizeTimeout;\n\n $special = $event.special.debouncedresize = {\n setup: function () {\n $(this).on(\"resize\", $special.handler);\n },\n teardown: function () {\n $(this).off(\"resize\", $special.handler);\n },\n handler: function (event, execAsap) {\n // Save the context\n var context = this,\n args = arguments,\n dispatch = function () {\n // set correct event type\n event.type = \"debouncedresize\";\n $event.dispatch.apply(context, args);\n };\n\n if (resizeTimeout) {\n clearTimeout(resizeTimeout);\n }\n\n execAsap ?\n dispatch() :\n resizeTimeout = setTimeout(dispatch, $special.threshold);\n },\n threshold: 150\n };\n\n })(jQuery);\n }\n\n /*\n _ _ _ _\n ___| (_) ___| | __ (_)___\n / __| | |/ __| |/ / | / __|\n \\__ \\ | | (__| < _ | \\__ \\\n |___/_|_|\\___|_|\\_(_)/ |___/\n |__/\n\n Version: 1.4.1\n Author: Ken Wheeler\n Website: http://kenwheeler.github.io\n Docs: http://kenwheeler.github.io/slick\n Repo: http://github.com/kenwheeler/slick\n Issues: http://github.com/kenwheeler/slick/issues\n\n */\n if (HawkSearch.loadPlugins.slick == true) {\n !function (a) { \"use strict\"; \"function\" == typeof define && define.amd ? define([\"jquery\"], a) : \"undefined\" != typeof exports ? module.exports = a(require(\"jquery\")) : a(jQuery) }(function (a) {\n \"use strict\"; var b = window.Slick || {\n }; b = function () { function c(c, d) { var f, g, h, e = this; if (e.defaults = { accessibility: !0, adaptiveHeight: !1, appendArrows: a(c), appendDots: a(c), arrows: !0, asNavFor: null, prevArrow: '<button type=\"button\" data-role=\"none\" class=\"slick-prev\">Previous</button>', nextArrow: '<button type=\"button\" data-role=\"none\" class=\"slick-next\">Next</button>', autoplay: !1, autoplaySpeed: 3e3, centerMode: !1, centerPadding: \"50px\", cssEase: \"ease\", customPaging: function (a, b) { return '<button type=\"button\" data-role=\"none\">' + (b + 1) + \"</button>\" }, dots: !1, dotsClass: \"slick-dots\", draggable: !0, easing: \"linear\", edgeFriction: .35, fade: !1, focusOnSelect: !1, infinite: !0, initialSlide: 0, lazyLoad: \"ondemand\", mobileFirst: !1, pauseOnHover: !0, pauseOnDotsHover: !1, respondTo: \"window\", responsive: null, rtl: !1, slide: \"\", slidesToShow: 1, slidesToScroll: 1, speed: 500, swipe: !0, swipeToSlide: !1, touchMove: !0, touchThreshold: 5, useCSS: !0, variableWidth: !1, vertical: !1, waitForAnimate: !0 }, e.initials = { animating: !1, dragging: !1, autoPlayTimer: null, currentDirection: 0, currentLeft: null, currentSlide: 0, direction: 1, $dots: null, listWidth: null, listHeight: null, loadIndex: 0, $nextArrow: null, $prevArrow: null, slideCount: null, slideWidth: null, $slideTrack: null, $slides: null, sliding: !1, slideOffset: 0, swipeLeft: null, $list: null, touchObject: {}, transformsEnabled: !1 }, a.extend(e, e.initials), e.activeBreakpoint = null, e.animType = null, e.animProp = null, e.breakpoints = [], e.breakpointSettings = [], e.cssTransitions = !1, e.hidden = \"hidden\", e.paused = !1, e.positionProp = null, e.respondTo = null, e.shouldClick = !0, e.$slider = a(c), e.$slidesCache = null, e.transformType = null, e.transitionType = null, e.visibilityChange = \"visibilitychange\", e.windowWidth = 0, e.windowTimer = null, f = a(c).data(\"slick\") || {}, e.options = a.extend({}, e.defaults, f, d), e.currentSlide = e.options.initialSlide, e.originalSettings = e.options, g = e.options.responsive || null, g && g.length > -1) { e.respondTo = e.options.respondTo || \"window\"; for (h in g) g.hasOwnProperty(h) && (e.breakpoints.push(g[h].breakpoint), e.breakpointSettings[g[h].breakpoint] = g[h].settings); e.breakpoints.sort(function (a, b) { return e.options.mobileFirst === !0 ? a - b : b - a }) } \"undefined\" != typeof document.mozHidden ? (e.hidden = \"mozHidden\", e.visibilityChange = \"mozvisibilitychange\") : \"undefined\" != typeof document.msHidden ? (e.hidden = \"msHidden\", e.visibilityChange = \"msvisibilitychange\") : \"undefined\" != typeof document.webkitHidden && (e.hidden = \"webkitHidden\", e.visibilityChange = \"webkitvisibilitychange\"), e.autoPlay = a.proxy(e.autoPlay, e), e.autoPlayClear = a.proxy(e.autoPlayClear, e), e.changeSlide = a.proxy(e.changeSlide, e), e.clickHandler = a.proxy(e.clickHandler, e), e.selectHandler = a.proxy(e.selectHandler, e), e.setPosition = a.proxy(e.setPosition, e), e.swipeHandler = a.proxy(e.swipeHandler, e), e.dragHandler = a.proxy(e.dragHandler, e), e.keyHandler = a.proxy(e.keyHandler, e), e.autoPlayIterator = a.proxy(e.autoPlayIterator, e), e.instanceUid = b++, e.htmlExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*)$/, e.init(), e.checkResponsive(!0) } var b = 0; return c }(), b.prototype.addSlide = b.prototype.slickAdd = function (b, c, d) { var e = this; if (\"boolean\" == typeof c) d = c, c = null; else if (0 > c || c >= e.slideCount) return !1; e.unload(), \"number\" == typeof c ? 0 === c && 0 === e.$slides.length ? a(b).appendTo(e.$slideTrack) : d ? a(b).insertBefore(e.$slides.eq(c)) : a(b).insertAfter(e.$slides.eq(c)) : d === !0 ? a(b).prependTo(e.$slideTrack) : a(b).appendTo(e.$slideTrack), e.$slides = e.$slideTrack.children(this.options.slide), e.$slideTrack.children(this.options.slide).detach(), e.$slideTrack.append(e.$slides), e.$slides.each(function (b, c) { a(c).attr(\"data-slick-index\", b) }), e.$slidesCache = e.$slides, e.reinit() }, b.prototype.animateHeight = function () { var a = this; if (1 === a.options.slidesToShow && a.options.adaptiveHeight === !0 && a.options.vertical === !1) { var b = a.$slides.eq(a.currentSlide).outerHeight(!0); a.$list.animate({ height: b }, a.options.speed) } }, b.prototype.animateSlide = function (b, c) { var d = {}, e = this; e.animateHeight(), e.options.rtl === !0 && e.options.vertical === !1 && (b = -b), e.transformsEnabled === !1 ? e.options.vertical === !1 ? e.$slideTrack.animate({ left: b }, e.options.speed, e.options.easing, c) : e.$slideTrack.animate({ top: b }, e.options.speed, e.options.easing, c) : e.cssTransitions === !1 ? (e.options.rtl === !0 && (e.currentLeft = -e.currentLeft), a({ animStart: e.currentLeft }).animate({ animStart: b }, { duration: e.options.speed, easing: e.options.easing, step: function (a) { a = Math.ceil(a), e.options.vertical === !1 ? (d[e.animType] = \"translate(\" + a + \"px, 0px)\", e.$slideTrack.css(d)) : (d[e.animType] = \"translate(0px,\" + a + \"px)\", e.$slideTrack.css(d)) }, complete: function () { c && c.call() } })) : (e.applyTransition(), b = Math.ceil(b), d[e.animType] = e.options.vertical === !1 ? \"translate3d(\" + b + \"px, 0px, 0px)\" : \"translate3d(0px,\" + b + \"px, 0px)\", e.$slideTrack.css(d), c && setTimeout(function () { e.disableTransition(), c.call() }, e.options.speed)) }, b.prototype.asNavFor = function (b) { var c = this, d = null !== c.options.asNavFor ? a(c.options.asNavFor).slick(\"getSlick\") : null; null !== d && d.slideHandler(b, !0) }, b.prototype.applyTransition = function (a) { var b = this, c = {}; c[b.transitionType] = b.options.fade === !1 ? b.transformType + \" \" + b.options.speed + \"ms \" + b.options.cssEase : \"opacity \" + b.options.speed + \"ms \" + b.options.cssEase, b.options.fade === !1 ? b.$slideTrack.css(c) : b.$slides.eq(a).css(c) }, b.prototype.autoPlay = function () { var a = this; a.autoPlayTimer && clearInterval(a.autoPlayTimer), a.slideCount > a.options.slidesToShow && a.paused !== !0 && (a.autoPlayTimer = setInterval(a.autoPlayIterator, a.options.autoplaySpeed)) }, b.prototype.autoPlayClear = function () { var a = this; a.autoPlayTimer && clearInterval(a.autoPlayTimer) }, b.prototype.autoPlayIterator = function () { var a = this; a.options.infinite === !1 ? 1 === a.direction ? (a.currentSlide + 1 === a.slideCount - 1 && (a.direction = 0), a.slideHandler(a.currentSlide + a.options.slidesToScroll)) : (0 === a.currentSlide - 1 && (a.direction = 1), a.slideHandler(a.currentSlide - a.options.slidesToScroll)) : a.slideHandler(a.currentSlide + a.options.slidesToScroll) }, b.prototype.buildArrows = function () { var b = this; b.options.arrows === !0 && b.slideCount > b.options.slidesToShow && (b.$prevArrow = a(b.options.prevArrow), b.$nextArrow = a(b.options.nextArrow), b.htmlExpr.test(b.options.prevArrow) && b.$prevArrow.appendTo(b.options.appendArrows), b.htmlExpr.test(b.options.nextArrow) && b.$nextArrow.appendTo(b.options.appendArrows), b.options.infinite !== !0 && b.$prevArrow.addClass(\"slick-disabled\")) }, b.prototype.buildDots = function () { var c, d, b = this; if (b.options.dots === !0 && b.slideCount > b.options.slidesToShow) { for (d = '<ul class=\"' + b.options.dotsClass + '\">', c = 0; c <= b.getDotCount() ; c += 1) d += \"<li>\" + b.options.customPaging.call(this, b, c) + \"</li>\"; d += \"</ul>\", b.$dots = a(d).appendTo(b.options.appendDots), b.$dots.find(\"li\").first().addClass(\"slick-active\") } }, b.prototype.buildOut = function () { var b = this; b.$slides = b.$slider.children(b.options.slide + \":not(.slick-cloned)\").addClass(\"slick-slide\"), b.slideCount = b.$slides.length, b.$slides.each(function (b, c) { a(c).attr(\"data-slick-index\", b) }), b.$slidesCache = b.$slides, b.$slider.addClass(\"slick-slider\"), b.$slideTrack = 0 === b.slideCount ? a('<div class=\"slick-track\"/>').appendTo(b.$slider) : b.$slides.wrapAll('<div class=\"slick-track\"/>').parent(), b.$list = b.$slideTrack.wrap('<div class=\"slick-list\"/>').parent(), b.$slideTrack.css(\"opacity\", 0), (b.options.centerMode === !0 || b.options.swipeToSlide === !0) && (b.options.slidesToScroll = 1), a(\"img[data-lazy]\", b.$slider).not(\"[src]\").addClass(\"slick-loading\"), b.setupInfinite(), b.buildArrows(), b.buildDots(), b.updateDots(), b.options.accessibility === !0 && b.$list.prop(\"tabIndex\", 0), b.setSlideClasses(\"number\" == typeof this.currentSlide ? this.currentSlide : 0), b.options.draggable === !0 && b.$list.addClass(\"draggable\") }, b.prototype.checkResponsive = function (b) { var d, e, f, c = this, g = c.$slider.width(), h = window.innerWidth || a(window).width(); if (\"window\" === c.respondTo ? f = h : \"slider\" === c.respondTo ? f = g : \"min\" === c.respondTo && (f = Math.min(h, g)), c.originalSettings.responsive && c.originalSettings.responsive.length > -1 && null !== c.originalSettings.responsive) { e = null; for (d in c.breakpoints) c.breakpoints.hasOwnProperty(d) && (c.originalSettings.mobileFirst === !1 ? f < c.breakpoints[d] && (e = c.breakpoints[d]) : f > c.breakpoints[d] && (e = c.breakpoints[d])); null !== e ? null !== c.activeBreakpoint ? e !== c.activeBreakpoint && (c.activeBreakpoint = e, \"unslick\" === c.breakpointSettings[e] ? c.unslick() : (c.options = a.extend({}, c.originalSettings, c.breakpointSettings[e]), b === !0 && (c.currentSlide = c.options.initialSlide), c.refresh())) : (c.activeBreakpoint = e, \"unslick\" === c.breakpointSettings[e] ? c.unslick() : (c.options = a.extend({}, c.originalSettings, c.breakpointSettings[e]), b === !0 && (c.currentSlide = c.options.initialSlide), c.refresh())) : null !== c.activeBreakpoint && (c.activeBreakpoint = null, c.options = c.originalSettings, b === !0 && (c.currentSlide = c.options.initialSlide), c.refresh()) } }, b.prototype.changeSlide = function (b, c) { var f, g, h, d = this, e = a(b.target); switch (e.is(\"a\") && b.preventDefault(), h = 0 !== d.slideCount % d.options.slidesToScroll, f = h ? 0 : (d.slideCount - d.currentSlide) % d.options.slidesToScroll, b.data.message) { case \"previous\": g = 0 === f ? d.options.slidesToScroll : d.options.slidesToShow - f, d.slideCount > d.options.slidesToShow && d.slideHandler(d.currentSlide - g, !1, c); break; case \"next\": g = 0 === f ? d.options.slidesToScroll : f, d.slideCount > d.options.slidesToShow && d.slideHandler(d.currentSlide + g, !1, c); break; case \"index\": var i = 0 === b.data.index ? 0 : b.data.index || a(b.target).parent().index() * d.options.slidesToScroll; d.slideHandler(d.checkNavigable(i), !1, c); break; default: return } }, b.prototype.checkNavigable = function (a) { var c, d, b = this; if (c = b.getNavigableIndexes(), d = 0, a > c[c.length - 1]) a = c[c.length - 1]; else for (var e in c) { if (a < c[e]) { a = d; break } d = c[e] } return a }, b.prototype.clickHandler = function (a) { var b = this; b.shouldClick === !1 && (a.stopImmediatePropagation(), a.stopPropagation(), a.preventDefault()) }, b.prototype.destroy = function () { var b = this; b.autoPlayClear(), b.touchObject = {}, a(\".slick-cloned\", b.$slider).remove(), b.$dots && b.$dots.remove(), b.$prevArrow && \"object\" != typeof b.options.prevArrow && b.$prevArrow.remove(), b.$nextArrow && \"object\" != typeof b.options.nextArrow && b.$nextArrow.remove(), b.$slides.removeClass(\"slick-slide slick-active slick-center slick-visible\").removeAttr(\"data-slick-index\").css({ position: \"\", left: \"\", top: \"\", zIndex: \"\", opacity: \"\", width: \"\" }), b.$slider.removeClass(\"slick-slider\"), b.$slider.removeClass(\"slick-initialized\"), b.$list.off(\".slick\"), a(window).off(\".slick-\" + b.instanceUid), a(document).off(\".slick-\" + b.instanceUid), b.$slider.html(b.$slides) }, b.prototype.disableTransition = function (a) { var b = this, c = {}; c[b.transitionType] = \"\", b.options.fade === !1 ? b.$slideTrack.css(c) : b.$slides.eq(a).css(c) }, b.prototype.fadeSlide = function (a, b) { var c = this; c.cssTransitions === !1 ? (c.$slides.eq(a).css({ zIndex: 1e3 }), c.$slides.eq(a).animate({ opacity: 1 }, c.options.speed, c.options.easing, b)) : (c.applyTransition(a), c.$slides.eq(a).css({ opacity: 1, zIndex: 1e3 }), b && setTimeout(function () { c.disableTransition(a), b.call() }, c.options.speed)) }, b.prototype.filterSlides = b.prototype.slickFilter = function (a) { var b = this; null !== a && (b.unload(), b.$slideTrack.children(this.options.slide).detach(), b.$slidesCache.filter(a).appendTo(b.$slideTrack), b.reinit()) }, b.prototype.getCurrent = b.prototype.slickCurrentSlide = function () { var a = this; return a.currentSlide }, b.prototype.getDotCount = function () { var a = this, b = 0, c = 0, d = 0; if (a.options.infinite === !0) d = Math.ceil(a.slideCount / a.options.slidesToScroll); else if (a.options.centerMode === !0) d = a.slideCount; else for (; b < a.slideCount;)++d, b = c + a.options.slidesToShow, c += a.options.slidesToScroll <= a.options.slidesToShow ? a.options.slidesToScroll : a.options.slidesToShow; return d - 1 }, b.prototype.getLeft = function (a) { var c, d, f, b = this, e = 0; return b.slideOffset = 0, d = b.$slides.first().outerHeight(), b.options.infinite === !0 ? (b.slideCount > b.options.slidesToShow && (b.slideOffset = -1 * b.slideWidth * b.options.slidesToShow, e = -1 * d * b.options.slidesToShow), 0 !== b.slideCount % b.options.slidesToScroll && a + b.options.slidesToScroll > b.slideCount && b.slideCount > b.options.slidesToShow && (a > b.slideCount ? (b.slideOffset = -1 * (b.options.slidesToShow - (a - b.slideCount)) * b.slideWidth, e = -1 * (b.options.slidesToShow - (a - b.slideCount)) * d) : (b.slideOffset = -1 * b.slideCount % b.options.slidesToScroll * b.slideWidth, e = -1 * b.slideCount % b.options.slidesToScroll * d))) : a + b.options.slidesToShow > b.slideCount && (b.slideOffset = (a + b.options.slidesToShow - b.slideCount) * b.slideWidth, e = (a + b.options.slidesToShow - b.slideCount) * d), b.slideCount <= b.options.slidesToShow && (b.slideOffset = 0, e = 0), b.options.centerMode === !0 && b.options.infinite === !0 ? b.slideOffset += b.slideWidth * Math.floor(b.options.slidesToShow / 2) - b.slideWidth : b.options.centerMode === !0 && (b.slideOffset = 0, b.slideOffset += b.slideWidth * Math.floor(b.options.slidesToShow / 2)), c = b.options.vertical === !1 ? -1 * a * b.slideWidth + b.slideOffset : -1 * a * d + e, b.options.variableWidth === !0 && (f = b.slideCount <= b.options.slidesToShow || b.options.infinite === !1 ? b.$slideTrack.children(\".slick-slide\").eq(a) : b.$slideTrack.children(\".slick-slide\").eq(a + b.options.slidesToShow), c = f[0] ? -1 * f[0].offsetLeft : 0, b.options.centerMode === !0 && (f = b.options.infinite === !1 ? b.$slideTrack.children(\".slick-slide\").eq(a) : b.$slideTrack.children(\".slick-slide\").eq(a + b.options.slidesToShow + 1), c = f[0] ? -1 * f[0].offsetLeft : 0, c += (b.$list.width() - f.outerWidth()) / 2)), c }, b.prototype.getOption = b.prototype.slickGetOption = function (a) { var b = this; return b.options[a] }, b.prototype.getNavigableIndexes = function () { var e, a = this, b = 0, c = 0, d = []; for (a.options.infinite === !1 ? (e = a.slideCount - a.options.slidesToShow + 1, a.options.centerMode === !0 && (e = a.slideCount)) : (b = -1 * a.slideCount, c = -1 * a.slideCount, e = 2 * a.slideCount) ; e > b;) d.push(b), b = c + a.options.slidesToScroll, c += a.options.slidesToScroll <= a.options.slidesToShow ? a.options.slidesToScroll : a.options.slidesToShow; return d }, b.prototype.getSlick = function () { return this }, b.prototype.getSlideCount = function () { var c, d, e, b = this; return e = b.options.centerMode === !0 ? b.slideWidth * Math.floor(b.options.slidesToShow / 2) : 0, b.options.swipeToSlide === !0 ? (b.$slideTrack.find(\".slick-slide\").each(function (c, f) { return f.offsetLeft - e + a(f).outerWidth() / 2 > -1 * b.swipeLeft ? (d = f, !1) : void 0 }), c = Math.abs(a(d).attr(\"data-slick-index\") - b.currentSlide) || 1) : b.options.slidesToScroll }, b.prototype.goTo = b.prototype.slickGoTo = function (a, b) { var c = this; c.changeSlide({ data: { message: \"index\", index: parseInt(a) } }, b) }, b.prototype.init = function () { var b = this; a(b.$slider).hasClass(\"slick-initialized\") || (a(b.$slider).addClass(\"slick-initialized\"), b.buildOut(), b.setProps(), b.startLoad(), b.loadSlider(), b.initializeEvents(), b.updateArrows(), b.updateDots()), b.$slider.trigger(\"init\", [b]) }, b.prototype.initArrowEvents = function () { var a = this; a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.on(\"click.slick\", { message: \"previous\" }, a.changeSlide), a.$nextArrow.on(\"click.slick\", { message: \"next\" }, a.changeSlide)) }, b.prototype.initDotEvents = function () { var b = this; b.options.dots === !0 && b.slideCount > b.options.slidesToShow && a(\"li\", b.$dots).on(\"click.slick\", { message: \"index\" }, b.changeSlide), b.options.dots === !0 && b.options.pauseOnDotsHover === !0 && b.options.autoplay === !0 && a(\"li\", b.$dots).on(\"mouseenter.slick\", function () { b.paused = !0, b.autoPlayClear() }).on(\"mouseleave.slick\", function () { b.paused = !1, b.autoPlay() }) }, b.prototype.initializeEvents = function () { var b = this; b.initArrowEvents(), b.initDotEvents(), b.$list.on(\"touchstart.slick mousedown.slick\", { action: \"start\" }, b.swipeHandler), b.$list.on(\"touchmove.slick mousemove.slick\", { action: \"move\" }, b.swipeHandler), b.$list.on(\"touchend.slick mouseup.slick\", { action: \"end\" }, b.swipeHandler), b.$list.on(\"touchcancel.slick mouseleave.slick\", { action: \"end\" }, b.swipeHandler), b.$list.on(\"click.slick\", b.clickHandler), b.options.autoplay === !0 && (a(document).on(b.visibilityChange, function () { b.visibility() }), b.options.pauseOnHover === !0 && (b.$list.on(\"mouseenter.slick\", function () { b.paused = !0, b.autoPlayClear() }), b.$list.on(\"mouseleave.slick\", function () { b.paused = !1, b.autoPlay() }))), b.options.accessibility === !0 && b.$list.on(\"keydown.slick\", b.keyHandler), b.options.focusOnSelect === !0 && a(b.$slideTrack).children().on(\"click.slick\", b.selectHandler), a(window).on(\"orientationchange.slick.slick-\" + b.instanceUid, function () { b.checkResponsive(), b.setPosition() }), a(window).on(\"resize.slick.slick-\" + b.instanceUid, function () { a(window).width() !== b.windowWidth && (clearTimeout(b.windowDelay), b.windowDelay = window.setTimeout(function () { b.windowWidth = a(window).width(), b.checkResponsive(), b.setPosition() }, 50)) }), a(\"*[draggable!=true]\", b.$slideTrack).on(\"dragstart\", function (a) { a.preventDefault() }), a(window).on(\"load.slick.slick-\" + b.instanceUid, b.setPosition), a(document).on(\"ready.slick.slick-\" + b.instanceUid, b.setPosition) }, b.prototype.initUI = function () { var a = this; a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.show(), a.$nextArrow.show()), a.options.dots === !0 && a.slideCount > a.options.slidesToShow && a.$dots.show(), a.options.autoplay === !0 && a.autoPlay() }, b.prototype.keyHandler = function (a) { var b = this; 37 === a.keyCode && b.options.accessibility === !0 ? b.changeSlide({ data: { message: \"previous\" } }) : 39 === a.keyCode && b.options.accessibility === !0 && b.changeSlide({ data: { message: \"next\" } }) }, b.prototype.lazyLoad = function () { function g(b) { a(\"img[data-lazy]\", b).each(function () { var b = a(this), c = a(this).attr(\"data-lazy\"); b.load(function () { b.animate({ opacity: 1 }, 200) }).css({ opacity: 0 }).attr(\"src\", c).removeAttr(\"data-lazy\").removeClass(\"slick-loading\") }) } var c, d, e, f, b = this; b.options.centerMode === !0 ? b.options.infinite === !0 ? (e = b.currentSlide + (b.options.slidesToShow / 2 + 1), f = e + b.options.slidesToShow + 2) : (e = Math.max(0, b.currentSlide - (b.options.slidesToShow / 2 + 1)), f = 2 + (b.options.slidesToShow / 2 + 1) + b.currentSlide) : (e = b.options.infinite ? b.options.slidesToShow + b.currentSlide : b.currentSlide, f = e + b.options.slidesToShow, b.options.fade === !0 && (e > 0 && e--, f <= b.slideCount && f++)), c = b.$slider.find(\".slick-slide\").slice(e, f), g(c), b.slideCount <= b.options.slidesToShow ? (d = b.$slider.find(\".slick-slide\"), g(d)) : b.currentSlide >= b.slideCount - b.options.slidesToShow ? (d = b.$slider.find(\".slick-cloned\").slice(0, b.options.slidesToShow), g(d)) : 0 === b.currentSlide && (d = b.$slider.find(\".slick-cloned\").slice(-1 * b.options.slidesToShow), g(d)) }, b.prototype.loadSlider = function () { var a = this; a.setPosition(), a.$slideTrack.css({ opacity: 1 }), a.$slider.removeClass(\"slick-loading\"), a.initUI(), \"progressive\" === a.options.lazyLoad && a.progressiveLazyLoad() }, b.prototype.next = b.prototype.slickNext = function () { var a = this; a.changeSlide({ data: { message: \"next\" } }) }, b.prototype.pause = b.prototype.slickPause = function () { var a = this; a.autoPlayClear(), a.paused = !0 }, b.prototype.play = b.prototype.slickPlay = function () { var a = this; a.paused = !1, a.autoPlay() }, b.prototype.postSlide = function (a) { var b = this; b.$slider.trigger(\"afterChange\", [b, a]), b.animating = !1, b.setPosition(), b.swipeLeft = null, b.options.autoplay === !0 && b.paused === !1 && b.autoPlay() }, b.prototype.prev = b.prototype.slickPrev = function () { var a = this; a.changeSlide({ data: { message: \"previous\" } }) }, b.prototype.progressiveLazyLoad = function () { var c, d, b = this; c = a(\"img[data-lazy]\", b.$slider).length, c > 0 && (d = a(\"img[data-lazy]\", b.$slider).first(), d.attr(\"src\", d.attr(\"data-lazy\")).removeClass(\"slick-loading\").load(function () { d.removeAttr(\"data-lazy\"), b.progressiveLazyLoad() }).error(function () { d.removeAttr(\"data-lazy\"), b.progressiveLazyLoad() })) }, b.prototype.refresh = function () { var b = this, c = b.currentSlide; b.destroy(), a.extend(b, b.initials), b.init(), b.changeSlide({ data: { message: \"index\", index: c } }, !0) }, b.prototype.reinit = function () { var b = this; b.$slides = b.$slideTrack.children(b.options.slide).addClass(\"slick-slide\"), b.slideCount = b.$slides.length, b.currentSlide >= b.slideCount && 0 !== b.currentSlide && (b.currentSlide = b.currentSlide - b.options.slidesToScroll), b.slideCount <= b.options.slidesToShow && (b.currentSlide = 0), b.setProps(), b.setupInfinite(), b.buildArrows(), b.updateArrows(), b.initArrowEvents(), b.buildDots(), b.updateDots(), b.initDotEvents(), b.options.focusOnSelect === !0 && a(b.$slideTrack).children().on(\"click.slick\", b.selectHandler), b.setSlideClasses(0), b.setPosition(), b.$slider.trigger(\"reInit\", [b]) }, b.prototype.removeSlide = b.prototype.slickRemove = function (a, b, c) { var d = this; return \"boolean\" == typeof a ? (b = a, a = b === !0 ? 0 : d.slideCount - 1) : a = b === !0 ? --a : a, d.slideCount < 1 || 0 > a || a > d.slideCount - 1 ? !1 : (d.unload(), c === !0 ? d.$slideTrack.children().remove() : d.$slideTrack.children(this.options.slide).eq(a).remove(), d.$slides = d.$slideTrack.children(this.options.slide), d.$slideTrack.children(this.options.slide).detach(), d.$slideTrack.append(d.$slides), d.$slidesCache = d.$slides, d.reinit(), void 0) }, b.prototype.setCSS = function (a) { var d, e, b = this, c = {}; b.options.rtl === !0 && (a = -a), d = \"left\" == b.positionProp ? Math.ceil(a) + \"px\" : \"0px\", e = \"top\" == b.positionProp ? Math.ceil(a) + \"px\" : \"0px\", c[b.positionProp] = a, b.transformsEnabled === !1 ? b.$slideTrack.css(c) : (c = {}, b.cssTransitions === !1 ? (c[b.animType] = \"translate(\" + d + \", \" + e + \")\", b.$slideTrack.css(c)) : (c[b.animType] = \"translate3d(\" + d + \", \" + e + \", 0px)\", b.$slideTrack.css(c))) }, b.prototype.setDimensions = function () { var a = this; if (a.options.vertical === !1 ? a.options.centerMode === !0 && a.$list.css({ padding: \"0px \" + a.options.centerPadding }) : (a.$list.height(a.$slides.first().outerHeight(!0) * a.options.slidesToShow), a.options.centerMode === !0 && a.$list.css({ padding: a.options.centerPadding + \" 0px\" })), a.listWidth = a.$list.width(), a.listHeight = a.$list.height(), a.options.vertical === !1 && a.options.variableWidth === !1) a.slideWidth = Math.ceil(a.listWidth / a.options.slidesToShow), a.$slideTrack.width(Math.ceil(a.slideWidth * a.$slideTrack.children(\".slick-slide\").length)); else if (a.options.variableWidth === !0) { var b = 0; a.slideWidth = Math.ceil(a.listWidth / a.options.slidesToShow), a.$slideTrack.children(\".slick-slide\").each(function () { b += a.listWidth }), a.$slideTrack.width(Math.ceil(b) + 1) } else a.slideWidth = Math.ceil(a.listWidth), a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0) * a.$slideTrack.children(\".slick-slide\").length)); var c = a.$slides.first().outerWidth(!0) - a.$slides.first().width(); a.options.variableWidth === !1 && a.$slideTrack.children(\".slick-slide\").width(a.slideWidth - c) }, b.prototype.setFade = function () { var c, b = this; b.$slides.each(function (d, e) { c = -1 * b.slideWidth * d, b.options.rtl === !0 ? a(e).css({ position: \"relative\", right: c, top: 0, zIndex: 800, opacity: 0 }) : a(e).css({ position: \"relative\", left: c, top: 0, zIndex: 800, opacity: 0 }) }), b.$slides.eq(b.currentSlide).css({ zIndex: 900, opacity: 1 }) }, b.prototype.setHeight = function () { var a = this; if (1 === a.options.slidesToShow && a.options.adaptiveHeight === !0 && a.options.vertical === !1) { var b = a.$slides.eq(a.currentSlide).outerHeight(!0); a.$list.css(\"height\", b) } }, b.prototype.setOption = b.prototype.slickSetOption = function (a, b, c) { var d = this; d.options[a] = b, c === !0 && (d.unload(), d.reinit()) }, b.prototype.setPosition = function () { var a = this; a.setDimensions(), a.setHeight(), a.options.fade === !1 ? a.setCSS(a.getLeft(a.currentSlide)) : a.setFade(), a.$slider.trigger(\"setPosition\", [a]) }, b.prototype.setProps = function () { var a = this, b = document.body.style; a.positionProp = a.options.vertical === !0 ? \"top\" : \"left\", \"top\" === a.positionProp ? a.$slider.addClass(\"slick-vertical\") : a.$slider.removeClass(\"slick-vertical\"), (void 0 !== b.WebkitTransition || void 0 !== b.MozTransition || void 0 !== b.msTransition) && a.options.useCSS === !0 && (a.cssTransitions = !0), void 0 !== b.OTransform && (a.animType = \"OTransform\", a.transformType = \"-o-transform\", a.transitionType = \"OTransition\", void 0 === b.perspectiveProperty && void 0 === b.webkitPerspective && (a.animType = !1)), void 0 !== b.MozTransform && (a.animType = \"MozTransform\", a.transformType = \"-moz-transform\", a.transitionType = \"MozTransition\", void 0 === b.perspectiveProperty && void 0 === b.MozPerspective && (a.animType = !1)), void 0 !== b.webkitTransform && (a.animType = \"webkitTransform\", a.transformType = \"-webkit-transform\", a.transitionType = \"webkitTransition\", void 0 === b.perspectiveProperty && void 0 === b.webkitPerspective && (a.animType = !1)), void 0 !== b.msTransform && (a.animType = \"msTransform\", a.transformType = \"-ms-transform\", a.transitionType = \"msTransition\", void 0 === b.msTransform && (a.animType = !1)), void 0 !== b.transform && a.animType !== !1 && (a.animType = \"transform\", a.transformType = \"transform\", a.transitionType = \"transition\"), a.transformsEnabled = null !== a.animType && a.animType !== !1 }, b.prototype.setSlideClasses = function (a) { var c, d, e, f, b = this; b.$slider.find(\".slick-slide\").removeClass(\"slick-active\").removeClass(\"slick-center\"), d = b.$slider.find(\".slick-slide\"), b.options.centerMode === !0 ? (c = Math.floor(b.options.slidesToShow / 2), b.options.infinite === !0 && (a >= c && a <= b.slideCount - 1 - c ? b.$slides.slice(a - c, a + c + 1).addClass(\"slick-active\") : (e = b.options.slidesToShow + a, d.slice(e - c + 1, e + c + 2).addClass(\"slick-active\")), 0 === a ? d.eq(d.length - 1 - b.options.slidesToShow).addClass(\"slick-center\") : a === b.slideCount - 1 && d.eq(b.options.slidesToShow).addClass(\"slick-center\")), b.$slides.eq(a).addClass(\"slick-center\")) : a >= 0 && a <= b.slideCount - b.options.slidesToShow ? b.$slides.slice(a, a + b.options.slidesToShow).addClass(\"slick-active\") : d.length <= b.options.slidesToShow ? d.addClass(\"slick-active\") : (f = b.slideCount % b.options.slidesToShow, e = b.options.infinite === !0 ? b.options.slidesToShow + a : a, b.options.slidesToShow == b.options.slidesToScroll && b.slideCount - a < b.options.slidesToShow ? d.slice(e - (b.options.slidesToShow - f), e + f).addClass(\"slick-active\") : d.slice(e, e + b.options.slidesToShow).addClass(\"slick-active\")), \"ondemand\" === b.options.lazyLoad && b.lazyLoad() }, b.prototype.setupInfinite = function () { var c, d, e, b = this; if (b.options.fade === !0 && (b.options.centerMode = !1), b.options.infinite === !0 && b.options.fade === !1 && (d = null, b.slideCount > b.options.slidesToShow)) { for (e = b.options.centerMode === !0 ? b.options.slidesToShow + 1 : b.options.slidesToShow, c = b.slideCount; c > b.slideCount - e; c -= 1) d = c - 1, a(b.$slides[d]).clone(!0).attr(\"id\", \"\").attr(\"data-slick-index\", d - b.slideCount).prependTo(b.$slideTrack).addClass(\"slick-cloned\"); for (c = 0; e > c; c += 1) d = c, a(b.$slides[d]).clone(!0).attr(\"id\", \"\").attr(\"data-slick-index\", d + b.slideCount).appendTo(b.$slideTrack).addClass(\"slick-cloned\"); b.$slideTrack.find(\".slick-cloned\").find(\"[id]\").each(function () { a(this).attr(\"id\", \"\") }) } }, b.prototype.selectHandler = function (b) { var c = this, d = parseInt(a(b.target).parents(\".slick-slide\").attr(\"data-slick-index\")); return d || (d = 0), c.slideCount <= c.options.slidesToShow ? (c.$slider.find(\".slick-slide\").removeClass(\"slick-active\"), c.$slides.eq(d).addClass(\"slick-active\"), c.options.centerMode === !0 && (c.$slider.find(\".slick-slide\").removeClass(\"slick-center\"), c.$slides.eq(d).addClass(\"slick-center\")), c.asNavFor(d), void 0) : (c.slideHandler(d), void 0) }, b.prototype.slideHandler = function (a, b, c) { var d, e, f, g, h = null, i = this; return b = b || !1, i.animating === !0 && i.options.waitForAnimate === !0 || i.options.fade === !0 && i.currentSlide === a || i.slideCount <= i.options.slidesToShow ? void 0 : (b === !1 && i.asNavFor(a), d = a, h = i.getLeft(d), g = i.getLeft(i.currentSlide), i.currentLeft = null === i.swipeLeft ? g : i.swipeLeft, i.options.infinite === !1 && i.options.centerMode === !1 && (0 > a || a > i.getDotCount() * i.options.slidesToScroll) ? (i.options.fade === !1 && (d = i.currentSlide, c !== !0 ? i.animateSlide(g, function () { i.postSlide(d) }) : i.postSlide(d)), void 0) : i.options.infinite === !1 && i.options.centerMode === !0 && (0 > a || a > i.slideCount - i.options.slidesToScroll) ? (i.options.fade === !1 && (d = i.currentSlide, c !== !0 ? i.animateSlide(g, function () { i.postSlide(d) }) : i.postSlide(d)), void 0) : (i.options.autoplay === !0 && clearInterval(i.autoPlayTimer), e = 0 > d ? 0 !== i.slideCount % i.options.slidesToScroll ? i.slideCount - i.slideCount % i.options.slidesToScroll : i.slideCount + d : d >= i.slideCount ? 0 !== i.slideCount % i.options.slidesToScroll ? 0 : d - i.slideCount : d, i.animating = !0, i.$slider.trigger(\"beforeChange\", [i, i.currentSlide, e]), f = i.currentSlide, i.currentSlide = e, i.setSlideClasses(i.currentSlide), i.updateDots(), i.updateArrows(), i.options.fade === !0 ? (c !== !0 ? i.fadeSlide(e, function () { i.postSlide(e) }) : i.postSlide(e), i.animateHeight(), void 0) : (c !== !0 ? i.animateSlide(h, function () { i.postSlide(e) }) : i.postSlide(e), void 0))) }, b.prototype.startLoad = function () { var a = this; a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.hide(), a.$nextArrow.hide()), a.options.dots === !0 && a.slideCount > a.options.slidesToShow && a.$dots.hide(), a.$slider.addClass(\"slick-loading\") }, b.prototype.swipeDirection = function () { var a, b, c, d, e = this; return a = e.touchObject.startX - e.touchObject.curX, b = e.touchObject.startY - e.touchObject.curY, c = Math.atan2(b, a), d = Math.round(180 * c / Math.PI), 0 > d && (d = 360 - Math.abs(d)), 45 >= d && d >= 0 ? e.options.rtl === !1 ? \"left\" : \"right\" : 360 >= d && d >= 315 ? e.options.rtl === !1 ? \"left\" : \"right\" : d >= 135 && 225 >= d ? e.options.rtl === !1 ? \"right\" : \"left\" : \"vertical\" }, b.prototype.swipeEnd = function () { var c, b = this; if (b.dragging = !1, b.shouldClick = b.touchObject.swipeLength > 10 ? !1 : !0, void 0 === b.touchObject.curX) return !1; if (b.touchObject.edgeHit === !0 && b.$slider.trigger(\"edge\", [b, b.swipeDirection()]), b.touchObject.swipeLength >= b.touchObject.minSwipe) switch (b.swipeDirection()) { case \"left\": c = b.options.swipeToSlide ? b.checkNavigable(b.currentSlide + b.getSlideCount()) : b.currentSlide + b.getSlideCount(), b.slideHandler(c), b.currentDirection = 0, b.touchObject = {}, b.$slider.trigger(\"swipe\", [b, \"left\"]); break; case \"right\": c = b.options.swipeToSlide ? b.checkNavigable(b.currentSlide - b.getSlideCount()) : b.currentSlide - b.getSlideCount(), b.slideHandler(c), b.currentDirection = 1, b.touchObject = {}, b.$slider.trigger(\"swipe\", [b, \"right\"]) } else b.touchObject.startX !== b.touchObject.curX && (b.slideHandler(b.currentSlide), b.touchObject = {}) }, b.prototype.swipeHandler = function (a) { var b = this; if (!(b.options.swipe === !1 || \"ontouchend\" in document && b.options.swipe === !1 || b.options.draggable === !1 && -1 !== a.type.indexOf(\"mouse\"))) switch (b.touchObject.fingerCount = a.originalEvent && void 0 !== a.originalEvent.touches ? a.originalEvent.touches.length : 1, b.touchObject.minSwipe = b.listWidth / b.options.touchThreshold, a.data.action) { case \"start\": b.swipeStart(a); break; case \"move\": b.swipeMove(a); break; case \"end\": b.swipeEnd(a) } }, b.prototype.swipeMove = function (a) { var d, e, f, g, h, b = this; return h = void 0 !== a.originalEvent ? a.originalEvent.touches : null, !b.dragging || h && 1 !== h.length ? !1 : (d = b.getLeft(b.currentSlide), b.touchObject.curX = void 0 !== h ? h[0].pageX : a.clientX, b.touchObject.curY = void 0 !== h ? h[0].pageY : a.clientY, b.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(b.touchObject.curX - b.touchObject.startX, 2))), e = b.swipeDirection(), \"vertical\" !== e ? (void 0 !== a.originalEvent && b.touchObject.swipeLength > 4 && a.preventDefault(), g = (b.options.rtl === !1 ? 1 : -1) * (b.touchObject.curX > b.touchObject.startX ? 1 : -1), f = b.touchObject.swipeLength, b.touchObject.edgeHit = !1, b.options.infinite === !1 && (0 === b.currentSlide && \"right\" === e || b.currentSlide >= b.getDotCount() && \"left\" === e) && (f = b.touchObject.swipeLength * b.options.edgeFriction, b.touchObject.edgeHit = !0), b.swipeLeft = b.options.vertical === !1 ? d + f * g : d + f * (b.$list.height() / b.listWidth) * g, b.options.fade === !0 || b.options.touchMove === !1 ? !1 : b.animating === !0 ? (b.swipeLeft = null, !1) : (b.setCSS(b.swipeLeft), void 0)) : void 0) }, b.prototype.swipeStart = function (a) { var c, b = this; return 1 !== b.touchObject.fingerCount || b.slideCount <= b.options.slidesToShow ? (b.touchObject = {}, !1) : (void 0 !== a.originalEvent && void 0 !== a.originalEvent.touches && (c = a.originalEvent.touches[0]), b.touchObject.startX = b.touchObject.curX = void 0 !== c ? c.pageX : a.clientX, b.touchObject.startY = b.touchObject.curY = void 0 !== c ? c.pageY : a.clientY, b.dragging = !0, void 0) }, b.prototype.unfilterSlides = b.prototype.slickUnfilter = function () { var a = this; null !== a.$slidesCache && (a.unload(), a.$slideTrack.children(this.options.slide).detach(), a.$slidesCache.appendTo(a.$slideTrack), a.reinit()) }, b.prototype.unload = function () { var b = this; a(\".slick-cloned\", b.$slider).remove(), b.$dots && b.$dots.remove(), b.$prevArrow && \"object\" != typeof b.options.prevArrow && b.$prevArrow.remove(), b.$nextArrow && \"object\" != typeof b.options.nextArrow && b.$nextArrow.remove(), b.$slides.removeClass(\"slick-slide slick-active slick-visible\").css(\"width\", \"\") }, b.prototype.unslick = function () { var a = this; a.destroy() }, b.prototype.updateArrows = function () {\n var b, a = this; b = Math.floor(a.options.slidesToShow / 2), a.options.arrows === !0 && a.options.infinite !== !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.removeClass(\"slick-disabled\"), a.$nextArrow.removeClass(\"slick-disabled\"), 0 === a.currentSlide ? (a.$prevArrow.addClass(\"slick-disabled\"), a.$nextArrow.removeClass(\"slick-disabled\")) : a.currentSlide >= a.slideCount - a.options.slidesToShow && a.options.centerMode === !1 ? (a.$nextArrow.addClass(\"slick-disabled\"), a.$prevArrow.removeClass(\"slick-disabled\")) : a.currentSlide >= a.slideCount - 1 && a.options.centerMode === !0 && (a.$nextArrow.addClass(\"slick-disabled\"), a.$prevArrow.removeClass(\"slick-disabled\")))\n }, b.prototype.updateDots = function () { var a = this; null !== a.$dots && (a.$dots.find(\"li\").removeClass(\"slick-active\"), a.$dots.find(\"li\").eq(Math.floor(a.currentSlide / a.options.slidesToScroll)).addClass(\"slick-active\")) }, b.prototype.visibility = function () { var a = this; document[a.hidden] ? (a.paused = !0, a.autoPlayClear()) : (a.paused = !1, a.autoPlay()) }, a.fn.slick = function () { var g, a = this, c = arguments[0], d = Array.prototype.slice.call(arguments, 1), e = a.length, f = 0; for (f; e > f; f++) if (\"object\" == typeof c || \"undefined\" == typeof c ? a[f].slick = new b(a[f], c) : g = a[f].slick[c].apply(a[f].slick, d), \"undefined\" != typeof g) return g; return a }, a(function () { a(\"[data-slick]\").slick() })\n });\n }\n\n /*\n *\n * Copyright (c) 2006-2011 Sam Collett (http://www.texotela.co.uk)\n * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)\n * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.\n *\n * Version 1.3\n * demo: http://www.texotela.co.uk/code/jquery/numeric/\n *\n */\n if (HawkSearch.loadPlugins.numeric == true) {\n (function (e) { e.fn.numeric = function (t, n) { if (typeof t === \"boolean\") { t = { decimal: t } } t = t || {}; if (typeof t.negative == \"undefined\") t.negative = true; var r = t.decimal === false ? \"\" : t.decimal || \".\"; var i = t.negative === true ? true : false; var n = typeof n == \"function\" ? n : function () { }; return this.data(\"numeric.decimal\", r).data(\"numeric.negative\", i).data(\"numeric.callback\", n).keypress(e.fn.numeric.keypress).keyup(e.fn.numeric.keyup).blur(e.fn.numeric.blur) }; e.fn.numeric.keypress = function (t) { var n = e.data(this, \"numeric.decimal\"); var r = e.data(this, \"numeric.negative\"); var i = t.charCode ? t.charCode : t.keyCode ? t.keyCode : 0; if (i == 13 && this.nodeName.toLowerCase() == \"input\") { return true } else if (i == 13) { return false } var s = false; if (t.ctrlKey && i == 97 || t.ctrlKey && i == 65) return true; if (t.ctrlKey && i == 120 || t.ctrlKey && i == 88) return true; if (t.ctrlKey && i == 99 || t.ctrlKey && i == 67) return true; if (t.ctrlKey && i == 122 || t.ctrlKey && i == 90) return true; if (t.ctrlKey && i == 118 || t.ctrlKey && i == 86 || t.shiftKey && i == 45) return true; if (i < 48 || i > 57) { if (this.value.indexOf(\"-\") != 0 && r && i == 45 && (this.value.length == 0 || e.fn.getSelectionStart(this) == 0)) return true; if (n && i == n.charCodeAt(0) && this.value.indexOf(n) != -1) { s = false } if (i != 8 && i != 9 && i != 13 && i != 35 && i != 36 && i != 37 && i != 39 && i != 46) { s = false } else { if (typeof t.charCode != \"undefined\") { if (t.keyCode == t.which && t.which != 0) { s = true; if (t.which == 46) s = false } else if (t.keyCode != 0 && t.charCode == 0 && t.which == 0) { s = true } } } if (n && i == n.charCodeAt(0)) { if (this.value.indexOf(n) == -1) { s = true } else { s = false } } } else { s = true } return s }; e.fn.numeric.keyup = function (t) { var n = this.value; if (n.length > 0) { var r = e.fn.getSelectionStart(this); var i = e.data(this, \"numeric.decimal\"); var s = e.data(this, \"numeric.negative\"); if (i != \"\") { var o = n.indexOf(i); if (o == 0) { this.value = \"0\" + n } if (o == 1 && n.charAt(0) == \"-\") { this.value = \"-0\" + n.substring(1) } n = this.value } var u = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, \"-\", i]; var a = n.length; for (var f = a - 1; f >= 0; f--) { var l = n.charAt(f); if (f != 0 && l == \"-\") { n = n.substring(0, f) + n.substring(f + 1) } else if (f == 0 && !s && l == \"-\") { n = n.substring(1) } var c = false; for (var h = 0; h < u.length; h++) { if (l == u[h]) { c = true; break } } if (!c || l == \" \") { n = n.substring(0, f) + n.substring(f + 1) } } var p = n.indexOf(i); if (p > 0) { for (var f = a - 1; f > p; f--) { var l = n.charAt(f); if (l == i) { n = n.substring(0, f) + n.substring(f + 1) } } } this.value = n; e.fn.setSelection(this, r) } }; e.fn.numeric.blur = function () { var t = e.data(this, \"numeric.decimal\"); var n = e.data(this, \"numeric.callback\"); var r = this.value; if (r != \"\") { var i = new RegExp(\"^\\\\d+$|\\\\d*\" + t + \"\\\\d+\"); if (!i.exec(r)) { n.apply(this) } } }; e.fn.removeNumeric = function () { return this.data(\"numeric.decimal\", null).data(\"numeric.negative\", null).data(\"numeric.callback\", null).unbind(\"keypress\", e.fn.numeric.keypress).unbind(\"blur\", e.fn.numeric.blur) }; e.fn.getSelectionStart = function (e) { if (e.createTextRange) { var t = document.selection.createRange().duplicate(); t.moveEnd(\"character\", e.value.length); if (t.text == \"\") return e.value.length; return e.value.lastIndexOf(t.text) } else return e.selectionStart }; e.fn.setSelection = function (e, t) { if (typeof t == \"number\") t = [t, t]; if (t && t.constructor == Array && t.length == 2) { if (e.createTextRange) { var n = e.createTextRange(); n.collapse(true); n.moveStart(\"character\", t[0]); n.moveEnd(\"character\", t[1]); n.select() } else if (e.setSelectionRange) { e.focus(); e.setSelectionRange(t[0], t[1]) } } } })(jQuery)\n }\n /*! waitForImages jQuery Plugin 2013-07-20 */\n if (HawkSearch.loadPlugins.waitForImages == true) {\n !function (a) { var b = \"waitForImages\"; a.waitForImages = { hasImageProperties: [\"backgroundImage\", \"listStyleImage\", \"borderImage\", \"borderCornerImage\", \"cursor\"] }, a.expr[\":\"].uncached = function (b) { if (!a(b).is('img[src!=\"\"]')) return !1; var c = new Image; return c.src = b.src, !c.complete }, a.fn.waitForImages = function (c, d, e) { var f = 0, g = 0; if (a.isPlainObject(arguments[0]) && (e = arguments[0].waitForAll, d = arguments[0].each, c = arguments[0].finished), c = c || a.noop, d = d || a.noop, e = !!e, !a.isFunction(c) || !a.isFunction(d)) throw new TypeError(\"An invalid callback was supplied.\"); return this.each(function () { var h = a(this), i = [], j = a.waitForImages.hasImageProperties || [], k = /url\\(\\s*(['\"]?)(.*?)\\1\\s*\\)/g; e ? h.find(\"*\").addBack().each(function () { var b = a(this); b.is(\"img:uncached\") && i.push({ src: b.attr(\"src\"), element: b[0] }), a.each(j, function (a, c) { var d, e = b.css(c); if (!e) return !0; for (; d = k.exec(e);) i.push({ src: d[2], element: b[0] }) }) }) : h.find(\"img:uncached\").each(function () { i.push({ src: this.src, element: this }) }), f = i.length, g = 0, 0 === f && c.call(h[0]), a.each(i, function (e, i) { var j = new Image; a(j).on(\"load.\" + b + \" error.\" + b, function (a) { return g++ , d.call(i.element, g, f, \"load\" == a.type), g == f ? (c.call(h[0]), !1) : void 0 }), j.src = i.src }) }) } }(jQuery);\n }\n\n if (HawkSearch.loadPlugins.alertify == true) {\n /*! alertifyjs - v1.8.0 - Mohammad Younes <[email protected]> (http://alertifyjs.com) */\n !function (a) {\n \"use strict\"; function b(a, b) { a.className += \" \" + b } function c(a, b) { for (var c = a.className.split(\" \"), d = b.split(\" \"), e = 0; e < d.length; e += 1) { var f = c.indexOf(d[e]); f > -1 && c.splice(f, 1) } a.className = c.join(\" \") } function d() { return \"rtl\" === a.getComputedStyle(document.body).direction } function e() { return document.documentElement && document.documentElement.scrollTop || document.body.scrollTop } function f() { return document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft } function g(a) { for (; a.lastChild;) a.removeChild(a.lastChild) } function h(a) { if (null === a) return a; var b; if (Array.isArray(a)) { b = []; for (var c = 0; c < a.length; c += 1) b.push(h(a[c])); return b } if (a instanceof Date) return new Date(a.getTime()); if (a instanceof RegExp) return b = new RegExp(a.source), b.global = a.global, b.ignoreCase = a.ignoreCase, b.multiline = a.multiline, b.lastIndex = a.lastIndex, b; if (\"object\" == typeof a) { b = {}; for (var d in a) a.hasOwnProperty(d) && (b[d] = h(a[d])); return b } return a } function i(a, b) { var c = a.elements.root; c.parentNode.removeChild(c), delete a.elements, a.settings = h(a.__settings), a.__init = b, delete a.__internal } function j(a, b) { return function () { if (arguments.length > 0) { for (var c = [], d = 0; d < arguments.length; d += 1) c.push(arguments[d]); return c.push(a), b.apply(a, c) } return b.apply(a, [null, a]) } } function k(a, b) { return { index: a, button: b, cancel: !1 } } function l(a, b) { \"function\" == typeof b.get(a) && b.get(a).call(b) } function m() { function a(a, b) { for (var c in b) b.hasOwnProperty(c) && (a[c] = b[c]); return a } function b(a) { var b = d[a].dialog; return b && \"function\" == typeof b.__init && b.__init(b), b } function c(b, c, e, f) { var g = { dialog: null, factory: c }; return void 0 !== f && (g.factory = function () { return a(new d[f].factory, new c) }), e || (g.dialog = a(new g.factory, t)), d[b] = g } var d = {}; return { defaults: o, dialog: function (d, e, f, g) { if (\"function\" != typeof e) return b(d); if (this.hasOwnProperty(d)) throw new Error(\"alertify.dialog: name already exists\"); var h = c(d, e, f, g); f ? this[d] = function () { if (0 === arguments.length) return h.dialog; var b = a(new h.factory, t); return b && \"function\" == typeof b.__init && b.__init(b), b.main.apply(b, arguments), b.show.apply(b) } : this[d] = function () { if (h.dialog && \"function\" == typeof h.dialog.__init && h.dialog.__init(h.dialog), 0 === arguments.length) return h.dialog; var a = h.dialog; return a.main.apply(h.dialog, arguments), a.show.apply(h.dialog) } }, closeAll: function (a) { for (var b = p.slice(0), c = 0; c < b.length; c += 1) { var d = b[c]; (void 0 === a || a !== d) && d.close() } }, setting: function (a, c, d) { if (\"notifier\" === a) return u.setting(c, d); var e = b(a); return e ? e.setting(c, d) : void 0 }, set: function (a, b, c) { return this.setting(a, b, c) }, get: function (a, b) { return this.setting(a, b) }, notify: function (a, b, c, d) { return u.create(b, d).push(a, c) }, message: function (a, b, c) { return u.create(null, c).push(a, b) }, success: function (a, b, c) { return u.create(\"success\", c).push(a, b) }, error: function (a, b, c) { return u.create(\"error\", c).push(a, b) }, warning: function (a, b, c) { return u.create(\"warning\", c).push(a, b) }, dismissAll: function () { u.dismissAll() } } } var n = { ENTER: 13, ESC: 27, F1: 112, F12: 123, LEFT: 37, RIGHT: 39 }, o = { autoReset: !0, basic: !1, closable: !0, closableByDimmer: !0, frameless: !1, maintainFocus: !0, maximizable: !0, modal: !0, movable: !0, moveBounded: !1, overflow: !0, padding: !0, pinnable: !0, pinned: !0, preventBodyShift: !1, resizable: !0, startMaximized: !1, transition: \"pulse\", notifier: { delay: 5, position: \"bottom-right\" }, glossary: { title: \"AlertifyJS\", ok: \"OK\", cancel: \"Cancel\", acccpt: \"Accept\", deny: \"Deny\", confirm: \"Confirm\", decline: \"Decline\", close: \"Close\", maximize: \"Maximize\", restore: \"Restore\" }, theme: { input: \"ajs-input\", ok: \"ajs-ok\", cancel: \"ajs-cancel\" } }, p = [], q = function () { return document.addEventListener ? function (a, b, c, d) { a.addEventListener(b, c, d === !0) } : document.attachEvent ? function (a, b, c) { a.attachEvent(\"on\" + b, c) } : void 0 }(), r = function () { return document.removeEventListener ? function (a, b, c, d) { a.removeEventListener(b, c, d === !0) } : document.detachEvent ? function (a, b, c) { a.detachEvent(\"on\" + b, c) } : void 0 }(), s = function () { var a, b, c = !1, d = { animation: \"animationend\", OAnimation: \"oAnimationEnd oanimationend\", msAnimation: \"MSAnimationEnd\", MozAnimation: \"animationend\", WebkitAnimation: \"webkitAnimationEnd\" }; for (a in d) if (void 0 !== document.documentElement.style[a]) { b = d[a], c = !0; break } return { type: b, supported: c } }(), t = function () { function m(a) { if (!a.__internal) { delete a.__init, a.__settings || (a.__settings = h(a.settings)), null === za && document.body.setAttribute(\"tabindex\", \"0\"); var c; \"function\" == typeof a.setup ? (c = a.setup(), c.options = c.options || {}, c.focus = c.focus || {}) : c = { buttons: [], focus: { element: null, select: !1 }, options: {} }, \"object\" != typeof a.hooks && (a.hooks = {}); var d = []; if (Array.isArray(c.buttons)) for (var e = 0; e < c.buttons.length; e += 1) { var f = c.buttons[e], g = {}; for (var i in f) f.hasOwnProperty(i) && (g[i] = f[i]); d.push(g) } var k = a.__internal = { isOpen: !1, activeElement: document.body, timerIn: void 0, timerOut: void 0, buttons: d, focus: c.focus, options: { title: void 0, modal: void 0, basic: void 0, frameless: void 0, pinned: void 0, movable: void 0, moveBounded: void 0, resizable: void 0, autoReset: void 0, closable: void 0, closableByDimmer: void 0, maximizable: void 0, startMaximized: void 0, pinnable: void 0, transition: void 0, padding: void 0, overflow: void 0, onshow: void 0, onclose: void 0, onfocus: void 0, onmove: void 0, onmoved: void 0, onresize: void 0, onresized: void 0, onmaximize: void 0, onmaximized: void 0, onrestore: void 0, onrestored: void 0 }, resetHandler: void 0, beginMoveHandler: void 0, beginResizeHandler: void 0, bringToFrontHandler: void 0, modalClickHandler: void 0, buttonsClickHandler: void 0, commandsClickHandler: void 0, transitionInHandler: void 0, transitionOutHandler: void 0, destroy: void 0 }, l = {}; l.root = document.createElement(\"div\"), l.root.className = Ca.base + \" \" + Ca.hidden + \" \", l.root.innerHTML = Ba.dimmer + Ba.modal, l.dimmer = l.root.firstChild, l.modal = l.root.lastChild, l.modal.innerHTML = Ba.dialog, l.dialog = l.modal.firstChild, l.dialog.innerHTML = Ba.reset + Ba.commands + Ba.header + Ba.body + Ba.footer + Ba.resizeHandle + Ba.reset, l.reset = [], l.reset.push(l.dialog.firstChild), l.reset.push(l.dialog.lastChild), l.commands = {}, l.commands.container = l.reset[0].nextSibling, l.commands.pin = l.commands.container.firstChild, l.commands.maximize = l.commands.pin.nextSibling, l.commands.close = l.commands.maximize.nextSibling, l.header = l.commands.container.nextSibling, l.body = l.header.nextSibling, l.body.innerHTML = Ba.content, l.content = l.body.firstChild, l.footer = l.body.nextSibling, l.footer.innerHTML = Ba.buttons.auxiliary + Ba.buttons.primary, l.resizeHandle = l.footer.nextSibling, l.buttons = {}, l.buttons.auxiliary = l.footer.firstChild, l.buttons.primary = l.buttons.auxiliary.nextSibling, l.buttons.primary.innerHTML = Ba.button, l.buttonTemplate = l.buttons.primary.firstChild, l.buttons.primary.removeChild(l.buttonTemplate); for (var m = 0; m < a.__internal.buttons.length; m += 1) { var n = a.__internal.buttons[m]; ya.indexOf(n.key) < 0 && ya.push(n.key), n.element = l.buttonTemplate.cloneNode(), n.element.innerHTML = n.text, \"string\" == typeof n.className && \"\" !== n.className && b(n.element, n.className); for (var o in n.attrs) \"className\" !== o && n.attrs.hasOwnProperty(o) && n.element.setAttribute(o, n.attrs[o]); \"auxiliary\" === n.scope ? l.buttons.auxiliary.appendChild(n.element) : l.buttons.primary.appendChild(n.element) } a.elements = l, k.resetHandler = j(a, X), k.beginMoveHandler = j(a, aa), k.beginResizeHandler = j(a, ga), k.bringToFrontHandler = j(a, B), k.modalClickHandler = j(a, R), k.buttonsClickHandler = j(a, T), k.commandsClickHandler = j(a, F), k.transitionInHandler = j(a, Y), k.transitionOutHandler = j(a, Z); for (var p in k.options) void 0 !== c.options[p] ? a.set(p, c.options[p]) : v.defaults.hasOwnProperty(p) ? a.set(p, v.defaults[p]) : \"title\" === p && a.set(p, v.defaults.glossary[p]); \"function\" == typeof a.build && a.build() } document.body.appendChild(a.elements.root) } function o() { wa = f(), xa = e() } function t() { a.scrollTo(wa, xa) } function u() { for (var a = 0, d = 0; d < p.length; d += 1) { var e = p[d]; (e.isModal() || e.isMaximized()) && (a += 1) } 0 === a && document.body.className.indexOf(Ca.noOverflow) >= 0 ? (c(document.body, Ca.noOverflow), w(!1)) : a > 0 && document.body.className.indexOf(Ca.noOverflow) < 0 && (w(!0), b(document.body, Ca.noOverflow)) } function w(d) { v.defaults.preventBodyShift && document.documentElement.scrollHeight > document.documentElement.clientHeight && (d ? (Ea = xa, Da = a.getComputedStyle(document.body).top, b(document.body, Ca.fixed), document.body.style.top = -xa + \"px\") : (xa = Ea, document.body.style.top = Da, c(document.body, Ca.fixed), t())) } function x(a, d, e) { \"string\" == typeof e && c(a.elements.root, Ca.prefix + e), b(a.elements.root, Ca.prefix + d), za = a.elements.root.offsetWidth } function y(a) { a.get(\"modal\") ? (c(a.elements.root, Ca.modeless), a.isOpen() && (pa(a), N(a), u())) : (b(a.elements.root, Ca.modeless), a.isOpen() && (oa(a), N(a), u())) } function z(a) { a.get(\"basic\") ? b(a.elements.root, Ca.basic) : c(a.elements.root, Ca.basic) } function A(a) { a.get(\"frameless\") ? b(a.elements.root, Ca.frameless) : c(a.elements.root, Ca.frameless) } function B(a, b) { for (var c = p.indexOf(b), d = c + 1; d < p.length; d += 1) if (p[d].isModal()) return; return document.body.lastChild !== b.elements.root && (document.body.appendChild(b.elements.root), p.splice(p.indexOf(b), 1), p.push(b), W(b)), !1 } function C(a, d, e, f) { switch (d) { case \"title\": a.setHeader(f); break; case \"modal\": y(a); break; case \"basic\": z(a); break; case \"frameless\": A(a); break; case \"pinned\": O(a); break; case \"closable\": Q(a); break; case \"maximizable\": P(a); break; case \"pinnable\": K(a); break; case \"movable\": ea(a); break; case \"resizable\": ka(a); break; case \"transition\": x(a, f, e); break; case \"padding\": f ? c(a.elements.root, Ca.noPadding) : a.elements.root.className.indexOf(Ca.noPadding) < 0 && b(a.elements.root, Ca.noPadding); break; case \"overflow\": f ? c(a.elements.root, Ca.noOverflow) : a.elements.root.className.indexOf(Ca.noOverflow) < 0 && b(a.elements.root, Ca.noOverflow); break; case \"transition\": x(a, f, e) } \"function\" == typeof a.hooks.onupdate && a.hooks.onupdate.call(a, d, e, f) } function D(a, b, c, d, e) { var f = { op: void 0, items: [] }; if (\"undefined\" == typeof e && \"string\" == typeof d) f.op = \"get\", b.hasOwnProperty(d) ? (f.found = !0, f.value = b[d]) : (f.found = !1, f.value = void 0); else { var g; if (f.op = \"set\", \"object\" == typeof d) { var h = d; for (var i in h) b.hasOwnProperty(i) ? (b[i] !== h[i] && (g = b[i], b[i] = h[i], c.call(a, i, g, h[i])), f.items.push({ key: i, value: h[i], found: !0 })) : f.items.push({ key: i, value: h[i], found: !1 }) } else { if (\"string\" != typeof d) throw new Error(\"args must be a string or object\"); b.hasOwnProperty(d) ? (b[d] !== e && (g = b[d], b[d] = e, c.call(a, d, g, e)), f.items.push({ key: d, value: e, found: !0 })) : f.items.push({ key: d, value: e, found: !1 }) } } return f } function E(a) { var b; S(a, function (a) { return b = a.invokeOnClose === !0 }), !b && a.isOpen() && a.close() } function F(a, b) { var c = a.srcElement || a.target; switch (c) { case b.elements.commands.pin: b.isPinned() ? H(b) : G(b); break; case b.elements.commands.maximize: b.isMaximized() ? J(b) : I(b); break; case b.elements.commands.close: E(b) } return !1 } function G(a) { a.set(\"pinned\", !0) } function H(a) { a.set(\"pinned\", !1) } function I(a) { l(\"onmaximize\", a), b(a.elements.root, Ca.maximized), a.isOpen() && u(), l(\"onmaximized\", a) } function J(a) { l(\"onrestore\", a), c(a.elements.root, Ca.maximized), a.isOpen() && u(), l(\"onrestored\", a) } function K(a) { a.get(\"pinnable\") ? b(a.elements.root, Ca.pinnable) : c(a.elements.root, Ca.pinnable) } function L(a) { var b = f(); a.elements.modal.style.marginTop = e() + \"px\", a.elements.modal.style.marginLeft = b + \"px\", a.elements.modal.style.marginRight = -b + \"px\" } function M(a) { var b = parseInt(a.elements.modal.style.marginTop, 10), c = parseInt(a.elements.modal.style.marginLeft, 10); if (a.elements.modal.style.marginTop = \"\", a.elements.modal.style.marginLeft = \"\", a.elements.modal.style.marginRight = \"\", a.isOpen()) { var d = 0, g = 0; \"\" !== a.elements.dialog.style.top && (d = parseInt(a.elements.dialog.style.top, 10)), a.elements.dialog.style.top = d + (b - e()) + \"px\", \"\" !== a.elements.dialog.style.left && (g = parseInt(a.elements.dialog.style.left, 10)), a.elements.dialog.style.left = g + (c - f()) + \"px\" } } function N(a) { a.get(\"modal\") || a.get(\"pinned\") ? M(a) : L(a) } function O(a) { a.get(\"pinned\") ? (c(a.elements.root, Ca.unpinned), a.isOpen() && M(a)) : (b(a.elements.root, Ca.unpinned), a.isOpen() && !a.isModal() && L(a)) } function P(a) { a.get(\"maximizable\") ? b(a.elements.root, Ca.maximizable) : c(a.elements.root, Ca.maximizable) } function Q(a) { a.get(\"closable\") ? (b(a.elements.root, Ca.closable), ua(a)) : (c(a.elements.root, Ca.closable), va(a)) } function R(a, b) { var c = a.srcElement || a.target; return Fa || c !== b.elements.modal || b.get(\"closableByDimmer\") !== !0 || E(b), Fa = !1, !1 } function S(a, b) { for (var c = 0; c < a.__internal.buttons.length; c += 1) { var d = a.__internal.buttons[c]; if (!d.element.disabled && b(d)) { var e = k(c, d); \"function\" == typeof a.callback && a.callback.apply(a, [e]), e.cancel === !1 && a.close(); break } } } function T(a, b) { var c = a.srcElement || a.target; S(b, function (a) { return a.element === c && (Ga = !0) }) } function U(a) { if (Ga) return void (Ga = !1); var b = p[p.length - 1], c = a.keyCode; return 0 === b.__internal.buttons.length && c === n.ESC && b.get(\"closable\") === !0 ? (E(b), !1) : ya.indexOf(c) > -1 ? (S(b, function (a) { return a.key === c }), !1) : void 0 } function V(a) { var b = p[p.length - 1], c = a.keyCode; if (c === n.LEFT || c === n.RIGHT) { for (var d = b.__internal.buttons, e = 0; e < d.length; e += 1) if (document.activeElement === d[e].element) switch (c) { case n.LEFT: return void d[(e || d.length) - 1].element.focus(); case n.RIGHT: return void d[(e + 1) % d.length].element.focus() } } else if (c < n.F12 + 1 && c > n.F1 - 1 && ya.indexOf(c) > -1) return a.preventDefault(), a.stopPropagation(), S(b, function (a) { return a.key === c }), !1 } function W(a, b) { if (b) b.focus(); else { var c = a.__internal.focus, d = c.element; switch (typeof c.element) { case \"number\": a.__internal.buttons.length > c.element && (d = a.get(\"basic\") === !0 ? a.elements.reset[0] : a.__internal.buttons[c.element].element); break; case \"string\": d = a.elements.body.querySelector(c.element); break; case \"function\": d = c.element.call(a) } \"undefined\" != typeof d && null !== d || 0 !== a.__internal.buttons.length || (d = a.elements.reset[0]), d && d.focus && (d.focus(), c.select && d.select && d.select()) } } function X(a, b) { if (!b) for (var c = p.length - 1; c > -1; c -= 1) if (p[c].isModal()) { b = p[c]; break } if (b && b.isModal()) { var d, e = a.srcElement || a.target, f = e === b.elements.reset[1] || 0 === b.__internal.buttons.length && e === document.body; f && (b.get(\"maximizable\") ? d = b.elements.commands.maximize : b.get(\"closable\") && (d = b.elements.commands.close)), void 0 === d && (\"number\" == typeof b.__internal.focus.element ? e === b.elements.reset[0] ? d = b.elements.buttons.auxiliary.firstChild || b.elements.buttons.primary.firstChild : f && (d = b.elements.reset[0]) : e === b.elements.reset[0] && (d = b.elements.buttons.primary.lastChild || b.elements.buttons.auxiliary.lastChild)), W(b, d) } } function Y(a, b) { clearTimeout(b.__internal.timerIn), W(b), t(), Ga = !1, l(\"onfocus\", b), r(b.elements.dialog, s.type, b.__internal.transitionInHandler), c(b.elements.root, Ca.animationIn) } function Z(a, b) { clearTimeout(b.__internal.timerOut), r(b.elements.dialog, s.type, b.__internal.transitionOutHandler), da(b), ja(b), b.isMaximized() && !b.get(\"startMaximized\") && J(b), v.defaults.maintainFocus && b.__internal.activeElement && (b.__internal.activeElement.focus(), b.__internal.activeElement = null), \"function\" == typeof b.__internal.destroy && b.__internal.destroy.apply(b) } function $(a, b) { var c = a[Ka] - Ia, d = a[La] - Ja; Na && (d -= document.body.scrollTop), b.style.left = c + \"px\", b.style.top = d + \"px\" } function _(a, b) { var c = a[Ka] - Ia, d = a[La] - Ja; Na && (d -= document.body.scrollTop), b.style.left = Math.min(Ma.maxLeft, Math.max(Ma.minLeft, c)) + \"px\", Na ? b.style.top = Math.min(Ma.maxTop, Math.max(Ma.minTop, d)) + \"px\" : b.style.top = Math.max(Ma.minTop, d) + \"px\" } function aa(a, c) { if (null === Pa && !c.isMaximized() && c.get(\"movable\")) { var d, e = 0, f = 0; if (\"touchstart\" === a.type ? (a.preventDefault(), d = a.targetTouches[0], Ka = \"clientX\", La = \"clientY\") : 0 === a.button && (d = a), d) { var g = c.elements.dialog; if (b(g, Ca.capture), g.style.left && (e = parseInt(g.style.left, 10)), g.style.top && (f = parseInt(g.style.top, 10)), Ia = d[Ka] - e, Ja = d[La] - f, c.isModal() ? Ja += c.elements.modal.scrollTop : c.isPinned() && (Ja -= document.body.scrollTop), c.get(\"moveBounded\")) { var h = g, i = -e, j = -f; do i += h.offsetLeft, j += h.offsetTop; while (h = h.offsetParent); Ma = { maxLeft: i, minLeft: -i, maxTop: document.documentElement.clientHeight - g.clientHeight - j, minTop: -j }, Oa = _ } else Ma = null, Oa = $; return l(\"onmove\", c), Na = !c.isModal() && c.isPinned(), Ha = c, Oa(d, g), b(document.body, Ca.noSelection), !1 } } } function ba(a) { if (Ha) { var b; \"touchmove\" === a.type ? (a.preventDefault(), b = a.targetTouches[0]) : 0 === a.button && (b = a), b && Oa(b, Ha.elements.dialog) } } function ca() { if (Ha) { var a = Ha; Ha = Ma = null, c(document.body, Ca.noSelection), c(a.elements.dialog, Ca.capture), l(\"onmoved\", a) } } function da(a) { Ha = null; var b = a.elements.dialog; b.style.left = b.style.top = \"\" } function ea(a) { a.get(\"movable\") ? (b(a.elements.root, Ca.movable), a.isOpen() && qa(a)) : (da(a), c(a.elements.root, Ca.movable), a.isOpen() && ra(a)) } function fa(a, b, c) { var e = b, f = 0, g = 0; do f += e.offsetLeft, g += e.offsetTop; while (e = e.offsetParent); var h, i; c === !0 ? (h = a.pageX, i = a.pageY) : (h = a.clientX, i = a.clientY); var j = d(); if (j && (h = document.body.offsetWidth - h, isNaN(Qa) || (f = document.body.offsetWidth - f - b.offsetWidth)), b.style.height = i - g + Ta + \"px\", b.style.width = h - f + Ta + \"px\", !isNaN(Qa)) { var k = .5 * Math.abs(b.offsetWidth - Ra); j && (k *= -1), b.offsetWidth > Ra ? b.style.left = Qa + k + \"px\" : b.offsetWidth >= Sa && (b.style.left = Qa - k + \"px\") } } function ga(a, c) { if (!c.isMaximized()) { var d; if (\"touchstart\" === a.type ? (a.preventDefault(), d = a.targetTouches[0]) : 0 === a.button && (d = a), d) { l(\"onresize\", c), Pa = c, Ta = c.elements.resizeHandle.offsetHeight / 2; var e = c.elements.dialog; return b(e, Ca.capture), Qa = parseInt(e.style.left, 10), e.style.height = e.offsetHeight + \"px\", e.style.minHeight = c.elements.header.offsetHeight + c.elements.footer.offsetHeight + \"px\", e.style.width = (Ra = e.offsetWidth) + \"px\", \"none\" !== e.style.maxWidth && (e.style.minWidth = (Sa = e.offsetWidth) + \"px\"), e.style.maxWidth = \"none\", b(document.body, Ca.noSelection), !1 } } } function ha(a) { if (Pa) { var b; \"touchmove\" === a.type ? (a.preventDefault(), b = a.targetTouches[0]) : 0 === a.button && (b = a), b && fa(b, Pa.elements.dialog, !Pa.get(\"modal\") && !Pa.get(\"pinned\")) } } function ia() { if (Pa) { var a = Pa; Pa = null, c(document.body, Ca.noSelection), c(a.elements.dialog, Ca.capture), Fa = !0, l(\"onresized\", a) } } function ja(a) { Pa = null; var b = a.elements.dialog; \"none\" === b.style.maxWidth && (b.style.maxWidth = b.style.minWidth = b.style.width = b.style.height = b.style.minHeight = b.style.left = \"\", Qa = Number.Nan, Ra = Sa = Ta = 0) } function ka(a) { a.get(\"resizable\") ? (b(a.elements.root, Ca.resizable), a.isOpen() && sa(a)) : (ja(a), c(a.elements.root, Ca.resizable), a.isOpen() && ta(a)) } function la() { for (var a = 0; a < p.length; a += 1) { var b = p[a]; b.get(\"autoReset\") && (da(b), ja(b)) } } function ma(b) { 1 === p.length && (q(a, \"resize\", la), q(document.body, \"keyup\", U), q(document.body, \"keydown\", V), q(document.body, \"focus\", X), q(document.documentElement, \"mousemove\", ba), q(document.documentElement, \"touchmove\", ba), q(document.documentElement, \"mouseup\", ca), q(document.documentElement, \"touchend\", ca), q(document.documentElement, \"mousemove\", ha), q(document.documentElement, \"touchmove\", ha), q(document.documentElement, \"mouseup\", ia), q(document.documentElement, \"touchend\", ia)), q(b.elements.commands.container, \"click\", b.__internal.commandsClickHandler), q(b.elements.footer, \"click\", b.__internal.buttonsClickHandler), q(b.elements.reset[0], \"focus\", b.__internal.resetHandler), q(b.elements.reset[1], \"focus\", b.__internal.resetHandler), Ga = !0, q(b.elements.dialog, s.type, b.__internal.transitionInHandler), b.get(\"modal\") || oa(b), b.get(\"resizable\") && sa(b), b.get(\"movable\") && qa(b) } function na(b) { 1 === p.length && (r(a, \"resize\", la), r(document.body, \"keyup\", U), r(document.body, \"keydown\", V), r(document.body, \"focus\", X), r(document.documentElement, \"mousemove\", ba), r(document.documentElement, \"mouseup\", ca), r(document.documentElement, \"mousemove\", ha), r(document.documentElement, \"mouseup\", ia)), r(b.elements.commands.container, \"click\", b.__internal.commandsClickHandler), r(b.elements.footer, \"click\", b.__internal.buttonsClickHandler), r(b.elements.reset[0], \"focus\", b.__internal.resetHandler), r(b.elements.reset[1], \"focus\", b.__internal.resetHandler), q(b.elements.dialog, s.type, b.__internal.transitionOutHandler), b.get(\"modal\") || pa(b), b.get(\"movable\") && ra(b), b.get(\"resizable\") && ta(b) } function oa(a) { q(a.elements.dialog, \"focus\", a.__internal.bringToFrontHandler, !0) } function pa(a) { r(a.elements.dialog, \"focus\", a.__internal.bringToFrontHandler, !0) } function qa(a) { q(a.elements.header, \"mousedown\", a.__internal.beginMoveHandler), q(a.elements.header, \"touchstart\", a.__internal.beginMoveHandler) } function ra(a) { r(a.elements.header, \"mousedown\", a.__internal.beginMoveHandler), r(a.elements.header, \"touchstart\", a.__internal.beginMoveHandler) } function sa(a) { q(a.elements.resizeHandle, \"mousedown\", a.__internal.beginResizeHandler), q(a.elements.resizeHandle, \"touchstart\", a.__internal.beginResizeHandler) } function ta(a) { r(a.elements.resizeHandle, \"mousedown\", a.__internal.beginResizeHandler), r(a.elements.resizeHandle, \"touchstart\", a.__internal.beginResizeHandler) } function ua(a) { q(a.elements.modal, \"click\", a.__internal.modalClickHandler) } function va(a) { r(a.elements.modal, \"click\", a.__internal.modalClickHandler) } var wa, xa, ya = [], za = null, Aa = a.navigator.userAgent.indexOf(\"Safari\") > -1 && a.navigator.userAgent.indexOf(\"Chrome\") < 0, Ba = { dimmer: '<div class=\"ajs-dimmer\"></div>', modal: '<div class=\"ajs-modal\" tabindex=\"0\"></div>', dialog: '<div class=\"ajs-dialog\" tabindex=\"0\"></div>', reset: '<button class=\"ajs-reset\"></button>', commands: '<div class=\"ajs-commands\"><button class=\"ajs-pin\"></button><button class=\"ajs-maximize\"></button><button class=\"ajs-close\"></button></div>', header: '<div class=\"ajs-header\"></div>', body: '<div class=\"ajs-body\"></div>', content: '<div class=\"ajs-content\"></div>', footer: '<div class=\"ajs-footer\"></div>', buttons: { primary: '<div class=\"ajs-primary ajs-buttons\"></div>', auxiliary: '<div class=\"ajs-auxiliary ajs-buttons\"></div>' }, button: '<button class=\"ajs-button\"></button>', resizeHandle: '<div class=\"ajs-handle\"></div>' }, Ca = { animationIn: \"ajs-in\", animationOut: \"ajs-out\", base: \"alertify\", basic: \"ajs-basic\", capture: \"ajs-capture\", closable: \"ajs-closable\", fixed: \"ajs-fixed\", frameless: \"ajs-frameless\", hidden: \"ajs-hidden\", maximize: \"ajs-maximize\", maximized: \"ajs-maximized\", maximizable: \"ajs-maximizable\", modeless: \"ajs-modeless\", movable: \"ajs-movable\", noSelection: \"ajs-no-selection\", noOverflow: \"ajs-no-overflow\", noPadding: \"ajs-no-padding\", pin: \"ajs-pin\", pinnable: \"ajs-pinnable\", prefix: \"ajs-\", resizable: \"ajs-resizable\", restore: \"ajs-restore\", shake: \"ajs-shake\", unpinned: \"ajs-unpinned\" }, Da = \"\", Ea = 0, Fa = !1, Ga = !1, Ha = null, Ia = 0, Ja = 0, Ka = \"pageX\", La = \"pageY\", Ma = null, Na = !1, Oa = null, Pa = null, Qa = Number.Nan, Ra = 0, Sa = 0, Ta = 0; return { __init: m, isOpen: function () { return this.__internal.isOpen }, isModal: function () { return this.elements.root.className.indexOf(Ca.modeless) < 0 }, isMaximized: function () { return this.elements.root.className.indexOf(Ca.maximized) > -1 }, isPinned: function () { return this.elements.root.className.indexOf(Ca.unpinned) < 0 }, maximize: function () { return this.isMaximized() || I(this), this }, restore: function () { return this.isMaximized() && J(this), this }, pin: function () { return this.isPinned() || G(this), this }, unpin: function () { return this.isPinned() && H(this), this }, bringToFront: function () { return B(null, this), this }, moveTo: function (a, b) { if (!isNaN(a) && !isNaN(b)) { l(\"onmove\", this); var c = this.elements.dialog, e = c, f = 0, g = 0; c.style.left && (f -= parseInt(c.style.left, 10)), c.style.top && (g -= parseInt(c.style.top, 10)); do f += e.offsetLeft, g += e.offsetTop; while (e = e.offsetParent); var h = a - f, i = b - g; d() && (h *= -1), c.style.left = h + \"px\", c.style.top = i + \"px\", l(\"onmoved\", this) } return this }, resizeTo: function (a, b) { var c = parseFloat(a), d = parseFloat(b), e = /(\\d*\\.\\d+|\\d+)%/; if (!isNaN(c) && !isNaN(d) && this.get(\"resizable\") === !0) { l(\"onresize\", this), (\"\" + a).match(e) && (c = c / 100 * document.documentElement.clientWidth), (\"\" + b).match(e) && (d = d / 100 * document.documentElement.clientHeight); var f = this.elements.dialog; \"none\" !== f.style.maxWidth && (f.style.minWidth = (Sa = f.offsetWidth) + \"px\"), f.style.maxWidth = \"none\", f.style.minHeight = this.elements.header.offsetHeight + this.elements.footer.offsetHeight + \"px\", f.style.width = c + \"px\", f.style.height = d + \"px\", l(\"onresized\", this) } return this }, setting: function (a, b) { var c = this, d = D(this, this.__internal.options, function (a, b, d) { C(c, a, b, d) }, a, b); if (\"get\" === d.op) return d.found ? d.value : \"undefined\" != typeof this.settings ? D(this, this.settings, this.settingUpdated || function () { }, a, b).value : void 0; if (\"set\" === d.op) { if (d.items.length > 0) for (var e = this.settingUpdated || function () { }, f = 0; f < d.items.length; f += 1) { var g = d.items[f]; g.found || \"undefined\" == typeof this.settings || D(this, this.settings, e, g.key, g.value) } return this } }, set: function (a, b) { return this.setting(a, b), this }, get: function (a) { return this.setting(a) }, setHeader: function (b) { return \"string\" == typeof b ? (g(this.elements.header), this.elements.header.innerHTML = b) : b instanceof a.HTMLElement && this.elements.header.firstChild !== b && (g(this.elements.header), this.elements.header.appendChild(b)), this }, setContent: function (b) { return \"string\" == typeof b ? (g(this.elements.content), this.elements.content.innerHTML = b) : b instanceof a.HTMLElement && this.elements.content.firstChild !== b && (g(this.elements.content), this.elements.content.appendChild(b)), this }, showModal: function (a) { return this.show(!0, a) }, show: function (a, d) { if (m(this), this.__internal.isOpen) { da(this), ja(this), b(this.elements.dialog, Ca.shake); var e = this; setTimeout(function () { c(e.elements.dialog, Ca.shake) }, 200) } else { if (this.__internal.isOpen = !0, p.push(this), v.defaults.maintainFocus && (this.__internal.activeElement = document.activeElement), \"function\" == typeof this.prepare && this.prepare(), ma(this), void 0 !== a && this.set(\"modal\", a), o(), u(), \"string\" == typeof d && \"\" !== d && (this.__internal.className = d, b(this.elements.root, d)), this.get(\"startMaximized\") ? this.maximize() : this.isMaximized() && J(this), N(this), c(this.elements.root, Ca.animationOut), b(this.elements.root, Ca.animationIn), clearTimeout(this.__internal.timerIn), this.__internal.timerIn = setTimeout(this.__internal.transitionInHandler, s.supported ? 1e3 : 100), Aa) { var f = this.elements.root; f.style.display = \"none\", setTimeout(function () { f.style.display = \"block\" }, 0) } za = this.elements.root.offsetWidth, c(this.elements.root, Ca.hidden), \"function\" == typeof this.hooks.onshow && this.hooks.onshow.call(this), l(\"onshow\", this) } return this }, close: function () { return this.__internal.isOpen && (na(this), c(this.elements.root, Ca.animationIn), b(this.elements.root, Ca.animationOut), clearTimeout(this.__internal.timerOut), this.__internal.timerOut = setTimeout(this.__internal.transitionOutHandler, s.supported ? 1e3 : 100), b(this.elements.root, Ca.hidden), za = this.elements.modal.offsetWidth, \"undefined\" != typeof this.__internal.className && \"\" !== this.__internal.className && c(this.elements.root, this.__internal.className), \"function\" == typeof this.hooks.onclose && this.hooks.onclose.call(this), l(\"onclose\", this), p.splice(p.indexOf(this), 1), this.__internal.isOpen = !1, u()), this }, closeOthers: function () { return v.closeAll(this), this }, destroy: function () { return this.__internal.isOpen ? (this.__internal.destroy = function () { i(this, m) }, this.close()) : i(this, m), this } } }(), u = function () { function d(a) { a.__internal || (a.__internal = { position: v.defaults.notifier.position, delay: v.defaults.notifier.delay }, l = document.createElement(\"DIV\"), h(a)), l.parentNode !== document.body && document.body.appendChild(l) } function e(a) { a.__internal.pushed = !0, m.push(a) } function f(a) { m.splice(m.indexOf(a), 1), a.__internal.pushed = !1 } function h(a) { switch (l.className = n.base, a.__internal.position) { case \"top-right\": b(l, n.top + \" \" + n.right); break; case \"top-left\": b(l, n.top + \" \" + n.left); break; case \"bottom-left\": b(l, n.bottom + \" \" + n.left); break; default: case \"bottom-right\": b(l, n.bottom + \" \" + n.right) } } function i(d, h) { function i(a, b) { b.dismiss(!0) } function m(a, b) { r(b.element, s.type, m), l.removeChild(b.element) } function o(a) { return a.__internal || (a.__internal = { pushed: !1, delay: void 0, timer: void 0, clickHandler: void 0, transitionEndHandler: void 0, transitionTimeout: void 0 }, a.__internal.clickHandler = j(a, i), a.__internal.transitionEndHandler = j(a, m)), a } function p(a) { clearTimeout(a.__internal.timer), clearTimeout(a.__internal.transitionTimeout) } return o({ element: d, push: function (a, c) { if (!this.__internal.pushed) { e(this), p(this); var d, f; switch (arguments.length) { case 0: f = this.__internal.delay; break; case 1: \"number\" == typeof a ? f = a : (d = a, f = this.__internal.delay); break; case 2: d = a, f = c } return \"undefined\" != typeof d && this.setContent(d), u.__internal.position.indexOf(\"top\") < 0 ? l.appendChild(this.element) : l.insertBefore(this.element, l.firstChild), k = this.element.offsetWidth, b(this.element, n.visible), q(this.element, \"click\", this.__internal.clickHandler), this.delay(f) } return this }, ondismiss: function () { }, callback: h, dismiss: function (a) { return this.__internal.pushed && (p(this), (\"function\" != typeof this.ondismiss || this.ondismiss.call(this) !== !1) && (r(this.element, \"click\", this.__internal.clickHandler), \"undefined\" != typeof this.element && this.element.parentNode === l && (this.__internal.transitionTimeout = setTimeout(this.__internal.transitionEndHandler, s.supported ? 1e3 : 100), c(this.element, n.visible), \"function\" == typeof this.callback && this.callback.call(this, a)), f(this))), this }, delay: function (a) { if (p(this), this.__internal.delay = \"undefined\" == typeof a || isNaN(+a) ? u.__internal.delay : +a, this.__internal.delay > 0) { var b = this; this.__internal.timer = setTimeout(function () { b.dismiss() }, 1e3 * this.__internal.delay) } return this }, setContent: function (b) { return \"string\" == typeof b ? (g(this.element), this.element.innerHTML = b) : b instanceof a.HTMLElement && this.element.firstChild !== b && (g(this.element), this.element.appendChild(b)), this }, dismissOthers: function () { return u.dismissAll(this), this } }) } var k, l, m = [], n = { base: \"alertify-notifier\", message: \"ajs-message\", top: \"ajs-top\", right: \"ajs-right\", bottom: \"ajs-bottom\", left: \"ajs-left\", visible: \"ajs-visible\", hidden: \"ajs-hidden\" }; return { setting: function (a, b) { if (d(this), \"undefined\" == typeof b) return this.__internal[a]; switch (a) { case \"position\": this.__internal.position = b, h(this); break; case \"delay\": this.__internal.delay = b } return this }, set: function (a, b) { return this.setting(a, b), this }, get: function (a) { return this.setting(a) }, create: function (a, b) { d(this); var c = document.createElement(\"div\"); return c.className = n.message + (\"string\" == typeof a && \"\" !== a ? \" ajs-\" + a : \"\"), i(c, b) }, dismissAll: function (a) { for (var b = m.slice(0), c = 0; c < b.length; c += 1) { var d = b[c]; (void 0 === a || a !== d) && d.dismiss() } } } }(), v = new m; v.dialog(\"alert\", function () { return { main: function (a, b, c) { var d, e, f; switch (arguments.length) { case 1: e = a; break; case 2: \"function\" == typeof b ? (e = a, f = b) : (d = a, e = b); break; case 3: d = a, e = b, f = c } return this.set(\"title\", d), this.set(\"message\", e), this.set(\"onok\", f), this }, setup: function () { return { buttons: [{ text: v.defaults.glossary.ok, key: n.ESC, invokeOnClose: !0, className: v.defaults.theme.ok }], focus: { element: 0, select: !1 }, options: { maximizable: !1, resizable: !1 } } }, build: function () { }, prepare: function () { }, setMessage: function (a) { this.setContent(a) }, settings: { message: void 0, onok: void 0, label: void 0 }, settingUpdated: function (a, b, c) { switch (a) { case \"message\": this.setMessage(c); break; case \"label\": this.__internal.buttons[0].element && (this.__internal.buttons[0].element.innerHTML = c) } }, callback: function (a) { if (\"function\" == typeof this.get(\"onok\")) { var b = this.get(\"onok\").call(this, a); \"undefined\" != typeof b && (a.cancel = !b) } } } }), v.dialog(\"confirm\", function () {\n function a(a) { null !== c.timer && (clearInterval(c.timer), c.timer = null, a.__internal.buttons[c.index].element.innerHTML = c.text) } function b(b, d, e) { a(b), c.duration = e, c.index = d, c.text = b.__internal.buttons[d].element.innerHTML, c.timer = setInterval(j(b, c.task), 1e3), c.task(null, b) } var c = { timer: null, index: null, text: null, duration: null, task: function (b, d) { if (d.isOpen()) { if (d.__internal.buttons[c.index].element.innerHTML = c.text + \" (&#8207;\" + c.duration + \"&#8207;) \", c.duration -= 1, -1 === c.duration) { a(d); var e = d.__internal.buttons[c.index], f = k(c.index, e); \"function\" == typeof d.callback && d.callback.apply(d, [f]), f.close !== !1 && d.close() } } else a(d) } }; return {\n main: function (a, b, c, d) { var e, f, g, h; switch (arguments.length) { case 1: f = a; break; case 2: f = a, g = b; break; case 3: f = a, g = b, h = c; break; case 4: e = a, f = b, g = c, h = d } return this.set(\"title\", e), this.set(\"message\", f), this.set(\"onok\", g), this.set(\"oncancel\", h), this }, setup: function () { return { buttons: [{ text: v.defaults.glossary.ok, key: n.ENTER, className: v.defaults.theme.ok }, { text: v.defaults.glossary.cancel, key: n.ESC, invokeOnClose: !0, className: v.defaults.theme.cancel }], focus: { element: 0, select: !1 }, options: { maximizable: !1, resizable: !1 } } }, build: function () { }, prepare: function () { }, setMessage: function (a) { this.setContent(a) }, settings: { message: null, labels: null, onok: null, oncancel: null, defaultFocus: null, reverseButtons: null }, settingUpdated: function (a, b, c) {\n switch (a) {\n case \"message\": this.setMessage(c);\n break; case \"labels\": \"ok\" in c && this.__internal.buttons[0].element && (this.__internal.buttons[0].text = c.ok, this.__internal.buttons[0].element.innerHTML = c.ok), \"cancel\" in c && this.__internal.buttons[1].element && (this.__internal.buttons[1].text = c.cancel, this.__internal.buttons[1].element.innerHTML = c.cancel); break; case \"reverseButtons\": c === !0 ? this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element) : this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element); break; case \"defaultFocus\": this.__internal.focus.element = \"ok\" === c ? 0 : 1\n }\n }, callback: function (b) { a(this); var c; switch (b.index) { case 0: \"function\" == typeof this.get(\"onok\") && (c = this.get(\"onok\").call(this, b), \"undefined\" != typeof c && (b.cancel = !c)); break; case 1: \"function\" == typeof this.get(\"oncancel\") && (c = this.get(\"oncancel\").call(this, b), \"undefined\" != typeof c && (b.cancel = !c)) } }, autoOk: function (a) { return b(this, 0, a), this }, autoCancel: function (a) { return b(this, 1, a), this }\n }\n }), v.dialog(\"prompt\", function () { var b = document.createElement(\"INPUT\"), c = document.createElement(\"P\"); return { main: function (a, b, c, d, e) { var f, g, h, i, j; switch (arguments.length) { case 1: g = a; break; case 2: g = a, h = b; break; case 3: g = a, h = b, i = c; break; case 4: g = a, h = b, i = c, j = d; break; case 5: f = a, g = b, h = c, i = d, j = e } return this.set(\"title\", f), this.set(\"message\", g), this.set(\"value\", h), this.set(\"onok\", i), this.set(\"oncancel\", j), this }, setup: function () { return { buttons: [{ text: v.defaults.glossary.ok, key: n.ENTER, className: v.defaults.theme.ok }, { text: v.defaults.glossary.cancel, key: n.ESC, invokeOnClose: !0, className: v.defaults.theme.cancel }], focus: { element: b, select: !0 }, options: { maximizable: !1, resizable: !1 } } }, build: function () { b.className = v.defaults.theme.input, b.setAttribute(\"type\", \"text\"), b.value = this.get(\"value\"), this.elements.content.appendChild(c), this.elements.content.appendChild(b) }, prepare: function () { }, setMessage: function (b) { \"string\" == typeof b ? (g(c), c.innerHTML = b) : b instanceof a.HTMLElement && c.firstChild !== b && (g(c), c.appendChild(b)) }, settings: { message: void 0, labels: void 0, onok: void 0, oncancel: void 0, value: \"\", type: \"text\", reverseButtons: void 0 }, settingUpdated: function (a, c, d) { switch (a) { case \"message\": this.setMessage(d); break; case \"value\": b.value = d; break; case \"type\": switch (d) { case \"text\": case \"color\": case \"date\": case \"datetime-local\": case \"email\": case \"month\": case \"number\": case \"password\": case \"search\": case \"tel\": case \"time\": case \"week\": b.type = d; break; default: b.type = \"text\" } break; case \"labels\": d.ok && this.__internal.buttons[0].element && (this.__internal.buttons[0].element.innerHTML = d.ok), d.cancel && this.__internal.buttons[1].element && (this.__internal.buttons[1].element.innerHTML = d.cancel); break; case \"reverseButtons\": d === !0 ? this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element) : this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element) } }, callback: function (a) { var c; switch (a.index) { case 0: this.settings.value = b.value, \"function\" == typeof this.get(\"onok\") && (c = this.get(\"onok\").call(this, a, this.settings.value), \"undefined\" != typeof c && (a.cancel = !c)); break; case 1: \"function\" == typeof this.get(\"oncancel\") && (c = this.get(\"oncancel\").call(this, a), \"undefined\" != typeof c && (a.cancel = !c)), a.cancel || (b.value = this.settings.value) } } } }), \"object\" == typeof module && \"object\" == typeof module.exports ? module.exports = v : \"function\" == typeof define && define.amd ? define([], function () { return v }) : a.alertify || (a.alertify = v)\n }(\"undefined\" != typeof window ? window : this);\n }\n\n $.expr[':'].containsNoCase = function (a, i, m) {\n var regex = /(.*?)\\s\\(\\d+?\\)/;\n var textNode = a.textContent || a.innerText || \"\";\n var matches = textNode.match(regex);\n if (matches == null) {\n return null;\n }\n\n return (matches[1]).toUpperCase().indexOf(m[3].toUpperCase()) >= 0;\n };\n\n $.fn.filterThatList = function (options) {\n // if there are no passed options create an empty options object\n if (options === undefined || options === null) {\n options = {};\n }\n\n\n // set up default options\n var defaults = {\n searchTarget: $(this) // the search input\n };\n\n return this.each(function () {\n // merge passed options with default options to create settings\n var settings = $.extend(defaults, options);\n\n settings.searchTarget.change(function () {\n // get the value of the input which is used to filter against\n var filter = $(this).val();\n var searchList = settings.list;\n var isNestedFacet = settings.list.hasClass(\"hawk-nestedfacet\");\n //when nested facet prepare flat facet\n if (isNestedFacet) {\n var flatUlId = settings.list.attr(\"id\") + \"_flat\";\n if ($(\"#\" + flatUlId).length == 0) {\n var searchList = $(settings.list[0].cloneNode(false));\n searchList.removeClass(\"hawk-navTruncateList\");\n searchList.addClass(\"hawk-scrollList\");\n searchList.attr(\"id\", flatUlId);\n searchList.appendTo(settings.list.parent());\n\n $(settings.list).find(\"li\").each(function () {\n var pathArr = [];\n $(this).parentsUntil(\"#\" + settings.list.attr(\"id\"), \"li\").each(function () {\n var text = $($($(this).children(\"a\")).children(\"span\").contents()[0]).text();\n text = text.trim();\n pathArr.unshift(text);\n });\n\n var li = $(\"<li>\");\n if ($(this).hasClass(\"hawkFacet-active\")) {\n li.addClass(\"hawkFacet-active\");\n }\n\n li.appendTo(searchList);\n var anchor = $(this).children(\"a\").clone();\n if (pathArr.length > 0) {\n var textSpan = anchor.children(\"span\")\n var spanCount = textSpan.children(\".hawk-facetCount\").remove()\n pathArr.push(textSpan.text());\n textSpan.html(pathArr.join(\" &raquo; \"));\n textSpan.append(spanCount);\n }\n\n anchor.appendTo(li);\n });\n var liHeight = searchList.children(\"li\").first().outerHeight();\n //set search list for max 20 elements\n searchList.css(\"max-height\", (liHeight * 20) + \"px\");\n settings.list.hide();\n }\n else {\n searchList = $(\"#\" + flatUlId);\n searchList.show();\n settings.list.hide();\n }\n }\n var noResults = (\"<li><span>No Results Found</span></li>\");\n\n if (filter) {\n searchList\n // hide items that do not match input filter\n .find(\"li:not(:containsNoCase(\" + filter + \"))\").hide()\n // show items that match input filter\n .end().find(\"li:containsNoCase(\" + filter + \")\").show();\n\n var items = searchList.find(\"li:containsNoCase(\" + filter + \")\");\n\n // nothing matches filter\n // add no results found\n if (items.length == 0) {\n var item = $(noResults);\n searchList.prepend(item);\n return;\n }\n\n //check if more results\n var options = settings.list.data().options;\n var moreItems = items.filter(function (index) {\n return index >= options.cutoff;\n });\n moreItems.hide();\n\n //if no more results\n if (moreItems.length == 0) {\n return;\n }\n\n //otherwise\n //remove no results\n items.find(\":contains('No Results Found')\").remove();\n\n if (moreItems) {\n //add more button and handle it's click event\n var more = settings.list.find(\"li.hawk-navMore\");\n more.off(\"click\").each(function () { $(this).find(\"span\").text($(this).parent().data().options.moreText); });\n more.show();\n\n more.on(\"click\", function (event) {\n var moreTrigger = $(this);\n if ($(this).hasClass(\"hawk-navMoreActive\")) {\n searchList\n // hide items that do not match input filter\n .find(\"li:not(:containsNoCase(\" + filter + \"))\").hide()\n // show items that match input filter\n .end().find(\"li:containsNoCase(\" + filter + \")\").show();\n\n items = searchList.find(\"li:containsNoCase(\" + filter + \")\");\n\n moreItems = items.filter(function (index) {\n return index >= options.cutoff;\n });\n moreItems.hide();\n\n moreTrigger.find(\"span\").text(moreTrigger.parent().data().options.moreText);\n moreTrigger.removeClass(\"hawk-navMoreActive\");\n window[\"hawkexpfacet_\" + searchList.attr(\"id\")] = null;\n moreTrigger.show();\n } else {\n searchList\n // hide items that do not match input filter\n .find(\"li:not(:containsNoCase(\" + filter + \"))\").hide()\n // show items that match input filter\n .end().find(\"li:containsNoCase(\" + filter + \")\").show();\n\n items = searchList.find(\"li:containsNoCase(\" + filter + \")\");\n\n // nothing matches filter\n if (items.length == 0) {\n var item = $(noResults);\n searchList.prepend(item);\n return;\n }\n moreTrigger.addClass(\"hawk-navMoreActive\").find(\"span\").text(options.lessText);\n moreTrigger.show();\n window[\"hawkexpfacet_\" + searchList.attr(\"id\")] = true;\n }\n });\n\n }\n //no filter\n } else {\n //remove no results option\n settings.list.find(\":contains('No Results Found')\").remove();\n\n // if nothing is entered display all items in list\n if (isNestedFacet) {\n searchList.hide();\n settings.list.show();\n }\n else {\n if (settings.list.hasClass(\"hawk-navTruncateList\")) {\n var wasExpanded = settings.list.find(\"li.hawk-navMore > span\").hasClass(\"hawk-navMoreActive\");\n\n if (wasExpanded) {\n settings.list.find(\"li\").show();\n }\n else {\n var options = settings.list.data().options;\n var items = settings.list.find(\"li:not(.hawk-navMore)\");\n\n items.each(function (i, el) {\n if (i < options.cutoff) {\n $(this).show();\n } else {\n $(this).hide();\n }\n });\n\n\n //check if more results\n var options = settings.list.data().options;\n var moreItems = items.filter(function (index) {\n return index >= options.cutoff;\n });\n moreItems.hide();\n\n //if no more results\n if (moreItems.length == 0) {\n return;\n }\n\n if (moreItems) {\n var more = settings.list.find(\"li.hawk-navMore\");\n more.off(\"click\").find(\"span\").text(options.moreText);\n more.show();\n\n more.on(\"click\", function (event) {\n var moreTrigger = $(this);\n if ($(this).hasClass(\"hawk-navMoreActive\")) {\n moreTrigger.hide();\n moreTrigger.removeClass(\"hawk-navMoreActive\").find(\"span\").text(options.moreText);\n window[\"hawkexpfacet_\" + searchList.attr(\"id\")] = null;\n moreTrigger.show();\n } else {\n moreTrigger.addClass(\"hawk-navMoreActive\").find(\"span\").text(options.lessText);\n window[\"hawkexpfacet_\" + searchList.attr(\"id\")] = true;\n moreTrigger.show();\n }\n });\n }\n\n }\n } else {\n settings.list.find(\"li\").show();\n }\n }\n }\n }).keyup(function () {\n //trigger above actions at every keyup\n $(this).change();\n });\n\n });\n };\n }", "title": "" }, { "docid": "da92fb503cc0876a6cd7c2b36db75dab", "score": "0.52213126", "text": "function eventDrag(){\n $( \"div.eventDiv>p:not(.myDiv)\" ).draggable({\n helper: 'clone', \n greedy: true, \n opacity: 0.70,\n zIndex:100000, \n start: function (e, ui) {\n console.log(e);\n console.log(ui);\n ui.helper.animate({\n width: 60,\n height: 20,\n zIndex:10\n });\n }\n });\n\n $( \".test\" ).droppable({ \n drop: function( event, ui ) {\n var selectedEventDate,\n FormattedEventDate,\n eventDivID,\n cnt,\n eventID,\n eventName;\n\n\n $(this).append(ui.draggable[0].innerHTML);\n selectedEventDate = $(this).parent().data('date');\n FormattedEventDate = (new Date(selectedEventDate).getDate()+1)+\"-\"+(new Date(selectedEventDate).getMonth()+1)+\"-\"+new Date(selectedEventDate).getFullYear();\n eventDivID = $(this).attr('id');\n cnt = $(\"#\"+eventDivID).find(':hidden#item').length;\n \n if (cnt === 1 ){\n eventID=$(\"#\"+eventDivID).find(':hidden#item').val();\n eventName=$.trim($(\"#Event_\"+eventID).text());\n } else {\n eventID = $(\"#\"+eventDivID).find(\".eventItem:eq(\"+(cnt-1)+\")\" ).attr(\"value\");\n eventName=$.trim($(\"#Event_\"+eventID).text());\n }\n saveEventDate(FormattedEventDate,eventName,eventID);\n }\n });\n}", "title": "" }, { "docid": "012913e782d89c1efcf1518ea9d40e6c", "score": "0.5219548", "text": "function dragTheFlag() {\n\t$(\"#dragFlag\").draggable({\n\t\tcontainment: $(\"#divDragFlag\"),\n\t\topacity: 0.5,\n\t\tsnap: \"#divDragFlag\",\n\t});\n}", "title": "" }, { "docid": "f480d7b97f7ffe6c5455f796856e3692", "score": "0.5204354", "text": "function makingResizableControl($control, maxWidth, maxHeight) {\r\r\n\tvar child, childrens, childrenId = \"\", width = 0, height = 0, screenId = \"\", controlId = \"\", role, minWidth = 10, controlType = $control.attr(\"data-role\");\r\r\n\tminWidth = ((controlType == \"textarea\" || controlType == \"droparea\") ? minWidth : 100);\r\r\n\t$control.resizable({\r\r\n\t\thelper: \"ui-resizable-helper\",\r\r\n\t\tautoHide: true,\r\r\n\t\tmaxWidth: maxWidth,\r\r\n\t\tmaxHeight: maxHeight,\r\r\n\t\tminWidth: minWidth,\r\r\n\t\tminHeight: 16,\r\r\n\t\tstart: function( event, ui ) {\r\r\n\t\t\tvar controlRole = $control.attr(\"data-role\"),minWidth1 = 10,mw=0,mw1,minHeight1 = 16,mh=0,mh1,element,maxWidth1,maxHeight1;\r\r\n\t\t\tvar ele = $control.find(\".element\");\r\r\n\t\t\tif(controlRole == \"divbox\"){\r\r\n\t\t\t\tif(ele.length > 0){\r\r\n\t\t\t\t\tfor(var index = 0; index<ele.length;index++){\r\r\n\t\t\t\t\t\telement = ele.eq(index);\r\r\n\t\t\t\t\t\tmw1 = parseInt(element.css(\"left\").split(\"px\")[0],10)+element.width()+5;\r\r\n\t\t\t\t\t\tmh1 = parseInt(element.css(\"top\").split(\"px\")[0],10)+element.height()+3;\r\r\n\t\t\t\t\t\tif(mw < mw1){\r\r\n\t\t\t\t\t\t\tmw = mw1;\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\tif(mh < mh1){\r\r\n\t\t\t\t\t\t\tmh = mh1;\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\tminWidth1 = mw;\r\r\n\t\t\t\t\tminHeight1 = mh;\r\r\n\t\t\t\t}else{\r\r\n\t\t\t\t\tminWidth1 = 100;\r\r\n\t\t\t\t}\r\r\n\t\t\t}else {\r\r\n\t\t\t\tmaxWidth1 = $control.parent().innerWidth() - $control.position().left;\r\r\n\t\t\t\tmaxHeight1 = $control.parent().innerHeight() - $control.position().top;\r\r\n\t\t\t\tminWidth1= ((controlRole == \"textarea\" || controlRole == \"droparea\") ? 10 : 100);\r\r\n\t\t\t\t$(this).resizable(\"option\",\"maxWidth\",maxWidth1-1);\r\r\n\t\t\t\t$(this).resizable(\"option\",\"maxHeight\",maxHeight1-1); \r\r\n\t\t\t}\r\r\n\t\t\t$(this).resizable( \"option\", \"minWidth\", minWidth1 );\r\r\n\t\t\t$(this).resizable( \"option\", \"minHeight\", minHeight1 );\r\r\n\t\t} ,\r\r\n\t\tstop: function(event, ui) {\r\r\n\t\t\tscreenId = $(\"#editorArea .selected\").attr(\"id\");\r\r\n\t\t\tcontrolId = ui.element.attr(\"id\");\r\r\n setCoordinateRange(controlId,screenId);\r\r\n\t\t\trole = $(\"#\"+controlId).attr(\"data-role\");\r\r\n\t\t\tif(role!=\"divbox\"){\r\r\n\t\t\t\tsetControlHeightWidth(ui.element);\t\r\r\n\t\t\t\tadjustControlHeightWidth(ui.element);\r\r\n\t\t\t}\r\r\n\t\t\t/*if(role==\"textarea\"){\r\r\n\t\t\t\tvar controlEle = $(\"#\"+screenId+\" #\"+controlId);\r\r\n\t\t\t\tif(controlEle.find(\".text\").hasClass(\"centerAlignText\") == true){\r\r\n\t\t\t\t\tif((controlEle.find(\".text\").outerHeight(true) >= controlEle.find(\".text\")[0].scrollHeight) && (parseInt($(\".ui-resizable-helper\").width(),10)+4 >= controlEle.find(\".text\")[0].scrollWidth)){\r\r\n\t\t\t\t\t\t//controlEle.find(\".text\").css(\"display\",\"table-cell\");\t\r\r\n\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t//controlEle.find(\".text\").css(\"display\",\"inline-block\");\t\r\r\n\t\t\t\t\t}\t\r\r\n\t\t\t\t}\r\r\n\t\t\t}*/\r\r\n\t\t\tif(controlType==\"textarea\"){\r\r\n\t\t\t\tvar contrl = $(\"#\"+screenId+\" #\"+controlId);\r\r\n\t\t\t\tif(contrl.attr(\"textAlignmentCenter\") == \"2\") {\r\r\n\t\t\t\t\tvar diffHt = parseInt(contrl.find(\".text\").height(),10)- parseInt(contrl.find(\".text\").children().height(),10);\r\r\n\t\t\t\t\tif(diffHt < 0){\r\r\n\t\t\t\t\t\tcontrl.find(\".text\").children().css(\"margin-top\",\"0px\");\r\r\n\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\tcontrl.find(\".text\").children().css(\"margin-top\",(diffHt/2)+\"px\");\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}else{\r\r\n\t\t\t\t\tcontrl.find(\".text\").find(\".centerAlignText\").css(\"margin-top\",\"0px\");\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t\teditorContent[screenId][controlId].property.height = ui.size.height-2;\r\r\n\t\t\teditorContent[screenId][controlId].property.width = ui.size.width-2;\r\r\n\t\t\tchildrens = ui.element.find(\".element\");\r\r\n\t\t\tfor(var index=0; index<childrens.length; index++) {\r\r\n\t\t\t\tchild = childrens.eq(index);\r\r\n\t\t\t\tchildrenId = child.attr(\"id\");\r\r\n\t\t\t\tmaxWidth = ui.element.innerWidth() - child.position().left;\r\r\n\t\t\t\tmaxHeight = ui.element.innerHeight() - child.position().top;\r\r\n\t\t\t\tmakingResizableControl(child, maxWidth, maxHeight);\r\r\n\t\t\t\tmakeSpinner(\"width\", 100, maxWidth-2);\r\r\n\t\t\t\tmakeSpinner(\"height\", 16, maxHeight-2);\r\r\n\t\t\t}\r\r\n\t\t\tui.element.css({\r\r\n\t\t\t\ttop: editorContent[screenId][controlId].property.y,\r\r\n\t\t\t\tleft: editorContent[screenId][controlId].property.x\r\r\n\t\t\t});\r\r\n\t\t}\r\r\n\t});\r\r\n}", "title": "" }, { "docid": "17be8bfdcc9c86a0ed1260c65890da0f", "score": "0.5149637", "text": "function importJQueryUI() {\n\t$.getScript(\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js\", function() {\n\t\tinitPhysicalComponents();\n\t});\n}", "title": "" }, { "docid": "44bb5ac19a2db0a6288522862aa3504b", "score": "0.5146277", "text": "function UI() {\n }", "title": "" }, { "docid": "b36981b509dfc10b360d0494dc680f2a", "score": "0.5144831", "text": "function cargarJqueryUI() {\r\n document.querySelectorAll(\"iframe\").forEach(e => {\r\n $(e).draggable({\r\n connectToSortable: \"#sortable\",\r\n helper: \"clone\",\r\n revert: \"invalid\",\r\n drag: function (event) {\r\n iddevideo = event.target.getAttribute(\"idvideo\")\r\n tituloingresado = event.target.getAttribute(\"titulovideo\")\r\n }\r\n });\r\n e.classList.add(\"ui-state-default\");\r\n });\r\n}", "title": "" }, { "docid": "776884f3d811b9a9563057dd3d95be90", "score": "0.51441485", "text": "function callDialog(){\n $('#dialog-confirm')\n // Dialog will slide down from top of document\n .on('dialogopen', function () {\n var widget = $(this).dialog('widget'),\n offset = widget.offset();\n widget\n .css('top', -widget.outerWidth() + 'px')\n .animate({ top: offset.top }, { duration: 1000 });\n })\n .dialog({\n resizable: false,\n draggable: false,\n height: 325,\n width: 550,\n modal: true\n });\n$('#tabs').tabs({\n hide: {\n effect: 'slide',\n duration: 500\n }\n});\n}", "title": "" }, { "docid": "f398aec7a88bb15e50c3b675710420e5", "score": "0.5138865", "text": "function g(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[\"\"]),this.regional.en=t.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=t.extend(!0,{},this.regional.en),this.dpDiv=v(t(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "1404a3d3fd4a89e099108308d5a74305", "score": "0.5129934", "text": "uiEvtMouseUpPerformed(x, y) {\r\n return false;\r\n }", "title": "" }, { "docid": "264301d1c3f5a8b755ffca6458d16667", "score": "0.51232934", "text": "none() {this._escape = this._pointerDownOutside = this._itemActivate = false;}", "title": "" }, { "docid": "d378c43bf2c76efc9ac0a75550c77a12", "score": "0.5116473", "text": "function draggable (heading, top, left,parentId,width,height) {\n//\tvar target = document.getElementById(parentId);\n//\tvar pos =\"\" + left +\" \" + top;\t\n\n\tif (width == null || height == null) {\n\t\twidth = \"auto\";\n\t\theight = \"auto\";\n\t}\n\t\n\tvar $result = $(\"<div>\", {title: heading});\n\tvar resultId = $result.uniqueId().attr(\"id\");\n\n\tvar $dialog = $result.dialog({\n\t\tposition: {\n\t\t\tmy: 'left top',\n\t\t\tat: 'left',\n\t\t\tof: $('#centerdiv')\n\t\t},\n\t\t// hack trying to stop jumping to top \n\t\tdragStop: function(event, ui) {\n\t\t var iObj = ui.offset;\n\t\t if (iObj.top < 0) {\n\t\t \tevent.target.offsetParent.style.top = \"0px\";\n\t\t }\n\t\t },\n\t\tdraggable: true,\n\t\tappendTo: '#' + parentId,\n\t\theight:height,\n\t\twidth:width,\n\t})\n\t.parent().draggable({\n\t\tcontainment: '#centerdiv' \n\t});\t\n\n\t$dialog.css({\"top\": top, \"left\" : left})\n\n\tvar $parent = $dialog.parent(),\n $button = $parent.find( \".ui-dialog-titlebar-close\" );\n\t\n\t$button\n\t .contents()\n\t .filter(function() {\n\t return this.nodeType == 3; //Remove TEXT_NODE\n\t }).remove();\n\t\n\treturn resultId;\n}", "title": "" }, { "docid": "6f55704caa201c3ad7a3b04cdbc02fc0", "score": "0.51102453", "text": "function JoubelUI() {}", "title": "" }, { "docid": "6f55704caa201c3ad7a3b04cdbc02fc0", "score": "0.51102453", "text": "function JoubelUI() {}", "title": "" }, { "docid": "1a55df43a7119f4985358e9cdc8e1029", "score": "0.51061785", "text": "function a(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[\"\"]),this.regional.en=t.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=t.extend(!0,{},this.regional.en),this.dpDiv=f(t(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "9a5992ab058529e34a7c578da4e50aa9", "score": "0.51061785", "text": "function a(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[\"\"]),this.regional.en=e.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=e.extend(!0,{},this.regional.en),this.dpDiv=o(e(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "ad1d1aa0cfefde52ddac3630e298f5d1", "score": "0.5100426", "text": "function tabOver(selector)\n{\n $(selector).addClass(\"ui-state-active\");\n}", "title": "" }, { "docid": "35707940bda9d28eaf661b58aa48cb20", "score": "0.50963604", "text": "function dragEnter() {}", "title": "" }, { "docid": "fc6056db9f3fa2a3a7806d1b884c580f", "score": "0.5091164", "text": "function defineDialogIndicators(){\n\t$('.dialogInputParams').dialog({\n\t\tautoOpen: false,\n\t\tmodal: true,\n closeOnEscape: true,\n resizable: false,\n show: 'drop',\n hide: 'drop',\n position: ['center', 130]\n\t});\n}", "title": "" }, { "docid": "a3225371c8db8b43073ef52333afdf74", "score": "0.50901073", "text": "function displayOptions(e){\r\n\te.show();\r\n\r\n}", "title": "" }, { "docid": "51c914c1a08ec705b0f029dcb8d5dae1", "score": "0.5087832", "text": "function b(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[\"\"]),this.regional.en=e.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=e.extend(!0,{},this.regional.en),this.dpDiv=d(e(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "8a94a3e9656bd5e0b29b036d3be06c48", "score": "0.50850147", "text": "function updateUI(controlName, event)\r\n{\r\n}", "title": "" }, { "docid": "4ac61f060e0ab97b677c6d7cb76e62dd", "score": "0.5081993", "text": "function makingDrggableControl($control) {\r\r\n\tvar $parent, $selectedEditor, screenId = \"\", role = \"\", maxWidth = 0, maxHeight = 0, controlId = \"\", parentPos;\r\r\n\t$control.draggable({\r\r\n\t\tcontainment: \"parent\",\r\r\n\t\thandle: \"> .handle\",\r\r\n\t\t//grid: [1, 1],\r\r\n\t\tdrag: function( event, ui ) {\r\r\n\t\t\tparentPos = $(this).parent().offset();\r\r\n\t\t\tif(parentPos.top+$(this).parent().height() <= $(this).height()+ui.offset.top) {\r\r\n\t\t\t\t$control.css({'top' : $(this).parent().height()-$(this).height()-2});\r\r\n\t\t\t\treturn false;\r\r\n\t\t\t} else if(parentPos.left+$(this).parent().width() <= $(this).width()+ui.offset.left) {\r\r\n\t\t\t\t$control.css({'left' : $(this).parent().width()-$(this).width()-2});\r\r\n\t\t\t\treturn false;\r\r\n\t\t\t} else {\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}\r\r\n\t\t},\r\r\n\t\tstop: function(event, ui) {\r\r\n\t\t\t$parent = ui.helper.parent();\r\r\n\t\t\t$selectedEditor = $(\"#editorArea .selected\");\r\r\n\t\t\tscreenId = $selectedEditor.attr(\"id\");\r\r\n\t\t\tcontrolId = ui.helper.attr(\"id\");\r\r\n\t\t\trole = ui.helper.attr(\"data-role\");\r\r\n\r\r\n\t\t\t// calculating maximum height and width\r\r\n\t\t\tif(role == \"divbox\") {\r\r\n\t\t\t\tmaxWidth = $selectedEditor.width()+$selectedEditor.offset().left-ui.position.left;\r\r\n\t\t\t\tmaxHeight = $(\"body\").height()-ui.position.top;\r\r\n\t\t\t\t$control.css({'top' : parseInt(ui.position.top),'left' : parseInt(ui.position.left)});\r\r\n\t\t\t} else {\r\r\n\t\t\t\tmaxHeight = $parent.height()-ui.position.top;\r\r\n\t\t\t\tmaxWidth = $parent.width()-ui.position.left;\r\r\n\t\t\t}\r\r\n\t\t\t// updating JSON\r\r\n\t\t\teditorContent[screenId][controlId].property.x = ui.position.left;\r\r\n\t\t\teditorContent[screenId][controlId].property.y = ui.position.top;\r\r\n\r\r\n\t\t\t// updating maxwidth and maxheight\r\r\n\t\t\tsetPerimeterRange(controlId,screenId);\r\r\n\t\t\tui.helper.resizable(\"option\",\"maxWidth\",maxWidth);\r\r\n\t\t\tui.helper.resizable(\"option\",\"maxHeight\",maxHeight);\r\r\n\t\t}\r\r\n\t});\r\r\n}", "title": "" }, { "docid": "5af83cc55655218fa8c6e4da8fb1562d", "score": "0.5073184", "text": "function initSelectButtons() {\n var buttons = $('.select-button');\n buttons.mousedown(function(e) {\n $(this).addClass('button-down');\n activateSelectButton($(this));\n });\n buttons.mouseup(function(e) {\n $(this).removeClass('button-down');\n });\n buttons.mouseleave(function(e) {\n $(this).removeClass('button-down');\n });\n }", "title": "" }, { "docid": "ab944e97506af339859d324d1cc72b4f", "score": "0.5067799", "text": "function initJQueryUi(){\n //$(\"#accordion\").accordion({autoHeight:false});\n $(\"#accordion\").accordion({autoHeight:true, heightStyle: \"fill\"});\n $(\".tabs\").tabs();\n $(\"button\").button();\n $(\".radios\").buttonset();\n //$(\"#radio_ogddata\").buttonset();\n\n //make the map follow the scroll\n var el=$('#tabs-tab');\n var elpos=el.offset().top;\n $(window).scroll(function () {\n var y=$(this).scrollTop();\n if(y<elpos){el.stop().animate({'top':0},500);}\n else{el.stop().animate({'top':y-elpos},500);}\n });\n \n function setSize(){\n /*\n $(\"#content\").css(\"height\",window.innerHeight-40);\n $(\"#tabs-tab\").css(\"height\",window.innerHeight-80);\n $(\"#map-tab\").css(\"height\",window.innerHeight-100);\n $(\"#info-tab\").css(\"height\",window.innerHeight-100);\n $(\"#map\").css(\"height\",window.innerHeight-220);\n */\n $(\"#content\").css(\"height\", $(window).height()-40);\n $(\"#tabs-tab\").css(\"height\",$(window).height()-80);\n $(\"#map-tab\").css(\"height\",$(window).height()-100);\n $(\"#info-tab\").css(\"height\",$(window).height()-100);\n $(\"#map\").css(\"height\",$(window).height()-220);\n };\n setSize();\n $(window).resize(function(){\n setSize();\n });\n \n //define dialogs\n $(\"#dialog_matchproperties\").dialog({\n autoOpen: false,\n modal: true,\n width: 600,\n height: 250,\n buttons: {\n \"Starte Match\": function(){\n startMatch();\n $(this).dialog(\"close\");\n },\n \"Cancel\": function(){\n $(this).dialog(\"close\");\n }\n }\n });\n $(\"#dialog_welcome\").dialog({\n autoOpen: false,\n modal: true,\n width: 600,\n height: 350,\n buttons: {\n \"Close\": function(){\n $(this).dialog(\"close\");\n }\n }\n });\n \n messageForIE();\n}", "title": "" }, { "docid": "29265f661cd936df455f01039cb5e790", "score": "0.5064559", "text": "function l(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[\"\"]),this.regional.en=e.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=e.extend(!0,{},this.regional.en),this.dpDiv=u(e(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "ff864043d417d7a81ecab2e01263c4d1", "score": "0.5054594", "text": "function lockScreen()\r\n{\r\n\tjQuery.blockUI({ message: i18n_waiting , css: { \r\n\t\tborder: 'none', \r\n\t\tpadding: '15px', \r\n\t\tbackgroundColor: '#000', \r\n\t\t'-webkit-border-radius': '10px', \r\n\t\t'-moz-border-radius': '10px', \r\n\t\topacity: .5, \r\n\t\tcolor: '#fff'\t\t\t\r\n\t} }); \r\n}", "title": "" }, { "docid": "788528fb86b8b5cea0e990c7ead48ff3", "score": "0.5054513", "text": "reset() {\n\t\t$(this.ui).empty();\n\t}", "title": "" }, { "docid": "f617ba63bb71d0d77ebd8b03dfab5a7e", "score": "0.50452715", "text": "function updateUI() {\n $.when(el.jq.css('display'), el.jq.css('z-index'), el.jq.width(), el.jq.outerWidth(), el.jq.height(), el.jq.outerHeight()).then(function(display, zIndex, width, outerWidth, height, outerHeight) {\n if (self.isMobileApp) {\n height = $('#vwo-resize-height').val().replace(/-?([\\d]*)/, parseInt($('#vwo-resize-height').val(), 10) || 0);\n width = $('#vwo-resize-width').val().replace(/-?([\\d]*)/, parseInt($('#vwo-resize-width').val(), 10) || 0);\n } else {\n var diffH = outerHeight - height\n , diffW = outerWidth - width;\n height = $('#vwo-resize-height').val().replace(/-?([\\d]*)/, (parseInt($('#vwo-resize-height').val(), 10) || 0) - diffH);\n width = $('#vwo-resize-width').val().replace(/-?([\\d]*)/, (parseInt($('#vwo-resize-width').val(), 10) || 0) - diffW);\n }\n self.el.update({\n height: height,\n width: width,\n display: display,\n zIndex: zIndex\n }, true);\n });\n }", "title": "" }, { "docid": "426ce8611eb0211f03ed9c9d2e5117b0", "score": "0.5041691", "text": "function JQSliderCreate() {\n $(this)\n .removeClass('ui-corner-all ui-widget-content')\n .wrap('<span class=\"ui-slider-wrap\"></span>')\n .find('.ui-slider-handle')\n .removeClass('ui-corner-all ui-state-default');\n}", "title": "" }, { "docid": "2e33938356356b7502328f3b6e64e48c", "score": "0.5036929", "text": "shouldUpdateElem(elem, ui)\n\t{\n\t\treturn true;\n\t}", "title": "" }, { "docid": "11c3a598c00359eaaffb1b810f10d318", "score": "0.5035471", "text": "function r(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[\"\"]),this.regional.en=e.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=e.extend(!0,{},this.regional.en),this.dpDiv=l(e(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "6cb114e7d2729e13fb4302fc7b29013f", "score": "0.50258744", "text": "uiEvtMouseOutPerformed() {\r\n return false;\r\n }", "title": "" }, { "docid": "06e5e7b2500686d032583f24f5e6c0c6", "score": "0.5023397", "text": "function NoSelection() {\r\n\r\n // Dialog\r\n var d_noSel = new Window('dialog'); \r\n d_noSel.text = 'Randomize Selection'; \r\n d_noSel.orientation = 'column'; \r\n d_noSel.alignChildren = ['fill','top']; \r\n d_noSel.spacing = 10; \r\n d_noSel.margins = [8,12,8,16]; \r\n\r\n // Script description\r\n var noSel_desc = d_noSel.add('group'); \r\n noSel_desc.orientation = 'column'; \r\n noSel_desc.alignChildren = ['left','center']; \r\n noSel_desc.spacing = 0; \r\n\r\n // IMPORTANT all noSel_desc must me used\r\n noSel_desc.add('statictext', undefined, 'Randomly select objects to bulk edit.'); \r\n\r\n // Dialog text wrap\r\n var noSel_text = d_noSel.add('group'); \r\n noSel_text.orientation = 'row'; \r\n noSel_text.alignChildren = ['left','center']; \r\n noSel_text.spacing = 10; \r\n noSel_text.margins = [0,4,0,10]; \r\n\r\n // Dialog text\r\n var noSel_text_01 = noSel_text.add('statictext', undefined, 'Select some objects to run this script.'); \r\n\r\n // Dialog button\r\n // IMPORTANT must use name:'ok' proerty here\r\n var noSel_btn = d_noSel.add('button', undefined, 'Got it!', {name: 'ok'}); \r\n noSel_btn.alignment = ['left','top']; \r\n\r\n\r\n // Show dialog\r\n d_noSel.show();\r\n\r\n}", "title": "" }, { "docid": "8ee9d0058d24b3dad490e2b2199e2654", "score": "0.50206393", "text": "function ui(k, v) {\n // console.log('update ui');\n $$(k).text(v);\n}", "title": "" }, { "docid": "984542938c4207c41e56fbc32220ea21", "score": "0.5013823", "text": "function showDialog(url, ptitle) {\n var loadingHtml = '<img src=\"@Url.Content(\"~/images/spinner.gif\")\" class=\"spinner\"/>';\n $('#dialog').dialog({\n autoOpen: true,\n width: 650,\n height: 620,\n position: 'center',\n resizable: false,\n title: ptitle,\n modal: true,\n open: function (event, ui) {\n $(this).html(loadingHtml);\n $(this).load(url);\n\n //$(this).find('.ui-dialog-titlebar').hide();\n\n // find all the buttons - note that the 'ui' argument is an empty object\n //var buttons = $(event.target).parent().find('.ui-dialog-buttonset').children();\n //buttons.css({ \"font-size\": \"0.85em\", \"padding\": \"2\" }).addClass(\"dialog-button\");\n\n // enable all buttons\n //buttons.removeClass('ui-state-disabled').attr('disabled',false);\n\n // add the icons\n //buttons.removeClass('ui-button-text-only').addClass('ui-button-text-icon-primary');\n //$(buttons[0]).append(\"<span class='ui-icon ui-icon-check'></span>\");\n //$(buttons[1]).append(\"<span class='ui-icon ui-icon-close'></span>\");\n\n // push the first button to the left side\n //$(buttons[0]).css('position','absolute').css('left','25px');\n }\n });\n}", "title": "" }, { "docid": "d6cbe290752adf85a42a5b41a424bfd2", "score": "0.50111276", "text": "function HTMLUI() {\n}", "title": "" }, { "docid": "8c962b6111634476981151fafb2feaae", "score": "0.50073755", "text": "function initDatepickerRange(handler, options) {\n\n\tvar e = handler;\n\n\tif (typeof(handler) == \"string\") {\n\t\te = $(handler);\n\t}\n\t\n\tvar tmp = $(e).val();\n\tif (tmp && tmp.length == 10) { // if not range\n\t\t$(e).datepicker();\n\t\treturn;\n\t}\n\t\n\tif (! tmp || tmp == \"-1\") {\n\t\tvar from, to, d1, d2;\n\t\tfrom = new Date((new Date()).getTime() - 1000 * 60 * 60 * 24 * 15);\n\t\tto = new Date((new Date()).getTime() - 1000 * 60 * 60 * 24 * 1);\n\t\td1 = $.datepicker.formatDate('yy-mm-dd', from, {});\n\t d2 = $.datepicker.formatDate('yy-mm-dd', to, {});\n\n\t\t$(e).attr(\"value\", d1 + \",\" + d2);\n\t}\n\n\t\n\t$(e).on(\"click\", function() {\n\t\tvar that = $(this);\n\t\tvar val = $(this).val();\n\n\t\tif (val && val.length > 0) {\n\t\t\tvar ss = val.replace(\"/-/g\",\"/\").split(\",\");\n\t\t\t$(this).attr(\"data-prv\", (new Date(ss[0] + \" 00:00:00\")).getTime());\n\t\t\t$(this).attr(\"data-cur\", (new Date(ss[ss.length - 1] + \" 00:00:00\")).getTime());\n\t\t}\n\t\t\n\t\tif (! $(this).hasClass(\"classInit\")) {\n\t\t\t$(this).addClass(\"classInit\");\n\t\t\t$(this).after(\"<div style='position: absolute;z-index: 10000;'></div>\");\n\t\t}\n\t\t\n\t\tvar $datepickerHandler = $(this).next();\n\t\t\t\t\n\t\t$datepickerHandler.datepicker(\"destroy\");\n\t\t$datepickerHandler.datepicker({\n numberOfMonths: 2,\n changeMonth: true,\n changeYear: true,\n showButtonPanel: true,\n maxDate: 0,\n newOpen: true,\n\n onSelect: function ( dateText, inst ) {\n \tvar cur = parseInt($(this).prev().attr(\"data-cur\")),\n \t prv = parseInt($(this).prev().attr(\"data-prv\")), tmp, d1, d2;\n \t\n \ttmp = (new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)).getTime();\n \t\n \tif( $(this).datepicker(\"option\",\"newOpen\") ){\n \t\tcur = prv = tmp;\n \t\t$(this).datepicker(\"option\",\"newOpen\", false);\n \t} else if ( cur === prv ) {\n\t \tcur = tmp;\n \t} else {\n \t\tcur = prv = tmp;\n \t}\n \t\n \t$(this).prev().attr(\"data-cur\", cur);\n \t$(this).prev().attr(\"data-prv\", prv);\n \t\n \ttmp = Math.min(prv,cur);\n \tcur = Math.max(prv,cur);\n \tprv = tmp;\n \t\n \td1 = $.datepicker.formatDate('yy-mm-dd', new Date(prv), {});\n d2 = $.datepicker.formatDate('yy-mm-dd', new Date(cur), {});\n $(this).prev().val(d1 + \",\" + d2);\t\t\t\t\t \n },\n beforeShowDay: function ( date ) {\n \tvar prv = $(this).prev().attr(\"data-prv\"),\n \tcur = $(this).prev().attr(\"data-cur\"),\n \tclasses = \"\",\n \tmax = Math.max(prv, cur),\n \tmin = Math.min(prv, cur),\n \tdateTime = date.getTime();\n \tif((dateTime >= min && dateTime <= max )){\n \t\tclasses = 'date-range-selected';\n \t\tif ( dateTime == min && dateTime == max ) {\n \t\t\tclasses += ' date-range-only';\n \t\t} else if ( dateTime == min ) {\n \t\t\tclasses += ' date-range-first';\n \t\t} else if ( dateTime == max ) {\n \t\t\tclasses += ' date-range-last';\n \t\t}\n \t}\n \t\n \treturn [true, classes];\n },\n onAfterUpdate: function ( inst ) {\n $('<button type=\"button\" class=\"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all\" data-handler=\"hide\" data-event=\"click\">确定</button>')\n .appendTo($('.ui-datepicker-buttonpane'))\n .on('click', function () {\n \t $('.ui-datepicker').hide();\n \t if (options && options.datepickerCloseCallback) {\n \t\t options.datepickerCloseCallback();\n \t }\n });\n },\n onClose: function(){\n \t$(this).datepicker(\"option\",\"newOpen\", true);\n }\n });\n\t\n\t\t$datepickerHandler.datepicker('refresh').show();\n\t\t\n\t});\n\t\n\t$( document ).click(function( event ){\n\t\tvar $target = event && event.target;\n\t\n\t\tif ( !$target ){\n\t\t\treturn true;\n\t\t}\n\n\t\t$target = $( $target );\n\n\t\tif ( !$(event.toElement).is( \".classDatepicker, .ui-state-default, .ui-datepicker-current, .ui-icon\" )\n\t\t\t\t&& $target.closest( \".classDatepicker, .hasDatepicker\" ).size() == 0 ){\n\t\t\tvar tmp = $(\".ui-datepicker :visible\");\n\t\t\tif (tmp && tmp.length > 0 && options && options.datepickerCloseCallback) {\n\t\t\t\toptions.datepickerCloseCallback();\n\t\t\t}\n\t\t\t$('.ui-datepicker').hide();\n\t\t}\n\t\t\n\t});\n\t\n//\tif( options && options.withQuickAccess ){\n//\t\t\n//\t\t$('<ul class=\"selectCf\">'\n//\t + '<li class=\"\"><a class=\"aToday\" href=\"javascript:void(0);\">今天</a></li>'\n//\t + '<li class=\"\"><a class=\"aYesterday\" href=\"javascript:void(0);\">昨天</a></li>'\n//\t + '<li class=\"\"><a class=\"aRecent7Days\" href=\"javascript:void(0);\">7天</a></li>'\n//\t + '<li class=\"\"><a class=\"aRecent14Days\" href=\"javascript:void(0);\">14天</a></li>'\n//\t + '<li class=\"active\"><a class=\"aRecent30Days\" href=\"javascript:void(0);\">30天</a></li>'\n//\t + '</ul>').insertAfter( $(e) );\n//\t\t\n//\t}\n}", "title": "" }, { "docid": "701020b614b75a20e999c64549b0622e", "score": "0.50068945", "text": "_onMouseDown(event) {}", "title": "" }, { "docid": "fe11d5287f6b710caaa97621d9501975", "score": "0.50056595", "text": "function dateSelection(eventObj)\n{\n\thboxScroller.layoutAnimConfig=layoutConfig;\n\tif(eventObj.id==\"btnFromDatePicker\" && count==2)\n\t{\n\t\thboxScroller.removeAt(0, animationConfigDisable);\n\t\tcount=count-1;\n\t}\n\telse if(eventObj.id==\"btnToDatePicker\" && count==1){\n\t\thboxScroller.addAt(lblDummy2,-1,animationConfigEnable);\n\t\tcount=count+1;\n\t}\n\tbtnIdCal=eventObj.id;\n}", "title": "" }, { "docid": "80e5c7072abc440d84160259c8318df4", "score": "0.4995924", "text": "function showWhileSyncDialog(title) {\r\n whileSyncDialog = $('<div></div>').dialog({\r\n autoOpen : true,\r\n draggable : false,\r\n resizable: false,\r\n modal : true,\r\n closeOnEscape: true,\r\n title : title,\r\n buttons : {\r\n 'OK' : function() {\r\n $(this).dialog('close');\r\n }\r\n }\r\n });\r\n\r\n openDialog(whileSyncDialog);\r\n \r\n $('.ui-widget-overlay').removeClass('ui-widget-overlay-wood');\r\n }", "title": "" }, { "docid": "1e6853acb7334702e8cd0cca4e03727b", "score": "0.4988725", "text": "__initUnselectButton() {\n let instance = this;\n $( \"#unselect-measurement-button\" ).click(\n function(){\n $( \"#measurement-list .ui-selected\" ).each(function(){\n //Remove selected attribute from UI.\n $(this).removeClass(\"ui-selected\");\n //Toggle measurement color\n let uuid = $(this).context.attributes[\"uuid\"].value;\n instance.toggleColor(uuid);\n });\n }\n ).button({\n icon: \"ui-icon-flag\",\n text: false\n });\n }", "title": "" }, { "docid": "09ce158d02cc7661e6ada51abdfd713e", "score": "0.4988227", "text": "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>\"));}", "title": "" }, { "docid": "fb7318e21ded9cc210f70bb1af9d2157", "score": "0.49759904", "text": "function c(){a(\"#__dragtable_disable_text_selection__\").remove(),f?a(document.body).attr(\"onselectstart\",f):a(document.body).removeAttr(\"onselectstart\"),g?a(document.body).attr(\"unselectable\",g):a(document.body).removeAttr(\"unselectable\")}", "title": "" }, { "docid": "eb82cb853a59943e02396f90637e57c4", "score": "0.4970254", "text": "function unblockUI(target) {\n if (target) {\n $(target).unblock({\n onUnblock: function () {\n $(target).css(\"position\", \"\");\n $(target).css(\"zoom\", \"\");\n }\n });\n } else {\n $.unblockUI();\n }\n}", "title": "" }, { "docid": "cb5d16c6d8227df996a5fb9d1f57d378", "score": "0.49650854", "text": "function get_dependent_text()\n{\n $('body').append('<div style=\"width:500px; height: 500px;\" id=\"dep_dialog\"></div>');\n $('#dep_dialog').html('<h1>Select dependent content</h1>' + $('#original').html());\n\n $(\"#dep_dialog\").dialog({\n buttons: [\n {\n text: \"Ok\",\n icons: {\n primary: \"ui-icon-heart\"\n },\n click: function() {\n $( this ).dialog( \"close\" );\n //submit_edit();\n }\n },\n {\n text: \"Cancel\",\n icons: {\n primary: \"ui-icon-heart\"\n },\n click: function() {\n $( this ).dialog( \"close\" );\n }\n }\n ]\n });\n}", "title": "" }, { "docid": "96938673e9445ed5c833621b1410a45b", "score": "0.49641433", "text": "function add_browtab_ui_dialogs(){\n $dialog_box_form.dialog({ // main dialog\n dialogClass: \"no-close\",\n autoOpen: false,\n modal: true,\n closeOnEscape: true,\n width: dialog_width(),\n open: set_Ok_button_on_Enter,\n close: selRowFocus,\n buttons: get_dialog_default_buttons() // no comma - last item in array\n });\n $dialog_confirm.dialog({ // confirm dialog\n dialogClass: \"no-close\",\n autoOpen: false,\n modal: true,\n closeOnEscape: true,\n width: 0.8 * dialog_width()\n // buttons: get_confirm_dialog_default_buttons() // no comma - last item in array\n });\n $dialog_message.dialog({ // message dialog\n dialogClass: \"no-close\",\n autoOpen: false,\n modal: true,\n closeOnEscape: true,\n close: selRowFocus,\n buttons: { Ok: dialog_close } // no comma - last item in array\n });\n}", "title": "" }, { "docid": "df3811249bf24220da070a6517358c54", "score": "0.49629453", "text": "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.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));}", "title": "" }, { "docid": "374193b0e19c2821260a6bc4e104b452", "score": "0.49629453", "text": "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>\"));}", "title": "" }, { "docid": "374193b0e19c2821260a6bc4e104b452", "score": "0.49629453", "text": "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>\"));}", "title": "" }, { "docid": "ae39a70500731df752a38d70a45b533e", "score": "0.49622357", "text": "function selectElement(e) {\n//\t$('#temp_text').blur();\n\tie8SafePreventEvent(e) ; \n\t$('.dragged').removeClass('dragged')\n\tview.initialMousePosX = e.pageX ; \n\tview.initialMousePosY = e.pageY ; \n\tview.mouseDownX = e.pageX ;\n\tview.mouseDownY = e.pageY ;\n\n\tif ($(this).hasClass('fitted')) \n\t\t$(this).addClass('croppable');\t\t\n\n\tif ($(this).hasClass('croppable')){\n \t\t\t$('.selected').removeClass('selected') ; \n\t\t\t$(this).removeClass('highlighted').addClass('selected').addClass('qcrop');\n\t\t\tif(! $(this).hasClass('fitted'))\n\t\t\t\t$('#'+$(this).attr('id').split('outline_')[1]).addClass('crop');\n\t}\n\telse {\n\t\texitInlineCrop();\n\t\tif (! e.ctrlKey && ! e.shiftKey) { // Clicking on an elements without holding the CTRL key\n\t\t\tif($(this).hasClass('selected') && ! $(this).hasClass('unmovable')) {\n//\t\t\t\t$('.selected').not('.unmovable').addClass('grabbed') ;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$('.selected').removeClass('selected') ;\n\t\t\t\t$(this).removeClass('highlighted').addClass('selected') ;\t\t\t\n//\t\t\t\t$('.selected').not('.unmovable').addClass('grabbed') ;\n\t\t\t}\n\t\t}\n\t\n\t\telse {\t\t// Clicking on an elements while holding the CTRL key\n\t\t\tstopPropag(e);\n\t\t\tview.alignToolAutoOpen = true ;\n\t\t\tif($(this).hasClass('selected')) \n\t\t\t{\t\n\t\t\t\t$(this).removeClass('selected') ;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//stopPropag(e);\n\t\t\t\t//view.alignToolAutoOpen = true ;\n\t\t\t\t$(this).removeClass('highlighted').addClass('selected') ;\n\t\t\t\t$(\".selected\").not('.unmovable').addClass('grabbed') ;\n\t\t\t}\n\t\t}\n\t}\n\t// In case the element is non-selectable, it cancels the selection\n\tif ($(this).hasClass('non-selectable') || $(this).hasClass('locked') ) {\n\t\t$(this).removeClass('selected').removeClass('grabbed') ; \n\t\tview.selectorX = e.pageX - getCanvasX() ;\n\t\tview.selectorY = e.pageY - getCanvasY() ;\n\t}\n\t if ($(this).hasClass('locked') )\n\t\t$(this).addClass('highlighted') ; \n\n\tarrangeOutlineZindex() ;\n\tupdateToolbar() ; \t\n\tsetActiveTextboxPosition() ; \n\tupdateSnapPoints();\n\n\n}", "title": "" }, { "docid": "911a3f650c00c27be9171ecbd6afbade", "score": "0.4958973", "text": "function DDButtonClick() {\n\n // Close any existing copies of the dialog\n DDDialogClose();\n\n // Calculate the height/maxHeight (i.e. add some height for Blip.tv)\n DDDialogHeight = DDDialogDefaultHeight;\n DDDialogMaxHeight = DDDialogDefaultHeight + DDDialogDefaultExtraHeight;\n\n // Open the dialog while setting the width, height, title, buttons, etc. of it\n var buttons = { \"Okay\": DDButtonOkay, \"Cancel\": DDDialogClose };\n var title = '<img src=\"/wp-content/plugins/dipdive/resource/gfx/dipdive.png\" alt=\"Dipdive\" width=\"20\" height=\"20\" /> Dipdive';\n jQuery(\"#dd-dialog\").dialog({ autoOpen: false, width: 750, minWidth: 750, height: DDDialogHeight, minHeight: DDDialogHeight, maxHeight: DDDialogMaxHeight, title: title, buttons: buttons });\n\n // Reset the dialog box incase it's been used before\n jQuery(\"#dd-dialog-input\").val(\"\");\n jQuery(\"#dd-dialog-tag\").val('dipdive');\n\n // Style the jQuery-generated buttons by adding CSS classes and add second CSS class to the \"Okay\" button\n jQuery(\".ui-dialog button\").addClass(\"button\").each(function(){\n if ( \"Okay\" == jQuery(this).html() ) jQuery(this).addClass(\"button-highlighted\");\n });\n\n // Do some hackery on any links in the message -- jQuery(this).click() works weird with the dialogs, so we can't use it\n jQuery(\"#dd-dialog-message a\").each(function(){\n jQuery(this).attr(\"onclick\", 'window.open( \"' + jQuery(this).attr(\"href\") + '\", \"_blank\" );return false;' );\n });\n\n // Show the dialog now that it's done being manipulated\n jQuery(\"#dd-dialog\").dialog(\"open\");\n\n // Focus the input field\n jQuery(\"#dd-dialog-input\").focus();\n}", "title": "" }, { "docid": "fc1db4006359293f5f05b98be4a2d53a", "score": "0.49585515", "text": "function ajaxAutoCompleteDropDown() {\n jQuery.widget( \"ui.combobox\", {\n _create: function() {\n var self = this;\n var select = this.element.hide(),\n selected = select.children( \":selected\" ),\n value = selected.val() ? selected.text() : \"\";\n var input = jQuery( \"<input>\" )\n .insertAfter( select )\n .val( value )\n .autocomplete({\n delay: 0,\n minLength: 0,\n source: function( request, response ) {\n var matcher = new RegExp( jQuery.ui.autocomplete.escapeRegex(request.term), \"i\" );\n response( select.children( \"option\" ).map(function() {\n var text = jQuery( this ).text();\n if ( this.value && ( !request.term || matcher.test(text) ) )\n return {\n label: text.replace(\n new RegExp(\n \"(?![^&;]+;)(?!<[^<>]*)(\" +\n jQuery.ui.autocomplete.escapeRegex(request.term) +\n \")(?![^<>]*>)(?![^&;]+;)\", \"gi\"\n ), \"<b>$1</b>\" ),\n value: text,\n option: this\n };\n }) );\n },\n select: function( event, ui ) {\n ui.item.option.selected = true;\n //select.val( ui.item.option.value );\n self._trigger( \"selected\", event, {\n item: ui.item.option\n });\n },\n change: function( event, ui ) {\n if ( !ui.item ) {\n var matcher = new RegExp( \"^\" + jQuery.ui.autocomplete.escapeRegex( jQuery(this).val() ) + \"$\", \"i\" ),\n valid = false;\n select.children( \"option\" ).each(function() {\n if ( this.value.match( matcher ) ) {\n this.selected = valid = true;\n return false;\n }\n });\n if ( !valid ) {\n // remove invalid value, as it didn't match anything\n jQuery( this ).val( \"\" );\n select.val( \"\" );\n return false;\n }\n }\n }\n })\n //.addClass( \"ui-widget ui-widget-content ui-corner-left\" );\n\n input.data( \"ui-autocomplete\" )._renderItem = function( ul, item ) {\n return jQuery( \"<li></li>\" )\n .data( \"item.autocomplete\", item )\n .append( \"<a>\" + item.label + \"</a>\" )\n .appendTo( ul );\n };\n\n jQuery( \"<a>&nbsp;</a>\" )\n .attr( \"tabIndex\", -1 )\n .attr( \"title\", \"Show All Items\" )\n .insertAfter( input )\n .button({\n icons: {\n primary: \"ui-icon-triangle-1-s\"\n },\n text: false\n })\n .removeClass( \"ui-corner-all\" )\n .addClass( \"ui-corner-right ui-button-icon\" )\n .click(function() {\n // close if already visible\n if ( input.autocomplete( \"widget\" ).is( \":visible\" ) ) {\n input.autocomplete( \"close\" );\n return;\n }\n\n // pass empty string as value to search for, displaying all results\n input.autocomplete( \"search\", \"\" );\n input.focus();\n });\n }\n });\n\n}", "title": "" }, { "docid": "249d7d4598c7738151743c364e71dfcd", "score": "0.49518162", "text": "function datePickerInRange ( startdate, enddate, setCurrentStartDate, setCurrentEndDate, hideDel )\r\n{\r\n\tif( setCurrentStartDate == undefined ) setCurrentStartDate = true;\r\n\tif( setCurrentEndDate == undefined ) setCurrentEndDate = true;\r\n\t\r\n\ts = jQuery(\"#\" + startdate );\r\n\te = jQuery(\"#\" + enddate );\r\n\tif( setCurrentStartDate && s.val()=='') s.val( getCurrentDate() );\r\n\tif( setCurrentEndDate && e.val()=='' ) e.val( getCurrentDate() );\r\n\r\n\tvar dates = $('#'+startdate+', #' + enddate).datepicker(\r\n\t{\r\n\t\tdateFormat: dateFormat,\r\n\t\tdefaultDate: \"+1w\",\r\n\t\tchangeMonth: true,\r\n\t\tchangeYear: true,\r\n\t\tnumberOfMonths: 1,\r\n\t\tmonthNamesShort: monthNames,\r\n\t\tdayNamesMin: dayNamesMin,\r\n\t\tshowAnim: '',\r\n\t\tcreateButton: false,\r\n\t\tconstrainInput: true,\r\n yearRange: '-100:+100',\r\n\t\tonSelect: function(selectedDate)\r\n\t\t{\r\n\t\t\tvar option = this.id == startdate ? \"minDate\" : \"maxDate\";\r\n\t\t\tvar instance = $(this).data(\"datepicker\");\r\n\t\t\tvar date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);\r\n\t\t\tdates.not(this).datepicker(\"option\", option, date);\r\n\t\t}\r\n\t});\r\n\r\n\tjQuery( \"#\" + startdate ).attr(\"readonly\", true );\r\n\tjQuery( \"#\" + enddate ).attr(\"readonly\", true );\r\n\tjQuery( \".ui-datepicker-trigger\").hide();\r\n\taddRemoveDateButton( startdate, hideDel );\r\n\taddRemoveDateButton( enddate, hideDel );\r\n\t\r\n $(\"#ui-datepicker-div\").hide();\r\n}", "title": "" }, { "docid": "595ba3e04934b50d27670032095eba99", "score": "0.49512705", "text": "function UIHelper(){\n\n }", "title": "" }, { "docid": "90d2accfbc6bc4dc53a37566ad700eb0", "score": "0.49491864", "text": "eq(_widget) { return false; }", "title": "" }, { "docid": "10a090cf37dbec26946cf92ea2c82a14", "score": "0.49464336", "text": "function dragEnd(e) {\r\n\r\n\t// Si no hay elemento en el contenedor mostramos el texto\r\n\t/*if ($(\"#destino div\").length === 0) $(\"#destino\").append('<p>DRAG&DROP</p>');*/\r\n\r\n\t// Si no hay elemento en el contenedor mostramos el texto\r\n\t/*if ($(\"#origen div\").length === 0) $(\"#origen\").append('<p>DRAG&DROP</p>');*/\r\n\r\n\t/* Reseteamos valores modificados para inicializarlos */\r\n\t$(this).css({\r\n\t\t'background-color': '',\r\n\t\t'border-style': 'solid'\r\n\t});\r\n\r\n\t// Mostramos el objeto arrastrado previamente ocultado\r\n\tobjArrastrado.css('visibility', 'visible');\r\n\r\n}", "title": "" }, { "docid": "d10cf70d9c93334906b27fb51cc97741", "score": "0.49385235", "text": "function datepickerKeep() {\r\n if ($.datepicker._datepickerShowing) {\r\n var datepicker = $.datepicker._curInst;\r\n var datepickerInput = datepicker.input;\r\n var datepickerDiv = datepicker.dpDiv;\r\n datepickerDiv.position({\r\n my : 'left top',\r\n of : datepickerInput,\r\n at : 'left bottom'\r\n });\r\n }\r\n }", "title": "" }, { "docid": "73f1bb6f33a499658c42ef97b3d969aa", "score": "0.4931163", "text": "function makeSelection(event, ui) {\n\n $('#name').val(ui.item.data.name);\n $('#size').val(ui.item.data.size);\n $('#cals').val(ui.item.data.cals);\n $('#carbs').val(ui.item.data.carbs);\n $('#proteins').val(ui.item.data.prot);\n $('#weight').val(ui.item.data.weight);\n}", "title": "" }, { "docid": "b7cb8893d7c13cdb7af883b2bacce17d", "score": "0.4926777", "text": "function main() {\r\n $('.uiTooltipText').addClass('uiChatListItem').removeClass('uiTooltipText');\r\n}", "title": "" }, { "docid": "5fb4c3fbf7dd4eafe7170963bc8abf9a", "score": "0.49212822", "text": "function DraggableBallot () {}", "title": "" }, { "docid": "01f79b763da23dc381529ccbfbb892af", "score": "0.49136055", "text": "function UI(){\n\n}", "title": "" }, { "docid": "78286c15bcd6c4c2feb1790c89b196d5", "score": "0.49111682", "text": "function load_date_pickers() {\n $('.datepicker').each(function() {\n $(this).datepicker({ dateFormat: 'yy-mm-dd', showOn : 'focus', constrainInput : true });\n });\n\t$('#ui-datepicker-div').css('clip', 'auto');\n}", "title": "" }, { "docid": "71b5877cd68d07f2839b5e1c910c182d", "score": "0.4908612", "text": "function clicked(d,i) {\n}", "title": "" }, { "docid": "1bdf88d6bb96043efb742fcc473f239d", "score": "0.49076787", "text": "function customStyleSelect(select){\n $(select).niceSelect();\n}", "title": "" }, { "docid": "feb86f16eb9213aae15a951e49d7689d", "score": "0.4906052", "text": "function UI() { } // UI constructor is simple because we are not passing anything in, it will just be an empty function. Everything esle will go inside the prototype. ", "title": "" }, { "docid": "3f332823fcccad4217d9f9d674161845", "score": "0.49059927", "text": "uiEvtMouseMovePerformed(x, y) {\r\n return false;\r\n }", "title": "" }, { "docid": "6e246bf270edae13986074bd1f728dda", "score": "0.48966187", "text": "function DoMouseDrag(e)\n\t{\n\tvar x = e.clientX + xDragOffset;\n var y = e.clientY + yDragOffset;\n\n var dialog = document.getElementById('uiDialogHTMLElement');\n\n var xfinal = x+\"px\";\n\tvar yfinal = y+\"px\";\n \n\tdialog.style.left = xfinal;\n\tdialog.style.top = yfinal;\n\t}", "title": "" }, { "docid": "df73625981f71261acdb78715a51f560", "score": "0.48960817", "text": "function UI() {\n\n}", "title": "" }, { "docid": "83ca4073bb527c7346edb070535402c4", "score": "0.48934636", "text": "function u(r,a){S=m.find(\".ui-slider-handle\");var u=\"\",p=e.split(\"-\");p.length>=4&&(u=\"sg-title-\"+p[3]),p.length>=5&&(u+=\" row-\"+p[4]),S.attr(\"role\",\"slider\"),S.attr(\"aria-labelledby\",u),S.attr(\"aria-valuemin\",s),S.attr(\"aria-valuemax\",i),S.attr(\"aria-orientation\",t),d&&(c(!1===l?d:i-d),$(\".sg-slider-value-\"+e).html(d),1==n&&1==o&&(y.appendTo(\".slider-\"+e+\" .ui-slider-handle\"),$(\".sg-bubble-\"+e).text(d)))}", "title": "" }, { "docid": "2e92cf6933134093b96405418b70aa46", "score": "0.48857605", "text": "function fncDialogFaderAdmin(sID,sMassage,sTime, sTitle, sHeight,sWidth){\t\n if(sTitle==true){\n\t sHeight = sHeight + 100\n } else {sHeight = sHeight}\n\t$(\"#\"+sID).dialog({ \n\tautoOpen: false,\n\twidth: sWidth,\n height: sHeight,\t\n\tshow: {\n effect: \"explode\", //explode,slide,puff,drop,blind,clip, fold,scale,size,pulsate\n duration: 1000\n },\n hide: {\n effect: \"fade\",\n duration: 2000\n },\t \n\t create: function (event, ui) {\n\t\tif (sTitle == false){\t\n\t\t $(\".ui-widget-header\").hide();\n\t\t}\n\t}\n\t});\n\t$(\"#\"+sID).dialog('open'); \n\t$(\"#\"+sID).html(\"<h1 style='color:green!important; text-align:center;'>\" + sMassage +\"</h1>\"); \n\tsetTimeout(\n\t\tfunction () {\t\t\t \n\t\t\t $(\"#\"+sID).dialog(\"close\");\t\t\t\n\t}, sTime);\n}//end fncDialogFaderAdmin", "title": "" } ]
cc71be177b22579b7a029b68d4e6fb5d
const MASSNUMS = [1, 0, 1, 2, 4, 5];
[ { "docid": "9788c4ccb41101414118a93ae8507192", "score": "0.0", "text": "function getResyltCheck(mass) {\n let flag = true;\n if (mass.length == 0) {\n alert(\"Massive is hollow!\");\n return;\n }\n let j = 0;\n // algorithm search masive sort or not?\n for (let i = 0; i < mass.length - 1; i++) {\n for (j = j + 1; j < mass.length; j++) {\n if (mass[i] > mass[j]) {\n flag = false;\n break;\n }\n break;\n }\n }\n return flag;\n}", "title": "" } ]
[ { "docid": "d39973973d2dbb6a691beb6a45c1562f", "score": "0.6461868", "text": "function fillMatchNumbersSE(maxNo){\n\tvar mns = [];\n\tfor (var i = 0; i < maxNo; i++){\n\t\tmns.push( [maxNo - i, maxNo - i] );\n\t}\n\t\n\tfor (var i = maxNo + 1; i >= 1; i--){\n\t\tmns.push( [i, i, 1] );\n\t}\n\treturn mns\n}", "title": "" }, { "docid": "04a628cf21386c30c289b82342d1145a", "score": "0.61919117", "text": "function moneys(array, start, length){\n let curr = 0\n let prev = 0\n for(let i=start; i<length; i++){\n let temp = curr\n curr = Math.max(prev + nums[i], curr)\n prev = temp \n }\n \n return curr\n }", "title": "" }, { "docid": "80a99e682edfda40b527bcb71ea02f1a", "score": "0.59467524", "text": "getms(l){\n let res = [];\n for(let m=0; m<=l; m++){\n if(m === -0) m = 0;\n res.push(m);\n }\n return res;\n }", "title": "" }, { "docid": "2df6c992772da78461f90dc9be63aad9", "score": "0.58184737", "text": "static get maxList() {\n return 0xffff + 0x1;\n }", "title": "" }, { "docid": "b78c59660decd079f81f353b2b11101d", "score": "0.57959765", "text": "function lonelyinteger(a) {\n // Write your code here\n const s = new Set()\n\n a.forEach(number => {\n if (s.has(number)) s.delete(number)\n else s.add(number)\n })\n\n return Array.from(s)[0]\n}", "title": "" }, { "docid": "a0c634233bc76c3aaad3c87f7b36cfe4", "score": "0.57764935", "text": "function make_numbers(N){\n return Array.apply(null, {length: N}).map(function(value, index){\n return index + 1;\n });\n }", "title": "" }, { "docid": "b5753b10651443fbb150113deead3670", "score": "0.5774881", "text": "function generateNumArray(size){\r\n\tlet arr = new Array(size);\r\n\tarr.fill(0);\r\n\tarr.forEach((e,index) => \r\n\t\tarr[index] = Math.round(Math.random()*1000*(Math.random() > 0.5 ? 1 : -1)));\r\n\treturn arr;\r\n}", "title": "" }, { "docid": "4c70083dc8e75dba77e181d192b8a535", "score": "0.5770262", "text": "times01() { this.mantisa.unshift(new Array(this.mantisa[0].length).fill(0)) }", "title": "" }, { "docid": "611317c2ae6d3d85e5690d171a264e3d", "score": "0.576987", "text": "function findUnique(numbers) {\r\n return numbers.reduce((a, b) => a ^ b)\r\n}", "title": "" }, { "docid": "721b0c725c3303c4cfeeb3e364024dd4", "score": "0.576785", "text": "function increaseArrayMembers(){\n return Array\n .apply(0, Array(20))\n .map((start, n) => (n + 1) * 5);\n}", "title": "" }, { "docid": "f751ab66bd03df54fe711522797e6fbb", "score": "0.5725785", "text": "function maker() {\n var arr = [];\n for (var i = 1; i < 216; i++) {\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "be5f7ec03e7478b6aa5d4c1bd6ac3e07", "score": "0.5724231", "text": "function solve(number){\n var arr=[];\n arr.length=number;\n for (var index = 0; index < arr.length; index+=1) {\n arr[index]=index*5;\n console.log(arr[index]);\n }\n}", "title": "" }, { "docid": "05f3ffb958311a843d5cd5ca6a98307f", "score": "0.57149374", "text": "function indexMultByFive() {\n const arr = Array(20);\n for (let i = 0; i < arr.length; i++) {\n arr[i] = i * 5;\n }\n return arr;\n}", "title": "" }, { "docid": "be4bd5f090b8b241d82372f3752e39da", "score": "0.5690837", "text": "function unique5(arr) {\n return Array.from(new Set(arr))\n}", "title": "" }, { "docid": "75af867ed09a03010849ac9bd82348b0", "score": "0.56903535", "text": "function numberRandomInRange(array, max){\r\n while (array.length < 16) {\r\n var numberComputer = Math.floor(Math.random() * (max - 1 + 1) + 1);\r\n if (!(array.includes(numberComputer))) {\r\n array.push(numberComputer);\r\n }\r\n }\r\n return array;\r\n}", "title": "" }, { "docid": "72035123ccecb66f1029a742c560118f", "score": "0.56865853", "text": "function pickingNumbers(a) {\n return [...new Set(a)].reduce((c, v) => {\n return Math.max(c,\n a.reduce((c1, v1) => c1 += (v1 === v || v1 === v + 1), 0));\n },0);\n}", "title": "" }, { "docid": "305116421d414e6adfd445eb23082146", "score": "0.56661385", "text": "function Mn(num1, num2){\n for(let i = 0; i < num1; i ++){\n for(let j = 1; j < num2; j++){\n\n }\n }\n}", "title": "" }, { "docid": "d6a217ca44d0b9020bf3e73ba58c1e76", "score": "0.5656921", "text": "next5() {\n let newList = [];\n let start = this.state.currentProduct;\n if (start < 6) {\n for (let i = 1; i < 101; i++) {\n if (i !== start) {\n newList.push(i);\n }\n if (newList.length === 5) {\n break;\n }\n }\n } else if (start > 96) {\n for (let i = start + 1; i < 101; i++) {\n newList.push(i);\n }\n for (let j = 1; newList.length < 5; j++) {\n newList.push(j);\n }\n } else {\n for (let k = start + 1; newList.length < 5; k++) {\n newList.push(k);\n }\n }\n return newList;\n }", "title": "" }, { "docid": "d0fdcd3d479183a1f6b4c9dbc9336399", "score": "0.5653053", "text": "function populateArray(number) {\n\tvar array = [];\n\tfor (var i = 0; i <= number; i++) {\n\t\tarray.push(i);\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "a9d0f215397a420bde424c126fee1e65", "score": "0.56499517", "text": "function stray(numbers) {\n \n let MaxNumber = Math.max(...numbers)\n let MinNumber = Math.min(...numbers)\n \n let arr = numbers.filter(number =>{ \n return number === MaxNumber\n })\n \n let finalArray = arr.length == 1\n \n return finalArray ? MaxNumber : MinNumber;\n}", "title": "" }, { "docid": "7542bf6665df200ce712a720d02507cc", "score": "0.5641446", "text": "function numArr(limit){\n\tlist = [];\n\tfor (let i = 0; i < limit; i ++){\n\t\tlist.push(i);\n\t}\n\treturn list;\n}", "title": "" }, { "docid": "f6a87f65e285342508ddecb315f941a0", "score": "0.5638336", "text": "function fiveTo(number) {\n var output = [];\n if (number === 5){\n return [5];\n } else if (number > 5){\n for (var i = 5; i <= number; i += 1){\n output.push(i);\n }\n } else {\n for (var i = 5; i >= number; i -= 1){\n output.push(i);\n }\n }\n return output;\n}", "title": "" }, { "docid": "7c00be9f0ba20dd8eb3e65a85dbf10b2", "score": "0.56261396", "text": "_startArrayOfNumbers() {\n this.multiples = new Array(); \n for (var i = this._ini; i <= this._final; i++) {\n this.multiples.push(i);\n }\n }", "title": "" }, { "docid": "0a335b512b5ed0223b7e9475a3032d31", "score": "0.5612886", "text": "function duplicate(list=[]) {\n const n = list.length - 1;\n return list.reduce((a,b) => (a || 0) +b) - Math.floor(n * (n + 1) / 2);\n}", "title": "" }, { "docid": "5cbfae598c117947f6902ffe7ca2f1c5", "score": "0.5604864", "text": "function findMultiples(int,limit){\n let result = []\n \n for (let i = int; i<=limit ; i+=int)\n result.push(i)\n \n return result\n}", "title": "" }, { "docid": "0b781e2a5db1de068449c3767bd5ba6a", "score": "0.56036973", "text": "constructor(m, n){\n this.m = m;\n this.n = n;\n this.values = Array(m).fill().map(() => Array(n).fill(0));\n }", "title": "" }, { "docid": "4cf288652e2af9652cae182574802156", "score": "0.56032586", "text": "function computeNumbers() {\n let winner = [];\n for (let i = 0; i < 3; i++) {\n winner.push(Math.floor(1 + Math.random() * 39))\n };\n return winner\n}", "title": "" }, { "docid": "67e655b4218acbd2d605683578c0e070", "score": "0.5594711", "text": "function megaFriend(arr){\n var large = arr[0];\n for (let i = 0; i < arr.length; i++) {\n var element = arr[i];\n if( large.length < element.length){\n large = element;\n }\n }\n return large;\n}", "title": "" }, { "docid": "9f5cc0672d3e7263d1d00c2ac5a70d66", "score": "0.558539", "text": "function findMultiples(integer, limit) {\n const arr = []\n for(let i = integer; i <= limit; i += integer) {\n arr.push(i)\n } \n return arr\n}", "title": "" }, { "docid": "a65d178e4993a692635ebba16ab3c0ea", "score": "0.5580805", "text": "function solution(N, A) {\n // write your code in JavaScript (Node.js 8.9.4)\n let arrayOfCounters = Array.apply(null, Array(N)).map(v => 0);\n let offset = 0;\n let maxCounter = 0;\n \n A.forEach(element => {\n if (element >= 1 && element <= N) {\n arrayOfCounters[element-1] = Math.max(offset, arrayOfCounters[element-1]) + 1;\n maxCounter = Math.max(arrayOfCounters[element-1], maxCounter);\n } else {\n offset = maxCounter;\n }\n });\n arrayOfCounters.map((e, i) => {\n if (e < offset) {\n arrayOfCounters[i] = offset;\n }\n })\n return arrayOfCounters;\n}", "title": "" }, { "docid": "0cd4b958de379924ea109e4414b7971f", "score": "0.55769384", "text": "function M(n){return [255&n,(65280&n)>>>8,(16711680&n)>>>16,(4278190080&n)>>>24]}", "title": "" }, { "docid": "24986bee38190dcfffd52d75e0365c67", "score": "0.55746025", "text": "function singleNumber(nums) {\n const memo = new Set();\n\n for (let num of nums) {\n if (memo.has(num)) {\n memo.delete(num);\n } else {\n memo.add(num);\n }\n }\n\n return [...memo][0];\n}", "title": "" }, { "docid": "0734f17bde7d0198b52e7b5f3d8020a6", "score": "0.55608666", "text": "function maxOfArray(numbers) {\n //\n}", "title": "" }, { "docid": "1600e4262a4a42cee07d179807baaa2e", "score": "0.5556434", "text": "function notemax(tab){\n let max = 0;\n for(var i = 0; i < tab.length; i++){\n if(max < tab[i]){\n max = tab[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "b23346facd9f97ef3f31046a836f2825", "score": "0.5552007", "text": "function solution (A) {\n // let num = 1\n // A.forEach(function (element, index) {\n // if (!A.includes(index + 1)) num = 0\n // })\n // return num\n // // // if ((new Set (A)).size !== A.length) return 0\n // // for (let i = 1; i <= A.length; i++) {\n // // if (A.indexOf(i) === -1) return 0\n // // }\n // // return 1\n if (A.length === Math.max(...A) && A.length === ((new Set (A)).size)) return 1\n else return 0\n}", "title": "" }, { "docid": "e0c0008bdab9371207aaf8e88a17459b", "score": "0.55509263", "text": "function findMAxSequence(arr) {\n var maxCount = 1;\n var tempCount = 1;\n var tempInd = 0;\n var lastInd = 0;\n var result = [];\n\n for(var i = 0; i < arr.length - 1; i++) {\n if(arr[i] === arr[i + 1]) {\n tempCount++;\n tempInd = i + 1;\n if(i === arr.length - 2){\n if(tempCount >= maxCount) {\n maxCount = tempCount;\n lastInd = tempInd;\n }\n }\n }\n else {\n if(tempCount >= maxCount) {\n maxCount = tempCount;\n lastInd = tempInd;\n }\n tempCount = 1;\n }\n }\n var firstInd = lastInd - maxCount + 1;\n for (var i = firstInd, j = 0; i < firstInd + maxCount; i++, j++) {\n result[j] = arr[i];\n }\n return result;\n}", "title": "" }, { "docid": "5b2d74c471e3e116d06985b64c55d318", "score": "0.5546849", "text": "function monkeyCount(n) {\n console.log(n);\n let arr = [];\n for (let i = 1; i <= n; i++) {\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "b910eb6bd40c9f8642b566d5893dcfd1", "score": "0.55465484", "text": "function extraerMultiplos(numbers) {\n\tvar multiplos = new Array();\n\tvar mensaje = \"Los multiplos son: \";\n\tfor (i=0; i<numbers.length; i++)\n\t\tif (numbers[i] % 5 == 0 && numbers[i] > 5){\n\t\t\tmultiplos.push(numbers[i]);\n\t\t}\n\treturn multiplos;\n}", "title": "" }, { "docid": "d2fd3a5900d64f6b0de0f65ea77cb421", "score": "0.5545892", "text": "function randomNumbers () {\n let arr = [];\n for(let i = 0; i < 7; i++) {\n arr.push(Math.floor(Math.random * 9));\n }\n\n let newArr = Array.from(new Set(arr));\n if(newArr.length === 7) {\n return newArr\n } else {\n for(let i = 0; i < 7 - newArr.length; i++) {\n newArr.push(Math.floor(Math.random * 9));\n }\n return newArr\n }\n}", "title": "" }, { "docid": "c770b3b9aae7da7150cd0e42cbf46d4d", "score": "0.5538852", "text": "function f8( elements, num_of_attempts )\n{\n let min, rand_number;\n for(let i=0; i<num_of_attempts; ++i)\n {\n rand_number = f7(elements);\n //rand_number = elements[Math.floor(Math.random() * elements.length)];\n if( min == undefined || rand_number < min )\n min = rand_number;\n }\n return min;\n}", "title": "" }, { "docid": "00fdd4942357c7bbdd0ddf39d53a1c4c", "score": "0.55385685", "text": "function ThreeFiveMultiples(num) {\n let arr = [];\n\n for (let i = 1; i < num; i++) {\n if (i % 5 === 0 || i % 3 === 0) {\n arr.push(i);\n }\n }\n\n return arr.length > 0 ? arr.reduce((a, c) => a + c) : 0;\n}", "title": "" }, { "docid": "3fe49df64e5a36cc386bfb47b04ac377", "score": "0.55364776", "text": "function maxTriSum(numbers){\n let arr = Array.from(new Set(numbers)).sort((a,b) => b-a);//new Set to avoid duplications\n return arr.slice(0,3).reduce((a,b) => a+b);\n}", "title": "" }, { "docid": "1d7ce2c3ca01749ff0f72662c0c8eacd", "score": "0.5535346", "text": "function monkeyCount(n) {\n\tvar arr = [];\n\tfor (let i = 1; i <= n; i++) {\n\t\tarr.push(i);\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "2d75f3bd253079642ff0e8181566ad34", "score": "0.5529844", "text": "function presents(a) {\n return a.reduce((arr, x, i) => {\n arr[x - 1] = i + 1;\n return arr;\n }, []);\n}", "title": "" }, { "docid": "76c3f6594ad0cabbe0b926ec9512d2ab", "score": "0.5525438", "text": "init(num) {\n this.coll = [0, 1, 2];\n for (let i = 3; i <= num; i++) {\n let tmp = this.collatz_length(i);\n this.coll[i] = tmp;\n if (tmp > this.maximum[1]){\n this.maximum = [i, tmp];\n }\n }\n }", "title": "" }, { "docid": "f4588e830753a811b04c4968f44a0934", "score": "0.5522227", "text": "function problem5(){\n var MultipleThree =[];\n\n for(i=3; i<=9; i+=3){\n MultipleThree.push(i);\n\n\n }\n return MultipleThree;\n}", "title": "" }, { "docid": "b4c392b141983d65504afa6b4dc461bf", "score": "0.55040187", "text": "function migratoryBirds(ar) {\n let maxFreq = 0;\n let minId = 6;\n let hash = ar.reduce((acc,curr) => {\n acc[curr] = ++acc[curr] || 1;\n return acc;\n }, {})\n\n for(let key in hash){\n if(hash[key] >= maxFreq){\n if(maxFreq === hash[key]){\n minId = Math.min(minId, parseInt(key));\n } else {\n minId = parseInt(key); \n }\n maxFreq = hash[key];\n }\n }\n return minId;\n}", "title": "" }, { "docid": "88ffcd2869d7d3c4dcd5e90ff4d3049c", "score": "0.5500826", "text": "function monkeyCount(n) {\n return Array.from({length: n}, (val, idx) => idx + 1);\n}", "title": "" }, { "docid": "ac9bb8bb774a6866003733856448bdd4", "score": "0.5500374", "text": "function genera_mine() {\r\n var array_mine = [];\r\n for (var i = 0; i < 16; i++) {\r\n var numeri_pc = genera_random(1, 100)\r\n array_mine.push(numeri_pc);\r\n }\r\n return array_mine;\r\n}", "title": "" }, { "docid": "35d0497e419354890b20b90139979ea6", "score": "0.5499638", "text": "function n2ns(n) { return Array.from({length: n}, (v,i) => i+1 ) }", "title": "" }, { "docid": "a8afa56bd09a9678fa1250e6d8c6fc18", "score": "0.54962975", "text": "function maximalSequence() {\n var elements = [2, 1, 1, 2, 3, 3, 2, 2, 2, 1];\n var counter1 = 1;\n var counter2 = 0;\n var currentNumber;\n var result = [];\n\n for (var i = 1; i < elements.length; i++) {\n if (elements[i] === elements[i - 1]) {\n counter1++;\n } else {\n if (counter1 >= counter2) {\n counter2 = counter1;\n currentNumber = elements[i - 1];\n }\n counter1 = 1;\n }\n }\n\n for (var i = 0; i < counter2; i++) {\n result[i] = currentNumber;\n }\n console.log('Maximal sequence: ' + result.join(', '));\n}", "title": "" }, { "docid": "2e28ef6bef9cee6b584df723f75dd474", "score": "0.5489283", "text": "function greatGrowingList(n) {\n array = []\n for(counter=1; counter <= n; counter++) {\n array.push(counter)\n }\n console.log(array)\n }", "title": "" }, { "docid": "ebbbf29612d3fa2261864447b7814c0b", "score": "0.5480647", "text": "function nb_cassables(min,max){\n return min+Math.floor(Math.random()*max); \n }", "title": "" }, { "docid": "ebbbf29612d3fa2261864447b7814c0b", "score": "0.5480647", "text": "function nb_cassables(min,max){\n return min+Math.floor(Math.random()*max); \n }", "title": "" }, { "docid": "495df0b9d7bb9b3bb338830262c5e8a2", "score": "0.54798394", "text": "function getNums(size = 16) {\n var nums = [];\n for (let i = 0; i < size; i++) {\n nums[i] = i + 1;\n }\n nums.sort(function (a, b) { return Math.random() - 0.5 });\n return nums;\n}", "title": "" }, { "docid": "fe224d8bcdae533ae94928cfed37f4be", "score": "0.547866", "text": "function solution(N, A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const counter = new Array(N).fill(0);\n let max = 0;\n let prev = A[0] - 1;\n A.forEach((element, ind) => {\n if (element === N + 1) {\n max > 0 ? counter.fill(max) : counter.fill(0);\n } else if (element >= 1 && element <= N) {\n counter[element - 1]++;\n if (max < counter[element - 1]) max = counter[element - 1];\n }\n });\n console.log(max);\n return counter;\n}", "title": "" }, { "docid": "f6207ef4af3c81c8a16e2056dc4f4bda", "score": "0.54740614", "text": "function n(x,M){if(x===M)return 0;for(var B=x.length,Q=M.length,se=0,P=Math.min(B,Q);se<P;++se)if(x[se]!==M[se]){B=x[se],Q=M[se];break}return B<Q?-1:Q<B?1:0}", "title": "" }, { "docid": "84d16c2944507adaa561238bf5d1681d", "score": "0.54725134", "text": "function findNb(m) {\n let count = 0;\n for (let i=1; i<m; i++){\n count += Math.pow(i,3);\n if (count>m) {\n return -1\n } else if (count === m) {\n return i\n }\n }\n}", "title": "" }, { "docid": "4d23aeed8b0375361e51e24eb36447b2", "score": "0.54724056", "text": "function initArr() {\n for (let k = 0; k < elementCount; k++) {\n elementsArr.push(randomInt(5, 999));\n }\n updateMaxMin();\n}", "title": "" }, { "docid": "5056faa7eec17b94b4a53099c37a260d", "score": "0.547235", "text": "function solution(A) {\n \n A = A.sort((a,b)=>a-b);\n\n \n // write your code in JavaScript (Node.js 8.9.4)\n if(A.every(item=>item<=0)){\n return 1;\n }\n \n let positiveArr = A.filter(item=>item>0);\n positiveArr = [...new Set(positiveArr)]\n let incremental = 1;\n\n console.log(positiveArr);\n \n \n for(var item of positiveArr){\n if(incremental !== item){\n return incremental;\n }else{\n incremental++;\n }\n }\n return ++item;\n }", "title": "" }, { "docid": "2717a72b4ea7892995043593f1b2a16a", "score": "0.5471217", "text": "function ultimos6Meses(){\n var mes=mesActual();\n mes=parseInt(mes);\n var ret=[];\n var arr=['01','02','03','04','05','06','07','08','09','10','11','12'];\n var temp=mes;\n for (var i = 1; i <= 6; i++) {\n if (temp==0) {\n ret.push(arr[temp]);\n temp = 12;\n }else{\n ret.push(arr[temp]);\n }//if-else\n temp--;\n }//for\n return ret;\n}", "title": "" }, { "docid": "ac091cae349c398ebb36994334f58c59", "score": "0.54696155", "text": "function breakChocolate(n,m) {\n if (n * m <= 1) {\n return 0; \n }\n else {\n return n * m - 1;\n }\n \n}", "title": "" }, { "docid": "a3d84d4df5f3cd37ccbd6f15a5d66c68", "score": "0.5469097", "text": "function initSNums() {\r\n let snums = [0, 1, 10, 10, 5, 10,\r\n 2, 7, 7, 4, 8, 9,\r\n 7, 2, 5, 6, 0, 3,\r\n 1, 7, 3, 2, 8, 10,\r\n 6, 3, 0, 5, 9, 7,\r\n 7, 10, 10, 7, 1, 10\r\n ];\r\n return snums;\r\n}", "title": "" }, { "docid": "a4692fcf97ff769b461b0d5df4e2a866", "score": "0.5463727", "text": "maxmum(){\n return arr[len-1];\n }", "title": "" }, { "docid": "f40437cb2c529cafddecd2252553159e", "score": "0.54605037", "text": "function createMines(rangeNum) {\n var mines = [];\n var rndMine;\n while (mines.length < 16) {\n rndMine = randomGenerator(rangeNum);\n if (isIncluded(rndMine, mines) === false) {\n mines.push(rndMine);\n }\n }\n return mines;\n}", "title": "" }, { "docid": "e8d9e7beb1728c78299b0d1ddcf1c1e2", "score": "0.54593843", "text": "function solution(number){\n let arr = 0\n if (number < 0) {return 0};\n \n for (var i = 1 ; i < number;i++){\n if (i % 3 ===0 || i % 5 ===0 ){\n arr+=i\n \n }\n }return arr\n}", "title": "" }, { "docid": "895d34f2b874a6814d4aaffd4a6a73d5", "score": "0.54589605", "text": "function make_list(num1)\n{\n var list = [];\n for(var i = 0; i < num1; i++) list.push(i+1);\n test_list = list;\n}", "title": "" }, { "docid": "ef06d8a469fc48afe1f9b4e64c497964", "score": "0.54578775", "text": "function makeArrayConsecutive2(statues) {\n var min = statues[0];\n var max = statues[0];\n var sum, m;\n for( var i = 1; i < statues.length ; i++)\n {\n\n if(min < statues[i]) {\n min = min;\n }\n else{\n min = statues[i];\n }\n if(max > statues[i])\n {\n max=max;\n }\n else{\n max=statues[i];\n }\n }\n sum=max - min + 1;\n m= sum - statues.length;\n return m;\n}", "title": "" }, { "docid": "2bdc14f687fd8c477bc5e4d54b7b7d86", "score": "0.54572767", "text": "function sequence(number) {\n let result = [];\n\n for (let i = 1; i <= number; i += 1) {\n result.push(i);\n };\n \n return result;\n}", "title": "" }, { "docid": "214fe0824a1cd7d15f5f038e6d8a7c01", "score": "0.54533535", "text": "function maxOfArray(numbers) {\n //\n let max = numbers.reduce((elem, acc) => {\n return (elem > acc) ? elem : acc;\n }, 0);\n return max;\n}", "title": "" }, { "docid": "8844c838c92707345fa3bff7040589c8", "score": "0.5450244", "text": "function solution(A) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n\tlet nums = [];\r\n\tlet maxNum = 0;\r\n\tA.forEach(item => {\r\n\t\tif (item > 0) {\r\n\t\t\tif (!nums[item - 1]) {\r\n\t\t\t\tnums[item - 1] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (item > maxNum) {\r\n\t\t\tmaxNum = item;\r\n\t\t}\r\n\t});\r\n\t\r\n\tconst index = nums.findIndex(item => !item);\r\n\tif (index > -1) {\r\n\t\treturn index + 1;\r\n\t} else {\r\n\t\treturn maxNum > 0 ? (maxNum + 1) : 1;\r\n\t}\r\n}", "title": "" }, { "docid": "d565d2b4eeef9b725f6ba9331f743027", "score": "0.54494816", "text": "function SmallStraightVariables(uniqueNums){\n var ssCount = 0;\n var ssCount2 = 0;\n for(ss = 0; ss < uniqueNums.length-1; ss++){\n if(uniqueNums[ss] + 1 == uniqueNums[ss+1])\n ssCount++;\n }\n for(ss2 = uniqueNums.length; ss2 > 1; ss2--){\n if(uniqueNums[ss2] -1 == uniqueNums[ss2-1])\n ssCount2++;\n }\n if(ssCount >= 3 || ssCount2){\n return true;\n }\n \n\n \n}", "title": "" }, { "docid": "28d1b7fe6e58a859998b593ed56249ce", "score": "0.54491556", "text": "function smnbias(n)\n{\n return (1 - 3/(4*n-9)) ;\n}", "title": "" }, { "docid": "4febaa952c97f37d1bf7bcb9aa64bce9", "score": "0.5448571", "text": "function problem2(){\n var TenToOne= [];\n for(var i=10; i>0; i--){\n TenToOne.push(i);\n }\n return TenToOne\n}", "title": "" }, { "docid": "36f603c414bc3f88abbbabe4e219a707", "score": "0.544457", "text": "function assignMandatories(howMany, mandatoryArray)\n {\n var selectedIndex = 0;\n\n // each loop iteration finds one value, stuffs it into mandatoryArray, and \n // removes it from numberArr[]. Removing the value ensures it will only\n // be used once across character sets.\n for (var i = 0; i < howMany; i++)\n {\n // random selection of index into numberArr\n selectedIndex = Math.floor(Math.random()*numberArr.length);\n // value at the selected location is added to mandatoryArray\n mandatoryArray.push(numberArr[selectedIndex]);\n // and removed from numberArr (which reduces the length of numberArr)\n numberArr.splice(selectedIndex,1);\n }\n }", "title": "" }, { "docid": "db8848661fce81ebd93647514fdcc65d", "score": "0.5436289", "text": "function multiples(max, num){\n // returns an array of numbers\n var num_multiples = [];\n\n for (var i = 1; i < max; i += 1) {\n var product = num * i;\n\n if (product < max) {\n num_multiples.push(product);\n }\n }\n return num_multiples;\n}", "title": "" }, { "docid": "90fb69db30deacdbb216cbf35dd8571f", "score": "0.5436174", "text": "function singleNumber(nums) {\n let num = 0;\n for (let n of nums) {\n num ^= n;\n }\n return num;\n }", "title": "" }, { "docid": "89ebbd902b8795b140172c4885250dee", "score": "0.5435876", "text": "function canoniacalNums(array) {\n let collection = []\n\n array.forEach(number => {\n let canonicalNum =\n (number)\n .toString()\n .split('')\n .sort((a, b) => a - b )\n .join('');\n\n collection.push(\n {\n number: number,\n canonicalNum: Number(canonicalNum)\n }\n );\n });\n\n return collection;\n}", "title": "" }, { "docid": "1400c13813cd17f3856a30e03754d886", "score": "0.5431367", "text": "function numberOfSets(numberOfEntries){\n let sets = numberOfEntries / numberToShow;\n sets = Math.ceil(sets);\n return sets;\n}", "title": "" }, { "docid": "7f3971dc90218b0df8f2475ace0a8d1d", "score": "0.5424602", "text": "function solution(M, A) {\n // write your code in JavaScript (Node.js 8.9.4)\n let count = 0;\n let prevPos = new Array(M + 1).fill(-1);\n let start = 0;\n\n for (let i = 0; i < A.length; i++) {\n let val = A[i];\n if (prevPos[val] >= start) {\n start = prevPos[val] + 1;\n }\n prevPos[val] = i;\n count += i - start + 1;\n if (count > 1000000000) break;\n }\n\n return Math.min(count, 1000000000);\n}", "title": "" }, { "docid": "5a13d6f56330363437d86c29b6507507", "score": "0.5422646", "text": "function maxSequence(arr) {\n let seq = 1;\n let maxSeq = 1;\n let num = arr[0];\n arr.forEach((el, i) => {\n if (el === arr[i + 1]) {\n seq++;\n if (seq > maxSeq) {\n maxSeq = seq;\n num = el;\n }\n } else if (el !== arr[i + 1]) {\n seq = 1;\n }\n });\n const maxArr = Array(maxSeq);\n return maxArr.fill(num);\n}", "title": "" }, { "docid": "de98191dd02593cc0cf8b1467b07c1fa", "score": "0.5421716", "text": "function sockMerchant(n, ar) {\n const countsMap = ar.reduce((map, v) => {\n map[v] = map[v] === undefined ? 1 : map[v] + 1;\n return map;\n }, {});\n console.log('counts', countsMap);\n const counts = Object.values(countsMap);\n console.log(counts);\n const pairs = counts.reduce((pairs, count) => pairs + Math.floor(count / 2), 0);\n return pairs;\n}", "title": "" }, { "docid": "5e90c58d12c3344097e0b9f53410ceef", "score": "0.5418855", "text": "function candies(n, m) {\n return (Math.floor(m/n)*n)\n}", "title": "" }, { "docid": "458c35a7c5c455ed48763d4ae71f6759", "score": "0.54169244", "text": "nostrum(a) {\n strum[a - 1] = 1;\n }", "title": "" }, { "docid": "23dbd0ee983a7f7aabdadfae2610e6fe", "score": "0.54165876", "text": "function initNumberSet(N) {\n let array = [];\n for (let i = 1; i <= N * N; i++) {\n array.push(i);\n }\n\n let numberSet = [];\n let idx = 0;\n let toggle = true; // true -> go up\n for (let i = 0; i < N * 2 - 1; i++) {\n let set;\n if (i < N) {\n set = array.splice(0, ++idx);\n } else {\n set = array.splice(0, --idx);\n }\n\n /*\n when i == even number, go bottom at first\n when i == odd number, go right at first\n */\n if (i % 2 === 1) set.sort((a, b) => b - a); // order by DESC\n\n numberSet.push(set);\n }\n\n for (let i = 0; i < numberSet.length; i++) {\n console.log(JSON.stringify(numberSet[i]));\n }\n\n return numberSet;\n}", "title": "" }, { "docid": "509eacb257a733510533ad3b92f35548", "score": "0.5415041", "text": "random_unique_list(n, min, max){\n\t\tlet i = 0;\n\t\tlet uniqueList = new Array(n);\n\t\tlet uniqueVals = new Map();\n\t\twhile(i<n){\n\t\t\tlet randVal = this.rand_int(min, max);\n\t\t\tif(!uniqueVals.has(randVal)){\n\t\t\t\tuniqueVals.set(randVal, i);\n\t\t\t\tuniqueList[i] = randVal;\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn uniqueList;\n\t}", "title": "" }, { "docid": "86c4da47ea9fdd0d629fbd18a4deb0f5", "score": "0.54138464", "text": "multiplyArray(a){let count=1;for(let i=0;i<a.length;i++){count*=a[i];}return count}", "title": "" }, { "docid": "b3b3eeab85c6b26c2eee528c26aba8bd", "score": "0.54115075", "text": "function maker() {\n var numbers = [];\n for(var i =0; i <= 25; i++) {\n // Code here\n numbers.push(i);\n }\n return numbers;\n}", "title": "" }, { "docid": "ec86997ea3e219043dc6f64be246f9f7", "score": "0.54105264", "text": "function migratoryBirds(n, arr) {\n var countArr = []\n arr.map((bird) => {\n countArr[bird]\n ? countArr[bird]++\n : countArr[bird] = 1\n })\n\n var indexMax = 0\n var countMax = 0\n\n countArr.map((count, index) => {\n if (count>countMax) {\n indexMax = index\n countMax = count\n }\n })\n return indexMax\n}", "title": "" }, { "docid": "e2938fa9c70277a1ae5a317cf8a24bfe", "score": "0.54031456", "text": "static get MAX() {\n return 4;\n }", "title": "" }, { "docid": "0f0a55d504a0e16416873ae742833c2f", "score": "0.5403001", "text": "function numberOptionsMaker() {\n numberOptions = [];\n for (let i = 0; i < 4; i++) {\n number = Math.floor(Math.random() * (12-1) + 1);\n numberOptions.push(number);\n }\n return numberOptions;\n}", "title": "" }, { "docid": "89687441c05b5764b9f650ea9da7e853", "score": "0.5401117", "text": "sumMultiplies() {\r\n let multipliesOf3or5 = [];\r\n let totalSum = 0;\r\n for (let i = 1; i < 1000; i++) {\r\n if (i % 3 === 0 || i % 5 === 0) {\r\n totalSum += i;\r\n }\r\n }\r\n console.log(totalSum);\r\n }", "title": "" }, { "docid": "561824cca5f5df158b63b7b0bdcee153", "score": "0.5397938", "text": "function minimumAndMaximumIterate(numbers) {}", "title": "" }, { "docid": "6a3c7c28b675bea460dc093c58abe2d4", "score": "0.5394365", "text": "function createArrayNoDups(num){\r\n let result = []\r\n \r\n for(let i = 0; i < num; i++){\r\n result.push(i);\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "d166c55ef6a4fd4a248ead7491b41b27", "score": "0.5392512", "text": "function helper(n) {\n let result = [];\n\n}", "title": "" }, { "docid": "2475a549102d3eec091056c49cbf1ded", "score": "0.5389703", "text": "function count31() {\n var numbers = [];\n // Code Here\n for (var i = 0; i < 32; i++) {\n numbers.push(i);\n }\n return numbers;\n}", "title": "" }, { "docid": "c43adae91ae16d5178f4b7964b30d06c", "score": "0.5388596", "text": "function getYourIds() {\n for (i=0; i <= 5; i++) {\n let categoryId = Math.floor(1 + Math.random() * 2000);\n if(sixIds.includes(categoryId)) {\n i--;\n } else {\n sixIds.push(categoryId);\n }\n }\n return sixIds;\n}", "title": "" }, { "docid": "786ea580003ff4b5cb86ed54116f6f8c", "score": "0.5379677", "text": "function doubleton(num) {\n while (true) {\n num++;\n if (new Set(String(num)).size === 2)\n return num;\n }\n}", "title": "" }, { "docid": "39b5c3e403d34b77ff679aa107459f5d", "score": "0.5375814", "text": "function smallMultiples(n,k){\nif(Number.isNaN(k)){throw \"Invalid Input\";} \nif(typeof(n)!==\"number\"){throw \"Invalid Input\";}\nif(typeof(k)!==\"number\"){throw \"Invalid Input\";}\n\n\n\n\n\tvar apple = [];\n\tfor(var m = 2;k*m<=n;m++){\n\t\t\n\t\t\tapple.push(\"happy\");\n\t//\t\tif(m*k>=n){return apple;\n\t\t\n\t}\n\t{return apple.length;}\t\t \n\t//};\n\n\n}", "title": "" }, { "docid": "87d691650f61f21a58d7d9bdb68e3412", "score": "0.5372089", "text": "function randomArray(m,n,level){\n\tvar mine_num,\n\t\tsum,\n\t\ta = [],\n\t\tb = [],\n\t\tc = [],\n\t\ti,\n\t\tj;\n\tmine_num = level.mines;\n\tsum = m * n;\n\tfor(i=0;i<sum;i++){\n\t\ta[i] = i;\n\t\tc[i] = 0;\n\t}\n\tfor(j=0;j<mine_num;j++){\n\t\tb.push(a.splice(Math.floor(Math.random()*a.length),1));\n\t\tc[b[j]]=1;\n\t}\n\treturn c;\n}", "title": "" }, { "docid": "e46abfedeab4e69028364aa89a875e70", "score": "0.537083", "text": "function arrayManipulation(n, queries = [[]]) {\n const arr = '0'.repeat(n).split('').map(e => parseInt(e));\n let max = 0;\n let current = 0;\n\n queries.forEach(([a, b, k]) => {\n arr[a - 1] += k;\n if (b != n) arr[b] -= k;\n });\n\n arr.forEach(number => {\n current += number;\n\n if (max < current) max = current;\n })\n\n return max;\n}", "title": "" } ]
a0be672db7b04b229aec2acebe00ff12
Get the proper translation based on the following logic: try to find the text in the selected language OR try to find the text in the english language OR return the first translation available.
[ { "docid": "daa443d91bc13ed9175d6a6b840aa9cc", "score": "0.75378346", "text": "getTranslation(texts, exact) {\n if (texts === undefined || texts.length === 0) {\n return \"\";\n }\n \n const translationLanguage = texts.find(val => val.lang === this.state.lang);\n if (translationLanguage !== undefined\n && translationLanguage.description !== undefined\n && translationLanguage.description !== \"\") {\n return translationLanguage.description;\n } else {\n if (!exact) {\n const translationEnglish = texts.find(val => val.lang === MultiLingualText.ENGLISH_LANG);\n \n if (translationEnglish !== undefined\n && translationEnglish.description !== undefined\n && translationEnglish.description !== \"\") {\n return translationEnglish.description;\n }\n }\n }\n \n if (!exact) {\n return texts[0].description;\n } else {\n return \"\";\n }\n }", "title": "" } ]
[ { "docid": "9d185acce6ffbbedec871422977e36da", "score": "0.6662649", "text": "function getLanguage() {\r\n\t\t// first try to find the youtube language for best blending\r\n\t\tvar language=unsafeWindow.ytLocale;\r\n\t\tif(isDefined(language)) {\r\n\t\t\tlanguage = language.substr(0,2);\r\n\t\t\tif(isDefined(translation[language])) {\r\n\t\t\t\treturn language;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// next try the browser default language\r\n\t\tlanguage=String.substr(window.navigator.language,0,2);\r\n\t\tif(isDefined(language) && isDefined(translation[language])) {\r\n\t\t\treturn language;\r\n\t\t}\r\n\t\t\r\n\t\tif(isDefined(translation[defaultLanguage])) {\r\n\t\t\treturn defaultLanguage;\r\n\t\t}\r\n\t\t\r\n\t\t// punt! return the first language defined\r\n\t\tfor (var key in translation) {\r\n\t\t\treturn key;\r\n\t\t}\r\n\t\t\r\n\t}", "title": "" }, { "docid": "7c1a6b14def8236e960a79a371872deb", "score": "0.6615774", "text": "function gettext( text ){\n \n if (window.location.search==\"?lang=cy\"){\n\tif (en2cy.hasOwnProperty(text)){\n\t return en2cy[text];\n\t}\n }\n // return English text if no translation is available\n return text;\n}", "title": "" }, { "docid": "cec33a616056dc7a01454be6bff55b53", "score": "0.6540298", "text": "async function getTargetLang(msg) {\n var substring = msg.slice(0);\n var targetLanguage = null;\n while (substring.length > 0) {\n var openBrac = substring.indexOf('(');\n if (openBrac === -1) {\n break;\n }\n var closeBrac = substring.indexOf(')', openBrac);\n if (closeBrac === -1) {\n break;\n }\n var content = substring.slice(openBrac+1, closeBrac);\n console.log(content);\n if (content in supportedLang){\n targetLanguage = content;\n break;\n } else {\n substring = substring.slice(openBrac+1);\n }\n }\n if (targetLanguage == null) {\n try {\n let response = await translate.detect(msg);\n if (response[0].language === 'en') {\n return 'French';\n } else {\n return 'English';\n }\n } catch (error) {\n console.log('Error at detectLanguage --> ${error}');\n return 'English';\n }\n } else {\n return targetLanguage\n }\n}", "title": "" }, { "docid": "9d58901c10c79e2b88878638198b825c", "score": "0.65258986", "text": "getTranslation(text) {\n return this.translation[text];\n }", "title": "" }, { "docid": "71718e8742d776e9041c096e7fae2cb8", "score": "0.65051264", "text": "function getTranslation(lang) {\n const TRANSLATIONS = {\n en: {\n 'extension-title': 'Extension without Shell navigation',\n 'first-level-1-text': 'This is the page from the side navigation entry \"First Level 1\".',\n 'first-level-1-title': 'First Level 1',\n 'first-level-2-second-level-1-text': 'This is the page from the side navigation entry \"Second Level 1\".',\n 'first-level-2-second-level-1-title': 'Second Level 1',\n 'first-level-2-second-level-2-third-level-1-text': 'This is the page from the side navigation entry \"Third Level 1\".',\n 'first-level-2-second-level-2-third-level-1-title': 'Third Level 1',\n 'not-found-text': 'Page has not been found.',\n 'not-found-title': 'Not Found',\n 'side-first-level-1-title': 'First Level 1',\n 'side-first-level-2-title': 'First Level 2',\n 'side-first-level-2-side-second-level-1-title': 'Second Level 1',\n 'side-first-level-2-side-second-level-2-title': 'Second Level 2',\n 'side-first-level-2-side-second-level-2-side-third-level-1-title': 'Third Level 1',\n },\n de: {\n 'extension-title': 'Erweiterung ohne Shell Navigation',\n 'first-level-1-text': 'Das ist die Seite von dem Navigationseintrag \"Erstes Level 1\".',\n 'first-level-1-title': 'Erstes Level 1',\n 'first-level-2-second-level-1-text': 'Das ist die Seite von dem Navigationseintrag \"Zweites Level 1\".',\n 'first-level-2-second-level-1-title': 'Zweites Level 1',\n 'first-level-2-second-level-2-third-level-1-text': 'Das ist die Seite von dem Navigationseintrag \"Drittes Level 1\".',\n 'first-level-2-second-level-2-third-level-1-title': 'Dittes Level 1',\n 'not-found-text': 'Die Seite konnte nicht gefunden werden.',\n 'not-found-title': 'Nicht gefunden',\n 'side-first-level-1-title': 'Erstes Level 1',\n 'side-first-level-2-title': 'Erstes Level 2',\n 'side-first-level-2-side-second-level-1-title': 'Zweites Level 1',\n 'side-first-level-2-side-second-level-2-title': 'Zweites Level 2',\n 'side-first-level-2-side-second-level-2-side-third-level-1-title': 'Dittes Level 1'\n }\n }\n if (Object.keys(TRANSLATIONS).indexOf(lang) !== -1) {\n return TRANSLATIONS[lang];\n } else {\n return TRANSLATIONS[en];\n }\n}", "title": "" }, { "docid": "460881d267fce98775ca25e632fc47f5", "score": "0.6498974", "text": "getTextDependingOnLanguage(language) {\n\n switch (language) {\n case 'dutch':\n return 'Voorleggen'\n case 'russian':\n return 'Подтвердить'\n default:\n return 'Submit'\n }\n }", "title": "" }, { "docid": "5b6e30af1b5de356d721f9013bb29954", "score": "0.6492503", "text": "function returnLanguage() {\n var lang = document.location.href.split('/')[3];\n var uaText = {\n open: 'Читати далі',\n close: 'Згорнути'\n };\n var ruText = {\n open: 'Читать далее',\n close: 'Свернуть'\n };\n var enText = {\n open: 'Read more',\n close: 'Close'\n };\n if(lang=='ru') {\n return ruText;\n } else if(lang=='en') {\n return enText;\n } else {\n return uaText;\n }\n }", "title": "" }, { "docid": "6d40f5e3c2344c576ce53c4ae619ca04", "score": "0.634118", "text": "async getLanguage(id_project, language) {\n var that = this;\n var returnval = await that.getAll(id_project);\n winston.debug(\"getLanguage returnval: \",returnval);\n\n if (!returnval) {\n var retPiv = await that.fetchPivotDefault();\n winston.debug(\"retPiv\",retPiv);\n return retPiv;\n }\n\n var pickedLang = returnval.data.find(l => l.lang === language);\n\n winston.debug(\"getLanguage pickedLang\"+ language,pickedLang);\n\n if (pickedLang) {\n return pickedLang; \n } else {\n\n var defaultLang = returnval.data.find(l => l.default === true);\n\n if (defaultLang) {\n return defaultLang; \n }\n\n var pivotLang = returnval.data.find(l => l.lang === that.FALLBACK_LANGUAGE); // <-- NOT necessary but nice\n if (pivotLang) {\n return pivotLang; \n } else {\n var retPiv = await that.fetchPivotDefault();\n winston.debug(\"retPiv\",retPiv);\n return retPiv;\n }\n }\n \n }", "title": "" }, { "docid": "cc46ab67aed0fa6c2713b11173d05be4", "score": "0.6305667", "text": "function translate_l10n(i18n_text, lang) {\n retval = \"\"\n if (arguments.length < 2)\n lang = language\n if (lang in translations) {\n if (i18n_text in translations[lang]) {\n retval = translations[lang][i18n_text]\n } else {\n // It's tempting to use a <span class=\"l10n_error\"> here to flag the \n // text, but some text replacement happens in HTML <option> tags,\n // which do not allow child elements like <span>.\n retval = \"ERROR: '\" + lang + \"' translation not found for '\" + i18n_text + \"'\"\n }\n } else {\n retval = \"ERROR: Language '\" + lang + \"' not found in translations table\"\n }\n return retval\n}", "title": "" }, { "docid": "c21150a9bd5c4fb283d0f7b3ee87a71b", "score": "0.6290543", "text": "function selectLocale(wanted, available) {\n // Find exact match\n const exact = available.find((locale) => locale.name === wanted);\n if (exact != null) {\n return exact;\n }\n\n // Find language match otherwise\n const language = getLanguage(wanted);\n return available.find((locale) => getLanguage(locale.name) === language);\n}", "title": "" }, { "docid": "2fb661b2fe81910c271a9afad422a664", "score": "0.62632847", "text": "function getTranslation(value) {\n\t\t\tvar translation = value;\n\t\t\t\n\t\t\tif (typeof Strings !== 'undefined')\n\t\t\t{\n\t\t\t\ttranslation = Strings[value];\t\n\t\t\t}\n\t\t\t\n\t\t\treturn translation;\n\t\t}", "title": "" }, { "docid": "f9891160c3280d16fc1595c2ceab0e65", "score": "0.6227899", "text": "function translate(text){\n var result = text\n for(let key of Object.keys(dict1)){\n const def = dict1[key]\n result = replace_substrings(result, key, def)\n }\n if (result.includes(\"selection\")){\n let sel = Editor.get_javascript(true)\n if (sel == \"\") {\n out(\"There is no selection in the editor.\")\n speak(\"There is no selection in the editor.\")\n }\n else {\n result = replace_substrings(result, \"selection\", sel)\n }\n }\n return result\n}", "title": "" }, { "docid": "05187265b0d77bc830fbeb960f4b8fc1", "score": "0.61950594", "text": "function getLangString(curTransLang,curElement,curClass,curTransChunk,transChunksLen,j,curClassNum) {\r\n\t\r\n\tvar detectedLang = \"\";\r\n\r\n\t// if the current element does not need a language string appended, end function\r\n\tif(curClass[2] != true) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// if source language for current element has already been manually specified, set this as detected language\r\n\tif(curClass[1] != \"\") {\r\n\t\tdetectedLang = curClass[1];\r\n\t}\r\n\t// otherwise find out language based on the detected source languages for translated chunks in current element \r\n\telse {\r\n\t\tdetectedLang = findDetectedLang(curTransLang,curTransChunk,transChunksLen);\r\n\t}\r\n\r\n\t// if detected language is same as site language, there is no need to display language string, so end function\r\n\tif(detectedLang == GL_curLang){\r\n\t\t\treturn;\r\n\t}\r\n\r\n\tvar srcLangString = getFmtLangStr(detectedLang); // retrieve name of detected language as a formatted string \r\n\r\n\t// append language string to current element...\r\n\tcurElement.innerHTML += '<div style=\"color: green;\" id=\"mlt_srctxt' + j + '\">[<span class=\"mlt_langstring\" ' +\r\n\t'style=\"font-family: arial, sans-serif; font-size: 11px;\"><em>Automatic translation from ' + srcLangString + \r\n\t': ' + google.language.getBranding().innerHTML + '</em> - <a id=\"mlt_srctxtlnk' + j + '\" href=\"javascript:showSrcTxt(' + \r\n\tj + ',' + curClassNum + ',0)\">View Source Text [+]</a></span><span id=\"mlt_srctxtbracket' + j + '\">]</span></div>';\r\n}", "title": "" }, { "docid": "90a39efb1022e7acbace3da549ca60b0", "score": "0.6183158", "text": "async getLikelyLocaleForLanguage(language) {\n let lang = language.toLowerCase();\n if (!this.likelyLocaleTable) this.likelyLocaleTable = await this.buildLikelyLocaleTable();\n\n if (this.likelyLocaleTable[lang]) return this.likelyLocaleTable[lang];\n this.fallbackLocaleTable = this.fallbackLocaleTable || require('./fallback-locales');\n\n return this.fallbackLocaleTable[lang];\n }", "title": "" }, { "docid": "b53f8e7b713b4d61ef4df6c2d0622f38", "score": "0.61532485", "text": "function getTextFor(key) {\r\n\tif(langs[active_lang][key]) {\r\n\t\treturn langs[active_lang][key];\r\n\t} else if(langs['english'][key]) {\r\n\t\tconsole.log('[translation] Missing value for key: ' +key+' (lang:'+active_lang+')');\r\n\t\treturn langs['english'][key];\r\n\t} else {\r\n\t\tconsole.log('[translation] Missing value for key: ' +key+')');\r\n\t\treturn '{{text.'+key+'}}';\r\n\t}\r\n}", "title": "" }, { "docid": "6bfe41babafec43c45f4f1b36b535f5f", "score": "0.6140133", "text": "getBestLocale (obj) {\n const preferredLocale = this.$i18n.locale\n if (obj && obj[preferredLocale]) return obj[preferredLocale]\n else {\n // get the first available\n for (const lang in obj) {\n if (obj[lang]) return obj[lang]\n }\n }\n // default\n return 'Unknown'\n }", "title": "" }, { "docid": "66b0822497eaa11357a087467252348f", "score": "0.61308855", "text": "function translate(text) {\n if (lang == 'fa' || lang == null || dict == null)\n return text\n else {\n dic = dict[lang][text];\n if (dic == null) {\n return '! ' + text + ' !';\n }\n else\n return dic;\n }\n}", "title": "" }, { "docid": "98c3befe9c18f6f4890c78605f4d610a", "score": "0.61205554", "text": "function getCurrentLang() {\r\n return getSetting(\"lang\", _a[worldLetters] && worldLetters || \"en\");\r\n /*Return the \"lang\" setting, or else if there's a translation for the current world's code, return that, or else \"en\".*/\r\n}", "title": "" }, { "docid": "06a71c8e71ac7ec0f0d6e77015bd61f4", "score": "0.60914737", "text": "function getLocalizedString(id) {\n for (let language of locale.LANGUAGES) {\n if (this === language[locale.GLOBAL_ID]) {\n return getStringIfExists(language[id], id);\n }\n }\n\n return getStringIfExists(locale.DEFAULT_LANGUAGE[id], id);\n}", "title": "" }, { "docid": "18644e3e77cd570aa24fd9cd3ddd303f", "score": "0.6087041", "text": "function translate(id, culture) {\r\n var result = _.find(translationsArr, function(item) {\r\n return item.id === id;\r\n });\r\n if (typeof result !== 'undefined') {\r\n return result[culture];\r\n } \r\n return null;\r\n }", "title": "" }, { "docid": "54d4e8510217c9bfcfa59e60ab3bd2fc", "score": "0.60825783", "text": "static getTranslationFor(language) {\n return this._loadTranslations(language);\n }", "title": "" }, { "docid": "729f2cef39076b2c652b1da49ab450d2", "score": "0.60467994", "text": "function find_language() {\n let tag = [... document.getElementsByClassName(\"ant-select-selection-selected-value\")];\n if(tag && tag.length > 0)\n {\n for (let i = 0; i < tag.length; i++) {\n const elem = tag[i].textContent;\n if(elem != undefined && languages[elem] != undefined)\n {\n return languages[elem]; //should generate respective file extension\n }\n }\n return null;\n }\n}", "title": "" }, { "docid": "81f0403d0323ab3a97891c8b56ad0275", "score": "0.6016448", "text": "function getCurrentLanguage () {\n return $translate.use();\n }", "title": "" }, { "docid": "550d3ec3742e06be5e0fbb1b18e2cde2", "score": "0.5975204", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "1ba4a17b2ffe45a3ab8d15ba7974a60f", "score": "0.596732", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split, get = function(k) {\n if (!languages[k] && hasModule) {\n try {\n require(\"./lang/\" + k);\n } catch (e) {}\n }\n return languages[k];\n };\n if (!key) {\n return moment.fn._lang;\n }\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [ key ];\n }\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split(\"-\");\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split(\"-\") : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join(\"-\"));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "c95e0ff2961a6b25bb2df20cd2064447", "score": "0.59395856", "text": "function getDisplayLanguage(languages, items) {\n var itemLanguages = items.map(function(itm) {\n if (typeof itm === 'string') {\n return null;\n } else {\n return itm['@language'];\n }\n });\n\n var bestLanguageMatch = null;\n jQuery.each(languages, function(idx, lang) {\n if (bestLanguageMatch !== null) {\n return false;\n } else {\n if (itemLanguages.indexOf(lang) !== -1) {\n bestLanguageMatch = lang;\n }\n }\n });\n\n // Only pick the first available language if **all** property values\n // have an associated language\n if (bestLanguageMatch === null && itemLanguages.indexOf(null) === -1) {\n bestLanguageMatch = itemLanguages[0];\n }\n return bestLanguageMatch;\n }", "title": "" }, { "docid": "917099b035c509acfb52bb91acd08702", "score": "0.5933496", "text": "function findPreferedLanguage() {\n var candidates = ['de','en'];\n var langHash = findHashParameter('lang');\n if(langHash && candidates.includes(langHash)) {\n return langHash;\n }\n var langGet = findGetParameter('lang');\n if(langGet && candidates.includes(langGet)) {\n return langGet;\n }\n var langNavi = navigator.language || navigator.userLanguage;\n if(langNavi && candidates.includes(langNavi.substr(0,2))) {\n return langNavi.substr(0,2);\n }\n if(navigator.languages) {\n for(var j=0; j<navigator.languages.length; j++) {\n var langList = navigator.languages[j].substr(0,2);\n if(langList && candidates.includes(langList)) {\n return langList;\n }\n }\n } \n return candidates[0];\n}", "title": "" }, { "docid": "697d1b5c6a4eed89964f0a41097e4557", "score": "0.5916588", "text": "function determineLanguage() {\n var newL;\n if ((newL = Cookie.getCookie(\"lang\" + window.location.search)) != null) { // some already set language\n lang = newL;\n prepareData();\n return;\n } \n\n // fallback if no language specified in older json versions\n if (json_obj.languages == null) {\n lang = \"cs\"; // change to en eventually - when migrated\n return;\n }\n\n // else see if some enabled language is preferred on the system\n var preferredLanguage = window.navigator.userLanguage || window.navigator.language;\n preferredLanguage = preferredLanguage.split(\"-\")[0]; // to get rid of en-AU en-US etc\n if (json_obj.languages[preferredLanguage] != \"\" && json_obj.languages[preferredLanguage] != null) { // TODO -- not sure about the null checks\n lang = preferredLanguage;\n prepareData();\n return;\n }\n // if not, just pick first enabled language\n for (l of supportedLanguages) {\n if (json_obj.languages[l] != null && json_obj.languages[l] != \"\") { // TODO\n lang = l;\n prepareData();\n return;\n }\n }\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.59067106", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "508d7d3bf14844bbdc6664f91b243be2", "score": "0.59021854", "text": "function _(translateID){\r\n return (typeof _a[getCurrentLang()] !== \"undefined\" && _a[getCurrentLang()][translateID]) || translateID;\r\n /*If there are translations for the current language, and there exists a translation for this thing, use that. Else, return the translation's ID.*/\r\n}", "title": "" }, { "docid": "8dcf32f5133031f51f6332328c7f9aa0", "score": "0.58951753", "text": "function getLangDefinition(key) {\n var i = 0,\n j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) {\n }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "794d2b2b86f2c6a5469f9661e294faf6", "score": "0.5891363", "text": "function translate() {\n\tlang = get_language();\n\t$.getJSON(\"https://raw.githubusercontent.com/ekling/dutchman/master/language_strings.json\", function( json ) {\n\t\tlangdict = json[lang];\n lang == \"en\" ? $('#cartUndo').css('margin-top', '37px') : $('#cartUndo').css('margin-top', '2px');\n lang == \"en\" ? sessionStorage.lang = \"en\" : sessionStorage.lang = \"sv\";\n\n\t\t$('*').each(function() {\n\t\t \tif ($(this).attr('data-text')) {\n\n\t\t \t\ttext = $(this).attr('data-text')\n\t\t \t\ttranslated_text = langdict[text];\n\n\t\t \t\tif ($(this).attr(\"value\")) {\n\t\t \t\t\t//Case for buttons etc, where the translated\n\t\t \t\t\t//text resides inside the value attribute\n\t\t \t\t\t$(this).val(translated_text);\n\t\t \t\t} else {\n\t\t \t\t\t$(this).text(translated_text);\n\t\t \t\t}\n\n\t\t \t}\n\t\t })\n\t });\n}", "title": "" }, { "docid": "0aa81ed1db9fe2822f08355a68aeade4", "score": "0.5887501", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "0aa81ed1db9fe2822f08355a68aeade4", "score": "0.5887501", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "0aa81ed1db9fe2822f08355a68aeade4", "score": "0.5887501", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "0aa81ed1db9fe2822f08355a68aeade4", "score": "0.5887501", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "0aa81ed1db9fe2822f08355a68aeade4", "score": "0.5887501", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "0aa81ed1db9fe2822f08355a68aeade4", "score": "0.5887501", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.5884161", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "e870385a50451a8af8251460433c2cd5", "score": "0.5867724", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "title": "" }, { "docid": "e870385a50451a8af8251460433c2cd5", "score": "0.5867724", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "title": "" }, { "docid": "d064b21c149cbdf0fd80edbde6e9d87c", "score": "0.5865524", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "title": "" }, { "docid": "9cacd4df4064857221d65e2a78c7dce1", "score": "0.5856506", "text": "function getLangDefinition(key) {\r\n var i = 0, j, lang, next, split,\r\n get = function (k) {\r\n if (!languages[k] && hasModule) {\r\n try {\r\n require('./lang/' + k);\r\n } catch (e) { }\r\n }\r\n return languages[k];\r\n };\r\n\r\n if (!key) {\r\n return moment.fn._lang;\r\n }\r\n\r\n if (!isArray(key)) {\r\n //short-circuit everything else\r\n lang = get(key);\r\n if (lang) {\r\n return lang;\r\n }\r\n key = [key];\r\n }\r\n\r\n //pick the language from the array\r\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\r\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\r\n while (i < key.length) {\r\n split = normalizeLanguage(key[i]).split('-');\r\n j = split.length;\r\n next = normalizeLanguage(key[i + 1]);\r\n next = next ? next.split('-') : null;\r\n while (j > 0) {\r\n lang = get(split.slice(0, j).join('-'));\r\n if (lang) {\r\n return lang;\r\n }\r\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\r\n //the next array item is better than a shallower substring of this one\r\n break;\r\n }\r\n j--;\r\n }\r\n i++;\r\n }\r\n return moment.fn._lang;\r\n }", "title": "" }, { "docid": "f085d5a9790208b5e0f6720beab7a6e8", "score": "0.5849155", "text": "function chooseLocale(names) {\n\t var i = 0,\n\t j,\n\t next,\n\t locale,\n\t split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "c66345b311d928ed78ebc860925be962", "score": "0.5847896", "text": "function translateWord(word, upper, language){\n\tword=word.toLowerCase();\n\t\n\tvar translation=word;\n\t\n\tif(language==\"es\"){\n\t\tif(words[word]!=null){\n\t\t\ttranslation=words[word];\n\t\t}\n\t}\n\telse{\n\t\tfor(w in words)\n\t\t{\n\t\t\tif(words[w]==word){\n\t\t\t\ttranslation=w;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif(upper!=''){\n\t\tif(upper=='ucfirst'){\n\t\t\treturn ucfirst(translation);\n\t\t}\n\t\telse{\n\t\t\treturn translation.toUpperCase();\n\t\t}\n\t}\n\telse{\n\t\treturn translation;\n\t}\n}", "title": "" }, { "docid": "29c361992d2bb7ba314d2c5dc852c928", "score": "0.5847266", "text": "function chooseLocale(names) {\n\t var i = 0,\n\t j,\n\t next,\n\t locale,\n\t split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "29c361992d2bb7ba314d2c5dc852c928", "score": "0.5847266", "text": "function chooseLocale(names) {\n\t var i = 0,\n\t j,\n\t next,\n\t locale,\n\t split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "a6f2185d8582d19651eb3d53f81003b3", "score": "0.5834361", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\r\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "title": "" }, { "docid": "ab0c8943229268b7fbed974d4e237055", "score": "0.58265746", "text": "translate(lang, path, data = {}) {\n let language = this.storage.get(lang);\n if (!language) {\n language = this.storage.get(this.fallbackLang);\n if (!language)\n throw new errors_1.IllegalArgumentError(`Language ${lang} does not exist.`);\n }\n return language.translate(path, data);\n }", "title": "" }, { "docid": "4b5b1efcf46bd8bdbe2cc14be1e54b75", "score": "0.58183485", "text": "findLanguage(resource) {\n const ext = paths_1.Paths.extname(resource.path) || resource.path;\n const language = language_1.LANGUAGES.find(item => item.extension === ext);\n return !!language ? language.id : '';\n }", "title": "" }, { "docid": "a2859a447bfc734b3471ec15a80e23ad", "score": "0.5802881", "text": "function getPopupText(lang){\n\t\t//console.log('getPopupText ' + lang);\n\t\treturn translations[lang];\n\t}", "title": "" }, { "docid": "8fc54af75710ef9e37c692eff36858bd", "score": "0.5802295", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t}", "title": "" }, { "docid": "171e0d6748c21cf577940facd59b38a9", "score": "0.5801883", "text": "function chooseLocale(names) {\n\t\t var i = 0, j, next, locale, split;\n\n\t\t while (i < names.length) {\n\t\t split = normalizeLocale(names[i]).split('-');\n\t\t j = split.length;\n\t\t next = normalizeLocale(names[i + 1]);\n\t\t next = next ? next.split('-') : null;\n\t\t while (j > 0) {\n\t\t locale = loadLocale(split.slice(0, j).join('-'));\n\t\t if (locale) {\n\t\t return locale;\n\t\t }\n\t\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t\t //the next array item is better than a shallower substring of this one\n\t\t break;\n\t\t }\n\t\t j--;\n\t\t }\n\t\t i++;\n\t\t }\n\t\t return null;\n\t\t }", "title": "" }, { "docid": "1b4371ca298d5b2a655ab2efa4696290", "score": "0.58015805", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n \n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "727712cdd8eb7f4209f807b2d240dc03", "score": "0.57903135", "text": "function chooseLocale(names) {\n\t var i = 0,\n\t j,\n\t next,\n\t locale,\n\t split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (\n\t next &&\n\t next.length >= j &&\n\t commonPrefix(split, next) >= j - 1\n\t ) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "title": "" }, { "docid": "8a5eb6b257bd0282eb205efd3960e8f3", "score": "0.57893443", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "ad8b39f2f527227954ebdaee03712e76", "score": "0.5788992", "text": "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "title": "" }, { "docid": "ad8b39f2f527227954ebdaee03712e76", "score": "0.5788992", "text": "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "title": "" }, { "docid": "ce5a4ef87aa707647c8af6fcbfd8ac11", "score": "0.5784053", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "ce5a4ef87aa707647c8af6fcbfd8ac11", "score": "0.5784053", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "825701d9c68a07cc86635d0bccfd9b84", "score": "0.5783661", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "825701d9c68a07cc86635d0bccfd9b84", "score": "0.5783661", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "825701d9c68a07cc86635d0bccfd9b84", "score": "0.5783661", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "825701d9c68a07cc86635d0bccfd9b84", "score": "0.5783661", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "825701d9c68a07cc86635d0bccfd9b84", "score": "0.5783661", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "825701d9c68a07cc86635d0bccfd9b84", "score": "0.5783661", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "3762487d36f597fa2e15c7068e9e6c1f", "score": "0.5781096", "text": "function detectUserLang(){\r\n\t/* detect user's current language (if they are using IE this will be based on the regional settings on their system; \r\n\t otherwise it will be based on the default language of their current browser) */\r\n\tvar detectedLang = (navigator.language) ? navigator.language : navigator.userLanguage;\r\n\t\r\n\t// if language cannot be detected for some reason, end function.\r\n\tif((typeof detectedLang == \"undefined\") || (detectedLang == \"\")) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t// if language is regional dialect (e.g. \"en-gb\"), check last 2 letters are upper case - for google compatibility.\r\n\tif(detectedLang.length == 5) {\r\n\t\tdetectedLang = detectedLang.substr(0,3) + detectedLang.substr(3).toUpperCase();\r\n\t}\r\n\t\r\n\t// check that Google can translate content into detected language\r\n\tif (!google.language.isTranslatable(detectedLang)) {\r\n\t\t// if not, check if language is a regional dialect (e.g. \"en-GB\")\r\n\t\tif(detectedLang.length == 5) {\r\n\t\t\t// if so, Google may still be able to translate into a non-regional equivalent (e.g. \"en\")\r\n\t\t\tdetectedLang = detectedLang.substr(0,2);\r\n\t\t\tif (!google.language.isTranslatable(detectedLang)) {\r\n\t\t\t\treturn; // google cannot translate into non-regional equivalent, so end function\r\n\t\t\t}\r\n\t\t// language is not a regional dialect, and google cannot translate into it, so end function\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar detectedLangStr = getFmtLangStr(detectedLang); // retrieve name of detected language as a formatted string\r\n\t\r\n\t// display message asking user if they want to translate current page into detected language\r\n\tdocument.getElementById(\"mlt_translatemsg\").innerHTML = 'Translate this page into ' + detectedLangStr + '? ' +\r\n\t'<a href=\"javascript:changeLang(\\'' + detectedLang + '\\')\">Yes</a> | <a href=\"javascript:changeLang(\\'orig\\')\">No</a>';\r\n\tminiTranslate(document.getElementById(\"mlt_translatemsg\"),detectedLang); // translate question into detected language\r\n\tdocument.getElementById(\"mlt_translatemsg\").style.display='block'; // show the question on screen\r\n}", "title": "" }, { "docid": "2b5b0149a207e324f083cceb7e416f6a", "score": "0.57785606", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "5e4bd350524d3022a92a43d636753fea", "score": "0.57779217", "text": "async function getTranslate(){\n const transApiKey = getKeys().transApiKey; \n const dictApiKey = getKeys().dictApiKey;\n let text = getText();\n let lang = `${document.getElementsByClassName('languageChoose__lang')[0].getAttribute('ui')}-${document.getElementsByClassName('languageChoose__lang')[1].getAttribute('ui')}`;\n try{ \n addLoading();\n drawLoading();\n if(itsOneWord(text)){\n let response = await fetch(`${urlDict}lookup?key=${dictApiKey}&lang=${lang}&text=${text}&ui=ru`);\n let answer = await response.json();\n console.log(answer);\n delLoading();\n if(response.status == 400){\n throw new Error(`${answer.message}`);\n }\n dictionaryResultRender(answer);\n }else{\n let response = await fetch(`${urlTrans}translate?key=${transApiKey}&lang=${lang}&text=${text}`);\n let answer = await response.json();\n console.log(answer);\n delLoading();\n if(response.status == 400){\n throw new Error(`${answer.message}`);\n }\n translateRresultRender(answer);\n }\n }catch(e){\n console.log(e);\n showAlert(`${e}`); \n }\n}", "title": "" }, { "docid": "3795444bac2a44ad8169657a995045a1", "score": "0.5777409", "text": "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "title": "" }, { "docid": "51ccdfc1480c0a1a0d06430cb18d228f", "score": "0.57755035", "text": "function chooseLocale(names) {\n var i = 0,\n j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "dd07e8dbc3487c0ee8884a42ef88c1d3", "score": "0.5774124", "text": "function globalization_preferred_language_cb(lang_code) {\n console.log(\"lang_code = \" + lang_code);\n lang = 'English';\n if (lang_code in language_from_code)\n lang = language_from_code[lang_code];\n\n var ajax_request = {\n dataType: \"json\",\n url: \"js/translations.json\",\n data: {},\n success: load_translations_success_cb,\n error: load_translations_error_cb\n }\n var o = $.ajax(ajax_request)\n set_default_language(lang)\n\n // if translations are loaded, use them\n if (language !== null && 'English' in translations) {\n translate_spans()\n }\n}", "title": "" }, { "docid": "0ed870ee1e703ae1c0d17d477ec8ac4b", "score": "0.577412", "text": "function handleTranslate() {\n var editor = EditorManager.getFocusedEditor();\n\n if (!editor) {\n return;\n }\n\n var pos = editor.getCursorPos(),\n doc = editor.document,\n originalFileEntry = doc.file,\n filename = originalFileEntry.name,\n is_smarty = filename.match(/\\.tpl$/),\n text = '';\n\n\n var range = {\n 'start': {\n line: pos.line,\n ch: pos.ch\n },\n 'end': {\n line: pos.line,\n ch: pos.ch\n }\n }\n var key;\n if (is_smarty) {\n //Left\n do {\n range.start.ch--;\n text = doc.getRange(range.start, range.end);\n } while (range.start.ch > 0 && text.charAt(0) != '{');\n if (text.charAt(0) != '{') {\n return;\n }\n //Right\n do {\n range.end.ch++;\n text = doc.getRange(range.start, range.end);\n } while (/*Have we reached the end*/text.length == range.end.ch - range.start.ch && text.charAt(text.length - 1) != '}');\n\n if (text.charAt(text.length - 1) != '}') {\n return;\n }\n var res;\n if (!(res = text.match(/^\\{l\\s+(?:\"|')(.*)(?:\"|')\\s*\\}$/))) {\n return;\n }\n key = res[1];\n } else {\n range.start.ch -= 4;\n //Left\n do {\n range.start.ch--;\n text = doc.getRange(range.start, range.end);\n } while (range.start.ch > 0 && text.substr(0, 5) != 'lang(');\n if (text.substr(0, 5) != 'lang(') {\n return;\n }\n //Right\n do {\n range.end.ch++;\n text = doc.getRange(range.start, range.end);\n } while (range.end.ch < 100 && text.charAt(text.length - 1) != ')');\n\n if (text.charAt(text.length - 1) != ')') {\n return;\n }\n var res;\n if (!(res = text.match(/^lang\\(\\s*(?:\"|')(.*)(?:\"|')\\s*\\)$/))) {\n return;\n }\n key = res[1];\n }\n translateKey(key);\n }", "title": "" }, { "docid": "f01136d1111c2f98dcf0689c76583551", "score": "0.5767", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f01136d1111c2f98dcf0689c76583551", "score": "0.5767", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f01136d1111c2f98dcf0689c76583551", "score": "0.5767", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f01136d1111c2f98dcf0689c76583551", "score": "0.5767", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f01136d1111c2f98dcf0689c76583551", "score": "0.5767", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f01136d1111c2f98dcf0689c76583551", "score": "0.5767", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "aacf5b38743fc97ca47b2927f04b65c7", "score": "0.5765149", "text": "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "title": "" }, { "docid": "aacf5b38743fc97ca47b2927f04b65c7", "score": "0.5765149", "text": "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "title": "" }, { "docid": "24a59c45300e67b6c8d654526f3419ad", "score": "0.5759242", "text": "function lm(m) {\n for ( var i = 0 ; i < LANGUAGE.length ; i++ )\n if ( m.hasOwnProperty(LANGUAGE[i]) )\n return m[LANGUAGE[i]];\n\n console.log('No language match for: ', m);\n}", "title": "" }, { "docid": "37dd416755c4006f1b9531bb4c6b7a1a", "score": "0.57551885", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" } ]
a90934338f851098fa97d52c5767bce1
This function generates a random quote from the array in quotes.js
[ { "docid": "50fa860d941320e0c97b93b0e7537718", "score": "0.83228236", "text": "function getRandomQuote() {\n\t//generate random number to to used as index of the objet in quotes array.\n\tlet randonNumber = Math.floor(Math.random() * quotes.length);\n\treturn quotes[randonNumber];\n}", "title": "" } ]
[ { "docid": "6b89d8d75cb4daa3f4dab65ac9058f43", "score": "0.87529826", "text": "function getRandomQuote(array){\n var number = Math.floor(Math.random() * array.length);\n quote = quotes[number];\n return quote;\n}", "title": "" }, { "docid": "14670f0468e0b1d6e46a25d5ad15671a", "score": "0.8747614", "text": "function getRandomQuote(quotes_array){\n return quotes_array[Math.floor(Math.random() * quotes_array.length)];\n}", "title": "" }, { "docid": "7a3d3f021cb909ddcc9b664eb95774af", "score": "0.8687153", "text": "function getRandomQuote(array)\n{\n let randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "0f6098e6391f6765caa9731a445c2605", "score": "0.86444867", "text": "function getRandomQuote(array) {\n\tlet randomQuote = array[Math.floor(Math.random() * quotes.length )];\n\treturn randomQuote;\n}", "title": "" }, { "docid": "30925a5093459cf624e343d62185d155", "score": "0.85569024", "text": "function getRandomQuote (array){\n let numb = quotes[Math.floor(Math.random() * quotes.length)];\n return numb;\n}", "title": "" }, { "docid": "86a7930f118f67429477e789fed00a98", "score": "0.84983796", "text": "function getRandomQuote() {//the getRandomQuote function will take for the array of objects and apply it to a random number based on the legth of the array\r\n var randomNum = Math.floor( Math.random() * quotes.length);\r\n var randomQuote = quotes[randomNum]; \r\n \r\n return randomQuote;\r\n}", "title": "" }, { "docid": "9bb3f93a9446688dda2a13441e095d0e", "score": "0.8472385", "text": "function getRandomQuote() {\n //uses the Math library to call a random number between 0 and length of the array\n randomNumber = Math.floor(Math.random() * quotes.length);\n\n //returns the random quote by using the random number as the index value to call within the array\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "92ae35e65e78673e7c3ddf92f2c1b6af", "score": "0.84402525", "text": "function getRandomQuote(array) {\n let randomNum = Math.floor(Math.random() * array.length);\n let randomQuote = array[randomNum];\n return randomQuote;\n}", "title": "" }, { "docid": "efe8b74dcf3fe7a03782dbb8553c937e", "score": "0.8435179", "text": "function getRandomQuote(arr){\n let randomNumber = Math.floor(Math.random() * arr.length)+1;\n quote = inputArray[randomNumer]\n return quote\n}", "title": "" }, { "docid": "2ab231b0312f866521bae0e9c478ca06", "score": "0.8431629", "text": "function getRandomQuote(arr){ \n const randomNumber = Math.floor(Math.random() * (arr.length-1))+1;\n const randomQuote = arr[randomNumber];\n return randomQuote;\n}", "title": "" }, { "docid": "0ca2eda95d32237ccf95c611c4b79ca8", "score": "0.84249413", "text": "function getRandomQuote()\n{\n //Generates a random number and pick up a quote from the array\n var index = Math.floor(Math.random() * quotes.length);\n return quotes[index];\n}", "title": "" }, { "docid": "708148748a11c89d37caf47c53e82790", "score": "0.8385213", "text": "function getRandomQuote(array){\n // this generates random number index\n var quote_position = Math.floor(Math.random() * quotes.length);\n\n // loops through the array of quotes with the set index from the random number\n for(var i = 0; i < array.length; i += 1){\n var random_quote = array[quote_position];\n }\n return random_quote;\n}", "title": "" }, { "docid": "459954796a6b56029a93667776e2e0e1", "score": "0.83672273", "text": "function getRandomQuote(array) {\n var quoteIndex = Math.floor(Math.random() * (quotes.length));\n var randomQuote = array[quoteIndex];\n return randomQuote;\n}", "title": "" }, { "docid": "63c541b506f624d80a919e52ff09e474", "score": "0.83644396", "text": "function getRandomQuote(arr) {\n let randNum = Math.floor(Math.random() * ( arr.length ));\n let randQuote = arr[randNum];\n return randQuote;\n}", "title": "" }, { "docid": "36eb69382a2dbcfb1b164a547d17ed61", "score": "0.83561194", "text": "function getRandomQuote() {\n\tvar randomNumber = Math.floor(Math.random() * quoteArray.length);\n\treturn quoteArray[randomNumber];\n}", "title": "" }, { "docid": "2002cdae21ca0248e1886dddc738f312", "score": "0.8350407", "text": "function getRandomQuote(array) {\n var randomNumber = Math.floor(Math.random() * array.length);\n return array[randomNumber];\n}", "title": "" }, { "docid": "bd1f2eb1e0b0549d3193e85506418579", "score": "0.8348451", "text": "function getRandomQuote(){\n\n // 1. Start by using the Math.random() method to multiply by the length of the array\n // 2. To make sure that the number chosen by the is an integer and is rounded down, Math.floor() is used\n let generatedQuote = Math.floor(Math.random() * quotes.length)\n\n // The generatedQuote variable is then used to access the index of the quotes array via bracket notation\n let newRandomQuote = quotes[generatedQuote]\n\n return newRandomQuote\n \n}", "title": "" }, { "docid": "4acadd97a9c2aef4bad877bacfabcd78", "score": "0.8346681", "text": "function getRandomQuote( array ){\n var numberOfQuotes = array.length;\n var randomNumber = Math.floor(Math.random() * (numberOfQuotes));\n for(var i = 0; i < numberOfQuotes; i++){\n var randomQuote = array[randomNumber];\n } \nreturn randomQuote;\n}", "title": "" }, { "docid": "804eec6e55c84f95cc24ff420adadf61", "score": "0.8340479", "text": "function getRandomQuote(arr){\n let randomIndex = Math.floor(Math.random() * (arr.length));\n return arr[randomIndex];\n}", "title": "" }, { "docid": "f3e17ede360682ae573265134e293659", "score": "0.8332724", "text": "function getRandomQuote(quotesArray) {\n var random = Math.floor(Math.random() * quotesArray.length);\n return quotesArray[random];\n}", "title": "" }, { "docid": "7aa0d67e81639d931cea59a5fe232c36", "score": "0.83235854", "text": "function getRandomQuote(arr) {\n const randomNumber = Math.floor(Math.random() * arr.length)\n return arr[randomNumber];\n}", "title": "" }, { "docid": "5a621bd6d6cd6cd8d4dad4bac477a3cd", "score": "0.831957", "text": "function getRandomQuote(quotes){\n let total= Math.floor(Math.random() * quotes.length);\n return quotes[total];\n}", "title": "" }, { "docid": "db48382ba95f636712faeabb74b48537", "score": "0.8315383", "text": "function quote_generator() {\n const quote_lib = [\n 'Q',\n 'WWG1WGA',\n 'Pay Attention',\n 'Degenerates, Degenerate ~ Eddie Day',\n 'Happy wife, Happy life ~ Eddie Day',\n 'Recognize Abstract Patterns',\n 'When does a sheep dog bark?',\n 'All we Do is Pattern Match',\n 'The World is about to change',\n 'I AM',\n];\n let _rndQuoteIndex = function () {\n return (Math.random() * ((quote_lib.length - 1) - 0) + 0).toFixed(0);\n }\n return quote_lib[_rndQuoteIndex()];\n}", "title": "" }, { "docid": "6af3d872bdd1cbb7900ca455798ed52f", "score": "0.83147115", "text": "function getRandomQuote(arr) {\n\tlet randomNumber = Math.floor(Math.random() * arr.length);\n \treturn arr[randomNumber];\n}", "title": "" }, { "docid": "f47628534f6c13382e10332dbd1e6dcd", "score": "0.830578", "text": "function getRandomQuote(array) {\n let quoteNumber = Math.floor(Math.random() * quotes.length); //generates number between 0 to last index number\n return randomQuote = array[quoteNumber]; //return the random item \n\n}", "title": "" }, { "docid": "61feaaef8105eb4f0bcbc90a52b8fed9", "score": "0.8287375", "text": "function getRandomQuote(arr) {\n var randomNumber = Math.floor(Math.random() * arr.length);\n return arr[randomNumber];\n}", "title": "" }, { "docid": "b9a9c21060f2baffc843ef1bb04684a9", "score": "0.8281246", "text": "function getRandomQuote(){\n\nconst randNum = Math.floor(Math.random()*quotes.length);\nreturn quotes[randNum];\n\n}", "title": "" }, { "docid": "256fdee22120b855eb3e74690496c3bf", "score": "0.8277163", "text": "function getRandomQuote() {\n let randomNumber = Math.floor(Math.random() * quotes.length);\n let randomQuotes = quotes[randomNumber]\n return randomQuotes;\n }", "title": "" }, { "docid": "3ea5f44bd28d5fda9c02ceec0eabe67f", "score": "0.8275665", "text": "function getRandomQuote() {\n return quotes[Math.floor(Math.random() * quotes.length)];\n}", "title": "" }, { "docid": "3ea5f44bd28d5fda9c02ceec0eabe67f", "score": "0.8275665", "text": "function getRandomQuote() {\n return quotes[Math.floor(Math.random() * quotes.length)];\n}", "title": "" }, { "docid": "331267f189584226c378cd14d22e4ff4", "score": "0.82735634", "text": "function getRandomQuote() {\n a = Math.floor(Math.random() * quotes.length);\n return quotes[a];\n}", "title": "" }, { "docid": "590c913bb119babd04779a3ae664375d", "score": "0.8267666", "text": "function getRandomQuote() {\n let randomNum = Math.floor (Math.random()*quotes.length);\n return quotes[randomNum];\n }", "title": "" }, { "docid": "a213e365c3d008083ecb9ca22246d122", "score": "0.8255567", "text": "function getRandomQuote() {\n let i = Math.floor(Math.random() * quotes.length);\n return quotes[i];\n }", "title": "" }, { "docid": "0814f97f27b29353f3349791a1840ec0", "score": "0.82481635", "text": "function getRandomQuote() {\n //work out how many quotes there are\n let max = quotes.length - 1;\n //generate a random number between 0 and total number of quotes less 1\n let randomNum = Math.round(Math.random()*max);\n //locate quote from array and return it.\n return quotes[randomNum];\n}", "title": "" }, { "docid": "0ace99b26e17896a6578807fee743a66", "score": "0.8239736", "text": "function getRandomQuote() { \n var i = Math.floor(Math.random() * quotes.length) ;\n return quotes[i];\n }", "title": "" }, { "docid": "cd81c95ddae46816aac4f680f7b64608", "score": "0.82368064", "text": "function getRandomQuote () {\n return quotes[Math.floor(Math.random()*quotes.length)];\n}", "title": "" }, { "docid": "e03051aba61a24b2bfb9198f994a6e62", "score": "0.82261974", "text": "function getRandomQuote() {\nvar randomNumber = Math.floor(Math.random()* (quotes.length));\nreturn quotes [randomNumber];\n}", "title": "" }, { "docid": "8516e9b97da12240afd88fb9623c0d57", "score": "0.82105523", "text": "function getRandomQuote() {\n let randomNumber = Math.floor(Math.random() * Math.floor(quotes.length));\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "afa750eb2982265a5e1d20c4ba806220", "score": "0.82099795", "text": "function getRandomQuote(){\n var randomNumber = Math.floor(Math.random()* quotes.length);\n return quotes[randomNumber];\n }", "title": "" }, { "docid": "1fb9c6518c142280c952af83fb30f063", "score": "0.8208811", "text": "function getRandomQuote(){\n randomQuote = quotes[Math.floor(Math.random() * Math.floor(quotes.length))];\n}", "title": "" }, { "docid": "47b4c1e256bfb49da39690045af1583d", "score": "0.8184519", "text": "function getRandomQuote() {\r\n let randomNumber = Math.floor(Math.random() * quotes.length);\r\n return quotes[randomNumber];\r\n}", "title": "" }, { "docid": "46c05e956092b22611470380bf68ccf7", "score": "0.8176167", "text": "function getRandomQuote() {\n\n let randomNum = Math.floor(Math.random() * (quotes.length));\n\n let randomQuote = quotes[randomNum];\n\n return randomQuote;\n}", "title": "" }, { "docid": "c703f75a01d540388759ad8274729eac", "score": "0.8163646", "text": "function getRandomQuote(){\n const randomIndex = Math.floor(Math.random() * quotes.length)\n const randomQuote = quotes[randomIndex]\n\n return randomQuote\n\n}", "title": "" }, { "docid": "945d9ece616711692abda87ab8d02e9d", "score": "0.8163295", "text": "function getRandomQuote() {\n return quotes[Math.floor(Math.random() * 7)];\n}", "title": "" }, { "docid": "55935865abdefd61f7f044008fb0a9d3", "score": "0.8160132", "text": "function getRandomQuote() {\n // store the length of the quotes array\n let upper = quotes.length;\n // create a random number from 0 to the upper\n let randomNumber = Math.floor(Math.random() * upper);\n // randomly access an object at index based on the value of randomNumber\n let quote = quotes[randomNumber];\n // return a random quote object\n return quote;\n}", "title": "" }, { "docid": "20c821ae5c3e4260fac832a73375f73f", "score": "0.8158222", "text": "function getRandomQuote() {\n\n // refill the array if needed\n if (!uniqueRandoms.length) {\n for (var i = 0; i < quotes.length; i++) {\n uniqueRandoms.push(i);\n }\n }\n var index = Math.floor(Math.random() * uniqueRandoms.length);\n var finalRandom = uniqueRandoms[index];\n\n // remove that value from the array to avoid any duplicate numbers\n uniqueRandoms.splice(index, 1);\n\n return quotes[finalRandom];\n}", "title": "" }, { "docid": "e14f2d7e0a6298f2c209b8ca26ddba4e", "score": "0.8158147", "text": "function getRandomQuote() {\n var randNum = Math.floor(Math.random() * 10)\n var quoteOb = quotes[randNum]\n return quoteOb\n}", "title": "" }, { "docid": "39a75e4190241d0fc35440e2bb58cda2", "score": "0.81461453", "text": "function getRandomQuote(){\n //gets random number and uses it to return a random quote at that index.\n let random = Math.floor(Math.random() * quotes.length);\n return quotes[random];\n }", "title": "" }, { "docid": "87e17abd4d5c5cdb4c07fc2ee27ca7cb", "score": "0.81459475", "text": "function getRandomQuote(){\n\n\tlet randomNumber = Math.floor( Math.random() * (quotes.length ) );\n\treturn quotes[randomNumber];\n\n}", "title": "" }, { "docid": "4ac783d22e276ebdf3a1e6a21570a11b", "score": "0.8145895", "text": "function getRandomQuote() {\n randomQuote = quotes[Math.floor(Math.random() * quotes.length)];\n return randomQuote;\n}", "title": "" }, { "docid": "eb0878ac14e303d4eecb06fa15fc30b0", "score": "0.8140748", "text": "function getRandomQuote () {\t\n\n\tvar temp = Math.floor(Math.random()*quotes.length);\n\treturn quotes[temp];\n\n}", "title": "" }, { "docid": "0252cc3fdcb754a643e52ed0f48d6d76", "score": "0.8135553", "text": "function getRandomQuote () {\n const quoteNumber = Math.floor (Math.random () * quotes.length); \n return quotes[quoteNumber];\n}", "title": "" }, { "docid": "43c06c08089ec8b6297f45915077f1f9", "score": "0.813352", "text": "function getRandomQuote() {\n\n var randomNumber = Math.floor(Math.random() * quotes.length ); //returns a random integer upto the length of the array\n \n var randomQuoteObj = quotes[randomNumber];\n\n return randomQuoteObj;\n }", "title": "" }, { "docid": "30e03e3dd8150b700d7661420f415deb", "score": "0.8127034", "text": "function getRandomQuote(){\n var randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "e1eef8e540f6bb320304112a225ca742", "score": "0.8126978", "text": "function getRandomQuote(){\n\nvar randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n\n }", "title": "" }, { "docid": "9c4e92692ed015805b3cd7fe1dfa5c06", "score": "0.812604", "text": "function getRandomQuote( arr ) {\n let randomNumber = Math.floor( Math.random() * quotes.length);\n let randomQuote = quotes[randomNumber];\n console.log(randomQuote);\n return randomQuote;\n\n}", "title": "" }, { "docid": "d06332fd6432809b84e94580849d2ec2", "score": "0.81168866", "text": "function getRandomQuote() {\n\tvar the_size = quotes.length;\n\tvar the_random =Math.floor(Math.random() * the_size);\n\treturn quotes[the_random];\n}", "title": "" }, { "docid": "be71492cdc92b6e391a4649697e5d1c2", "score": "0.81136304", "text": "function getRandomQuote() {\n let randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "0a6ac4188b983c6e2ebc246134164424", "score": "0.8110764", "text": "function getRandomQuote(){//generates random quotes using Math.random()\n var random = Math.floor(Math.random() * quotes.length);\n return quotes[random];\n}", "title": "" }, { "docid": "3277dd78d0ed034a1e36c3b3d3125037", "score": "0.810711", "text": "function randomQuote() {\n loadQuotes();\n\n let i = Math.floor(Math.random() * (quotes.length));\n return quotes[i];\n}", "title": "" }, { "docid": "92490c2174d37ceb7fd0b8d5ea156d33", "score": "0.8104722", "text": "function getRandomQuote() {\n const randomNumber = Math.floor(Math.random()*quotes.length);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "245883295628331c13b5590402ea50a1", "score": "0.8104061", "text": "function getRandomQuote() {\n let quotesLength = quotes.length;\n let randomNumber = Math.floor(Math.random() * quotesLength);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "02d88ea38c04b588b5865c2e98c0aa7d", "score": "0.80974704", "text": "function getRandomQuote() {\n\tconst randomNumber = Math.floor(Math.random() * quotes.length);\n\treturn quotes[randomNumber];\n}", "title": "" }, { "docid": "889d2ceeb214a75b198ac087da1fa737", "score": "0.8095079", "text": "function getRandomQuote() {\n var randomNum = Math.floor(Math.random() * quotes.length);\n return quotes[randomNum];\n}", "title": "" }, { "docid": "321cf6cec59ba59b20f5f7a4fbeee754", "score": "0.80948484", "text": "function getRandomQuote() {\n return quotes[Math.floor((Math.random() * 5))];\n}", "title": "" }, { "docid": "fe00b64be76b155eaf65213b06af89cc", "score": "0.8088987", "text": "function getRandomQuote(array){\n if(array.length === 0){\n for(i=0; i < quotes.length; i++){\n array[i]=quotes[i];\n }\n }\n var randomIndex = Math.floor(Math.random()*array.length);\n var randomQuote = array[randomIndex];\n array.splice(randomIndex,1);\n return randomQuote;\n}", "title": "" }, { "docid": "5c6eb0136401537326215fd4bfac7fb2", "score": "0.8086988", "text": "function getRandomQuote() {\n let randomNumber = Math.floor((Math.random() * quotes.length));\n let randomQuote = quotes[randomNumber];\n return randomQuote;\n}", "title": "" }, { "docid": "5716b8185c66007af09eb10a1141e6c4", "score": "0.80842376", "text": "function getRandomQuote() {\n return quotes[Math.floor( Math.random() * 5 )];\n}", "title": "" }, { "docid": "1499e7502ef44082ba36ab5c19fb06ed", "score": "0.8083578", "text": "function getRandomQuote() {\n let randomNumber = Math.floor(Math.random() * quotes.length);\n let randomQuote = quotes[randomNumber];\n return randomQuote;\n}", "title": "" }, { "docid": "7555e1548edb31d12c28cb8956563111", "score": "0.80782264", "text": "function getRandomQuote() {\n var quoteObject = quotes[Math.floor(Math.random() * quotes.length)];\n return quoteObject;\n}", "title": "" }, { "docid": "12782bdbc635905c8faccd6b4d9ed752", "score": "0.80763674", "text": "function getRandomQuote() {\n var randomNumber = Math.floor(Math.random() * quotes.length );\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "6d1bf2dd577c1aac1dab10ca2bfcc10f", "score": "0.80729765", "text": "function getRandomQuote() {\n \n //variable to store random number based on the number of objects in the quote array\n const randomQuoteNumber = Math.floor( Math.random() * quotes.length);\n \n //return a random quotes Keys and Properties based on the previously generated number\n return quotes[randomQuoteNumber];\n}", "title": "" }, { "docid": "030432d8b59c136a66169362582657be", "score": "0.807197", "text": "function getRandomQuote() {\n var randomNum = Math.floor(Math.random() * (quotes.length));\n return quotes[randomNum];\n}", "title": "" }, { "docid": "9f7836f3303f3962b7751b9e01a3a5f1", "score": "0.8071831", "text": "function getRandomQuote () {\n let randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "30b0f422b0b1ba3be01d3c26c465a255", "score": "0.80711156", "text": "function getRandomQuote() {\n var randomNum = Math.floor(Math.random() * (quotes.length));\n return quotes[randomNum];\n}", "title": "" }, { "docid": "17a9975182678069878cf5be9206695f", "score": "0.8065842", "text": "function getRandomQuote(){\n let randomQuoteIndex = Math.floor(Math.random()*quotes.length);\n return quotes[randomQuoteIndex];\n}", "title": "" }, { "docid": "23e9ee9c44e5610fce3c5b4bb13b7d87", "score": "0.80638194", "text": "function getRandomQuote() {\n const randomNumber = Math.floor(Math.random() * (quotes.length));\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "25bd561c17b1c9c8be6127d51c0ae2ab", "score": "0.8059571", "text": "function getRandomQuote() {\n var randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "38e11826044b9d7c62e2dbef02b3481e", "score": "0.8057069", "text": "function getRandomQuote(){\n\n var getRandomNumber = Math.floor((Math.random() * quotes.length ));\n return quotes[getRandomNumber];\n\n}", "title": "" }, { "docid": "494f60bdcffcaed6d925251df7b5f949", "score": "0.80544907", "text": "function generateQuotes(){\n var quotes_sample = [];\n for (x=0; x<=4; x++) {\n quotes_sample.push(bob_ross_quotes.splice(Math.ceil(Math.random(bob_ross_quotes.length) * bob_ross_quotes.length)-1, 1));\n }\n return quotes_sample;\n}", "title": "" }, { "docid": "23ba0581a4f01accdf53c5e26bd0ae16", "score": "0.8053854", "text": "function getRandomQuote() {\n var randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n }", "title": "" }, { "docid": "18f57af61a50ceb01b2b8c61703886c9", "score": "0.8052467", "text": "function getRandomQuote() {\n var randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "18f57af61a50ceb01b2b8c61703886c9", "score": "0.8052467", "text": "function getRandomQuote() {\n var randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "268895b05ce3315378d033da7e693fe1", "score": "0.8051002", "text": "function getRandomQuote() {\n var randomQuote = quotes[Math.floor(Math.random() * quotes.length)];\n return randomQuote;\n}", "title": "" }, { "docid": "98792577aa083c29a9b7f5dda8c0b788", "score": "0.80241317", "text": "function getRandomQuote() {\n let randomNum = Math.floor(Math.random() * quotes.length);\n let quoteObject = quotes[randomNum];\n return quoteObject;\n}", "title": "" }, { "docid": "e13a74d9262644f18fb83768336a3673", "score": "0.8022212", "text": "function getRandomQuote() {\n //Random number between zero and last index in the 'quotes' array\n const randomNumber = Math.floor(Math.random() * quotes.length);\n\n //Random object from 'quotes' array \n let randomQuoteObject = quotes[randomNumber];\n return randomQuoteObject;\n}", "title": "" }, { "docid": "16bcd9a6fc74e910069fb896135c3850", "score": "0.80189234", "text": "function getRandomQuote() {\n\n let randomQuoteIndex = Math.floor(Math.random() * quotes.length);\n let randomQuote = quotes[randomQuoteIndex];\n return randomQuote;\n}", "title": "" }, { "docid": "b179e06e6f0fb7b8d1fec76bdd4a77ff", "score": "0.80133", "text": "function getRandomQuote() {\n const q = Math.floor(Math.random()*quotes.length);\n return quotes[q];\n}", "title": "" }, { "docid": "8b4dba3b4381481fa3b944e5b96071bb", "score": "0.7990835", "text": "function getRandomQuote() {\n i = Math.floor(Math.random() * (quotes.length));\n if (usedQuotes.length < quotes.length) {\n if (usedQuotes.indexOf(quotes[i]) > -1 ) {\n return getRandomQuote();\n } else {\n usedQuotes.push(quotes[i]);\n return quotes[i];\n }\n } else {\n usedQuotes = [];\n return getRandomQuote();\n }\n }", "title": "" }, { "docid": "cb23dbef59c64e10d3240720e9b3cc99", "score": "0.7990681", "text": "function getRandomQuote(){\n var quoteObject = Math.floor(Math.random() * quotes.length);\n return (quotes[quoteObject]);\n}", "title": "" }, { "docid": "62d627f31ece3264fbf34658a1402b5a", "score": "0.79806215", "text": "function getRandomQuote() {\n var quoteNumber = Math.floor(Math.random() * (quotes.length));\n return quotes[quoteNumber];\n}", "title": "" }, { "docid": "1ddf0b139e3ebda1683f8da25255dc2b", "score": "0.7978181", "text": "function getQuote() \n{\t// Generate a random number from 0 - QUOTE.length - 1.\n\tlet num = Math.floor((Math.random() * QUOTE.length)); \n\tlet duplicate = false;\n\t// Jump through each used quote and generate a random number that has not been used already.\n\tdo {\n\t\tduplicate = false;\n\t\tfor(let i = 0; i < pastQuotes.length; i++) { \t\n\t\t\t// Check if the generated number has been used.\n\t\t\tif(num === pastQuotes[i]) {\n\t\t\t\tduplicate = true;\n\t\t\t}\n\t\t}\n\t\t// Generate a new number as it has been used and then check again.\n\t\tif(duplicate) {\n\t\t\tnum = Math.floor((Math.random() * QUOTE.length)); \n\t\t}\n\t} while(duplicate);\n\n\tpastQuotes.push(num);\n\n\tif(pastQuotes.length === QUOTE.length) {\n\t\tpastQuotes = [];\n\t}\n\n\tgenerateQuote(QUOTE[num].quote, QUOTE[num].source);\n}", "title": "" }, { "docid": "7b3adb1a7e8b01c710fbcd790fcdee2e", "score": "0.7972711", "text": "function getRandomQuote() {\n let randomQuote = Math.floor(Math.random() * quotes.length);\n\n return quotes[randomQuote];\n}", "title": "" }, { "docid": "7b3adb1a7e8b01c710fbcd790fcdee2e", "score": "0.7972711", "text": "function getRandomQuote() {\n let randomQuote = Math.floor(Math.random() * quotes.length);\n\n return quotes[randomQuote];\n}", "title": "" }, { "docid": "7d4701671847c1f3c8ac68e3590ed426", "score": "0.7962398", "text": "function generateQuote(){\n // generate a new random number..\n randomNumber = getRandomNumber(quotes.length);\n\n // assign new random quote and author to variables..\n // var quote = quotes[randomNumber][0];\n // var author = quotes[randomNumber][1];\n // quoteArr = [quotes[randomNumber][0], quotes[randomNumber][1]];\n\n // store the randomly chosen quote text and author in quoteObj..\n quoteObj.text = quotes[randomNumber][0];\n quoteObj.author = quotes[randomNumber][1];\n\n // send the new random quote to the console for testing...\n console.log(quoteObj.text + \" - \" + quoteObj.author);\n // return the quoteArr array with new quote and author.\n return quoteObj;\n }", "title": "" }, { "docid": "925a13e9b6aa7cec201dada24558a51a", "score": "0.795025", "text": "function getRandomQuote() {\n return getRandomElement(allQuotes);\n }", "title": "" }, { "docid": "cce2c85111428631da3a5f04eaa3bc71", "score": "0.79244924", "text": "function getRandomQuote() {\n let randomNumber = Math.floor( Math.random() * 5);\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "5b7bfc2d943f55ed903e251a89589bb7", "score": "0.7921701", "text": "function getRandomQuote(){\nvar RandomNumber = Math.floor(Math.random() * quotes.length);\n//Here we choose our random quote\nvar UsedQuote = quotes[RandomNumber];\nreturn UsedQuote\n}", "title": "" }, { "docid": "a144c5e12a143faf0710e1ef10da8bdf", "score": "0.790842", "text": "function getRandomQuote() {\n var randomNumberQuote = quotes[Math.floor( Math.random() * quotes.length)];\n return randomNumberQuote;\n}", "title": "" }, { "docid": "b8eca5304f3b58c969f96b5f697ad15e", "score": "0.79049253", "text": "function getRandomQuote () {\n quoteNumber = Math.floor(Math.random() * quotes.length)\n console.log(quotes[quoteNumber])\n return quotes[quoteNumber]\n}", "title": "" } ]
686ce540b58ab42bbf6af2a9af49265c
Automates filtering of companies based on query string with name, minEmployee , or maxEmployee example returns 2 companies: arnoldbergertownsend & garnermichael
[ { "docid": "fbc0d2dcdc2159c4b16b64964b874d9b", "score": "0.6974081", "text": "static async filterCompanies(urlQuery) {\r\n let newQuery = `SELECT * FROM companies WHERE`;\r\n // if (name) get companies that match query\r\n let queryCount = 0;\r\n\r\n for (let key in urlQuery) {\r\n if (queryCount > 0) {\r\n newQuery += ` AND `;\r\n }\r\n if (key === \"name\") {\r\n newQuery += ` LOWER(name) LIKE LOWER('%${urlQuery[key]}%')`;\r\n }\r\n if (key === \"minEmployees\") {\r\n newQuery += ` num_employees >= ${urlQuery[key]} `;\r\n }\r\n if (key === \"maxEmployees\") {\r\n newQuery += ` num_employees <= ${urlQuery[key]} `;\r\n }\r\n queryCount++;\r\n }\r\n\r\n const results = await db.query(newQuery);\r\n return results.rows;\r\n }", "title": "" } ]
[ { "docid": "5543cb092174c94bda1fb0fbc5a375ea", "score": "0.68834287", "text": "function sqlCompanyFilter(filterData) {\n // Checks for both min and max employees and then checks that max is not less than min. If so, throws error.\n if (filterData['minEmployees'] && filterData['maxEmployees']) {\n if (filterData['maxEmployees'] < filterData['minEmployees']) {\n throw new BadRequestError(\n 'Max employees must be greater than Min employees'\n )\n }\n }\n // {name: 'Comp', minEmployees: 32, maxEmployees: 50} =>\n // ['\"NAME\" LIKE \"%$1%\"', '\"num_employees\">=$2', '\"num_employees\"<=$3']\n const keys = Object.keys(filterData)\n const cols = keys.map((colName, idx) => {\n if (colName === 'minEmployees') {\n return `\"num_employees\">=$${idx + 1}`\n } else if (colName === 'maxEmployees') {\n return `\"num_employees\"<=$${idx + 1}`\n } else if (colName === 'name') {\n return `upper(${colName}) LIKE upper('%' || $${idx + 1} || '%')`\n }\n })\n\n return {\n // whereCriteria:\n // '\"NAME\" LIKE \"%$1%\" AND \"num_employees\"<=$2 AND \"num_employees\">=$3'\n whereCriteria: cols.join(' AND '),\n values: Object.values(filterData),\n }\n}", "title": "" }, { "docid": "697b4a360ba7661dfecf7f3f8524bbef", "score": "0.6882259", "text": "function companyQueryStringHelp(command, companies) {\n\t// if min_employees & max_employees is in the query string check that the min value is not greater than the max value.\n\tif (command.min_employees && command.max_employees) {\n\t\tif (command.min_employees > command.max_employees) {\n\t\t\tlet err = new ExpressError(\n\t\t\t\t\"min_employees paramter is greater than max_employees paramter\",\n\t\t\t\t400\n\t\t\t);\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// if search is in the query string filter results by company name or handle\n\tif (command.search) {\n\t\tcompanies = companies.filter(\n\t\t\t(company) =>\n\t\t\t\tcompany.name.includes(command.search) || company.handle.includes(command.search)\n\t\t);\n\t}\n\t// if min_employees is in the query string filter results by min employees\n\tif (command.min_employees) {\n\t\tcompanies = companies.filter((company) => company.num_employees > command.min_employees);\n\t}\n\t// if max_employees is in the query string filter results by min employees\n\tif (command.max_employees) {\n\t\tcompanies = companies.filter((company) => company.num_employees < command.max_employees);\n\t}\n\treturn companies;\n}", "title": "" }, { "docid": "302f24a992d8fb3e951cbdeb48474a0d", "score": "0.66635776", "text": "static async findAll(search, min, max) {\n let filters = [];\n let companyResp;\n let idx = 1;\n let baseURL = `SELECT handle, name FROM companies`\n\n if (search !== undefined) {\n baseURL += ` WHERE name ILIKE $1`\n filters.push(`%${search}%`);\n idx++\n }\n if (min !== undefined) {\n if (filters.length) {\n baseURL += ` AND num_employees >= $${idx}`\n } else {\n baseURL += ` WHERE num_employees >= $${idx}`\n }\n idx++;\n filters.push(min);\n }\n if (max !== undefined) {\n if (filters.length) {\n baseURL += ` AND num_employees <= $${idx}`\n } else {\n baseURL += ` WHERE num_employees <= $${idx}`\n }\n idx++;\n filters.push(max);\n }\n\n if (filters.length) {\n companyResp = await db.query(baseURL, filters)\n } else {\n companyResp = await db.query(baseURL)\n }\n\n\n return companyResp.rows;\n }", "title": "" }, { "docid": "e42dca8040597a127d56116aad75596d", "score": "0.6553664", "text": "static _buildQuery({ search, min_employees, max_employees }) {\n const BASE_QUERY = 'SELECT handle, name FROM companies';\n const ORDER_QUERY = ' ORDER BY handle';\n\n let whereQuery = '';\n\n let idx = 1;\n let columns = [];\n let queryArray = [];\n\n // Set query parts depending on which were fed into function\n if (search || min_employees || max_employees) {\n whereQuery = ' WHERE ';\n }\n if (search) {\n let searchQuery = `name ILIKE $${idx}`;\n idx++;\n columns.push(`%${search}%`);\n queryArray.push(searchQuery);\n }\n if (min_employees) {\n let minQuery = `num_employees >= $${idx}`;\n idx++;\n columns.push(min_employees);\n queryArray.push(minQuery);\n }\n if (max_employees) {\n let maxQuery = `num_employees <= $${idx}`;\n idx++;\n columns.push(max_employees);\n queryArray.push(maxQuery);\n }\n\n // Combine the query strings for filtering in SQL WHERE clause\n let filterQuery = queryArray.join(' AND ');\n // Combine all query parts\n const finalQuery = BASE_QUERY + whereQuery + filterQuery + ORDER_QUERY;\n return { query: finalQuery, columns };\n }", "title": "" }, { "docid": "a39636ba8a2afabea329d86a25fbd0b1", "score": "0.6489275", "text": "searchCompanies() {\n const searchQuery = new RegExp(this.companySearch, 'i');\n this.displayData.companies = this.safeData.companies.filter(record => searchQuery.test(record.name));\n if (this.displayData.companies.length > 50) {\n this.displayData.companies = this.displayData.companies.slice(0, 49);\n }\n }", "title": "" }, { "docid": "86bbc337fb95028499aa2c4d83d98a85", "score": "0.64559746", "text": "static async getFilteredCompanies(query) {\n let res = await this.request(`companies?name=${query}`);\n // console.log(\"query\", query, \"company\", res.companies)\n return res.companies;\n }", "title": "" }, { "docid": "e31e94c7486392aae6703a0fb434f36b", "score": "0.61933917", "text": "function createFilterFor(query) {\r\n\t\t\t\t\t\tvar lowercaseQuery = angular.lowercase(query);\r\n\t\t\t\t\t\treturn function filterFn(emp) {\r\n\t\t\t\t\t\t\treturn (angular.lowercase(emp.companyName).indexOf(\r\n\t\t\t\t\t\t\t\t\tlowercaseQuery) >= 0);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}", "title": "" }, { "docid": "6e9c880ceef647a3890bed209eabcca9", "score": "0.6081427", "text": "function getEnergyCompanys(res, mysql, context, searched, filters_name, filters_arr, complete){\n if (searched === 0){\n var default_search =\"\";\n name_query = default_search.replace(\";\",\"\");\n var inserts = ['[0-9]*', 0, Math.pow(2,127)];\n }\n else{\n name_query = filters_name.replace(\";\",\"\");//protect against stopping query\n var inserts;\n inserts = filters_arr;\n if (filters_arr[0] === \"-\"){\n inserts[0] = '[0-9]*';\n }\n }\n var sql = \"SELECT DISTINCT c.energy_company_id, c.energy_company_name, c.net_worth FROM energy_company AS c \"\n + \"LEFT JOIN energy_plant_company AS pc ON c.energy_company_id = pc.energy_company_id \"\n + \"WHERE pc.energy_plant_id REGEXP ? AND c.energy_company_name LIKE '%\"+name_query+\"%' AND (c.net_worth>=? AND c.net_worth<=?)\";\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.energy_companys = results;\n complete();\n });\n }", "title": "" }, { "docid": "9da809709aa003400592629d99b2d3ab", "score": "0.60242087", "text": "function querySearch (query) {\n\t\t\t\t \n\t\t\t//Custom Filter\n\t\t\tvar results=[];\n\t\t\tfor (i = 0, len = $scope.allCompanies.length; i<len; ++i){\n\t\t\t\t//console.log($scope.allCompanies[i].value.value);\n\t\t\t\t\n\t\t\t\tif($scope.allCompanies[i].value.indexOf(query.toLowerCase()) !=-1)\n\t\t\t\t{\n\t\t\t\t\tresults.push($scope.allCompanies[i]);\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn results;\n\t\t}", "title": "" }, { "docid": "9da809709aa003400592629d99b2d3ab", "score": "0.60242087", "text": "function querySearch (query) {\n\t\t\t\t \n\t\t\t//Custom Filter\n\t\t\tvar results=[];\n\t\t\tfor (i = 0, len = $scope.allCompanies.length; i<len; ++i){\n\t\t\t\t//console.log($scope.allCompanies[i].value.value);\n\t\t\t\t\n\t\t\t\tif($scope.allCompanies[i].value.indexOf(query.toLowerCase()) !=-1)\n\t\t\t\t{\n\t\t\t\t\tresults.push($scope.allCompanies[i]);\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn results;\n\t\t}", "title": "" }, { "docid": "9e1cac4eecb8c0fc5f617ebe4343e44b", "score": "0.59678894", "text": "async function queryCompany(){\n const models = await API.graphql(graphqlOperation(listCompanys))\n listofcompanys = models.data.listCompanys.items\n if(listofcompanys){\n let filteredlist = [];\n if(formData.searchBy === \"ID\"){\n filteredlist = listofcompanys.filter(company=>{return company&&company.companyId === Number(formData.searchField)});\n }\n else if(formData.searchBy === \"Name\"){\n filteredlist = listofcompanys.filter(company=>{return company&&company.name === String(formData.searchField)});\n }\n setCompanys(filteredlist);\n }\n }", "title": "" }, { "docid": "e1ce900857729280d74272dc39956d2e", "score": "0.59665024", "text": "function searchEmployee(input) {\n const filteredEmployees = [];\n \n employees.forEach((employee) => {\n // join the first and the last name\n const fullName = employee.name.first + employee.name.last;\n // Checks for input match\n if (fullName.toUpperCase().includes(input.toUpperCase())) {\n filteredEmployees.push(employee);\n }\n });\n // empty the gallery\n gridContainer.innerHTML = '';\n \n // Generate a new gallery\n displayEmployees(filteredEmployees);\n }", "title": "" }, { "docid": "69c36a7f029a91695f34f2cc970d2a5c", "score": "0.59582734", "text": "function findTaxQualifyingConditionsByRegularExpression(queryUpperCased, request){\n\t\t\tvar qualifyingConditions = [];\n\t\t\tif(self.allTaxQualifyingConditions){\n\t\t\t\tvar currentTaxQualifyingCondition;\n\t\t\t\tfor(var index = 0; index < self.allTaxQualifyingConditions.length; index++){\n\t\t\t\t\tcurrentTaxQualifyingCondition = self.allTaxQualifyingConditions[index];\n\t\t\t\t\tif(currentTaxQualifyingCondition.displayName &&\n\t\t\t\t\t\tcurrentTaxQualifyingCondition.displayName.toUpperCase().includes(queryUpperCased)){\n\t\t\t\t\t\tqualifyingConditions.push(currentTaxQualifyingCondition);\n\t\t\t\t\t\tif(currentTaxQualifyingCondition.length === MAX_DROPDOWN_SIZE){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// after finding all the results, if this is the latest request, set the list to the current value\n\t\t\tif(request === LATEST_REQUEST) {\n\t\t\t\tself.qualifyingConditionValues = qualifyingConditions;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f61d5da20d45fea24363f5ccd57823f6", "score": "0.5803521", "text": "function filterAPI() {\n // axios.get('http://localhost:8080/employees')\n axios\n .get(\"https://and-apollo-slackbot.herokuapp.com/employees\")\n .then((res) => {\n const response = res.data;\n\n console.log(response);\n const employee = response.filter((name) => {\n counter++;\n console.log(\"filter has been hit this: \" + counter + \" many times\");\n console.log(name);\n const first = name.firstName.toLocaleLowerCase();\n console.log(first);\n const last = name.lastName.toLocaleLowerCase();\n console.log(last);\n const lowerCaseSearchedUser = searchedUser.toLocaleLowerCase();\n console.log(lowerCaseSearchedUser);\n const full = `${first} ${last}`;\n console.log(full);\n const fullOriginal = `${name.firstName} ${name.lastName}`;\n console.log(\"full original :\" + fullOriginal);\n //'includes' method compares any piece of name to string (from object) so that if user only knows a part of the employee's name the api will still be called\n //compares input to object whether the user types in all lower case or capitalizes the first letter\n if (full.includes(lowerCaseSearchedUser)) {\n console.log(\"if full includes lcsu: \");\n return true;\n } else if (fullOriginal.includes(searchedUser)) {\n console.log(\"if full original includes searchedUser: \");\n return true;\n }\n });\n setUsers(employee);\n });\n }", "title": "" }, { "docid": "788946090f05859cd244970040e38513", "score": "0.5758211", "text": "function searchCompany() {\n if ($rootScope.filterCompany.word == '')\n $rootScope.filterCompany.word = null;\n\n getCompanies($rootScope.filterCompany.skip);\n getCountCompanies();\n }", "title": "" }, { "docid": "a6dc4116ebcbd6572fcfe9c000b73f71", "score": "0.56521827", "text": "function companyEmployeesList($query) {\n var getUsers = new baseService();\n getUsers.setPath('ray', '/company/' + structureService.companyId + '/employees?count=10&cursor=1');\n return getUsers.execute().then(function (response) {\n return response.map(function (user) {\n return {\n name: user.firstName + ' ' + user.lastName,\n id: user.id\n };\n }).filter(function (user) {\n return user.name.toLowerCase().indexOf($query.toLowerCase()) != -1;\n });\n });\n }", "title": "" }, { "docid": "b234db4c3958edbb3c17546e8cbe29cb", "score": "0.5646207", "text": "function createFilterFor(query) {\n\t var lowercaseQuery = angular.lowercase(query).replace(/[-]/g,'');\n\n\t return function filterFor(s) {\n\t return (!scope.selected_set[s.number] && (angular.lowercase(s.name).indexOf(lowercaseQuery) !== -1 ||(s.number+'').indexOf(lowercaseQuery) !== -1) );\n\t };\n\t }", "title": "" }, { "docid": "4228cef4d2982e384b85805f6de01150", "score": "0.5620543", "text": "onFilter(event, filterKey, value) {\n console.log('filtering')\n \n if (value === \"firstName\") {\n const employeeData = this.state.employeeResArr\n const filterEmployees = employeeData.filter((employee) => employee.firstName === filterKey)\n this.setState({ filteredEmployees: filterEmployees })\n } else if (value === 'lastName') {\n const employeeData = this.state.employeeResArr\n const filterEmployees = employeeData.filter((employee) => employee.lastName === filterKey)\n this.setState({ filteredEmployees: filterEmployees })\n } else if (value === 'yearsWithCompany') {\n const employeeData = this.state.employeeResArr\n //The \"==\" was done intentionally in below lines of code. It is because user is typing in the info in an input box which is coming back as a string\n //While respone from axios call for registered age is an integer\n // eslint-disable-next-line\n const filterEmployees = employeeData.filter((employee) => employee.yearsWithCompany == filterKey)\n this.setState({ filteredEmployees: filterEmployees })\n } else {\n this.setState({ filteredEmployees: this.state.employeeResArr})\n // this.render()\n }\n }", "title": "" }, { "docid": "65f95ec398d769ce2b9415809aabf572", "score": "0.5582929", "text": "function search() {\r\n let searchInput = document.getElementById(\"textInput\").value;\r\n let inputText = searchInput.trim();\r\n\r\n if (!inputText) {\r\n return;\r\n }\r\n\r\n filterResults = [];\r\n\r\n filterResults = rentalClients.filter(customer => {\r\n return customer.last_name.toUpperCase().startsWith(inputText.toUpperCase());\r\n });\r\n\r\n displayResults();\r\n}", "title": "" }, { "docid": "f9b768bddd38d62b549362c388089d68", "score": "0.5557617", "text": "function filterEmployees(filter){\n if(filter === \"\"){\n initFilterEmployees();\n }else{\n filteredIndex = [];\n for (var i = 0; i < employees.length; i++) {\n var firstName = employees[i].name.first;\n var lastName = employees[i].name.last;\n var email = employees[i].email;\n var username = email.substring(0,email.search(\"@\"));\n\n if(firstName.includes(filter) || lastName.includes(filter) || username.includes(filter)){\n filteredIndex.push(i);\n }\n }\n }\n\n displayEmployees();\n}", "title": "" }, { "docid": "e68ed8eaae50a35e6f5fc9e9c7d19d3d", "score": "0.5541117", "text": "filterEmployee() {\n let filteredEmployees = this.state.employees.filter((employee) => {\n let fullName = employee.name.first + \" \" + employee.name.last;\n return (fullName.includes(this.state.searchKeyword));\n });\n this.setState({employeesForDisplay: filteredEmployees});\n }", "title": "" }, { "docid": "3b7c56fa551c6f9916e7c214fbbd682f", "score": "0.55387396", "text": "function handleInputChange(event) {\n const { name, value } = event.target;\n console.log(value);\n let result = employees.filter(people => people.name.toLowerCase().includes(value) )\n console.log(result);\n setEmployees(result);\n\n if(!value){ loadEmployees() }\n }", "title": "" }, { "docid": "f6b9b22485e03c1ca0cc60202b3520bb", "score": "0.55028963", "text": "function SearchByKeyEnter(){\n \n let results = data.filter(element=>element.name.toLowerCase().startsWith(inputValue.value) || element.capital.toLowerCase().startsWith(inputValue.value) || element.region.toLowerCase().startsWith(inputValue.value));\n\n displayData(results);\n \n}", "title": "" }, { "docid": "3af4fbe2388416176bd5de032576edcb", "score": "0.54876345", "text": "function getInputFromUserByRange() {\n makeListAgain() // rendering all data again\n var one = document.getElementById(\"userInputFilterCostOne\").value\n one = parseInt(one)\n\tvar two = document.getElementById(\"userInputFilterCostTwo\").value\n\ttwo = parseInt(two)\n\t//var testOne = 10\n\t//var testTwo = 12\n return filterByCostByRange(one, two)\n}", "title": "" }, { "docid": "60b7d7a94ccb42b09c1e7fde7d354960", "score": "0.5375781", "text": "function filterBestSellers() {}", "title": "" }, { "docid": "a66ab1cc97be7ed2e1bff676e0286957", "score": "0.5358229", "text": "queryCompanies({ include, filter, top, skip, orderBy } = {}) {\n var path = this.buildUrl({\n url: `/api/v2/companies`,\n parameters: {\n $include: include,\n $filter: filter,\n $top: top,\n $skip: skip,\n $orderBy: orderBy\n }\n });\n return this.restCall({ url: path, verb: 'get', payload: null });\n }", "title": "" }, { "docid": "3f93a755eff3869ef2f9fb56fff74aa0", "score": "0.533456", "text": "function searchEmployees() {\n let data, txtValue;\n const filter = searchInput.value.toLowerCase();\n const cards = document.querySelectorAll(\".card\");\n const name = document.querySelectorAll(\".card-name\");\n\n for (let i = 0; i < cards.length; i++) {\n data = cards[i];\n if (data) {\n txtValue = name[i].textContent.toLowerCase();\n if (txtValue.indexOf(filter) > -1) {\n data.style.display = \"\";\n } else {\n data.style.display = \"none\";\n }\n }\n }\n}", "title": "" }, { "docid": "58b19502995b24d596f747621303fc1d", "score": "0.5332139", "text": "handleSearch(event) {\n event.preventDefault();\n const search = event.target.value;\n const filempfirst = this.state.employees.filter(\n employee =>\n (employee.firstname.toLowerCase().indexOf(search.toLowerCase())\n && employee.lastname.toLowerCase().indexOf(search.toLowerCase())\n && employee.role.toLowerCase().indexOf(search.toLowerCase())\n && employee.code.toLowerCase().indexOf(search.toLowerCase())) > -1,\n );\n this.setState({\n selectedEmp: filempfirst,\n });\n }", "title": "" }, { "docid": "a119eefa1f201c043a9d3d9edf935168", "score": "0.5330294", "text": "function filter(field = lastFilterField, needle = lastFilterNeedle) {\n data = [];\n //depending on the selected field ask for a differnet input and then iterate over all experiments and select the matching ones\n if (field == \"ID\" || field == \"Newton\") {\n needle = needle || prompt('Suchmaske:\\n \"Wert\" oder \"Wert-Wert\"', \"100-150\");\n lastFilterField = field;\n lastFilterNeedle = needle;\n if (needle == null || needle == \"\") {\n fillTable(experiments);\n return;\n }\n if (!(/^\\d+(-\\d+)?/g).test(needle)) {\n alert(\"Eingabe keine gültige Maske\");\n fillTable(experiments);\n return;\n }\n needle = needle.split('-');\n if (needle.length == 1) {\n needle = +needle[0];\n experiments.forEach(exp => {\n if (exp[field] == needle) data.push(exp);\n });\n } else {\n min = +needle[0];\n max = +needle[1];\n experiments.forEach(exp => {\n if (exp[field] >= min && exp[field] <= max) data.push(exp);\n });\n }\n }\n if (field == \"Type\") {\n needle = needle || prompt('Suchmaske:\\n \"Zug\", \"Scher\", \"Benutzerdefiniert\" oder Zeichenfolge', \"Benutzerd\");\n lastFilterField = field;\n lastFilterNeedle = needle;\n if (needle == null || needle == \"\") {\n fillTable(experiments);\n return;\n }\n experiments.forEach(exp => {\n if (exp[\"Type\"].indexOf(needle) > -1) data.push(exp);\n });\n }\n if (field == \"Creator\") {\n needle = needle || prompt('Suchmaske:\\n \"Name\" oder Zeichenfolge');\n lastFilterField = field;\n lastFilterNeedle = needle;\n if (needle == null || needle == \"\") {\n fillTable(experiments);\n return;\n }\n experiments.forEach(exp => {\n if (exp[\"Creator\"].indexOf(needle) > -1) data.push(exp);\n });\n }\n if (field == \"Description\") {\n needle = needle || prompt('Suchmaske:\\n Zeichenfolge');\n lastFilterField = field;\n lastFilterNeedle = needle;\n if (needle == null || needle == \"\") {\n fillTable(experiments);\n return;\n }\n experiments.forEach(exp => {\n if (exp[\"Description\"].indexOf(needle) > -1) data.push(exp);\n });\n }\n if (field == \"Time\") {\n needle = needle || prompt('Suchmaske:\\n \"yyyy-mm-dd\" oder \"yyyy-mm-dd - yyyy-mm-dd');\n lastFilterField = field;\n lastFilterNeedle = needle;\n if (!/^\\d\\d\\d\\d-\\d\\d-\\d\\d( - \\d\\d\\d\\d-\\d\\d-\\d\\d)?$/g.test(needle)) {\n alert(\"Eingabe keine gültige Maske\");\n fillTable(experiments);\n return;\n }\n needle = needle.split(' - ');\n if (needle.length == 1) {\n needle = needle[0];\n experiments.forEach(exp => {\n if (exp[\"Time\"].indexOf(needle) > -1) data.push(exp);\n });\n } else {\n min = needle[0];\n max = needle[1];\n experiments.forEach(exp => {\n if (exp[\"Time\"] >= min && exp[\"Time\"] <= max) data.push(exp);\n });\n }\n }\n if (field == \"Material1\"||field==\"Material2\") {\n if (needle == null || needle == \"\") {\n fillTable(experiments);\n return;\n }\n experiments.forEach(exp => {\n if (exp[field] == needle) data.push(exp);\n }); \n }\n //insert the filtered dataset into the table\n fillTable(data);\n}", "title": "" }, { "docid": "ae62c5571b432f1b65b288c4e60506cb", "score": "0.53204393", "text": "function createFilterFor(query) {\n\tvar lowercaseQuery = angular.lowercase(query);\n\n\treturn function filterFn(contact) {\n\t return (angular.lowercase(contact.description).indexOf(lowercaseQuery) !== -1) ||\n\t (angular.lowercase(contact.title).indexOf(lowercaseQuery) !== -1);\n\t};\n\n }", "title": "" }, { "docid": "ae4fee2457a20fa2471f69befc4b163d", "score": "0.5315981", "text": "function search(input) {\n\tconst found = [];\n\temployees.forEach(employee => {\n\t\t// Concatenate full name\n\t\tconst name = employee.name.first + employee.name.last;\n\t\t// Check for user input value\n\t\tif (name.toLowerCase().includes(input.toLowerCase())) {\n\t\t\tfound.push(employee);\n\t\t}\n\t});\n\tgallery.innerHTML = ''; // Clear any rendered cards\n\trenderGalleryHTML(found);\n}", "title": "" }, { "docid": "3c0490ac61e1628223afb22c91e96942", "score": "0.53125364", "text": "function search() {\n query = proxy + '/api/Gridify'\n if (ageLessThanInput.value && !ageMoreThanInput.value) {\n query = proxy + `/api/Gridify?Filter=age<<${ageLessThanInput.value}`;\n }\n if (!ageLessThanInput.value && ageMoreThanInput.value) {\n query = proxy + `/api/Gridify?Filter=age>=${ageMoreThanInput.value}`;\n }\n if (ageLessThanInput.value && ageMoreThanInput.value) {\n query = proxy + `/api/Gridify?Filter=age<<${ageLessThanInput.value},age>=${ageMoreThanInput.value}`;\n }\n queryParam.innerHTML = 'query: ' + query;\n\n tableBody.innerHTML = ''\n fetch(query)\n .then(response => response.json())\n .then(data => {\n data.items.forEach((q, index) => {\n const headerOne = document.createElement('tr');\n headerOne.innerHTML = `\n <th scope=\"row\">${index + 1} </th>\n <th scope=\"row\">${q.firstName} </th>\n <th scope=\"row\">${q.lastName} </th>\n <th scope=\"row\">${q.age} </th>\n <th scope=\"row\">${q.phoneNumber} </th>\n <th scope=\"row\">${q.address} </th>\n `\n tableBody.append(headerOne)\n });\n })\n}", "title": "" }, { "docid": "20f7838b869e9c70a2866b8748502b50", "score": "0.53025556", "text": "function minAgeFilter(){\n\t// takes value from min age select\n\tvar minAge = document.getElementById('minAgeSelector').value;\n\tclear();\n\t// No min age selected\n\tif(minAge == 1){\n\t\tminimumAge = 0;\n\t}\n\t// Older than U9\n\telse if(minAge == 2){\n\t\tminimumAge = 9;\n\t}\n\t// Older than U11\n\telse if(minAge == 3){\n\t\tminimumAge = 11;\n\t}\n\t// Older than U13\n\telse if(minAge == 4){\n\t\tminimumAge = 13;\n\t}\n\t// Older than U15\n\telse if(minAge == 5){\n\t\tminimumAge = 15;\n\t}\n\t// Older than U17\n\telse if(minAge == 6){\n\t\tminimumAge = 17;\n\t}\n\t// Older than U20\n\telse if(minAge == 7){\n\t\tminimumAge = 20;\n\t}\n\twriteFilterFencerInfo();\n\topenMemberInfo();\n}", "title": "" }, { "docid": "db2e6bd87b1992fe0426e87297600d99", "score": "0.53021264", "text": "function searchCompanies(company){\r\n const params = {\r\n function: 'SYMBOL_SEARCH',\r\n keywords: company,\r\n apikey: apiKeyStocks\r\n };\r\n // let searchURL = 'https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=';\r\n const searchURL = 'https://www.alphavantage.co/';\r\n const queryString = formatQueryParams(params);\r\n const url = searchURL + 'query?' + queryString;\r\n\r\n fetch(url)\r\n .then(response => {\r\n if(response.ok){\r\n return response;\r\n } else {\r\n throw 'Error with response (in getQuote function)';\r\n }\r\n })\r\n .then(response => response.json())\r\n .then(responseJson => displayMatchingCompanies(responseJson))\r\n .catch(error => alert(`Error Message1: ${error.message}`));\r\n}", "title": "" }, { "docid": "040f7b9d8d9b3a1c9bc892ba8a380262", "score": "0.5301013", "text": "search(value) {\n // Create a regexp expression with the search value\n const search = new RegExp(this.escapeRegExp(value), \"gi\");\n\n // Runs filter function on Employee Array\n return this.show().filter((element) =>\n\n // Each element is an object. Construct an array of their values for each element\n Object.values(element).some((e) =>\n // Check if search value matches any of the object's values. Return true if it does\n search.test(e)));\n }", "title": "" }, { "docid": "4fd0f388717ede2cad4fe39d84eee4c9", "score": "0.52834916", "text": "function filterQuery(){\n var minrent=document.getElementById(\"minrent\").value;\n var maxrent=document.getElementById(\"maxrent\").value;\n var minrooms=document.getElementById(\"minrooms\").value;\n var maxrooms=document.getElementById(\"maxrooms\").value;\n var minarea=document.getElementById(\"minarea\").value;\n var maxarea=document.getElementById(\"maxarea\").value;\n \n minrent= Number(minrent);\n maxrent= Number(maxrent);\n minrooms=Number(minrooms);\n maxrooms=Number(maxrooms);\n minarea=Number(minarea);\n maxarea=Number(maxarea);\n\n if(maxrent==\"\" || maxrent == NaN) maxrent = MAX_INPUT_FIELD_VALUE;\n if(minrooms==\"\" || minrooms== NaN) minrooms = -1;\n if(maxrooms==\"\" || maxrooms== NaN) maxrooms = MAX_INPUT_FIELD_VALUE;\n if(minarea==\"\" || minarea== NaN) minarea= -1;\n if(maxarea==\"\"|| maxarea ==NaN) maxarea= MAX_INPUT_FIELD_VALUE;\n\n var filterJSON = {\n 'type': 'FeatureCollection',\n 'features': []\n };\n houseJSON.features.forEach((feat, idx) =>{\n var rent=Number(feat.properties.rent);\n var rooms=Number(feat.properties.bedrooms);\n var area=Number(feat.properties.area);\n if( minrent <=rent && rent <= maxrent && minrooms<= rooms && rooms <= maxrooms && minarea <= area && area <= maxarea ){\n filterJSON.features.push(feat);\n }\n });\n refreshHouseDataSource();\n closeFilterPopup();\n}", "title": "" }, { "docid": "f455d786beee221c5c39f2bde8e93ee2", "score": "0.52742726", "text": "function searchFilter(data){\n return data.filter((emp) => emp.name.toLowerCase().indexOf(search) !== -1)\n }", "title": "" }, { "docid": "051b89fd58d1ddb7baecc964b7707974", "score": "0.527366", "text": "function filterOnName(name, originalList, filteredSet, firstFilter) {\n var currentFilteredSet = new Set();\n\n for (var i = 0; i < originalList.length; i++) {\n if (name.toLowerCase() === 'availability' && originalList[i].availabilityStatus !== null && originalList[i].availabilityStatus !== undefined) {\n if (originalList[i].availabilityStatus.toLowerCase() === ('available')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'agricultural and biological engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('agricultural and biological engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'aerospace engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('aerospace engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'biological engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('biological engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'business administration' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('business administration')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'biomedical engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('biomedical engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'chemical engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('chemical engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'civil engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('civil engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'computer and information science engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('computer and information science engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'computer engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('computer engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'computer science - engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('computer science - engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'computer science - liberal arts' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('computer science - liberal arts')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'digital arts and sciences' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('digital arts and sciences')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'electrical and computer engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('electrical and computer engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'electrical engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('electrical engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'environmental engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('environmental engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'environmental engineering science' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('environmental engineering science')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'engineering school for sustainable infrastructure and the environment' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('engineering school for sustainable infrastructure and the environment')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'industrial and systems engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('industrial and systems engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'materials science and engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('materials science and engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'mechanical and aerospace engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('mechanical and aerospace engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'mechanical engineering' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('mechanical engineering')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'packaging sciences' && originalList[i].major !== null && originalList[i].major !== undefined) {\n if (originalList[i].major.toLowerCase() === ('packaging sciences')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'sponsor' && originalList[i].type !== null && originalList[i].type !== undefined) {\n if (originalList[i].type.toLowerCase() === ('sponsor')) {\n currentFilteredSet.add(originalList[i]);\n }\n } else if (name.toLowerCase() === 'student' && originalList[i].type !== null && originalList[i].type !== undefined) {\n if (originalList[i].type.toLowerCase() === ('student')) {\n currentFilteredSet.add(originalList[i]);\n }\n }\n }\n\n if (firstFilter) {\n filteredSet.clear();\n currentFilteredSet.forEach(function (value) {\n filteredSet.add(value);\n });\n } else {\n var finalFilteredSet = new Set();\n filteredSet.forEach(function (value) {\n if (currentFilteredSet.has(value)) {\n finalFilteredSet.add(value);\n }\n });\n filteredSet.clear();\n finalFilteredSet.forEach(function (value) {\n filteredSet.add(value);\n });\n }\n\n }", "title": "" }, { "docid": "cf939b2a8ce0f27c2d461eb89159f395", "score": "0.5267196", "text": "function createFilterForManufacturers(query) {\n var lcQuery = angular.lowercase(query);\n return function filterFn(item) {\n item = angular.lowercase(item);\n return (item.indexOf(lcQuery) === 0);\n }\n }", "title": "" }, { "docid": "34f818f65149311c4d9c48c6988a9643", "score": "0.526711", "text": "function query(filterBy) {\n return httpService.get('toy', {params: filterBy})\n // return httpService.get('toy', filterBy)\n // return Axios.get(`${BASE_URL}toy/filterBy=${filterBy}`)\n // `${BASE_URL}toy?name=${filterBy.name}&price=${filterBy.price}` // req.query\n}", "title": "" }, { "docid": "e20dc674afdd4c0f751408b920093f69", "score": "0.5254815", "text": "function filtering(detail){\n \n// if(isNaN(context.searchColumn.fname !== \"\" && detail[context.searchColumn.bname] !== undefined)){\n if(detail[context.searchColumn.bname] !== undefined && isNaN(detail[context.searchColumn.bname])){\n // console.log(detail[context.searchColumn.bname]);\n return detail[context.searchColumn.bname].toUpperCase().indexOf(context.query.toUpperCase()) !== -1;\n}else if (context.searchColumn.fname !== \"\"){\n return String(detail[context.searchColumn.bname]).indexOf(context.query) !== -1; \n}}", "title": "" }, { "docid": "8fe6169ac8b04d1eec7afd8ef0803b0d", "score": "0.52538425", "text": "function filter(event) {\r\n event.preventDefault()\r\n let minValue = document.getElementById(\"minPrice\").value;\r\n let maxValue = document.getElementById(\"maxPrice\").value;\r\n let filterData = products.filter(function(item) {\r\n return item.price >= minValue && item.price <= maxValue;\r\n });\r\n\r\n displayProducts(filterData);\r\n document.getElementById(\"minPrice\").value;\r\n document.getElementById(\"maxPrice\").value;\r\n }", "title": "" }, { "docid": "bb959ce40653547b83b5ce625f7c4aab", "score": "0.525308", "text": "divideName(data) {\n data.filter((person) => (person.firstname = person.name.split(\" \")[0]));\n data.filter((person) => (person.lastname = person.name.split(\" \")[1]));\n data.filter((person) => (person.salary = \"calculating...\"));\n }", "title": "" }, { "docid": "3845a1f60ecea707427781f89621ff4b", "score": "0.5252145", "text": "function filter(search_key, categories, min_price, max_price, limit) {\n if(categories.length == 0)\n {\n displayAllProduct(limit);\n }\n else\n {\n searchProduct(search_key, categories, min_price, max_price, limit);\n }\n }", "title": "" }, { "docid": "bf2ca26c7040e6a2c958945652183a75", "score": "0.524855", "text": "searchCompanies( query, params ){\n if( !query )\n throw new Error(\"query is required in CompanySearchService.searchCompanies\");\n\n const QueryParams = {\n ...params,\n q: query\n }\n\n return this.customSearch(this.searchPath, QueryParams );\n }", "title": "" }, { "docid": "a094bdaeb08fe676eecc73ec9fc34349", "score": "0.5242183", "text": "function createFilterFor(query) {\n\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);\n //return true;\n };\n }", "title": "" }, { "docid": "42440eef9c554012f42ffdbc8ec26965", "score": "0.5239544", "text": "static async filterAndListCompanies(queryObject) {\n const { query, columns } = this._buildQuery(queryObject);\n const companiesResult = await db.query(query, columns);\n return companiesResult.rows;\n }", "title": "" }, { "docid": "d2a0c5b5e38b98334517e4c73484e66d", "score": "0.52347094", "text": "checkSearchedPart(companyName,inputValue){\n let index = companyName.toLowerCase().indexOf(inputValue.toLowerCase());\n if(index >- 1){\n let len = inputValue.length;\n companyName = companyName.slice(0,index) + '<mark>' + companyName.slice(index,index+len) + '</mark>' + companyName.slice(index+len);\n }\n if(companyName.length>45){\n companyName = companyName.slice(0,45) + '...'\n }\n return companyName;\n }", "title": "" }, { "docid": "65b1910692a98a554c6a04dbdf0be9f5", "score": "0.5220585", "text": "function searchEmployees(input) {\n personGallery.innerHTML = '';\n let filteredResults = [];\n dataArray.forEach(person => {\n let fullName = `${person.name.first} ${person.name.last}`\n if (fullName.toLowerCase().includes(input.toLowerCase())) {\n filteredResults.push(person);\n generateGallery(filteredResults);\n cardHandler(filteredResults);\n }\n });\n if (filteredResults.length === 0) {\n personGallery[0].innerHTML = '<h1>Sorry, no results found.</h1>';\n }\n}", "title": "" }, { "docid": "57f688294c3a2d1ccbd2dacb9db35e18", "score": "0.5211623", "text": "function filterNames() {\n\t\tif (stateActiveWindow == 'comb') {\n\t\t\t$('.companyListing .setOne1').each(function() {\n\t\t\t\tvar alphaName = $(this).text().slice(0,searchLength).toLowerCase(); // query each listing to certain length\n\t\t\t\t\n\t\t\t\tif (alphaName != searchString) {\n\t\t\t\t\t$(this).parent().hide(); // hide if listing does not match search entered\n\t\t\t\t}\n\t\t\t\tif (alphaName == searchString) {\n\t\t\t\t\t$(this).parent().addClass('markedListing'); // mark matched listing\n\t\t\t\t\tnumberOfMatches += 1; // count total number of matched listings\n\t\t\t\t} \n\t\t\t});\n\t\t} else if (stateActiveWindow == 'comp') { \n\t\t\t$('.companyListing[data-type=\"Comp\"] .setOne1').each(function() {\n\t\t\t\tvar alphaName = $(this).text().slice(0,searchLength).toLowerCase(); // query each listing to certain length\n\t\t\t\t\n\t\t\t\tif (alphaName != searchString) {\n\t\t\t\t\t$(this).parent().hide(); // hide if listing does not match search entered\n\t\t\t\t}\n\t\t\t\tif (alphaName == searchString) {\n\t\t\t\t\t$(this).parent().addClass('markedListing'); // mark matched listing\n\t\t\t\t\tnumberOfMatches += 1; // count total number of matched listings\n\t\t\t\t} \n\n\t\t\t});\n\t\t} else {\n\t\t\t$('.indivListing .setTwo1').each(function() {\n\t\t\t\tvar alphaName = $(this).text().slice(0,searchLength).toLowerCase(); // query each listing to certain length\n\t\t\t\t\n\t\t\t\tif (alphaName != searchString) {\n\t\t\t\t\t$(this).parent().hide(); // hide if listing does not match search entered\n\t\t\t\t}\n\t\t\t\tif (alphaName == searchString) {\n\t\t\t\t\t$(this).parent().addClass('markedListing'); // mark matched listing\n\t\t\t\t\tnumberOfMatches += 1; // count total number of matched listings\n\t\t\t\t} \n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "5dd6fbeefbb8369618b86803966c65f5", "score": "0.5203986", "text": "function createFilterFor(query) {\n\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(contact) {\n\n return (contact._lowername.indexOf(lowercaseQuery) != -1);\n //return true;\n };\n }", "title": "" }, { "docid": "93d0fcd5475537f1aa2e0294ce180ad1", "score": "0.52017015", "text": "function filterItems(arr, query) {\n return arr.filter(function(el) {\n return el.name.first.toLowerCase().indexOf(query.toLowerCase()) !== -1 || el.name.last.toLowerCase().indexOf(query.toLowerCase()) !== -1\n })\n }", "title": "" }, { "docid": "e1ac6daa340eac8000426dd6ed2cfb98", "score": "0.5191067", "text": "function filterJobs() {\r\n\t\r\n\tif (filterKeywords.value != \"\" && filterKeywords.value != null)\r\n\t\tfilterKeywordsFunction();\r\n\telse if (filterCity.value != \"\" && filterCity.value != null)\r\n\t\tfilterCityFunction();\r\n\telse if (filterDate.value != \"\" && filterDate.value != null)\r\n\t\tfilterDateFunction();\r\n\telse if (filterPay.value != \"\" && filterPay.value != null)\r\n\t\tfilterPayFunction();\r\n}", "title": "" }, { "docid": "dc1994e79bae6d812a7db7d519043b0f", "score": "0.51771945", "text": "function filterCompanies(companies = [], myProperties) {\n return companies.filter(company => matchesRequirement(company.requires, myProperties)).map(company => `Company ${company.title}`);\n}", "title": "" }, { "docid": "40975d7fe36bc5f3c31928bb0ae003a2", "score": "0.517241", "text": "static async searchCompaniesByName(req, res) {\n\t\ttry {\n\t\t\t// get the roles form service\n\t\t\tlet companies = await CompanyService.searchCompaniesByName(req.body.criteria, req.user.id)\n\t\t\t// return the response\n\t\t\tres.json(response.success(ka.request_success, companies))\n\t\t} catch (error) {\n\t\t\tres.json(response.success(ka.request_error))\n\t\t}\n\t}", "title": "" }, { "docid": "7680f12d2ad672e4e8f7d414635fd920", "score": "0.51714456", "text": "static async all(search, min_salary, min_equity) {\n let startingQuery = `SELECT * FROM jobs`;\n let whereValues = []\n\n if (min_salary) {\n whereValues.push(`salary >= ${min_salary}`)\n }\n if (min_equity) {\n whereValues.push(`equity >= ${min_equity}`);\n }\n if (search) {\n whereValues.push(`title ILIKE '${search}'`);\n }\n\n if (whereValues.length > 0) {\n startingQuery += ' WHERE '\n }\n\n let query = startingQuery + whereValues.join(\" AND \")\n\n let res = await db.query(query)\n return res.rows\n }", "title": "" }, { "docid": "a17f4c6c5ebd6397c1566e7b69ffa4f9", "score": "0.5168341", "text": "filterByString(students) {\n let filter = this.state.filter.toLowerCase()\n return students.filter(s => {\n return s.firstname.toLowerCase().includes(filter) || s.surname.toLowerCase().includes(filter) || s.email.toLowerCase().includes(filter) || s.age.toString().includes(filter) || s.grade.toString().includes(filter)\n })\n }", "title": "" }, { "docid": "4fc0d84a9b61d4ebb862d767050889b2", "score": "0.51543534", "text": "function createSkillRatingQuery(minRating, maxRating) {\n var skillQuery = \"value.skill_level_min:[\" + minRating + \" TO 5] AND \" + \"value.skill_level_max:[1 TO \" + maxRating + \"]\"\n return skillQuery\n}", "title": "" }, { "docid": "86ca0f74b9b1904ea38f27e76048d9c9", "score": "0.5151469", "text": "createFilterFor(query)\n {\n //var lowercaseQuery = query.toLowerCase();\n\n return function filterFn(subject)\n {\n return (subject.display.indexOf(query) === 0);\n };\n }", "title": "" }, { "docid": "819b55beea6e1fb1eb93f210524a2c26", "score": "0.51477146", "text": "function getFilteredEmployeesModel(filterString) {\n //uses lodash filter and includes function\n let filteredEmployees = _.filter(employeesModel, function(employee) {\n //ignores case, checks string entered\n if (\n employee.FirstName.toUpperCase().includes(filterString.toUpperCase()) ||\n employee.LastName.toUpperCase().includes(filterString.toUpperCase()) ||\n employee.Position.PositionName.toUpperCase().includes(filterString.toUpperCase())\n ) {\n return true;\n }\n });\n\n return filteredEmployees;\n}", "title": "" }, { "docid": "e5083f12d4085bbea294137bd951e9fb", "score": "0.51401997", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\n }", "title": "" }, { "docid": "a70f03e44ec5b6724c046b3a75bf4d47", "score": "0.51382554", "text": "static searchFilter(params){\n let searchList = []\n if ('title' in params){\n searchList.push(`lower(title) LIKE '%${params['title'].toLowerCase()}%'`)\n }\n if('minSalary' in params){\n searchList.push(`salary >= ${params['minSalary']}`)\n }\n if('hasEquity' in params && params['hasEquity'] == 'true'){\n searchList.push(`equity IS NOT NULL`)\n }\n\n /// creating string to be entered into sql query if necessary\n if (searchList.length == 3){\n return `WHERE ` + `${searchList[0]} AND ` + `${searchList[1]} AND ` + `${searchList[2]}`\n }else if(searchList.length == 2){\n return `WHERE ` + `${searchList[0]} AND ` + `${searchList[1]}`\n }else if(searchList.length ==1){\n return `WHERE ` + `${searchList[0]}`\n }else{\n return ''\n }\n }", "title": "" }, { "docid": "0c62efa1165feb94236dfae0fcd70129", "score": "0.5125567", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(expense) {\n return (expense.display.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "ab6bf36f9c1c967d734e5dd828fc7eb8", "score": "0.51233304", "text": "constructor() {\n super();\n this.queryURL = constants.ANGEL_COMPANIES_URL;\n this.getIdsURL = 'https://angel.co/company_filters/search_data?sort=signal&page=';\n this.currentPage = 1;\n this.retryAttempt = 0;\n this.companies = [];\n }", "title": "" }, { "docid": "9955b836f3da7d52ffa61243f6f78831", "score": "0.51027364", "text": "function autocomplete (req, res){\n\n var re = new RegExp(req.query.q, \"i\"); // i = case insensitive\n var limit = req.query.limit || 5;\n var customer = req.query.customer || \"\";\n\n if (limit<=0) {\n\n activityModel.find({ name: { $regex: re }})\n .and({customer: customer})\n .populate('skills rank')\n .then(function (results){ res.status(200).json(results) ;})\n .catch(function (err) { errorHandler.handleError(err, req, res) })\n }\n\n else {\n\n // If limit is more than zero. I assume the user wants the same amount of negative activities as possitive.\n // So the limit is used to filter both positive and negative. Thus the amount of activities that will be\n // returned will be 2 times the limit sent.\n\n var _resObj = [];\n var _promises = [];\n\n //Positive Activities\n var pos = activityModel.find({ name: { $regex: re }})\n .and({customer: customer})\n .and({\"reward.xp\": { $gt: 0}})\n .limit(limit)\n .populate('skills rank')\n .then(function (results){ _resObj = _.concat(_resObj, results); });\n\n //Negative Activities\n var neg = activityModel.find({ name: { $regex: re }})\n .and({customer: customer})\n .and({\"reward.xp\": { $lt: 0}})\n .limit(limit)\n .populate('skills rank')\n .then(function (results){ _resObj = _.concat(_resObj, results); });\n\n\n _promises.push(pos);\n _promises.push(neg);\n\n Promise.all(_promises)\n .then(function (results){ res.status(200).json(_resObj) ;})\n .catch(function (err) { errorHandler.handleError(err, req, res) })\n }\n }", "title": "" }, { "docid": "fc612a8c04aaf0ca8d6fd211fd880fb2", "score": "0.5099494", "text": "function setRange(namePrefix, minVal, maxVal) {\n //console.log(namePrefix, minVal, maxVal);\n\n globalFilters = validFilters['min-' + namePrefix](minVal, globalFilters);\n globalFilters = validFilters['max-' + namePrefix](maxVal, globalFilters);\n\n loadData(globalData, globalCsv, globalFilters);\n}", "title": "" }, { "docid": "5f571c228410648ae4ff73a07d65b9be", "score": "0.50957566", "text": "function companyUsers(input) {\n let bigObj = {};\n for ( let i = 0; i < input.length; i ++ ) {\n let currentStuff = input[i].split(' -> ');\n let company = currentStuff[0];\n let employeeID = currentStuff[1];\n if ( !bigObj.hasOwnProperty(company) ) {\n bigObj[company] = [];\n }\n if ( bigObj[company].indexOf(employeeID) === -1 ) {\n bigObj[company].push(employeeID);\n }\n }\n Object.keys(bigObj).sort((a,b) => a.localeCompare(b)).forEach(function(i) {\n console.log(i);\n for ( let j in bigObj[i]) {\n console.log('-- ' + bigObj[i][j]);\n }\n });\n}", "title": "" }, { "docid": "a19098c3143d2b82fe0f03344a6465b2", "score": "0.5093207", "text": "function filterByMinMaxPrice(minPrice, maxPrice) {\n $('.goods-list-block').each(function () {\n $(this).hide();\n let price = parseFloat($(this).find('.goods-price span').html());\n if( price >= parseFloat(minPrice) && price <= parseFloat(maxPrice) ) { \n $(this).show();\n }\n });\n }", "title": "" }, { "docid": "dc5a141a167d35337243d80aece6b2f6", "score": "0.50792706", "text": "function filterURL(page_no = '') {\n let filter_values = {\n price: {min: 0, max: 0},\n sort_by: '',\n categories: [],\n brands: []\n }\n\n // get all the values\n filter_values.price.min = document.getElementsByClassName('filter_price_min')[0].value;\n filter_values.price.max = document.getElementsByClassName('filter_price_max')[0].value;\n\n let cats = document.getElementsByClassName('filter_category');\n for (var i = 0; i < cats.length; i++) {\n if (cats[i].checked) {\n filter_values.categories.push(cats[i].value);\n }\n }\n\n let brands = document.getElementsByClassName('filter_brand');\n for (var i = 0; i < brands.length; i++) {\n if (brands[i].checked) {\n filter_values.brands.push(brands[i].value);\n }\n }\n\n filter_values.sort_by = document.getElementsByClassName('filter_sort_by')[0].value;\n let url = new URL(window.location.href);\n\n url.searchParams.delete('min');\n url.searchParams.delete('max');\n if (filter_values.price.min && filter_values.price.max) {\n url.searchParams.append('min', filter_values.price.min);\n url.searchParams.append('max', filter_values.price.max);\n }\n\n if (filter_values.sort_by == 'relevance') {\n url.searchParams.delete('sort_by');\n }\n\n url.searchParams.delete('categories');\n if (filter_values.categories.length > 0) {\n let x = '';\n for (var i = 0; i < filter_values.categories.length; i++) {\n x = x + filter_values.categories[i] +',';\n }\n url.searchParams.append('categories', x.substring(0, x.length - 1));\n }\n\n url.searchParams.delete('brands');\n if (filter_values.brands.length > 0) {\n let x = '';\n for (var i = 0; i < filter_values.brands.length; i++) {\n x = x + filter_values.brands[i] +',';\n }\n url.searchParams.append('brands', x.substring(0, x.length - 1));\n }\n\n url.searchParams.delete('sort_by');\n if (filter_values.sort_by) {\n if (filter_values.sort_by == 'relevance') {\n\n }else {\n url.searchParams.append('sort_by', filter_values.sort_by);\n }\n }\n url.searchParams.delete('page');\n if (page_no) {\n url.searchParams.append('page', page_no);\n }\n\n window.location.href = url.href;\n}", "title": "" }, { "docid": "e385fcbd0bb3a6752f9608948f2331fe", "score": "0.5067337", "text": "function filteryear(){\n let startYear = parseInt(FilterByYear.value) ;\n let endYear = parseInt(FilterByYearEnd.value) ;\n FilterByStatus.value = 'all'\n startYear = isNaN(startYear) ? -1 :startYear ;\n endYear = isNaN(endYear) ? 1000000 :endYear ;\n\n console.log(startYear,endYear)\n let temp = [ ] ;\n for( const app of allApps)\n if(app.AY >= startYear && app.AY+1 <= endYear)\n temp.push(app);\n displayAll(temp)\n}", "title": "" }, { "docid": "afdf75cd00577c12cc000b079f801425", "score": "0.5065994", "text": "function searchEmployee() {\n var names = [],\n userNames = [];\n\n searchBar.addEventListener('keyup', function(event) {\n var query = event.target.value.toLowerCase();\n for (var i = 0; i < employees.length; i++) {\n if (\n employees[i]['name']['first'].indexOf(query) > -1 ||\n employees[i]['name']['last'].indexOf(query) > -1 ||\n employees[i]['login']['username'].indexOf(query) > -1\n ) {\n cards[i].className = 'employees__card';\n } else {\n cards[i].className = 'employees__card--hidden';\n }\n }\n });\n}", "title": "" }, { "docid": "b2a82a3b1acece7e8043914bedb9e6d2", "score": "0.5063298", "text": "async filterCompanies(name) {\n let results = await JoblyApi.getCompaniesSearch(name);\n this.setState({ companies: results });\n }", "title": "" }, { "docid": "cf6fca22595d8ce25a9f46ae618fc482", "score": "0.5061371", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact.username.indexOf(lowercaseQuery) != -1);;\n };\n }", "title": "" }, { "docid": "6532bcffba21baeda5991830f066cfc7", "score": "0.5047593", "text": "filter(query) {\n let isCity, isType, isPrice;\n\n let prices = query.precio.split(';'); // obtiene el minimo y maximo precio de la consulta\n prices[MIN_PRICE] = parseInt(prices[MIN_PRICE]);\n prices[MAX_PRICE] = parseInt(prices[MAX_PRICE]);\n\n return DM._data.filter( o => {\n isCity = query.ciudad == '' ? true : query.ciudad == o.Ciudad;\n isType = query.tipo == '' ? true : query.tipo == o.Tipo;\n isPrice = o._precio >= prices[MIN_PRICE] && o._precio <= prices[MAX_PRICE];\n\n return isCity && isType && isPrice; // // si es de la ciudad y es del tipo solicitado y es del precio requerido pertenece al filtro\n });\n }", "title": "" }, { "docid": "47cf4ce2d24f78dc2d608b6afbec5ded", "score": "0.5042659", "text": "function filterJobs() {\n return jobs.filter(job => {\n if (search.length === 0) { return job }\n else {\n return job.title.toLowerCase().includes(search.toLowerCase()) || job.location[0].toLowerCase().includes(search.toLowerCase()) || job.industry.toString().toLowerCase().includes(search.toLowerCase())\n }\n })\n }", "title": "" }, { "docid": "7717eb33865b29e45aa8e61d2360adbc", "score": "0.50407994", "text": "byCompanyParams(props = this.props) {\n return `?units=${this.unit_ids(props)}${this.getDateParams(props)}`\n }", "title": "" }, { "docid": "ebbdcd4386fabc256a35a0f3e20ccdf8", "score": "0.5027223", "text": "onSearch(search) {\n // console.log(\"search:\", search)\n this.svalue = search; // for drop list when greater than 2 char\n let locationCount = 0; // count of location in list\n let agenciesCount = 0; // count of agencies in list\n\n this.filterdOptions = this.options.filter(s => {\n if (s.hasOwnProperty('group')) return true;\n\n if (s.type !== 'agency') {\n if (locationCount == 10) return false;\n let isOk = s.name.toLowerCase().includes(search.toLowerCase());\n\n if (isOk) locationCount++;\n\n return isOk;\n }\n\n if (s.type === 'agency') {\n if (agenciesCount == 10) return false;\n let isOk = s.name.toLowerCase().includes(search.toLowerCase());\n\n if (isOk) agenciesCount++;\n\n return isOk;\n }\n\n return false;\n });\n }", "title": "" }, { "docid": "4aa2770ae3006bfbd8bb876a848e1cfd", "score": "0.50254536", "text": "customQuery(record) {\n\t\tfunction generateRangeQuery(appbaseField) {\n\t\t\tif (record.length > 0) {\n\t\t\t\treturn record.map(singleRecord => ({\n\t\t\t\t\trange: {\n\t\t\t\t\t\t[appbaseField]: {\n\t\t\t\t\t\t\tgte: singleRecord.start,\n\t\t\t\t\t\t\tlte: singleRecord.end,\n\t\t\t\t\t\t\tboost: 2.0\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\t\tif (record) {\n\t\t\tconst query = {\n\t\t\t\tbool: {\n\t\t\t\t\tshould: generateRangeQuery(this.props.appbaseField),\n\t\t\t\t\tminimum_should_match: 1,\n\t\t\t\t\tboost: 1.0\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn query;\n\t\t}\n\t}", "title": "" }, { "docid": "9b9a9de2c8a5a67ca443f1e46fd127a9", "score": "0.50253606", "text": "function sqlJobFilter(filterData) {\n // hasEquity MUST BE LAST!!!\n // {title: 'Comp', minSalary: 50000, hasEquity: true} =>\n // ['\"TITLE\" LIKE \"%$1%\"', '\"salary\">=$2', '\"equity\">0']\n const keys = Object.keys(filterData)\n const values = Object.values(filterData)\n\n const cols = keys.map((colName, idx) => {\n if (colName === 'minSalary') {\n return `\"salary\">=$${idx + 1}`\n } else if (colName === 'title') {\n return `upper(${colName}) LIKE upper('%' || $${idx + 1} || '%')`\n } else if (colName === 'hasEquity') {\n // We do not want a boolean in the values passed to the query. This will remove the boolean no matter true or false. \n values.splice(idx, 1)\n\n if (filterData['hasEquity'] === true) {\n return `\"equity\">0`\n } else {\n return ''\n }\n }\n })\n\n return {\n // whereCriteria:\n // '\"NAME\" LIKE \"%$1%\" AND \"num_employees\"<=$2 AND \"num_employees\">=$3'\n whereCriteria: cols.join(' AND '),\n values: values,\n }\n}", "title": "" }, { "docid": "c021c3737f1115cf7da0663dd5a8ecae", "score": "0.50191706", "text": "function buildQueryNames(contact) {\n var filter = [];\n\n if (contact.givenName && contact.givenName.length > 0 &&\n contact.givenName[0].length > 0) {\n // First the name condition is put there\n FIRST_NAME_COND[2] = contact.givenName[0].toLowerCase();\n }\n else {\n // The condition will be false by definition\n FIRST_NAME_COND[2] = 'A';\n }\n\n filter.push(FIRST_NAME_COND.join(''));\n filter.push(' OR ');\n\n if (contact.familyName && contact.familyName.length > 0 &&\n contact.familyName[0].length > 0) {\n // First the name condition is put there\n LAST_NAME_COND[2] = contact.familyName[0].toLowerCase();\n }\n else {\n // The condition will be false by definition\n LAST_NAME_COND[2] = 'A';\n }\n\n filter.push(LAST_NAME_COND.join(''));\n\n SEARCH_QUERY[3] = filter.join('');\n\n var out = SEARCH_QUERY.join('');\n\n return out;\n }", "title": "" }, { "docid": "cd4b1a61f1ab333e114517d9490a042b", "score": "0.501768", "text": "function createFilterFor(query) {\n let lowercaseQuery = angular.lowercase(query);\n return (sub) => sub._lower_sub_name.indexOf(lowercaseQuery) === 0 || sub.sub_code.toString().indexOf(lowercaseQuery) === 0;\n }", "title": "" }, { "docid": "33f23e20bf16c0b44cc03f81ea92712a", "score": "0.5014092", "text": "function Filter_Contact_Entity_List() {\n // TODO: Change this to IndexedDB. This will remove the JSON.parse overhead\n //var json = JSON.parse(localStorage.getItem('Organization_Cache'));\n var json = $(\"#contacts\").data(\"JSON\");\n // Sanity checks\n if (json === null || json === undefined || jQuery.isEmptyObject(json)) {\n AdaHeads.Log(Log_Level.Error,\"Empty JSON\");\n return;\n }\n \n // Unhide every contact, if the search field is cleared\n if($(\"#Contact_Search_Field\").val() === \"\") {\n AdaHeads.Log(Log_Level.Debug,\"Search area cleared; showing all\");\n $.each(json.contacts, function(i,contact){\n $(\"#ce_id_\"+i).show();\n });\n return;\n }\n \n // Loop through every contact\n $.each(json.contacts, function(i,contact){\n var Matches = 0;\n var Number_Of_Keywords = -1;\n // Loop through every keyword in the search field\n var Keywords = $(\"#Contact_Search_Field\").val().toLowerCase().split(\" \");\n Number_Of_Keywords = Keywords.length;\n \n // Match each contact's name to each keyword\n $.each(Keywords, function(j,keyword) {\n /* The split returns an extra empty keyword when search string ends with \n a space. This is compensation. */\n if(keyword === \"\") {\n Number_Of_Keywords--;\n return;\n }\n \n // If any part of their names matches, we're good.\n if(contact.name.toLowerCase().indexOf(keyword) >= 0) {\n Matches++;\n AdaHeads.Log(Log_Level.Debug,contact.name.toLowerCase()+\" matches on \" + keyword);\n }\n \n /* At this point we can break, if we have already found every match.\n We should also break if the contact has no tags */\n if(Matches >= Number_Of_Keywords || contact.attributes.tags === undefined) {\n return;\n }\n \n // Otherwise we do a full search on tags\n $.each(contact.attributes.tags, function(j,tag) {\n if(tag.toLowerCase().indexOf(keyword) >= 0) {\n Matches++;\n AdaHeads.Log(Log_Level.Debug,contact.name+\"'s tag \"+tag +\" matches on \" + keyword);\n }\n });\n }); \n\n if(Matches >= Number_Of_Keywords) {\n $(\"#ce_id_\"+contact.db_columns.ce_id).show();\n }\n else {\n $(\"#ce_id_\"+contact.db_columns.ce_id).hide();\n // if this is the selected element, we must find another to make active\n if ($(\"#ce_id_\"+contact.db_columns.ce_id).hasClass('activeitem')) {\n $(\"#ce_id_\"+contact.db_columns.ce_id).removeClass('activeitem');\n $('.Contact_Entity').filter(\":visible\").first().addClass('activeitem');\n }\n }\n });\n}", "title": "" }, { "docid": "94a287ab436f3122e6aa0767a8e0a8a6", "score": "0.5006659", "text": "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n if (!$scope.options.hideOld) {\n return ((item.song_name.indexOf(lowercaseQuery) >= 0 && parseInt(item.gap_shows) <= 100));\n }\n else {\n return item.song_name.indexOf(lowercaseQuery) >= 0\n };\n };\n }", "title": "" }, { "docid": "18d296c4dedfe821b107f6eb90355872", "score": "0.4994524", "text": "getURLs(localBusinesses, filter, urlsNumber) {\n let city = '';\n let category = '';\n if (filter && filter.city) city = filter.city;\n if (filter && filter.category) category = filter.category;\n\n console.log('city index:'+this.cityIndex);\n console.log('city:'+this.citiesArray[this.cityIndex]);\n this.localBusinesses = localBusinesses;\n this.filtredLocalBusinesses = _.filter(this.localBusinesses, comp => comp.source === 'yelp');\n console.log(this.filtredLocalBusinesses.length+' local businesses from yelp');\n this.urlsNumber = urlsNumber || 100;\n let estimatedResultsPerPage = 10;\n\n //setting the query URL depending on the chosen category\n let paramsURL = '';\n\n if (!city) {\n if (this.citiesArray[this.cityIndex]) {\n city = this.citiesArray[this.cityIndex];\n } else {\n console.log('done with all cities, please add more.');\n return false;\n }\n }\n paramsURL = city.replace(/ /g, '+');\n console.log('scraping local businesses from '+city);\n\n if (city === 'New York') {\n this.filtredLocalBusinesses = _.filter(this.filtredLocalBusinesses, comp =>\n comp.city.toLowerCase() === 'new york' || comp.city.toLowerCase() === 'brooklyn' );\n } else {\n this.filtredLocalBusinesses = _.filter(this.filtredLocalBusinesses, comp => comp.city.toLowerCase() === city.toLowerCase() );\n }\n console.log(this.filtredLocalBusinesses.length+' '+city+' local businesses from yelp in db');\n if (category) {\n category = category.toLowerCase();\n this.filtredLocalBusinesses = _.filter(this.filtredLocalBusinesses, comp => {\n for(let i = 0; i < comp.categories.length; i++) {\n if (comp.categories[i].toLowerCase() === category.toLowerCase()) {\n return true;\n }\n }\n return false;\n });\n }\n\n //setting the page we'll start scraping on, basing on companies array.\n if (this.pageNumber === 0) {\n this.pageNumber = parseInt(this.filtredLocalBusinesses.length/estimatedResultsPerPage);\n if (this.pageNumber > this.maxPageNumber) this.pageNumber = this.maxPageNumber;\n if (category) this.pageNumber -= 5;\n if (this.pageNumber < 0) this.pageNumber = 0;\n }\n\n console.log('starting at page :'+this.pageNumber+' - 10 result per page');\n\n return new Promise((resolve) => {\n let urlsToReturn = [];\n\n this._scrapeForUrls(paramsURL, category, urlsToReturn, () => {\n console.log(urlsToReturn.length+' url returned from request');\n resolve(urlsToReturn);\n });\n\n });\n\n\n }", "title": "" }, { "docid": "12df0fe5e031cc697502e361fcb430ab", "score": "0.49932227", "text": "start(selector, data, max, search) {\n // If autocomplete container is already display\n if ( $('#autocomplete-container').length ) $('#autocomplete-container').remove()\n\n // Get the value of our input focus\n const value = selector.val()\n\n // If nothing is enter in our input, return\n if (!value) return\n\n // Set an empty array which contains our datas to give at our function which generate our list\n let array = []\n\n // Set a counter to display a certain number of elements on our list\n let count = 0\n\n // Map the entire object\n data.map((obj, pos) => {\n // If the number max is reached\n if (count === max) return\n\n const sch = obj[search]\n\n // Confront ville_code_postal and the value of our input\n if ( sch.substr(0, value.length).toLowerCase() === value.toLowerCase() ) {\n count += 1\n array.push(sch)\n }\n })\n\n // Function which generates our list display\n this.generateList(selector, array)\n }", "title": "" }, { "docid": "21e7f7a90ab8d8f7d78ab331d66226af", "score": "0.49917045", "text": "search(condition, study, keyword, types, statuses, countries, min, max) {\n // Replace variables in case they are falsy (e.g. empty string, null, undefined)\n condition = condition || '';\n study = study || '';\n\n //the following are arrays, because the dropdown menus contain checkboxes\n // console.log(statuses);\n\n this.loading = true;\n let queryBuilder = '';\n\n //CONDITION OR DISEASE\n if (condition !== '') queryBuilder = `Study%5D%28AREA%5BCondition%5D+${condition.replace(' ', '+')}`;\n\n //STUDY NAME\n if (study !== '') {\n if (queryBuilder != '') queryBuilder += '+AND+'; //if the previous inputs aren't filled in\n else queryBuilder += 'Study%5D%28';\n queryBuilder += `AREA%5BBriefTitle%5DCOVERAGE%5BContains%5DEXPANSION%5BConcept%5D+${study.replace(' ', '+')}`;\n }\n\n //OTHER TERMS\n if (keyword !== '') {\n if (queryBuilder != '') queryBuilder += '+AND+'; //if the previous inputs aren't filled in\n else queryBuilder += 'Study%5D%28';\n queryBuilder += `AREA%5BInterventionName%5DCOVERAGE%5BContains%5DEXPANSION%5BLossy%5D+${keyword.replace(' ', '+')}+OR+AREA%5BInterventionOtherName%5DCOVERAGE%5BContains%5DEXPANSION%5BLossy%5D+${keyword.replace(' ', '+')}`;\n }\n\n //STUDY TYPE\n if (JSON.stringify(types) != JSON.stringify(['dropdown', 'div-filter'])) {\n if (queryBuilder != '') queryBuilder += '+AND+'; //if the previous inputs aren't filled in\n else queryBuilder += 'Study%5D%28';\n queryBuilder += `AREA%5BStudyType%5DCOVERAGE%5BFullMatch%5DEXPANSION%5BNone%5D+%28${types[0].replace(/_/g, '+')}`;\n if (statuses.length > 1)\n for(let i = 1; i < types.length; i++) queryBuilder += `+OR+${types[i].replace(/_/g, '+')}`;\n queryBuilder += '%29';\n }\n\n //STATUS\n if (JSON.stringify(statuses) != JSON.stringify(['dropdown', 'div-filter'])) {\n if(statuses[0] == 'Active_not_recruiting') statuses[0] = 'Active,_not_recruiting';\n\n if (queryBuilder != '') queryBuilder += '+AND+'; //if the previous inputs aren't filled in\n else queryBuilder += 'Study%5D%28';\n queryBuilder += `AREA%5BOverallStatus%5DCOVERAGE%5BFullMatch%5DEXPANSION%5BNone%5D+%28${statuses[0].replace(/_/g, '+')}`;\n if (statuses.length > 1)\n for(let i = 1; i < statuses.length; i++) queryBuilder += `+OR+${statuses[i].replace(/_/g, '+')}`;\n queryBuilder += '%29';\n }\n\n //COUNTRY\n if (JSON.stringify(countries) != JSON.stringify(['dropdown', 'div-filter'])) {\n if (queryBuilder != '') queryBuilder += '%29+AND+SEARCH%5B'; //if the previous inputs aren't filled in\n queryBuilder += `Location%5D%28AREA%5BLocationCountry%5DCOVERAGE%5BFullMatch%5DEXPANSION%5BNone%5D+%28${countries[0].replace(/_/g, '+')}`;\n if (countries.length > 1)\n for(var i = 1; i < countries.length; i++) queryBuilder += `+OR+${countries[i].replace(/_/g, '+')}`;\n queryBuilder += '%29';\n }\n\n // console.log(\"Query:\" + queryBuilder);\n\n if (queryBuilder == '') {\n window.alert('Fill in at least one search input!');\n return;\n }\n\n queryBuilder += `%29&fields=${this.fields}`;\n if (min != '' && max != '') queryBuilder += `&min_rnk=${min}&max_rnk=${max}`;\n // Search and notify observers that the results have changed\n this.retrieve(this.baseUrl + this.query + queryBuilder)\n .then((data) => {\n this.notifyObservers({\n searchResults: data.StudyFieldsResponse.StudyFields,\n NStudiesFound: data.StudyFieldsResponse.NStudiesFound,\n param: [condition, study, keyword, types, statuses, countries],\n minRank : data.StudyFieldsResponse.MinRank,\n maxRank : data.StudyFieldsResponse.MaxRank});\n this.map=true;\n this.loading = false;\n });\n }", "title": "" }, { "docid": "42897cf3e7618f8645dd8269cd670a7b", "score": "0.49881896", "text": "getFilterVal(contentTiers, filterVal) {\n if (filterVal != undefined && filterVal.contentTierName != undefined) {\n var contentTierName = filterVal.contentTierName.toLowerCase();\n var product = filterVal.product.toLowerCase();\n return (contentTiers.filter(obj => (contentTierName != \"\" ? obj.name.toLowerCase().indexOf(contentTierName) != -1 : true)\n && (product != \"\" ? matchProducts(obj.products, product) : true)\n ));\n }\n else\n return contentTiers;\n }", "title": "" }, { "docid": "5a0abacc209c399954f257b5abad7da2", "score": "0.49829373", "text": "function filterPrice(arr, min=0, max=99999999) {\n var tmp_arr = arr.filter(watch => watch.price > min && watch.price < max);\n fillArticluleHolder(tmp_arr);\n getNUmberOfFoundWatchesAfterFiltering();\n dataJSON_MAIN_TEMP_COPY = (tmp_arr !== dataJSON_MAIN_TEMP_COPY) ? tmp_arr : dataJSON_MAIN;\n}", "title": "" }, { "docid": "6fc6520b196414ab45022c7682c2d8e5", "score": "0.49821097", "text": "createFilterFor(query) {\n let lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n }", "title": "" }, { "docid": "4361f73338890f26fdefe1a6699c1e00", "score": "0.49804303", "text": "customQuery(record) {\n\t\tif (record) {\n\t\t\treturn {\n\t\t\t\trange: {\n\t\t\t\t\t[this.props.appbaseField]: {\n\t\t\t\t\t\tgte: record.start,\n\t\t\t\t\t\tlte: record.end,\n\t\t\t\t\t\tboost: 2.0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}", "title": "" }, { "docid": "8b5b41f362d89c68913f794d5240ab13", "score": "0.4973769", "text": "function maxAgeFilter(){\n\t// takes value from max age select\n\tvar maxAge = document.getElementById('maxAgeSelector').value;\n\tclear();\n\t// No max age selected\n\tif(maxAge == 1){\n\t\tmaximumAge = 99;\n\t}\n\t// Older than U9\n\telse if(maxAge == 2){\n\t\tmaximumAge = 9;\n\t}\n\t// Older than U11\n\telse if(maxAge == 3){\n\t\tmaximumAge = 11;\n\t}\n\t// Older than U13\n\telse if(maxAge == 4){\n\t\tmaximumAge = 13;\n\t}\n\t// Older than U15\n\telse if(maxAge == 5){\n\t\tmaximumAge = 15;\n\t}\n\t// Older than U17\n\telse if(maxAge == 6){\n\t\tmaximumAge = 17;\n\t}\n\t// Older than U20\n\telse if(maxAge == 7){\n\t\tmaximumAge = 20;\n\t}\n\twriteFilterFencerInfo();\n\topenMemberInfo();\n}", "title": "" }, { "docid": "c40fccb1f0a6ce64e4e2ed46f89a4da6", "score": "0.49578738", "text": "filterSearch(userInputSearch) {\n return this.contacts.filter(element => element.name.toLowerCase().includes(userInputSearch.toLowerCase()));\n // Se volessi filtrare solo i nomi che iniziano con dovrei usare strartsWith()\n }", "title": "" }, { "docid": "13bea0a2dad80c5a1b06fed4bd24e533", "score": "0.495459", "text": "function search(){\r\n\t\r\n\t// topical keywords\r\n\t//keywords = document.getElementById('keyword').value;\r\n\tkeywords = document.getElementById('keywordinput').value;\r\n\t\r\n\t// query geographic extent\r\n\tlatmin = document.getElementById('latmin').value;\r\n\tlatmax = document.getElementById('latmax').value;\r\n\tlongmin = document.getElementById('longmin').value;\r\n\tlongmax = document.getElementById('longmax').value;\r\n\textent = [longmin, latmin, longmax, latmax];\r\n\tsearchExtent = \"searchExtent=[\" + extent + \"]\";\r\n\t\r\n\t// maximum number of records returned\r\n\tmaxRecs = 20;\r\n\r\n\t// limit category to \"Data\"\r\n\tcategory = \"filter=browseCategory=Data\";\r\n\t\r\n\t// limit type to \"Shapefile\" OR \"GeoTIFF\"\r\n\ttype = \"filter=browseType=Shapefile&filter=browseType=GeoTIFF&conjunction=browseType=OR\"\r\n\t\r\n\t// limit extention to \"Shapefile\" OR \"Raster\"\r\n\textention = \"filter=facets.facetName=Raster&filter=facets.facetName=Shapefile&conjunction=facets.facetName=OR\";\t\r\n\t\r\n\t// retrieve title in query\r\n\tfields = \"fields=title\";\r\n\t\r\n\t// query results returned in json format\r\n\tformat = \"format=json\";\t\r\n\t\r\n\t// concatenate query parameters into a single string\r\n\tparastring = \"q=\" + keywords\r\n\t\t\t\t + \"&\" + searchExtent\r\n\t + \"&max=\" + maxRecs\r\n\t + \"&\" + category\r\n\t + \"&\" + type\r\n\t + \"&\" + extention\r\n\t + \"&\" + fields \r\n\t + \"&\" + format;\r\n\t\r\n\t// use HTTP GET to perform query\r\n\t$.get(\"https://www.sciencebase.gov/catalog/items?\"+parastring, showList);\t\r\n}", "title": "" }, { "docid": "9ca7fffa77f2385b29f8a38d360815eb", "score": "0.49501306", "text": "handleFilterVenues() {\n const {\n props: { venues },\n state: { query }\n } = this;\n\n if (query.trim() !== '') {\n const matchingVenues = venues.filter((venue) =>\n venue.name\n .toLowerCase()\n .replace(/[^\\w ]/gi, '')\n .trim()\n .includes(\n query\n .toLowerCase()\n .replace(/[^\\w ]/gi, '')\n .trim()\n )\n );\n return matchingVenues;\n } else {\n return venues;\n }\n }", "title": "" }, { "docid": "56674f90b372b47f112edd87bb3b2ba1", "score": "0.4948777", "text": "function searchByPublicationYear(yearLowerBound, yearUpperBound) {\n // TODO\n}", "title": "" }, { "docid": "cd8895b434946e8c3e914768b42d91f9", "score": "0.49472398", "text": "function search() {\n\tvar a = $('#inputFieldAddress').val();\n\tvar q = $('#inputFieldQuery').val();\n\tvar max_num = $('#maxNum').val();\n\n\tif (max_num == \"\") {\n\t\tmax_num=20;\n\t}\n\n\tif (q == \"\" || q == null || q == undefined) {\n\t\tlocation.href='/';\n\t} else {\n\t\t//parse special char\n\t\tvar entry = { \"'\": \"&apos;\", '\"': '&quot;', '<': '&lt;', '>': '&gt;' };\n\t\ta = a.replace(/(['\")-><&\\\\\\/\\.])/g, function ($0) { return entry[$0] || $0; });\n\t\tq = q.replace(/(['\")-><&\\\\\\/\\.])/g, function ($0) { return entry[$0] || $0; });\n\n\t\tvar string = '/query?a='+a+'&q='+q+'&max_num='+max_num;\n\t\tlocation.href = string;\n\t};\n\n}", "title": "" }, { "docid": "64c6f7fa803bf863ed88e41b1ba72d23", "score": "0.49457294", "text": "function parse_search_results_company(b_algo,b_name,b_url,b_caption,p_caption,type) {\n var dash_re=/\\s[-\\|]\\s.*$/;\n var buzzfile_re=/^(.*)?\\sin\\s([^,]*),\\s([A-Z]{2})/,match;\n if(/(linkedin|corporationwiki|facebook)\\.com/.test(b_url)) {\n my_query.fields.company_name=b_name.replace(dash_re,\"\").trim();\n return true;\n }\n if(/buzzfile\\.com/.test(b_url)&&(match=b_name.match(buzzfile_re))) {\n Object.assign(my_query.fields,{company_name:match[1].trim(),person_geo_city:match[2].trim(),\n person_geo_state:match[3].trim(),country:\"United States of America\"});\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "5716f7c4c64c742413515cc1d927746c", "score": "0.49326473", "text": "filterLogic (authors, searchQuery) {\n return (\n authors.filter(\n item => item.name.toLowerCase().indexOf(searchQuery.toLowerCase()) >= 0\n )\n )\n }", "title": "" }, { "docid": "768b9f5d05daa2324e44457a0b835db4", "score": "0.49229258", "text": "function createFiltersFromQueryParams(request) {\n let clause = \"1=1\";\n let countries = getQueryParamValueByName(request, \"countries\");\n if (countries.length > 0) {\n const re = /(,)/g;\n const subst = '\"$1\"';\n clause += \" AND country IN (\\\"\";\n countries = countries.replace(re, subst)\n clause += countries;\n clause += \"\\\") \";\n }\n let years = getQueryParamValueByName(request, \"years\");\n if (years.length > 0) {\n clause += \" AND year IN (\";\n clause += years;\n clause += \");\";\n }\n return clause;\n}", "title": "" }, { "docid": "6756f15d3de7dbb6054759e59fbae53b", "score": "0.49194795", "text": "dynamicSearch() {\n return this.state.people.filter((people) => people.nome.toLowerCase().includes(this.state.searchTitle.toLowerCase()));\n }", "title": "" } ]
621441ac3a97bb97607b65289c168736
Santa's little helpers populates missing values
[ { "docid": "353d317e102def4e0349a35888431306", "score": "0.5091269", "text": "function populate(dst, src) {\n for (var prop in src) {\n if (!dst[prop]) dst[prop] = src[prop];\n }\n return dst;\n}", "title": "" } ]
[ { "docid": "39b5d5aec7c90450caa6564ab1144203", "score": "0.6068826", "text": "function setundefinedtovalue() {\n for (const field in getdata) {\n if (getdata[field] === undefined) {\n getdata = { ...getdata, [field]: user[field] };\n }\n }\n }", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "888a72ec1ed8e679d3a55a6c98702ef5", "score": "0.58660793", "text": "function missingValue(arr){\n\n}", "title": "" }, { "docid": "e9044f1f141ea6a41e8c84b0b8f4984b", "score": "0.5864518", "text": "function populateBlank(ltr,hits) {\n //iterate hits\n hits.forEach((e) => {\n blank[e] = ltr;\n });\n }", "title": "" }, { "docid": "af8ab96e87583b391f2b243d70f62cae", "score": "0.5815107", "text": "function setDefaultValues()\n{\n return [54, undefined, -127, \"sunshine\"];\n}", "title": "" }, { "docid": "40a40845fcf0de46df587d75c3fa3f11", "score": "0.5811462", "text": "function fillUndefineds (items) {\n var statuses = ['name', 'attack', 'defense', 'dig', 'life', 'delay', 'popularity', 'delay_item', 'popularity', 'shield']\n \n items.forEach(function (item) {\n statuses.forEach(function (status) {\n if (item[status] === undefined) {\n item[status] = 0\n }\n })\n })\n}", "title": "" }, { "docid": "c15f90697c74eba197e3b260bb62f4cd", "score": "0.57362", "text": "function missingValue(unorderedNums) {}", "title": "" }, { "docid": "495956348695e993f5dbe95fbd7416bc", "score": "0.5545979", "text": "_initializeStartingValues() {\n const data = this.getGurpsActorData()\n data.currentdodge = 0 // start at zero, and bonuses will add, and then they will be finalized later\n if (!!data.equipment && !data.equipment.carried) data.equipment.carried = {} // data protection\n if (!!data.equipment && !data.equipment.other) data.equipment.other = {}\n\n if (!data.migrationversion) return // Prior to v0.9.6, this did not exist\n let v = /** @type {SemanticVersion} */ (SemanticVersion.fromString(data.migrationversion))\n\n // Attributes need to have 'value' set because Foundry expects objs with value and max to be attributes (so we can't use currentvalue)\n // Need to protect against data errors\n for (const attr in data.attributes) {\n if (typeof data.attributes[attr] === 'object' && data.attributes[attr] !== null)\n if (isNaN(data.attributes[attr].import)) data.attributes[attr].value = 0\n else data.attributes[attr].value = parseInt(data.attributes[attr].import)\n }\n // After all of the attributes are copied over, apply tired to ST\n if (!!data.additionalresources.isTired)\n data.attributes.ST.value = Math.ceil(parseInt(data.attributes.ST.value.toString()) / 2)\n recurselist(data.skills, (e, k, d) => {\n // @ts-ignore\n e.level = parseInt(+e.import)\n })\n recurselist(data.spells, (e, k, d) => {\n // @ts-ignore\n e.level = parseInt(+e.import)\n })\n\n // we don't really need to use recurselist for melee/ranged... but who knows, they may become hierarchical in the future\n recurselist(data.melee, (e, k, d) => {\n if (!!e.import) {\n e.level = parseInt(e.import)\n if (!isNaN(parseInt(e.parry))) {\n // allows for '14f' and 'no'\n let base = 3 + Math.floor(e.level / 2)\n let bonus = parseInt(e.parry) - base\n if (bonus != 0) {\n e.parrybonus = (bonus > 0 ? '+' : '') + bonus\n }\n }\n if (!isNaN(parseInt(e.block))) {\n let base = 3 + Math.floor(e.level / 2)\n let bonus = parseInt(e.block) - base\n if (bonus != 0) {\n e.blockbonus = (bonus > 0 ? '+' : '') + bonus\n }\n }\n } else {\n e.parrybonus = e.parry\n e.blockbonus = e.block\n }\n })\n\n recurselist(data.ranged, (e, k, d) => {\n e.level = parseInt(e.import)\n })\n\n // Only prep hitlocation DRs from v0.9.7 or higher (we don't really need to use recurselist... but who knows, hitlocations may become hierarchical in the future)\n if (!v.isLowerThan(settings.VERSION_097))\n recurselist(data.hitlocations, (e, k, d) => {\n e.dr = e.import\n })\n }", "title": "" }, { "docid": "1129d02f87a82ee394e5d0903181169c", "score": "0.55148005", "text": "function missing(){}", "title": "" }, { "docid": "f4748da18469c3cff0135e8778c96ffc", "score": "0.5437385", "text": "function stoogeInit(x) {\n deathAge = computeAgeAtDeath(x);\n x['ageAtDeath'] = deathAge;\n x['oldestAgeAtDeath'] = deathAge;\n x['oldestSoFar'] = x['name'];\n return x;\n}", "title": "" }, { "docid": "dd1e37caebbd93a48b6f16846dca37e5", "score": "0.5434491", "text": "function defaults(dst,src){forEach(src,function(value,key){if(!isDefined(dst[key])){dst[key]=value;}});}", "title": "" }, { "docid": "dd1e37caebbd93a48b6f16846dca37e5", "score": "0.5434491", "text": "function defaults(dst,src){forEach(src,function(value,key){if(!isDefined(dst[key])){dst[key]=value;}});}", "title": "" }, { "docid": "dd1e37caebbd93a48b6f16846dca37e5", "score": "0.5434491", "text": "function defaults(dst,src){forEach(src,function(value,key){if(!isDefined(dst[key])){dst[key]=value;}});}", "title": "" }, { "docid": "1158221003f3e1687e4697617bef0399", "score": "0.5424317", "text": "empties() {\n let e = [];\n for (let x = 0; x < 9; x++) {\n for (let y = 0; y < 9; y++) {\n if (this.items[x][y] === undefined) {\n e.push({x, y});\n }\n }\n }\n return e;\n }", "title": "" }, { "docid": "03578194a0d96cafc0216149dcb4637a", "score": "0.5401141", "text": "function assignRandomValues() {\n const possibleValues = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n\n gem1val = getRandomIndex(possibleValues)\n gem2val = getRandomIndex(possibleValues)\n gem3val = getRandomIndex(possibleValues)\n gem4val = getRandomIndex(possibleValues)\n }", "title": "" }, { "docid": "345931f0ea4e4353703e435d58a2cf57", "score": "0.53773946", "text": "function _fillMissingFields(attrs) {\n var attr;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n\n // populate missing name\n if(typeof attr.name === 'undefined') {\n if(attr.type && attr.type in pki.oids) {\n attr.name = pki.oids[attr.type];\n } else if(attr.shortName && attr.shortName in _shortNames) {\n attr.name = pki.oids[_shortNames[attr.shortName]];\n }\n }\n\n // populate missing type (OID)\n if(typeof attr.type === 'undefined') {\n if(attr.name && attr.name in pki.oids) {\n attr.type = pki.oids[attr.name];\n } else {\n var error = new Error('Attribute type not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n\n // populate missing shortname\n if(typeof attr.shortName === 'undefined') {\n if(attr.name && attr.name in _shortNames) {\n attr.shortName = _shortNames[attr.name];\n }\n }\n\n // convert extensions to value\n if(attr.type === oids.extensionRequest) {\n attr.valueConstructed = true;\n attr.valueTagClass = asn1.Type.SEQUENCE;\n if(!attr.value && attr.extensions) {\n attr.value = [];\n for(var ei = 0; ei < attr.extensions.length; ++ei) {\n attr.value.push(pki.certificateExtensionToAsn1(\n _fillMissingExtensionFields(attr.extensions[ei])));\n }\n }\n }\n\n if(typeof attr.value === 'undefined') {\n var error = new Error('Attribute value not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n}", "title": "" }, { "docid": "345931f0ea4e4353703e435d58a2cf57", "score": "0.53773946", "text": "function _fillMissingFields(attrs) {\n var attr;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n\n // populate missing name\n if(typeof attr.name === 'undefined') {\n if(attr.type && attr.type in pki.oids) {\n attr.name = pki.oids[attr.type];\n } else if(attr.shortName && attr.shortName in _shortNames) {\n attr.name = pki.oids[_shortNames[attr.shortName]];\n }\n }\n\n // populate missing type (OID)\n if(typeof attr.type === 'undefined') {\n if(attr.name && attr.name in pki.oids) {\n attr.type = pki.oids[attr.name];\n } else {\n var error = new Error('Attribute type not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n\n // populate missing shortname\n if(typeof attr.shortName === 'undefined') {\n if(attr.name && attr.name in _shortNames) {\n attr.shortName = _shortNames[attr.name];\n }\n }\n\n // convert extensions to value\n if(attr.type === oids.extensionRequest) {\n attr.valueConstructed = true;\n attr.valueTagClass = asn1.Type.SEQUENCE;\n if(!attr.value && attr.extensions) {\n attr.value = [];\n for(var ei = 0; ei < attr.extensions.length; ++ei) {\n attr.value.push(pki.certificateExtensionToAsn1(\n _fillMissingExtensionFields(attr.extensions[ei])));\n }\n }\n }\n\n if(typeof attr.value === 'undefined') {\n var error = new Error('Attribute value not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n}", "title": "" }, { "docid": "345931f0ea4e4353703e435d58a2cf57", "score": "0.53773946", "text": "function _fillMissingFields(attrs) {\n var attr;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n\n // populate missing name\n if(typeof attr.name === 'undefined') {\n if(attr.type && attr.type in pki.oids) {\n attr.name = pki.oids[attr.type];\n } else if(attr.shortName && attr.shortName in _shortNames) {\n attr.name = pki.oids[_shortNames[attr.shortName]];\n }\n }\n\n // populate missing type (OID)\n if(typeof attr.type === 'undefined') {\n if(attr.name && attr.name in pki.oids) {\n attr.type = pki.oids[attr.name];\n } else {\n var error = new Error('Attribute type not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n\n // populate missing shortname\n if(typeof attr.shortName === 'undefined') {\n if(attr.name && attr.name in _shortNames) {\n attr.shortName = _shortNames[attr.name];\n }\n }\n\n // convert extensions to value\n if(attr.type === oids.extensionRequest) {\n attr.valueConstructed = true;\n attr.valueTagClass = asn1.Type.SEQUENCE;\n if(!attr.value && attr.extensions) {\n attr.value = [];\n for(var ei = 0; ei < attr.extensions.length; ++ei) {\n attr.value.push(pki.certificateExtensionToAsn1(\n _fillMissingExtensionFields(attr.extensions[ei])));\n }\n }\n }\n\n if(typeof attr.value === 'undefined') {\n var error = new Error('Attribute value not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n}", "title": "" }, { "docid": "345931f0ea4e4353703e435d58a2cf57", "score": "0.53773946", "text": "function _fillMissingFields(attrs) {\n var attr;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n\n // populate missing name\n if(typeof attr.name === 'undefined') {\n if(attr.type && attr.type in pki.oids) {\n attr.name = pki.oids[attr.type];\n } else if(attr.shortName && attr.shortName in _shortNames) {\n attr.name = pki.oids[_shortNames[attr.shortName]];\n }\n }\n\n // populate missing type (OID)\n if(typeof attr.type === 'undefined') {\n if(attr.name && attr.name in pki.oids) {\n attr.type = pki.oids[attr.name];\n } else {\n var error = new Error('Attribute type not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n\n // populate missing shortname\n if(typeof attr.shortName === 'undefined') {\n if(attr.name && attr.name in _shortNames) {\n attr.shortName = _shortNames[attr.name];\n }\n }\n\n // convert extensions to value\n if(attr.type === oids.extensionRequest) {\n attr.valueConstructed = true;\n attr.valueTagClass = asn1.Type.SEQUENCE;\n if(!attr.value && attr.extensions) {\n attr.value = [];\n for(var ei = 0; ei < attr.extensions.length; ++ei) {\n attr.value.push(pki.certificateExtensionToAsn1(\n _fillMissingExtensionFields(attr.extensions[ei])));\n }\n }\n }\n\n if(typeof attr.value === 'undefined') {\n var error = new Error('Attribute value not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n}", "title": "" }, { "docid": "345931f0ea4e4353703e435d58a2cf57", "score": "0.53773946", "text": "function _fillMissingFields(attrs) {\n var attr;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n\n // populate missing name\n if(typeof attr.name === 'undefined') {\n if(attr.type && attr.type in pki.oids) {\n attr.name = pki.oids[attr.type];\n } else if(attr.shortName && attr.shortName in _shortNames) {\n attr.name = pki.oids[_shortNames[attr.shortName]];\n }\n }\n\n // populate missing type (OID)\n if(typeof attr.type === 'undefined') {\n if(attr.name && attr.name in pki.oids) {\n attr.type = pki.oids[attr.name];\n } else {\n var error = new Error('Attribute type not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n\n // populate missing shortname\n if(typeof attr.shortName === 'undefined') {\n if(attr.name && attr.name in _shortNames) {\n attr.shortName = _shortNames[attr.name];\n }\n }\n\n // convert extensions to value\n if(attr.type === oids.extensionRequest) {\n attr.valueConstructed = true;\n attr.valueTagClass = asn1.Type.SEQUENCE;\n if(!attr.value && attr.extensions) {\n attr.value = [];\n for(var ei = 0; ei < attr.extensions.length; ++ei) {\n attr.value.push(pki.certificateExtensionToAsn1(\n _fillMissingExtensionFields(attr.extensions[ei])));\n }\n }\n }\n\n if(typeof attr.value === 'undefined') {\n var error = new Error('Attribute value not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n}", "title": "" }, { "docid": "345931f0ea4e4353703e435d58a2cf57", "score": "0.53773946", "text": "function _fillMissingFields(attrs) {\n var attr;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n\n // populate missing name\n if(typeof attr.name === 'undefined') {\n if(attr.type && attr.type in pki.oids) {\n attr.name = pki.oids[attr.type];\n } else if(attr.shortName && attr.shortName in _shortNames) {\n attr.name = pki.oids[_shortNames[attr.shortName]];\n }\n }\n\n // populate missing type (OID)\n if(typeof attr.type === 'undefined') {\n if(attr.name && attr.name in pki.oids) {\n attr.type = pki.oids[attr.name];\n } else {\n var error = new Error('Attribute type not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n\n // populate missing shortname\n if(typeof attr.shortName === 'undefined') {\n if(attr.name && attr.name in _shortNames) {\n attr.shortName = _shortNames[attr.name];\n }\n }\n\n // convert extensions to value\n if(attr.type === oids.extensionRequest) {\n attr.valueConstructed = true;\n attr.valueTagClass = asn1.Type.SEQUENCE;\n if(!attr.value && attr.extensions) {\n attr.value = [];\n for(var ei = 0; ei < attr.extensions.length; ++ei) {\n attr.value.push(pki.certificateExtensionToAsn1(\n _fillMissingExtensionFields(attr.extensions[ei])));\n }\n }\n }\n\n if(typeof attr.value === 'undefined') {\n var error = new Error('Attribute value not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n}", "title": "" }, { "docid": "345931f0ea4e4353703e435d58a2cf57", "score": "0.53773946", "text": "function _fillMissingFields(attrs) {\n var attr;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n\n // populate missing name\n if(typeof attr.name === 'undefined') {\n if(attr.type && attr.type in pki.oids) {\n attr.name = pki.oids[attr.type];\n } else if(attr.shortName && attr.shortName in _shortNames) {\n attr.name = pki.oids[_shortNames[attr.shortName]];\n }\n }\n\n // populate missing type (OID)\n if(typeof attr.type === 'undefined') {\n if(attr.name && attr.name in pki.oids) {\n attr.type = pki.oids[attr.name];\n } else {\n var error = new Error('Attribute type not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n\n // populate missing shortname\n if(typeof attr.shortName === 'undefined') {\n if(attr.name && attr.name in _shortNames) {\n attr.shortName = _shortNames[attr.name];\n }\n }\n\n // convert extensions to value\n if(attr.type === oids.extensionRequest) {\n attr.valueConstructed = true;\n attr.valueTagClass = asn1.Type.SEQUENCE;\n if(!attr.value && attr.extensions) {\n attr.value = [];\n for(var ei = 0; ei < attr.extensions.length; ++ei) {\n attr.value.push(pki.certificateExtensionToAsn1(\n _fillMissingExtensionFields(attr.extensions[ei])));\n }\n }\n }\n\n if(typeof attr.value === 'undefined') {\n var error = new Error('Attribute value not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n}", "title": "" }, { "docid": "345931f0ea4e4353703e435d58a2cf57", "score": "0.53773946", "text": "function _fillMissingFields(attrs) {\n var attr;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n\n // populate missing name\n if(typeof attr.name === 'undefined') {\n if(attr.type && attr.type in pki.oids) {\n attr.name = pki.oids[attr.type];\n } else if(attr.shortName && attr.shortName in _shortNames) {\n attr.name = pki.oids[_shortNames[attr.shortName]];\n }\n }\n\n // populate missing type (OID)\n if(typeof attr.type === 'undefined') {\n if(attr.name && attr.name in pki.oids) {\n attr.type = pki.oids[attr.name];\n } else {\n var error = new Error('Attribute type not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n\n // populate missing shortname\n if(typeof attr.shortName === 'undefined') {\n if(attr.name && attr.name in _shortNames) {\n attr.shortName = _shortNames[attr.name];\n }\n }\n\n // convert extensions to value\n if(attr.type === oids.extensionRequest) {\n attr.valueConstructed = true;\n attr.valueTagClass = asn1.Type.SEQUENCE;\n if(!attr.value && attr.extensions) {\n attr.value = [];\n for(var ei = 0; ei < attr.extensions.length; ++ei) {\n attr.value.push(pki.certificateExtensionToAsn1(\n _fillMissingExtensionFields(attr.extensions[ei])));\n }\n }\n }\n\n if(typeof attr.value === 'undefined') {\n var error = new Error('Attribute value not specified.');\n error.attribute = attr;\n throw error;\n }\n }\n}", "title": "" }, { "docid": "d0a8a50d27a5055772e08732f6fb639a", "score": "0.536251", "text": "function v(t){const e=t[f];if(!e||null==e.$__.populated)return;const n=Object.keys(e.$__.populated).filter(e=>e.startsWith(t[p]+\".\"));for(const r of n){const n=r.slice((t[p]+\".\").length);Array.isArray(e.$__.populated[r].value)&&(e.$__.populated[r].value=t.map(t=>t.populated(n)))}}", "title": "" }, { "docid": "1435b3bb9763000b6a6a104bdc7d44f4", "score": "0.53288907", "text": "async setMissingUserIDs() {\n const membersSheet = await this.sheetsAPI.loadMemberIDs();\n\n const original = membersSheet.data;\n const updated = lib.setMissingUserIDs(original);\n\n await membersSheet.reconciliateFn(updated);\n return {};\n }", "title": "" }, { "docid": "01a5b39ade719de48481b158d99b8e26", "score": "0.5322577", "text": "fix_accounts(newAccount, accounts, holdings) {\n console.log(newAccount);\n //If account already exists just want to extract values\n let accountNames = this.get_names(accounts);\n let accountName = newAccount.name;\n delete newAccount.name;\n //all the holding names, new ones included\n let holdingNames = this.get_names(holdings);\n\n if (accountNames.includes(accountName)){\n //account already exists\n //need to just append the new keys to the account\n let currAccount = accounts.find(savedAcc => savedAcc.name === accountName);\n Object.keys(newAccount).map((holdingName) => {\n currAccount.values[holdingName] = newAccount.holdingName;\n });\n // currAccount.values = newAccount;\n } else {\n //If not an existing account we will just create a new one\n // need to set values of other holding to zero in this account\n \n for (let i = 0; i < holdingNames.length; i++){\n if (!(holdingNames[i] in newAccount)){\n //set values of holdings not in this account to zero\n newAccount[holdingNames[i]] = 0;\n }\n }\n accounts.push({name: accountName, values: newAccount, limit: -1, id: (accounts[accounts.length - 1].id + 1)});\n }\n //Also need to update the holdings of the other accounts to reflect read holdings\n for (let i = 0; i < accounts.length; i++){\n let currAccount = accounts[i];\n let currHoldings = Object.keys(currAccount.values);\n holdingNames.map((name) => {\n //want to initialize it to zero if not found in account already\n if (!(currHoldings.includes(name))){\n currAccount.values[name] = 0;\n }\n });\n\n }\n return {accounts: accounts, newAccount: accountName};\n }", "title": "" }, { "docid": "84e466272f32ddfb0acbc3205f191d11", "score": "0.5291936", "text": "function setInitialVals () {\n for (i=0; i<10; i++) {\n \n random_int = Math.round (Math.random (1,10) * 100), \n\n entities[i]=\n { \n // we might like to have name related to the enitity's ranking\n name: \"entity_\" + random_int.toString(), \n\n // we assume that the ranking assumes values from 1 to 100 \n ranking: random_int, \n }\n\n\n }\n}", "title": "" }, { "docid": "1ce643bbe7266b4b68ccb40c8688fbbb", "score": "0.5271229", "text": "function applyMissingYearValues(arr_missing_year_groups) {\n\n var idx = 0;\n\n arr_missing_year_groups.forEach( (year_group) => {\n\n //get the first item in the sequence e.g 1911 and -1 \n //then search on the 1910 which we will have in the data\n start_sequence_year = year_group[0] - 1;\n //idx in the arr_years that we can use to get the value out\n start_sequence_idx = findIndex(arr_years, start_sequence_year);\n //value we are going to base the calculations on\n start_sequence_value = Number(arr_years[start_sequence_idx].cost);\n //where the sequence ends\n end_sequence_year = year_group[year_group.length-1] + 1;\n //idx in the arr_years that we can use to get the value out\n end_sequence_idx = findIndex(arr_years, end_sequence_year);\n //value we are going to base the calculations on\n end_sequence_value = Number(arr_years[end_sequence_idx].cost);\n\n //calculate the missing values and create the same structure\n //to merge with arr_years \n arr_group_updated = updateMissingYearValues(year_group, start_sequence_value, end_sequence_value);\n\n insertArrayAt(arr_years, start_sequence_idx, arr_group_updated);\n\n idx++;\n\n });\n\n\n\n}", "title": "" }, { "docid": "13d677bd0829012e9cd0715b3381e1de", "score": "0.526102", "text": "_cleanParams(params){let newParams={};for(x in params){const prop=x,value=params[x];if(\"\"===value||null===value||value===void 0){// do nothing\n}else{// add the clean property to the new params object\nnewParams[prop]=value}}return newParams}", "title": "" }, { "docid": "ad81352683a8ad6130908b071a02aa32", "score": "0.52168775", "text": "function populate(dst, src) {\n\t for (var prop in src) {\n\t if (!dst[prop]) dst[prop] = src[prop];\n\t }\n\t return dst;\n\t}", "title": "" }, { "docid": "ad81352683a8ad6130908b071a02aa32", "score": "0.52168775", "text": "function populate(dst, src) {\n\t for (var prop in src) {\n\t if (!dst[prop]) dst[prop] = src[prop];\n\t }\n\t return dst;\n\t}", "title": "" }, { "docid": "ad81352683a8ad6130908b071a02aa32", "score": "0.52168775", "text": "function populate(dst, src) {\n\t for (var prop in src) {\n\t if (!dst[prop]) dst[prop] = src[prop];\n\t }\n\t return dst;\n\t}", "title": "" }, { "docid": "9ad9c2652ac3bbb306de572ac2baa952", "score": "0.51885295", "text": "fixMissingElementsinJSON (result) {\n result.map((resultElement) => {\n if(\"authors\" in resultElement) {}\n else {\n resultElement.authors = ['']; \n }\n if(\"imageLinks\" in resultElement) {}\n else {\n resultElement.imageLinks = {smallThumbNail: '', thumbnail: ''};\n }\n if(\"shelf\" in result) {}\n else {\n resultElement.shelf = 'none';\n }\n })\n return result;\n }", "title": "" }, { "docid": "bea6864f89f8b6b12cedb3dfa2757962", "score": "0.5165765", "text": "function missing_check_data(missing_check, student_name, check_range, school_type) {\n\n var check_data = check_range.getValues();\n for(j = 0 ; j<check_data.length; j++){\n if(check_data[j][0].length == 0){\n missing_check.push([school_type, student_name])\n }\n }\n}", "title": "" }, { "docid": "0ff6ec5f0ee8f9691e7d029cd7ee3701", "score": "0.5107957", "text": "function defaultPatient() {\n return {\n height: {\n value: ''\n },\n weight: {\n value: ''\n },\n sys: {\n value: ''\n },\n dia: {\n value: ''\n },\n ldl: {\n value: ''\n },\n hdl: {\n value: ''\n },\n glucose: {\n value: ''\n },\n bmi: {\n value: ''\n },\n };\n}", "title": "" }, { "docid": "39bb51b25516ba3c5f8d5516a9b9650f", "score": "0.51074725", "text": "function fillOut(arr, s){\n var x = arr;\n if (isValid(s.benefits, false)){\n x[0].size += 1;\n }\n if (isValid(s.mental_health_consequences, true)){\n x[1].size += 1;\n }\n if (isValid(s.coworkers, false)){\n x[2].size += 1;\n }\n if (isValid(s.supervisor, false)){\n x[3].size += 1;\n }\n if (isValid(s.mental_vs_physical, false)){\n x[4].size += 1;\n }\n if (isValid(s.anonymity, false)){\n x[5].size += 1;\n }\n if (isValid(s.wellness_program, false)){\n x[6].size += 1;\n }\n if (isValid(s.leave, false)){\n x[7].size += 1;\n }\n return x;\n }", "title": "" }, { "docid": "221812d70266f303ab0800de95fa5eaa", "score": "0.5101904", "text": "addBlank() {\n if (this.evidence.experiment_context && this.evidence.experiment_context.length > 0) {\n let last_item_idx = this.evidence.experiment_context.length - 1;\n if (this.evidence.experiment_context[last_item_idx].value) {\n this.evidence.experiment_context.push({'name': '', 'value': ''});\n }\n }\n else {\n this.evidence.experiment_context = [];\n this.evidence.experiment_context.push({'name': '', 'value': ''});\n }\n }", "title": "" }, { "docid": "4154791e20717219a99ae0194b9376ac", "score": "0.5101241", "text": "missingProp() {\n var missingprop = [];\n if(this.name == \"Default Name\") missingprop.push('name');\n if(this.purpose == \"Default type of Client\") missingprop.push('purpose');\n if(this.version == \"First Version\") missingprop.push('version');\n if(this.description == \"No description was provided\") missingprop.push('description');\n if(this.keywords == \"No keywords were provided.\") missingprop.push('keywords');\n if(this.otherInfo == null) missingprop.push('otherInfo')\n return missingprop;\n }", "title": "" }, { "docid": "e84ab59231a2c30d11f4834b4ec4d33f", "score": "0.5084795", "text": "nullifyUVs() {\n\n\t\tconst uvAttribute = this.attributes.uv;\n\n\t\tfor ( let i = 0; i < uvAttribute.count; i++ ) {\n\n\t\t\tuvAttribute.setXY( i, 0, 0 );\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "a649f9ea75fde043ea7e8dfe7198e2bc", "score": "0.5076215", "text": "function addInMissingFields(record) {\n\t// Summary\n\t//--------\n\tif (record.name) {\n\t\trecord.summary = record.name;\n\t}\n\n\t// Kind\n\t//------\n\trecord.kind = 'Immunization';\n\n\t// Codes\n\t//-------\n\tif (!record.codes) {\n\t\trecord.codes = [];\n\t}\n\n\t// Performer\n\t//----------\n\tif (record.performer) {\n\t\t//Performer DisplayName\n\t\t//---------------------\n\t\tif ((!record.performer.displayName) && (record.performer.name)) {\n\t\t\trecord.performer.displayName = ncUtil.namecase(record.performer.name);\n\t\t}\n\n\t\t// Performer Summary\n\t\t//------------------\n\t\trecord.performer.summary = recEnrichXformerUtil.getSummary('Clinician', record.performer);\n\t}\n}", "title": "" }, { "docid": "34355bf9fa58f4290a813389e1b91e58", "score": "0.5059095", "text": "function noValues() {\n generateHeaderRow();\n\tfor (let i = 0; i < amountStud; i++) {\n\t\tavgPerRow.push(0);\n\t\taddRow();\n\t}\n\tgenerateFooterRow();\n\tcreateTableInfo();\n}", "title": "" }, { "docid": "43831417c97954d1778da8d50bae544b", "score": "0.5039138", "text": "setValues(){\n let items = this.initializeField(); // Create zero matrix\n items = this.randomizeMines(items); // Create random mines\n items = this.setBoxValue(items); // Set values for the boxes\n return items;\n }", "title": "" }, { "docid": "12c61a083d82decb53e7a611fabf85f7", "score": "0.50262636", "text": "getBlank() {\n\t\tlet blanks = this.map.flat().filter(tile => {\n\t\t\tif(tile instanceof Blank)\n\t\t\t\treturn !tile.hasCreature();\n\t\t\telse\n\t\t\t\treturn false;\n\t\t});\n\n\t\treturn ROT.RNG.getItem(blanks);\n\t}", "title": "" }, { "docid": "dcc96dd978debe010d582f2f3f3c4873", "score": "0.50248665", "text": "function clearValuesToNextRun() {\n infectedHousesArray = [];\n infectedHousesFilterArray = [];\n zombies = 1;\n roundsUntilAllAreZombies = 0;\n}", "title": "" }, { "docid": "ecfa3193263d7a15768c3806cf74a5b6", "score": "0.5022547", "text": "defineDefaultValues() {\n if (this.scale == undefined || this.scale <= 0) {\n this.scale = 1;\n }\n\n if (this.spriteChoice == undefined || this.spriteChoice < 0 || this.spriteChoice > 3) {\n this.spriteChoice = randomInt(3);\n }\n }", "title": "" }, { "docid": "1db27c3fc3af6f876a876dbcc49f2562", "score": "0.5017479", "text": "setMissingIds() {\n this.database = this.database.map(note => this.setId(note))\n }", "title": "" }, { "docid": "7a28e90576313c3285de5a288eb6cc21", "score": "0.5012293", "text": "function defaults(dst, src) {\n\t forEach(src, function(value, key) {\n\t if (!isDefined(dst[key])) {\n\t dst[key] = value;\n\t }\n\t });\n\t}", "title": "" }, { "docid": "7cb972e4c179f347f5451943cd012ca4", "score": "0.4995666", "text": "function createMissingMap(schema) {\r\n // Bail early if there are no missing values.\r\n if (!schema.missingValues || schema.missingValues.length === 0) {\r\n return null;\r\n }\r\n // Collect the missing values into a map.\r\n var result = Object.create(null);\r\n for (var _i = 0, _a = schema.missingValues; _i < _a.length; _i++) {\r\n var value = _a[_i];\r\n result[value] = true;\r\n }\r\n // Return the populated map.\r\n return result;\r\n }", "title": "" }, { "docid": "7cb972e4c179f347f5451943cd012ca4", "score": "0.4995666", "text": "function createMissingMap(schema) {\r\n // Bail early if there are no missing values.\r\n if (!schema.missingValues || schema.missingValues.length === 0) {\r\n return null;\r\n }\r\n // Collect the missing values into a map.\r\n var result = Object.create(null);\r\n for (var _i = 0, _a = schema.missingValues; _i < _a.length; _i++) {\r\n var value = _a[_i];\r\n result[value] = true;\r\n }\r\n // Return the populated map.\r\n return result;\r\n }", "title": "" }, { "docid": "7cb972e4c179f347f5451943cd012ca4", "score": "0.4995666", "text": "function createMissingMap(schema) {\r\n // Bail early if there are no missing values.\r\n if (!schema.missingValues || schema.missingValues.length === 0) {\r\n return null;\r\n }\r\n // Collect the missing values into a map.\r\n var result = Object.create(null);\r\n for (var _i = 0, _a = schema.missingValues; _i < _a.length; _i++) {\r\n var value = _a[_i];\r\n result[value] = true;\r\n }\r\n // Return the populated map.\r\n return result;\r\n }", "title": "" }, { "docid": "13315563794f2c49b72979a06984bc43", "score": "0.49901384", "text": "function populate(dst, src) {\n }", "title": "" }, { "docid": "7ac1ce561757857c8edfff54a9e8f88f", "score": "0.4989409", "text": "function stuInfo(id, name, age) {\n if (id === void 0) { id = 0; }\n if (name === void 0) { name = \"unknown\"; }\n if (age === void 0) { age = 6; }\n}", "title": "" }, { "docid": "2fca03ee8419563b9d32f2c5a6e89bed", "score": "0.4987507", "text": "fill_in_data(data) {\n for(let tuple of this.items) { // [stmt, response, emotion]\n let text = tuple[0];\n let name = this.response_name;\n let known_response = data.lookup(text, name).response;\n tuple[1] = known_response;\n }\n }", "title": "" }, { "docid": "fa689a4392fca5be85fe138eb0f67370", "score": "0.49812248", "text": "populateLoss(value){\n this.arrayLoss = new Array(value);\n for (let index in this.arrayLoss) {\n this.arrayLoss[index] = 0\n }\n }", "title": "" }, { "docid": "da48f452efbbea90264fc26fe3e29ca5", "score": "0.49742088", "text": "function fillFromRawAssessor (assessor) {\n for (let x = 0; x < rawAssessors.length; x++) {\n var assessorData = new AssessorData(rawAssessors[x]);\n if (safeTrim(assessorData.name) === safeTrim(assessor.name)) {\n assessor.accreditationDate = helperService.toDate(assessorData.accreditationDate);\n assessor.description = assessorData.description;\n assessor.logo = assessorData.logo;\n assessor.pocName = assessorData.pocName;\n assessor.pocEmail = assessorData.pocEmail;\n assessor.website = assessorData.website;\n assessor.remediation = assessorData.remediation;\n assessor.founded = assessorData.founded;\n assessor.primaryOfficeLocations = assessorData.primaryOfficeLocations;\n assessor.fedrampAssessed = assessorData.fedrampAssessed;\n assessor.provideConsultingServices = assessorData.provideConsultingServices;\n assessor.descriptionOfConsultingServices = assessorData.descriptionOfConsultingServices;\n assessor.consultingServicesTo = assessorData.consultingServicesTo;\n assessor.additionalCyberFrameworks = assessorData.additionalCyberFrameworks;\n break;\n }\n }\n\n return assessor;\n }", "title": "" }, { "docid": "dd4f4eb39ccd8cbbcf5104491f7f6571", "score": "0.4973768", "text": "fillUpUniquePlayerIdArray() {\n var emptyIntermediatePlayerIdArray = [];\n for (i in this.gamePlayersArray) {\n if (this.gamePlayersArray[i].score != null) {\n emptyIntermediatePlayerIdArray.push(this.gamePlayersArray[i].player.id)\n }\n }\n this.uniquePlayerIdArray = emptyIntermediatePlayerIdArray.filter((item, index) => emptyIntermediatePlayerIdArray.indexOf(item) === index);\n this.fillUpObjectLeaderboard();\n }", "title": "" }, { "docid": "1284471d26bd2e35b42880e19873bc3d", "score": "0.49712318", "text": "checkNull() {\n let contacts = this.getContacts();\n\n contacts = contacts.map(contact => {\n if (!contact.firstName) {\n contact.firstName = '';\n }\n if (!contact.lastName) {\n contact.lastName = '';\n }\n if (!contact.preferredName) {\n contact.preferredName = '';\n }\n if (!contact.email) {\n contact.email = '';\n }\n if (!contact.phoneNumber) {\n contact.phoneNumber = '';\n }\n if (!contact.city) {\n contact.city = '';\n }\n if (!contact.state) {\n contact.state = '';\n }\n if (!contact.zip) {\n contact.zip = '';\n }\n if (!contact.lat) {\n contact.lat = '';\n }\n if (!contact.lng) {\n contact.lng = '';\n }\n if (!contact.favoriteHobby) {\n contact.favoriteHobby = '';\n }\n return contact;\n });\n\n this.setState({ contacts });\n }", "title": "" }, { "docid": "03b9e72a3a509fcf6696b0b95572c60e", "score": "0.49696937", "text": "_prepareCharacterData(actorData) {\r\n this._prepareSharedData(actorData);\r\n\r\n const data = actorData.data;\r\n\r\n if (game.settings.get(\"starwarsffg\", \"enableSoakCalc\")) {\r\n this._calculateDerivedValues(actorData);\r\n }\r\n\r\n // Build complete talent list.\r\n\r\n const specializations = actorData.items.filter((item) => {\r\n return item.type === \"specialization\";\r\n });\r\n\r\n const globalTalentList = [];\r\n specializations.forEach((element) => {\r\n\r\n //go throut each list of talent where learned = true\r\n\r\n const learnedTalents = Object.keys(element.data.talents).filter(key => element.data.talents[key].islearned === true);\r\n\r\n learnedTalents.forEach(talent => {\r\n const item = JSON.parse(JSON.stringify(element.data.talents[talent]));\r\n item.firstSpecialization = element._id;\r\n item.source = [{ type : \"specialization\", typeLabel: \"SWFFG.Specialization\", name: element.name, id: element._id }];\r\n item.safe_desc = PopoutEditor.renderDiceImages(item.description.replace(/(<([^>]+)>)/gi, \"\"));\r\n if (item.isRanked) {\r\n item.rank = element.data.talents[talent]?.rank ? element.data.talents[talent].rank : 1;\r\n } else {\r\n item.rank = \"N/A\";\r\n }\r\n\r\n let index = globalTalentList.findIndex((obj) => {\r\n return obj.name === item.name;\r\n });\r\n\r\n if (index < 0 || !item.isRanked) {\r\n globalTalentList.push(item);\r\n } else {\r\n globalTalentList[index].source.push({ type : \"specialization\", typeLabel: \"SWFFG.Specialization\", name: element.name, id: element._id })\r\n globalTalentList[index].rank += element.data.talents[talent]?.rank ? element.data.talents[talent].rank : 1;\r\n }\r\n });\r\n\r\n // if (element?.talentList && element.talentList.length > 0) {\r\n // element.talentList.forEach((talent) => {\r\n // const item = JSON.parse(JSON.stringify(talent));\r\n // item.firstSpecialization = element._id;\r\n // item.source = [{ type : \"specialization\", typeLabel: \"SWFFG.Specialization\", name: element.name, id: element._id }];\r\n // item.safe_desc = PopoutEditor.renderDiceImages(talent.description.replace(/(<([^>]+)>)/gi, \"\"));\r\n \r\n\r\n // if (item.isRanked) {\r\n // item.rank = talent.rank;\r\n // } else {\r\n // item.rank = \"N/A\";\r\n // }\r\n\r\n // let index = globalTalentList.findIndex((obj) => {\r\n // return obj.name === item.name;\r\n // });\r\n\r\n // if (index < 0 || !item.isRanked) {\r\n // globalTalentList.push(item);\r\n // } else {\r\n // globalTalentList[index].source.push({ type : \"specialization\", typeLabel: \"SWFFG.Specialization\", name: element.name, id: element._id })\r\n // globalTalentList[index].rank += talent.rank;\r\n // }\r\n // });\r\n // }\r\n });\r\n\r\n const talents = actorData.items.filter((item) => {\r\n return item.type === \"talent\";\r\n });\r\n\r\n talents.forEach((element) => {\r\n const item = {\r\n name : element.name,\r\n itemId : element._id,\r\n description : element.data.description,\r\n activation: element.data.activation.value,\r\n activationLabel: element.data.activation.label,\r\n isRanked: element.data.ranks.ranked,\r\n safe_desc: PopoutEditor.renderDiceImages(element.data.description.replace(/(<([^>]+)>)/gi, \"\")),\r\n source : [{ type : \"talent\", typeLabel: \"SWFFG.Talent\", name: element.name, id: element._id }]\r\n }\r\n\r\n if(item.isRanked) {\r\n item.rank = element.data.ranks.current;\r\n } else {\r\n item.rank = \"N/A\";\r\n }\r\n\r\n let index = globalTalentList.findIndex((obj) => {\r\n return obj.name === item.name;\r\n });\r\n\r\n if (index < 0 || !item.isRanked) {\r\n globalTalentList.push(item);\r\n } else {\r\n globalTalentList[index].source.push({ type : \"talent\", typeLabel: \"SWFFG.Talent\", name: element.name, id: element._id })\r\n globalTalentList[index].rank += element.data.ranks.current;\r\n }\r\n\r\n });\r\n\r\n globalTalentList.sort((a, b) => {\r\n let comparison = 0;\r\n if (a.name > b.name) {\r\n comparison = 1;\r\n } else if (a.name < b.name) {\r\n comparison = -1;\r\n }\r\n return comparison;\r\n });\r\n\r\n\r\n data.talentList = globalTalentList;\r\n }", "title": "" }, { "docid": "bc23755acaacf1dba0224599ebbf96fa", "score": "0.49534982", "text": "get dummyPurchases() {\n if (this.dummySalesField === undefined) {\n\n this.dummySalesField = this.dummyDownloads.map((d) => {\n return this.randomWholeNum(d) * this.state.appInsightsAppPrice;\n });\n\n }\n\n return this.dummySalesField;\n }", "title": "" }, { "docid": "8e29a1582ab229da6b29d679cda9f459", "score": "0.49438295", "text": "set spatialize(value) {}", "title": "" }, { "docid": "3b16611e99ff15924e4cab79e60b886c", "score": "0.49399993", "text": "function newNumbers() {\n\t\tmagicNumber = Math.floor(Math.random() * 200) + 20;\n\t\tinfinity1 = Math.ceil(Math.random() * 20);\n\t\tinfinity2 = Math.ceil(Math.random() * 20);\n\t\tinfinity3 = Math.ceil(Math.random() * 20);\n infinity4 = Math.ceil(Math.random() * 20);\n infinity5 = Math.ceil(Math.random() * 20);\n infinity6 = Math.ceil(Math.random() * 20);\n\t}", "title": "" }, { "docid": "b7c671f1591b068fe4d9e03fd8c7e037", "score": "0.49354777", "text": "function resetVars() {\n\t\tlats1 = [];\n\t\tlons1 = [];\n\t\ttimestamps = [];\n\t\ttrajectoryIDtoIdxMap = {};\n\t\ttrajectories = [];\n\t\tNs = [];\n\t\tN = 0;\n\t\tlimits = {'minX':0, 'maxX':0, 'minY':0, 'maxY':0};\n\t\tunique = 0;\n\t\tNULLs = 0;\n\t\tlocalSelections = [];\n\t}", "title": "" }, { "docid": "9cbd18157a7ed672ddecbf0023223869", "score": "0.49196", "text": "function defaultPatient() {\n return {\n height: {\n value: ''\n },\n weight: {\n value: ''\n },\n sys: {\n value: ''\n },\n dia: {\n value: ''\n },\n ldl: {\n value: ''\n },\n hdl: {\n value: ''\n },\n note: 'No Annotation',\n };\n}", "title": "" }, { "docid": "5a66e86e9902055fe791ca114a7111e0", "score": "0.49193782", "text": "getUpdatedValues(values){\n let updated = {};\n Object.keys(values).forEach(key => {\n if( values[key] !== this.props.initialValues[key] ){\n if (key === 'department') {\n // Set value for department as an id\n updated.department = this.getDepartmentId(values);\n } else {\n updated[key] = values[key];\n }\n }\n })\n return updated; \n }", "title": "" }, { "docid": "5821aebfe2f6a4d387dbc705d163a4ec", "score": "0.49185592", "text": "initDefaultData() {\n const { defaultData, fields } = this.props;\n\n const newDefaultData = defaultData !== undefined ? defaultData : {};\n\n return fields.reduce(\n (prev, { name, type }) => ({\n ...prev,\n [name]:\n newDefaultData[name] !== undefined ? newDefaultData[name] : type === \"tags\" ? [] : \"\",\n }),\n {},\n );\n }", "title": "" }, { "docid": "13a9a883293225662e6b5a3b11a2b661", "score": "0.4905088", "text": "function makeEmptyYear(stats, age) {\n empty = {};\n $.each(stats, function(index, stat) {\n empty[stat] = 0;\n });\n empty.age = age;\n return empty;\n}", "title": "" }, { "docid": "959911178af79f19a5da88a28561eca9", "score": "0.4903406", "text": "addMissingKeys(keys, newDataIndex) {\n for (let key of keys) {\n if (this.formValues.Data.every((entry) => entry.Key !== key)) {\n this.formValues.Data[newDataIndex].Key = key;\n return;\n }\n }\n }", "title": "" }, { "docid": "8ba096305715fe19e75e234c5cfc237c", "score": "0.49025178", "text": "if (this.state.currentStep !== prevState.currentStep) {\n const stepData = steps[this.state.currentStep];\n\n const nextState: any = {};\n\n const overrideableFields = [\n 'frequency',\n 'amplitude',\n 'harmonicsForShape',\n 'numOfHarmonics',\n 'convergence',\n 'phase',\n ];\n\n overrideableFields.forEach(field => {\n const fieldOverride = `${field}Override`;\n\n if (stepData[fieldOverride] != null) {\n nextState[field] = stepData[fieldOverride];\n }\n });\n\n this.setState(nextState);\n }", "title": "" }, { "docid": "bad28386857df57299583b734e7f36b7", "score": "0.4898932", "text": "get skipUnknownValues() {\r\n return this.i.nb;\r\n }", "title": "" }, { "docid": "27f4c6c1e61980d2853c0c9c93122aa7", "score": "0.48973504", "text": "function assignNA(value){\n\t\n\tif(value.length === 0){\n\t\t\n\t\tvalue = \"N / A\";\n\t\t\n\t}\n\treturn value;\n}", "title": "" }, { "docid": "45d4c34e4267e88a691c82d1e8ee6c91", "score": "0.4893562", "text": "function getDummyPerson() {\n return {name: {'title': 'mr', 'last': 'wenban', first: 'russell'}};\n }", "title": "" }, { "docid": "cd40d67e6798677014a07b3d32379df7", "score": "0.48902857", "text": "fill_in_data(data) {\n for(let tuple of this.questions) { // [question, response]\n let text = tuple[0];\n let name = this.response_name;\n let known_response = data.lookup(text, name).response;\n tuple[1] = known_response;\n }\n }", "title": "" }, { "docid": "b78ddffb19bd5152c1f12955bb2fc331", "score": "0.48845124", "text": "populateData() {\n }", "title": "" }, { "docid": "1da8b376e9f0fef00433e17b3aee814c", "score": "0.48816112", "text": "function defaultPatient() {\n return {\n height: {\n value: ''\n },\n weight: {\n value: ''\n },\n sys: {\n value: ''\n },\n dia: {\n value: ''\n },\n note: 'No Annotation',\n };\n}", "title": "" }, { "docid": "facf4079c376f90177dd0509c4f28aae", "score": "0.48727033", "text": "function fillExploitationNorightsData(index) {\n switch (index) {\n case 1:\n rightsMulti_Artist_Compilations = \"true\";\n break;\n case 2:\n rightsSynchronisation = \"true\";\n break;\n case 3:\n rightsMidPrice = \"true\";\n break;\n case 4:\n rightsBudget = \"true\";\n break;\n case 5:\n rightsPremiums = \"true\";\n break;\n case 6:\n rightssample_Use = \"true\";\n break;\n case 7:\n rightsAdvert_Royalty_Breaks = \"true\";\n break;\n case 8:\n rightsClub_Mail_Order = \"true\";\n break;\n case 9:\n rightsRemix_Edit = \"true\";\n break;\n case 10:\n rightsGreatest_Hits = \"true\";\n break;\n case 11:\n rightsKiosk = \"true\";\n break;\n }\n }", "title": "" }, { "docid": "5c1590eb2ddc152eb4ff32f23ab6a728", "score": "0.48690128", "text": "function generate_dummy_data(){\n let foods = [\"Apple\", \"Orange\", \"Banana\", \"Potato\", \"Strawberries\", \"Celery\", \"Leek\", \"Pummelo\", \"Dragonfruit\", \"Guinea Pig\"];\n let locations = [\"Mobile, AL\", \"Terrapin Station, MT\", \"Denver, CO\", \"Franklins Tower, TX\", \"Baker Street, MA\", \n \"Lubbock, TX\", \"Wichita, KS\", \"Fennario, WY\", \"Big Foot County, ND\", \"Santa Fe, NM\"];\n let codes = generate_codes(10, 8);\n let objects = [];\n for (let i = 1; i <= 10; i++){\n let obj = {};\n let mp = Math.floor(Math.random() * 10) + 2;\n obj.name = foods[i-1];\n obj.QR_code = codes[i-1];\n obj.amount = Math.floor(Math.random() * 1000);\n obj.location = locations[i];\n obj.transport_from = locations[i%2];\n obj.transport_to = locations[i-1];\n obj.cost = mp,\n objects.push(obj);\n }\n return(objects);\n}", "title": "" }, { "docid": "81f4211994049420cd34e48784258d38", "score": "0.48542494", "text": "function fillIn(obj, var_defaults){\n forEach(slice(arguments, 1), function(base){\n forOwn(base, function(val, key){\n if (obj[key] == null) {\n obj[key] = val;\n }\n });\n });\n return obj;\n }", "title": "" }, { "docid": "6ca66d01b723637130bc05380deb3b43", "score": "0.48533398", "text": "_getValue_unavailable() {}", "title": "" }, { "docid": "6ca66d01b723637130bc05380deb3b43", "score": "0.48533398", "text": "_getValue_unavailable() {}", "title": "" }, { "docid": "6ca66d01b723637130bc05380deb3b43", "score": "0.48533398", "text": "_getValue_unavailable() {}", "title": "" }, { "docid": "60798daba1c4b52715c53d0de7450ae7", "score": "0.484672", "text": "function defaults(object1, object2){\n //your code here\n return reduce(object1, function(obj, curr, key){\n \n each(object2, function(val, k){\n \n if(obj[k] === undefined){\n \n obj[k] = val;\n \n }\n \n });\n \n obj[key] = curr;\n return obj;\n \n },{});\n}", "title": "" }, { "docid": "9aabf82f9f6ee3697ffa0fa575f90493", "score": "0.48408884", "text": "fillInChartDataMissingRegions() {\n if(this.chartData && this.labels && this.regionField !== 'request_ip_city') {\n let data = this.chartData\n const regionCodes = Object.keys(this.labels);\n for(let i = 0, len = regionCodes.length; i < len; i++) {\n const regionCode = regionCodes[i];\n if(!data[regionCode]) {\n data[regionCode] = {\n name: regionCode,\n };\n }\n }\n\n this.set('chartData', data);\n }\n }", "title": "" }, { "docid": "d9a30cb7919a5c15a34da6ab38fabde6", "score": "0.48383135", "text": "function fillinit() {\n const bucket = new Int32Array(buckets)\n const count = new Int32Array(buckets);\n bucket.fill(-1);\n return {bucket, count};\n }", "title": "" }, { "docid": "83310ed7f67bdba13a13af358ebfd185", "score": "0.48330957", "text": "function defaults(dst, src) {\n forEach(src, function(value, key) {\n if (!isDefined(dst[key])) {\n dst[key] = value;\n }\n });\n}", "title": "" } ]
fa804717ca5452e8240287d47e3e484d
This boots of the day ticker count down.
[ { "docid": "db6e00fe39fffda2d334bb338ceee556", "score": "0.0", "text": "startYearCount() {\n this.removeWindowClickStartCountUpEvent();\n\n const intervalId = setInterval(() => {\n this.state.activeDate.setDate(this.state.activeDate.getDate() + 1);\n\n if(this.state.lastMonth !== this.state.activeDate.getMonth()) {\n this.clearExpiredTimeline();\n }\n\n const upcomingFlareIds = this.getUpcomingFlareIds();\n\n this.props.onDayTick(upcomingFlareIds.length > 0);\n\n this.setState({\n activeDate: this.state.activeDate,\n activeSpots: upcomingFlareIds,\n lastMonth: this.state.activeDate.getMonth()\n });\n\n if(this.state.activeDate > new Date()) {\n clearInterval(this.state.intervalId);\n } else {\n this.loadNextYearIfRequired();\n }\n\n }, 500);\n\n this.setState({\n countUpStarted: true,\n intervalId\n });\n }", "title": "" } ]
[ { "docid": "a612a54741f91f849ad698ac766b58b0", "score": "0.60274744", "text": "function setCountDown() {\n intervalId = setInterval(count, 1000);\n }", "title": "" }, { "docid": "87ddc2d5cce3e8d4cc3441bd2c55de99", "score": "0.5770458", "text": "function timerCountDown() {\n\n }", "title": "" }, { "docid": "87937d1e0fccd2b3c2dfe3e4a1271f51", "score": "0.563834", "text": "function countDown() {\n clearInterval(intervalId);\n intervalId = setInterval(decrement, 1000);\n }", "title": "" }, { "docid": "ac78427dabca3344b57298f28112a734", "score": "0.5632537", "text": "function doCountDown() {\n\t\t\tif(hbCountDown > 1) {\n\t\t\t\thbCountDown--;\n\t\t\t}\n\t\t\tif (hbCountDown == 1) {\n\t\t\t\tstatus = $.Acheta.HeartBeater.STATUS_LIMIT_REACHED;\n\t\t\t\tuserChecker.stopChecking();\n\t\t\t\t$(self).triggerHandler($.Acheta.HeartBeater.EVENT_HEARTBEAT_LIMIT_REACHED);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "adc4811452a52be8630b7f295543ae25", "score": "0.56029356", "text": "function init_countdown() {\n if ($(\".count-down\").length) {\n var year = parseInt($(\".count-down\").attr(\"data-countdown-year\"), 10);\n var month = parseInt($(\".count-down\").attr(\"data-countdown-month\"), 10) - 1;\n var day = parseInt($(\".count-down\").attr(\"data-countdown-day\"), 10);\n $(\".count-down\").countdown({\n until: new Date(year, month, day),\n\n padZeroes: true\n });\n }\n }", "title": "" }, { "docid": "e1bbffd5dfa462371555bbc806520849", "score": "0.55745023", "text": "function countItDown(){\r\n startTime -= 1\r\n $el.text(startTime);\r\n\r\n if( startTime <= 0 ){\r\n // Stop the timer and trigger the callback.\r\n clearInterval(timer);\r\n callback();\r\n return;\r\n }\r\n }", "title": "" }, { "docid": "b2f5e09594f58f366a9cb2d82b658b46", "score": "0.55544394", "text": "function startCountDown() {\n intervalID = setInterval(countDown, 1000);\n }", "title": "" }, { "docid": "6badb9a5ef2138390925c801683799f4", "score": "0.5513579", "text": "function stoppaCountDown() {\r\n clearInterval(clock);\r\n $('h2').text(\"Tempo scaduto!\");\r\n }", "title": "" }, { "docid": "3dcd12c03a84ceb9556757e43e385484", "score": "0.5463551", "text": "function countDown() {\n\t\t// decrease time by 1\n\t\ttime--;\n\t\t// update the time displayed\n\t\tupdate($timer, time);\n\t\t// the game is over if the timer has reached 0\n\t\tif(time <= 0) {\n\t\t\tgameOver();\n\t\t}\n\t}", "title": "" }, { "docid": "6d9260f4823c02373bcee46a61ae85bd", "score": "0.54505026", "text": "function countItDown(){\n startTime = 0;///decrement startTime: //-= 1\n $el.text(startTime);\n App.doTextFit('#hostWord');\n\n if( startTime <= 0 ){\n // console.log('Countdown Finished.');\n\n // Stop the timer and do the callback.\n clearInterval(timer);\n callback();\n return;\n }\n }", "title": "" }, { "docid": "fb979f5d632394007f1072b6b8f9e643", "score": "0.5439819", "text": "function countDown() {\n if (countClock > 0) {\n countClock--;\n $(\".timer\").text(\"You have \" + countClock + \" seconds\");\n }\n else {\n wrongGuess();\n }\n }", "title": "" }, { "docid": "f2d64a07d8cc0569e2191ea3e550a691", "score": "0.5425587", "text": "function uncleStopped() {\n changeBtn(\"timer\");\n setTimeout(function() {\n countDown(10);\n }, 1000);\n }", "title": "" }, { "docid": "c248d6703d4c81d8ac4a56d7876c08cf", "score": "0.5414513", "text": "function stopTicker() {\n $erpTickerUl.stop();\n }", "title": "" }, { "docid": "cd413f3fd75f5a61a2b8dd5017ad3d60", "score": "0.5398378", "text": "shuttingDown() {\n this._shuttingDown = true;\n }", "title": "" }, { "docid": "6d35aafa19d159cd8d61e52208edf777", "score": "0.5393538", "text": "function stop_power_up_att () {\n rate_of_fire = 40\n }", "title": "" }, { "docid": "89b6f08e247fe9b52c8084a6886a8b5f", "score": "0.5324576", "text": "function decrement24() {\n\t\tcountdown24--;\n\t\tif(countdown24 === -1) {\n\t\t\tsound = new Audio(\"assets/audio/24 - Clock Effect.mp3\");\n\t\t\tsound.play();\n\t\t\tstop24();\n\t\t\tcountdown24 = 22;\n\t\t\t// need a stop function in case someone answers\n\t\t}\n\t}", "title": "" }, { "docid": "3df7c4a79bf5ce6ceb1b337c19a98106", "score": "0.5277748", "text": "function stopcountdown() {\n\t\tclearInterval(countingdown);\n\t}", "title": "" }, { "docid": "9fdd03e1226e538f824707554afac246", "score": "0.52609545", "text": "function powerDown () {\n console.log(\"power down\");\n //isPowered = false;\n pfio.digital_write(0,0);\n setTimeout(doReset, 5000);\n}", "title": "" }, { "docid": "43e984045ce84003ec75739f6d315511", "score": "0.52562547", "text": "function sys_reboot(){system.reboot_sys();}", "title": "" }, { "docid": "a421902da02275464bc57d9ad7fdc733", "score": "0.52409065", "text": "function get_boot_time()\n{\n return (+new Date()) - boot_start_time;\n}", "title": "" }, { "docid": "0616c7c85e1519df67ee8bfe949199ee", "score": "0.5232869", "text": "function startOwlDown() {\n resetOwlClock(); \n owlMain.goDown(); \n }", "title": "" }, { "docid": "20bd9fc41540db5ab6ea7198ffc71779", "score": "0.5226405", "text": "function startCountDown() {\n\t//start timer\n\twindow.timer = setInterval(function(){\n\t\t//subtract 1 from counter\n\t\tcounter--;\n\t\t//show time remaining in DOM\n\t\tif (counter > 9) {\n\t\t\t$(\"#stop-clock\").html(\"0:\" + counter); \n\t\t} \telse {\n\t\t\t$(\"#stop-clock\").html(\"0:0\" + counter);\n\t\t}\n\t}, 1000);\n\n}", "title": "" }, { "docid": "5d1f48f57632722c7188a70a499e60b3", "score": "0.5222579", "text": "onResetDaySelected_() {\n if (!this.autoReset_) {\n return;\n }\n this.trafficCountersAdapter_.setTrafficCountersAutoResetForNetwork(\n this.guid, this.autoReset_, {value: this.resetDay_});\n this.load();\n }", "title": "" }, { "docid": "6c12c9952282efa7a8279bbf95d1e891", "score": "0.52104807", "text": "disconnectedCallback() {\n super.disconnectedCallback();\n dateService.off(dateService.DAY_CHANGED, this._onDayChanged);\n }", "title": "" }, { "docid": "b71600818fb7b4f96c1c2b4b60488201", "score": "0.5201256", "text": "shutdown() {\n clearInterval(this.runIntervalID);\n }", "title": "" }, { "docid": "b61d2f3a9707ba9180965a1bb605a9a5", "score": "0.5200255", "text": "function doShutdown()\r\n{\r\n\tdebugOut(\"doShutdown\");\r\n\t// Old till feb2011\r\n\t//nasObject.makeServerRequest( \"/cgi-bin/restart.cgi?option=shutdown\", \"GET\", shutDownComplete, null ); \t// Tell it to shut down!\r\n\turl = \"/cgi-bin/sys/sysRequest.cgi\" + '?count=' + Math.random() + \"&sid=\" + encodeURIComponent(qnapSid) + \"&subfunc=power_mgmt\";\r\n\taction = \"&apply=shutdown\";\r\n\tnasObject.makeServerRequest( url + action, \"GET\", processStateTable, null );\r\n}", "title": "" }, { "docid": "cb5f7de9fafb75843b54e259266b7537", "score": "0.51855063", "text": "componentDidUpdate(prevProps, prevState) {\n try {\n if ( this.props.app.weeks.unMountChild ) {\n this.props.unmountDays(false);\n }\n } catch (e) {}\n\n }", "title": "" }, { "docid": "91f089af40ec054adb7daafc9153f67f", "score": "0.5155038", "text": "function countDownTimer(){ \n \n // Figure out the time to launch\n timeToLaunch();\n \n // Write to countdown component\n $( \"#days .number\" ).text(days);\n $( \"#hours .number\" ).text(hrs);\n $( \"#minutes .number\" ).text(min);\n $( \"#seconds .number\" ).text(sec);\n \n // Repeat the check every second\n setTimeout(countDownTimer,1000);\n}", "title": "" }, { "docid": "6257cc23df79c33470c966498830c59b", "score": "0.5154102", "text": "function boffReset() {\n _boffIteration = 0;\n }", "title": "" }, { "docid": "d793ad13c8fc2b90a69f41ba0942d29b", "score": "0.51501244", "text": "function YModule_get_rebootCountdown()\n {\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_REBOOTCOUNTDOWN_INVALID;\n }\n }\n return this._rebootCountdown;\n }", "title": "" }, { "docid": "84053dbc1ef7cbf6e14d5dcd3aa93b37", "score": "0.51377356", "text": "function rebootDevice() {\r\n var d = new Date();\r\n rebootVal = d.toISOString();\r\n firebase.database().ref(gFirebaseDeviceRoot + '/reboot').set(rebootVal);\r\n }", "title": "" }, { "docid": "ec4b850f1c27d89834ad346cdc111406", "score": "0.5134806", "text": "function Boot(){}", "title": "" }, { "docid": "cd48572fd7b48b2f5783f0ccca3d2004", "score": "0.5134603", "text": "function liftOff() {\n $('.hasCountdown').css({\n display: 'none'\n });\n $('#countdown').addClass('hidden');\n $('#register-button').addClass('hidden');\n $('.register-title').addClass('hidden');\n $('.register-box').append('<h2>We are at capacity and can no longer accept registrations.</h2>');\n $('.register-box').append('<button class=\"btn btn-large btn-primary disabled\" disabled=\"true\" id=\"register-button\">Sold Out</button>');\n }", "title": "" }, { "docid": "c6d8eced340e5cdbdf2e16a9d8ff70ce", "score": "0.5127595", "text": "function stopCountDown(){\r\n clearInterval(counter);\r\n}", "title": "" }, { "docid": "aae208d378860f0bf1fd90d4ddc0b53d", "score": "0.51127374", "text": "shutdown () {\n\t\tif (this.shuttingDown) { return; }\n\t\tthis.shuttingDown = true;\n\t\tsetTimeout(() => {\n\t\t\tprocess.exit(0);\n\t\t}, 100);\n\t}", "title": "" }, { "docid": "155069df30a9dbefce6a2c584a42d08f", "score": "0.51072323", "text": "function set_lotto_countdown(pCaptionDay, pCaptionDays,countDownCounter1)\n{\n\tsCaptionDay = pCaptionDay;\n\tsCaptionDays = pCaptionDays;\n\t\n\tcountDownCounter = countDownCounter1;\n\t\n\tresetDrawCountdown1(0);\n}", "title": "" }, { "docid": "aa017ba1b892d6e6ee1e155c66382a31", "score": "0.5096076", "text": "function liftOff() {\r\n\t\t$('.hasCountdown').css({\r\n\t\t\tdisplay: 'none'\r\n\t\t});\r\n\t\t$('#countdown').addClass('hidden');\r\n\t\t$('#register-button').addClass('hidden');\r\n\t\t$('.register-title').addClass('hidden');\r\n\t\t$('.register-box').append('<h2>We are at capacity and can no longer accept registrations.</h2>');\r\n\t\t$('.register-box').append('<button class=\"btn btn-large btn-primary disabled\" disabled=\"true\" id=\"register-button\">Sold Out</button>');\r\n\t}", "title": "" }, { "docid": "7ceb6fb07d9b73ebc82b30688598f771", "score": "0.50820464", "text": "function countDown(){\n \tgameClock--;\n \tif (gameClock<=0){\n \t\tclearInterval(gameTimer)\n \t\talert(\"Game Over\")\n \t}\t\n\t\t$('.clock').text(gameClock);\n}", "title": "" }, { "docid": "79f763a8e8ec9705a0900132df2476d1", "score": "0.50726914", "text": "exitRerunEveryClock(ctx) {\n\t}", "title": "" }, { "docid": "59e7f47e65e14cffbcc747132f7c3071", "score": "0.5071895", "text": "getDownCount() {}", "title": "" }, { "docid": "de67be4f63985f2a27f69e5db9da0821", "score": "0.5070251", "text": "function evtFullyBooted() {\n try {\n logger.info(IDLOG, 'asterisk fully booted');\n start();\n } catch (err) {\n logger.error(IDLOG, err.stack);\n }\n}", "title": "" }, { "docid": "d1e7fc2c4a13599a99a0af5666ce0ced", "score": "0.50636363", "text": "function StartClock(){\n \n CountUp();\n}", "title": "" }, { "docid": "4c16d3ed201bf73e445f902551ac781c", "score": "0.5062575", "text": "function countDownTimer(){\n\n // Figure out the time to launch\n timeToLaunch();\n\n // Write to countdown component\n $( \"#days .number\" ).text(days);\n $( \"#hours .number\" ).text(hrs);\n $( \"#minutes .number\" ).text(min);\n $( \"#seconds .number\" ).text(sec);\n\n // Repeat the check every second\n setTimeout(countDownTimer,1000);\n}", "title": "" }, { "docid": "197e04163c7c279e4a1d0e4bbcedd1b5", "score": "0.50617534", "text": "function resetData(){\n title.innerText = 'WORK';\n document.getElementById('tick').setAttribute('src', '');\n clearInterval(interval);\n work.disabled = false;\n bre.disabled = false;\n start.disabled = false;\n inc.disabled = false;\n dec.disabled = false;\n updateTimeLimit();\n}", "title": "" }, { "docid": "b1f7935954d6ac49e4ca26fe48b2742c", "score": "0.5059494", "text": "startCountDown(){\n \tclearInterval(this.interval);\n\n \tthis.interval = setInterval(\n\t\t\tfunction() {\n\t\t\t\tlet newTime = this.state.currentMilliseconds;\n\t\t\t\tnewTime -= 10;\n\n\t\t\t\tif(newTime > 0){\n\t\t\t\t\tthis.setState(\n\t\t\t\t\t\t{currentMilliseconds: newTime\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.setState(\n\t\t\t\t\t\t{currentMilliseconds: 0\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}.bind(this),\n\t\t\t10\n\t\t);\n \t}", "title": "" }, { "docid": "9ac4496f71b46243b36c5d5caaeaef76", "score": "0.50572413", "text": "tickDownBonus () {\n // only count down if the bonus > 0 AND the level is still being played.\n if (this.state.timeBonus - this.props.misclicks*100 <= 0) {\n this.setState({\n isTimeOut: true\n })\n return\n }\n if (this.props.isLevelComplete) { return }\n\n this.setState({\n timeBonus: this.state.timeBonus - 1\n })\n\n if (this.props.isLevelComplete) { return }\n\n }", "title": "" }, { "docid": "6174bf5fd02e9a7633d18c875523a5b9", "score": "0.50542", "text": "async populateUserSpecifiedResetDay_() {\n const result = await this.populateUserSpecifiedResetDayHelper_();\n this.resetDay_ = result;\n }", "title": "" }, { "docid": "f5140c3f185a6bee89a040b79e287b38", "score": "0.50440216", "text": "async boot() {}", "title": "" }, { "docid": "c0db48a8db1157851d073f7e7c834fe1", "score": "0.50375456", "text": "function countDown() {\n killSwitch();\n if (startingTimer > -1) {\n setTimeout(function () {\n if (startingTimer == 0) {\n $('#spawn-point-67').html('<p class=\"text-light count-down-text\">go</p>');\n setTimeout(function () {\n $('#spawn-point-67').html('');\n timerPro.start();\n }, 500)\n }\n if (startingTimer !== 0) {\n timerPro.stop();\n $('#spawn-point-67').html(`<p class=\"text-light count-down-text\">${startingTimer}</p>`);\n startingTimer--;\n countDown();\n }\n }, 500);\n }\n}", "title": "" }, { "docid": "316fe1cb009eb220bcdaf511f7487bf9", "score": "0.50304663", "text": "static async shutdown () {\n latching.hook(\"shutdown-enter\", \"none\")\n\n /* determine root component */\n const root = cs(\"/\")\n\n /* shutdown service layer */\n const sv = root.property(\"sv\")\n if (typeof sv === \"object\" && typeof sv.shutdown === \"function\")\n await sv.shutdown()\n\n /* shutdown component tree */\n await new Promise((resolve) => {\n root.state(\"created\", resolve)\n })\n\n /* shutdown component system */\n cs.shutdown()\n\n /* cleanup DOM */\n $(\"body\").attr(\"class\").split(/\\s+/).forEach((cls) => {\n if (cls.match(/^gs-/))\n $(\"body\").removeClass(cls)\n })\n if ($(\"body\").attr(\"class\") === \"\")\n $(\"body\").removeAttr(\"class\")\n latching.hook(\"shutdown-leave\", \"none\")\n }", "title": "" }, { "docid": "050942051f0166a66a7aaac81c4783ce", "score": "0.50263274", "text": "boot() {}", "title": "" }, { "docid": "406a45200c381f5b39f2ea5a4d6da517", "score": "0.50186783", "text": "tick() {\n if (this.state.countingDown){\n this.setState(function (prevState) {\n // When the counter hits 00:00, toggle between Session and Break and reset the timer to the corresponding one\n if (prevState.timeLeftMinutes === 0 && prevState.timeLeftSeconds === 0) {\n this.alarmBeep.play() // Play alarm sound at 00:00\n if (prevState.timerLabel === \"Session\") {\n return {\n timerLabel: \"Break\",\n timeLeftMinutes: this.state.breakLength,\n timeLeftSeconds: 0\n }\n }\n else {\n return {\n timerLabel: \"Session\",\n timeLeftMinutes: this.state.sessionLength,\n timeLeftSeconds: 0\n }\n } \n }\n\n // When seconds hit 00, reduce from minute counter and roll back seconds counter\n else if (prevState.timeLeftSeconds === 0) {\n return {\n timeLeftSeconds: 59,\n timeLeftMinutes: prevState.timeLeftMinutes - 1\n }\n }\n\n // Or just count down from seconds\n else {\n return {\n timeLeftSeconds: prevState.timeLeftSeconds - 1\n };\n }\n });\n }\n }", "title": "" }, { "docid": "87afae42c3a4e1cdceccdcc91e16793e", "score": "0.5000299", "text": "function countdown() {\n\tfor (blastOff = 10; blastOff >= 0; blastOff--) {\n\t\tblastOff > 0 ? console.log(blastOff) : console.log('Blast Off!');\n\t}\n}", "title": "" }, { "docid": "5d0c4b4d0e2086121d697cee829e8f67", "score": "0.49976182", "text": "shutdown() {\n\t\tif (this._updateInterval) {\n\t\t\tclearInterval(this._updateInterval);\n\t\t\tthis._updateInterval = null;\n\t\t}\n\t\tthis.emit('shutdown');\n\t\t\n\t\tthis.saveMemory();\n\t\tthis.postDebug('[Meta] UpdaterNeeded shutting down.')\n\t\t\t.then(()=>getLogger.shutdown)\n\t\t\t.then(()=>process.exit());\n\t\t\t//TODO Figure out why the postDebug() promise is resolving before it should!\n\t}", "title": "" }, { "docid": "b608cd718de65bda4017db4d54c451bb", "score": "0.4996099", "text": "function onLowBattery() {\n app.exit();\n }", "title": "" }, { "docid": "82ab0df41f6acb5c8ead16f7c4c4e190", "score": "0.49946734", "text": "function countDown(){\n let now = new Date(),\n eventDate = new Date(2018, 08, 01),\n currentTime = now.getTime(),\n eventTime = eventDate.getTime(),\n remTime = eventTime - currentTime,\n s = Math.floor(remTime/1000),\n m = Math.floor(s/60),\n h = Math.floor(m/60),\n d = Math.floor(h/24);\n\n h %= 24;\n m %= 60;\n s %= 60;\n\n h = (h < 10) ? \"0\"+ h : h;\n m = (m < 10) ? \"0\"+ m : m;\n s = (s < 10) ? \"0\"+ s : s;\n\n document.getElementById(\"days\").textContent = d;\n document.getElementById(\"hours\").textContent = h;\n document.getElementById(\"minutes\").textContent = m;\n document.getElementById(\"seconds\").textContent = s;\n\n setInterval(countDown , 1000);\n\n}", "title": "" }, { "docid": "449b582a54f72feee521c6296aff7577", "score": "0.49905586", "text": "function startCoolDown() {\n document.getElementById(\"display\").innerHTML = \"Cool Down\";\n lateTime = coolDown;\n resetTimer();\n startTimer();\n} // startWarmUp", "title": "" }, { "docid": "7aa6f73e5bb9921ae6a6295e0c70ea9d", "score": "0.49896094", "text": "function countDown(){\n time--;\n $(\"#timer\").html(time);\n if (time === 0){\n clearInterval(thetimer);\n }\n }", "title": "" }, { "docid": "507b9aed63bba765e906737ecebc3407", "score": "0.49874887", "text": "cleanup() {\n this.currentTicker.off('update', this.update);\n }", "title": "" }, { "docid": "802050dc599ea6850a1070ba416b9849", "score": "0.49789432", "text": "function countDown(){\n const newYearsDate= new Date(newYears);\n const currentDate = new Date();\n const totalSeconds = (newYearsDate - currentDate)/ 1000;\n \n const days = Math.floor(totalSeconds / 3600 / 24);\n const hours = Math.floor(totalSeconds / 3600 % 24);\n const mins = (Math.floor(totalSeconds / 60 % 24) % 60);\n const seg = Math.floor(totalSeconds % 60);\n\n daysEl.innerHTML = days; \n hoursEl.innerHTML = hours;\n minsEl.innerHTML = mins; \n segEl.innerHTML = seg; \n \n}", "title": "" }, { "docid": "af415be88e8b69c92ddacefa134feac7", "score": "0.49733514", "text": "exitPeriod(ctx) {\r\n\t}", "title": "" }, { "docid": "8cef554b48f7f780c040a5605a97270f", "score": "0.49712825", "text": "boot() {\n\t}", "title": "" }, { "docid": "8cf593463c94013784b0f0d9a7ba7867", "score": "0.49578068", "text": "function stopResetRunningClock() {\n //$(\"#running-clock\").empty();\n if (interval_running_clock != null) {\n clearInterval(interval_running_clock);\n interval_running_clock = null;\n }\n }", "title": "" }, { "docid": "5787f6bd1aef7326d9f4b9fff1c690da", "score": "0.49571943", "text": "function countdown() {\n\t\tif (j === 10) {\n\t\t\t$(\"#GameOver\").append(\"Game Over\");\n\t\t\t$(\"#correct\").append(\"You answered \" + correctanswers + \" correctly\");\n\t\t\t$(\"#incorrect\").append(\"You answered \" + incorrectanswers + \" incorrectly\");\n\t\t\t$(\".choice1\").off();\n\t\t\t$(\".choice2\").off();\n\t\t\t$(\".choice3\").off();\n\t\t\t$(\".choice4\").off();\n\t\t\treset = setInterval(resetGame, 5000);\n\t\t\tstopcountdown();\n\t\t\treturn;\n\t\t}\n\t\tcountingdown = setInterval(decrement, 1000);\n\t}", "title": "" }, { "docid": "08fba1a95ee00835ded46703c44a7379", "score": "0.49537766", "text": "_triggerTick () {\n if (this.tick !== undefined && this.tick !== null) {\n this.tick(this.countdown)\n }\n }", "title": "" }, { "docid": "b5ad587c039516221260715e6eb35c36", "score": "0.49503586", "text": "function isDown () { // Loop until connection succeeds, then switch to isUp\n ping.sys.probe(host, function (isAlive) { // Ping host\n if (isAlive) {\n loopCount++;\n if (loopCount > 1) { // Double-check before taking action\n timeOffset();\n webhook.body.value1 = 'Modem is back online'; // Change value of the first key in the webhook JSON body object\n webhook.body.value2 = 'Downtime was ' + offsetReadable; // Change value of the second key in the webhook JSON body object\n logChange();\n isUp();\n } else {\n isDown();\n }\n } else {\n logStatus();\n setTimeout(isDown, (30 * 1000)); // Run isDown in 30s\n }\n });\n}", "title": "" }, { "docid": "d81faf3540bf00c91c4953e1e7502a01", "score": "0.49468777", "text": "function stampaCountDown() {\r\n $('h2').text(\"Il tempo scorre: \" + time);\r\n time--;\r\n }", "title": "" }, { "docid": "096993ae76cedc5116948ed4a127609c", "score": "0.4944014", "text": "function resetDay(d) {\n d.setHours(0);\n d.setMinutes(0);\n d.setSeconds(0);\n d.setMilliseconds(0);\n}", "title": "" }, { "docid": "f000d79d8a65d8018d8c6d4dce46cec2", "score": "0.49439332", "text": "function resetCountDown(button) {\n startingMinutes; // Reseteando los minutos que va tener nuestra cuenta atras\n time = startingMinutes * 60; // Reseteando nuestro tiempo en el counterDown\n let toggleButton = $(\"#toggleCounter\");\n if (toggleButton.hasClass(\"active\")) {\n toggleButton.removeClass(\"active\").text(\"Inicar\"); // Regresar al estado original mi boton de iniciar\n clearInterval(countDown); //para mi cuentra atras\n $(\"#minutes\").html(`${startingMinutes}:00`); // Pintar los mi contador reseteado\n countDown; // llamando de nuevo counterDown para que se reinicie\n }\n}", "title": "" }, { "docid": "2d7cf265f80c1e02eb946c84deb36d3a", "score": "0.49437857", "text": "triggerWakeUpCycles() {\n triggerMorning().subscribe(() => {\n displayMessage(`Just woke up *${this.animal.sound}*, what a beautiful day!`);\n this.lifemeter.displayStatus();\n this.lifemeter.increaseAge();\n this.setWakeUpState();\n });\n }", "title": "" }, { "docid": "9da4a4f1006a323e2cf2a0e237af664b", "score": "0.4938472", "text": "function checkOff() {\n if (i > 7) {\n state = \"end\";\n }\n }", "title": "" }, { "docid": "1b023d4be93ad57a35a793bb77fa93e9", "score": "0.49352095", "text": "componentWillUnmount() {\n \t\tclearInterval(window.newStock)\n \t}", "title": "" }, { "docid": "4209ee5219d864c4bb4eba8bed353d01", "score": "0.49340135", "text": "function runClock() {\n clearInterval(intervalId);\n intervalId = setInterval(decrement, 1000);\n }", "title": "" }, { "docid": "b69ff73be489d129f14954af7a732dd1", "score": "0.49302644", "text": "fwk_app_on_update() {\n if (this.fwk_app_visible) {\n if (this._prev_update_sec === undefined) {\n this._prev_update_sec = 0;\n }\n let now_sec = Fwk.now().sec;\n if (now_sec - this._prev_update_sec > FwkTestApp.update_ival_sec()) {\n this._prev_update_sec = now_sec;\n this._init();\n this._load();\n }\n }\n }", "title": "" }, { "docid": "3889f4a1e124f89602e71dac0d957cdc", "score": "0.4927594", "text": "function fifteen() {\n intervalId = setInterval(decrement, 1000);\n }", "title": "" }, { "docid": "a47c15e05f7e00e8aefba57606a9ba59", "score": "0.49222156", "text": "fwk_app_on_update() {\n if (this.fwk_app_visible) {\n this._init();\n if (this._prev_update_sec === undefined) {\n this._prev_update_sec = 0;\n }\n let now_sec = Fwk.now().sec;\n if (now_sec - this._prev_update_sec > this._update_interval_sec()) {\n this._prev_update_sec = now_sec;\n this._load();\n }\n }\n }", "title": "" }, { "docid": "6716dc2c9468fd3104029e2f2b755976", "score": "0.49204245", "text": "stop() {\n if (this.ticker_) {\n this.ticker_.stop()\n this.ticker_ = null\n }\n }", "title": "" }, { "docid": "ed436f48cbecb7fde9973c895b5ed93a", "score": "0.4910342", "text": "stop() {\n if (this.status === CountdownStatus.stop) {\n return;\n }\n\n this.status = CountdownStatus.stop;\n this.destroy();\n this.callEvent('stop');\n }", "title": "" }, { "docid": "6a43d7169377a0cdfe157c5a39de8b27", "score": "0.49099478", "text": "function stopHeartBeat() {\n clearInterval(heartbeatTimer);\n }", "title": "" }, { "docid": "61e9c01de61d6d951ed60b5189fc0338", "score": "0.48902082", "text": "async getBleboxUptime(init) {\r\n\t\tlet states = {};\r\n\t\tstates = await this.getSimpleObject(\"deviceUptime\", null);\r\n\t\tif (init){\r\n\t\t\tawait this.initIobStates(states);\r\n\t\t}\r\n\t\tawait this.setIobStates(states);\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "9df267e364689b328969187ad8604cc2", "score": "0.4885288", "text": "startNewDay() {\n this.userIdOfLikedPosts = [];\n this.followCountCurrentDay = 0;\n this.unfollowCountCurrentDay = 0;\n this.likesCountCurrentDay = 0;\n this.dislikesCountCurrentDay = 0;\n this.storageService.cleanUp();\n }", "title": "" }, { "docid": "c046711074127d3ad8884d547014d1a8", "score": "0.48847118", "text": "function restartBrew() {\n // Cannot restart if a timer is already running\n if (vm.timerRunning) {\n return;\n }\n\n // Hide stars, \"Add Note\", brew note form, and \"Restart Brew\"\n vm.showStars = false;\n $(\"a[href].add-brew-note\").addClass(\"hidden\");\n $(\".brew-form\").addClass(\"hidden\");\n $(\".brew-step--restart\").addClass(\"hidden\");\n\n // Hide the timeline (hidden during countdown)\n $(`.time-${vm.countdownVal}`).removeClass(\"timeline\");\n\n // Show the \"RESET\" button\n $(\"a[href].reset-brew\").removeClass(\"hidden\");\n\n // Reset all steps to be inactive\n $(\".brew-step\").addClass(\"brew-step--inactive\");\n\n // Show the countdown step and its timer\n $(\".brew-step--countdown\").removeClass(\"brew-step--inactive\");\n $(\".brew-step--countdown\").removeClass(\"hidden\");\n $(\"timer.delay\").removeClass(\"hidden\");\n\n // Start the countdown timer\n $scope.$broadcast('startTimer', 'countdown');\n }", "title": "" }, { "docid": "aaaf8f23823ce3dfc2955a0ed463354a", "score": "0.48778316", "text": "function countdown() {\n clearInterval(intervalId);\n decrement();\n intervalId = setInterval(decrement, 1000);\n }", "title": "" }, { "docid": "b1e406dbee46aed084f87b16fd6a77dd", "score": "0.48732257", "text": "berriesLateUpdate() {\n BerryManager.berries.forEach(berry => {\n berry.sendMessage('lateUpdate');\n });\n }", "title": "" }, { "docid": "9ae5fce346a607f093f1a4cd5ec8f849", "score": "0.48695517", "text": "function countdownByFives() {}", "title": "" }, { "docid": "206ead09d39b5fd73ff0a97cf8a75d32", "score": "0.4846303", "text": "function closeDaily(event) {\n \n var val = LS.getData('focus-storage'),\n objectStorage = {\n 'val': null,\n 'isChecked': false\n };\n \n\t\tLS.setData('focus-storage', objectStorage);\n \n render();\n }", "title": "" }, { "docid": "f4d2cccc118427607ca30ee2cecaffb2", "score": "0.48446807", "text": "function countDown() {\r\n var count = 10;\r\n //starting countdown at 10\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n //countdown decreases to 9\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 1000);\r\n //countdown decreases to 8\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 2000);\r\n //countdown decreases to 7\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 3000);\r\n //countdown decreases to 6\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 4000);\r\n //countdown decreases to 5\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 5000);\r\n //countdown decreases to 4\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 6000);\r\n //countdown decreases to 3\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 7000);\r\n //countdown decreases to 2\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 8000);\r\n //countdown decreases to 1\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = count;\r\n count = count - 1;\r\n }, 9000);\r\n //countdown to Blast Off\r\n setTimeout(function () {\r\n document.getElementById(\"countDownTimer\").innerHTML = \"Blast off\";\r\n count = count - 1;\r\n }, 10000);\r\n}", "title": "" }, { "docid": "a64d94f86be0cc3ec397380a05e9bd58", "score": "0.48376295", "text": "function countdown()\n{\n maxTicks--;\n}", "title": "" }, { "docid": "6aa31a691b5643277331e2252f991bcb", "score": "0.48359323", "text": "onAutoDataUsageResetToggle_() {\n this.autoReset_ = !this.autoReset_;\n this.resetDay_ = 1;\n const day = this.autoReset_ ? {value: this.resetDay_} : null;\n this.trafficCountersAdapter_.setTrafficCountersAutoResetForNetwork(\n this.guid, this.autoReset_, day);\n this.load();\n }", "title": "" }, { "docid": "4aa9fec7eba271d58c68b7cad69d6c64", "score": "0.48324567", "text": "preShutdown(callback) {\n let self = this;\n self.is_shutting_down = true;\n self.reportWorker(self.name, intf.Consts.WorkerStatus.closing, (err) => {\n if (err) {\n log.logger().error(self.log_prefix + \"Error while reporting worker status as 'closing':\");\n log.logger().exception(err);\n }\n self.leadership.shutdown((err) => {\n if (err) {\n log.logger().error(self.log_prefix + \"Error while shutting down leader:\");\n log.logger().exception(err);\n }\n callback();\n });\n });\n }", "title": "" }, { "docid": "d7afc53bc334caef2d53d58c9ad6f541", "score": "0.4831898", "text": "function loadTimer() {\n clearInterval(btIntervalId);\n btIntervalId = setInterval(btDecrement, 1000);\n }", "title": "" }, { "docid": "6d60dbbe38b0d096be3d1ea75108a706", "score": "0.48299184", "text": "function countDown() {\n timer--;\n $('.time-counter').text(timer);\n if(timer === 0){\n timeOut();\n };\n}", "title": "" }, { "docid": "770ed6c7c46112b9f9ef491990919f44", "score": "0.48239207", "text": "triggerSleepingCycles() {\n triggerNight().subscribe(() => {\n displayMessage(`Sleepy sleepy *${this.animal.sound}*, going to sleep now!`);\n this.setSleepingState();\n });\n }", "title": "" }, { "docid": "c1ce880a34667b91ac2c70ee7d530712", "score": "0.4820089", "text": "function decrement() {\n\t\tcountdown--;\n\t\t$(\".show-timer\").html(countdown);\n\n\t\tif(countdown === -1) {\n\t\t\tstop();\n\t\t\tcountdown = 31;\n\t\t\tanswerChoices();\n\n\t\t};\n\n\t}", "title": "" }, { "docid": "9497b79605913c5b8b13f65ef790e88f", "score": "0.48144853", "text": "function countDownTimer (){\n\t\tsecondsRemaining--;\n\t\t$(\"#seconds\").html(secondsRemaining);\n\t\tif (secondsRemaining === 0) {\t\n\t\t\tcount++;\n\t\t\tsecondsRemaining = 30;\n\t\t\tquestionDisplay();\n\t\t}\n\t}", "title": "" }, { "docid": "c76ab0213d398e92223b158c8b104f47", "score": "0.48138398", "text": "function countingdown() {\n document.countDown.num.value--;\n}", "title": "" }, { "docid": "69022681c558e22192c6267c33b5aded", "score": "0.48134592", "text": "function ticker(){\n if(debug)\n console.log('tick');\n $.getJSON(ticker_url, function(data) {});\n setTimeout(ticker, 10 * 60 * 1000);\n}", "title": "" }, { "docid": "75f495fde54faebc9a3eb77a25231b92", "score": "0.4811305", "text": "function decrement() {\n count--\n $(\"#counter\").text(count);\n if (count == 0) {\n clearInterval(intervalID);\n running = false;\n timeUp()\n \n }\n}", "title": "" }, { "docid": "616b2c47cca2790dd4acab3b6f4eeb35", "score": "0.48103932", "text": "function stop() {\n\t\tTicker.removeListener(tick);\n\t}", "title": "" }, { "docid": "b60520a15e7b80e1d7c9fc0a2669bd03", "score": "0.48094347", "text": "shutdown() {\n async.series([\n this.killChildren(),\n this.saveNodeServers(),\n //web.stopService(),\n mqttc.stopService(),\n mqtts.stopService(),\n //db.stopService(),\n setTimeout(process.exit(0),500)\n ])\n }", "title": "" }, { "docid": "3442a41b2865511e9352a633b01682aa", "score": "0.4809224", "text": "function w3_reboot_cb()\n{\n\tw3_show_block('id-reboot');\n}", "title": "" } ]
db2264e8d8bb0c929f8b44046e79c1fe
This is free and unencumbered software released into the public domain. See UNLICENSE.
[ { "docid": "affbb0883f2342d98d4c4ad1b8043f1f", "score": "0.0", "text": "function world_moveTurn() {\n return {\n id: \"world1\",\n name: \"Move &amp; Turn\",\n levels: [\n {\n level: puzzle_welcome(),\n /**\n * The awards that will be given to the player once the level is\n * completed.\n */\n badges: {\n instruction: {\n \"move\": true,\n \"turn\": true\n }\n },\n /**\n * what conditions need to be met to unlock this level?\n * the unlock returns true if this level should be unlocked\n */\n unlock: function() {\n return true\n },\n },\n {\n level: puzzle_uturn(),\n badges: {},\n unlock: prevLevelCompleted\n },\n {\n level: puzzle_blocks(),\n badges: {},\n unlock: prevLevelCompleted\n },\n {\n level: puzzle_torus(),\n badges: {},\n unlock: prevLevelCompleted\n },\n {\n level: puzzle_zig_zag(),\n badges: {},\n unlock: prevLevelCompleted\n },\n {\n level: puzzle_traps(),\n badges: {},\n unlock: function(campaign, state, world_index, level_index) {\n return isLevelCompleted(state, world_index, level_index - 2) \n }\n },\n ]\n }\n}", "title": "" } ]
[ { "docid": "650ff554859977bab92401016e1b7806", "score": "0.6937309", "text": "private public function m246() {}", "title": "" }, { "docid": "44dfde9906fa1c183245d889a94dcfc2", "score": "0.6834098", "text": "private internal function m248() {}", "title": "" }, { "docid": "b33f113b364cb6a949568de25eed0541", "score": "0.65449375", "text": "transient private internal function m185() {}", "title": "" }, { "docid": "52b64fbfa48bc95d11ed241ebbfa874b", "score": "0.6544917", "text": "protected internal function m252() {}", "title": "" }, { "docid": "c3c25cf1ec1e29fc7c48de89a7783e78", "score": "0.6475953", "text": "transient protected internal function m189() {}", "title": "" }, { "docid": "cf9ce75761cad4941aee8bb5bc575522", "score": "0.6467008", "text": "transient final protected internal function m174() {}", "title": "" }, { "docid": "67fb1e0945a420ae9db984ef54bcf3d1", "score": "0.64313596", "text": "transient private protected internal function m182() {}", "title": "" }, { "docid": "f1c7314a8a6377212b3b1ef87294d24f", "score": "0.63313776", "text": "static transient final protected public internal function m46() {}", "title": "" }, { "docid": "83537a1e4ca50b2c5e40ce61b473a85b", "score": "0.6251049", "text": "static transient final protected internal function m47() {}", "title": "" }, { "docid": "3cca6f93efa9ebfc5ca48df4a9bf8fc7", "score": "0.62393856", "text": "static transient final private internal function m43() {}", "title": "" }, { "docid": "28d6c8882b456d32efd62295bb8bb3fb", "score": "0.61812603", "text": "static final private internal function m106() {}", "title": "" }, { "docid": "3e392767020376db6a11cf854f020420", "score": "0.61432546", "text": "static transient final private protected internal function m40() {}", "title": "" }, { "docid": "d45637012cbb4c67efaae60843d8f53d", "score": "0.61107886", "text": "static transient private protected internal function m55() {}", "title": "" }, { "docid": "59ead3af459e8ad39f66a32162206af2", "score": "0.60862297", "text": "static transient private protected public internal function m54() {}", "title": "" }, { "docid": "ee65c6c23ba35809ca8d65ab809a4fed", "score": "0.60569626", "text": "transient final private protected internal function m167() {}", "title": "" }, { "docid": "befdecdf4a7bf48d9420b7d26c55916d", "score": "0.59974736", "text": "function _____SHARED_functions_____(){}", "title": "" }, { "docid": "21202cdb3707850c0b0db221f39311a3", "score": "0.5955776", "text": "transient final private protected public internal function m166() {}", "title": "" }, { "docid": "220c91d045d529816acdea75c15274eb", "score": "0.5939828", "text": "transient private protected public internal function m181() {}", "title": "" }, { "docid": "6af6bd78b9d52bcc22735ff022111502", "score": "0.59239805", "text": "static transient final protected function m44() {}", "title": "" }, { "docid": "4fc4a89f08bb88c36370bac974880c27", "score": "0.5907149", "text": "transient private public function m183() {}", "title": "" }, { "docid": "5403238d4184f5632a3765ef78b2a364", "score": "0.5884547", "text": "transient final private internal function m170() {}", "title": "" }, { "docid": "8b22d16ffad9def34d45d9fbab1259f8", "score": "0.5843792", "text": "static transient private public function m56() {}", "title": "" }, { "docid": "04cc796a1a2b9422786b7134e33fa6ef", "score": "0.58301723", "text": "static private internal function m121() {}", "title": "" }, { "docid": "88369507a5fde33e7aec9e00e2eaf9a0", "score": "0.5761692", "text": "static private protected internal function m118() {}", "title": "" }, { "docid": "4960adbf0c25c9ceb299043adaad5d5e", "score": "0.57454544", "text": "static transient private internal function m58() {}", "title": "" }, { "docid": "300c0ddc31c5332c68af92c1b3ac2b8a", "score": "0.56847715", "text": "static transient final private protected public internal function m39() {}", "title": "" }, { "docid": "c8ac2700475ab780db94c845554e4a78", "score": "0.566879", "text": "static final private public function m104() {}", "title": "" }, { "docid": "b9678f002ad40e28f61787784b2195f0", "score": "0.56540126", "text": "static protected internal function m125() {}", "title": "" }, { "docid": "43aeb0e8be9eb1e03dd3fa81453171b4", "score": "0.5619123", "text": "static ready() { }", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5593573", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5593573", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5593573", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5593573", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5593573", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5593573", "text": "initialize() {}", "title": "" }, { "docid": "43ff965c3063f616a30e394ca4639fe9", "score": "0.5590982", "text": "function DWRUtil() { }", "title": "" }, { "docid": "f1e2f82081e7c9f60b40a62f51b9995d", "score": "0.55876046", "text": "static transient final private public function m41() {}", "title": "" }, { "docid": "47f16eb5845acd037ada73601afd57ff", "score": "0.55775964", "text": "transient final private public function m168() {}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.55539775", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.55539775", "text": "constructor() {\n\t}", "title": "" }, { "docid": "137cf68a24ac6e192c29191550b7c560", "score": "0.55219686", "text": "static private protected public internal function m117() {}", "title": "" }, { "docid": "e1fd6370f9dceb24ecc3cd7ebbb8a8e8", "score": "0.55219644", "text": "function SigV4Utils() { }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5492344", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.549083", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "c4e691fd99c4a41814c1c388b6d546dd", "score": "0.54713863", "text": "static transient final private protected public function m38() {}", "title": "" }, { "docid": "f97925d34e944763d94c11ac8b79c5e8", "score": "0.5455357", "text": "initialize()\n {\n }", "title": "" }, { "docid": "b42351186d39e9dcb30e6c46cddcfeee", "score": "0.54520345", "text": "constructor () {\r\n\t\t\r\n\t}", "title": "" }, { "docid": "ad91cf774842c7f01d01e1212f9f184d", "score": "0.54138887", "text": "constructor () { super() }", "title": "" }, { "docid": "4da117810475b0e9ba413138eafc9f0e", "score": "0.5409862", "text": "constructor (){}", "title": "" }, { "docid": "240644cc0b3bb87bf74241a66c29e74d", "score": "0.539765", "text": "function StupidBug() {}", "title": "" }, { "docid": "301f2ebe5360d9fdfa5e873b757d6bbf", "score": "0.5389435", "text": "static final private protected internal function m103() {}", "title": "" }, { "docid": "0a4604394a6dab697d4bfad1ff9b47b9", "score": "0.53785163", "text": "function WSAPI() {\n }", "title": "" }, { "docid": "87ba68c22404f14f983ab256193c0855", "score": "0.53613573", "text": "function version(){ return \"0.13.0\" }", "title": "" }, { "docid": "f66ee57414255f4244ad5d088c1767f9", "score": "0.53454804", "text": "constructor() {\n\t\t// ...\n\t}", "title": "" }, { "docid": "4c1ea78d778fc7556b74a417f1e75309", "score": "0.5342194", "text": "function Bevy() {}", "title": "" }, { "docid": "b74a9ca6d29d03f398001e2ee9e346fc", "score": "0.5335818", "text": "frame() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "20ec093e744b26c3bcaad65b435d01ea", "score": "0.5318458", "text": "static final protected internal function m110() {}", "title": "" }, { "docid": "d70a588c9c8603d0d6763381e733fdbd", "score": "0.5316823", "text": "constructor( ) {}", "title": "" }, { "docid": "3851bc35b2cb99d240553f3088eaa830", "score": "0.5301029", "text": "obtain(){}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.52956206", "text": "init () {}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.52956206", "text": "init () {}", "title": "" }, { "docid": "069fa12d6ffc4f1cb9ef54cc58fcb53a", "score": "0.52914554", "text": "initialize() {\n\n }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5281767", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5281767", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5281767", "text": "ready() { }", "title": "" } ]
91fec091e4de65a2c724528a35ea00bb
Callback for when everything is done
[ { "docid": "ce51978866f110eb35f1558d13cb6233", "score": "0.0", "text": "function done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" } ]
[ { "docid": "b129dc0a7872d11b6490cf73326c4f77", "score": "0.7797569", "text": "function _done(){}", "title": "" }, { "docid": "293462ea36f1210bc9add374c78db0cf", "score": "0.76460195", "text": "done () {\n\n\t\tthis._callBackOnComplete();\n\t}", "title": "" }, { "docid": "c38a382e1d4e802d84798bb3dc2b3e7f", "score": "0.73289984", "text": "onFinish() {}", "title": "" }, { "docid": "c8f0405d54ba4371b0fce5fb9682bb21", "score": "0.72417575", "text": "done() {}", "title": "" }, { "docid": "c8f0405d54ba4371b0fce5fb9682bb21", "score": "0.72417575", "text": "done() {}", "title": "" }, { "docid": "58a8eb079114b0d530ed091508e71cc2", "score": "0.7207289", "text": "function ondone() {\n cleanup();\n callback(result);\n }", "title": "" }, { "docid": "34ffbaedd153be9f0050b6a27dfa8a17", "score": "0.71673983", "text": "function done() {\n\t\t\tcallback();\n\t\t}", "title": "" }, { "docid": "11a0ea295488cdc96910da4215af7d5e", "score": "0.71593755", "text": "function onFinish() {\n console.log('finished!');\n }", "title": "" }, { "docid": "27ea8b6d6210ad7ae41d42ead25743c5", "score": "0.7123885", "text": "function doneCb() {\n console.log('done')\n }", "title": "" }, { "docid": "a63ce86e0d3352b79f0cde5a5755912d", "score": "0.69340444", "text": "function done() {\n\tvar len;\n\tvar f;\n\tvar i;\n\n\tlen = listeners.length;\n\n\t// Inform all the listeners that the harness has finished...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf = listeners.shift();\n\t\tf();\n\t}\n}", "title": "" }, { "docid": "aaf5c6071e67df6493b13157bd4e3be5", "score": "0.69194514", "text": "function done() {\n\t self._server = null;\n\t if (callback) {\n\t callback.apply(null, arguments);\n\t }\n\t }", "title": "" }, { "docid": "c58faf231a19f70f3b708190791b40e8", "score": "0.6916781", "text": "function complete() {\n console.log(\"Begin complete():: created=\"+created+\" updated=\"+updated+\" deleted=\"+deleted); //DEBUG\n if(created && updated && deleted) {\n console.log(\"Job well done.\");\n context.succeed();\n }\n }", "title": "" }, { "docid": "6fc75c50e3c6fa1c4f032d0d3dd7d867", "score": "0.68924415", "text": "_oncomplete(){}", "title": "" }, { "docid": "5d1da6a675345c0abee045a3972516d6", "score": "0.68901104", "text": "function onAllDone(calls, cb) {\n // Implement this\n }", "title": "" }, { "docid": "622f453675c383a5d39173fa372fddf9", "score": "0.68886673", "text": "function finish() {\n if (!done) {\n done = true;\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "022c7c004910ddb5715d0a87ede3f52a", "score": "0.68673193", "text": "function whenDone() {\n done = true;\n checkReady();\n }", "title": "" }, { "docid": "2aacf4e38bcedbbc90efb9481dd965e3", "score": "0.6858631", "text": "doneLoading() {\n\t\t\tclearTimeout(this.timeout);\n\t\t\tthis.loaded = true;\n\t\t\tif (this.callback !== 0) {\n\t\t\tthis.callback();\n\t\t\t}\n\t}", "title": "" }, { "docid": "f8095ab2c0b3babf03e36a48e9707d40", "score": "0.6844498", "text": "function _done() {\n if (_doneCallback) {\n _doneCallback();\n _doneCallback = null;\n }\n}", "title": "" }, { "docid": "6aba9da48402ed80970e467f987aa0d4", "score": "0.68050796", "text": "function done(self){\n\t\t\tthis.graph.canvas.container.find('.loader').remove();\n\n\t\t\t// Build the menus\n\t\t\tthis.updateLayerMenu();\n\t\t\tthis.updateViewMenu();\n\t\t\tthis.updateOptionsMenu();\n\n\t\t\t// CALLBACK\n\t\t\tif(typeof this.callback===\"function\") this.callback.call(this);\n\n this.log.info('Finished processing '+this.el.getAttribute('id'));\n\n\t\t}", "title": "" }, { "docid": "1e5dc4c389bc68bf35662689eead45f7", "score": "0.6776483", "text": "function complete() {\n\t\t\tcallbackCount++;\n\t\t\tif(callbackCount >= 1) {\n\t\t\t\t//console.log(context);\n\t\t\t\tres.render('UpdatePlayer', context);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cd42af345b82a2177fa6f87793809c3d", "score": "0.6771641", "text": "onDone(){\n if(this.config.debug) console.log('onDone callback !')\n if(this.config.onDone) this.config.onDone()\n }", "title": "" }, { "docid": "d48b615d8c8b37c60fa4ac7a5896a4e7", "score": "0.67579657", "text": "Finished()\n {\n\n }", "title": "" }, { "docid": "d645b65755826bd29a4dece9cfddf763", "score": "0.67561173", "text": "_complete() {}", "title": "" }, { "docid": "55b471123af4a30869cdafd5cc78f362", "score": "0.67335933", "text": "done () {\n this._ended = true;\n this._start(this._result);\n }", "title": "" }, { "docid": "1758834b4b5753fc4e38450c931807a0", "score": "0.6725499", "text": "function done(err, result) {\n util.debug('Cycle Completed','results or error available');\n}", "title": "" }, { "docid": "366c4d211d2c1f6f009c8c2bd36fee35", "score": "0.67245924", "text": "function complete(){\n callbackCount++; \n if(callbackCount >= 1){\n //res.render('visit', context);\n res.json(context);\n }\n\n }", "title": "" }, { "docid": "544326435c7775a16ffd061df7c6c8bb", "score": "0.6719667", "text": "function makeComplete() {\n\n}", "title": "" }, { "docid": "cd348d27eef8a01dbd128b738b17967a", "score": "0.6717038", "text": "function completeTask() {\n\t\t\tif (o && _.isFunction(o.callback)) {\n\t\t\t\to.callback(o.fontName, o.types, o.glyphs, o.hash);\n\t\t\t}\n\t\t\tallDone();\n\t\t}", "title": "" }, { "docid": "91e92770a0e449cdc46d9288c99be046", "score": "0.66943336", "text": "function complete(){\n callbackCount++;\n if(callbackCount >= 1){\n res.render('update-movie', context);\n }\n }", "title": "" }, { "docid": "95973d2215a292330e4b2976321bf7c7", "score": "0.6690884", "text": "function async_return() {\r\n console.log(\"ready\");\r\n if (async_num == 0) {\r\n callback(file_list);\r\n }\r\n }", "title": "" }, { "docid": "12148407feb242d54f540c348cb2f8d9", "score": "0.6683349", "text": "function callbackDone() {\n module.presentation.set('contents', module.contents);\n module.callback(module.command);\n }", "title": "" }, { "docid": "12148407feb242d54f540c348cb2f8d9", "score": "0.6683349", "text": "function callbackDone() {\n module.presentation.set('contents', module.contents);\n module.callback(module.command);\n }", "title": "" }, { "docid": "f37d9affebacd26b74039631c63ac1d8", "score": "0.66388106", "text": "function done() {\n self._server = null;\n if (callback) callback.apply(null, arguments);\n }", "title": "" }, { "docid": "03fd54c4e7c0fc42718b17104b5c8422", "score": "0.66092277", "text": "function complete(results) {\n $yetify.tower.emit(\"results\", results);\n }", "title": "" }, { "docid": "3a87473ee87c70c71dcf907bc9daee4d", "score": "0.6606418", "text": "complete(){this.done(\"complete\")}", "title": "" }, { "docid": "fe0e7e7f7f6dd61020a8ca9275dc9612", "score": "0.66054946", "text": "function complete(){\n callbackCount++;\n if(callbackCount >= 1){\n\n res.render('parts', context);\n }\n\n }", "title": "" }, { "docid": "6382bf2f88d6e1175bb04767ff056c50", "score": "0.6596474", "text": "function done () {\n log('done'.green);\n }", "title": "" }, { "docid": "eb6e1b54047b745ed78bc769eb4e3a55", "score": "0.6522281", "text": "function done() {\n self._server = null;\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "ca1c6e1f91faaf33e0a070794c03e2f3", "score": "0.6513533", "text": "function end(done) {\n//call `done()` to finish the output\n done();\n}", "title": "" }, { "docid": "feb58ce54319fb3e4368c15158876d80", "score": "0.6481035", "text": "done() {\n var data = {\n 'id' : this.id,\n 'tempresults' : this.results\n };\n this.socket.emit('benchmark_done', data);\n ResultDbAgent.completeBenchmark(this.id);\n }", "title": "" }, { "docid": "68f49a978b82651cfde1e2e8159eba45", "score": "0.6469249", "text": "function cb() { }", "title": "" }, { "docid": "72f13556142ebea5e90e64f1121884af", "score": "0.6460849", "text": "function done() {\n this.complete = true;\n cleanDir(this.options.tmp);\n if (typeof this.options.success) {\n this.options.success();\n }\n }", "title": "" }, { "docid": "12e19d6a3cba1c99c34ab3498b3181ad", "score": "0.6448179", "text": "function complete(index) {\n completedcount++;\n if (resultList.length === completedcount) {\n let t2 = new Date();\n console.log('result files parsing', (t2 - t1) / 1000);\n callback();\n }\n }", "title": "" }, { "docid": "b4d5de9ac671cfd7a6bca39742b9420e", "score": "0.64310956", "text": "doneLoading() {\n\t\tconst result = this.isLoading();\n\n\t\tif (result === 1) {\n\t\t\tif (typeof this.loadedCallback !== 'undefined' && this.loadedCallback !== 0 && this.loadedCallback !== null) {\n\t\t\t\tthis.loadedCallback();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "e2c49958cc9960bd015094995d388454", "score": "0.6413337", "text": "function complete() {\n processedItems++;\n console.log(\"Processed domain \"+processedItems+\" of \"+totalItems); //DEBUG\n if(processedItems==totalItems) {\n console.log(\"All domains processed, shut 'er down.'\");\n callback(null, \"EOL\"); // End the Lambda\n }\n } //complete()", "title": "" }, { "docid": "5446b017d0473b02707822f443aafcbc", "score": "0.64041543", "text": "function completed() {\n\t\t\tclearTimeout(t);\n\t\t\telem.onreadystatechange = elem.onload = elem.onerror = null;\n\t\t\tcallback(elem);\n\t\t}", "title": "" }, { "docid": "0d7c4d1091f64282e65031a01d43d8f8", "score": "0.6398357", "text": "function checkFinished () {\n console.log(fileLoadCount+\" files loaded\");\n if (fileLoadCount == fileLoadThreshold) { \n console.log(\"localFileLoader - callback: \"+cFunc.name);\n cFunc(targetObj); \n } else {\n fileLoadCount++;\n }\n }", "title": "" }, { "docid": "1434ec56ab7ce274d263b728dda4f664", "score": "0.63949716", "text": "function complete(){\n\t\t\t\tcallbackCount++;\n\t\t\t\tif(callbackCount >=1){\n\t\t\t\t\tres.render('add_event', context)\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "7dcfa9477dc2c48043064dd02a637922", "score": "0.6390457", "text": "function uploadComplete() {\n }", "title": "" }, { "docid": "c880730cbd97a834a5fb5cdb9e71a34c", "score": "0.6388806", "text": "_onTasksDone() {\n // meant to be implemented by subclass if needed\n }", "title": "" }, { "docid": "01bf2ce4d1fd5c59fa8554c44022633f", "score": "0.63845104", "text": "finish() {}", "title": "" }, { "docid": "ad52dee8edd621afc42e21add8b6f3fc", "score": "0.6382755", "text": "function finished(err) {\n if (err) {\n console.log(\"ooops, something went wrong.\");\n console.log(err);\n } else {\n console.log('Data saved successfully');\n }\n }", "title": "" }, { "docid": "b6f136866c2ee246edcade801e15d356", "score": "0.6356212", "text": "function onAllDone( err ) {\n if ( err ) {\n Y.log( 'Could not initialize form on server: ' + JSON.stringify( err ), 'warn', NAME );\n return callback( err );\n }\n callback( null, activity, template, mapper, mapperContext );\n }", "title": "" }, { "docid": "c7bb8246bdd9c0d6ff428f0f3d00fa99", "score": "0.63560337", "text": "function finish() {\n\n}", "title": "" }, { "docid": "9fc07d633fbb2e057a7b795bae1ac21c", "score": "0.6343141", "text": "function complete() {\n context.close();\n callback.apply(fs, arguments);\n }", "title": "" }, { "docid": "9fc07d633fbb2e057a7b795bae1ac21c", "score": "0.6343141", "text": "function complete() {\n context.close();\n callback.apply(fs, arguments);\n }", "title": "" }, { "docid": "11dfa3ca337fbe43504dcfafe40ca988", "score": "0.6332815", "text": "_impl_allDone() {\n this._collector.allDone();\n }", "title": "" }, { "docid": "a65a5682c2225f8f9e21e0a2b4806e8c", "score": "0.63162804", "text": "function _ProcessSyncDoneCallback() {\n if (_opt.syncDoneCallback != null) {\n _opt.syncDoneCallback();\n }\n }", "title": "" }, { "docid": "3845f41bd86897496a2b74baca78587c", "score": "0.6310107", "text": "function complete(){\n callbackCount++;\n if(callbackCount >= 4){\n res.render('stack', context);\n //console.log(company);\n //console.log(field);\n //console.log(tool);\n //console.log(code);\n //console.log(list);\n }\n\n }", "title": "" }, { "docid": "a785c308f808aa53b109ac8de7eff674", "score": "0.630776", "text": "function case_done() {\n\n if (case_result.status == 'running') {\n case_result.status = 'success';\n }\n \n show_fixture_result(case_result);\n \n case_results.push(case_result);\n \n process.nextTick(execute);\n }", "title": "" }, { "docid": "5c657a191cc2f362e3591de6ae6d3c28", "score": "0.6297772", "text": "onFinished(eventArgs) {\n // (implemented by child class)\n }", "title": "" }, { "docid": "e7d45e2ebfc91505b668623c19d747c4", "score": "0.62884915", "text": "function onAllDone(err) {\n if ( err ) {\n Y.log( 'Problem applying mapper context for activity: ' + JSON.stringify( err ), 'warn', NAME );\n return callback( err );\n }\n\n Y.log( 'Order is mapped into form.', 'debug', NAME );\n onOwnProgress( { percent: 100, label: 'Form mapper ready.' } );\n\n mapper.context = mapperContext;\n callback( null, mapper );\n }", "title": "" }, { "docid": "6d70be5d4a72e9c022040779ef9b022f", "score": "0.6274508", "text": "function saveComplete() {\n\t\t\tif ($.isFunction(completeCallback)) {\n\t\t\t\tcompleteCallback(successfulOperations, failedOperations);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c54da5ea3c6f1825ba2c3fd931e24dc7", "score": "0.62596506", "text": "function onAllDone(err) {\n\n if ( err ) {\n Y.log( 'Problem applying mapper context for activity: ' + JSON.stringify( err ), 'warn', NAME );\n return callback( err );\n }\n\n if( !mapper ) {\n return callback( null, null );\n }\n\n mapper.context = mapperContext;\n\n Y.log( 'Activity is mapped into form.', 'debug', NAME );\n onOwnProgress( { percent: 100, label: 'Form mapper ready.' } ); // TRANSLATEME\n callback( null, mapper );\n }", "title": "" }, { "docid": "a5c485379ee917157bf91dbeb32b198c", "score": "0.62353885", "text": "onready() {}", "title": "" }, { "docid": "d5ec46f8db9ccfea641dfa113e200b07", "score": "0.6230203", "text": "onended() {}", "title": "" }, { "docid": "c263c7c5ae50f628583dc40542596e78", "score": "0.62257046", "text": "function done() {\n console.log(\"Images loaded!\")\n}", "title": "" }, { "docid": "270c6211eef35db5997899017eccc7fa", "score": "0.622146", "text": "_final(cb) {\n cb();\n return;\n }", "title": "" }, { "docid": "96e936bc54e2ac6cc1982d590e327edb", "score": "0.621929", "text": "function complete() {\r\n ingestionCoordinator.send(null);\r\n allSent = true;\r\n}", "title": "" }, { "docid": "753d1e5238a28deb2f78258ba56a9ac5", "score": "0.62087697", "text": "function localComplete() {\n self.log(`Done: ${cmdName}`);\n self.emit(`${EventNS}:taskdone`, {\n cmd: cmdName,\n media: self.getMetadataBySlug(slug)\n });\n }", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.61970186", "text": "async end() { }", "title": "" }, { "docid": "2ff307d6132e9e850570fc61c7828926", "score": "0.61916816", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "0309d299fbcc178c446a16a4dff3bf9a", "score": "0.6189448", "text": "function complete() {\n\t\t\tcallbackcount++;\n\t\t\tif (callbackcount >= 3) {\n\t\t\t\tres.render('control_instances.handlebars', context);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ed795fb2dafae922b34aa66c7efc1363", "score": "0.61875945", "text": "function startDownload() {\n\n //Prefer to use API way\n if (config.useAPI) {\n let albums = config.albums;\n let overAllCount = 0;\n\n albums.forEach(album => {\n api.downLoadImagesByAlbum(album, function(result) {\n if (result) {\n console.log('Album ' + albums[0] + ' was saved');\n }\n\n overAllCount++;\n if (albums.length == overAllCount) {\n process.exit(0);\n }\n });\n });\n\n }\n //Old way of doing things if you like hardcore stuff\n else {\n\n fileHandler.collectData(function error(message) {\n console.error(message);\n }, function success(data) {\n if (data != undefined) {\n let overAllCount = 0;\n let dataAmount = data.length;\n data.forEach(album => {\n downloader.downloadImages(album, function(albumName) {\n console.log('Images were saved in album ' + albumName);\n overAllCount++;\n\n if (dataAmount == overAllCount) {\n process.exit(0);\n }\n });\n });\n }\n else {\n console.error('Something went wrong with getting list of albums');\n process.exit(1);\n }\n });\n }\n}", "title": "" }, { "docid": "863b05bba3809aa3779b251ca0d88709", "score": "0.61851346", "text": "_onComplete () {\n // Ensure worker queues for all paths are stopped at the end of the query\n this.stop()\n }", "title": "" }, { "docid": "863b05bba3809aa3779b251ca0d88709", "score": "0.61851346", "text": "_onComplete () {\n // Ensure worker queues for all paths are stopped at the end of the query\n this.stop()\n }", "title": "" }, { "docid": "5b6d649f191ceb8d7e285677efe71988", "score": "0.618273", "text": "function scriptsDone () {\n \n let DOMContentLoadedEvent = document.createEvent('Event');\n DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true);\n document.dispatchEvent(DOMContentLoadedEvent);\n\n // based on an array of callback functions specified by the user\n callBacks.forEach(cb => {\n cb;\n })\n \n //console.log(\"scripts done\", document)\n }", "title": "" }, { "docid": "5a9b994963e1be9e4bfb241f5e4d593f", "score": "0.61741066", "text": "function complete() {\n\t\t\tcallbackcount++;\n\t\t\tif (callbackcount >= 4) {\n\t\t\t\tres.render('control_instances.handlebars', context);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "eb06d74f9e90dc58aba420ac992bba73", "score": "0.6163591", "text": "function oncomplete_fn () {\n if ( error_list.length === 0 ) {\n logFn( local_str + 'Success' );\n then_fn();\n }\n else {\n error_list.sort();\n console.log( error_list.join( prefixStr ) );\n failFn( local_str + 'Fail' );\n }\n }", "title": "" }, { "docid": "bce7e5433ab652b3862ce3189908ec55", "score": "0.6157039", "text": "function complete(){\r\n insertBookAuthor(res, mysql, bookAuthorInserts, finalComplete); // Because we must have a valid ISBN, author_id, genre_id, publisher_id\r\n insertBookGenre(res, mysql, bookGenreInserts, finalComplete); // due to foreign key restraints. In other words, these keys must exist in the parent table. \r\n insertBookCopies(res, mysql, bookCopiesInserts, finalComplete);\r\n }", "title": "" }, { "docid": "8503e7629af1dcaa72e553992f384aa4", "score": "0.6153494", "text": "_done() {\n this.printWarnings();\n const allWarningCount = this.countWarningsByType();\n const errorWarningCount = allWarningCount.get(polymer_analyzer_1.Severity.ERROR);\n // If any ERROR warnings occurred, propagate an error in each build stream.\n if (errorWarningCount > 0) {\n this.emitAnalysisError(new Error(`${errorWarningCount} error(s) occurred during build.`));\n return;\n }\n // If analysis somehow finished with files that still needed to be loaded,\n // propagate an error in each build stream.\n for (const filePath of this.loader.deferredFiles.keys()) {\n const err = new Error(`Not found: ${filePath}`);\n this.loader.rejectDeferredFile(filePath, err);\n return;\n }\n // Resolve our dependency analysis promise now that we have seen all files\n this._dependenciesStream.end();\n this._resolveDependencyAnalysis(this._dependencyAnalysis);\n }", "title": "" }, { "docid": "49f797cd21ef37f271955f7b251769b7", "score": "0.6144842", "text": "function finished(){\n Logger.log(\"Script finished\");\n}", "title": "" }, { "docid": "793e210f22bcea5d40ee0822cd3fe55f", "score": "0.61414635", "text": "finish () {\n this.done = true\n }", "title": "" }, { "docid": "ed4071e330502b63de79e53c55e6303b", "score": "0.6132934", "text": "function allFetchesDone(callback) {\n if (items.length == 0) {\n console.log(\"Fetching collection done. \" + ids.length + \" records found.\");\n util.call(callback);\n } else {\n addItemsAsTask();\n async.parallel(asyncTasks, function () {\n allFetchesDone(callback);\n });\n }\n}", "title": "" }, { "docid": "bf54037e3cf1e78ee7b80c8da3d8a980", "score": "0.6130754", "text": "function checkFinished () {\n console.log(fileLoadCount+\" files loaded\")\n if (fileLoadCount == fileLoadThreshold) {\n \n console.log(\"loadOBJMehses - callback: \"+cFunc.name);\n if ( cArguments === undefined ) {\n cFunc();\n } else {\n cFunc(cArguments);\n }\n \n }\n }", "title": "" }, { "docid": "ed0f4a5d96df587ed216a3c23bef5b3d", "score": "0.6122207", "text": "function test_done() {\r\n\t\tif(that.to_run.length > 0) {\r\n\t\t\tthat.start();\r\n\t\t} else {\r\n\t\t\t$(resultsdivid).append('<p class=\"complete\">Tests Complete</p>');\t\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "c5ab549de0fd301befc1b187b4fa84e3", "score": "0.61197156", "text": "onload() {\n // do something to the UI when this fires to signify that it's done\n console.log('done loading');\n }", "title": "" }, { "docid": "9f8cbe7ff063c908ea39318a0e2eb6f0", "score": "0.6103401", "text": "function completeTask() {\n if (defaultOptions && defaultOptions.callback && 'call' in defaultOptions.callback) {\n defaultOptions.callback(defaultOptions.fontName, defaultOptions.types, defaultOptions.glyphs, defaultOptions.hash);\n }\n allDone();\n }", "title": "" }, { "docid": "272ea3a05109da7a197c11b919bc8b0d", "score": "0.60885", "text": "checkForDone() {\n this.remainingFilesToProcess--;\n\n if (this.remainingFilesToProcess === 0) {\n this.outputBuffers = [];\n this.bufferMap = new Map();\n this.bufferOffset = 0;\n\n this.processBuffers()\n .then(() => {\n this.callback({\n file: this.buildOutputFile()\n });\n })\n .catch((error) => {\n this.callback({\n error: error\n });\n });\n }\n }", "title": "" }, { "docid": "a854de742646f53d0714720329f93125", "score": "0.6082847", "text": "async end() {\n return;\n }", "title": "" }, { "docid": "a854de742646f53d0714720329f93125", "score": "0.6082847", "text": "async end() {\n return;\n }", "title": "" }, { "docid": "f1aff2add303d77ee7591d56534178b9", "score": "0.6070359", "text": "function taskComplete() {\n\n}", "title": "" }, { "docid": "b381e7b8f9a9819fa190df36a36c3955", "score": "0.60693187", "text": "function complete() {\n\t\t$status.text( 'Done' );\n\t\t$cancelbtn.attr( 'disabled', 'disabled' );\n\t\t$startbtn.removeAttr( 'disabled' );\n\t}", "title": "" }, { "docid": "be3e2e2d6b2283dde445986161b5b004", "score": "0.6064721", "text": "done() { // Should be launched by the task when it's over\n this.node.tasksStatus[this.name] = 'done';\n saveStatus(this.node, this.name, 'done');\n this.emit('done');\n }", "title": "" }, { "docid": "ecdd50f56061c18694f02c8d20f2b79b", "score": "0.6052228", "text": "function finalCallback() {\n console.log(\"See, I fetched it all:\");\n console.log(arguments);\n}", "title": "" } ]
2059adc0eba76d0082c1888c698f3800
Creates a deep copy of the given object. The object must be serializable, i.e.: It must not contain any cycles Only primitive types are allowed (object, array, number, string, boolean) Its depth should be considerably low for performance reasons
[ { "docid": "708acf8f605eb8ea29b4c787ee508938", "score": "0.7480635", "text": "function clone(object) {\n return deserialize(serialize(object));\n}", "title": "" } ]
[ { "docid": "cb1401a0857a74b0c5926c4fa8614592", "score": "0.8066232", "text": "function deepClone(object) {\n // IMPLEMENT ME\n}", "title": "" }, { "docid": "50223b84e2cace28f12522f72461ebeb", "score": "0.8059632", "text": "function deepClone(object){var clone={};var value=void 0;for(var prop in object) {value = object[prop];if(value && typeof value === 'object'){clone[prop] = deepClone(value);}else {clone[prop] = value;}}return clone;}", "title": "" }, { "docid": "a053b895fb01c4bddf22a57e4244698a", "score": "0.8045908", "text": "function deepClone(obj){\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "0767081c93b3522058b7a14736c86053", "score": "0.8033318", "text": "function deepClone(object){var clone={};var value=void 0;for(var prop in object) {value = object[prop];if(value && (typeof value === 'undefined'?'undefined':_typeof(value)) === 'object'){clone[prop] = deepClone(value);}else {clone[prop] = value;}}return clone;}", "title": "" }, { "docid": "60a7f29f5757870abe58020617e7d311", "score": "0.80088973", "text": "function cloneDeep(obj) { return JSON.parse(JSON.stringify(obj)) }", "title": "" }, { "docid": "06901c12b54a2a6cfdf30ff393e72640", "score": "0.80025315", "text": "function deepClone(object) {\n return JSON.parse(JSON.stringify(object));\n }", "title": "" }, { "docid": "4bee8d381ed0d0bb668277e794230030", "score": "0.79115736", "text": "function deepObjCopy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "d94caedea1695aad79fb0620ebaf6b53", "score": "0.7806535", "text": "function deepClone(obj) {\n\t\t\tswitch (typeof obj) {\n\t\t\t\tcase 'object':\n\t\t\t\t\treturn JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n\t\t\t\tcase 'undefined':\n\t\t\t\t\treturn null; //this is how JSON.stringify behaves for array items\n\t\t\t\tdefault:\n\t\t\t\t\treturn obj; //no need to clone primitives\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "27d374592d63754a331622ebad0ce19e", "score": "0.77987957", "text": "function deepCloneObj(aObj) {\n return JSON.parse(JSON.stringify(aObj))\n}", "title": "" }, { "docid": "c21504ec56231140659ae476e9ad894f", "score": "0.7797175", "text": "function deepClone(obj) {\n if (obj === undefined || obj === null)\n return undefined;\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "804238bd6d3cc69516dbaaad3c4b45ef", "score": "0.7647038", "text": "deepClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }", "title": "" }, { "docid": "34f8c30a7196795e9da3e6eb3ec5be72", "score": "0.7626437", "text": "function deepCopy(obj) {\n var ret, key;\n var marker = '__deepCopy';\n if (obj && obj[marker]) throw new Error('attempted deep copy of cyclic object');\n\n if (obj && obj.constructor == Object) {\n ret = {};\n obj[marker] = true;\n\n for (key in obj) {\n if (key == marker) continue;\n ret[key] = deepCopy(obj[key]);\n }\n\n delete obj[marker];\n return ret;\n }\n\n if (obj && obj.constructor == Array) {\n ret = [];\n obj[marker] = true;\n\n for (key = 0; key < obj.length; key++) ret.push(deepCopy(obj[key]));\n\n delete obj[marker];\n return ret;\n }\n /*\n * It must be a primitive type -- just return it.\n */\n\n\n return obj;\n}", "title": "" }, { "docid": "bb1068124ea00439d9b3ee78bcf99032", "score": "0.75701666", "text": "function deepCopy(obj){var ret,key;var marker='__deepCopy';if(obj&&obj[marker])throw new Error('attempted deep copy of cyclic object');if(obj&&obj.constructor==Object){ret={};obj[marker]=true;for(key in obj){if(key==marker)continue;ret[key]=deepCopy(obj[key]);}delete obj[marker];return ret;}if(obj&&obj.constructor==Array){ret=[];obj[marker]=true;for(key=0;key<obj.length;key++){ret.push(deepCopy(obj[key]));}delete obj[marker];return ret;}/*\n\t * It must be a primitive type -- just return it.\n\t */return obj;}", "title": "" }, { "docid": "327d31f2f465cf04b17f47f2b556d629", "score": "0.7525187", "text": "function deepCopy(obj) {\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker]) throw new Error('attempted deep copy of cyclic object');\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker) continue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete obj[marker];\n\t\treturn ret;\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++) ret.push(deepCopy(obj[key]));\n\n\t\tdelete obj[marker];\n\t\treturn ret;\n\t}\n\n\t/*\n * It must be a primitive type -- just return it.\n */\n\treturn obj;\n}", "title": "" }, { "docid": "4fa20dcf42c06ea83cce5e08a252d640", "score": "0.7494225", "text": "function deepCopyObject(obj){\n return clone(obj)\n}", "title": "" }, { "docid": "82e150888bd3d03642848662f514a857", "score": "0.7463874", "text": "function deepClone(object) {\r\n var clone = {};\r\n for (var key in object) {\r\n var value = object[key];\r\n if (typeof value != 'object') {\r\n clone[key] = value;\r\n } else {\r\n clone[key] = deepClone(value);\r\n //Here the object property is also an object.\r\n //By means of a recursive function, what we do is to clone the object that\r\n //is on the second or next level.\r\n }\r\n }\r\n return clone;\r\n}", "title": "" }, { "docid": "e908b8cd3e4d4f085db458cc1f430f93", "score": "0.74608237", "text": "static clone(obj) {\n console.assert(obj);\n // TODO(burdon): Consider _.cloneDeep?\n return JSON.parse(JSON.stringify(obj));\n }", "title": "" }, { "docid": "75a8fa1c39770d2bb4f551c67835abb7", "score": "0.74498856", "text": "function deepCopy(obj)\n\t{\n\t\tvar ret, key;\n\t\tvar marker = '__deepCopy';\n\t\n\t\tif (obj && obj[marker])\n\t\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\t\n\t\tif (obj && obj.constructor == Object) {\n\t\t\tret = {};\n\t\t\tobj[marker] = true;\n\t\n\t\t\tfor (key in obj) {\n\t\t\t\tif (key == marker)\n\t\t\t\t\tcontinue;\n\t\n\t\t\t\tret[key] = deepCopy(obj[key]);\n\t\t\t}\n\t\n\t\t\tdelete (obj[marker]);\n\t\t\treturn (ret);\n\t\t}\n\t\n\t\tif (obj && obj.constructor == Array) {\n\t\t\tret = [];\n\t\t\tobj[marker] = true;\n\t\n\t\t\tfor (key = 0; key < obj.length; key++)\n\t\t\t\tret.push(deepCopy(obj[key]));\n\t\n\t\t\tdelete (obj[marker]);\n\t\t\treturn (ret);\n\t\t}\n\t\n\t\t/*\n\t\t * It must be a primitive type -- just return it.\n\t\t */\n\t\treturn (obj);\n\t}", "title": "" }, { "docid": "1143abf0ce1f66c115e348b566e04d8f", "score": "0.74497074", "text": "function deepCopy(obj)\n\t{\n\t\tvar ret, key;\n\t\tvar marker = '__deepCopy';\n\n\t\tif (obj && obj[marker])\n\t\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\t\tif (obj && obj.constructor == Object) {\n\t\t\tret = {};\n\t\t\tobj[marker] = true;\n\n\t\t\tfor (key in obj) {\n\t\t\t\tif (key == marker)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tret[key] = deepCopy(obj[key]);\n\t\t\t}\n\n\t\t\tdelete (obj[marker]);\n\t\t\treturn (ret);\n\t\t}\n\n\t\tif (obj && obj.constructor == Array) {\n\t\t\tret = [];\n\t\t\tobj[marker] = true;\n\n\t\t\tfor (key = 0; key < obj.length; key++)\n\t\t\t\tret.push(deepCopy(obj[key]));\n\n\t\t\tdelete (obj[marker]);\n\t\t\treturn (ret);\n\t\t}\n\n\t\t/*\n\t\t * It must be a primitive type -- just return it.\n\t\t */\n\t\treturn (obj);\n\t}", "title": "" }, { "docid": "1143abf0ce1f66c115e348b566e04d8f", "score": "0.74497074", "text": "function deepCopy(obj)\n\t{\n\t\tvar ret, key;\n\t\tvar marker = '__deepCopy';\n\n\t\tif (obj && obj[marker])\n\t\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\t\tif (obj && obj.constructor == Object) {\n\t\t\tret = {};\n\t\t\tobj[marker] = true;\n\n\t\t\tfor (key in obj) {\n\t\t\t\tif (key == marker)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tret[key] = deepCopy(obj[key]);\n\t\t\t}\n\n\t\t\tdelete (obj[marker]);\n\t\t\treturn (ret);\n\t\t}\n\n\t\tif (obj && obj.constructor == Array) {\n\t\t\tret = [];\n\t\t\tobj[marker] = true;\n\n\t\t\tfor (key = 0; key < obj.length; key++)\n\t\t\t\tret.push(deepCopy(obj[key]));\n\n\t\t\tdelete (obj[marker]);\n\t\t\treturn (ret);\n\t\t}\n\n\t\t/*\n\t\t * It must be a primitive type -- just return it.\n\t\t */\n\t\treturn (obj);\n\t}", "title": "" }, { "docid": "503b64ba775cd6331315e2691c834d58", "score": "0.7444264", "text": "function clone(obj) {\n if (!tipe.object(obj)) return obj\n try { var clonedObj = JSON.parse(JSON.stringify(obj)) }\n catch(e) { return e }\n return clonedObj\n}", "title": "" }, { "docid": "cce5ce1f865e6c9ed769361a1b41bda2", "score": "0.7438437", "text": "function deepClone(object) {\n var clone = {}, value;\n\n for (var prop in object) {\n value = object[prop];\n if (value && typeof value === 'object') {\n clone[prop] = deepClone(value);\n } else {\n clone[prop] = value;\n }\n }\n\n return clone;\n }", "title": "" }, { "docid": "ebf4678e031422918477d7b115d24904", "score": "0.73818475", "text": "function clone(obj){ return JSON.parse(JSON.stringify(obj));}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "d73feb6acfcac5d8b1107458592d3162", "score": "0.73478824", "text": "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "title": "" }, { "docid": "96eb1dde309b9758677664f791912080", "score": "0.73453313", "text": "function deepCopy(o) {\n\treturn JSON.parse(JSON.stringify(o));\n}", "title": "" }, { "docid": "f4b707bd19afddf42a51ab1193ec8db9", "score": "0.73206544", "text": "function deepClone(object) {\n var clone = {}, value;\n\n for (var prop in object) {\n value = object[prop];\n if (value && typeof value === 'object') {\n clone[prop] = deepClone(value);\n } else {\n clone[prop] = value;\n }\n }\n\n return clone;\n}", "title": "" }, { "docid": "62d191f99681fd44e1836ea2240367e4", "score": "0.73139846", "text": "function deepClone(object) {\n var clone = {};\n var value = undefined;\n\n for (var prop in object) {\n value = object[prop];\n if (value && typeof value === 'object') {\n clone[prop] = deepClone(value);\n } else {\n clone[prop] = value;\n }\n }\n\n return clone;\n }", "title": "" }, { "docid": "62d191f99681fd44e1836ea2240367e4", "score": "0.73139846", "text": "function deepClone(object) {\n var clone = {};\n var value = undefined;\n\n for (var prop in object) {\n value = object[prop];\n if (value && typeof value === 'object') {\n clone[prop] = deepClone(value);\n } else {\n clone[prop] = value;\n }\n }\n\n return clone;\n }", "title": "" }, { "docid": "02b3e1d45668f18e6838ff0dd7d57735", "score": "0.72930366", "text": "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "02b3e1d45668f18e6838ff0dd7d57735", "score": "0.72930366", "text": "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "02b3e1d45668f18e6838ff0dd7d57735", "score": "0.72930366", "text": "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "2f9c6615b11d53a40cb380ef0c680cae", "score": "0.72779876", "text": "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "2f9c6615b11d53a40cb380ef0c680cae", "score": "0.72779876", "text": "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "724b1b7a3c7bdcc3ca67346357df954c", "score": "0.7275039", "text": "function cloneObject(obj){\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "724b1b7a3c7bdcc3ca67346357df954c", "score": "0.7275039", "text": "function cloneObject(obj){\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "f616fb8652b3fce015f13b8cc3c57cff", "score": "0.7271427", "text": "function copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "59fba31245a84a56f34576328445bad4", "score": "0.726556", "text": "function clone(obj) {\r\n //3 simple types and null / undefined\r\n if (null == obj || \"object\" != typeof obj) return obj;\r\n\r\n //date\r\n if (obj instanceof Date) {\r\n var copy = new Date();\r\n copy.setTime(obj.getTime());\r\n return copy;\r\n }\r\n\r\n //array\r\n if (obj instanceof Array) {\r\n var copy = [];\r\n for (var i = 0; i < obj.length; ++i) {\r\n copy[i] = clone(obj[i]);\r\n }\r\n return copy;\r\n }\r\n\r\n //object\r\n if (obj instanceof Object) {\r\n var copy = {};\r\n for (var attr in obj) {\r\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\r\n }\r\n return copy;\r\n }\r\n throw new Error(\"object type not supported yet!\");\r\n}", "title": "" }, { "docid": "02e505f73f9b9ee6c4c5abe7bad14f8a", "score": "0.7260519", "text": "function deepClone(object) {\n var clone = {};\n var value;\n\n for (var prop in object) {\n value = object[prop];\n\n if (value && typeof value === 'object') {\n clone[prop] = deepClone(value);\n } else {\n clone[prop] = value;\n }\n }\n\n return clone;\n }", "title": "" }, { "docid": "02e505f73f9b9ee6c4c5abe7bad14f8a", "score": "0.7260519", "text": "function deepClone(object) {\n var clone = {};\n var value;\n\n for (var prop in object) {\n value = object[prop];\n\n if (value && typeof value === 'object') {\n clone[prop] = deepClone(value);\n } else {\n clone[prop] = value;\n }\n }\n\n return clone;\n }", "title": "" }, { "docid": "02e505f73f9b9ee6c4c5abe7bad14f8a", "score": "0.7260519", "text": "function deepClone(object) {\n var clone = {};\n var value;\n\n for (var prop in object) {\n value = object[prop];\n\n if (value && typeof value === 'object') {\n clone[prop] = deepClone(value);\n } else {\n clone[prop] = value;\n }\n }\n\n return clone;\n }", "title": "" }, { "docid": "c3269f5b0056c1868ba9e69cefab5f69", "score": "0.7256844", "text": "function clone(obj) {\r\n // Handle the 3 simple types, and null or undefined\r\n if (null == obj || \"object\" != typeof obj) return obj;\r\n\r\n var copy;\r\n\r\n // Handle Date\r\n if (obj instanceof Date) {\r\n copy = new Date();\r\n copy.setTime(obj.getTime());\r\n }\r\n // Handle Array\r\n else if (obj instanceof Array) {\r\n copy = [];\r\n for (var i = 0, len = obj.length; i < len; i++) {\r\n copy[i] = clone(obj[i]);\r\n }\r\n }\r\n // Handle Object\r\n else if (obj instanceof Object) {\r\n copy = {};\r\n for (var attr in obj) {\r\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\r\n }\r\n }\r\n else {\r\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\r\n }\r\n\r\n return copy;\r\n}", "title": "" }, { "docid": "33b6590f41ea8c316bb95d2e174c124e", "score": "0.72468585", "text": "function clone(obj) {\n var copy;\n\n if (null == obj || \"object\" != typeof obj) {\n return obj;\n }\n\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n if (obj instanceof Array) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n if (obj instanceof Object) {\n console.log(\"here bay\");\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "title": "" }, { "docid": "bbcd51af052b000a9bb873261fdb8e0f", "score": "0.72408694", "text": "function clone(obj) {\n var copy;\n\n // Handle the 3 simple types, and null or undefined\n if (null == obj || \"object\" != typeof obj) return obj;\n\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "title": "" }, { "docid": "647062dd657bd1c9d8b3729db8490e5a", "score": "0.7234867", "text": "function cloneObj(obj) { return JSON.parse( JSON.stringify(obj) ) }", "title": "" }, { "docid": "a3b80ea7def6173a6b91aab5406b4f37", "score": "0.72337556", "text": "function clone(obj) {\n\n // Handle the 3 simple types, and null or undefined\n if (obj === null || 'object' !== typeof obj)\n return obj;\n\n var copy;\n\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++)\n copy[i] = clone(obj[i]);\n return copy;\n }\n\n // Handle Object\n if (typeof obj === 'object') {\n copy = Object.create(null);\n for (var attr in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, attr))\n copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error('Unable to clone object');\n\n}", "title": "" }, { "docid": "bfcdb78594cabf6eba1dc6089774a2b5", "score": "0.7215994", "text": "function clone(obj) {\n\tvar copy;\n\n\t// Handle the 3 simple types, and null or undefined\n\tif (null == obj || \"object\" != typeof obj) return obj;\n\n\t// Handle Date\n\tif (obj instanceof Date) {\n\t\tcopy = new Date();\n\t\tcopy.setTime(obj.getTime());\n\t\treturn copy;\n\t}\n\n\t// Handle Array\n\tif (obj instanceof Array) {\n\t\tcopy = [];\n\t\tfor (var i = 0, len = obj.length; i < len; i++) {\n\t\t\tcopy[i] = clone(obj[i]);\n\t\t}\n\t\treturn copy;\n\t}\n\n\t// Handle Object\n\tif (obj instanceof Object) {\n\t\tcopy = {};\n\t\tfor (var attr in obj) {\n\t\t\tif (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n\t\t}\n\t\treturn copy;\n\t}\n\n\tthrow new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "title": "" }, { "docid": "41eea70e8fa406f4bad8c50a789e2dbb", "score": "0.7207604", "text": "function Clone(obj){\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "ee97fe1b0d6a60e4828ed0d2c73a8aaf", "score": "0.7205751", "text": "function deepCopy(object) {\n var refsCopied = [];\n function copyRecurse(obj) {\n var result = null;\n if (obj) {\n if (Array.isArray(obj)) {\n // @ts-ignore\n result = [];\n }\n else {\n // create clone of the object with same prototype chain\n result = Object.create(Object.getPrototypeOf(obj));\n }\n // iterate over all the properties in the object\n Object.keys(obj).forEach(function (key) {\n // recursively copy the object's properties if the property is an object\n var value = obj[key];\n if (typeof value === 'object') {\n // @ts-ignore\n if (refsCopied.indexOf(value) !== -1) {\n throw new Error(\"Cannot perform DeepCopy() because a circular reference was encountered, object: \" + obj + \", property: \" + key);\n }\n // @ts-ignore\n refsCopied.push(value);\n // @ts-ignore\n result[key] = copyRecurse(value);\n refsCopied.pop();\n }\n else {\n // @ts-ignore\n result[key] = value;\n }\n });\n }\n return result;\n }\n return copyRecurse(object);\n}", "title": "" }, { "docid": "edff35312ffe40dada6d9f3d4eeeecad", "score": "0.7199264", "text": "function deepClone(obj) {\n if (!obj || typeof obj !== 'object') {\n return obj;\n }\n\n if (obj instanceof RegExp) {\n // See https://github.com/Microsoft/TypeScript/issues/10990\n return obj;\n }\n\n var result = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(function (key) {\n if (obj[key] && typeof obj[key] === 'object') {\n result[key] = deepClone(obj[key]);\n } else {\n result[key] = obj[key];\n }\n });\n return result;\n}", "title": "" }, { "docid": "a0fcfa822a43fcde2937a0e987978520", "score": "0.7186748", "text": "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }", "title": "" }, { "docid": "d6921a22cd3d3461e2e94bfefae2ecb3", "score": "0.7181458", "text": "function copyObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "9d6d16506a56de5aef2187d578671c17", "score": "0.7165529", "text": "function deepClone(obj) {\n if (!obj || typeof obj !== 'object') {\n return obj;\n }\n if (obj instanceof RegExp) {\n // See https://github.com/Microsoft/TypeScript/issues/10990\n return obj;\n }\n var result = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(function (key) {\n if (obj[key] && typeof obj[key] === 'object') {\n result[key] = deepClone(obj[key]);\n }\n else {\n result[key] = obj[key];\n }\n });\n return result;\n}", "title": "" }, { "docid": "9d6d16506a56de5aef2187d578671c17", "score": "0.7165529", "text": "function deepClone(obj) {\n if (!obj || typeof obj !== 'object') {\n return obj;\n }\n if (obj instanceof RegExp) {\n // See https://github.com/Microsoft/TypeScript/issues/10990\n return obj;\n }\n var result = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(function (key) {\n if (obj[key] && typeof obj[key] === 'object') {\n result[key] = deepClone(obj[key]);\n }\n else {\n result[key] = obj[key];\n }\n });\n return result;\n}", "title": "" }, { "docid": "d634fc7daae35d9394efc9fa2caa5436", "score": "0.71573293", "text": "function clone(obj) {\n var copy, i;\n // Handle the 3 simple types, and null or undefined\n if (null === obj || \"object\" !== typeof obj) return obj;\n\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array\n if (obj instanceof Array) {\n var len;\n copy = [];\n for (i = 0, len = obj.length; i < len; ++i) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n }", "title": "" }, { "docid": "46af1f389ca83b11adea7103cff21273", "score": "0.7147502", "text": "function clone(obj) {\n var copy;\n // Handle the 3 simple types, and null or undefined\n if (null == obj || \"object\" != typeof obj)\n return obj;\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr))\n copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "title": "" }, { "docid": "4e98512f5d7abad1523d739a5fbbb4d6", "score": "0.71441454", "text": "function clone(object) {\n if(null == object || \"object\" != typeof object) return object\n // create new blank object of same type\n let copy = object.constructor()\n \n // copy all attributes into it\n for(let attr in object) {\n if(object.hasOwnProperty(attr)) {\n copy[attr] = object[attr]\n }\n }\n return copy\n}", "title": "" }, { "docid": "746117b667a9bc4efc272082dd4ae8e6", "score": "0.71351063", "text": "function __clone(obj) {\n // Handle the 3 simple types, and null or undefined\n if (obj == null || \"object\" != typeof obj) {\n return obj;\n }\n\n if (obj instanceof Array) {\n var copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = __clone(obj[i]);\n }\n return copy;\n }\n\n if (obj instanceof Object) {\n var copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = __clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n }", "title": "" }, { "docid": "249a33bce1d861597842779ab82216e7", "score": "0.71306545", "text": "function _clone(obj, /* INTERNAL */ _visited) {\n var clone = {};\n \n // initialize the visited objects array, if needed\n // this is used to detect cyclic references\n if (_visited == undefined) _visited = [];\n \n // if obj was already visited, don't try to copy it,\n // just return the reference to avoid infinte loops\n var i = _visited.indexOf(obj);\n if (i > -1) return _visited[i];\n \n // add this object to the visited array\n _visited.push(obj);\n \n var props = Object.getOwnPropertyNames(obj);\n \n for (var i = 0; i < props.length; i++) {\n if (obj[props[i]] instanceof Object) {\n // recursive clone\n clone[props[i]] = _clone(obj[props[i]], _visited);\n } else {\n // copy property\n clone[props[i]] = obj[props[i]];\n }\n }\n return clone;\n }", "title": "" }, { "docid": "1bf68296fbaf9f5a8250acdfab7fdd81", "score": "0.71288264", "text": "function cloneObject(objeto) {\n return (JSON.parse(JSON.stringify(objeto)));\n }", "title": "" }, { "docid": "5b95d68544e2a803acede35256550aaf", "score": "0.7124441", "text": "function shallowClone(obj) {\n var rst = obj;\n if (obj instanceof Object) {\n rst = Object.assign({}, obj);\n }\n return rst;\n }", "title": "" }, { "docid": "dee6018d352a55e5767d9394dd4946ee", "score": "0.71119547", "text": "function _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}", "title": "" }, { "docid": "bf940bc30de1fa9c1685fb12d33fccbe", "score": "0.7102631", "text": "function deepCopy(object) {\n\t var refsCopied = [];\n\t var copyRecurse = function (obj) {\n\t var result = null;\n\t if (obj) {\n\t if (Array.isArray(obj)) {\n\t result = [];\n\t }\n\t else {\n\t // create clone of the object with same prototype chain\n\t result = Object.create(Object.getPrototypeOf(obj));\n\t }\n\t // iterate over all the properties in the object\n\t Object.keys(obj).forEach(function (key) {\n\t // recursively copy the object's properties if the property is an object\n\t var value = obj[key];\n\t if (typeof value === \"object\") {\n\t if (refsCopied.indexOf(value) !== -1) {\n\t throw new Error(\"Cannot perform DeepCopy() because a circular reference was encountered, object: \" + String(obj) + \", property: \" + String(key));\n\t }\n\t refsCopied.push(value);\n\t result[key] = copyRecurse(value);\n\t refsCopied.pop();\n\t }\n\t else {\n\t result[key] = value;\n\t }\n\t });\n\t }\n\t return result;\n\t };\n\t return copyRecurse(object);\n\t }", "title": "" }, { "docid": "63dc8eb96a7aedad8b788a202fd3970f", "score": "0.70941186", "text": "deepCopyObject(object) {\n const copiedObject = {};\n Object.keys(object).forEach(key => {\n copiedObject[key] =\n typeof object[key] === 'object' ? Object.assign({}, object[key]) : object[key];\n });\n return copiedObject;\n }", "title": "" }, { "docid": "2abeb27b4ecb53a567c92543862be0ff", "score": "0.70866376", "text": "function _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return properties_lib_esm_logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}", "title": "" }, { "docid": "2abeb27b4ecb53a567c92543862be0ff", "score": "0.70866376", "text": "function _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return properties_lib_esm_logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}", "title": "" }, { "docid": "2abeb27b4ecb53a567c92543862be0ff", "score": "0.70866376", "text": "function _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return properties_lib_esm_logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}", "title": "" }, { "docid": "2abeb27b4ecb53a567c92543862be0ff", "score": "0.70866376", "text": "function _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return properties_lib_esm_logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}", "title": "" }, { "docid": "2abeb27b4ecb53a567c92543862be0ff", "score": "0.70866376", "text": "function _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return properties_lib_esm_logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}", "title": "" }, { "docid": "50714df3d462668318ecb675323cc5d8", "score": "0.7057547", "text": "function deepCopy(obj) {\n var cloned = {};\n for (var prop in obj) {\n if (typeof obj[prop] === \"object\") {\n cloned[prop] = obj[prop];\n deepCopy(obj[prop]);\n } else {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}", "title": "" }, { "docid": "ae9f37bdd8dabf622e9af21610be0de1", "score": "0.7052186", "text": "function _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n } // Arrays are mutable, so we need to create a copy\n\n\n if (Array.isArray(object)) {\n return Object.freeze(object.map(item => deepCopy(item)));\n }\n\n if (typeof object === \"object\") {\n const result = {};\n\n for (const key in object) {\n const value = object[key];\n\n if (value === undefined) {\n continue;\n }\n\n defineReadOnly(result, key, deepCopy(value));\n }\n\n return result;\n }\n\n return logger.throwArgumentError(`Cannot deepCopy ${typeof object}`, \"object\", object);\n}", "title": "" }, { "docid": "e0bc81560408e5a6078ce5c3b1b05492", "score": "0.7049688", "text": "function clone(obj) {\n if (obj === null || (typeof obj) !== 'object') {\n return obj;\n }\n var temp = new obj.constructor();\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n temp[key] = clone(obj[key]);\n }\n }\n return temp;\n}", "title": "" }, { "docid": "86b1838cbdd10539d302e0773e44f801", "score": "0.7035351", "text": "function clone(obj) {\n if (obj == null || typeof (obj) != 'object')\n return obj;\n var temp = new obj.constructor();\n for (var key in obj)\n temp[key] = clone(obj[key]);\n return temp;\n }", "title": "" }, { "docid": "8a7a4c404d8685fccaa9745322ef0f8e", "score": "0.70310646", "text": "function deepClone(obj) {\n var result = Array.isArray(obj) ? [] : {};\n for (var p in obj) {\n if (obj.hasOwnProperty(p) || Array.isArray(obj)) {\n result[p] = (typeof obj[p] === 'object') ? deepClone(obj[p]) : obj[p];\n }\n }\n return result;\n}", "title": "" }, { "docid": "d016df3c439238241755fd572cefeb30", "score": "0.70261806", "text": "function clone (object) {\n\treturn objectAssignDeep.noMutate(object);\n}", "title": "" }, { "docid": "822a0b837977095d437c75428425e0e4", "score": "0.7021574", "text": "function $copy(obj) {\r\n if (typeof obj !== 'object') return obj;\r\n var value = obj.valueOf();\r\n if (obj != value) return new obj.constructor(value);\r\n var newobj = {};\r\n for( var prop in obj) newobj[prop] = obj[prop];\r\n return newobj;\r\n}", "title": "" }, { "docid": "9bf71ff95fc7c3bb5ffe96052c94d751", "score": "0.70033854", "text": "function clone(obj) {\r\n if (null == obj || 'object' !== typeof obj) return obj;\r\n var copy = obj.constructor();\r\n for (var attr in obj) {\r\n if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr];\r\n }\r\n return copy;\r\n}", "title": "" }, { "docid": "8262c698fc651de792dc9fee11f3376c", "score": "0.700295", "text": "function _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n lib_esm_defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return lib_esm_logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}", "title": "" }, { "docid": "bb18ca9eb5d01d8081f7f3a3217d5913", "score": "0.69846815", "text": "copy(obj){\n\t\treturn JSON.parse(JSON.stringify(obj));\n\t}", "title": "" }, { "docid": "4e07f9cb64c93977fdbf01c5c1667482", "score": "0.69815266", "text": "function clone(obj) {\n return copyInto(obj, {});\n}", "title": "" }, { "docid": "a58aef24b4d6f843cd3c1e98eb632381", "score": "0.6980784", "text": "function clone(obj) {\n if (null === obj || \"object\" !== typeof obj) {\n return arguments[arguments.length - 1];\n }\n if (obj instanceof Date) {\n return new Date(obj);\n }\n let copy = obj.constructor();\n if (typeof copy !== \"undefined\") {\n Array.prototype.forEach.call(arguments, obj => {\n if (typeof obj !== \"undefined\") {\n if (obj instanceof Array) {\n for (let i = 0; i < obj.length; ++i) {\n copy[i] = (copy[i] ?\n clone(copy[i], obj[i]) :\n clone(obj[i]));\n }\n }\n for (let attr in obj) {\n if (obj.hasOwnProperty(attr)) {\n copy[attr] = (typeof copy[attr] !== \"undefined\" ?\n clone(copy[attr], obj[attr]) :\n clone(obj[attr]));\n }\n }\n }\n });\n } else {\n copy = arguments[arguments.length - 1];\n }\n return copy;\n }", "title": "" }, { "docid": "d97996b981384d3347212d63850e0520", "score": "0.69784683", "text": "function deepClone(obj) {\n var rst = obj,\n Constructor;\n \n if (obj instanceof Object) {\n Constructor = obj.constructor;\n switch (Constructor) {\n case RegExp:\n rst = new Constructor(obj);\n break;\n case Date:\n rst = new Constructor(obj.getTime());\n break;\n default:\n rst = new Constructor();\n }\n \n for (var prop in obj) {\n rst[prop] = zQuery.deepClone(obj[prop]);\n }\n }\n \n return rst;\n }", "title": "" }, { "docid": "e2914d44fa0979e03a433cc22add5067", "score": "0.69782776", "text": "function copyObj(obj) {\n\tvar clone = (obj instanceof Array) ? [] : {};\n\tfor (var i in obj) {\n\t\tif (typeof(obj[i]) === 'object')\n\t\t\tclone[i] = copyObj(obj[i]);\n\t\telse\n\t\t\tclone[i] = obj[i];\n\t}\n\treturn clone;\n}", "title": "" }, { "docid": "a666a1eaa0211964a675ce8fed3c89c1", "score": "0.697181", "text": "function clone(obj){\n if(obj == null || typeof(obj) != \"object\") {\n return obj;\n };\n var temp = new obj.constructor();\n for(var key in obj) {\n temp[key] = clone(obj[key]);\n };\n return temp;\n }", "title": "" } ]
49dba23d96fcdade2a9fabdb31c8ff03
Chapter 11 5 minutes between each tests
[ { "docid": "e2f64ada35744f82509b40ae6935c87c", "score": "0.0", "text": "function C011_LiteratureClass_Mildred_WaitTest() {\n\tCurrentTime = CurrentTime + 290000;\n}", "title": "" } ]
[ { "docid": "87d8c00ac9837dfa30b6b9dd374d6381", "score": "0.6267536", "text": "function executeTests(tests) {\n calculatingTime(tests);\n addTestSummary();\n }", "title": "" }, { "docid": "850781dc01425e8ee236fce9e5b74916", "score": "0.6199347", "text": "function test() {\n app.tag(\"Main\").w+=0.001;\n const start = app.stage.platform.getHrTime();\n app.stage.ctx._update();\n const end = app.stage.platform.getHrTime();\n if (end-start < 1.0) {\n total += (end - start);\n measurements++;\n if ((measurements % 100) === 0) {\n console.log(total / measurements + 'ms in ' + measurements + ' tests');\n }\n\n if (measurements === 1000) {\n measurements = 0;\n total = 0;\n }\n }\n}", "title": "" }, { "docid": "a942f1c06813d5814a03cf12fd0a05fb", "score": "0.6027204", "text": "function testSuite() {\r\n var boundaryTest = false;\r\n\r\n // Write a test query here\r\n describe(\"maths\", 2, \"17:00\", \"23:59\", \"off\", false, 0);\r\n\r\n function describe(subject, mode, start, finish, weekends, boundaries, type) {\r\n if(boundaries) { boundaryTest = true; }\r\n\r\n if(subject === \"business\") {\r\n $business_schedule(start, finish, weekends, mode, type);\r\n } else if(subject === \"psychology\") {\r\n $psychology_schedule(start, finish, weekends, mode, type);\r\n } else if(subject === \"computer science\") {\r\n $comp_schedule(start, finish, weekends, mode, type);\r\n } else if(subject === \"maths\") {\r\n $maths_schedule(start, finish, weekends, mode, type);\r\n } else if(subject === \"product design\") {\r\n $product_design_schedule(start, finish, weekends, mode, type);\r\n }\r\n\r\n }\r\n\r\n /************ DEFAULT FUNCTIONS *************/\r\n function setUp(start, finish, weekends, mode, course) {\r\n var plan = {\r\n mode: mode,\r\n startTime: start,\r\n endTime: finish,\r\n weekends: weekends // If \"off\", Saturday and Sunday will be skipped and the available hours will decrease\r\n };\r\n\r\n let assignments = $getAssignments(course); // Fresh set of data each time\r\n\r\n return {\r\n plan: plan,\r\n assignments: assignments\r\n };\r\n }\r\n function tearDown() {\r\n // Nothing goes here because no functionality needed\r\n checkUtilisation();\r\n function checkUtilisation() {\r\n let report = \"\";\r\n for(let i=0; i<completedSubjects.length; i++) {\r\n let pass = completedSubjects[i].success;\r\n let str;\r\n if(pass) {\r\n str = completedSubjects[i].moduleName + \": COMPLETED \" + \"\\n\";\r\n } else {\r\n str = completedSubjects[i].moduleName + \": FAILED \" + \"\\n\";\r\n }\r\n report += str;\r\n }\r\n //alert(report);\r\n }\r\n }\r\n\r\n /***************** DATA *********************/\r\n function $getAssignments(course) {\r\n // Test Case Data\r\n var business_assignments = [\r\n m1 = {\r\n moduleCode: \"BS305\",\r\n moduleName: \"1st Semester Corporate Finance\",\r\n quota: 100,\r\n color: \"Green\",\r\n type: \"E\",\r\n dueDate: \"2020-01-29\"\r\n },\r\n m2 = {\r\n moduleCode: \"BS305\",\r\n moduleName: \"2nd Semester Corporate Finance\",\r\n quota: 100,\r\n color: \"Green\",\r\n type: \"E\",\r\n dueDate: \"2020-05-22\"\r\n },\r\n m3 = {\r\n moduleCode: \"BS301\",\r\n moduleName: \"Dissertation\",\r\n quota: 50,\r\n color: \"Black\",\r\n type: \"A\",\r\n dueDate: \"2019-10-31\"\r\n },\r\n m4 = {\r\n moduleCode: \"BS307\",\r\n moduleName: \"International Finance\",\r\n quota: 200,\r\n color: \"Blue\",\r\n type: \"A\",\r\n dueDate: \"2020-05-05\"\r\n },\r\n m5={\r\n moduleCode: \"BS311\",\r\n moduleName: \"Managing & Developing People\",\r\n quota: 60,\r\n color: \"Orange\",\r\n type: \"A\",\r\n dueDate: \"2020-03-30\"\r\n },\r\n m6={\r\n moduleCode: \"BS315\",\r\n moduleName: \"Consumer Psychology\",\r\n quota: 200,\r\n color: \"Purple\",\r\n type: \"A\",\r\n dueDate: \"2020-04-04\"\r\n },\r\n m7={\r\n moduleCode: \"BS320\",\r\n moduleName: \"Assignment: Business Strategy\",\r\n quota: 60,\r\n color: \"Brown\",\r\n type: \"A\",\r\n dueDate: \"2020-03-25\"\r\n },\r\n m8={\r\n moduleCode: \"BS320\",\r\n moduleName: \"Exam: Business Strategy\",\r\n quota: 140,\r\n color: \"Purple\",\r\n type: \"E\",\r\n dueDate: \"2020-05-15\"\r\n }\r\n\r\n ];\r\n var psychology_assignments = [\r\n m1 = {\r\n moduleCode: \"SS603\",\r\n moduleName: \"Dissertation\",\r\n quota: 400,\r\n color: \"Black\",\r\n type: \"A\",\r\n dueDate: \"2020-04-21\"\r\n },\r\n m2 = {\r\n moduleCode: \"SS605\",\r\n moduleName: \"1 Sociology\",\r\n quota: 200,\r\n color: \"Orange\",\r\n type: \"A\",\r\n dueDate: \"2020-01-25\"\r\n },\r\n m3 = {\r\n moduleCode: \"SS606\",\r\n moduleName: \"Cyberpsychology\",\r\n quota: 200,\r\n color: \"Purple\",\r\n type: \"A\",\r\n dueDate: \"2020-05-01\"\r\n },\r\n m4 = {\r\n moduleCode: \"SS611\",\r\n moduleName: \"2 Sociology\",\r\n quota: 200,\r\n color: \"Black\",\r\n type: \"A\",\r\n dueDate: \"2020-05-21\"\r\n },\r\n m5 = {\r\n moduleCode: \"SS618\",\r\n moduleName: \"Critical Community Psychology\",\r\n quota: 100,\r\n color: \"Red\",\r\n type: \"A\",\r\n dueDate: \"2020-01-21\"\r\n },\r\n m6 = {\r\n moduleCode: \"SS618\",\r\n moduleName: \"Exam: Critical Community Psychology\",\r\n quota: 100,\r\n color: \"Red\",\r\n type: \"E\",\r\n dueDate: \"2020-05-22\"\r\n }\r\n ];\r\n var product_design_assignments = [\r\n m1 = {\r\n moduleCode: \"PD301\",\r\n moduleName: \"Main Project\",\r\n quota: 400,\r\n color: \"Black\",\r\n type: \"A\",\r\n dueDate: \"2020-05-20\"\r\n },\r\n m2 = {\r\n moduleCode: \"PD303\",\r\n moduleName: \"Pathways\",\r\n quota: 400,\r\n color: \"Green\",\r\n type: \"A\",\r\n dueDate: \"2020-03-20\"\r\n },\r\n m3 = {\r\n moduleCode: \"PD305\",\r\n moduleName: \"Project: Tech\",\r\n quota: 200,\r\n color: \"Blue\",\r\n type: \"A\",\r\n dueDate: \"2020-01-31\"\r\n },\r\n m4 = {\r\n moduleCode: \"PD305\",\r\n moduleName: \"Report: Tech\",\r\n quota: 100,\r\n color: \"Blue\",\r\n type: \"A\",\r\n dueDate: \"2020-05-05\"\r\n }\r\n ];\r\n var mathematics_assignments = [\r\n m1 = {\r\n moduleCode: \"MM602\",\r\n moduleName: \"Mathematics of Finance\",\r\n quota: 200,\r\n color: \"Blue\",\r\n type: \"E\",\r\n dueDate: \"2020-05-22\"\r\n },\r\n m2 = {\r\n moduleCode: \"MM605\",\r\n moduleName: \"Maths Education Experience\",\r\n quota: 200,\r\n color: \"Red\",\r\n type: \"A\",\r\n dueDate: \"2020-04-25\"\r\n },\r\n m3 = {\r\n moduleCode: \"MM618\",\r\n moduleName: \"Time Series & Forecasting\",\r\n quota: 200,\r\n color: \"Grey\",\r\n type: \"A\",\r\n dueDate: \"2020-06-01\"\r\n },\r\n m4 = {\r\n moduleCode: \"MM640\",\r\n moduleName: \"Extended Mathematical Sciences Project\",\r\n quota: 400,\r\n color: \"Black\",\r\n type: \"A\",\r\n dueDate: \"2020-04-29\"\r\n },\r\n m5 = {\r\n moduleCode: \"MM607\",\r\n moduleName: \"Perspectives on Maths\",\r\n quota: 200,\r\n color: \"Purple\",\r\n type: \"A\",\r\n dueDate: \"2020-01-31\"\r\n }\r\n ];\r\n var computer_science_assignments = [\r\n m1={\r\n moduleCode: \"CI301\",\r\n moduleName: \"The Individual Project\",\r\n quota: 400,\r\n color: \"Black\",\r\n type: \"A\",\r\n dueDate: \"2020-05-20\" },\r\n\r\n m2={ moduleCode: \"CI360\",\r\n moduleName: \"Mobile App Development\",\r\n quota: 200,\r\n color: \"Green\",\r\n type: \"A\",\r\n dueDate: \"2020-05-01\"},\r\n\r\n m3={ moduleCode: \"CI315\",\r\n moduleName: \"Design Patterns\",\r\n quota: 100,\r\n color: \"Orange\",\r\n type: \"E\", // Type: Exam\r\n dueDate: \"2020-01-28\"},\r\n\r\n m4={ moduleCode: \"CI315\",\r\n moduleName: \"Software Architecture\",\r\n quota: 100,\r\n color: \"Brown\",\r\n type: \"E\",\r\n dueDate: \"2020-06-01\" },\r\n\r\n m5={ moduleCode: \"CI312\",\r\n moduleName: \"Computer Graphics Algorithms\",\r\n quota: 100,\r\n color: \"Purple\",\r\n type: \"A\",\r\n dueDate: \"2019-12-12\"\r\n },\r\n\r\n m6={ moduleCode: \"CI316\",\r\n moduleName: \"Software Validation\",\r\n quota: 100,\r\n color: \"Blue\",\r\n type: \"A\",\r\n dueDate: \"2020-05-02\"\r\n },\r\n\r\n m7= { moduleCode: \"CI346\",\r\n moduleName: \"Programming Languages\",\r\n quota: 100,\r\n color: \"Gray\",\r\n type: \"A\",\r\n dueDate: \"2020-01-17\"\r\n },\r\n\r\n m8 = { moduleCode: \"CI346\",\r\n moduleName: \"Concurrency & Client Server Computing\",\r\n quota: 100,\r\n color: \"Gray\",\r\n type: \"E\",\r\n dueDate: \"2020-05-22\"\r\n }\r\n ];\r\n\r\n let assignments = []; // Actual array, created from scratch at each execution\r\n\r\n if(course === \"business\") {\r\n assignments = business_assignments;\r\n } else if(course === \"psychology\") {\r\n assignments = psychology_assignments;\r\n } else if(course === \"computer science\") {\r\n assignments = computer_science_assignments;\r\n } else if(course === \"maths\") {\r\n assignments = mathematics_assignments;\r\n } else if(course === \"product design\") {\r\n assignments = product_design_assignments;\r\n }\r\n\r\n return assignments;\r\n }\r\n\r\n /***************************** TEST SCENARIOS ******************************/\r\n\r\n // Business & Finance\r\n function $business_schedule(start, finish, weekends, mode, type) {\r\n let bundle = setUp(start, finish, weekends, mode, \"business\");\r\n if(boundaryTest) { setBoundaryTest(bundle.assignments, bundle.plan, type) }\r\n work_planner(bundle.assignments, bundle.plan);\r\n tearDown();\r\n }\r\n\r\n // Psychology\r\n function $psychology_schedule(start, finish, weekends, mode, type) {\r\n let bundle = setUp(start, finish, weekends, mode, \"psychology\");\r\n if(boundaryTest) { setBoundaryTest(bundle.assignments, bundle.plan, type) }\r\n work_planner(bundle.assignments, bundle.plan);\r\n tearDown();\r\n }\r\n\r\n // Maths\r\n function $maths_schedule(start, finish, weekends, mode, type) {\r\n let bundle = setUp(start, finish, weekends, mode, \"maths\");\r\n if(boundaryTest) { setBoundaryTest(bundle.assignments, bundle.plan, type) }\r\n work_planner(bundle.assignments, bundle.plan);\r\n tearDown();\r\n }\r\n\r\n // Computer Science\r\n function $comp_schedule(start, finish, weekends, mode, type) {\r\n let bundle = setUp(start, finish, weekends, mode, \"computer science\");\r\n if(boundaryTest) { setBoundaryTest(bundle.assignments, bundle.plan, type) }\r\n work_planner(bundle.assignments, bundle.plan);\r\n tearDown();\r\n }\r\n\r\n // Product Design\r\n function $product_design_schedule(start, finish, weekends, mode, type) {\r\n let bundle = setUp(start, finish, weekends, mode, \"product design\");\r\n if(boundaryTest) { setBoundaryTest(bundle.assignments, bundle.plan, type) }\r\n work_planner(bundle.assignments, bundle.plan);\r\n tearDown();\r\n }\r\n\r\n // BOUNDARY TESTING\r\n function setBoundaryTest(assignments, plan, type) {\r\n if (type === 1) {\r\n testWithLowerCap(assignments, plan);\r\n } else if (type === 2) {\r\n testWithInfeasibleWorkload(assignments);\r\n } else {\r\n // Do nothing\r\n }\r\n }\r\n\r\n function testWithLowerCap(assignments, plan) {\r\n let startTime = plan.startTime.substring(0,2);\r\n let finishTime = plan.endTime.substring(0,2);\r\n startTime++; startTime++; finishTime--; // Lose three hours\r\n let t1 = startTime+\":00\"; let t2 = finishTime+\":00\";\r\n plan.startTime = t1; plan.endTime = t2;\r\n }\r\n function testWithInfeasibleWorkload(assignments) {\r\n assignments.forEach(function(e) {\r\n e.quota = e.quota*2; // Double all quotas\r\n });\r\n }\r\n\r\n // ASSERTIONS\r\n function equal(a, b, c) {\r\n return a + b === c;\r\n }\r\n\r\n}", "title": "" }, { "docid": "9bba951809eb43590aa89f5d799d1fa1", "score": "0.5931069", "text": "function _test(tests){var pv=process.argv,v=process.argv.includes(\"-v\"),vars=pv[1].split(\"/\"),fn=vars[vars.length-1].split(\".\")[0];rpt=parseInt(pv.find(function(t){return!isNaN(parseInt(t))})||1);for(var c=1;c<=rpt;c++)tests.reduce(function(r,obj,i,a){\"string\"==typeof obj&&(obj={test:obj}),Array.isArray(obj)&&(obj={test:obj[0],expected:obj[1]});var t,test=obj.test,exp=void 0===obj.expected||obj.expected,section=obj.section;test&&!new RegExp(/[a-zA-Z]+\\([^\\)]*\\)/g).test(test)&&(test=fn+\"(\"+test+\")\");var ts=process.hrtime(),actual=eval(test),ms=process.hrtime(ts)[1]/1e6,failed=JSON.stringify(actual)!=JSON.stringify(exp),newSection=function(t){r.sn=t,r.st=\"\",r.sp=0,r.sc=0,r.s++};return i||newSection(section||fn),section||(t=\"\u001b[2m\u001b[3\"+(failed?\"1\":\"2\")+\"m * \"+test+\" expected \u001b[1m\"+exp+\"\u001b[22m\u001b[2m; returned \u001b[3m\"+actual+\"\u001b[37m\"+(v?\" (\"+ms+\"ms)\":\"\")+\"\\n\",(failed||v)&&(r.st+=t),failed||(r.sp++,r.tpt++),r.sc++,r.tt++),(section&&i||i===a.length-1)&&(failed=r.sp<r.sc,failed||r.tps++,r.t+=\"\\n\u001b[0m\u001b[1m\u001b[3\"+(failed?\"1\":\"2\")+\"m\"+r.s+\") \"+r.sn+\" -> \"+r.sp+\"/\"+r.sc+\" (\"+Math.floor(r.sp/r.sc*100)+\"%)\\n\"+r.st,newSection(section),r.ts++),i===a.length-1&&_final(r),r},{t:\"\",tt:0,tpt:0,tps:0,s:0,sn:\"\",sp:0,sc:0,st:\"\"});function _final(t){failed=t.tpt<t.tt,rpt,t.h=\"\\n\u001b[0m\u001b[10\"+(failed?\"1\":\"2\")+\"m\u001b[30m\u001b[4m\"+(rpt>1?\"TEST \"+c:\"TESTS\")+\" \"+(failed?\"FAILED\":\"PASSED\")+\"\u001b[24m: Sections \"+t.tps+\"/\"+(t.s-1)+\" (\"+Math.floor(t.tps/(t.s-1)*100)+\"%), Tests \"+t.tpt+\"/\"+t.tt+\" (\"+Math.floor(t.tpt/t.tt*100)+\"%)\u001b[0m\\n\",console.log(t.h+t.t+t.h)}}", "title": "" }, { "docid": "9f9e2496b11699b001d0d04db09a3489", "score": "0.5908866", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleepIn(true, false);\n document.getElementById(\"output\").innerHTML += nextOne(true, false);\n //test third method, etc\n}", "title": "" }, { "docid": "b9e8e0ee7676429618220bf617ea22f6", "score": "0.5903111", "text": "function time(options) {\n var options = options || {};\n bench('madoko', (function() {\n return function(text) {\n return madoko.markdown(text);\n };\n })());\n}", "title": "" }, { "docid": "b62611ea28fc028d98183e9a211b1c90", "score": "0.580647", "text": "function _test(tests) {\n\n // gather user-selected execution parameters from node\n var pv = process.argv, \n\n // flag for \"verbose mode\" (v)\n v = process.argv.includes('-v'),\n\n // get filename (fn)\n vars = pv[1].split('/'), \n fn = vars[vars.length - 1].split('.')[0];\n\n // if one of the parameters is a valid number, repeat tests that many times (rpt)\n rpt = parseInt( pv.find( function (a) { \n return !isNaN( parseInt( a ) );\n }) || 1 );\n\n\n // repeat the test (rpt) times, keeping a count (c) \n for (var c = 1; c <= rpt; c++) {\n\n // r = reduce object that keeps track of test results for summary\n tests.reduce(function (r, obj, i, a) {\n\n // if test is not an object, make it one\n if (typeof obj === 'string' ) obj = { test: obj };\n if (Array.isArray(obj)) obj = { test: obj[0], expected:obj[1] };\n\n var t, // temp variable for gathering text results\n test = obj.test,\n // if no expected value passed, assume true\n exp = obj.expected === undefined \n ? true \n : obj.expected,\n section = obj.section;\n \n // if there is no function expression in the test, assume filename as function\n if (test && !new RegExp(/[a-zA-Z]+\\([^\\)]*\\)/g).test(test)) test = fn + '(' + test + ')';\n\n // start timer\n var ts = process.hrtime(), \n // run test\n actual = eval(test), \n // log time elapsed\n ms = process.hrtime(ts)[1] / 1000000, \n // log whether test passed or failed\n failed = JSON.stringify(actual) != JSON.stringify(exp); \n\n var newSection = function newSection(section) {\n // set name of section\n r.sn = section;\n // reset section text, tests passed in section (r.sp), section test count (r.sc)\n r.st = ''; r.sp = 0; r.sc = 0;\n // increment section count\n r.s++; \n };\n\n // initialize first section; if no explicit section name, default to function/file name\n if (!i) newSection( section || fn ); \n\n // if this is a test (not a section) LOG TEST RESULTS to temp variable\n if (!section) {\n\n /* console formatting uses strange codes:\n \\x1b[31m = red\n \\x1b[32m = green\n \\x1b[37m = white\n \\x1b[2m = dim\n \\x1b[1m = bold\n \\x1b[3m = italics\n \\x1b[0m = reset to default\n */\n\n // format red (or green) depending on whether test passed or failed\n t = '\\x1b[2m\\x1b[3' + (failed ? '1' : '2') + 'm' \n\n // \"test expected bold ( [expected_value] ); returned italics ( [actual_value] )\" \n + ' * ' + test + ' expected \\x1b[1m' + exp + '\\x1b[22m\\x1b[2m; returned \\x1b[3m' + actual\n\n // if \"verbose\" option selected, log the time it took to run the function\n + '\\x1b[37m' + (v ? ' (' + ms + 'ms)' : '') + '\\n';\n\n // add test to list if test failed OR if \"verbose\" option indicates to show passed tests\n if (failed || v) r.st += t;\n\n // if test passed, increment \"test passed in this section\" (r.sp) & \"total passed tests\" (r.tpt)\n if (!failed) {\n r.sp++;\n r.tpt++;\n }\n\n // increment \"section count\" and \"total tests\"\n r.sc++;\n r.tt++;\n }\n\n // if there is a section, summarize and log previous section (into temp variable)\n if (section && !!i || i === a.length - 1) {\n\n // if fewer tests PASSED in the section than total tests IN the section, the section fails \n failed = r.sp < r.sc;\n\n // increment \"total passed sections\" \n if (!failed) {\n r.tps++;\n }\n\n // format red (or green) and bold depending on whether section passed or failed\n r.t += '\\n\\x1b[0m\\x1b[1m\\x1b[3' + (failed ? '1' : '2') + 'm' \n\n // log [section number (r.s)] ) [section_name (r.sn)] => \n // [passed_tests_in_current_section (r.sp)] / [total_tests_in_current_section (r.sc)]\n + r.s + ') ' + r.sn + ' -> ' + r.sp + '/' + r.sc \n\n // log ( [percent_of_tests_passed] % )\n + ' (' + Math.floor(r.sp / r.sc * 100) + '%)\\n' + r.st;\n\n newSection(section);\n\n // increment section count (r.ts)\n r.ts++;\n\n }\n\n // if we're on the last item, print TOTAL TEST SUMMARY from results object\n if (i === a.length - 1) _final( r );\n\n return r;\n\n }, {\n // initialize all the test tracking variables\n t: '', // collected test results\n tt: 0, // total tests\n tpt: 0, // total passed tests\n tps: 0, // total passed sections\n s: 0, // section count\n sn: '', // name of current section\n sp: 0, // passed tests in current section\n sc: 0, // tests in current section\n st: '' // test results for current section\n }); // text, total (passed tests, passed sections, sections (name, passed tests, total tests ) \n }\n\n function _final( r ) {\n\n // if fewer tests PASSED than total tests, entire routine fails \n failed = r.tpt < r.tt;\n \n // if multiple tests, print which one we're on\n (rpt > 1) ? 'TEST #' + c : 'TESTS';\n\n // format red (or green) and bold depending on whether section passed or failed\n // \\x1b[101m = red background; \\x1b[102m = green background; \\x1b[4m = underline\n r.h = '\\n\\x1b[0m\\x1b[10' + (failed ? '1' : '2') + '\\x1b[4m'\n \n // if multiple tests, print which one we're on and whether it passed or failed\n + ( ( rpt > 1 ) ? 'TEST ' + c : 'TESTS' ) + ' ' + ( failed ? 'FAILED' : 'PASSED' ) \n\n // end underline; log total passed sections (r.tps) / total sections (r.s)\n + '\\x1b[24m: Sections ' + r.tps + '/' + (r.s - 1) \n \n // log Section success % (passed_sections / total sections) * 100\n + ' (' + Math.floor(r.tps / (r.s - 1) * 100) + '%),' \n\n // log total passed tests / total tests\n + ' Tests ' + r.tpt + '/' + r.tt\n\n // log total success % (passed_tests / total tests) * 100\n + ' (' + Math.floor(r.tpt / r.tt * 100) + '%)\\x1b[0m\\n';\n \n // print TOTAL TEST SUMMARY before and after other tests\n console.log(r.h + r.t + r.h);\n }\n\n}", "title": "" }, { "docid": "1a3a7960265116ffdcc4450feef06148", "score": "0.5788675", "text": "function runSomeTests()\n {\n const tests = [ {value:\"dasd\",result:\"\"},\n {value:\"10d\",result:\"\"},\n {value:\"0\",result:\"\"},\n {value:\"1\",result:\"one\"},\n {value:\"5\",result:\"five\"},\n {value:\"10\",result:\"ten\"},\n {value:\"11\",result:\"eleven\"},\n {value:\"15\",result:\"fifteen\"},\n {value:\"20\",result:\"twenty\"},\n {value:\"24\",result:\"twenty-four\"},\n {value:\"79\",result:\"seventy-nine\"},\n {value:\"100\",result:\"one hundred\"},\n {value:\"101\",result:\"one hundred, one\"},\n {value:\"305\",result:\"three hundred, five\"},\n {value:\"777\",result:\"seven hundred, seventy-seven\"},\n {value:\"1000\",result:\"one thousand\"},\n {value:\"1002\",result:\"one thousand, two\"},\n {value:\"1055\",result:\"one thousand, fifty-five\"},\n {value:\"1114\",result:\"one thousand, one hundred, fourteen\"},\n {value:\"9999\",result:\"nine thousand, nine hundred, ninety-nine\"},\n {value:\"10000\",result:\"ten thousand\"},\n {value:\"10003\",result:\"ten thousand, three\"},\n {value:\"20073\",result:\"twenty thousand, seventy-three\"},\n {value:\"41003\",result:\"forty-one thousand, three\"},\n {value:\"108003\",result:\"one hundred, eight thousand, three\"},\n {value:\"550003\",result:\"five hundred, fifty thousand, three\"},\n {value:\"990012\",result:\"nine hundred, ninety thousand, twelve\"},\n {value:\"1000000\",result:\"one million\"},\n {value:\"1000003\",result:\"one million, three\"},\n {value:\"3003000\",result:\"three million, three thousand\"},\n {value:\"7200013\",result:\"seven million, two hundred thousand, thirteen\"},\n {value:\"9999999\",result:\"nine million, nine hundred, ninety-nine thousand, nine hundred, ninety-nine\"},\n {value:\"10000003\",result:\"ten million, three\"},\n {value:\"90001003\",result:\"ninety million, one thousand, three\"},\n {value:\"1000000000\",result:\"one billion\"}\n ];\n\n let totalSuccess=0;\n\n for (testItem of tests) {\n let result = numberToWords(testItem.value);\n if (result == testItem.result) {\n totalSuccess++;\n console.debug(`PASS! ${testItem.value} : [${result}] = [${testItem.result}]`);\n } else {\n console.warn(`FAIL! ${testItem.value} : [${result}] = [${testItem.result}]`);\n }\n }\n console.log(`total success : ${totalSuccess} / ${tests.length}`);\n }", "title": "" }, { "docid": "c817fa32648f99f04e9f2836584b1bc0", "score": "0.57847697", "text": "function checkTime() {\n if (triviaTimer !== 0) {\n counter.innerText = triviaTimer--;\n\n }\n //run checkAnswer to cycle through question array\n else if (triviaTimer === 0) {\n checkAnswer();\n triviaTimer = 20;\n }\n }", "title": "" }, { "docid": "894d327bfd95577e428a4243cab45ce2", "score": "0.57611156", "text": "function run(){\n heading('test');\n test();\n heading('printNumbers');\n printNumbers();\n heading('Exercise 3');\n twoNumbers();\n heading('Exercise');\n printSquare(3);\n}", "title": "" }, { "docid": "7d0d49c9c14ceb8065656db3bb2be682", "score": "0.5706001", "text": "function nextRound(callback) {\n descriptionCount *= 2;\n if (descriptionCount > maxDescriptionCount)\n return;\n\n // Reset the results.\n results = {};\n\n // Create new steps\n steps.push(generateDescriptions);\n for (var step = 0; step < benchmarkSteps.length; step++)\n for (var i = 0; i < repeats; i++)\n steps.push(benchmarkSteps[step]);\n steps.push(printResults);\n steps.push(nextRound);\n\n // Execute the steps\n callback();\n}", "title": "" }, { "docid": "8338cd52aac3c225396f8577bd49cb9a", "score": "0.5704861", "text": "function runTest() {\n if( testIndex < testNameList.length ) {\n const testName = testNameList[testIndex++];\n const testCode = testJZENVM[testName];\n console.log( '\\n\\nRunning test: '+testName+' --------------------------------' );\n JZENVM.run( testCode );\n setTimeout( runTest, 5*1000 );\n }\n}", "title": "" }, { "docid": "04260ecba78698362a5187a6ce272985", "score": "0.5694305", "text": "function score(){\n //starts with 10 seconds\n //10 seconds added for each correct question\n}", "title": "" }, { "docid": "9a6523b02fb751eaae743cda4f8eaa03", "score": "0.5673228", "text": "function countdownDisplay() {\n cov_g777u47x4().f[7]++;\n //Calculate the session minutes\n let session_minutes = (cov_g777u47x4().s[134]++, Math.floor(session_seconds / 60)); //Update the brower title\n\n let title = (cov_g777u47x4().s[135]++, currTask == 0 ? (cov_g777u47x4().b[23][0]++, `${session_minutes}m`) : (cov_g777u47x4().b[23][1]++, `${session_minutes}m: ${currTask}`));\n let bk = (cov_g777u47x4().s[136]++, `${session_minutes}m: Break!`);\n cov_g777u47x4().s[137]++;\n\n if (!isBreak) {\n cov_g777u47x4().b[24][0]++;\n cov_g777u47x4().s[138]++;\n\n if (document.title != bk) {\n cov_g777u47x4().b[25][0]++;\n cov_g777u47x4().s[139]++;\n document.title = bk;\n } else {\n cov_g777u47x4().b[25][1]++;\n }\n } else {\n cov_g777u47x4().b[24][1]++;\n cov_g777u47x4().s[140]++;\n\n if ((cov_g777u47x4().b[27][0]++, isStarted) && (cov_g777u47x4().b[27][1]++, document.title != title)) {\n cov_g777u47x4().b[26][0]++;\n cov_g777u47x4().s[141]++;\n document.title = title;\n } else {\n cov_g777u47x4().b[26][1]++;\n cov_g777u47x4().s[142]++;\n\n if ((cov_g777u47x4().b[29][0]++, !isStarted) && (cov_g777u47x4().b[29][1]++, document.title != \"Pomodoro Timer!\")) {\n cov_g777u47x4().b[28][0]++;\n cov_g777u47x4().s[143]++;\n document.title = \"Pomodoro Timer!\";\n } else {\n cov_g777u47x4().b[28][1]++;\n }\n }\n } //Find the remaining seconds\n\n\n let remaining_seconds = (cov_g777u47x4().s[144]++, session_seconds % 60); //Display the timer as HTML content\n\n cov_g777u47x4().s[145]++;\n document.getElementById(\"timerDisplay\").textContent = `${session_minutes}:${remaining_seconds < 10 ? (cov_g777u47x4().b[30][0]++, '0') : (cov_g777u47x4().b[30][1]++, '')}${remaining_seconds}`;\n}", "title": "" }, { "docid": "4f46342298d058c4e5e2bea2d6d81db1", "score": "0.5657105", "text": "function PagesPerMinute() {\n // Your code here\n for (i = 1, dep = 20; i <= 6; i++) {\n result = dep * i;\n console.log(result);\n }\n}", "title": "" }, { "docid": "c800b744dcc8dd3ad98d7d3cebafaabd", "score": "0.56481576", "text": "run() {\n const self = this;\n test.describe(self.name, function () {\n\n this.timeout(self.timeout);\n\n test.before(self.pre);\n test.after(self.post);\n\n for (let testcase in self.testcases) {\n if (self.executables.length > 0) {\n if (self.executables.includes(testcase)) {\n test.it(testcase, self.testcases[testcase]);\n }\n else {\n test.it.skip(testcase, self.testcases[testcase]);\n }\n } else {\n test.it(testcase, self.testcases[testcase]);\n }\n }\n });\n }", "title": "" }, { "docid": "a446e103cc663f7ab8675acf52792812", "score": "0.56200665", "text": "function C011_LiteratureClass_Mildred_StartTest() {\n\tif (C011_LiteratureClass_Mildred_GoodStudentCount >= 2) ActorChangeAttitude(1, 0);\n\tCurrentTime = CurrentTime + 50000;\n\tC011_LiteratureClass_Mildred_StartQuiz(C011_LiteratureClass_Mildred_TestChapter.toString(), \"Sidney\");\n}", "title": "" }, { "docid": "dfcb957fb2bae31729420e37e8591f25", "score": "0.56127644", "text": "function getCompletedChapterTestCount(){\n var cnt = 0;\n for(var i=0;i<noOfAttemptedTests.length;i++){\n if(noOfAttemptedTests[i]!=0)\n cnt+=NoOfQuestionsToDisplayArray[i];\n }\n return cnt;\n}", "title": "" }, { "docid": "96e60acf0a2f8e7384ef42ebdf0be45b", "score": "0.5605395", "text": "function main(){\n for(var i = 0; i < 25; i++){\n var obj = readFileToJson('testCase' + (i+1).toString() + '.txt');\n\t runTestCase(obj);\n\t}\n}", "title": "" }, { "docid": "fa82e824fe18632002ef3a9942ed3d6e", "score": "0.5591063", "text": "function AGTest(outputLog) {\n\n //NOTES TO YIFAT AND PATRICK:\n // No IO tests should be isolated. Which means that you have to check that the block\n // is on screen.\n // All getter/setter functions inside anonymous Assert functions.\n // Thanks for all your work :D\n\n var pluralExists = function() {\n return spriteContainsBlock(\"plural %\");\n }\n\n var fb = new FeedbackLog(null, id, 'this is a feedback log test', 0);\n fb.snapWorld = world;\n\n // Create a first test chunk\n var first_chunk = fb.newChunk('Make the plural block.');\n // Add a first tip to that first test chunk\n var first_tip = first_chunk.newTip('Make sure you name your block exactly \"plural %\".',\n 'Great job!');\n\n var ass_test1 = first_tip.newAssertTest(\n pluralExists,\n \"Testing if there is a 'plural %' block in the scripting area.\",\n \"There is a 'plural %' block in the scripting area.\",\n \"Make sure you name your block exactly 'plural %'.\",\n 1);\n\n var second_tip = first_chunk.newTip('Make sure your block works on basic inputs.',\n 'Great job!');\n\n second_tip.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"cat\"], //input\n \"cats\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n second_tip.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"day\"], //input\n \"days\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n var third_tip = first_chunk.newTip('Make sure your block works when the singular word ends in \"s\".',\n 'Great job!');\n\n third_tip.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"boss\"], //input\n \"bosses\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n third_tip.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"dress\"], //input\n \"dresses\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n var fourth_tip = first_chunk.newTip('Make sure your block works when the singular word ends in \"x\".',\n 'Great job!');\n\n fourth_tip.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"fox\"], //input\n \"foxes\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n fourth_tip.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"box\"], //input\n \"boxes\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n\n\n var second_tip2 = first_chunk.newTip('Make sure your block works when the singular word ends in \"th\".',\n 'Great job!');\n\n second_tip2.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"moth\"], //input\n \"moths\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n second_tip2.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"sloth\"], //input\n \"sloths\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n var third_tip2 = first_chunk.newTip('Make sure your block works when the singular word ends in \"tch\".',\n 'Great job!');\n\n third_tip2.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"match\"], //input\n \"matches\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n third_tip2.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"crutch\"], //input\n \"crutches\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n var fourth_tip2 = first_chunk.newTip('Make sure your block works when the singular word ends in \"sh\".',\n 'Great job!');\n\n fourth_tip2.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"dish\"], //input\n \"dishes\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n fourth_tip2.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"wish\"], //input\n \"wishes\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n var second_tip4 = first_chunk.newTip('Make sure your block works when the second-to-last letter is a vowel.',\n 'Great job!');\n\n second_tip4.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"tray\"], //input\n \"trays\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n second_tip4.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"boy\"], //input\n \"boys\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n var third_tip4 = first_chunk.newTip('Make sure your block works when the second-to-last letter is a consonant.',\n 'Great job!');\n\n third_tip4.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"sky\"], //input\n \"skies\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n third_tip4.newIOTest('r', //testClass\n 'plural %', //blockSpec\n [\"try\"], //input\n \"tries\", //output\n -1, //timeout\n false, //isolated\n 1); //points\n\n\n\n\n\n\n\n return fb;\n}", "title": "" }, { "docid": "78090d401fe56a7f8e81fea41108cb3b", "score": "0.55736977", "text": "function testConsecutive() {\n const { parameters } = tests.exercises.find((exercise) => {\n return exercise.name === \"consecutive\";\n });\n\n let tc = 0;\n let pass = 0;\n for (const numbers of parameters[0].values) {\n const functionCall = `consecutive(${format(numbers)})`;\n const expected = staff.consecutive(numbers);\n const actual = student.consecutive(numbers);\n\n if (expected !== actual) {\n console.log(`Test Case ${tc + 1} -- Fail.`);\n console.log(` - call: ${functionCall}`);\n console.log(` - expected: ${expected}`);\n console.log(` - actual: ${actual}\\n`);\n } else {\n pass++;\n }\n\n tc++;\n }\n console.log(`consecutive -- passed ${pass} out of ${tc} test cases.`);\n}", "title": "" }, { "docid": "ad35c351c6fbacf93f0f297a42561191", "score": "0.5562824", "text": "function test6() {\n test6_1();\n // test6_2();\n // test6_3();\n // test6_4();\n}", "title": "" }, { "docid": "d95f9d2189b47f3f6337fe60af0ba8fd", "score": "0.55564535", "text": "function St(Chapter)\n{\n \n var clickedfromchapter;\n //Start Hrb(06/16/2009): Added for preserving test questions\n var questionToPick;\n //end Hrb(06/16/2009): Added for preserving test question\n \n //hrb start: Show popup if course is expired\n if(isExpired)\n {\n document.getElementById(\"testPopUpL1\").style.textAlign = \"center\";\n showAlertPopup(COURSE_EXPIRE,COURSE_HAS_EXPIRED);\n return;\n }\n //hrb end: Show popup if course is expired\n \n clickedfromchapter = CurrentChapter;\n \n CurrentChapter = Chapter;\n \n \n //start Hrb(05/25/2009): Added for course previewer\n if (lessonMode == LESSON_PREVIEWER_MODE && parseInt(demoChapters) <= parseInt(TotalChapters))\n {\n showCoursePreviewPopUp();\n CurrentChapter = clickedfromchapter;\n return;\n }\n //End Hrb(05/25/2009): Added for course previewer\n\n //preliminary pages status\n updatePreliminaryPageStatusFromOutline();\n //end preliminary pages status\n \n //HRB: Added for showing test description page before going to test page.\n if(outlineflag)\n {\n if(mode==\"review\" || mode ==\"retake\"){\n var str = \"\";\n if(mode==\"review\")\n str = eval(\"SWITCH_FROM_REVIEW_\" + FinalExam.toUpperCase());\n else\n str = eval(\"SWITCH_FROM_RETAKE_\" + FinalExam.toUpperCase());\n str= str.replace(/&nbsp;/g,' ');\n \n var res = confirm(str);\n if(res){\n mode = \"study\";\n }else{\n return;\n }\n }\n // Added to display the TestPopUp window in Firefox\n //if(noOfAttemptedTests[CurrentChapter-1] == testAttempts || noOfattempts == testAttempts)\n if(noOfattempts == testAttempts)\n { \n var alertMsg = FAILED_CANNOT_RETAKE_TEST_PART3 + testAttempts + FAILED_CANNOT_RETAKE_TEST_PART2;\n showAlertPopup(CHAPTER_TEST,alertMsg)\n CurrentChapter = clickedfromchapter;\n return;\n }\n //else if(noOfAttemptedTests[CurrentChapter-1] >= CHAPTER_TEST_PASSED || noOfattempts >= CHAPTER_TEST_PASSED)\n else if(noOfattempts >= CHAPTER_TEST_PASSED)\n {\n showAlertPopup(CHAPTER_TEST,CHAPTERTEST_PASS_INFO1)\n CurrentChapter = clickedfromchapter;\n return;\n }\n }\n \n if(!isChapterTestPageShown)\n { \n fnShowChapterTestDescrPage();\n //HRB: start of code for showing test page consistently.\n isChapterTestPageShown = false;\n //HRB: end of code for showing test page consistently.\n return;\n }\n else\n {\n testDescriptionStr=\"\"\n isChapterTestPageShown = false;\n } \n //HRB: End of Added for showing test description page before going to test page.\n\n // Start a test.\n // Can come here\n // i) from the outline, when selecting a chapter test\n // ii) from the next button, when pressed on the last page of a chapter\n document.progress.Bookmark(0);\n testDescriptionStr = CurrentChapter+',test_page';\n document.progress.testDescription(testDescriptionStr);\n \n //hrb end : Commented for opening other windows and navigate to other pages even if tools window is open\n document.getElementById(\"glossLx\").onmousedown();\n document.getElementById(\"helpLx\").onmousedown();\n document.getElementById(\"printLx\").onmousedown();\n \n TestInit();\n CurrentTestQuestion = 0;\n document.getElementById(\"content\").innerHTML = \"\";\n \n //hrb start : Changes to enable menu's on test pages\n if (!scorm)\n {\n document.getElementById(\"searchText\").style.visibility = '';\n document.getElementById(\"searchbuttonL\").style.visibility = '';\n }\n\n document.getElementById(\"glossbuttonL\").style.visibility = '';\n document.getElementById(\"bookmarkbuttonL\").style.visibility = '';\n document.getElementById(\"printbuttonL\").style.visibility = '';\n \n //hrb start : Changes to enable menu's on test pages\n document.getElementById(\"controlpanel\").style.visibility = 'visible';\n //hrb: Added chapter test question combo box\n document.getElementById(\"questionControlPanel\").style.visibility = 'visible';\n //hrb: End of Added chapter test question combo box\n \n //hrb: Added chapter test question number\n document.getElementById(\"showQuestionNumber\").style.visibility = 'visible';\n //hrb: End of Added chapter test question number\n \n document.getElementById(\"submittest\").style.visibility = 'hidden';\n document.getElementById(\"submittest_disable\").style.visibility = 'visible';\n \n document.getElementById(\"subchaptertitle\").innerHTML = \"\";\n //hrb: changes for next and prev button\n document.getElementById(\"PrevButtonDisabled\").style.display = \"none\";\n document.getElementById(\"NextButton\").style.display = \"\";\n document.getElementById(\"PrevButton\").style.display = \"\";\n document.getElementById(\"NextButtonDisabled\").style.display = \"none\";\n //hrb:end of changes for next and prev button\n \n //Start Hrb(06/16/2009): Added for preserving test questions\n FillTestQuestionsArray(Chapter);\n //End Hrb(06/16/2009): Added for preserving test questions\n \n \n //HRB : added to hide outline \n if (document.getElementById(\"outlineL\").style.pixelLeft > 200)\n {\n // Outline is out, so control is here because user clicked on link in outline to test\n mode = \"starttest\";\n }\n else\n {\n // User clicked next button at end of chapter.\n // Used to have a Flash that introduced the test.\n // Here loaded test.htm into frame_b, which\n // loaded starttest.swf, which\n // played and then loaded starttest.htm, which\n // called ShowTestQuestion.\n // But IE7 broke the Flash transfer, so we now skip the Flash and go right to starttest.htm,\n // letting it call ShowTestQuestion(1).\n // This is similar to above in OutlineHide(), where, for unknown reason,\n // we can go straight to ShowTestQuestion(1)\n // JDO 12/06/06\n //This page should come from reference course test apge\n var p = document.location.href.substring(0,document.location.href.indexOf('control.htm') - (courseInstanceId_dyn.length+1));\n parent.frames.frame_b.document.location = p + CourseReferenceId + \"/starttest.htm\";\n \n } \n}", "title": "" }, { "docid": "cdd8caee5224fc0679ade7b2e7452178", "score": "0.55430955", "text": "function runReport() {\n checkAnswers();\n calculateTestTime();\n calculateCheckedInputs();\n\n }", "title": "" }, { "docid": "6ff38a989110170707d68fd024a12c85", "score": "0.5529997", "text": "function testClickingOnSAButton() {\n\n // Call the function for clicking on SA button\n clickOnSAButton();\n\n // Test 1: Test if the Narrator is checking whether user has pressed 8 or \n // not for reading out suggestions\n // - 1. Press UP directly\n\n ///////////////////////////////////////////////////////////// UNCOMMENT IT /////////////////////////////////////////////////////////////\n // suggestedTimesListMoveUp();\n\n // Wait till the operation to finish\n host.setTimeout(function () {\n ///////////////////////////////////////////////////////////// TODO /////////////////////////////////////////////////////////////\n // Get the sentence that narrator says\n var narratorSentence;\n\n // For QUnit testing\n QUnit.test(\"Test for if the Narrator is checking whether user has pressed 8 or not for reading out suggestions - Press UP\", function (assert) {\n\n // Test the output has all the necessary components\n assert.strictEqual(narratorSentence, \"Make sure you have pressed 8 to start reading suggested times. \");\n\n });\n\n // - 2. Press DOWN directly\n suggestedTimesListMoveDown();\n \n host.setTimeout(function () {\n\n ///////////////////////////////////////////////////////////// TODO /////////////////////////////////////////////////////////////\n // Get the sentence that narrator says\n var narratorSentence;\n\n // For QUnit testing\n QUnit.test(\"Test for if the Narrator is checking whether user has pressed 8 or not for reading out suggestions - Press DOWN\", function (assert) {\n\n // Test the output has all the necessary components\n assert.strictEqual(narratorSentence, \"Make sure you have pressed 8 to start reading suggested times. \");\n\n });\n\n // Then we start the test for start reading out suggestions\n testStartReadingOutSuggestions();\n\n }, 2000);\n\n }, 2000);\n\n}", "title": "" }, { "docid": "23abfb25a614d7dbb457e08bf7756d4e", "score": "0.55160064", "text": "function run_test() {\n run_next_test();\n}", "title": "" }, { "docid": "6e32d6e42fbb98b8f56f48c6e711972d", "score": "0.55088663", "text": "function beCheerful(){\n\tfor(var i = 0; i < 98; i++){\n console.log(\"Good Morning!\");\n }\n}", "title": "" }, { "docid": "cc1dd9ed871bc76d30a768ad224cf140", "score": "0.5507985", "text": "function countdown() {\r\n countTime();\r\n // Executes if timer is not paused \r\n if(start.innerText === \"PAUSE\" || start.innertext === \"BREAK\") {\r\n let time = $(\"#timer p\").innerText,\r\n action = $(\"#action p\").innerText,\r\n color = getById(\"page\"),\r\n active = inputs[0].value,\r\n pause = inputs[1].value,\r\n sets = $(\"#sets p\").innerText;\r\n \r\n // Subtracts 1 second from running time\r\n $(\"#timer p\").innerText--;\r\n\r\n // After a repetition is finished: changes screen color, exercise text, action text\r\n // After a set is finished: lowers sets number by 1\r\n // After all sets are finished: executes \"stopTimer\"\r\n if(time <= 1 && action === \"Work\") {\r\n countExercises();\r\n // Changes from work to break\r\n $(\"#timer p\").innerText = pause;\r\n $(\"#action p\").innerText = \"Break\";\r\n color.style.backgroundColor = \"#076dd1\";\r\n \r\n // Changes exercise text after one is finished and lowers sets number if all exercises are finished\r\n let whichExercise = $(\"#exercise p\").innerText.match(/\\d+/g).map(Number)[0];\r\n if(whichExercise === exercises.length) {\r\n countSets();\r\n whichExercise = 0;\r\n $(\"#sets p\").innerText = --sets;\r\n\r\n // Stops the timer after all sets are finished\r\n if(sets == 0) {stopTimer();}\r\n }\r\n // Changes exercise text after every repetition\r\n $(\"#exercise p\").innerText = exercises[whichExercise];\r\n }\r\n else if (time <= 1 && action === \"Break\") {\r\n // Changes from break to work\r\n $(\"#timer p\").innerText = active;\r\n $(\"#action p\").innerText = \"Work\";\r\n color.style.backgroundColor = \"#118007\";\r\n }\r\n else if(time <= 1 && action === \"Get Ready!\"){\r\n // Used only for first start. Changes from get ready to work\r\n $(\"#timer p\").innerText = active;\r\n $(\"#action p\").innerText = \"Work\";\r\n color.style.backgroundColor = \"#118007\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "645241f9d627927e291e193812411cb0", "score": "0.5495701", "text": "function test5() {\n // test5_1();\n // test5_2();\n test5_3();\n}", "title": "" }, { "docid": "33f10bebfe11f4164b7c38b7742b5772", "score": "0.54900336", "text": "function beCheerful() {\n for (var i = 1; i < 99; i++) {\n console.log(`${i}: Good Morning!`);\n }\n}", "title": "" }, { "docid": "871c188fda77f38b60f58422cf7afb98", "score": "0.54895353", "text": "function test(e,t){count++;tests.push([e,t])}", "title": "" }, { "docid": "e6804962bdd910a181f50afabf9c5624", "score": "0.54767984", "text": "function runner(){\n //Record the start time.\n timerStart = Date.now();\n //Run each test in the testsQueue.\n runTests();\n }", "title": "" }, { "docid": "c2c5290a6f8d8527be2fd2370ef89008", "score": "0.54737705", "text": "function challenge6(){\nfor(i=1;i<=30;i++){\nif(i%3==0 && i%5==0){\n console.log('Fizz-Buzz');\n}\nelse if(i%3==0 && i%5!=0){\n console.log('Fizz'); \n}\nelse if(i%3!=0 && i%5 ==0){\n console.log('Buzz'); \n}\nelse{\n console.log(i); \n}\n\n}\n \n}", "title": "" }, { "docid": "456015b84d411aef1f016455431432d4", "score": "0.54699796", "text": "function C011_LiteratureClass_Mildred_StartTestMildred() {\n\tCurrentTime = CurrentTime + 50000;\n\tif (C011_LiteratureClass_Mildred_TestChapter >= 6) {\n\t\tC011_LiteratureClass_Mildred_TestChapter = 1;\n\t\tC011_LiteratureClass_Mildred_PlayerVictoryCount = 0;\n\t}\n\tC011_LiteratureClass_Mildred_StartQuiz(C011_LiteratureClass_Mildred_TestChapter.toString(), \"Mildred\");\n}", "title": "" }, { "docid": "f3c08d05d3d7e86b785362336d605734", "score": "0.54683524", "text": "function runExercise02 () {\n console.log(\"= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\");\n console.log(\"JS-1 - week 1 - Exercise 02\");\n console.log(\"fix `awesome` console.log\");\n console.log(\"- - - - - - - - - - - - - - - - - - - -\");\n console.log(\"`I'm awesome`\");\n console.log(\"= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\");\n console.log(\" \");\n}", "title": "" }, { "docid": "84263329ef0f3c78a28c2391b1070855", "score": "0.54526067", "text": "function testMovingToTomorrow() {\n\n // Test 1: Jump to a weekend, and the function should not accept this\n // as input\n\n jumpToSpecifiedDate(\"6/7/2015\");\n\n host.setTimeout(function () {\n jump_in_calendar(true);\n\n //host.setTimeout(function () {\n // //////////////////////////////////////////////////////////// TODO /////////////////////////////////////////////////////////////\n // // Get the sentence that narrator says\n // var narratorSentence;\n\n // // For QUnit testing\n // QUnit.test(\"Test for moving to tomorrow --> When the input day is a weekend\", function (assert) {\n\n // // Test the output has all the necessary components\n // assert.strictEqual(narratorSentence, \"You've selected a weekend. Please select a weekday.\");\n\n // });\n\n // // Test 2: Jump to tomorrow from a normal day\n // jumpToSpecifiedDate(\"6/8/2015\");\n\n // host.setTimeout(function () {\n // jump_in_calendar(true);\n\n // host.setTimeout(function () {\n // checkForDate(\"6/9/2015\",\n // \"Test for moving to tomorrow --> When the input day is a normal day and next day is not weekend\",\n // function () {\n\n // // Test 3: Tomorrow is a weekend\n // jumpToSpecifiedDate(\"6/12/2015\");\n\n // host.setTimeout(function () {\n\n // jump_in_calendar(true);\n // host.setTimeout(function () {\n\n // checkForDate(\"6/15/2015\",\n // \"Test for moving to tomorrow --> When the input day is a normal day and next day is weekend\", testMovingToYesterday);\n // }, 5000);\n\n // }, 3000);\n\n // });\n // }, 5000);\n\n // }, 3000);\n\n //}, 3000);\n\n console.log(\"Done\");\n\n }, 3000);\n\n}", "title": "" }, { "docid": "a5f3de286b80d41e57894c18a8b38a61", "score": "0.54505175", "text": "function simulate1month() {\n}", "title": "" }, { "docid": "fb6b47e3c96b428f6ec2079693f313da", "score": "0.5442844", "text": "function runExercise02 () {\n console.log(\"= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\");\n console.log(\"JS-1 - week 2 - Exercise 02\");\n console.log(\"Even / odd numbers\");\n console.log(\"- - - - - - - - - - - - - - - - - - - -\");\n console.log(\"Loop from 0 to 20 and log if the current loop control variable is even or odd\");\n for (let i=0; i<21; i++) {console.log(`The number ${i} is ${(i%2)==0?\"even\":\"odd\"}!`)};\n console.log(\"= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\");\n console.log(\" \");\n}", "title": "" }, { "docid": "b0cbe2a6c26ed82f6ef44acda1c780f6", "score": "0.544187", "text": "function startTest()\n\t{\n\t\tCurrentIndex = 0;\n\t\tWordCount = 0;\n\t\tMistakeCount = 0;\n\t\t$('#wordCount').text(\"Words: \" + WordCount.toString());\n\t\t$('#mistakeCount').text(\"Mistakes: \" + MistakeCount.toString());\n\t\t// Disable start, enable text input\n\t\t$('#resetButton').prop('disabled', true);\n\t\tCurrentTime = Time/1000;\n\t\tvar timer = setTimeout(complete, Time);\n\t\tsetTime();\n\t\tClock = setInterval(setTime, 1000);\n\t}", "title": "" }, { "docid": "23652128e5c0d1ac65cf7602721b3f11", "score": "0.54412574", "text": "function runTests(){\n var tests = 0; \n \n if(testPlace()){\n tests++\n }\n if(testMove()){\n tests++\n }\n if(testTurnLeft()){\n tests++\n }\n if(testTurnRight()){\n tests++\n }\n if(testCommandBeforePlace()){\n tests++\n }\n if(testsNotValidMove()){\n tests++\n }\n if(testsNotValidPlace()){\n tests++\n }\n \n console.log('-----UNIT TEST RESULT-----')\n if(tests===7){\n console.log('OK')\n }\n else{\n console.log(7-tests + ' of 7 tests failed')\n }\n}", "title": "" }, { "docid": "3626372589bd4020f62d85815e14becb", "score": "0.5437696", "text": "function start(){test=[sreq,sres,creq,cres];for(var e in exports.compare){console.log(e);var t=exports.compare[e]();console.log(t);console.log(t.length);console.log(\"\")}require(\"bench\").runMain()}", "title": "" }, { "docid": "eba79048fa89e7ba712cd4adbb6da004", "score": "0.5437628", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleep_in(true, false);\n document.getElementById(\"output\").innerHTML += monkey_trouble(true, false);\n document.getElementById(\"output\").innerHTML += string_times(true, false);\n document.getElementById(\"output\").innerHTML += front_times(true, false);\n document.getElementById(\"output\").innerHTML += string_bits(true, false);\n document.getElementById(\"output\").innerHTML += caughtSpeeding(true, false);\n document.getElementById(\"output\").innerHTML += fizz_buzz (true, false);\n document.getElementById(\"output\").innerHTML += teaParty(true, false);\n document.getElementById(\"output\").innerHTML += blackjack(true, false);\n document.getElementById(\"output\").innerHTML += loneSum(true, false);\n//test third method, etc\n}", "title": "" }, { "docid": "6c2afbc642ef6ae9db72bbb5a4188d98", "score": "0.5435801", "text": "function results() {\n\t//creating a new p element\n\tvar dee = document.createElement('p');\n\t//Appending the p element to the body of the code\n\tdocument.body.appendChild(dee);\n\t//setting the innerHtml for dee to the specified text\n\tdee.innerHTML = \"Number of passed tests is \" + assert.pass + \" out of \" + assert.i;\n}", "title": "" }, { "docid": "177d66729e3444969f15df722145d46c", "score": "0.5421956", "text": "function run_test() {\n runMyTests(5);\n}", "title": "" }, { "docid": "1c4db9015d30c5f0d43444ab49a70abc", "score": "0.5421706", "text": "function testIncreasing() {\n const { parameters } = tests.exercises.find((exercise) => {\n return exercise.name === \"increasing\";\n });\n\n let tc = 0;\n let pass = 0;\n for (const numbers of parameters[0].values) {\n const functionCall = `increasing(${format(numbers)})`;\n const expected = staff.increasing(numbers);\n const actual = student.increasing(numbers);\n\n if (expected !== actual) {\n console.log(`Test Case ${tc + 1} -- Fail.`);\n console.log(` - call: ${functionCall}`);\n console.log(` - expected: ${expected}`);\n console.log(` - actual: ${actual}\\n`);\n } else {\n pass++;\n }\n\n tc++;\n }\n console.log(`increasing -- passed ${pass} out of ${tc} test cases.`);\n}", "title": "" }, { "docid": "06d0645bf4b62cbb2b004eb30beca40d", "score": "0.5421599", "text": "function getTest() {\n switch (currentTestNr) {\n case 0:\n currentTest = Quiz;\n break;\n case 1:\n currentTest = Quiz;\n break;\n case 2:\n currentTest = FizzBuzz;\n break;\n case 3:\n currentTest = Memory;\n break;\n case 4:\n currentTest = \"test 4 placehold\";\n break;\n case 5:\n currentTest = \"test 5 placehold\";\n break;\n }\n }", "title": "" }, { "docid": "2c05651c1ddb4f623d016cfba14d7564", "score": "0.5413035", "text": "function initializeTest(data) {\n\n\t\tthis.data = data;\n\n\t\ttotalLineCount = data.content.length;\n\t\tcount = 0;\n\t\ttimer = 900000; // 15 min.\n\t}", "title": "" }, { "docid": "c327db7a997ab6441761936c304688ee", "score": "0.5410155", "text": "function preencher(){\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2021, 7, 31, 11, 40),\n activity: \"Nasci\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2021, 7, 31, 11, 40),\n activity: \"node\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2021, 7, 31, 11, 40),\n activity: \"react\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2004, 7, 24, 11, 40),\n activity: \"react-native\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2004, 7, 24, 11, 40),\n activity: \"react-native\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2004, 7, 24, 11, 40),\n activity: \"react-native\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2004, 7, 24, 11, 40),\n activity: \"react-native\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2004, 7, 24, 11, 40),\n activity: \"react-native\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2004, 7, 24, 11, 40),\n activity: \"react-native\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n tasks.push({\n day: new Date(2021, 7, 31),\n start: new Date(2021, 7, 31, 11, 10),\n end: new Date(2004, 7, 24, 11, 40),\n activity: \"react-native\",\n confirmation: false,\n id :Math.random(),\n select : false\n },)\n //console.log(tasks)\n AsyncStorage.setItem('teste', JSON.stringify(tasks))\n }", "title": "" }, { "docid": "79b2c3d84858da875670197fd72ac5c2", "score": "0.54101044", "text": "function timing(testCase) {\r\n if (isIstanbul) {\r\n testCase.timeout(25000);\r\n testCase.slow(3000);\r\n } else {\r\n testCase.timeout(15000);\r\n testCase.slow(2000);\r\n }\r\n}", "title": "" }, { "docid": "758ae1e2df72498de6ea693096231e09", "score": "0.5405283", "text": "function main(numSteps, numDancers, numDays) {\n\t//distribute steps between dacers ==> steps/ dancers\n\t// all steps must be learned in the timeline\n\t//Dancers(all together) can only learn up to 13% of the total steps per day.\n\t// find out the % each dancer memorizes\n\n\tlet percentOfStepsPerDay = Math.ceil((numSteps / numDays / numSteps) * 100);\n\tlet percentStepsPerDancer = percentOfStepsPerDay / numDancers;\n\t// percent .13 *100 => 13\n\n\t//if(total percentage of the steps is less than or equal to 13%,\n\tif (percentOfStepsPerDay <= 13) {\n\t\t//print \"Yes, they will succeed in that goal! {the percent of steps which every dancer should memorize per day}%.\"\n\t\tconsole.log(\n\t\t\t`Yes, they will succeed in that goal! ${percentStepsPerDancer.toFixed(\n\t\t\t\t2\n\t\t\t)}%.`\n\t\t);\n\t} else {\n\t\t//else\n\t\t//print \"No, they will not succeed in that goal! Required {the percent of steps which every dancer should memorize per day}% steps to be learned per day.\"\n\t\tconsole.log(\n\t\t\t`No, they will not succeed in that goal! Required ${percentStepsPerDancer.toFixed(\n\t\t\t\t2\n\t\t\t)}% steps to be learned per day.`\n\t\t);\n\t}\n\n\t//.toFixed(2)\n}", "title": "" }, { "docid": "2a988fcfa40e1460c774e86b323dd361", "score": "0.5400811", "text": "function startContinue5Timer() {\n var fiveMinutes = 60 * 5,\n display5 = document.querySelector('#timeContinue5Break');\n startTimer(fiveMinutes, display5);\n\n}", "title": "" }, { "docid": "3fa9b3203586618b81be72f870221279", "score": "0.5395615", "text": "function logTimings() {\n console.log(\n \"%cSuccessfully Done!\",\n \"color: green; font-family:monospace; font-size: 20px\"\n );\n for (var prop in timings) {\n if (timings.hasOwnProperty(prop)) {\n console.log(\n \"%c\" +\n prop +\n \" = \" +\n (timings[prop].sum / timings[prop].count).toString() +\n \"ms\",\n \"color: blue;font-family:monospace;font-size:18px\"\n );\n\n // i += 55;\n }\n }\n console.log(\n \"%c GOAL REACHED !!\",\n \"font-weight: bold; font-size: 50px;color: green; text-shadow: 3px 3px 0 rgb(100,31,38) , 6px 6px 0 rgb(226,150,14) , 9px 9px 0 rgb(245,221,8) , 15px 15px 0 rgb(2,135,206) , 18px 18px 0 rgb(40,177,145) \"\n );\n}", "title": "" }, { "docid": "ee9c60c17771aee60b3c594e9e5eb6f6", "score": "0.53843886", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleep_in(true, false);\n document.getElementById(\"output\").innerHTML += monkey_trouble(true, false);\n document.getElementById(\"output\").innerHTML += front_times(true, false);\n document.getElementById(\"output\").innerHTML += string_bits(true, false);\n document.getElementById(\"output\").innerHTML += caughtSpeeding(true, false);\n document.getElementById(\"output\").innerHTML += sleep_in(true, false);\n document.getElementById(\"output\").innerHTML += fizz_buzz(true, false);\n document.getElementById(\"output\").innerHTML += teaParty(true, false);\n document.getElementById(\"output\").innerHTML += blackjack(true, false);\n document.getElementById(\"output\").innerHTML += loneSum(true, false);\n //test third method, etc\n\n}", "title": "" }, { "docid": "ee5188b4b8cfa56e3018a1515dc63d40", "score": "0.5375562", "text": "function run(){\n\n\tdescribe(\"GummiBar\", function(){\n\n\t\t\tfindXML();\n\t\t\tparseXML();\n\t\t\tloadGame();\n\t\t\tsingleSpin(); // Start by doing a single spin\n\t\t\tfullGame();\n\t\t\tbonusGame();\n\t\t\tscatters();\n\t});\n\n}", "title": "" }, { "docid": "4079e65de1bdc5f901c67b7359884f98", "score": "0.53609765", "text": "function main() {\n var testCases = nextInt();\n\n for (var testCase = 1; testCase <= testCases; ++testCase) {\n var R = nextInt();\n var C = nextInt();\n var res = [];\n\n for (let i = 0; i < R; i++) {\n res.push(next().split(\"\"));\n }\n\n step(0, res, R, C);\n\n print(\"Case #\" + testCase + \":\");\n for (let i = 0; i < R; i++) {\n print(res[i].join(\"\"));\n }\n }\n}", "title": "" }, { "docid": "4ebf62792152548ff667d05474cd875a", "score": "0.5360782", "text": "function trial() {\n /* allow responses */\n keytest = 1;\n\n /* update counter display */\n $(\".countDisplay\").html((trialCount + 1) + \" /\" + trialArray.length + \" trials\");\n\n /* present target stim */\n $(\".targetDisplay\").hide();\n $(\".targetDisplay\").html(trialArray[trialCount].word); /* display word */\n $(\".targetDisplay\").css(\"color\", trialArray[trialCount].color); /* change color of word */\n $(\".targetDisplay\").show();\n\n /* get timestamp for stim presentation */\n time1 = new Date().getTime();\n}", "title": "" }, { "docid": "27a28f3e8f67bcfa21dfbceb5242974b", "score": "0.53589755", "text": "function isCourseCompleted()\n{\n /*if (FinalExam != EXAM_POSITION_BYCOURSE)\n {\n for(index= 0 ;index<TotalChapters ; index++)\n {\n if(noOfAttemptedTests[index] != CHAPTER_TEST_PASSED)\n return false;\n }\n return true;\n }\n else\n {*/\n if(noOfattempts == CHAPTER_TEST_PASSED)\n return true;\n else\n return false;\n //}\n}", "title": "" }, { "docid": "82ecbaf14a77651aef468785c24004b8", "score": "0.5358066", "text": "function startTests() {\n const startTime = Date.now();\n const runningTests = suite.map(startTest);\n report(runningTests, startTime);\n}", "title": "" }, { "docid": "6f81bb3de8e028190ffa90957dda8286", "score": "0.5355404", "text": "function countDownFunction() {\n if (startTime >= 0 && sectionCounter === 1) {\n timer.innerText = startTime;\n startTime--;\n } else if (startTime < 0 && sectionCounter < 2) {\n nextSection();\n }\n}", "title": "" }, { "docid": "e76853c8fa6e896c665ecfd66d4b01a5", "score": "0.5353527", "text": "function test3_3() {\n // test3_3_1();\n // test3_3_2();\n // test3_3_3();\n // test3_3_4();\n // test3_3_5();\n test3_3_6();\n}", "title": "" }, { "docid": "ebe6b3cc4905d6541096632e42d17a8f", "score": "0.53533745", "text": "function timeInWords(h, m) {\n //console.log('time');\n //var expr = 'Papayas';\n let answer = '';\n let hours = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve']; \n let minutes = {\n 13:'thirteen',\n 14: 'fourteen',\n 16: 'sixteen',\n 17: 'seventeen',\n 18: 'eighteen',\n 19: 'nineteen',\n 20: 'twenty',\n 200: 'twenty '\n \n }\n\n if (m < 31) {\n console.log('block 1');\n switch (m) {\n case 15:\n answer = ( 'quarter past ' + hours[h] );\n break;\n\n case 30:\n answer = ( 'half past ' + hours[h] );\n break;\n\n case 1:\n answer = ( '' + m + ' minute past ' + hours[h]);\n break;\n\n case 0:\n answer = ( '' + hours[h] + ' o\\' clock');\n break;\n\n \n default:\n if (m<13) {\n answer = ('' + hours[m] + ' minutes past ' + hours[h]);\n } else if (m<21) {\n answer = ('' + minutes[m] + ' minutes past ' + hours[h]);\n } else {\n let digit_array = m.toString().split('');\n //console.log(digit_array);\n answer = ('' + minutes[200] + hours[Number(digit_array[1])] + ' minutes past ' + hours[h]);\n }\n \n }\n } else {\n //console.log('block 2');\n switch (m) {\n case 45:\n answer = ( 'quarter to ' + hours[h+1] );\n break;\n\n \n default:\n let toMinutes = (60-m);\n //console.log('to minutes ' + toMinutes);\n if (toMinutes == 1) {\n answer = ('' + hours[toMinutes] + ' minute to ' + hours[h+1]);\n } else if (toMinutes<13) {\n answer = ('' + hours[toMinutes] + ' minutes to ' + hours[h+1]);\n } else if (toMinutes<21) {\n answer = ('' + minutes[toMinutes] + ' minutes to ' + hours[h+1]);\n } else {\n let digit_array = toMinutes.toString().split('');\n //console.log(digit_array);\n \n answer = ('' + minutes[200] + hours[Number(digit_array[1])] + ' minutes to ' + hours[h+1]);\n }\n }\n }\n\n console.log(answer);\n return answer;\n\n}", "title": "" }, { "docid": "d64e5ae8a7f09d490972342219aec2cb", "score": "0.53488606", "text": "function SubmitTest()\n{\n \n //reset the flag to '1' when any test submitted\n if (FinalExam == EXAM_POSITION_BYCOURSE){\n isChapterTestAttemptChanged = 1;\n }\n \n\n hidePopups();\n \n //Start HRB: Added for updating status of chapter test\n if (FinalExam == EXAM_POSITION_BYCOURSE)\n var key = \"TestQuestion \" + CurrentTestQuestion;\n else\n var key = \"Chapter\" + CurrentChapter + \" TestQuestion \" + CurrentTestQuestion;\n\n isChapterTestSubmited = true;\n \n //End HRB: Added for updating status of chapter test\n updateStatus(key, INCOMPLETED_STATUS_IMG);\n \n if(outlineflag)\n { \n if (document.getElementById(\"outlineL\").style.pixelLeft > 200)\n OutlineShowHide();\n \n if(!isIE && outlineflag)\n {\n OutlineShowHide();\n }\n outlineflag = 0;\n }\n \n if (FinalExam == EXAM_POSITION_BYCOURSE)\n {\n //hrb:changes for max 3 attempts\n noOfattempts++;\n \n if(noOfattempts<=testAttempts)\n //SubmitFinalExam();\n showFinalExamConfirmationPage();\n else\n {\n Sc(1);\n }\n }\n else\n {\n SubmitChapterTest();\n }\n \n //reset the flag once submit the test\n if (FinalExam == EXAM_POSITION_BYCOURSE){\n isQuestionResponseChanged = 0;\n isChapterTestAttemptChanged = 0;\n }\n \n} // end SubmitTest()", "title": "" }, { "docid": "246f950b7c0d1fb58018c98802e13231", "score": "0.5346836", "text": "function tellTime(h, m) {\n\tif (m === 0) {\n\t\tconsole.log(onesAndTeens[h] + \" o' clock\")\n\t} else if (m < 30 && m > 0) {\n\t\tif (m == 1) {\n\t\t\tconsole.log(onesAndTeens[m] + \" minute past \" + onesAndTeens[h]);\n\t\t} else if (m < 20) {\n\t\t\tif (m === 15) {\n\t\t\t\tconsole.log(\"quarter past \" + onesAndTeens[h]);\n\t\t\t} else {\n\t\t\t\tconsole.log(onesAndTeens[m] + \" minutes past \" + onesAndTeens[h]);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"twenty \" + onesAndTeens[m%20] + \" minutes past \" + onesAndTeens[h]);\n\t\t}\n\t} else {\n\t\tif (m === 30) {\n\t\t\tconsole.log(\"half past \" + onesAndTeens[h]);\n\t\t} else {\n\t\t\tvar remainingMinutes = 60 - m;\n\n\t\t\tif (remainingMinutes === 1) {\n\t\t\t\tconsole.log(onesAndTeens[remainingMinutes] + \" minute to \" + onesAndTeens[h+1]);\n\t\t\t} else if (remainingMinutes < 20) {\n\t\t\t\tif (remainingMinutes === 15) {\n\t\t\t\t\tconsole.log(\"quarter to \" + onesAndTeens[h+1]);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(onesAndTeens[remainingMinutes] + \" minutes to \" + onesAndTeens[h+1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.log(\"twenty \" + onesAndTeens[remainingMinutes%20] + \" minutes to \" + onesAndTeens[h+1]);\n\t\t\t}\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c51cd0ef64d75cc823f5201cd3eb4d57", "score": "0.53459036", "text": "function exec() {\n console.log('The tests below pass if there is no error in the console log');\n /*test1()\n test2()\n test3()\n test4()\n test5()\n test6()*/\n //test7()\n //test6()\n test8();\n }", "title": "" }, { "docid": "92487de3c5191b45c4d8f87635683bd2", "score": "0.5344475", "text": "function experimentSetUp(lobGraphNums){\n\n var start_time = 0;\n var end_time = lobGraphNums;\n var duration = end_time - start_time;\n\n\n // schedule_offsetfn returns time-dependent offset on schedule prices\n function schedule_offsetfn(t){\n var pi2 = Math.pi * 2;\n var c = Math.pi * 3000;\n var wavelength = t / c;\n var gradient = 100 * t / (c / pi2);\n var amplitude = 100 * t / (c / pi2);\n var offset = gradient + amplitude * Math.sin(wavelength * t);\n return int(round(offset, 0));\n }\n\n\n\tvar stepmode;\n\tfor (var stepMode=0; stepMode<stepModes.length; stepMode+=1){\n\t\tif (radios[tabNames['Config']][1][stepMode].selected){\n\t\t\tstepmode = stepModes[stepMode];\n\t\t}\n\t}\n\t\n\tvar timemode;\n\tfor (var timeMode=0; timeMode<timeModes.length; timeMode+=1){\n\t\tif (radios[tabNames['Config']][2][timeMode].selected){\n\t\t\ttimemode = timeModes[timeMode];\n\t\t}\n\t}\n\t\n var range1 = [slides[tabNames['Config']][0][1].value, slides[tabNames['Config']][0][0].value, schedule_offsetfn];\n var supply_schedule = [ {'from':start_time, 'to':end_time, 'ranges':[range1], 'stepmode':stepmode}\n ];\n\n var range1 = [slides[tabNames['Config']][0][1].value, slides[tabNames['Config']][0][0].value, schedule_offsetfn];\n var demand_schedule = [ {'from':start_time, 'to':end_time, 'ranges':[range1], 'stepmode':stepmode}\n ];\n\n var order_sched = {'sup':supply_schedule, 'dem':demand_schedule,\n 'interval':slides[tabNames['Config']][1][0].value, 'timemode':timemode}; // NOT drip-poisson as doesn't work in P5 currently\n\t\n\n // run a sequence of trials that exhaustively varies the ratio of four trader types\n // NB this has weakness of symmetric proportions on buyers/sellers -- combinatorics of varying that are quite nasty\n\n\n\tvar trader_ratios_b = [];\n\tfor (var trader_ratio=0; trader_ratio<traderNames.length; trader_ratio+=1){\n\t\ttrader_ratios_b.push(slides[tabNames['Buyers']][0][trader_ratio].value);\n\t}\n\tvar n_traders_b;\n\tfor (var traderNumOption=0; traderNumOption<traderNumOptions.length; traderNumOption+=1){\n\t\tif (radios[tabNames['Buyers']][0][traderNumOption].selected){\n\t\t\tn_traders_b = traderNumOptions[traderNumOption];\n\t\t}\n\t}\n\tvar trader_ratios_s = [];\n\tfor (var trader_ratio=0; trader_ratio<traderNames.length; trader_ratio+=1){\n\t\ttrader_ratios_s.push(slides[tabNames['Sellers']][0][trader_ratio].value);\n\t}\n\tvar n_traders_s;\n\tfor (var traderNumOption=0; traderNumOption<traderNumOptions.length; traderNumOption+=1){\n\t\tif (radios[tabNames['Sellers']][0][traderNumOption].selected){\n\t\t\tn_traders_s = traderNumOptions[traderNumOption];\n\t\t}\n\t}\n\n\tvar n_trader_types = trader_types.length;\n\t\n\tfunction generateSpec(trader_types,trader_ratios,n_traders){\n\t\tif (trader_ratios.length!==trader_types.length){\n\t\t\talert(\"ERROR: The arrays: 'trader_ratios' and 'trader_types' should be of the same length.\");\n\t\t}\n\t\tvar trader_ratio_sum = 0;\n\t\tfor (var i=0; i<trader_ratios.length; i+=1){\n\t\t\ttrader_ratio_sum += trader_ratios[i];\n\t\t}\n\t\tvar spec = {};\n\t\tfor (var i=0; i<trader_ratios.length; i+=1) {\n\t\t spec[trader_types[i]] = round(n_traders * trader_ratios[i]/trader_ratio_sum);\n\t\t}\n\t\treturn spec;\n\t}\n\t\n var buyers_spec = generateSpec(trader_types,trader_ratios_b,n_traders_b);//{'GVWY': 50,'SNPR': 100};//{'GVWY': 30,'ZIC': 0,'SHVR': 0,'SNPR': 170,'ZIP': 0}; // GVWY,ZIC,SHVR,SNPR,ZIP\n var sellers_spec = generateSpec(trader_types,trader_ratios_s,n_traders_s);\n var traders_spec = {'sellers':sellers_spec, 'buyers':buyers_spec};\n var trial = 0;\n return market_session('trial' + trial, start_time, end_time, traders_spec,order_sched, false, false);\n}", "title": "" }, { "docid": "f5bbbac83ef27a8ff299ab75a03c8026", "score": "0.53347707", "text": "function step() {\r\n count += 1;\r\n for (var i = 0; i < qa_set.length; i++) {\r\n qa_set[i].className= 'qa_set';\r\n \r\n }\r\n\r\n qa_set[count].className = \"qa_set active\"\r\n if ( count == 50) {\r\n \r\n skip.style.display = \"none\"\r\n // Time per question\r\n clearInterval(durationTime);\r\n countdown.innerHTML = 0;\r\n }\r\n\r\n}", "title": "" }, { "docid": "286210c8217caa4049cbaa4213125780", "score": "0.5331316", "text": "function preTestWork(){\n\n}", "title": "" }, { "docid": "f4303ace104ea4db01d0d9fde526a20d", "score": "0.5330905", "text": "function bench(pair, callback) {\n process.stdout.write(\".\");\n var func = pair[1];\n var start = new Date() - 0;\n func(function(err, cnt) {\n var end = new Date() - 0;\n var array = pair[2] || (pair[2] = []);\n array.push(end - start);\n pair[3] = cnt;\n setTimeout(callback, 100);\n });\n }", "title": "" }, { "docid": "e70ac2e7eaca8ef8688081d412fee6ed", "score": "0.53239834", "text": "async tests() {\n try {\n const { owner, repo } = this;\n const sixMonthsAgo = moment().subtract(6, 'months').format();\n const res = await axios.get(`https://api.github.com/repos/${owner}/${repo}/contents?access_token=f53a3a9b618e28420561d27ca99d38a1d3cc1364`);\n const contents = res.data;\n const hasTests = contents.some(item => item.name.includes('test'));\n\n if (hasTests) return 20;\n\n return 0;\n } catch (error) {\n throw new Error(error);\n }\n }", "title": "" }, { "docid": "bf0dc4181e2cee0d588fc33dd57f0d60", "score": "0.53215677", "text": "function nextNote() {\n currentStep++;\n if (currentStep == 16) currentStep = 0;\n noteTime += tic;\n}", "title": "" }, { "docid": "3445ca2e3277bbe2fa35c9cfc61c83d4", "score": "0.5319493", "text": "function gotHamletTestamentData () {\n // Join the two texts together into a single string\n let allText = hamletText + ' ' + oldTestamentText;\n // Create a Markov chain generator\n markov = new RiMarkov(4);\n // Load the string of both books into the Markov generator\n markov.loadText(allText);\n // Generate a paragraph of text\n generateParagraph();\n console.log('generated');\n}", "title": "" }, { "docid": "cd858caa7c3639c15fed6e7b3676bbd6", "score": "0.531673", "text": "function problem1() {\n const answerP = document.querySelector(\"#problem1Answer\");\n let sum = 0;\n for(let i = 0; i < 1000; i++) {\n if ((i%3===0) || (i%5===0)){\n sum += i;\n }\n }\n answerP.innerHTML = \"Answer: \" + sum;\n}", "title": "" }, { "docid": "254c47b01ee4781b052d8e36f50d100d", "score": "0.5313858", "text": "function startTest(blockNumber, inputTrialSet) {\n document.onkeydown = earlyEnd;\t\t\t//Set the early interrupt\n currentBlock = blockNumber;\t\t\t\t//Keep track of the current block\n currentTrial = 0;\t\t\t\t\t\t//The current data set uses 32 trials/test\n trialCount = inputTrialSet.length;\t\t//All tests are 32 trials, but check anyway\n trialResults = [];\t\t\t\t\t\t//We'll keep our results in this array\n practiceFeedbackUP = document.getElementById('practiceFeedbackUP');\n practiceFeedbackDOWN = document.getElementById('practiceFeedbackDOWN');\n iPadLeft = \tdocument.getElementById('iPadLeft');\n iPadRight = document.getElementById('iPadRight');\n\n //Setup the test in random order\n for (trialIndex=currentTrial; trialIndex<(trialCount+currentTrial); trialIndex++) {\n sourceTrial = randomNumber(0,(inputTrialSet.length-1));\t\t//Get a random trial\n trialResults[trialIndex] = inputTrialSet[sourceTrial];\t//Set up the results to contain the trial info\n inputTrialSet.splice(sourceTrial,1);\t\t\t\t\t\t\t//Remove the current trial from the pool, so we don't get it again\n }\n\n //Go through the test in reverse order and setup the view stack so we can quickly flip through them during testing\n for (reverseTrialIndex=(trialResults.length-1);reverseTrialIndex>=currentTrial;reverseTrialIndex--) {\n pushView('cueType10');\n pushView(trialResults[reverseTrialIndex][1]+trialResults[reverseTrialIndex][2]+trialResults[reverseTrialIndex][4]);\n pushView('cueType10');\n pushView('cueType'+trialResults[reverseTrialIndex][0]+trialResults[reverseTrialIndex][3]);\n pushView('cueType10');\n }\n pushView('blankView');\n startTrial();\t\t\t\t\t\t\t//Start the first trial\n}", "title": "" }, { "docid": "53ac81899c14e951aba59db37ecd3960", "score": "0.5312554", "text": "function startTest() {\n timerCount = 60;\n startTimer();\n startPrompt.style.display = \"none\";\n questionArea.style.display = \"block\";\n correctCheck.style.display = \"none\";\n startButton.style.display = \"none\";\n highScoreEL.style.display = \"none\";\n nextQuestion ();\n}", "title": "" }, { "docid": "9c9e785b70cba378e3c052d3aef17ef1", "score": "0.5309685", "text": "function ContadorDiferenciado() {\n for (var i = 0; i < 100; i++) {\n if (i % 3 == 0 && i % 5 != 0) {\n console.log(\"Fizz\");\n } else if (i % 5 == 0 && i % 3 != 0) {\n console.log(\"Buzz\");\n } else if (i % 5 == 0 && i % 3 == 0) {\n console.log(\"FizzBuzz\");\n } else {\n console.log(i);\n }\n }\n }", "title": "" }, { "docid": "86123525e0335a1c14989cb626906def", "score": "0.5309169", "text": "function tekCamp() {\n for (let i = 1; i<=100; i++){\n if (i % 3 === 0 && i % 5 ===0)\n console.log(\"TEKcamp\");\n\n if (i % 3 === 0)\n console.log(\"TEK\");\n \n if (i % 5 === 0)\n console.log(\"camp\");\n\n console.log(i);\n }\n \n }", "title": "" }, { "docid": "9ae17c9bcb8486ef95769d3ca106b755", "score": "0.5306718", "text": "function test5() {\n test5_1();\n // test5_2();\n}", "title": "" }, { "docid": "d97ba17d815612fd52a618ccae2ebbf9", "score": "0.52978843", "text": "async run() {\r\n\t\tthis.succeeded = 0;\r\n\t\tlog.write('Running %s (%d tests)', this.unitName, this.testCount);\r\n\r\n\t\tlet testIndex = 1;\r\n\t\tfor (const test of this.tests) {\r\n\t\t\tawait this.runner.markTest(util.format('%s->%s', this.unitName, test.name));\r\n\r\n\t\t\ttry {\r\n\t\t\t\tconst testStart = performance.now();\r\n\t\t\t\tawait test.call(this);\r\n\r\n\t\t\t\tthis.succeeded++;\r\n\r\n\t\t\t\tconst elapsed = Math.round(performance.now() - testStart);\r\n\t\t\t\tlog.write('(%d/%d) Passed %s->%s [%dms]', testIndex, this.testCount, this.unitName, test.name, elapsed);\r\n\t\t\t} catch (e) {\r\n\t\t\t\tlog.write('(%d/%d) FAILED %s->%s (%s)', testIndex, this.testCount, this.unitName, test.name, e.message);\r\n\t\t\t}\r\n\r\n\t\t\ttestIndex++;\r\n\t\t}\r\n\r\n\t\tlog.write('Test unit %s %s (%d/%d)', this.unitName, this.passed ? 'succeeded' : 'failed', this.succeeded, this.testCount);\r\n\t}", "title": "" }, { "docid": "22969f0f534c1ab8d93636af6d878540", "score": "0.5296558", "text": "function startUp() {\r\n\t\t\t\r\n\t if(learn === true) {\r\n\t\ttesting = false\r\n\t\trow4 = document.getElementsByClassName('flex-item3')\r\n\t\trow4[0].style.backgroundColor = 'white'\r\n\t\trow4[1].style.backgroundColor = 'black'\r\n\t\trow4[2].style.backgroundColor = 'black'\r\n\t\trow4[0].textContent = PHRASES[count][0][0];\r\n\t\trow4[1].textContent = PHRASES[count][1][0];\r\n\t\trow4[2].textContent = PHRASES[count][2][0];\r\n\t\tsetTimeout(answers,1000)\r\n\t\t\tfunction answers() {\r\n\t\t\t\trow4[1].style.backgroundColor = 'white';\r\n\t\t\t\trow4[2].style.backgroundColor = 'white';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tconsole.log(PHRASES[count][0][0]);\r\n\t\t\tconsole.log(PHRASES[count][1][0]);\r\n\t\t\tcount++;\r\n\t\t\tconsole.log(count)\r\n\t\t}\t \r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\r\n\t\r\n\t if(testing === true) {\r\n\t\tlearn = false\r\n\t\trow4 = document.getElementsByClassName('flex-item3')\r\n\t\trow4[0].style.backgroundColor = 'white'\r\n\t\trow4[1].style.backgroundColor = 'black'\r\n\t\trow4[2].style.backgroundColor = 'black'\r\n\t\tvar rand = (Math.ceil(Math.random() * 2));\r\n\t\tconsole.log(rand)\r\n\t\tif (rand == 1) {\r\n\t\t\tvar other = 2;\r\n\t\t\tconsole.log(other)\r\n\t\t}else{\r\n\t\t\tvar other = 1;\r\n\t\t\tconsole.log(other)\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tconsole.log(rand)\r\n\t\trow4[0].textContent = TEST_NOUNS[count][0][0];\r\n\t\trow4[1].textContent = TEST_NOUNS[count][rand][0];\r\n\t\trow4[2].textContent = TEST_NOUNS[count][other][0];\r\n\t\tcorrectAnswer = TEST_NOUNS[count][1][0];\r\n\t\tsetTimeout(answers,1000)\r\n\t\t\tfunction answers() {\r\n\t\t\t\trow4[1].style.backgroundColor = 'white';\r\n\t\t\t\trow4[2].style.backgroundColor = 'white';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tconsole.log(TEST_NOUNS[count][1][0]);\r\n\t\t\tconsole.log(TEST_NOUNS[count][2][0]);\r\n\t\t\tcount++;\r\n\t\t\tconsole.log(count)\r\n\t\t}\t \r\n\t}", "title": "" }, { "docid": "6b999b46400fb8c11bed4eae06837792", "score": "0.5296403", "text": "function startTest(){\n\n wipe()\n\n init()\n\n // debug console\n console.log(\"restarting\")\n\n \n // setup the questions\n setUpQuestions(curQ)\n\n // run timer every second\n timeReset = setInterval(timer, 1000)\n \n}", "title": "" }, { "docid": "fbaf66005c37b800464031b0e9758aa8", "score": "0.5294936", "text": "function isFailed()\n{\n //hrb: changes to goto next chapter if failed in any chapter test for 3 times\n /*if (FinalExam != EXAM_POSITION_BYCOURSE) \n {\n for(var index=0;index<=TotalChapters;index++)\n { \n if(noOfAttemptedTests[index]>=testAttempts && noOfAttemptedTests[index] != CHAPTER_TEST_PASSED)\n return true;\n }\n return false;\n }\n else\n {*/\n if(noOfattempts>=testAttempts && noOfattempts != CHAPTER_TEST_PASSED)\n return true;\n else\n return false;\n //}\n //hrb: end of changes to goto next chapter if failed in any chapter test for 3 times\n}", "title": "" }, { "docid": "ef3d84fafdf96bf6d7e2c197320ed6f3", "score": "0.52935845", "text": "function showHappyEnd() {\n console.log(\"This is the end of the test. Well done!\");\n}", "title": "" }, { "docid": "4a13bf1c20ca32faab735174d70c8d1f", "score": "0.5292142", "text": "function testResults() {\n var testtype = localStorage.getItem(\"testtype\");\n var resultstring = \"default\";\n var goodResult = false;\n var randomNumber;\n\n switch(testtype) {\n //teste alcoolemia\n case \"1\":\n randomNumber = getRandomArbitrary(0,1.5).toFixed(2);\n resultstring = randomNumber.toString() + \"%\";\n if (randomNumber < 0.5) {\n goodResult = true;\n }\n break;\n\n //teste de pressao arterial\n case \"2\":\n randomNumber = getRandomArbitrary(0,190).toFixed(0);\n var pressao2 = getRandomArbitrary(0,120).toFixed(0);\n resultstring = randomNumber.toString() + \"/\" + pressao2.toString() + \"\\nmmHg\";\n document.getElementById(\"Result_Text\").style.top = \"100px\";\n if (randomNumber < 120 && pressao2 < 80) { goodResult = true; }\n break;\n\n //teste de narcoticos\n case \"3\":\n var narcoticos = [\"Nao foram\\nencontradas\\nsubstancias\", \"Cannabis\", \"Ecstasy\", \"Heroina\", \"Cocaina\", \"Anfetaminas\", \"LSD\"];\n randomNumber = getRandomArbitrary(0,7).toFixed(0);\n switch(randomNumber) {\n case \"0\":\n case \"1\":\n document.getElementById(\"Result_Text\").style.top = \"90px\";\n document.getElementById(\"Result_Text\").style.fontSize = \"21px\";\n goodResult = true;\n randomNumber = 0;\n break;\n case \"6\":\n document.getElementById(\"Result_Text\").style.fontSize = \"25px\";\n break;\n }\n if (randomNumber > 1) { randomNumber -= 1; }\n resultstring = narcoticos[randomNumber];\n break;\n\n //ritmo cardiaco\n case \"4\":\n randomNumber = getRandomArbitrary(49,121).toFixed(0);\n resultstring = randomNumber.toString() + \" bpm\";\n if (60 < randomNumber && randomNumber < 100) { goodResult = true; }\n break;\n\n //teste de glicémia\n case \"5\":\n randomNumber = getRandomArbitrary(40,200).toFixed(0);\n resultstring = randomNumber.toString() + \"\\nmg/dl\";\n document.getElementById(\"Result_Text\").style.top = \"100px\";\n if (70 < randomNumber && randomNumber < 140) { goodResult = true; }\n break;\n }\n\n document.getElementById(\"Result_Text\").textContent = resultstring;\n if (goodResult) {\n document.getElementById(\"Touch_Screen\").style.backgroundColor = \"#17BF15\"; //green + thumbs up\n document.getElementById(\"Result_Text\").style.visibility = \"visible\";\n document.getElementById(\"Good\").style.visibility = \"visible\";\n } else {\n document.getElementById(\"Touch_Screen\").style.backgroundColor = \"#DE1F26\"; //red\n document.getElementById(\"Result_Text\").style.visibility = \"visible\";\n document.getElementById(\"Warning\").style.visibility = \"visible\";\n document.getElementById(\"Warning\").style.animation = \"pulse 1s ease-in infinite\";//add pulsating\n window.setTimeout(buttonise, 1100);\n }\n}", "title": "" }, { "docid": "3147541ac77cc9ba40ca00bf085eedee", "score": "0.529111", "text": "function MainTestCase()\n\t\t{\n\t\t\tfunction setUp()\n\t\t\t{\n\t\t\t\tPseudo.StartUnitTest.Result = \"\";\n\t\t\t};\n\t\t\t\n\t\t\tfunction test_CreateTestApp()\n\t\t\t{\n\t\t\t\t//this.getTestObject();\n\t\t\t\n\t\t\t\tPseudo.StartUnitTest.App =\n\t\t\t\t\tPseudo.Init(function(e){Pseudo.StartUnitTest.Result += \"\" + e;});\n\t\t\t\t\t\n\t\t\t\tjsUnity.assertions.assertNotUndefined(Pseudo.StartUnitTest.App, \n\t\t\t\t\t\"Unable to create test application!\");\n\t\t\t};\n\t\t\t\n\t\t\tfunction test_9_1_4_Eratosztenesz()\n\t\t\t{\n\t\t\t\tPseudo.StartUnitTest.App.ClearVariables();\n\t\t\t\tPseudo.StartUnitTest.App.AddVariable(\"i\",\"i\",\"Integer\",{i: false, m:true, o: false});\n\t\t\t\tPseudo.StartUnitTest.App.AddVariable(\"p\",\"p\",\"Integer\",{i: false, m:true, o: false});\n\t\t\t\tPseudo.StartUnitTest.App.AddVariable(\"a\",\"a\",\"Boolean\",{i: false, m:true, o: false}, 10);\n\t\t\t\tPseudo.StartUnitTest.App.Run(\n\t\t\t\t\t\"for I <- 2, 10\\n\" +\n\t\t\t\t\t\" A[I] <- igaz\\n\" +\n\t\t\t\t\t\"for P <- 2, 10\\n\" +\n\t\t\t\t\t\" if A[P] = igaz\\n\" +\n\t\t\t\t\t\" for I<- 2*P, 10, P\\n\" +\n\t\t\t\t\t\" A[I] <- hamis\\n\" +\n\t\t\t\t\t\"For I <- 2, 10\\n\" +\n\t\t\t\t\t\" if A[I] = igaz\\n\" +\n\t\t\t\t\t\" if I <> 2\\n\" +\n\t\t\t\t\t\" KI: \\\", \\\"\\n\" +\n\t\t\t\t\t\" Ki: I\"\n\t\t\t\t, \"\");\n\t\t\t\tPseudo.Options.Log.DisableAll();\n\t\t\t\tjsUnity.assertions.assertEqual(Pseudo.StartUnitTest.Result, \"2, 3, 5, 7\", \"\");\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "516ea29e77220ae39b98f8cfffb7be7d", "score": "0.5290369", "text": "function bigLoop() {\n for (let i = 1; i <= 100; i++) {\n if (i % 3 === 0 && i % 5 == 0) {\n console.log(\"CSC225 RULES I LOVE JAVASCRIPT\");\n } else if (i % 5 === 0) {\n console.log(\"I LOVE JAVASCRIPT\");\n } else if (i % 3 === 0) {\n console.log(\"CSC225 RULES\");\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "090b21c11234df5c9d3f1610f2ca96ed", "score": "0.52878594", "text": "function testTask() {\n console.log('Tests Finished');\n}", "title": "" }, { "docid": "66820a9d1d71cde50ccbc1b22deb7d86", "score": "0.5286361", "text": "function _initExercise() {\n\n var odds = _getOdds(numbers);\n var lowest = _getLowest(numbers);\n var sum = _getSumOfNumbers(numbers);\n var product = _getProductOfNumbers(numbers);\n var longestWord = _getLongestWordLength(copy);\n var longestWordLength = _getWordLength(longestWord);\n var averageWordLength = _getAverageWordLength(copy);\n var sortBy3rdLetter = _sortByThirdLetter(names);\n var moreThan8Words = _isWordWithMoreThan8LettersAvailable(names);\n var everyWord = _areAllWordsLongerThan8Letters(names);\n\n // Prints the result list on screen\n _printMethodsOnPage('result-1', odds);\n _printMethodsOnPage('result-2', lowest);\n _printMethodsOnPage('result-3', sum);\n _printMethodsOnPage('result-4', product);\n _printMethodsOnPage('result-5', longestWord);\n _printMethodsOnPage('result-6', longestWordLength);\n _printMethodsOnPage('result-7', averageWordLength);\n _printMethodsOnPage('result-8', sortBy3rdLetter);\n _printMethodsOnPage('result-9', moreThan8Words);\n _printMethodsOnPage('result-10', everyWord);\n }", "title": "" }, { "docid": "7f7fff8c7d64e0e33b4d2eb70c172abf", "score": "0.5283979", "text": "function calculatingTime(work) {\n var start = new Date();\n work();\n var end = new Date();\n\n var elapsedTime = (end - start) / 1000;\n\n var timeEl = document.getElementById('test-timing'),\n timeInfo = document.createTextNode('Run in ' + elapsedTime.toFixed(4) + ' seconds');\n\n timeEl.appendChild(timeInfo);\n }", "title": "" }, { "docid": "1e6a4e21bc6c6debf72b85772a1a8fb5", "score": "0.5282998", "text": "function runTest(){\n //Run the test life cycle asynchronously so the Browser remains responsive.\n setTimeout(function(){\n switch(currentTestStep){\n case 0: //Runs beforeEach.\n if(currentTestHash.beforeEachTest){\n runBeforeEachSync();\n }else if(currentTestHash.asyncBeforeEachTest){\n runBeforeEachAsync();\n }else{\n currentTestStep++;\n runTest();\n }\n break;\n case 1: //Runs the test.\n if(currentTestHash.isAsync){\n runAsyncTest();\n }else{\n runSyncTest();\n }\n break;\n case 2: //Runs afterEach.\n if(currentTestHash.afterEachTest){\n runAfterEachSync();\n }else if(currentTestHash.asyncAfterEachTest){\n runAfterEachAsync();\n }else{\n currentTestStep++;\n runTest();\n }\n break;\n case 3: //Sets up the processing of the next test to be run.\n testsQueueIndex++;\n testIsRunning = false;\n runTests();\n break;\n }\n }, 1);\n }", "title": "" }, { "docid": "bbb6d35c9925edabd535c05b3528bf43", "score": "0.5281033", "text": "function incorrect() {\n timeRemain -= 10; \n next();\n}", "title": "" }, { "docid": "96c83655a7802122505d40f1a49c0776", "score": "0.5280289", "text": "function Tester(func){\n const VALUE = 1000;\n var count = 0\n \n var startTime = TimeCalculator.now()\n while (count < VALUE){\n ObjectCreator[func]()\n count++\n }\n var stopTime = TimeCalculator.now()\n Report.println(\"start:\\t\" + TimeCalculator.print(startTime))\n Report.println(\"stop:\\t\" + TimeCalculator.print(stopTime))\n Report.println(\"diff:\\t\" + TimeCalculator.print(TimeCalculator.diff(stopTime, startTime)))\n Report.println(\"========\\n\")\n}", "title": "" }, { "docid": "1f6243db6be37a519a88b9ce1f4519a1", "score": "0.5276128", "text": "function doSomeRounds() {\n\t\t\t// decide how many rounds to do\n\t\t\tvar numToRun = Math.min(Math.max(11 * speed-1, 1), rounds - i);\n\t\t\tif (numToRun > 0) {\n\t\t\t\t// do the rounds\n\t\t\t\tgame.run(numToRun);\n\t\t\t\ti += numToRun;\n\t\t\t\tupdateScreen();\n\t\t\t\tif (speed < 6) {\n\t\t\t\t\t// make it a bit slow\n\t\t\t\t\ttimeout = setTimeout(doSomeRounds, 30);\n\t\t\t\t} else {\n\t\t\t\t\t// super fastness\n\t\t\t\t\twindow.postMessage('','*');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttearDown();\n\t\t\t\tonFinish(game.getScore());\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b384a880bf12a51d74f771084c8ba7bc", "score": "0.527446", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleep_in(true, false);\n document.getElementById(\"output\").innerHTML += monkey_trouble(true, false);\n document.getElementById(\"output\").innerHTML += String_times(true, false);\n document.getElementById(\"output\").innerHTML += front_times(true, false);\n document.getElementById(\"output\").innerHTML += String_bits(true, false);\n document.getElementById(\"output\").innerHTML += caughtSpeeding(true, false);\n document.getElementById(\"output\").innerHTML += fizzBuzz(true, false);\n document.getElementById(\"output\").innerHTML += teaParty(true, false);\n document.getElementById(\"output\").innerHTML += blackjack(true, false);\n document.getElementById(\"output\").innerHTML += loneSum(true, false);\n}", "title": "" }, { "docid": "3725fa9c46b1ffff4de02c6aae4be310", "score": "0.5266532", "text": "function main() {\n //let H = parseInt(readLine());\n //let M = parseInt(readLine());\n\n let H = 6;\n let M = parseInt('35');\n\n const mapper = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty'];\n let output = \"\";\n\n if(M === 0) {\n output = `${mapper[H - 1]} o' clock`;\n } else if(M == 15) {\n output = `quarter past ${mapper[H - 1]}`;\n } else if(M >= 1 && M <= 20) {\n output = `${mapper[M - 1]} minute${M !== 1 ? 's' : ''} past ${mapper[H - 1]}`;\n } else if(M >= 21 && M <= 29) {\n output = `twenty ${mapper[(M % 10) - 1]} minutes past ${mapper[H - 1]}`;\n } else if(M == 30) {\n output = `half past ${mapper[H - 1]}`;\n } else if(M == 45) {\n output = `quarter to ${mapper[H]}`;\n } else if(M >= 31 && M <= 38){\n output = `twenty ${mapper[(59 - M) % 10]} minutes to ${mapper[H]}`;\n } else if(M >= 39 && M <= 59){\n output = `${mapper[59 - M]} minutes to ${mapper[H]}`;\n }\n\n console.log(output);\n}", "title": "" }, { "docid": "1491650f115656103a25dd7fd828f0e4", "score": "0.52642083", "text": "function winGenerate(){\n\tcorrectCount++;\n\tsetTimeout(nextQuestion, 200);\n}", "title": "" }, { "docid": "8734bb932292bd1546cc28444c803c91", "score": "0.5263057", "text": "function beginTest() {\n //We're starting the test, so set the variable to true\n hasStarted = true;\n\n //Generate a date value for the current time as a baseline\n day = new Date();\n\n //Count the number of valid words in the testing baseline string\n cnt = strToTestType.split(\" \").length;\n\n //Set the total word count to the number of valid words that need to be typed\n word = cnt;\n //Set the exact time of day that the testing has started\n startType = day.getTime();\n\n //Disable the printing button (if used, in this download it's not included)\n document.getElementById(\"printB\").disabled = true;\n\n calcStat();\n\n //Initialize the testing objects by setting the values of the buttons, what to type, and what is typed\n //document.JobOp.start.value = \"-- Typing Test Started --\";\n document.JobOp.start.disabled = true;\n document.JobOp.given.value = strToTestType;\n document.JobOp.typed.value = \"\";\n\n //Apply focus to the text box the user will type the test into\n document.JobOp.typed.focus();\n document.JobOp.typed.select();\n}", "title": "" }, { "docid": "c6d0e51a9c5dee69845d03dd4855009d", "score": "0.5262597", "text": "function advance() {\n testing_1.tick();\n fixture.detectChanges();\n}", "title": "" }, { "docid": "907c044e9e48a5762f7635efff8de3a7", "score": "0.52617604", "text": "function Counting(){\n for(var i=1; i<=100; i++){\n if(i%5==0 && i%10==0){\n console.log('Coding Dojo');\n }else if(i%5==0){\n console.log('Coding');\n }else{\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "2af50c05a703a2c7316fb92b4de5b00e", "score": "0.5260943", "text": "function OR_MechanicalVentillationHours(TestName)\n{\n var exestatus = true;\n var browser;\n \n //Login\n exestatus = Features.MvLogin(TestName,exestatus);\n \n //Admit a patient in ICU - this is required to load the correct department in Operational reports\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Launch the operational reports\n exestatus = Features.MvLaunchOperationalReports(TestName, browser, exestatus);\n \n //Launch the MechanicalVentillationHours report and note the initial counts\n exestatus = Features.MvExtractInitialOpReports(TestName, browser, exestatus);\n \n //Admit a patient in ICU \n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Invasive ventilation only\n exestatus = Features.MvRecordInvasiveVentilation(TestName,exestatus);\n \n //Non-invasive ventilation only\n exestatus = Features.MvRecordNonInvasiveVentilation(TestName,exestatus);\n \n //High flow only\n exestatus = Features.MvHighFlowVentilation(TestName,exestatus);\n \n //Verify the number of Mechanical Ventillation Hours\n //exestatus = Features.MvVerifyFinalOR(TestName, \"MechanicalVentillationHours\" ,exestatus);\n \n //Logout\n exestatus = Features.MvLogout(TestName,exestatus);\n \n //Close the browser after report is verified\n exestatus = Features.MvBrowserLogout(TestName, browser, exestatus);\n}", "title": "" }, { "docid": "6da0503d98db0d3195400213bf900441", "score": "0.52609307", "text": "function calculateExpectedExerciseProgress(exercise) {\n // Return 100 if past the due date\n if (new Date().getTime() > new Date(exercise.dueDate).getTime()) return 100\n const millisecondsInADay = 1000*60*60*42\n // frequency is included in the model. Will be Daily, Weekly, Bi-Weekly, or X times per week\n const frequency = exercise.frequency\n // progress is included in the model. It indicates how many times the exercise has been completed\n const totalCompletions = exercise.goal\n // Get the day the exercise was assigned\n const assignmentDate = new Date(selectedAssignment.dateAssigned)\n // Get the day the exercise is due\n const dueDate = new Date(exercise.dueDate)\n // Get today's date as a reference point\n const today = new Date()\n // Calculate how many days have passed since the exercise was assigned\n let daysSinceAssignment;\n daysSinceAssignment = (today.getTime() - assignmentDate.getTime()) / millisecondsInADay\n // Calculate how many days there were to complete the assignment\n // let daysToCompleteExercise;\n // daysToCompleteExercise = (dueDate.getTime() - assignmentDate.getTime()) / millisecondsInADay\n // Will indicate how many times the exercise should have been completed\n let expectedCompletions = 0\n switch (frequency) {\n case \"Daily\":\n expectedCompletions = daysSinceAssignment\n break\n case \"Weekly\":\n expectedCompletions = daysSinceAssignment/7\n break\n case \"Bi-Weekly\":\n expectedCompletions = daysSinceAssignment/3.5\n break\n default:\n // X per week case\n const completionsPerWeek = Number(frequency.split(' ')[0])\n expectedCompletions = daysSinceAssignment/(7/completionsPerWeek)\n break\n }\n\n // Return it as a percent\n return 100 * expectedCompletions/totalCompletions\n\n}", "title": "" }, { "docid": "4e48cd03ca129bad630c871bd5575238", "score": "0.5259241", "text": "function runExperiment(trials, workerId, assignmentId, hitId, PORT, FULLSCREEN) {\n disableScrollOnSpacebarPress();\n\n let timeline = [];\n\n // Data that is collected for jsPsych\n let turkInfo = jsPsych.turk.turkInfo();\n let participantID = makeid() + \"iTi\" + makeid();\n\n jsPsych.data.addProperties({\n subject: participantID,\n condition: \"explicit\",\n group: \"shuffled\",\n assginementId: assignmentId,\n hitId: hitId\n });\n\n // sample function that might be used to check if a subject has given\n // consent to participate.\n var check_consent = function (elem) {\n if ($('#consent_checkbox').is(':checked')) {\n return true;\n }\n else {\n alert(\"If you wish to participate, you must check the box next to the statement 'I agree to participate in this study.'\");\n return false;\n }\n return false;\n };\n // declare the block.\n var consent = {\n type: 'external-html',\n url: \"./consent.html\",\n cont_btn: \"start\",\n check_fn: check_consent\n };\n\n timeline.push(consent);\n\n let continue_space =\n \"<div class='right small'>Press SPACE to continue.</div>\";\n\n let instructions = {\n type: \"instructions\",\n key_forward: 'space',\n key_backward: 'backspace',\n pages: [\n `<p>On each page you will see two pictures from the same category e.g., two cats. Your task is simply to decide which of the two pictures is the best example of your idea or image of what the category is. The categories you will see are <b>cats, dogs, birds, fish, cars, trains, planes and boats</b>.\n <p><b>Use the keys 1-5 to respond</b>. You will be asked to about 225 judgments. Please don't spend too much time on any one set of images. Estimated total time is 10-13 minutes. At the end, you will get a completion code. <br><br><b>Please respond carefully. If you miss the attention checks, we may deny payment.</b>\n </p> ${continue_space}`\n ]\n };\n\n timeline.push(instructions);\n\n // keeps track of current trial progression\n // and used for the progress bar\n let progress_number = 1;\n let images = [];\n let num_trials = trials.length;\n\n trials.forEach((trial, index) => {\n // In contrast to progress_number,\n // trial_number is used for recording\n // responses\n const trial_number = index + 1;\n\n images.push(\"images/\" + trial.pic1 + \".png\");\n images.push(\"images/\" + trial.pic2 + \".png\");\n\n // Empty Response Data to be sent to be collected\n let response = {\n workerId: workerId,\n assignmentId: assignmentId,\n hitId: hitId,\n seed: trial.seed,\n Category: trial.Category,\n Subcategory1: trial.Subcategory1,\n Subcategory2: trial.Subcategory2,\n firstStimPosition: trial.firstStimPosition,\n secondStimPosition: trial.secondStimPosition,\n pic1: trial.pic1,\n pic2: trial.pic2,\n expTimer: -1,\n response: -1,\n choice: 'error: no choice selected',\n trial_number: trial_number,\n rt: -1\n };\n\n let leftPic;\n let rightPic;\n if (trial.firstStimPosition === 'left') {\n leftPic = trial.pic1;\n } else if (trial.firstStimPosition === 'right') {\n rightPic = trial.pic1;\n }\n\n if (trial.secondStimPosition === 'left') {\n leftPic = trial.pic2;\n } else if (trial.secondStimPosition === 'right') {\n rightPic = trial.pic2;\n }\n\n let stimulus = `\n <h5 style=\"text-align:center;margin-bottom:20%;margin-top:0;\">Trial ${trial_number} of ${num_trials}</h5>\n <div style=\"width:100%;\">\n <div style=\"width:50%;text-align:center;float:left;\">\n <img src=\"images/${leftPic}.png\" alt=\"${leftPic}\" height=\"200px\" align=\"middle\" style=\"max-width:400px;\"/> \n </div>\n <div style=\"width:50%;text-align:center;float:left;\">\n <img src=\"images/${rightPic}.png\" alt=\"${rightPic}\" height=\"200px\" align=\"middle\" style=\"max-width:400px;width=50%;\" />\n </div>\n </div>\n `;\n\n const choices = [\n \"Left image much more typical\", \n \"Left image slightly more typical\", \n \"Both images equally typical\", \n \"Right image slightly more typical\", \n \"Right image much more typical\",\n ];\n \n let circles = choices.map(choice => {\n return `\n <div class=\"choice\">\n <div class=\"choice-circle empty-circle\"></div>\n <div class=\"text\">${choice}</div>\n </div>\n `;\n });\n\n let prompt = `\n <div class=\"bar\">\n ${circles.join(\"\")}\n </div>\n `;\n\n // Picture Trial\n let pictureTrial = {\n type: \"html-keyboard-response\",\n choices: choices.map((choice, index) => {\n return `${index + 1}`;\n }),\n\n stimulus: stimulus,\n\n prompt: function() {\n return prompt;\n },\n\n on_finish: function(data) {\n response.response = String.fromCharCode(data.key_press);\n response.choice = choices[Number(response.response)-1];\n response.rt = data.rt;\n response.expTimer = data.time_elapsed / 1000;\n\n // POST response data to server\n $.ajax({\n url: \"http://\" + document.domain + \":\" + PORT + \"/data\",\n type: \"POST\",\n contentType: \"application/json\",\n data: JSON.stringify(response),\n success: function() {\n console.log(response);\n }\n });\n }\n };\n timeline.push(pictureTrial);\n\n // let subject view their choice\n let breakTrial = {\n type: \"html-keyboard-response\",\n trial_duration: 500,\n response_ends_trial: false,\n\n stimulus: stimulus,\n\n prompt: function() {\n const circles = choices.map((choice, index) => {\n if (choice == response.choice) {\n return `\n <div class=\"choice\">\n <div class=\"choice-circle filled-circle\"></div>\n <div class=\"text\">${choice}</div>\n </div>\n `;\n }\n return `\n <div class=\"choice\">\n <div class=\"choice-circle empty-circle\"></div>\n <div class=\"text\">${choice}</div>\n </div>\n `;\n });\n\n const prompt = `\n <div class=\"bar\">\n ${circles.join(\"\")}\n </div>\n `;\n return prompt;\n },\n \n on_finish: function() {\n jsPsych.setProgressBar((progress_number - 1) / num_trials);\n progress_number++;\n },\n };\n timeline.push(breakTrial);\n });\n\n\n let questionsInstructions = {\n type: \"instructions\",\n key_forward: 'space',\n key_backward: 'backspace',\n pages: [\n `<p class=\"lead\">We'll now ask you a few demographic questions and we'll be done!\n </p> ${continue_space}`,\n ]\n };\n\n timeline.push(questionsInstructions);\n\n let demographicsTrial = {\n type: 'surveyjs',\n questions: demographicsQuestions,\n on_finish: function (data) {\n let demographicsResponses = data.response;\n console.log(demographicsResponses);\n let demographics = Object.assign({ workerId }, demographicsResponses);\n // POST demographics data to server\n $.ajax({\n url: 'http://' + document.domain + ':' + PORT + '/demographics',\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify(demographics),\n success: function () {\n }\n })\n\n let endmessage = `Thank you for participating! Your completion code is ${participantID}. Copy and paste this in \n MTurk to get paid. \n\n <p>The purpose of this HIT is to assess the extent to which different people agree what makes\n a particular dog, cat, or car typical.\n \n <p>\n If you have any questions or comments, please email [email protected].`;\n jsPsych.endExperiment(endmessage);\n }\n };\n timeline.push(demographicsTrial);\n\n let endmessage = `Thank you for participating! Your completion code is ${participantID}. Copy and paste this in \n MTurk to get paid. \n\n <p>The purpose of this HIT is to assess the extent to which different people agree what makes\n a particular dog, cat, or car typical.\n \n <p>\n If you have any questions or comments, please email [email protected].`;\n\n \n Promise.all(images.map((image, index) => {\n return loadImage(image)\n .catch((error) => {\n console.warn(\"Removing trial with image, \" + image);\n\n // there are twice the number of images than trials\n // we set trial to null so we can cleanly remove\n // it later\n trials[index / 2] = null;\n });\n }))\n .then((images) => {\n trials = trials.filter((trial, index) => {\n return trial !== null;\n });\n startExperiment();\n })\n\n function startExperiment() {\n jsPsych.init({\n timeline: timeline,\n fullscreen: FULLSCREEN,\n show_progress_bar: true,\n auto_update_progress_bar: false\n });\n }\n}", "title": "" } ]
00bd97073a6ba8cd747d1220b2eeb720
Check the winner, checking rows, diagonals and columns of the board.
[ { "docid": "485c100d745a3518318914c00f4535fd", "score": "0.71127015", "text": "function checkWinner(Row, Column, CurrentPlayer) {\n\t\t//checking Row\n\t\tif(Board[Row][0] === Board[Row][1] && Board[Row][0] === Board[Row][2] && Board[Row][0] === CurrentPlayer){\n\t\t\treturn true;\n\t\t}\n\n\t\t//Checking Columns\n\t\tif(Board[0][Column] === Board[1][Column] && Board[0][Column] === Board[2][Column] && Board[0][Column] === CurrentPlayer){\n\t\t\treturn true;\n\t\t}\n\n\t\t//Checking diagonals\n\t\tif(Board[0][0] === Board[1][1] && Board[0][0] === Board[2][2] && Board[0][0] === CurrentPlayer){\n\t\t\treturn true;\n\t\t}else if(Board[0][2] === Board[1][1] && Board[0][2] === Board[2][0] && Board[0][2] === CurrentPlayer){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" } ]
[ { "docid": "4beafc4bfdca6452253aac9a35b28151", "score": "0.8355907", "text": "checkWinner(givenBoard) {\n // Check rows\n let win = false;\n\n const checkEqual = arr => arr.every(v => (v === arr[0] && v !== ''));\n console.log(\"CHECK WINNER.\");\n const board = !givenBoard ? this.state.board : givenBoard;\n for (let i = 0; i < this.width; i++) {\n\n for (let j = 0; j < this.height; j++) {\n\n // Check row win\n if (j <= this.height - 4) {\n //console.log(\"LINE:\" + [board[i][j+1],board[i][j+2],board[i][j+3],board[i][j]]);\n win = checkEqual([board[i][j + 1], board[i][j + 2], board[i][j + 3], board[i][j]]) ? board[i][j] : false;\n if (win !== false) break;\n }\n\n // Check line & diagonal win \n if (i <= this.width - 4) {\n //console.log(\"ROW:\" + [board[i+1][j],board[i+2][j],board[i+3][j],board[i][j]]);\n win = checkEqual([board[i + 1][j], board[i + 2][j], board[i + 3][j], board[i][j]]) ? board[i][j] : false;\n if (win !== false) break;\n\n // Check diagonal line\n if (j <= this.height - 4) {\n win = checkEqual([board[i + 1][j + 1], board[i + 2][j + 2], board[i + 3][j + 3], board[i][j]]) ? board[i][j] : false;\n //console.log(\"MAYBE WIN? \" + [board[i][j],board[i+1][j+1],board[i+2][j+2],board[i+3][j+3]] + \"LINE: \" + i + \",ROW: \" + j);\n if (win !== false) break;\n }\n }\n\n if (i <= this.width - 4 && j >= 3) {\n win = checkEqual([board[i][j], board[i + 1][j - 1], board[i + 2][j - 2], board[i + 3][j - 3]]) ? board[i][j] : false;\n //console.log(\"MAYBE WIN? \" + [board[i + 3][j - 3], board[i + 2][j - 2], board[i + 1][j - 1], board[i][j]] + \"LINE: \" + i + \",ROW: \" + j);\n if (win !== false) break;\n }\n\n\n }\n\n // Break out from second for loop\n if (win !== false) {\n break;\n }\n }\n\n if (win !== false) return win;\n return false;\n }", "title": "" }, { "docid": "256771dcc3a036f8bf519a5d2d14071a", "score": "0.811606", "text": "checkForWin() {\n for (let y = 0; y < this.HEIGHT; y++) {\n for (let x = 0; x < this.WIDTH; x++) {\n // get \"check list\" of 4 cells (starting here) for each of the different\n // ways to win\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n // find winner (only checking each win-possibility as needed)\n if (this.isWin(horiz) \n || this.isWin(vert) \n || this.isWin(diagDR) \n || this.isWin(diagDL)) {\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "f9454fda9ebd78262da8b9aa097173f3", "score": "0.8098863", "text": "function checkWinCondition() {\n // check all combinations for rows/columns\n\n if (checkRows()){\n winner[0] = true\n return true\n }\n\n if (checkColumns()) {\n winner[0] = true\n return true\n }\n // check diagonals\n if(validateWin(2, 4, 6)) {\n winner[0] = true\n return true\n }\n\n if(validateWin(0, 4, 8)) {\n winner[0] = true\n return true\n }\n return false\n}", "title": "" }, { "docid": "2a9601f337b21c691448133d4250f422", "score": "0.80957425", "text": "checkWinner() {\n if (this._board[1][1] !== ' ') { \n if (this._board[1][0] === this._board[1][1] && this._board[1][1] === this._board[1][2] ||\n this._board[0][1] === this._board[1][1] && this._board[1][1] === this._board[2][1] ||\n this._board[0][0] === this._board[1][1] && this._board[1][1] === this._board[2][2] ||\n this._board[2][0] === this._board[1][1] && this._board[1][1] === this._board[0][2]) {\n this._winner = true; \n }\n } \n if (this._board[0][0] !== ' ') {\n if (this._board[0][0] === this._board[0][1] && this._board[0][1] === this._board[0][2] ||\n this._board[0][0] === this._board[1][0] && this._board[1][0] === this._board[2][0]) {\n this._winner = true; \n }\n } \n if (this._board[2][2] !== ' ') {\n if (this._board[2][0] === this._board[2][1] && this._board[2][1] === this._board[2][2] ||\n this._board[0][2] === this._board[1][2] && this._board[1][2] === this._board[2][2]) {\n this._winner = true; \n } \n }\n }", "title": "" }, { "docid": "d8f98a785ef89e1745de0f395d45cfe3", "score": "0.80652034", "text": "checkForWin() {\n const {\n board, currPlayer, height, width,\n } = this;\n const _win = (cells) => cells.every(\n ([y, x]) => y >= 0\n && y < height\n && x >= 0\n && x < width\n && board[y][x] === currPlayer,\n );\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "f051d935358d6d67a8a0f06d0cc95964", "score": "0.8040427", "text": "function checkWin(){\n var winningChecks = [\n [[0,0],[1,1],[2,2]], // top left bottom right diagonal\n [[2,0],[1,1],[0,2]], // top right bottom left diagonal\n [[0,0],[0,1],[0,2]], // Col 1\n [[1,0],[1,1],[1,2]], // Col 2\n [[2,0],[2,1],[2,2]], // Col 3\n [[0,0],[1,0],[2,0]], // Row 1\n [[0,1],[1,1],[2,1]], // Row 2\n [[0,2],[1,2],[2,2]], // Row 3\n ];\n let win = null;\n winningChecks.forEach((c)=>{\n if(currentGrid[c[0][0]][c[0][1]] != 0 && currentGrid[c[0][0]][c[0][1]] == currentGrid[c[1][0]][c[1][1]] && currentGrid[c[0][0]][c[0][1]] == currentGrid[c[2][0]][c[2][1]]){\n // We have a winner\n win = currentGrid[c[0][0]][c[0][1]];\n return;\n }\n });\n if(filledCells == 9){\n // Draw\n win = 0;\n }\n return win;\n}", "title": "" }, { "docid": "714bac0c8ed9ea2eb3e0525e45058cba", "score": "0.7972487", "text": "function isWinner()\n{\n\tvar ok;\n\n\t// check horizontals\n\tfor (var i=0; i<boardlength; i++)\n\t{\n\t\tok = true;\n\t\tfor (var j=0; j<boardwidth-1; j++)\n\t\t{\n\t\t\tif (board[i][j].value != board[i][j+1].value)\n\t\t\t{\n\t\t\t\tok = false;\n\t\t\t}\n\t\t}\n\t\tif (ok)\n\t\t{\n\t\t\t// if i got down here then all cells match so any one sure they're not all blank\n\t\t\tif (board[i][0].value != \"\")\n\t\t\t{\n\t\t\t\thighlightWinner(i,\"row\");\n\t\t\t\treturn board[i][0].value;\n\t\t\t}\n\t\t}\n\t}\n\n\t// check verticals\n\tfor (i=0; i<boardwidth; i++)\n\t{\n\t\tok = true;\n\t\tfor (j=0; j<boardlength-1; j++)\n\t\t{\n\t\t\tif (board[j][i].value != board[j+1][i].value)\n\t\t\t{\n\t\t\t\tok = false;\n\t\t\t}\n\t\t}\n\t\tif (ok)\n\t\t{\n\t\t\t// if i got down here then all cells match so any one sure they're not all blank\n\t\t\tif (board[0][i].value != \"\")\n\t\t\t{\n\t\t\t\thighlightWinner(i,\"col\");\n\t\t\t\treturn board[0][i].value;\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// check diagonal 1\n\tok = true;\n\tfor (i=0;i<boardlength-1;i++)\n\t{\n\t\tif (board[i][i].value != board[i+1][i+1].value)\n\t\t{\n\t\t\tok = false;\n\t\t}\n\n\t}\n\tif (ok)\n\t{\n\t\t// if i got down here then all cells match so any one sure they're not all blank\n\t\tif (board[0][0].value != \"\")\n\t\t{\n\t\t\thighlightWinner(0,\"diag\");\n\t\t\treturn board[0][0].value;\n\t\t}\n\t}\n\n\t// check diagonal 2\n\tok = true;\n\tfor (i=boardlength-1; i>0; i--)\n\t{\n\t\tif (board[i][boardlength-i-1].value != board[i-1][boardlength-i].value)\n\t\t{\n\t\t\tok = false;\n\t\t}\n\n\t}\n\tif (ok)\n\t{\n\t\t// if i got down here then all cells match so any one sure they're not all blank\n\t\tif (board[boardwidth-1][0].value != \"\")\n\t\t{\n\t\t\thighlightWinner(boardlength-1,\"diag\");\n\t\t\treturn board[boardlength-1][0].value;\n\t\t}\n\t}\n\n\treturn \"\";\n}", "title": "" }, { "docid": "0d6fde713c64d119467bf6af1b64504d", "score": "0.79453754", "text": "hasWinner(boardState) {\n //checking if the winner is column\n for (let row = 0; row < 7; row++){\n for (let column = 0; column < 4; column++){\n if (this.isLineWins(boardState[row][column], boardState[row][column+1], boardState[row][column+2], boardState[row][column+3])){\n return boardState[row][column] + ' wins!'\n } \n }\n }\n //checking if the winner is row\n for (let column = 0; column < 6; column++){\n for (let row = 0; row < 4; row++){\n if (this.isLineWins(boardState[row][column], boardState[row+1][column], boardState[row+2][column], boardState[row+3][column])){\n return boardState[row][column] + ' wins!'\n } \n }\n }\n //checking winner for the right diagonal\n for (let column = 0; column < 3; column++){\n for (let row = 0; row < 4; row++){\n if (this.isLineWins(boardState[row][column], boardState[row+1][column+1], boardState[row+2][column+2], boardState[row+3][column+3])){\n return boardState[row][column] + ' wins!'\n }\n } \n }\n //checking winner for the left diagonal\n //fixing 1 off\n for (let column = 0; column <= 4; column++){\n for (let row = 3; row <= 6; row++){\n if (this.isLineWins(boardState[row][column], boardState[row-1][column+1], boardState[row-2][column+2], boardState[row-3][column+3])){\n return boardState[row][column] + ' wins!'\n }\n }\n }\n \n return \"\";\n }", "title": "" }, { "docid": "3239c113ea8db7c97147b5ae51836d6e", "score": "0.79244095", "text": "function checkWinner() {\n for (let i = 0; i < board.length; i++) {\n //horizontal\n if (equal(board[i][0], board[i][1], board[i][2])) {\n addWin();\n drawWin('horizontal', i);\n return true;\n }\n //vertical\n if (equal(board[0][i], board[1][i], board[2][i])) {\n addWin();\n drawWin('vertical', i);\n return true;\n }\n }\n //diagonal l-r\n if (equal(board[0][0], board[1][1], board[2][2])) {\n addWin();\n drawWin('diaL-R', 0);\n return true;\n }\n //diagonal r-l\n if (equal(board[0][2], board[1][1], board[2][0])) {\n addWin();\n drawWin('diaR-L', 0);\n return true;\n }\n //draw\n if (positions.length === 0) {\n winner = 'draw';\n PlayerDraws++;\n drawWin('draw', 0);\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "aeadbb0a6809205367fa4c1b388ffdf4", "score": "0.7898524", "text": "function checkForWin() {\n\n /** _win:\n * takes input array of 4 cell coordinates [ [y, x], [y, x], [y, x], [y, x] ]\n * returns true if all are legal coordinates for a cell & all cells match\n * currPlayer\n */\n function _win(cells) {\n return cells.every(([y, x]) => {\n // check if y and x are in bound with the width and height of the board; and they all match one player;\n return (y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH && board[y][x] === currPlayer);\n })\n }\n\n // using HEIGHT and WIDTH, generate \"check list\" of coordinates\n // for 4 cells (starting here) for each of the different\n // ways to win: horizontal, vertical, diagonalDR, diagonalDL\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n\n // find winner (only checking each win-possibility as needed)\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "4f6bdafb47b708862ae921ceba20fdbd", "score": "0.78960985", "text": "function compWin() {\n var countRow = [0, 0, 0]; //Create count arrays\n var countCol = [0, 0, 0];\n \n for (var b = 0; b < 3; b++) { // Check rows and columns\n for (var a = 0; a < 3; a++) {\n if (board.state[a][b] === \"2\") {\n countRow[a]++;\n countCol[b]++;\n }\n if (countRow[a] === 3)\n won = 2;\n if (countCol[b] === 3)\n won = 2;\n }\n }\n \n // Check both diagonals\n if (board.state[0][0] === \"2\" &&\n board.state[1][1] === \"2\" &&\n board.state[2][2] === \"2\")\n won = 2;\n \n if (board.state[0][2] === \"2\" &&\n board.state[1][1] === \"2\" &&\n board.state[2][0] === \"2\")\n won = 2;\n \n return won;\n }", "title": "" }, { "docid": "ac1e8bde888f37bb622f2209d9c24863", "score": "0.78441447", "text": "function checkWin(board, player) {\n // horizontalCheck \n for (let j = 0; j<numCols-3 ; j++ ){\n for (let i = 0; i<numRows; i++){\n if (board[i][j] == player && board[i][j+1] == player && board[i][j+2] == player && board[i][j+3] == player){\n return true;\n } \n }\n }\n // verticalCheck\n for (let i = 0; i<numRows-3 ; i++ ){\n for (let j = 0; j<numCols; j++){\n if (board[i][j] == player && board[i+1][j] == player && board[i+2][j] == player && board[i+3][j] == player){\n return true;\n } \n }\n }\n // ascendingDiagonalCheck \n for (let i=3; i<numRows; i++){\n for (let j=0; j<numCols-3; j++){\n if (board[i][j] == player && board[i-1][j+1] == player && board[i-2][j+2] == player && board[i-3][j+3] == player)\n return true;\n }\n }\n // descendingDiagonalCheck\n for (let i=3; i<numRows; i++){\n for (let j=3; j<numCols; j++){\n if (board[i][j] == player && board[i-1][j-1] == player && board[i-2][j-2] == player && board[i-3][j-3] == player)\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "8a09ec043c363dce921a705b2ddaf5da", "score": "0.78391373", "text": "checkForWin(y, x) {\n // _win is true if every cell is a valid coordinate played by currPlayer\n const _win = cells =>\n cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < this.height &&\n x >= 0 &&\n x < this.width &&\n this.board[y][x] === this.currPlayer\n );\n // to check if there is a win, we iterate over the entire board to check if there is any win combination for horizonal, vertical, upper-right diagonal, or upper-left diagonal.\n for (let y = this.height - 1; y >= 0; y--) {\n for (let x = this.width - 1; x >= 0; x--) {\n //select 3 squares to the left of this current coordinate\n let horiz = [[y, x], [y, x - 1], [y, x - 2], [y, x - 3]];\n //select 3 squares above this current coordinate\n let vert = [[y, x], [y - 1, x], [y - 2, x], [y - 3, x]];\n //select 3 squares diagonally-right above this current coordinate\n let diagUR = [[y, x], [y - 1, x + 1], [y - 2, x + 2], [y - 3, x + 3]];\n //select 3 squares diagonally-left above this current coordinate\n let diagUL = [[y, x], [y - 1, x - 1], [y - 2, x - 2], [y - 3, x - 3]];\n\n // pass each group of coordindates to _win to confirm if they meet win criteria\n if (_win(horiz) || _win(vert) || _win(diagUR) || _win(diagUL)) {\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "1ef3a04e390076452a9b725bd32ee701", "score": "0.7834239", "text": "checkWin() {\n //find vertical winners\n for (let i = 0; i < this.board.length; i++) {\n let vertOne = true;\n let vertTwo = true;\n for (let j = 0; j < this.board[i].length; j++) {\n if (this.board[i][j] !== 1) {\n vertOne = false;\n }\n if (this.board[i][j] !== 2) {\n vertTwo = false;\n }\n }\n if (vertOne) return 1;\n if (vertTwo) return 2;\n }\n\n let array = this.board;\n\n //transpose array and do it again to find horizontal\n array[0].map((col, i) => array.map(row => row[i]));\n\n //find vertical winners\n for (let i = 0; i < this.board.length; i++) {\n let vertOne = true;\n let vertTwo = true;\n for (let j = 0; j < this.board[i].length; j++) {\n if (this.board[i][j] !== 1) {\n vertOne = false;\n }\n if (this.board[i][j] !== 2) {\n vertTwo = false;\n }\n }\n if (vertOne) return 1;\n if (vertTwo) return 2;\n }\n\n //transpose back\n this.board = array[0].map((col, i) => array.map(row => row[i]));\n\n return -1;\n }", "title": "" }, { "docid": "989a9acf91bcf732d93fab7fb4e2c5e5", "score": "0.78149456", "text": "function checkWin(board) {\n \"use strict\";\n return checkRow(board[0], board[1], board[2]) // rows\n + checkRow(board[3], board[4], board[5])\n + checkRow(board[6], board[7], board[8])\n + checkRow(board[0], board[3], board[6]) // columns\n + checkRow(board[1], board[4], board[7])\n + checkRow(board[2], board[5], board[8])\n + checkRow(board[0], board[4], board[8]) // main diagonal\n + checkRow(board[2], board[4], board[6]); // reverse diagonal\n}", "title": "" }, { "docid": "d8d1cfb67640d7b7e29f9b4da73a97bc", "score": "0.7789041", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n //create arrays for the different type of win conditions\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n //create nested arrays that have coordinates of the horizontal board\n const horiz = [\n [y, x],\n [y, x + 1],\n [y, x + 2],\n [y, x + 3]\n ];\n //nested array with column coordinates\n const vert = [\n [y, x],\n [y + 1, x],\n [y + 2, x],\n [y + 3, x]\n ];\n //nested array with diagonal coordinates going to the right\n const diagDR = [\n [y, x],\n [y + 1, x + 1],\n [y + 2, x + 2],\n [y + 3, x + 3]\n ];\n //nested array with diagonal coordinates going to the left\n const diagDL = [\n [y, x],\n [y + 1, x - 1],\n [y + 2, x - 2],\n [y + 3, x - 3]\n ];\n //if any of these nested arrays contain 4 cells of the same player that player wins\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "ba61827035bc7d5dd9d7648d3307a129", "score": "0.7770274", "text": "function checkWinner() {\n\tif (checkRows() === true || checkCols() === true || checkDiag() === true) {\n\t\twinningPlayer = turn.currentPlayerColor();\n\t\t// Alert winner\n\t\tendGame(\"Player \" + winningPlayer + \", you win!\");\n\t}\n\telse if (checkTie() === true) {\n\t\tendGame(\"It's a tie...\");\n\t}\n\telse {\n\t\tturn.changeTurn();\n\t}\n}", "title": "" }, { "docid": "6c6691c067e7cbdc4fd888ac6685ecc9", "score": "0.77648115", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n // loops through each row, then through each cell\n // determines if the cell is a starting point for a win in:\n // a horizontal manner, comparing current cell to the 3 cells to the right\n // a vertical manner, comparing the current cell to the 3 cells below it\n // a diagonal manner, comparing the current cell to the 3 cells down and to the right\n // a diagonal manner, comparing the current cell to the 3 cells down and to the left\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "5a627ee38bc76bb333af07fdf1110701", "score": "0.7752093", "text": "function checkForWin() {\n\tfunction _win(cells) {\n\t\t// Check four cells to see if they're all color of current player\n\t\t// - cells: list of four (y, x) cells\n\t\t// - returns true if all are legal coordinates & all match currPlayer\n\n\t\treturn cells.every(([ y, x ]) => y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH && htmlBoard[y][x] === currPlayer);\n\t}\n\n\t//look for wins based on piece placement first look across the rows\n\tfor (let y = 0; y < HEIGHT; y++) {\n\t\t//also look across the columns\n\t\tfor (let x = 0; x < WIDTH; x++) {\n\t\t\t//win types\n\t\t\tconst horiz = [ [ y, x ], [ y, x + 1 ], [ y, x + 2 ], [ y, x + 3 ] ];\n\t\t\tconst vert = [ [ y, x ], [ y + 1, x ], [ y + 2, x ], [ y + 3, x ] ];\n\t\t\tconst diagDR = [ [ y, x ], [ y + 1, x + 1 ], [ y + 2, x + 2 ], [ y + 3, x + 3 ] ];\n\t\t\tconst diagDL = [ [ y, x ], [ y + 1, x - 1 ], [ y + 2, x - 2 ], [ y + 3, x - 3 ] ];\n\t\t\t//only check for square if the checkbox is checked\n\t\t\tif (squareCheckbox.checked) {\n\t\t\t\tsquareWin = [ [ y, x ], [ y - 1, x ], [ y - 1, x + 1 ], [ y, x + 1 ] ];\n\t\t\t\tif (_win(squareWin)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//only check for 4 corners win if checkbox is checked\n\t\t\tif (fourCornersCheckbox.checked) {\n\t\t\t\tfourCornsWin = [ [ 0, 0 ], [ 5, 0 ], [ 5, 6 ], [ 0, 6 ] ];\n\t\t\t\tif (_win(fourCornsWin)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if any of the above aside from additional types are true, call win(true)\n\t\t\tif (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ad3bd42a10cce01cb5d098fc16abfcfb", "score": "0.77391666", "text": "checkForWin() {\n const _win = (cells) => {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n \n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < this.height &&\n x >= 0 &&\n x < this.width &&\n this.board[y][x] === this.currPlayer\n );\n }\n \n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const horiz = [\n [y, x], \n [y, x + 1], \n [y, x + 2], \n [y, x + 3]\n ];\n const vert = [\n [y, x], \n [y + 1, x], \n [y + 2, x], \n [y + 3, x]\n ];\n const diagDR = [\n [y, x], \n [y + 1, x + 1], \n [y + 2, x + 2], \n [y + 3, x + 3]\n ];\n const diagDL = [\n [y, x], \n [y + 1, x - 1], \n [y + 2, x - 2], \n [y + 3, x - 3]\n ];\n \n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "f1adcd6bf64307ee41cde729ffb3ee8a", "score": "0.7725089", "text": "function checkWin() {\r\n\tlet cb = []; // current board\r\n\tcb[0] = \"\"; // not going to use\r\n\tcb[1] = document.getElementById(\"one\").innerHTML;\r\n\tcb[2] = document.getElementById(\"two\").innerHTML;\r\n\tcb[3] = document.getElementById(\"thr\").innerHTML;\r\n\tcb[4] = document.getElementById(\"fou\").innerHTML;\r\n\tcb[5] = document.getElementById(\"fiv\").innerHTML;\r\n\tcb[6] = document.getElementById(\"six\").innerHTML;\r\n\tcb[7] = document.getElementById(\"sev\").innerHTML;\r\n\tcb[8] = document.getElementById(\"eig\").innerHTML;\r\n\tcb[9] = document.getElementById(\"nin\").innerHTML;\r\n\r\n\t// top row\r\n\tif (cb [1] != \"\" && cb[1] == cb[2] && cb[2] == cb[3]) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// middle row\r\n\tif (cb [4] != \"\" && cb[4] == cb[5] && cb[5] == cb[6]) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// bottom row\r\n\tif (cb [7] != \"\" && cb[7] == cb[8] && cb[8] == cb[9]) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// left column\r\n\tif (cb [1] != \"\" && cb[1] == cb[4] && cb[4] == cb[7]) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// middle column\r\n\tif (cb [2] != \"\" && cb[2] == cb[5] && cb[5] == cb[8]) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// bottom column\r\n\tif (cb [3] != \"\" && cb[3] == cb[6] && cb[6] == cb[9]) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// \"\\\" diagonal\r\n\tif (cb [1] != \"\" && cb[1] == cb[5] && cb[5] == cb[9]) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// \"/\" diagonal\r\n\tif (cb [3] != \"\" && cb[3] == cb[5] && cb[5] == cb[7]) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n\r\n} // checkWin", "title": "" }, { "docid": "5ce819a392b6c57e94834441ffe0b450", "score": "0.7717585", "text": "function WinCheck(x,y){\r\n \r\n //winning move is 4 vertically stacked chips\r\n if (y <= 2)\r\n {\r\n if (model.board[y][x] == model.board[y+1][x] && model.board[y][x] == model.board[y+2][x] && model.board[y][x] == model.board[y+3][x])\r\n {\r\n isWin = true;\r\n }\r\n }\r\n //winning move is 4 horizontally stacked chips\r\n if (x > 2 && model.board[y][x] == model.board[y][x-1] && model.board[y][x] == model.board[y][x-2] && model.board[y][x] == model.board[y][x-3])\r\n {\r\n isWin= true;\r\n }\r\n if (x > 0 && model.board[y][x] == model.board[y][x-1] && model.board[y][x] == model.board[y][x+1] && model.board[y][x] == model.board[y][x+2])\r\n {\r\n isWin= true;\r\n }\r\n if (x > 1 && model.board[y][x] == model.board[y][x-1] && model.board[y][x] == model.board[y][x-2] && model.board[y][x] == model.board[y][x+1])\r\n {\r\n isWin= true;\r\n }\r\n if (x < 4 && model.board[y][x] == model.board[y][x+1] && model.board[y][x] == model.board[y][x+2] && model.board[y][x] == model.board[y][x+3])\r\n {\r\n isWin= true;\r\n } \r\n //diagonal conditions for rightward facing diagonals\r\n if (x > 2 && y < 3 && model.board[y][x] == model.board[y+1][x-1] && model.board[y][x] == model.board[y+2][x-2] && model.board[y][x] == model.board[y+3][x-3])\r\n {\r\n isWin= true;\r\n }\r\n if (x <6 && x > 1 && y > 0 && y < 4 && model.board[y][x] == model.board[y+1][x-1] && model.board[y][x] == model.board[y+2][x-2] && model.board[y][x] == model.board[y-1][x+1])\r\n {\r\n isWin= true;\r\n }\r\n if (x < 5 && x > 0 && y > 1 && y < 5 && model.board[y][x] == model.board[y+1][x-1] && model.board[y][x] == model.board[y-1][x+1] && model.board[y][x] == model.board[y-2][x+2])\r\n {\r\n isWin= true;\r\n }\r\n if (x < 4 && y > 2 && model.board[y][x] == model.board[y-1][x+1] && model.board[y][x] == model.board[y-2][x+2] && model.board[y][x] == model.board[y-3][x+3])\r\n {\r\n isWin= true;\r\n } \r\n //diagonal condition for leftward facing diagonals\r\n if (x < 4 && y < 3 && model.board[y][x] == model.board[y+1][x+1] && model.board[y][x] == model.board[y+2][x+2] && model.board[y][x] == model.board[y+3][x+3])\r\n {\r\n isWin= true;\r\n }\r\n if (x <5 && x > 0 && y > 0 && y < 4 && model.board[y][x] == model.board[y-1][x-1] && model.board[y][x] == model.board[y+1][x+1] && model.board[y][x] == model.board[y+2][x+2])\r\n {\r\n isWin= true;\r\n }\r\n if (x < 6 && x > 1 && y > 1 && y < 5 && model.board[y][x] == model.board[y+1][x+1] && model.board[y][x] == model.board[y-1][x-1] && model.board[y][x] == model.board[y-2][x-2])\r\n {\r\n isWin= true;\r\n }\r\n if (x > 2 && y > 2 && model.board[y][x] == model.board[y-1][x-1] && model.board[y][x] == model.board[y-2][x-2] && model.board[y][x] == model.board[y-3][x-3])\r\n {\r\n isWin= true;\r\n } \r\n //other stuff\r\n if (movenumber == 42 && isWin == false)\r\n {\r\n boardLock = true;\r\n var ExitC = new Promise ((resolve,reject) => {\r\n setTimeout( () => {resolve()},1000)\r\n \r\n }) \r\n ExitC.then(() => {NoWin()})\r\n }\r\n if (isWin == true)\r\n {\r\n \r\n\r\n if (model.board[y][x] == \"R\") {\r\n boardLock = true;\r\n var ExitC = new Promise ((resolve,reject) => {\r\n setTimeout( () => {resolve()},2000)\r\n \r\n }) \r\n ExitC.then(() => {RedWin()})\r\n }\r\n else \r\n {\r\n boardLock = true;\r\n var ExitC = new Promise ((resolve,reject) => {\r\n setTimeout( () => {resolve()},2000)\r\n \r\n }) \r\n ExitC.then(() => {BlackWin()})\r\n }\r\n \r\n\r\n\r\n\r\n \r\n }\r\n}", "title": "" }, { "docid": "244c57678d76579f59bc6de16d372882", "score": "0.7702972", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n /** for every cell, take it and the three cells to its right\n * and put them in _win function. (some may not be valid cells\n * and beyond the dimensions of the board. For example starting\n * with [5,5] would include [5,6],[5,7],[5,8], the last of\n * which would not be on the board and would not pass the\n * cells.every condition no matter what.) */\n let horiz = [\n [y, x],\n [y, x + 1],\n [y, x + 2],\n [y, x + 3],\n ];\n //for every cell, take it and the three cells below and put them in _win function.\n let vert = [\n [y, x],\n [y + 1, x],\n [y + 2, x],\n [y + 3, x],\n ];\n //for every cell, take it and the three cells diagonally down and right and put in _win function.\n let diagDR = [\n [y, x],\n [y + 1, x + 1],\n [y + 2, x + 2],\n [y + 3, x + 3],\n ];\n //for every cell, take it and the three cells diagonally down and right and put in _win function.\n let diagDL = [\n [y, x],\n [y + 1, x - 1],\n [y + 2, x - 2],\n [y + 3, x - 3],\n ];\n /**If we have four in a row in any orientation, within the board dimensions,\n * and all belonging to the same player, checkForWin() returns true.*/\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "18b1e2d02ed59a651c133c230e90bc10", "score": "0.7688474", "text": "function checkForWin() {\n\tfunction _win(cells) {\n\t\treturn cells.every(([ y, x ]) => y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH && board[y][x] === currPlayer);\n\t}\n\n\t// Defining what a win is....\n\tfor (let y = 0; y < HEIGHT; y++) {\n\t\tfor (let x = 0; x < WIDTH; x++) {\n\t\t\tlet horiz = [ [ y, x ], [ y, x + 1 ], [ y, x + 2 ], [ y, x + 3 ] ];\n\t\t\tlet vert = [ [ y, x ], [ y + 1, x ], [ y + 2, x ], [ y + 3, x ] ];\n\t\t\tlet diagDR = [ [ y, x ], [ y + 1, x + 1 ], [ y + 2, x + 2 ], [ y + 3, x + 3 ] ];\n\t\t\tlet diagDL = [ [ y, x ], [ y + 1, x - 1 ], [ y + 2, x - 2 ], [ y + 3, x - 3 ] ];\n\n\t\t\tif (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7104f20e0fddbd4e7a8703c81fdd24d9", "score": "0.7685096", "text": "function diagnalWin() {\r\n for (x = 0; x < 4; x++) {\r\n for (j = 0; j < 3; j++) {\r\n if (board[x][j].color != \"\") {\r\n if (board[x][j].color == board[x + 1][j + 1].color) {\r\n if (board[x][j].color == board[x + 2][j + 2].color) {\r\n if (board[x][j].color == board[x + 3][j + 3].color) {\r\n for (k = 0; k < 4; k++) {\r\n winningCells.push(board[x + k][j + k]);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n for (x = 6; x > 2; x--) {\r\n for (j = 0; j < 3; j++) {\r\n if (board[x][j].color != \"\") {\r\n if (board[x][j].color == board[x - 1][j + 1].color) {\r\n if (board[x][j].color == board[x - 2][j + 2].color) {\r\n if (board[x][j].color == board[x - 3][j + 3].color) {\r\n for (k = 0; k < 4; k++) {\r\n winningCells.push(board[x - k][j + k]);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "afdf2464ca3c87d74e7bcf6292408e6b", "score": "0.7644941", "text": "function checkWin() {\n\t\t// Loop all rows and columns\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t\tvar allCheckedRow = true;\n\t\t\tvar allCheckedCol = true;\n\n\t\t\t// Loop all cells in row can column\n\t\t\tfor (var j = 0; j < 5; j++) {\n\t\t\t\t// Row\n\t\t\t\tif (!bingoBoard[i * 5 + j].checked) {\n\t\t\t\t\tallCheckedRow = false;\n\t\t\t\t}\n\n\t\t\t\t// Column\n\t\t\t\tif (!bingoBoard[j * 5 + i].checked) {\n\t\t\t\t\tallCheckedCol = false;\n\t\t\t\t}\n\n\t\t\t\tif (!allCheckedRow && !allCheckedCol) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if all rows were active\n\t\t\tif (allCheckedRow || allCheckedCol) {\n\t\t\t\treturn win();\n\t\t\t}\n\t\t}\n\n\t\t// Check cross\n\t\tvar indexes = [\n\t\t\t[1, 7, 13, 19, 25],\n\t\t\t[5, 9, 13, 17, 21]\n\t\t];\n\n\t\t\n\t\tfor (var i = 0; i < indexes.length; i++) {\n\t\t\tvar allChecked = true;\n\t\t\tfor (var j = 0; j < indexes[i].length; j++) {\n\t\t\t\tif (!bingoBoard[indexes[i][j] - 1].checked) {\n\t\t\t\t\tallChecked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (allChecked) {\n\t\t\t\treturn win();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ef96bde70b74bd2bbadf44d4eaa730e0", "score": "0.7644116", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n // the moves are legal && the currPlayer\n // has claimed each piece\n board[y][x] === currPlayer\n );\n }\n\n // start by iterating over the game board\n // at each x,y combo, set relative 'winning' arrays\n\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n const horiz = [\n [y, x],\n [y, x + 1],\n [y, x + 2],\n [y, x + 3],\n ];\n const vert = [\n [y, x],\n [y + 1, x],\n [y + 2, x],\n [y + 3, x],\n ];\n const diagDR = [\n [y, x],\n [y + 1, x + 1],\n [y + 2, x + 2],\n [y + 3, x + 3],\n ];\n const diagDL = [\n [y, x],\n [y + 1, x - 1],\n [y + 2, x - 2],\n [y + 3, x - 3],\n ];\n\n // if any of these winning arrays contain exclusively 'currPlayer'\n // i.e. all x,y combos were picked by the current player\n // return true to end the game (within handleClick)\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "d4409fbc01f19fef999bae31830021cf", "score": "0.7624508", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n//checks to make sure the pieces are within the board and the piece corresponds to the player\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n //goes through 'rows' in the board\n for (var y = 0; y < HEIGHT; y++) {\n //goes through each cell within the 'rows'\n for (var x = 0; x < WIDTH; x++) {\n //defines the various ways the pieces will connect four times\n var horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n var vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n var diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n var diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n //if any of the variables are true, return true;\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "85cf096e0544c935c654c9bd5ee41a8c", "score": "0.76170105", "text": "function checkWin(boardMoves){\n //check if someone won\n let vals = [true,false];\n let allNotNull = true;\n for(let k = 0;k<vals.length;k++){\n let value = vals[k];\n //check rows, columns, and diagonals\n let diagComplete1=true;\n let diagComplete2=true;\n\n for(let i = 0;i<3;i++){\n //check left to right diagnals\n if(boardMoves[i][i]!=value){\n diagComplete1 = false;\n }\n //check right to left diagnals\n if(boardMoves[2-i][i]!=value){\n diagComplete2 = false;\n }\n\n //now look at rows/columns\n let rowComplete = true;\n let colComplete = true;\n for(let j = 0 ; j<3;j++){\n //check rows\n if(boardMoves[i][j]!=value){\n rowComplete = false;\n }\n //check columns\n if(boardMoves[j][i]!=value){\n colComplete = false;\n }\n if(boardMoves[i][j] == null){\n allNotNull = false;\n }\n }\n if(rowComplete || colComplete){\n return value ? 1:0;\n }\n }\n if(diagComplete1 || diagComplete2){\n return value ? 1:0;\n }\n }\n if(allNotNull){\n return -1;\n }\n return null;\n }", "title": "" }, { "docid": "37949c56f2abb12b9bf765f67df24519", "score": "0.76093704", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < boardHeight &&\n x >= 0 &&\n x < boardWidth &&\n board[y][x] === currPlayer\n );\n }\n\n // check connections of cell in four way when fill the cell\n // return tree if find one connection in four ways\n for (let y = 0; y < boardHeight; y++) {\n for (let x = 0; x < boardWidth; x++) {\n const horiz = [\n [y, x],\n [y, x + 1],\n [y, x + 2],\n [y, x + 3],\n ];\n const vert = [\n [y, x],\n [y + 1, x],\n [y + 2, x],\n [y + 3, x],\n ];\n const diagDR = [\n [y, x],\n [y + 1, x + 1],\n [y + 2, x + 2],\n [y + 3, x + 3],\n ];\n const diagDL = [\n [y, x],\n [y + 1, x - 1],\n [y + 2, x - 2],\n [y + 3, x - 3],\n ];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "fbfa4cb843db7d937c619ff64bf07871", "score": "0.76044714", "text": "checkGameResult() {\n // Don't perform winning check until at least 5 moves.\n // 5 moves mean that X has moved 3 times and O only 2 times.\n if (this.state.roundMovesPerIndex.length < ((Game.BOARD_SIZE * 2) - 1)) {\n return GameResult.PLAYING;\n }\n for (let i = 0; i < Game.BOARD_SIZE; i++) {\n // Check rows.\n const rows = utils_1.unique(this.state.boardMatrix[i]);\n if (rows.length === 1 && rows[0] !== Player.NONE) {\n this.state.winner = this.getCurrentPlayerLabel();\n this.state.winningTiles = [[i, 0], [i, 1], [i, 2]];\n this.state.result = GameResult.WIN;\n return GameResult.WIN;\n }\n // Check columns.\n const columns = utils_1.unique([this.state.boardMatrix[0][i], this.state.boardMatrix[1][i], this.state.boardMatrix[2][i]]);\n if (columns.length === 1 && columns[0] !== Player.NONE) {\n this.state.winner = this.getCurrentPlayerLabel();\n this.state.winningTiles = [[0, i], [1, i], [2, i]];\n this.state.result = GameResult.WIN;\n return GameResult.WIN;\n }\n }\n // Check diags.\n const diag1 = utils_1.unique([this.state.boardMatrix[0][0], this.state.boardMatrix[1][1], this.state.boardMatrix[2][2]]);\n if (diag1.length === 1 && diag1[0] !== Player.NONE) {\n this.state.winner = this.getCurrentPlayerLabel();\n this.state.winningTiles = [[0, 0], [1, 1], [2, 2]];\n this.state.result = GameResult.WIN;\n return GameResult.WIN;\n }\n const diag2 = utils_1.unique([this.state.boardMatrix[0][2], this.state.boardMatrix[1][1], this.state.boardMatrix[2][0]]);\n if (diag2.length === 1 && diag2[0] !== Player.NONE) {\n this.state.winner = this.getCurrentPlayerLabel();\n this.state.winningTiles = [[0, 2], [1, 1], [2, 0]];\n this.state.result = GameResult.WIN;\n return GameResult.WIN;\n }\n if (this.state.roundMovesPerIndex.length === Game.BOARD_SIZE * Game.BOARD_SIZE) {\n this.state.result = GameResult.DRAW;\n return GameResult.DRAW;\n }\n return GameResult.PLAYING;\n }", "title": "" }, { "docid": "686ffeeb95b4e64cd7f954e1bc8e467b", "score": "0.7593184", "text": "checkForWin(row, col){\n\n //diagonal wins check\n //diagonal wins from LEFT TO RIGHT check\n if(row == col){\n\n //see if middle cell is filled\n if(row==1 && col==1){\n //if middle is filled increment both diagonal counters\n (this.state.board[row][col] == 'X') ? this.lrdiagonal++ : this.lrdiagonal--; \n (this.state.board[row][col] == 'X') ? this.rldiagonal++ : this.rldiagonal--;\n }\n else{\n //if not cell, adjust LR diagonal counters\n (this.state.board[row][col] == 'X') ? this.lrdiagonal++ : this.lrdiagonal--;\n } \n if (this.lrdiagonal == 3) { \n //X WINS by LR diagonal! \n this.setState({winner:'X'});\n }\n if (this.lrdiagonal == -3) { \n //O WINS by LR diagonal\n this.setState({winner:'O'});\n }\n }\n\n \n //RIGHT TO LEFT DIAGONAL CHECK\n if((row == 0 && col==2) || (row == 2 && col==0)) {\n\n (this.state.board[row][col] == 'X') ? this.rldiagonal++ : this.rldiagonal--;\n\n if (this.rldiagonal == 3) { \n //X WINS RL Diagonal! \n this.setState({winner:'X'});\n }\n if (this.rldiagonal == -3) { \n //O WINS by RL diagonal! \n this.setState({winner:'O'});\n }\n }\n\n \n //check for wins across columns and rows\n if(this.state.turn == 'X'){\n this.RowCount[row]++;\n this.ColCount[col]++;\n\n if (this.RowCount[row] == 3 || this.ColCount[col] == 3 ){\n //X WINS!!\n this.setState({winner:'X'});\n }\n }\n else{\n this.RowCount[row]--;\n this.ColCount[col]--;\n\n if (this.RowCount[row] == -3 || this.ColCount[col] == -3 ){\n //O WINS!!\n this.setState({winner:'O'});\n }\n }\n\n }", "title": "" }, { "docid": "c930e56d37994046eccec6265a22f173", "score": "0.75786865", "text": "function winCheck(playerValue) {\n // check logic for right or left diagonal\n let isLeftDiaglonal = true;\n let isRightDiaglonal = true;\n for (let i = 0; i < GRID_LENGTH; i++) {\n if (grid[i][i] != playerValue) {\n isLeftDiaglonal = false;\n }\n if (grid[i][grid.length - 1 - i] != playerValue) {\n isRightDiaglonal = false;\n }\n }\n \n if (isLeftDiaglonal || isRightDiaglonal) {\n return true;\n }\n \n // check row or column are same\n \n for (let i = 0; i < GRID_LENGTH; i++) {\n let isRow = true;\n let isColumn = true;\n for (let j = 0; j < GRID_LENGTH; j++) {\n if (grid[i][j] != playerValue) {\n isRow = false;\n }\n if (grid[j][i] != playerValue) {\n isColumn = false;\n }\n }\n if (isRow || isColumn) {\n return true;\n }\n }\n \n return false;\n }", "title": "" }, { "docid": "53d893dca23f200a13fc971742e7f738", "score": "0.75697297", "text": "function CheckWinner (player) {\n\n /* THIS WAS THE ORIGINAL ALGORITHM AND IT WORKS HORIZONTALLY AND VERTICALLY\n BUT FOUND THAT THE DIAGONAL WAS CONFUSING TO TEST, SO I'VE READJUSTED THE\n ALGORITHM TO BE MORE EXPRESSIVE RATHER THAN MATHEMATICAL :)\n\n for(var i=0;i<6;i++) { \n for(var j=0;j<7;j++) {\n if (vm.Rows[i][j] == player) {\n vm.count++; \n if (vm.count >= 4) {\n console.log('horzontal win');\n return true;\n }\n }\n else {\n vm.count = 0;\n }\n }\n }*/ \n\n // Finally, let's work our way over each cell to check for a winner in one step now.\n // We start at the bottom left, and work to our top right, we don't ignore impossible\n // options for winning as this allows us to expand the connect four grid if we want. \n \n for(var r=0;r<6;r++) { \n for(var c=0;c<7;c++) { \n\n // Horizonal win check\n if (vm.Rows[r][c] == player &&\n vm.Rows[r][c+1] == player &&\n vm.Rows[r][c+2] == player &&\n vm.Rows[r][c+3] == player) {\n return true;\n }\n\n // Now the vertical\n if (vm.Rows[r][c] == player &&\n (typeof vm.Rows[r+1] !== 'undefined') && vm.Rows[r+1][c] == player &&\n (typeof vm.Rows[r+2] !== 'undefined') && vm.Rows[r+2][c] == player &&\n (typeof vm.Rows[r+3] !== 'undefined') && vm.Rows[r+3][c] == player) {\n return true;\n }\n \n // Diagonal, up to the right\n if (vm.Rows[r][c] == player &&\n (typeof vm.Rows[r+1] !== 'undefined') && vm.Rows[r+1][c+1] == player &&\n (typeof vm.Rows[r+2] !== 'undefined') && vm.Rows[r+2][c+2] == player &&\n (typeof vm.Rows[r+3] !== 'undefined') && vm.Rows[r+3][c+3] == player) {\n return true;\n }\n\n // Diagonal, down to the right\n if (vm.Rows[r][c] == player &&\n (typeof vm.Rows[r-1] !== 'undefined') && vm.Rows[r-1][c+1] == player &&\n (typeof vm.Rows[r-2] !== 'undefined') && vm.Rows[r-2][c+2] == player &&\n (typeof vm.Rows[r-3] !== 'undefined') && vm.Rows[r-3][c+3] == player) {\n return true;\n } \n \n }\n }\n return false;\n }", "title": "" }, { "docid": "9bfcb64c6a116c03c2dc46df57adfd87", "score": "0.7548286", "text": "isWinner() {\n // Check diagonal down\n let firstSquare = this.squares[0][0];\n if (firstSquare !== ' ') {\n for (let i = 1; i < this.size; i++) {\n if (this.squares[i][i] !== firstSquare) {\n break;\n } else if (i + 1 === this.size) {\n return firstSquare; // Return winner's letter\n }\n }\n }\n\n // Check diagonal up\n firstSquare = this.squares[this.size - 1][0];\n if (firstSquare !== ' ') {\n for (let i = 1; i < this.size; i++) {\n if (this.squares[this.size - 1 - i][i] !== firstSquare) {\n break;\n } else if (i + 1 === this.size) {\n return firstSquare; // Return winner's letter\n }\n }\n }\n\n // Check rows\n for (let i = 0; i < this.size; i++) {\n firstSquare = this.squares[i][0];\n if (firstSquare !== ' ') {\n for (let j = 0; j < this.size; j++) {\n if (this.squares[i][j] !== firstSquare) {\n break;\n } else if (j + 1 === this.size) {\n return firstSquare; // Return winner's letter\n }\n }\n }\n }\n\n // Check cols\n for (let i = 0; i < this.size; i++) {\n firstSquare = this.squares[0][i];\n if (firstSquare !== ' ') {\n for (let j = 0; j < this.size; j++) {\n if (this.squares[j][i] !== firstSquare) {\n break;\n } else if (j + 1 === this.size) {\n return firstSquare; // Return winner's letter\n }\n }\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "cac58230b46922055c016146a42b9291", "score": "0.7535821", "text": "function checkGameState () {\n let gameover = false; \n // check row win\n for (var i = 0; i < size; i++) {\n let p1count = 0;\n let p2count = 0;\n\n for (var j = 0; j < size; j++) {\n if (board[i][j] == p1.playerType) \n p1count++;\n else if (board[i][j] == p2.playerType)\n p2count++;\n }\n\n if (p1count == size) {\n gameover = true;\n winner = p1;\n return gameover;\n }\n\n else if (p2count == size) {\n gameover = true;\n winner = p2;\n return gameover;\n }\n }\n\n // check col win\n for (var i = 0; i < size; i++) {\n let p1count = 0;\n let p2count = 0;\n\n for (var j = 0; j < size; j++) {\n if (board[j][i] == p1.playerType) \n p1count++;\n else if (board[j][i] == p2.playerType)\n p2count++;\n }\n\n if (p1count == size) {\n gameover = true;\n winner = p1;\n return gameover;\n }\n\n else if (p2count == size) {\n gameover = true;\n winner = p2;\n return gameover;\n }\n }\n\n // check left diagonal\n let p1count = 0;\n let p2count = 0;\n for (var i = 0, j = 0; i < size && j < size; i++, j++) {\n if (board[i][j] == p1.playerType) \n p1count++;\n else if (board[i][j] == p2.playerType)\n p2count++;\n }\n\n if (p1count == size) {\n gameover = true;\n winner = p1;\n return gameover;\n }\n\n else if (p2count == size) {\n gameover = true;\n winner = p2;\n return gameover;\n }\n\n // check right diagonal\n p1count = 0;\n p2count = 0;\n\n for (var i = 0, j = 2; i < size; i++, j--) {\n if (board[i][j] == p1.playerType) \n p1count++;\n else if (board[i][j] == p2.playerType)\n p2count++;\n }\n\n if (p1count == size) {\n gameover = true;\n winner = p1;\n return gameover;\n }\n\n else if (p2count == size) {\n gameover = true;\n winner = p2;\n return gameover;\n }\n\n return gameover;\n }", "title": "" }, { "docid": "630b4d9a83b846c56926448ada5acccd", "score": "0.7527566", "text": "checkWin() {\n // check rows\n for (let i = 0; i < 3; i++) {\n if (this.gameboard[i*3] != '' &&\n this.gameboard[i*3] == this.gameboard[i*3+1] &&\n this.gameboard[i*3+1] == this.gameboard[i*3+2])\n {\n return 'win'\n }\n }\n\n // check columns\n for (let i = 0; i < 3; i++) {\n if (this.gameboard[i] != '' &&\n this.gameboard[i] == this.gameboard[i+3] &&\n this.gameboard[i+3] == this.gameboard[i+6] )\n {\n return 'win'\n }\n }\n\n // check diagonals\n if (this.gameboard[0] != '' &&\n this.gameboard[0] == this.gameboard[4] &&\n this.gameboard[4] == this.gameboard[8])\n {\n return 'win'\n }\n\n if (this.gameboard[2] != '' &&\n this.gameboard[2] == this.gameboard[4] &&\n this.gameboard[4] == this.gameboard[6])\n {\n return 'win'\n }\n\n // check if is a draw\n if (!this.gameboard.includes('')) {\n return 'draw';\n }\n\n return '';\n }", "title": "" }, { "docid": "c4f11a2dace892fb5bf8488db15120ee", "score": "0.75146997", "text": "function checkWon() {\n // Horizontal\n for (let row = 0; row < 3; row++) {\n let count = 0;\n for (let col = 0; col < 3; col++) {\n if (gameboard[row][col] == currentPlayer) {\n count++;\n }\n }\n if (count == 3) {\n return true;\n }\n count = 0;\n }\n\n // Vertical\n for (let col = 0; col < 3; col++) {\n let count = 0;\n for (let row = 0; row < 3; row++) {\n if (gameboard[row][col] == currentPlayer) {\n count++;\n }\n }\n if (count == 3) {\n return true;\n }\n count = 0;\n }\n\n // Diagonal\n if (gameboard[0][0] == currentPlayer && \n gameboard[1][1] == currentPlayer &&\n gameboard[2][2] == currentPlayer) {\n return true;\n }\n\n if (gameboard[0][2] == currentPlayer && \n gameboard[1][1] == currentPlayer &&\n gameboard[2][0] == currentPlayer) {\n return true;\n }\n\n return false\n}", "title": "" }, { "docid": "57bd061f6fd545fc3ac675e44b8b0ebc", "score": "0.75109255", "text": "function checkWin(element, marker) {\n let row = element.id[4];\n let col = element.id[5];\n\n //Check row in which the cell was clicked\n for (let i = 1; i < 4; i++) {\n if (!$(\"#cell\" + row + \"\" + i).hasClass(marker)) break;\n win = (i === 3) ? true : false;\n }\n if (win === true) {\n setTimeout(() => {\n for (let i = 1; i < 4; i++) {\n $(\"#cell\" + row + i).addClass(\"winner\"); //Highlight the winning row or column or diagonal by adding the winner class\n }\n }, 500);\n return true;\n }\n\n //Check column in which the cell was clicked\n for (let i = 1; i < 4; i++) {\n if (!$(\"#cell\" + i + \"\" + col).hasClass(marker)) break;\n win = (i === 3) ? true : false;\n }\n if (win === true) {\n setTimeout(() => {\n for (let i = 1; i < 4; i++) {\n $(\"#cell\" + i + col).addClass(\"winner\");\n }\n }, 500)\n return true;\n }\n\n //Check the first diagonal from left to right (Diagonals are checked regardless of the fact the cell is central or not)\n for (let i = 1; i < 4; i++) {\n if (!$(\"#cell\" + i + \"\" + i).hasClass(marker)) break;\n win = (i === 3) ? true : false;\n }\n if (win === true) {\n setTimeout(() => {\n for (let i = 1; i < 4; i++) {\n $(\"#cell\" + i + i).addClass(\"winner\");\n }\n }, 500)\n return true;\n }\n\n //Check the second diagonal from right to left\n if ($(\"#cell13\").hasClass(marker)) {\n if ($(\"#cell22\").hasClass(marker)) {\n if ($(\"#cell31\").hasClass(marker)) {\n win = true;\n }\n }\n }\n if (win === true) {\n setTimeout(() => {\n $(\"#cell13\").addClass(\"winner\");\n $(\"#cell22\").addClass(\"winner\");\n $(\"#cell31\").addClass(\"winner\");\n }, 500)\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "22cf663b0f27d410c5347bc44a820ee2", "score": "0.7507991", "text": "function check_Winning_State(board){\n check_Left_Diagonal_Win(board);\n check_Right_Diagonal_Win(board);\n check_Vertical_Win1(board);\n check_Vertical_Win2(board);\n check_Vertical_Win3(board);\n check_Horizontal_Win1(board);\n check_Horizontal_Win2(board);\n check_Horizontal_Win3(board);\n}", "title": "" }, { "docid": "6f95c54ad6c10f7de560a24f94f6d90a", "score": "0.7480254", "text": "function checkWinner() {\n console.log(\"checkWinner was called\");\n\n if (turns === 9) {\n console.log(\"It's a draw!\");\n }\n\n //Horizontal win\n let cScore =0;\n let nScore = 0;\n for (let i = 0; i < myBoard.length; i++) {\n for (let j = 0; j < myBoard[i].length; j++) {\n if (myBoard[i][j] === \"cross\") {\n cScore++;\n } else if (myBoard[i][j] === \"nought\") {\n nScore++;\n }\n }\n\n //these checks could be removed into one function \n if (cScore === 3) {\n crossWins = true;\n //return true;\n } \n if (nScore === 3) { \n noughtWon = true\n }\n cScore =0;\n nScore =0;\n }\n //Vertical wins\n cScore = 0\n nScore = 0\n //loops each row\n let curCol = 0;\n for (let j = 0; j < myBoard.length; j++) {\n for (let i = 0; i < myBoard.length; i++) {\n\n if (myBoard[i][j] === \"cross\") {\n cScore++;\n } else if (myBoard[i][j] === \"nought\") {\n nScore++;\n }\n \n\n if (cScore === 3) {\n crossWon = true\n \n } \n if (nScore === 3) {\n noughtWon = true\n }\n }\n nScore = 0;\n cScore = 0;\n }\n\n //Right Diaganol win\n if (myBoard[0][0] === myBoard[1][1] && myBoard[0][0] === myBoard[2][2]) {\n if(myBoard[0][0] === \"cross\") {\n console.log(\"crosses Win\");\n crossWon = true\n } else if (myBoard[0][0] === \"nought\") {\n console.log(\"noughts win\");\n noughtWon = true\n }\n } \n\n if (myBoard[0][2] === myBoard[1][1] && myBoard[1][1] === myBoard[2][0]) {\n if(myBoard[1][1] === \"cross\") {\n crossWon = true\n } else if (myBoard[1][1] === \"nought\") {\n noughtWon = true\n }\n } \n //playerScore()\n // if (crossWon){\n // crossWins++\n // crossWon = false\n // console.log(\"Crosses Wins!\" + crossWins)\n // } else if (noughtWon) {\n // noughtWins++\n // noughtsWon = false\n // console.log(\"Noughts Wins!\" + noughtWins)\n // }\n return null;\n}", "title": "" }, { "docid": "9e88bf51c61f50ba2419a922ae198342", "score": "0.7438602", "text": "function checkBoard(marker) {\n console.log(\"check for winner\", marker); \n let winner = false;\n if (board[0] === marker && board[1] === marker && board[2] === marker){\n winner = true;\n console.log(\"row1\");\n } else if (board[3] === marker && board[4] === marker && board[5] === marker) {\n winner = true;\n console.log(\"row2\");\n } else if (board[6] === marker && board[7] === marker && board[8] === marker) {\n winner = true;\n console.log(\"row3\");\n } else if (board[0] === marker && board[3] === marker && board[6] === marker) {\n winner = true;\n console.log(\"col1\");\n } else if (board[1] === marker && board[4] === marker && board[7] === marker) {\n winner = true;\n console.log(\"col2\");\n } else if (board[2] === marker && board[5] === marker && board[8] === marker) {\n winner = true;\n console.log(\"col3\");\n } else if (board[0] === marker && board[4] === marker && board[8] === marker) {\n winner = true;\n console.log(\"dia1\");\n } else if (board[2] === marker && board[4] === marker && board[6] === marker) {\n winner = true;\n console.log(\"dia2\");\n }\n return winner;\n }", "title": "" }, { "docid": "8234411ce0c68f20fda5b2a6cc8d2d3e", "score": "0.74291784", "text": "function checkDiagDownWin() {\nfor (var y = 0; y <= 2; y++) {\n for (var x = 0; x <= 3; x++) {\n if (board[y][x] != 0 &&\n board[y][x] == board[y+1][x+1] &&\n board[y][x] == board[y+2][x+2] &&\n board[y][x] == board[y+3][x+3]) {\n return (currentPlayer);\n }\n }\n }\n}", "title": "" }, { "docid": "f553a721ef95b2f50120a386425a8e9d", "score": "0.74289846", "text": "checkWinner() {\n // if the grid is non existent or size of array is 0\n if (this.grid === undefined || this.grid === [] || this.grid.length == 0) {\n return null;\n } else {\n let i;\n for (i = 0; i < this.grid.length; i++) {\n if (!this.grid[i].state) {\n return '-';\n }\n }\n }\n // the array consists on 9 fields with index 0 to 8\n // winning horizontals cells are 0,1,2 and 3,4,5 and 6,7,8\n if (this.isRowEqual(0) === this.playerX\n || this.isRowEqual(1) === this.playerX || this.isRowEqual(2) === this.playerX) {\n return this.playerX;\n }\n if (this.isRowEqual(0) === this.playerO\n || this.isRowEqual(1) === this.playerO\n || this.isRowEqual(2) === this.playerO) {\n return this.playerO;\n }\n\n // winning vertical cells are 0,3,6 and 1,4,7 and 2,5,8\n if (this.isColEqual(0) === this.playerX\n || this.isColEqual(1) === this.playerX\n || this.isColEqual(2) === this.playerX) {\n return this.playerX;\n }\n if (this.isColEqual(0) === this.playerO\n || this.isColEqual(1) === this.playerO\n || this.isColEqual(2) === this.playerO) {\n return this.playerO;\n }\n if (this.isDiagonalEqual() === this.playerX) {\n return this.playerX;\n }\n if (this.isDiagonalEqual() === this.playerO) {\n return this.playerO;\n }\n\n\n return '-';\n }", "title": "" }, { "docid": "75ae4962c4cb3f804e487551106de8e3", "score": "0.7416156", "text": "function verifyWin(){\n let row, column, result;\n for(row = 0; row < 3; row++){ // win in the rows\n if((game[row][0] === game[row][1] && game[row][1] === game[row][2])){\n result = game[row][0];\n }\n\n }\n for(column = 0; column < 3; column++){ // win in the column\n if((game[0][column] === game[1][column] && game[1][column] === game[2][column])){\n result = game[0][column];\n }\n\n }\n // MAIN DIAGONAL \n if(game[0][0] === game[1][1] && game[1][1] === game[2][2]){\n result = game[0][0];\n }\n \n // SECOND DIAGONAL\n\n if(game[0][2] === game[1][1] && game[1][1] === game[2][0]){\n result = game[0][2];\n }\n\n // DRAW\n\n if(result === \"\"){\n let fullCamps = 0;\n for(let i = 0; i < 3; i++){\n for(let j = 0; j < 3; j++){\n if(game[i][j] != \"\"){\n fullCamps++;\n }\n }\n }\n if(fullCamps === 9){\n result = \"D\";\n }\n }\n return result;\n}", "title": "" }, { "docid": "1422632b4af663eef2b2aeab5e5e52b4", "score": "0.7414318", "text": "function humanWin() {\n var countRow = [0, 0, 0]; //Create count arrays\n var countCol = [0, 0, 0];\n \n for (var b = 0; b < 3; b++) { // Check rows and columns\n for (var a = 0; a < 3; a++) {\n if (board.state[a][b] === \"1\") {\n countRow[a]++;\n countCol[b]++;\n }\n if (countRow[a] === 3)\n won = 1;\n if (countCol[b] === 3)\n won = 1;\n }\n }\n \n // Check both diagonals\n if (board.state[0][0] === \"1\" &&\n board.state[1][1] === \"1\" &&\n board.state[2][2] === \"1\")\n won = 1;\n \n if (board.state[0][2] === \"1\" &&\n board.state[1][1] === \"1\" &&\n board.state[2][0] === \"1\")\n won = 1;\n \n return won;\n }", "title": "" }, { "docid": "3db73eb2cd2aa26e7fe9da549af57885", "score": "0.74141085", "text": "function isSolved(board) {\n let hasWinner = [false,'',0];\n for(let i = 0; i <= 2; i++){\n //CHECK HORIZONTAL\n if(board[i][0] == board[i][1] &&\n board[i][0] == board[i][2] &&\n board[i][1] == board[i][2] &&\n board[i][0] != 0){\n hasWinner = [true,\"V\",board[i][0]];\n break;\n }\n //CHECK VERTICAL\n if(board[0][i] == board[1][i] &&\n board[0][i] == board[2][i] &&\n board[1][i] == board[2][i] &&\n board[0][i] != 0){\n hasWinner = [true,\"H\",board[0][i]];\n break;\n }\n }\n //CHECK DIAGONAL LEFT TO RIGHT\n if(board[0][0] == board[1][1] &&\n board[0][0] == board[2][2] &&\n board[1][1] == board[2][2] &&\n board[0][0] != 0){\n hasWinner = [true,\"D1\",board[2][2]]; \n }\n //CHECK DIAGONAL RIGHT TO LEFT\n if(board[0][2] == board[2][0] &&\n board[0][2] == board[1][1] &&\n board[1][1] == board[2][0] &&\n board[0][2] != 0){\n hasWinner = [true,\"D2\",board[2][2]]; \n }\n //IF NO WINNER YET CHECK IF THE GAME IS NOT DONE YET OR DRAW\n let foundZero = false;\n if(hasWinner[0] == false){\n for(let i = 0; i<=2; i++){\n if(board[i].includes(0)){\n foundZero = true;\n break;\n }\n }\n if(foundZero){\n return -1;\n } else {\n return 0;\n }\n }\n return hasWinner[2];\n}", "title": "" }, { "docid": "bac6fe26be3629a4121584caa11ccd3a", "score": "0.7412337", "text": "function checkForWinner(player, row, column){\n if(horizontalCheck(player, row))\n return true;\n else if(verticalWinCondition(player, column))\n return true;\n else if(diagonalCheckDownLeft(player, row, column))\n return true;\n else if(diagonalCheckDownRight(player, row, column))\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "a7607f0239023dcef9408e5e064f13df", "score": "0.7403664", "text": "function checkDiagUpWin() {\nfor (var y = 3; y <= 5; y++) {\n for (var x = 0; x <= 3; x++) {\n if (board[y][x] != 0 &&\n board[y][x] == board[y-1][x+1] &&\n board[y][x] == board[y-2][x+2] &&\n board[y][x] == board[y-3][x+3]) {\n return (currentPlayer);\n }\n }\n }\n}", "title": "" }, { "docid": "b1657dc31fa5d722ea38ffa59085c102", "score": "0.7394823", "text": "function winByCol(board, turn) {\n for (let j = 0; j < board[0].length; j++ ) {\n let check_array = []\n for (let i = 0; i < board.length; i++) {\n check_array.push(board[i][j]) \n }\n if (winHelper(check_array, turn)) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "f20006396b2eeb70316d26fd063e3ac6", "score": "0.7383598", "text": "function checkWinner() {\n let winner = null;\n for (let i = 0; i < 3; i++) {\n if (equals3(board[i][0], board[i][1], board[i][2])) {\n winner = board[i][0];\n }\n }\n\n for (let i = 0; i < 3; i++) {\n if (equals3(board[0][i], board[1][i], board[2][i])) {\n winner = board[0][i];\n }\n }\n\n if (equals3(board[0][0], board[1][1], board[2][2])) {\n winner = board[0][0];\n }\n if (equals3(board[2][0], board[1][1], board[0][2])) {\n winner = board[2][0];\n }\n\n let openSpots = 0;\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n if (board[i][j] == \"\") {\n openSpots++;\n }\n }\n }\n\n if (winner == null && openSpots == 0) {\n return \"tie\";\n } else {\n return winner;\n }\n}", "title": "" }, { "docid": "8df82db464e674ff25ee2ee5450f614c", "score": "0.7380126", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n\n // Creates a for loop initialized at zero, using \"y\" as an index limited by the global variable \"HEIGHT\", and iterating one positive unit per loop (y++); representing the y-axis on the board\n for (let y = 0; y < HEIGHT; y++) {\n // For each iteration of parent loop, creates another for loop initialized at 0, using x as an index limited by the global variable \"WIDTH\", and iterating one positive unit per loop (x++); representing the x-axis on the board\n for (let x = 0; x < WIDTH; x++) {\n // For each iteration of parent loops, creates the variable \"horiz\" and assigns it to an array consisting of four subarrays representing four horizontally consecutive cells\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n // For each iteration of parent loops, creates the variable \"vert\" and assigns it to an array consisting of four subarrays representing four vertically consecutive cells\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n // For each iteration of parent loops, creates the variable \"diagDR\" and assigns it to an array consisting of four subarrays representing four diagonally consecutive cells that slope upward from left to right\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n // For each iteration of parent loops, creates the variable \"diagDL\" and assigns it to an array consisting of four subarrays representing four diagonally consecutive cells that slope downward from left to right\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n // Creates a boolean expression contingent upon the affirmation of one of four conditions defined by the aforementioned variables\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "14d9dd3f1370ed71847ade09dff4b1b5", "score": "0.7367133", "text": "function columnWin() {\r\n for (x = 0; x < 7; x++) {\r\n for (j = 1; j < 4; j++) {\r\n if (board[x][j].color != \"\") {\r\n if (board[x][j].color == board[x][j - 1].color) {\r\n if (board[x][j].color == board[x][j + 1].color) {\r\n if (board[x][j + 1].color == board[x][j + 2].color) {\r\n for (k = -1; k < 3; k++) {\r\n winningCells.push(board[x][j + k]);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "c818cc9fee197a6f0c4c5ecb0f9f375f", "score": "0.7334554", "text": "function diagonalWinner() {\n //This will check if there is a diagonal match\n //We need to check the index of each box by using the the .eq method\n var leftDownDiag = checkRow($boxes.eq(0), $boxes.eq(4), $boxes.eq(8));\n var rightUpDiag = checkRow($boxes.eq(2), $boxes.eq(4), $boxes.eq(6));\n\n //Using the || operator let us compare if there is a match in either ways there is a winner\n\n return leftDownDiag || rightUpDiag;\n}", "title": "" }, { "docid": "edce97d7ea6a4b1ded729129a927c57f", "score": "0.732773", "text": "function checkForWinner (move) {\n var result = false;\n if (checkRow(1, 2, 3, move)){\n result = true;\n }\n else if (checkRow(4, 5, 6, move)) {\n result = true;\n } else if (checkRow(7, 8, 9, move)) {\n result = true;\n } else if (checkRow(1, 4, 7, move)) {\n result = true;\n } else if (checkRow(2, 5, 8, move)) {\n result = true;\n } else if (checkRow(3, 6, 9, move)) {\n result = true;\n } else if (checkRow(7, 8, 9, move)) {\n result = true;\n } else if (checkRow(1, 5, 9, move)) {\n result = true;\n } else if (checkRow(3, 5, 7, move)) {\n result = true;\n }\n return result;\n }", "title": "" }, { "docid": "f271f1bc1c82048d64488778c1d9c34a", "score": "0.7306132", "text": "function isWinner(valueTurn) {\n const gridSize = Number(state.size);\n let horizontalCount;\n let verticalCount;\n let diagonalLeftToRight = 0;\n let diagonalRightToLeft = 0;\n let wonArrHorizontal;\n let wonArrVertical;\n let wonArrDiagonalLeftRight = [];\n let wonArrDiagonalRightLeft = [];\n\n for (let i = 0; i < gridSize; i++) {\n horizontalCount = 0;\n verticalCount = 0;\n wonArrHorizontal = [];\n wonArrVertical = [];\n for (let j = 0; j < gridSize; j++) {\n // like [0,1,2]\n if (state.board[i * gridSize + j] == valueTurn) {\n horizontalCount++;\n wonArrHorizontal.push(i * gridSize + j);\n }\n // like [0,3,6]\n if (state.board[j * gridSize + i] == valueTurn) {\n verticalCount++;\n wonArrVertical.push(j * gridSize + i);\n }\n }\n if (horizontalCount == gridSize) {\n // update arr[index path win condition]\n updateWonArr(wonArrHorizontal);\n return true;\n }\n if (verticalCount == gridSize) {\n // update arr[index path win condition]\n updateWonArr(wonArrVertical);\n return true;\n }\n // like [0,4,8]\n if (state.board[i * gridSize + i] == valueTurn) {\n diagonalLeftToRight++;\n wonArrDiagonalLeftRight.push(i * gridSize + i);\n }\n // like [2,4,6]\n if (state.board[(gridSize - 1) * (i + 1)] == valueTurn) {\n diagonalRightToLeft++;\n wonArrDiagonalRightLeft.push((gridSize - 1) * (i + 1));\n }\n }\n if (diagonalLeftToRight == gridSize) {\n // update arr[index path win condition]\n updateWonArr(wonArrDiagonalLeftRight);\n return true;\n }\n if (diagonalRightToLeft == gridSize) {\n // update arr[index path win condition]\n updateWonArr(wonArrDiagonalRightLeft);\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "1fffbdf9c6e6f360cd08b4f0ff7bed02", "score": "0.7290965", "text": "function checkWinner() {\n if ((gameBoard[0][0] + gameBoard[1][1] + gameBoard[2][2] === \"XXX\") || (gameBoard[0][0] + gameBoard[1][1] + gameBoard[2][2] === \"OOO\") || ((gameBoard[0][2] + gameBoard[1][1] + gameBoard[2][0] === \"XXX\") || (gameBoard[0][2] + gameBoard[1][1] + gameBoard[2][0] === \"OOO\"))) {\n gameBoard[4].win = true;\n printWinner();\n } else if ((gameBoard[0][0] + gameBoard[0][1] + gameBoard[0][2] === \"XXX\") || (gameBoard[0][0] + gameBoard[0][1] + gameBoard[0][2] === \"OOO\") || (gameBoard[1][0] + gameBoard[1][1] + gameBoard[1][2] === \"XXX\") || (gameBoard[1][0] + gameBoard[1][1] + gameBoard[1][2] === \"OOO\") || (gameBoard[2][0] + gameBoard[2][1] + gameBoard[2][2] === \"XXX\") || (gameBoard[2][0] + gameBoard[2][1] + gameBoard[2][2] === \"OOO\")) {\n gameBoard[4].win = true;\n printWinner();\n } else if ((gameBoard[0][0] + gameBoard[1][0] + gameBoard[2][0] === \"XXX\") || (gameBoard[0][0] + gameBoard[1][0] + gameBoard[2][0] === \"OOO\") || (gameBoard[0][1] + gameBoard[1][1] + gameBoard[2][1] === \"XXX\") || (gameBoard[0][1] + gameBoard[1][1] + gameBoard[2][1] === \"OOO\") || (gameBoard[0][2] + gameBoard[1][2] + gameBoard[2][2] === \"XXX\") || (gameBoard[0][2] + gameBoard[1][2] + gameBoard[2][2] === \"OOO\")) {\n gameBoard[4].win = true;\n printWinner();\n } else if(gameBoard[3].count == 9) {\n gameBoard[5].tie = true;\n printWinner();\n }\n}", "title": "" }, { "docid": "a303282f12c6c87167f10b5eac03d3de", "score": "0.7281958", "text": "function checkWinner() {\n\n console.log(\"checkWinner was called\");\n const winningBoard = \"nought,nought,nought\"\n const winningBoard1 = \"cross,cross,cross\"\n const horizontalBoard = []\n\n for(i=0;i<board.length;i++){\n for(j=0;j<board[i].length;j++){\n horizontalBoard.push(board[i][j])\n }\n }\n\n if ((horizontalBoard[0] !== null) && (horizontalBoard[0] === horizontalBoard[3]) && (horizontalBoard[3] === horizontalBoard [6])){\n return win(player)\n }\n if ((horizontalBoard[1] !== null) && (horizontalBoard[1] === horizontalBoard[4]) && (horizontalBoard[4] === horizontalBoard [7])){\n return win(player)\n }\n if ((horizontalBoard[2] !== null) && (horizontalBoard[2] === horizontalBoard[5]) && (horizontalBoard[5] === horizontalBoard [8])){\n return win(player)\n }\n if ((horizontalBoard[0] !== null) && (horizontalBoard[0] === horizontalBoard[4]) && (horizontalBoard[4] === horizontalBoard [8])){\n return win(player)\n }\n if ((horizontalBoard[2] !== null) && (horizontalBoard[2] === horizontalBoard[4]) && (horizontalBoard[4] === horizontalBoard [6])){\n return win(player)\n }\n\n for(i=0;i<board.length;i++){\n let currentRow = board[i].toString()\n console.log(currentRow)\n if(currentRow === winningBoard || currentRow === winningBoard1 ){\n return win(player)\n }\n // console.log(\"Not a winner\")\n }\n let nullCounter = 0\n for (i=0;i<horizontalBoard.length;i++){\n if (horizontalBoard[i] !== null) {\n nullCounter++\n }\n if (nullCounter === 9) {\n return \"nobody\"\n }\n }\n if (board === [null, null, null], [null, null, null], [null, null, null]) {\n return \"---\"\n }\n}", "title": "" }, { "docid": "78935b3aa8c0dd6a179f409d0cbc47ca", "score": "0.72819155", "text": "function isWinner(player) {\n\n for (var i = 0; i < 3; i++) {\n\n for (var j = 0; j < 3; j++) {\n\n if(self.gameBoard[0][0] == player && \n self.gameBoard[0][1] == player && self.gameBoard[0][2] == player) {\n return true;\n \n } \n\n if(self.gameBoard[1][0] == player && \n self.gameBoard[1][1] == player && self.gameBoard[1][2] == player) {\n return true; \n \n }\n\n if(self.gameBoard[2][0] == player &&\n self.gameBoard[2][1] == player && self.gameBoard[2][2] == player) {\n return true; \n \n }\n\n if(self.gameBoard[0][0] == player &&\n self.gameBoard[1][0] == player && self.gameBoard[2][0] == player) {\n return true; \n \n }\n\n if(self.gameBoard[1][0] == player &&\n self.gameBoard[1][1] == player && self.gameBoard[1][2] == player) {\n return true; \n \n }\n if(self.gameBoard[2][0] == player &&\n self.gameBoard[2][1] == player && self.gameBoard[2][2] == player) {\n return true; \n \n }\n if(self.gameBoard[0][0] == player &&\n self.gameBoard[1][1] == player && self.gameBoard[2][2] == player) {\n return true; \n \n }\n if(self.gameBoard[0][2] == player &&\n self.gameBoard[1][1] == player && self.gameBoard[2][0] == player) {\n return true; \n \n }\n } \n }\n\n return false;\n }", "title": "" }, { "docid": "37eec1fc639013add10eecbc80f52f47", "score": "0.7270277", "text": "function checkStateGame() {\n\n\tif (!gameEnd) {\n\n\t\t// Iterate through all the possible cells, using i,j as coordinates\n\t\tfor (let i = 0; i < 7; i++) {\n\t\t\tfor (let j = 0; j < 7; j++) {\n\n\t\t\t\t// The xDirection loop and yDirection loop determines the direction. \n\t\t\t\t// You can think of them as vectors, representing which way to check \n\t\t\t\tfor (let xDirection = -1; xDirection < 2; xDirection++) {\n\t\t\t\t\tfor (let yDirection = -1; yDirection < 2; yDirection++) {\n\n\t\t\t\t\t\t// The case of 0,0 is ignored as it is useless and will give false positive\n\t\t\t\t\t\t// of \"Four in a row\"\n\t\t\t\t\t\tif (xDirection == 0 && yDirection == 0) continue;\n\n\t\t\t\t\t\tvar fourInARow = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// This array will keep track of which are the four coordinates that makes\n\t\t\t\t\t\t// the winner win.\n\t\t\t\t\t\tvar positions = new Array();\n\n\t\t\t\t\t\t// Push the current coordinate we want to check as a possible coordinate\n\t\t\t\t\t\tpositions.push([i, j]);\n\n\t\t\t\t\t\t// This magnitude for loop deterimes how 'far' we want to check, relative from\n\t\t\t\t\t\t// the original i,j position\n\t\t\t\t\t\tfor (let magnitude = 1; magnitude < 4; magnitude++) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// The checking coordinates are determined by multiplying the magnitude\n\t\t\t\t\t\t\t// with the direction\n\t\t\t\t\t\t\tlet checkXPosition = Number(i) + Number(xDirection * magnitude);\n\t\t\t\t\t\t\tlet checkYPosition = Number(j) + Number(yDirection * magnitude);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If this direction cannot no longer be checked(as it extends out of bounds),\n\t\t\t\t\t\t\t// break out of this magnitude for loop. This will move onto the next direction.\n\t\t\t\t\t\t\tif (checkXPosition < 0 || checkXPosition >= 7 || checkYPosition < 0 || checkYPosition >= 7) {\n\t\t\t\t\t\t\t\tfourInARow = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// If the checking coordinates are not out of bounds, push it onto the possible\n\t\t\t\t\t\t\t\t// coordinates\n\t\t\t\t\t\t\t\tpositions.push([checkXPosition, checkYPosition]);\n\n\t\t\t\t\t\t\t\t// This statement below makes it such that if ONE of the checks is false(i.e.\n\t\t\t\t\t\t\t\t// it is NOT four in a row), fourInARow immediately becomes false and cannot\n\t\t\t\t\t\t\t\t// go back to true.\n\t\t\t\t\t\t\t\tfourInARow = fourInARow && (board[i][j] == board[checkXPosition][checkYPosition] && board[i][j] != 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If this current path we are checking IS fourInARow,\n\t\t\t\t\t\tif (fourInARow) {\n\n\t\t\t\t\t\t\tgameEnd = true;\n\n\t\t\t\t\t\t\t// Identify the four winning positions by increasing them by 2\n\t\t\t\t\t\t\tfor (let z = 0; z < positions.length; z++) {\n\t\t\t\t\t\t\t\tboard[Number(positions[z][0])][Number(positions[z][1])] = 3;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tboardRefresh(true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9299ef22ffd9b2edfcb5567bbf41f544", "score": "0.7270149", "text": "winner() {\n return this.checkHorizontals() ||\n this.checkVerticals() ||\n this.checkDiagonals();\n }", "title": "" }, { "docid": "e7ac53e0c2104dd81bcb5d7bbfcb04e7", "score": "0.7264571", "text": "function checkWinner(rows) {\n var allWinningLists = [\n rows, // rows\n _.zip(...rows), // columns\n getDiagonals(rows) // diagonals\n ];\n\n return allWinningLists\n .reduce((allLists, lists) => allLists.concat(lists), [])\n .reduce(checkListForWinner, '');\n}", "title": "" }, { "docid": "b07c193e9b8873407e672bff3fa5231d", "score": "0.7247339", "text": "_isWinner(){\n if(this._count === Math.pow(this._size, 2)){\n this._score['tie'] +=1;\n alert('TIE! Press reset to play again');\n }\n \n if(this._winLogic[this._turn].diag1 === this._size){\n this._winner = this._turn;\n this._score[this._turn] += 1;\n alert('WINNER! Press reset to play again');\n }\n \n if(this._winLogic[this._turn].diag2 === this._size){\n this._winner = this._turn;\n this._score[this._turn] += 1;\n alert('WINNER! Press reset to play again');\n }\n \n var col = this._winLogic[this._turn].col;\n \n // loop through col logic to see if winner\n for(var i = 0; i < col.length; i++){\n if(col[i] === this._size){\n this._winner = this._turn;\n this._score[this._turn] += 1;\n alert('WINNER! Press reset to play again');\n }\n }\n \n var row = this._winLogic[this._turn].row;\n \n // loop through row logic to see if winner\n for(var j = 0; j < row.length; j++){\n if(row[j] === this._size){\n this._winner = this._turn;\n this._score[this._turn] += 1;\n alert('WINNER! Press reset to play again');\n }\n }\n \n }", "title": "" }, { "docid": "94aceb711e378a6f45a737ac8f8f2709", "score": "0.7233503", "text": "function checkBoard() {\n const winningArrays = [\n [0,1,2,3], [0,4,8,12], [0,5,10,15], [1,5,9,13], [2,6,10,14], [3,7,11,15], [3,6,9,12], [4,5,6,7], [8,9,10,11], [12,13,14,15]\n ]\n\n //this checks for 4 in a row of same player pieces\n for(let y = 0; y < winningArrays.length; y++) {\n const square1 = squares[winningArrays[y][0]]\n const square2 = squares[winningArrays[y][1]]\n const square3 = squares[winningArrays[y][2]]\n const square4 = squares[winningArrays[y][3]]\n\n if(square1.classList.contains('player-one')\n && square2.classList.contains('player-one')\n && square3.classList.contains('player-one')\n && square4.classList.contains('player-one')) {\n\n //4 blue pieces\n result.innerHTML = 'Blue Wins!'\n\n }\n\n else if(square1.classList.contains('player-two')\n && square2.classList.contains('player-two')\n && square3.classList.contains('player-two')\n && square4.classList.contains('player-two')) {\n\n //4 red pieces\n result.innerHTML = 'Red Wins!'\n }\n }\n}", "title": "" }, { "docid": "7bd7dc55274f877774c766b0bade1abb", "score": "0.72313863", "text": "checkWinner(){\n\n // Possible winning combinations\n const winConditions = [\n [0,1,2],\n [3,4,5],\n [6,7,8],\n [0,3,6],\n [1,4,7],\n [2,5,8],\n [0,4,8],\n [2,4,6]\n ];\n\n // Loop through the array winConditions and check if any conditions has been fulfilled\n winConditions.forEach((w) =>{\n\n let squareA = this.squares[w[0]];\n let squareB = this.squares[w[1]];\n let squareC = this.squares[w[2]];\n\n // Check if square A is filled and have the same value as square B and square C\n if((squareA.value) && (squareA.value === squareB.value) && (squareA.value === squareC.value)){\n\n // End the current game\n this.inProgress = false;\n\n // Declare the winner\n this.winPlayer = squareA.value;\n\n // Highlight the value in the winning row\n squareA.isHighlighted = true;\n squareB.isHighlighted = true;\n squareC.isHighlighted = true;\n }\n\n });\n\n // If all the squares have been filled and there is no winner, the game is drawn\n if(this.moveCount == this.squares.length){\n this.inProgress = false;\n }\n\n }", "title": "" }, { "docid": "1c2a2ef7f56d217240f885a745b295a4", "score": "0.7223047", "text": "function diagonalWinCheck(){\r\n for(var col=0; col<5; col++){\r\n for(var row=0; row<7; row++){\r\n if(colorMatchCheck(returnColor(row, col),\r\n returnColor(row+1, col+1),\r\n returnColor(row+2, col+2),\r\n returnColor(row+3, col+3))){\r\n console.log('diag');\r\n reportWin(row, col);\r\n return true;\r\n }else if(colorMatchCheck(returnColor(row, col),\r\n returnColor(row-1, col+1),\r\n returnColor(row-2, col+2),\r\n returnColor(row-3, col+3))){\r\n console.log('diag');\r\n reportWin(row, col);\r\n return true;\r\n }else{\r\n continue;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "42af0cbc6cfeccb425ef8dc9091d80fd", "score": "0.72077554", "text": "function checkWin () {\n let box1 = document.getElementById('1').innerHTML || 'none';\n let box2 = document.getElementById('2').innerHTML || 'none';\n let box3 = document.getElementById('3').innerHTML || 'none';\n let box4 = document.getElementById('4').innerHTML || 'none';\n let box5 = document.getElementById('5').innerHTML || 'none';\n let box6 = document.getElementById('6').innerHTML || 'none';\n let box7 = document.getElementById('7').innerHTML || 'none';\n let box8 = document.getElementById('8').innerHTML || 'none';\n let box9 = document.getElementById('9').innerHTML || 'none';\n var gameOver = false;\n // Checking rows\n if (box1 != 'none' && box1 == box2 && box2 == box3 || \n box4 != 'none' && box4 == box5 && box5 == box6 || \n box7 !='none' && box7 == box8 && box8 == box9) {\n gameOver = true;\n }\n // Checking columns\n else if (box1 !='none' && box1 == box4 && box4 == box7 || \n box2 !='none' && box2 == box5 && box5 == box8 || \n box3 !='none' && box3 == box6 && box6 == box9) {\n gameOver = true;\n }\n // Checking diagnoals\n else if (box1 !='none' && box1 == box5 && box5 == box9 || \n box3 !='none' && box3 == box5 && box5 == box7) {\n gameOver = true;\n }\n console.log(\"Inside checkwin()\" , box1,box2,box3,box4,box5,box6,box7,box8,box9);\n var counter = this.Game.counter;\n if (gameOver) {\n SwitchPlay(); // Switch back to the last one who played\n let winner = this.Game.currentPlayer;\n document.getElementById(\"result\").innerHTML = \"Winner is \" + winner + \"!\";;\n this.Game.gameOver = true;\n }\n if (counter==9 && !gameOver) {\n let winnerId = document.getElementById(\"result\");\n winnerId.innerHTML = (\"Its a tie!\");\n this.Game.gameOver = true;\n }\n}", "title": "" }, { "docid": "bf083d06c060cf1f2dc80bc6fbe7e020", "score": "0.71979177", "text": "checkBoardWin() {\n console.log(\"\\n*****\");\n for (let i in this.wins) {\n if (this.checkRowWin(this.wins[i])) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "428fe7c622887fb1202608ef312dfaa8", "score": "0.7189161", "text": "function isWinner(x, y) {\n var consecutives = 4;\n var count = 0;\n var z = 0;\n var i;\n\n // Horizontal.\n for (i = 0; i < columns; i++) {\n if (board[i][y] == players[whoseTurn]) {\n count++;\n if (count >= consecutives) { return true; }\n } else {\n count = 0;\n }\n }\n\n // Vertical.\n count = 0;\n for (i = 0; i < rows; i++) {\n if (board[x][i] == players[whoseTurn]) {\n count++;\n if (count >= consecutives) { return true; }\n } else {\n count = 0;\n }\n }\n\n // Top right to bottom left diagonal.\n var dim = columns + rows;\n\tfor( var k = 0 ; k < dim; k++, count = 0) {\n for( var j = 0 ; j <= k ; j++ ) {\n var i = k - j;\n if( i < columns && j < rows && board[i][j] == players[whoseTurn]) {\n \tcount++;\n if (count >= consecutives) { return true; }\n }\n\n }\n }\n\n // Top left to bottom right diagonal.\n\tfor( var k = 0 ; k < dim; k++, count = 0) {\n\t\tvar kk = (columns - 1) - k;\n for( var j = 0 ; j <= k ; j++ ) {\n var i = kk + j;\n if( i >= 0 && j < rows && board[i][j] == players[whoseTurn]) {\n \tcount++;\n if (count >= consecutives) { return true; }\n }\n\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "8b43953abae6c649732a1f276048b2c0", "score": "0.71877164", "text": "function checkForWin() \n{\n\tif(moveNumber == boardSize*boardSize)\n\t{\n\t\talert(\"DRAW!!\");\n\t\tnewGame();\n\t}\n\telse\n\t{\n\t\tvar current;\n\n\t\t//Check each row for a win\n\t\tfor(var row = 0; row < boardSize; row++) \n\t\t{\n\t\t\tcurrent = $('#s' + row + '0 p').text();\n\n\t\t\tif(current != '' && current == $('#s' + row + '1 p').text() && current == $('#s' + row + '2 p').text())\n\t\t\t{\n\t\t\t\talert(\"Player \" + current + \" wins!\");\n\t\t\t\tnewGame();\n\t\t\t}\n\t\t}\n\t\t//Check each col for a win\n\t\tfor(var col = 0; col < boardSize; col++) \n\t\t{\n\t\t\tcurrent = $('#s0' + col + ' p').text();\n\n\t\t\tif(current != '' && current == $('#s1' + col + ' p').text() && current == $('#s2' + col + ' p').text())\n\t\t\t{\n\t\t\t\talert(\"Player \" + current + \" wins!\");\n\t\t\t\tnewGame();\n\t\t\t}\n\t\t}\n\t\t//Check the top-left -> bot-right diagonal for a win\n\t\tcurrent = $('#s00 p').text();\n\t\tif(current != '' && current == $('#s11 p').text() && current == $('#s22 p').text())\n\t\t{\n\t\t\talert(\"Player \" + current + \" wins!\");\n\t\t\tnewGame();\n\t\t}\n\t\t//Check the bot-left -> top-right diagonal for a win\n\t\tcurrent = $('#s20 p').text();\n\t\tif(current != '' && current == $('#s11 p').text() && current == $('#s02 p').text())\n\t\t{\n\t\t\talert(\"Player \" + current + \" wins!\");\n\t\t\tnewGame();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5e409c01b3f519d24f4f348057553076", "score": "0.7187103", "text": "function checkWin(turn) {\n if (state.board[0].join(\"\") === \"XXX\" || state.board[0].join(\"\") === \"OOO\") {\n renderWin(state.board[0][0]);\n } else if (state.board[1].join(\"\") === \"XXX\" || state.board[1].join(\"\") === \"OOO\") {\n renderWin(state.board[1][0]);\n } else if (state.board[2].join(\"\") === \"XXX\" || state.board[2].join(\"\") === \"OOO\") {\n renderWin(state.board[2][0]);\n } else if (state.board[0][0] === turn && turn === state.board[1][0] && turn === state.board[2][0]) {\n renderWin(state.board[0][0]);\n } else if (state.board[0][1] === turn && turn === state.board[1][1] && turn === state.board[2][1]) {\n renderWin(state.board[0][1]);\n } else if (state.board[0][2] === turn && turn === state.board[1][2] && turn === state.board[2][2]) {\n renderWin(state.board[0][2]);\n } else if (state.board[0][0] === turn && turn === state.board[1][0] && turn === state.board[2][0]) {\n renderWin(state.board[0][0]);\n } else if (state.board[0][0] === turn && turn === state.board[1][1] && turn === state.board[2][2]) {\n renderWin(state.board[0][0]);\n } else if (state.board[0][2] === turn && turn === state.board[1][1] && turn === state.board[2][0]) {\n renderWin(state.board[0][2]);\n } else if (state.board[0].includes(\"\") === false && state.board[1].includes(\"\") === false && state.board[2].includes(\"\") === false) {\n renderWin(\"tie\");\n }\n}", "title": "" }, { "docid": "7ac341b4fb0de41ff6a4848a86d49e12", "score": "0.7182287", "text": "function check_Right_Diagonal_Win(board){\n if ((board.top.col3 === \"X\") && (board.middle.col2 === \"X\") && (board.bottom.col1 === \"X\") || (board.top.col3 === \"O\") && (board.middle.col2 === \"O\") && (board.bottom.col1 === \"O\")) {\n console.log(\"Left Diagonal Match!~~~\");\n check_who_win(players);\n }\n}", "title": "" }, { "docid": "dc873f4d9ca61be5868deacca39e8633", "score": "0.71815014", "text": "function checkWin() {\n\n // This is checking the grid to see if there has been a winning combination\n for (i = 0; i < winSets.length; i++) {\n if (board[winSets[i][0]].innerHTML == board[winSets[i][1]].innerHTML\n && board[winSets[i][1]].innerHTML == board[winSets[i][2]].innerHTML\n && board[winSets[i][0]].innerHTML != \"\") {\n // This is setting gameOver variable to true because the game would be over\n gameOver = true;\n\n // If X won the game it will display a message saying X won\n if (player === \"X\") {\n document.getElementById(\"winner\").innerHTML = \"X Wins!\";\n // If O won the game it will display a message saying O won\n } else if (player === \"O\") {\n document.getElementById(\"winner\").innerHTML = \"O Wins!\";\n }\n\n // This calls to the display win function and passing the value true into it\n displayWin(gameOver);\n }\n\n }\n\n // This checks to see if all of the cells are filled\n if (empty === 0) {\n // This sets the gameOver variable to true because the game is over \n gameOver = true;\n // This will display a message saying that no one wins \n document.getElementById(\"winner\").innerHTML = \"No one wins!\";\n // This will call to the displayWin function and passing the value true into it\n displayWin(gameOver);\n\n }\n}", "title": "" }, { "docid": "2586fd91566370a97151adfd27fed678", "score": "0.7180804", "text": "function diagWin(){\r\n for (var col = 0; col < 4 ; col++) {\r\n for (var row = 0; row < 7 ; row++) {\r\n if (checkFour(currentChipColor(row,col),currentChipColor(row-1,col+1),currentChipColor(row-2,col+2),currentChipColor(row-3,col+3))) {\r\n console.log(\"pos diagonal win\");\r\n return true;\r\n }else if (checkFour(currentChipColor(row,col),currentChipColor(row+1,col+1),currentChipColor(row+2,col+2),currentChipColor(row+3,col+3))) {\r\n console.log(\"neg diagonal win\");\r\n return true;\r\n }else {\r\n continue;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "5e9a18c5d41c329810a2be5a4515ff02", "score": "0.7177813", "text": "function checkWin() {\n return board.every((row) =>\n row.every(\n (cell) =>\n cell.status === STATUS.NUMBER ||\n (cell.mine &&\n (cell.status === STATUS.MARKED || cell.status === STATUS.HIDDEN))\n )\n );\n}", "title": "" }, { "docid": "206e402b0891be4f2263b034c30f20bc", "score": "0.7173967", "text": "function checkForWin() {\n let victory = false;\n // checks rows\n let topRow = document.querySelectorAll('.top td div');\n // checks top row\n if (topRow[0].className == topRow[1].className && \n topRow[0].className == topRow[2].className &&\n topRow[0].className != 'square') {\n victory = true;\n return {\n victory,\n winner: topRow[0].className.substring(7),\n direction: 'top'\n }\n }\n let middleRow = document.querySelectorAll('.middle td div');\n // checks middle row\n if (middleRow[0].className == middleRow[1].className && \n middleRow[0].className == middleRow[2].className &&\n middleRow[0].className != 'square') {\n victory = true;\n return {\n victory,\n winner: middleRow[0].className.substring(7),\n direction: 'middle'\n }\n }\n let bottomRow = document.querySelectorAll('.bottom td div');\n // checks bottom row\n if (bottomRow[0].className == bottomRow[1].className && \n bottomRow[0].className == bottomRow[2].className &&\n bottomRow[0].className != 'square') {\n victory = true;\n return {\n victory,\n winner: bottomRow[0].className.substring(7),\n direction: 'bottom'\n }\n }\n // checks columns\n // checks left column\n if (topRow[0].className == middleRow[0].className && \n topRow[0].className == bottomRow[0].className &&\n topRow[0].className != 'square') {\n victory = true;\n return {\n victory,\n winner: topRow[0].className.substring(7),\n direction: 'left'\n }\n }\n // checks center column\n if (topRow[1].className == middleRow[1].className && \n topRow[1].className == bottomRow[1].className &&\n topRow[1].className != 'square') {\n victory = true;\n return {\n victory,\n winner: topRow[1].className.substring(7),\n direction: 'center'\n }\n }\n // checks right column\n if (topRow[2].className == middleRow[2].className && \n topRow[2].className == bottomRow[2].className &&\n topRow[2].className != 'square') {\n victory = true;\n return {\n victory,\n winner: topRow[2].className.substring(7),\n direction: 'right'\n }\n }\n // checks diagonals\n // checks falling diagonal\n if (topRow[0].className == middleRow[1].className && \n topRow[0].className == bottomRow[2].className &&\n topRow[0].className != 'square') {\n victory = true;\n return {\n victory,\n winner: topRow[0].className.substring(7),\n direction: 'falling'\n }\n }\n // checks rising diagonal\n if (bottomRow[0].className == middleRow[1].className && \n bottomRow[0].className == topRow[2].className &&\n bottomRow[0].className != 'square') {\n victory = true;\n return {\n victory,\n winner: bottomRow[0].className.substring(7),\n direction: 'rising'\n }\n }\n if (squares.length == 0) {\n victory = true;\n return {\n victory,\n winner: 'none',\n direction: 'tie'\n }\n }\n return {\n victory\n }\n}", "title": "" }, { "docid": "8fd38de1971c5735d485bdd3af446257", "score": "0.71696275", "text": "function checkForWin () {\n let winner = 0;\n for (i = 0; i < board.cells.length; i++) {\n if (board.cells[i].isMine === true && board.cells[i].isMarked === true) {\n return\n } else if (!board.cells[i].isMine && board.cells[i].hidden === true) {\nreturn\n }\n }\n return lib.displayMessage('You win!')\n}", "title": "" }, { "docid": "6dddc7e45380144bce42b26a18ccca22", "score": "0.71553594", "text": "checkBoard(newC, newR) {\n if (newC === -1 || newR === -1) {\n return;\n }\n\n let board = this.state.board;\n let turn = board[newC][newR];\n\n // directions to check from tile\n // [c, r]\n const directions = [\n [1 , 0], // right\n [0 , 1], // up\n [-1, 0], // left\n [0 ,-1], // down\n [1 , 1], // right,up\n [-1, 1], // left, up\n [-1,-1], // left, down\n [1 ,-1] // right,down\n ];\n\n for (let d_i = 0; d_i < directions.length; d_i ++) {\n let d = directions[d_i];\n\n let i = 1;\n while(turn === (board[newC + (d[0] * i)] && board[newC + (d[0] * i)][newR + (d[1] * i)])) {\n i ++;\n if (i === 4) {\n // WINNER\n console.log(\"WINNER: \" + turn);\n\n let j = 0;\n while (j < 4) {\n board[newC + (d[0] * j)][newR + (d[1] * j)] = turn === 0 ? 10 : 11;\n j ++;\n }\n\n this.setState({\n winner: turn\n });\n\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "a60a27649048ac52a6c338028de851db", "score": "0.7147236", "text": "function checkwin() {\n var winner = null;\n var emptyEle = null;\n if (checkEqual(0, 1, 2)) {\n winner = board[0];\n return winner;\n } else if (checkEqual(3, 4, 5)) {\n winner = board[3];\n return winner;\n } else if (checkEqual(6, 7, 8)) {\n winner = board[6];\n return winner;\n } else if (checkEqual(0, 3, 6)) {\n winner = board[0];\n return winner;\n } else if (checkEqual(1, 4, 7)) {\n winner = board[1];\n return winner;\n } else if (checkEqual(2, 5, 8)) {\n winner = board[2];\n return winner;\n } else if (checkEqual(0, 4, 8)) {\n winner = board[0];\n return winner;\n } else if (checkEqual(2, 4, 6)) {\n winner = board[2];\n return winner;\n } else {\n for (var i = 0; i < board.length; i++) {\n if (board[i] != \"\") {\n emptyEle = emptyEle + 1;\n }\n }\n if (emptyEle == 9) {\n winner = \"tie\";\n return winner;\n }\n }\n}", "title": "" }, { "docid": "c2f107a3d8363ad75dfc59f35b7074ce", "score": "0.7142676", "text": "function checkWin() {\r\n\r\n // TODO: document all of the code from class\r\n /**\r\n * This contains a loop that goes through the board array defined above.\r\n * The if statement along with the for loop checks if winning condition by checking is met if same 3 comes in a row . \r\n * WinSets defined and board together is used for checking.\r\n * board has the cell values while winSet contains possible winning positions.\r\n */\r\n for ( i = 0; i < winSets.length; i++) {\r\n if (board[winSets[i][0]].innerHTML == board[winSets[i][1]].innerHTML \r\n && board[winSets[i][1]].innerHTML == board[winSets[i][2]].innerHTML \r\n && board[winSets[i][0]].innerHTML != \"\") {\r\n \r\n //console.log(\"We have a winner!\");\r\n\r\n // TODO: replace console.log(\"We have a winner!\") with:\r\n\r\n // - set gameOver variable: game is now over \r\n gameOver=true;\r\n\r\n // - display \"X Wins!\" or \"O Wins!\" in the winner H3\r\n document.getElementById(\"winner\").innerHTML= player + \" Wins!\";\r\n\r\n // - call displayWin(true) function\r\n displayWin(gameOver);\r\n \r\n // - break out of this loop: no point in continuing\r\n break;\r\n }\r\n }\r\n \r\n // TODO: if there are no empty cells left and game is not yet over,\r\n // it means that there is no winner for this game\r\n // - set gameOver variable: game is now over \r\n // - display \"No one wins! :(\" in the winner H3\r\n // - call displayWin(true) function\r\n if(empty==0&&gameOver==false)\r\n { gameOver=true;\r\n \r\n document.getElementById(\"winner\").innerHTML=\"No one wins!\";\r\n\r\n displayWin(gameOver);\r\n\r\n }\r\n \r\n}", "title": "" }, { "docid": "b6a1394314165a15d151bbf8263abb8d", "score": "0.71231747", "text": "function checkWin(board) {\r\n for (var i = 0; i < board.length; i++) {\r\n for (var j = 0; j < board[i].length; j++) {\r\n if (!board[i][j].isShown) {\r\n return false;\r\n }\r\n if (board[i][j].isMarked && !board[i][j].isMine) {\r\n return false;\r\n }\r\n // if (board[i][j].isMine && !board[i][j].isMarked) {\r\n // return false;\r\n // }\r\n }\r\n }\r\n document.querySelector('.game-screen span').innerHTML = WIN_EMOJI;\r\n // console.log('you won!!!');\r\n gameOver();\r\n return true;\r\n}", "title": "" }, { "docid": "cb7dd056d328685ea1b592dda0406420", "score": "0.712137", "text": "function checkWin () {\n\n //declare vars\n var anyMovesLeft = false;\n var lineCheck = false;\n // these assume game area is square\n var rows = gameArea.length;\n var cols = gameArea[0].length;\n //\n\n //HORIZONTAL CHECK\n // go through the array line by line\n for (var i =0; i < rows; i++)\n {\n //the line matches unless two items aren't the same\n lineCheck = true;\n // go through each row item by item\n for (var j =1; j < cols; j++)\n {\n console.log('check pair ' + gameArea[i][j-1] + ' ' + gameArea[i][j]);\n //loop through until something does not match\n if (gameArea[i][j-1] != gameArea[i][j])\n {\n // mismatch found, line does not match, try next line\n lineCheck = false;\n break;\n }\n }\n console.log(lineCheck);\n //if no mismatches found, whole line matches, match found, return\n if (lineCheck) {\n return 'w';\n }\n }\n\n //VERTICAL CHECK\n // go through the array column by column\n for (var i = 0; i < rows; i++) {\n /*if (gameArea[0][i] == gameArea[1][i] == gameArea[2][i]) {\n return gameArea[0][i];\n }*/\n //the line matches unless two items aren't the same\n lineCheck = true;\n // go through each row item by item\n for (var j =1; j < cols; j++)\n {\n console.log('check pair ' + gameArea[j-1][i] + ' ' + gameArea[j][i]);\n //loop through until something does not match\n if (gameArea[j-1][i] != gameArea[j][i])\n {\n // mismatch found, line does not match, try next line\n lineCheck = false;\n break;\n }\n }\n console.log(lineCheck);\n //if no mismatches found, whole line matches, match found, return to\n if (lineCheck) {\n return 'w';\n }\n }\n\n //DIAGONAL CHECK\n //DIAGONAL - TOP LEFT TO BOTTOM RIGHT\n for (var i = 1; i < rows; i++) {\n lineCheck = true;\n console.log('check pair ' + gameArea[i-1][i-1] + ' ' + gameArea[i][i]);\n if (gameArea[i-1][i-1] != gameArea[i][i])\n {\n // mismatch found, line does not match, try next line\n lineCheck = false;\n break;\n }\n }\n console.log(lineCheck);\n if (lineCheck) {\n return 'w';\n }\n\n //DIAGONAL - TOP LEFT TO BOTTOM RIGHT\n for (var i = 0; i < rows-1 ; i++) {\n //the line matches unless two items aren't the same\n lineCheck = true;\n // go through each row item by item\n for (var j = cols-1; j >= 1; j--) {\n if ((i + j + 1) == rows) {\n console.log('check pair ' + gameArea[i][j] + ' ' + gameArea[i+1][j-1]);\n //loop through until something does not match\n if (gameArea[i][j] != gameArea[i+1][j-1]) {\n // mismatch found, line does not match, try next line\n lineCheck = false;\n break;\n }\n }\n }\n if (!lineCheck) {\n break;\n }\n }\n console.log(lineCheck);\n //if no mismatches found, whole line matches, match found, return to\n if (lineCheck) {\n return 'w';\n\n }\n\n //if all possibilities checked and no match, game was tie\n // loop through all items in all arrays\n // assumes no moves left, if any unused space exists, there is 1+ moves left\n for (var i =0; i < rows; i++)\n {\n for (var j = 0; j < cols; j++) {\n //if current item is a number, there are moves left\n if (!isNaN(gameArea[i][j]))\n {\n anyMovesLeft = true;\n }\n }\n }\n //if no moves are left, game is tie\n if (!anyMovesLeft)\n {\n return 't';\n }\n\n //if no player has made winning move AND has not used last move, continue\n return 'c';\n}", "title": "" }, { "docid": "972852ea494be72bd6946126ee2594bc", "score": "0.7115754", "text": "function checkResult(grid) {\n\n // Result of the game\n let result = null;\n \n // If their is any row in which all three colums have same symbol then \n // player with that symbol won the match\n for (let row = 0; row < 3; row++) {\n if (grid[row][0] === grid[row][1] && grid[row][1] === grid[row][2] && grid[row][0]!=null) {\n result = grid[row][0];\n return result;\n }\n }\n \n // If their is any column in which all three rows have same symbol then \n // player with that symbol won the match\n for (let col = 0; col < 3; col++) {\n if (grid[0][col] === grid[1][col] && grid[1][col] === grid[2][col] && grid[0][col]!=null) {\n result = grid[0][col];\n return result;\n }\n }\n \n // If right diagonal is equal\n if ( grid[0][0] === grid[1][1] && grid[1][1] === grid[2][2] && grid[0][0] != null ) {\n result = grid[0][0];\n return result;\n }\n \n // If left diagonal is equal\n if ( grid[0][2] === grid[1][1] && grid[1][1] === grid[2][0] && grid[0][2] != null ) {\n result = grid[0][2];\n return result;\n }\n\n // Legal moves to play in game \n let legalMove = 0;\n\n // Check all the position in tic tac toe matrix\n for (let row = 0; row < 3; row++) {\n for (let col = 0; col < 3; col++) {\n\n // Increase legal move by 1 if position is empty\n if (grid[row][col] == null) legalMove++;\n }\n }\n // If legal moves are zero then game is tied\n if (legalMove === 0) {\n result = \"T\";\n }\n\n // Return the result\n return result;\n}", "title": "" }, { "docid": "4b0473d885c308610fe246dd4f1404b9", "score": "0.71140724", "text": "function win() {\r\n var x = moves[moves.length - 1];\r\n var y = height[x] - 1;\r\n\r\n if (y >= 3 && board[x][y - 3] == board[x][y] && board[x][y - 2] == board[x][y] && board[x][y - 1] == board[x][y]) {\r\n mark_win(x, y, 0, -1);\r\n won = true;\r\n }\r\n for (var dy = -1; dy <= 1; dy++) {\r\n var nb = 0;\r\n for (var dx = 1; x + dx < 7 && y + dx * dy < 6 && y + dx * dy >= 0; dx++)\r\n if (board[x + dx][y + dx * dy] == board[x][y]) nb++;\r\n else break;\r\n for (var dx = -1; x + dx >= 0 && y + dx * dy < 6 && y + dx * dy >= 0; dx--)\r\n if (board[x + dx][y + dx * dy] == board[x][y]) nb++;\r\n else break;\r\n if (nb >= 3) {\r\n mark_win(x + dx + 1, y + (dx + 1) * dy, 1, dy);\r\n won = true;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "cb0dcfc256e57c3c48c10ee1e500d1a0", "score": "0.7099465", "text": "function _win(cells) {\n return cells.every(([y, x]) => {\n // check if y and x are in bound with the width and height of the board; and they all match one player;\n return (y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH && board[y][x] === currPlayer);\n })\n }", "title": "" }, { "docid": "161e1078187c1c8aa051bf35eb6ceba8", "score": "0.70941174", "text": "function checkForVictory(board)\n{\n\tvar victor = \"\";\n\tvar tie = true;\t\n\n\t//Check rows\n\tfor (var i = 0; i < 3; i++)\n\t{\n\t\tif (board[i][0] == board[i][1] && board[i][1] == board[i][2] && board[i][0] != \"\")\n\t\t{\n\t\t\tvictor = board[i][0];\n\t\t}\n\t}\n\n\t//Check columns\n\tfor (var i = 0; i < 3; i++)\n\t{\n\t\tif (board[0][i] == board[1][i] && board[1][i] == board[2][i] && board[0][i] != \"\")\n\t\t{\n\t\t\tvictor = board[0][i];\n\t\t}\n\t}\n\n\t//Check diagonal\n\tif (board[0][0] == board[1][1] && board[2][2] == board[1][1] && board[1][1] != \"\")\n\t{\n\t\tvictor = board[1][1];\n\t}\n\tif (board[1][1] == board[2][0] && board[1][1] == board[0][2] && board[1][1] != \"\")\n\t{\n\t\tvictor = board[1][1];\n\t}\n\n\tif (victor == \"\")\n\t{\n\t\t//Check for tie\n\t\tfor (var i = 0; i < 3 && tie; i++)\n\t\t{\n\t\t\tfor (var j = 0; j < 3; j++)\n\t\t\t{\n\t\t\t\tif (board[i][j] == \"\")\n\t\t\t\t{\n\t\t\t\t\ttie = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (tie)\n\t\t{\n\t\t\treturn 'n';\n\t\t}\n\t}\n\treturn victor;\n}", "title": "" }, { "docid": "5e853afcec4b6ad8104058f104a7228c", "score": "0.7092279", "text": "checkForWin(arr) {\n return (\n this.rowsWinCheck(arr) ||\n this.colsWinCheck(arr) ||\n this.diagsWinCheck(arr)\n );\n }", "title": "" }, { "docid": "66847b2084033289b66822a1bd8cfcd4", "score": "0.708735", "text": "_checkForWinner(board, player) {\n\n const winningCombos = [\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8],\n [0, 3, 6],\n [1, 4, 7],\n [2, 5, 8],\n [0, 4, 8],\n [2, 4, 6]\n ];\n\n for (let i = 0; i < winningCombos.length; i++) {\n const [a, b, c] = winningCombos[i];\n if (player === board[a] && player === board[b] && player === board[c]) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "1de28893d9de46956fd8ee5471ee65e3", "score": "0.7080693", "text": "function checkGame() {\n let cols = board[0].length;\n let rows = board.length;\n let returnValue = null;\n //Check columns\n for (let j = 0; j < cols; j++)\n {\n let value = board[0][j].value;\n for (let i = 1; i < rows; i++)\n {\n if (board[i][j].value != value)\n {\n break;\n }\n else if (i == 2)\n {\n if (value == \"x\")\n {\n returnValue = 1;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n if (value == \"o\")\n {\n returnValue = 2;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n }\n }\n }\n //Check rows\n for (let i = 0; i < rows; i++)\n {\n let value = board[i][0].value;\n for (let j = 1; j < cols; j++)\n {\n if (board[i][j].value != value)\n {\n break;\n }\n else if (j == 2)\n {\n if (value == \"x\")\n {\n returnValue = 1;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n if (value == \"o\")\n {\n returnValue = 2;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n }\n }\n }\n //Check diagonals\n let value = board[0][0].value;\n if (value == board[1][1].value && value == board[2][2].value && value != null)\n {\n if (value == \"x\")\n {\n returnValue = 1;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n else if (value == \"o\")\n {\n returnValue = 2;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n }\n value = board[0][2].value;\n if (value == board[1][1].value && value == board[2][0].value)\n {\n if (value == \"x\")\n {\n returnValue = 1;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n else if (value == \"o\")\n {\n returnValue = 2;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n }\n //Check draw\n let over = checkFull();\n if (over)\n {\n returnValue = 3;\n events.emit(\"gameEnded\", returnValue);\n return returnValue;\n }\n return 0;\n }", "title": "" }, { "docid": "9f25d51a799d51ef6c25ce8beda58d7f", "score": "0.7074468", "text": "function rowWin() {\r\n for (j = 0; j < 6; j++) {\r\n for (i = 1; i < 5; i++) {\r\n if (board[i][j].color != \"\") {\r\n if (board[i][j].color == board[i - 1][j].color) {\r\n if (board[i][j].color == board[i + 1][j].color) {\r\n if (board[i + 1][j].color == board[i + 2][j].color) {\r\n //gameOver = true;\r\n for (k = -1; k < 3; k++) {\r\n winningCells.push(board[i + k][j]);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "0ce5cb4685feaf42b664db8e05577764", "score": "0.70725954", "text": "isOver(num, col, row)\n {\n //first, check if the game is completed on a single board\n\n //create Sets for each direction. Since a Set has unique entries, if there\n //is only one entry and it is not an empty string, that entry is the winner\n \n //vertCoords, horCoors, etc are used to store the coordinates of squares in a winning \n //row so that we can track these squares and make them light up green in the win screen\n var horizontal = new Set()\n var horCoords = []\n var hor = 0\n var vertical = new Set()\n var vertCoords = []\n var vert = 0\n\n var posDiagonal = new Set()\n var posCoords = []\n var pos = 0\n var negDiagonal = new Set()\n var negCoords = []\n var neg = 0\n\n for (var y=0; y < game.n; y++){\n //check the possible horizontal and vertical wins for the given placement\n horizontal.add(game.board[num][row][y])\n horCoords.push([num, row, y])\n //update priority for blocking function for ai\n if(game.board[num][row][y] != \"\" && game.board[num][row][y] != \"o\")\n hor++\n vertical.add(game.board[num][y][col] )\n if(game.board[num][y][col] != \"\" && game.board[num][y][col] != \"o\")\n vert++\n vertCoords.push([num, y, col])\n //check the possible diagonal wins by checking the main diagonals\n posDiagonal.add(game.board[num][y][y])\n posCoords.push([num, y, y])\n if(game.board[num][y][y] != \"\" && game.board[num][y][y] != \"o\")\n pos++\n negDiagonal.add(game.board[num][game.n-1-y][y])\n negCoords.push([num, game.n-1-y, y])\n if(game.board[num][game.n-1-y][y] != \"\" && game.board[num][game.n-1-y][y] != \"o\")\n neg++\n }\n var gameOver = false;\n //if all entries in a row or column are the same, then the game is over\n //we don't need to check that the only entry is not a blank string, since\n //these Sets will include the piece that was just placed, which cannot possibly be blank\n if(horizontal.size === 1)\n {\n gameOver = true\n game.isDraw = false\n game.addWinningSquares(horCoords)\n }\n if(vertical.size === 1)\n {\n gameOver = true\n game.isDraw = false\n game.addWinningSquares(vertCoords)\n }\n //if all entries in a diagonal are the same AND that entry is not blank,\n //then the game is over\n if(posDiagonal.size === 1 && !posDiagonal.has(\"\"))\n {\n gameOver = true\n game.isDraw = false\n game.addWinningSquares(posCoords)\n }\n if(negDiagonal.size === 1 && !negDiagonal.has(\"\"))\n {\n gameOver = true\n game.isDraw = false\n game.addWinningSquares(negCoords)\n }\n //update priorities for blocking function for ai\n if(game.vsAi)\n {\n possibleLines = [[hor,blockHorizontal],[vert,blockVertical],[pos,blockPos],[neg,blockNeg]]\n game.possibleLines = possibleLines\n }\n //check 3D game ending conditions\n if(game.checkIfOver3D(num, col, row))\n {\n gameOver = true\n game.isDraw = false\n }\n //Not sure if it is possible to draw in 3D, we can check after 63 just in case\n else if(game.turns >= 63)\n {\n gameOver = true;\n game.isDraw = true\n }\n\n\n\n return gameOver\n\n }", "title": "" }, { "docid": "2926a93473a68c75855b1d0a7f042931", "score": "0.7071924", "text": "function ticTacCheck(moves){\n if(moves.length < 5){\n return 'Pending';\n };\n //board generation\n let moveCount = 0;\n let board = moves.reduce(function(acc, cur, index){\n moveCount +=1;\n //console.log(acc)\n //console.log(cur)\n //console.log(index)\n if(index %2 === 0){\n acc[cur[0]][cur[1]] += `A`;\n } else {\n acc[cur[0]][cur[1]] += `B`;\n \n }\n return acc;\n },[['','',''], //0\n ['','',''], //1\n ['','','']] //2\n );\n //console.log(board)\n\n let checkCol = function (board, colNum){\n let value = board[0][colNum];\n if (board[1][colNum] && board[1][colNum] == board[2][colNum] && board[2][colNum] == value) {\n return value;\n } else return false;\n }\n\n let checkRow = function (board, rowNum){\n let value = board[rowNum][0];\n if (board[rowNum][1] && board[rowNum][1] == board[rowNum][2] && board[rowNum][2] == value) {\n return value;\n } else return false;\n }\n\n let checkDiag = function (board){\n let center = board[1][1];\n // console.log(center);\n if (board[1][1] && (board[0][0] == center && board[2][2] == center || board[2][0] == center && board[0][2] == center)){\n return center;\n } else return false;\n }\n \n //check the board for matches\n //iterate through each row\n //check for horizont, verti, and diag matches\n //eject out of loop if true otherwise row and column variables will be overwritten by a false case after a true has been hit\n\n let diag = checkDiag(board);\n let column = false;\n let row = false;\n for (let i=0; i<3; i++){\n column = checkCol(board, i);\n row = checkRow(board, i);\n if (row || column){\n i=3;\n }\n }\n //console.log(row);\n // console.log(row || column || diag)\n if (row || column || diag){\n return row || column || diag\n } else {\n if (moveCount < 9){\n return `Pending`;\n } else return `Draw`;\n }\n \n}", "title": "" }, { "docid": "1a5d4a6d0bba8c6f447e24ef5d884b86", "score": "0.70716023", "text": "function check_Left_Diagonal_Win(board){\n if ((board.top.col1 === \"X\") && (board.middle.col2 === \"X\") && (board.bottom.col3 === \"X\") || (board.top.col1 === \"O\") && (board.middle.col2 === \"O\") && (board.bottom.col3 === \"O\")) {\n console.log(\"Right Diagonal Match!~~~\");\n check_who_win(players);\n }\n}", "title": "" }, { "docid": "687b6e2440ae2b32e4e3c671262348b9", "score": "0.7063343", "text": "function checkWinState(player) {\n let boxStates = boxes.map(box => box.innerText)\n let row0Win = (boxStates[0] === player && boxStates[1] === player && boxStates[2] === player)\n let row1Win = (boxStates[3] === player && boxStates[4] === player && boxStates[5] === player)\n let row2Win = (boxStates[6] === player && boxStates[7] === player && boxStates[8] === player)\n let col0Win = (boxStates[0] === player && boxStates[3] === player && boxStates[6] === player)\n let col1Win = (boxStates[1] === player && boxStates[4] === player && boxStates[7] === player)\n let col2Win = (boxStates[2] === player && boxStates[5] === player && boxStates[8] === player)\n let diag0Win = (boxStates[0] === player && boxStates[4] === player && boxStates[8] === player)\n let diag1Win = (boxStates[2] === player && boxStates[4] === player && boxStates[6] === player)\n return (\n row0Win || row1Win || row2Win ||\n col0Win || col1Win || col2Win ||\n diag0Win || diag1Win\n )\n}", "title": "" }, { "docid": "286d98384f1b2eb2dac972941b4897e5", "score": "0.70547175", "text": "function winCheck (arrayBoard, boolean) {\n //Horizontal\n if(arrayBoard[0][0] === toSymbol(turn+1) && arrayBoard[0][1] === toSymbol(turn+1) && arrayBoard[0][2] === toSymbol(turn+1)){\n winMessage();\n gameOver = true;\n }\n if(arrayBoard[1][0] === toSymbol(turn+1) && arrayBoard[1][1] === toSymbol(turn+1) && arrayBoard[1][2] === toSymbol(turn+1)){\n winMessage();\n gameOver = true;\n }\n if(arrayBoard[2][0] === toSymbol(turn+1) && arrayBoard[2][1] === toSymbol(turn+1) && arrayBoard[2][2] === toSymbol(turn+1)){\n winMessage();\n gameOver = true;\n }\n\n //Vertical\n if(arrayBoard[0][0] === toSymbol(turn+1) && arrayBoard[1][0] === toSymbol(turn+1) && arrayBoard[2][0] === toSymbol(turn+1)){\n winMessage();\n gameOver = true;\n }\n if(arrayBoard[0][1] === toSymbol(turn+1) && arrayBoard[1][1] === toSymbol(turn+1) && arrayBoard[2][1] === toSymbol(turn+1)){\n winMessage();\n gameOver = true;\n }\n if(arrayBoard[0][2] === toSymbol(turn+1) && arrayBoard[1][2] === toSymbol(turn+1) && arrayBoard[2][2] === toSymbol(turn+1)){\n winMessage();\n gameOver = true;\n }\n\n //Diagonal\n if(arrayBoard[0][0] === toSymbol(turn+1) && arrayBoard[1][1] === toSymbol(turn+1) && arrayBoard[2][2] === toSymbol(turn+1)){\n winMessage();\n gameOver = true;\n }\n if(arrayBoard[0][2] === toSymbol(turn+1) && arrayBoard[1][1] === toSymbol(turn+1) && arrayBoard[2][0] === toSymbol(turn+1)){\n winMessage();\n gameOver = true;\n }\n\n\n //Draw\n if(arrayBoard[0][0] !== \"\" && arrayBoard[0][1] !== \"\" && arrayBoard[0][2] !== \"\" && arrayBoard[1][0] !== \"\" && arrayBoard[1][1] !== \"\" && arrayBoard[1][2] !== \"\" && arrayBoard[2][0] !== \"\" && arrayBoard[2][1] !== \"\" && arrayBoard[2][2] !== \"\" && !gameOver){\n gameOver = true;\n $(\"#draw\").show();\n }\n if (gameOver) {\n $(\".btn\").show();\n }\n}", "title": "" }, { "docid": "11f77c6205f84956c8a96178807ff3bf", "score": "0.70532286", "text": "checkWinner(){\n const winningCombinations = [\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8],\n [0, 3, 6],\n [1, 4, 7],\n [2, 5, 8],\n [0, 4, 8],\n [2, 4, 6]\n ];\n\n winningCombinations.forEach((wc) => {\n const [a,b,c] = wc;\n const cnA = this.canvas[a];\n const cnB = this.canvas[b];\n const cnC = this.canvas[c];\n\n if(cnA.value && cnA.value === cnB.value && cnA.value === cnC.value) {\n //Game is not in progress anymore\n this.inProgress = false;\n this.winner = cnA.value; // \"O\" or \"X\"\n cnA.isHighlighted = cnB.isHighlighted = cnC.isHighlighted = true;\n }\n }); \n\n //Check for tie\n if(this.movesMade === this.canvas.length){\n this.inProgress = false;\n }\n }", "title": "" }, { "docid": "3f218c5dbd91ef22beb54b7d2ab4b8ff", "score": "0.70520884", "text": "function checkForWin () {\n\n let playerWin = true;\n\n board.cells.forEach( function(cell) {\n if (cell.isMine && !cell.isMarked) {\n playerWin = false;\n };\n if (!cell.isMine && cell.hidden) {\n playerWin = false;\n };\n });\n\n if (playerWin) {\n lib.displayMessage('You win!')\n }\n \n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n // lib.displayMessage('You win!')\n}", "title": "" }, { "docid": "2f89f7fbd3a245f65e5c8fabe7d64cd2", "score": "0.70475817", "text": "function vertWin(){\r\n for (var col = 0; col < 7; col++) {\r\n for (var row = 0; row < 3; row++) {\r\n if (checkFour(currentChipColor(row,col), currentChipColor(row+1,col), currentChipColor(row+2,col), currentChipColor(row+3,col))) {\r\n console.log(\"vertical win\");\r\n return true;\r\n }else {\r\n continue;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0a37e9690ee19fc0c171f931f85a222d", "score": "0.70465213", "text": "function cellClick(id) {\n\n //check id when clicking certain cell.\n console.log('id: ' + id);\n\n console.log('current player :', currentPlayer)\n //change their turn to play the game\n if (currentPlayer === \"X\") {\n //Change the HTML content of element with id to \"X\" in the browser\n document.getElementById(id).innerHTML = \"X\";\n board[id] = \"X\";\n currentPlayer = \"O\";\n console.log(board)\n } else {\n document.getElementById(id).innerHTML = \"O\";\n board[id] = \"O\";\n currentPlayer = \"X\";\n console.log(board)\n }\n //Winning\n //if current player has taken the same line of row, column, or digonal =>\n //winner is decided.\n\n //row\n for (let i = 0 ; i < board.length; i +=3) {\n if (board[i] === \"X\" && board[i] === board[i+1] && board[i+1] === board[i+2]) document.getElementById('status').innerHTML = `${board[i]} is winner!`;\n if (board[i] === \"O\" && board[i] === board[i+1] && board[i+1] === board[i+2]) document.getElementById('status').innerHTML = `${board[i]} is winner!`;\n }\n\n //column\n for (let i = 0; i < 3; i++) {\n if (board[i] === \"X\" && board[i] === board[i+3] && board[i+3] === board[i+6]) document.getElementById('status').innerHTML = `${board[i]} is winner!`;\n if (board[i] === \"O\" && board[i] === board[i+3] && board[i+3] === board[i+6]) document.getElementById('status').innerHTML = `${board[i]} is winner!`;\n }\n\n //diagonal1(major)\n if (board[0] === \"X\" && board[0] === board[4] && board[4] === board[8]) document.getElementById('status').innerHTML = `${board[0]} is winner!`;\n if (board[0] === \"O\" && board[0] === board[4] && board[4] === board[8]) document.getElementById('status').innerHTML = `${board[0]} is winner!`;\n\n //diagonal2(minor)\n if (board[2] === \"X\" && board[2] === board[4] && board[4] === board[6]) document.getElementById('status').innerHTML = `${board[2]} is winner!`;\n if (board[2] === \"O\" && board[2] === board[4] && board[4] === board[6]) document.getElementById('status').innerHTML = `${board[0]} is winner!`;\n\n gameActive = false;\n //Once winner is decided or board is fully occupied, cannot click anymore\n\n}", "title": "" }, { "docid": "14627f229a3d4b52e2b27d69e6d12389", "score": "0.70431966", "text": "function isGameWon() {\n\n // All possible \"3 in a row\"\n let lines = [\n [0,1,2],\n\t\t\t[3,4,5],\n\t\t\t[6,7,8],\n\t\t\t[0,3,6],\n\t\t\t[0,4,8],\n\t\t\t[1,4,7],\n\t\t\t[2,5,8],\n\t\t\t[2,4,6]\n ];\n\n // If any of the lines is filled with O's (player1)\n for (let i = 0; i < lines.length; i++) {\n if (box[lines[i][0]].classList.contains(\"box-filled-1\") &&\n box[lines[i][1]].classList.contains(\"box-filled-1\") &&\n box[lines[i][2]].classList.contains(\"box-filled-1\")) {\n\n // Display the winner screen\n finishScreen();\n finish.classList.add(\"screen-win-one\")\n message.innerHTML = playerName + \" is the winner\";\n setPlayer1();\n return;\n }\n\n // If any of the lines is filled with X's (player2)\n else if (box[lines[i][0]].classList.contains(\"box-filled-2\") &&\n box[lines[i][1]].classList.contains(\"box-filled-2\") &&\n box[lines[i][2]].classList.contains(\"box-filled-2\")) {\n\n // Display the winner screen\n finishScreen();\n finish.classList.add(\"screen-win-two\")\n if (isTwoPlayer) {\n message.innerHTML = player2Name + \" is the winner\";\n } else {\n message.innerHTML = \"Winner\";\n }\n setPlayer1();\n return;\n\n // If no lines are complete and board is full\n } else if (!isGameDraw()) {\n finishScreen();\n finish.classList.add(\"screen-win-tie\")\n message.innerHTML = \"It's a tie!\";\n setPlayer1();\n }\n }\n }", "title": "" } ]
bd87e53b639b4aa1512be83a9f93aab2
Intelligently divides one duration by another
[ { "docid": "65397ecc3b70ba981d7dd1718fe3f27c", "score": "0.676774", "text": "function divideDurationByDuration(dur1, dur2) {\n var months1, months2;\n if (durationHasTime(dur1) || durationHasTime(dur2)) {\n return dur1 / dur2;\n }\n months1 = dur1.asMonths();\n months2 = dur2.asMonths();\n if (Math.abs(months1) >= 1 && isInt(months1) &&\n Math.abs(months2) >= 1 && isInt(months2)) {\n return months1 / months2;\n }\n return dur1.asDays() / dur2.asDays();\n}", "title": "" } ]
[ { "docid": "f5075bbf737046e633ded315e89b304f", "score": "0.7022479", "text": "function L(a,c,d){// returnFloat=true\r\nreturn b.duration(Math.round(a.diff(c,d,!0)),d)}", "title": "" }, { "docid": "e3322e903b488f77c7518ff0900f3e53", "score": "0.6834051", "text": "function divideDurationByDuration(dur1, dur2) {\r\n var months1;\r\n var months2;\r\n if (durationHasTime(dur1) || durationHasTime(dur2)) {\r\n return dur1 / dur2;\r\n }\r\n months1 = dur1.asMonths();\r\n months2 = dur2.asMonths();\r\n if (Math.abs(months1) >= 1 && isInt(months1) &&\r\n Math.abs(months2) >= 1 && isInt(months2)) {\r\n return months1 / months2;\r\n }\r\n return dur1.asDays() / dur2.asDays();\r\n}", "title": "" }, { "docid": "76c7bce2ed84f147d5f26ef320a9f59f", "score": "0.6805473", "text": "function divideDurationByDuration(dur1, dur2) {\n var months1;\n var months2;\n if (durationHasTime(dur1) || durationHasTime(dur2)) {\n return dur1 / dur2;\n }\n months1 = dur1.asMonths();\n months2 = dur2.asMonths();\n if (Math.abs(months1) >= 1 && isInt(months1) &&\n Math.abs(months2) >= 1 && isInt(months2)) {\n return months1 / months2;\n }\n return dur1.asDays() / dur2.asDays();\n }", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "d17219067a2817d6dd4bcbc6c08d585f", "score": "0.6761466", "text": "function divideDurationByDuration(dur1, dur2) {\n\tvar months1, months2;\n\n\tif (durationHasTime(dur1) || durationHasTime(dur2)) {\n\t\treturn dur1 / dur2;\n\t}\n\tmonths1 = dur1.asMonths();\n\tmonths2 = dur2.asMonths();\n\tif (\n\t\tMath.abs(months1) >= 1 && isInt(months1) &&\n\t\tMath.abs(months2) >= 1 && isInt(months2)\n\t) {\n\t\treturn months1 / months2;\n\t}\n\treturn dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "25443f81fc56effb813ba325f3cb43e9", "score": "0.67601365", "text": "function divideDurationByDuration(dur1, dur2) {\n var months1;\n var months2;\n if (durationHasTime(dur1) || durationHasTime(dur2)) {\n return dur1 / dur2;\n }\n months1 = dur1.asMonths();\n months2 = dur2.asMonths();\n if (Math.abs(months1) >= 1 && isInt(months1) &&\n Math.abs(months2) >= 1 && isInt(months2)) {\n return months1 / months2;\n }\n return dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "25443f81fc56effb813ba325f3cb43e9", "score": "0.67601365", "text": "function divideDurationByDuration(dur1, dur2) {\n var months1;\n var months2;\n if (durationHasTime(dur1) || durationHasTime(dur2)) {\n return dur1 / dur2;\n }\n months1 = dur1.asMonths();\n months2 = dur2.asMonths();\n if (Math.abs(months1) >= 1 && isInt(months1) &&\n Math.abs(months2) >= 1 && isInt(months2)) {\n return months1 / months2;\n }\n return dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "25443f81fc56effb813ba325f3cb43e9", "score": "0.67601365", "text": "function divideDurationByDuration(dur1, dur2) {\n var months1;\n var months2;\n if (durationHasTime(dur1) || durationHasTime(dur2)) {\n return dur1 / dur2;\n }\n months1 = dur1.asMonths();\n months2 = dur2.asMonths();\n if (Math.abs(months1) >= 1 && isInt(months1) &&\n Math.abs(months2) >= 1 && isInt(months2)) {\n return months1 / months2;\n }\n return dur1.asDays() / dur2.asDays();\n}", "title": "" }, { "docid": "cd5489948ab38a25ad81cc88e51411b3", "score": "0.6707984", "text": "function z(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),\"days\"),ms:a.time()-c.time()})}", "title": "" }, { "docid": "56f545c184482cd6322d5fe3be0940c3", "score": "0.65848935", "text": "function J(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),\"days\"),ms:a.time()-c.time()})}", "title": "" }, { "docid": "da81a0dd8a3dbeabd0a617207c7f4898", "score": "0.6458688", "text": "function K(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),\"days\")})}", "title": "" }, { "docid": "8c6f6fa59dcc466200aefab524525fb4", "score": "0.6281988", "text": "function calculateDuration() {\nreturn endTime - startTime;\n}", "title": "" }, { "docid": "db0976ef8722cc24ea8b033bd5812005", "score": "0.6175779", "text": "function divideRangeByDuration(start, end, dur) {\n var months;\n if (durationHasTime(dur)) {\n return (end - start) / dur;\n }\n months = dur.asMonths();\n if (Math.abs(months) >= 1 && isInt(months)) {\n return end.diff(start, 'months', true) / months;\n }\n return end.diff(start, 'days', true) / dur.asDays();\n }", "title": "" }, { "docid": "7b37f96e78f6be38258102ff718c59bf", "score": "0.6155158", "text": "function divideRangeByDuration(start, end, dur) {\r\n var months;\r\n if (durationHasTime(dur)) {\r\n return (end - start) / dur;\r\n }\r\n months = dur.asMonths();\r\n if (Math.abs(months) >= 1 && isInt(months)) {\r\n return end.diff(start, 'months', true) / months;\r\n }\r\n return end.diff(start, 'days', true) / dur.asDays();\r\n}", "title": "" }, { "docid": "77088717e8b6d16f4e513f18d2876d41", "score": "0.60858345", "text": "function calculateDuration() {\r\n return endTime - startTime;\r\n }", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "373b065bd812b33523fe6c2f8c0d7506", "score": "0.6065895", "text": "function divideRangeByDuration(start, end, dur) {\n\tvar months;\n\n\tif (durationHasTime(dur)) {\n\t\treturn (end - start) / dur;\n\t}\n\tmonths = dur.asMonths();\n\tif (Math.abs(months) >= 1 && isInt(months)) {\n\t\treturn end.diff(start, 'months', true) / months;\n\t}\n\treturn end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "92c7a1829d434721731031bb8fff4fc6", "score": "0.60639834", "text": "function divideRangeByDuration(start, end, dur) {\n var months;\n if (durationHasTime(dur)) {\n return (end - start) / dur;\n }\n months = dur.asMonths();\n if (Math.abs(months) >= 1 && isInt(months)) {\n return end.diff(start, 'months', true) / months;\n }\n return end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "92c7a1829d434721731031bb8fff4fc6", "score": "0.60639834", "text": "function divideRangeByDuration(start, end, dur) {\n var months;\n if (durationHasTime(dur)) {\n return (end - start) / dur;\n }\n months = dur.asMonths();\n if (Math.abs(months) >= 1 && isInt(months)) {\n return end.diff(start, 'months', true) / months;\n }\n return end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "92c7a1829d434721731031bb8fff4fc6", "score": "0.60639834", "text": "function divideRangeByDuration(start, end, dur) {\n var months;\n if (durationHasTime(dur)) {\n return (end - start) / dur;\n }\n months = dur.asMonths();\n if (Math.abs(months) >= 1 && isInt(months)) {\n return end.diff(start, 'months', true) / months;\n }\n return end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "92c7a1829d434721731031bb8fff4fc6", "score": "0.60639834", "text": "function divideRangeByDuration(start, end, dur) {\n var months;\n if (durationHasTime(dur)) {\n return (end - start) / dur;\n }\n months = dur.asMonths();\n if (Math.abs(months) >= 1 && isInt(months)) {\n return end.diff(start, 'months', true) / months;\n }\n return end.diff(start, 'days', true) / dur.asDays();\n}", "title": "" }, { "docid": "bb6e4e3fc3994edac8c990aca07dec32", "score": "0.6024581", "text": "_secondsToUnits(seconds) {\n return 1 / seconds;\n }", "title": "" }, { "docid": "7544fafdb071ac483587a5970addf74f", "score": "0.6022697", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "7544fafdb071ac483587a5970addf74f", "score": "0.6022697", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "7544fafdb071ac483587a5970addf74f", "score": "0.6022697", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "7544fafdb071ac483587a5970addf74f", "score": "0.6022697", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "a8570c5c7bde951d3654292c7dde54b6", "score": "0.60189253", "text": "set duration(value) {}", "title": "" }, { "docid": "f9da12db5b993a2ce4f5a3196fa2c090", "score": "0.59423774", "text": "function diffByUnit(a, b, unit) {\r\n return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true\r\n unit);\r\n}", "title": "" }, { "docid": "b839c7655d2b1da8b11fff373793d406", "score": "0.59414333", "text": "function diffByUnit(a, b, unit) {\n return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true\n unit);\n }", "title": "" }, { "docid": "be380a55c531e2bb4b506698d1a6120a", "score": "0.5932039", "text": "function calculateDuration() {\r\n\t\t\treturn endTime - startTime;\r\n\t\t}", "title": "" }, { "docid": "f98e5e5a1cd903f50b3d3fb57c9688bb", "score": "0.59007156", "text": "calcPauseDuration(end, start){\n return moment(start) - moment(end);\n }", "title": "" }, { "docid": "601075e761542d6e96eb294d494e2e9f", "score": "0.5876628", "text": "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "title": "" }, { "docid": "56a87fd8f4915d4220a78b5b921b4404", "score": "0.58667034", "text": "function diffByUnit(a, b, unit) {\n return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true\n unit);\n}", "title": "" }, { "docid": "56a87fd8f4915d4220a78b5b921b4404", "score": "0.58667034", "text": "function diffByUnit(a, b, unit) {\n return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true\n unit);\n}", "title": "" }, { "docid": "56a87fd8f4915d4220a78b5b921b4404", "score": "0.58667034", "text": "function diffByUnit(a, b, unit) {\n return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true\n unit);\n}", "title": "" }, { "docid": "56a87fd8f4915d4220a78b5b921b4404", "score": "0.58667034", "text": "function diffByUnit(a, b, unit) {\n return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true\n unit);\n}", "title": "" }, { "docid": "55495a851fd6c586a56d8812accfa171", "score": "0.5803601", "text": "function cycleAvg(len, a, b) {\n // If they're more than half away, go around back.\n if (Math.abs(a - b) > len / 2) {\n let max = Math.max(a, b)\n let min = Math.min(a, b)\n let avg = (max - len + min) / 2\n return Math.round(len + avg) % len\n }\n return Math.round((a + b) / 2)\n}", "title": "" }, { "docid": "c71fe7b837645a13d6498db475696ea4", "score": "0.5801836", "text": "function ha(a,b){return a.eventStartMS-b.eventStartMS}", "title": "" }, { "docid": "7b3658eb8ba5d9b92ff460f9edf2a929", "score": "0.5790607", "text": "function ComputeDurationFromDuration(_out, _in) {\n Equation.call(this, _out, _in);\n}", "title": "" }, { "docid": "9c603af8f3075b608f1378d6080643c1", "score": "0.5789049", "text": "function timeAdder(value1, label1, value2, label2) {\n\n // exit if one of times is lower than 0 \n // or one of units is invalid\n if ((value1<0 || value2<0) && \n (label1 !== null || undefined) && \n (label2 !== null || undefined)) {\n console.log('both time values must be higher' +\n ' than zero and time units correct.'); \n return;\n }\n\n // weight indicates if unit is bigger or smaller\n // (e.g. hour is bigger than seconds thats's why \n // you have to multiply hours to seconds to sum)\n const multiplyUnitsBy = [1, 60, 60, 24];\n let result = [];\n\n const time1 = {\n value: value1,\n units: label1,\n weight: null\n };\n\n const time2 = {\n value: value2,\n units: label2,\n weight: null\n };\n\n const time3 = {\n value: 0,\n units: null,\n multiplyToSeconds: 0,\n seconds: null,\n minutes: null,\n hours: null,\n days: null\n };\n\n const divideBy = {\n seconds: 1,\n minutes: 1,\n hours: 1,\n days: 1\n\n };\n\n\n /**\n * sets weight to time units - equals to index in an\n * array in multiplyUnits (used for multiplication in \n * case entered units have different values)\n */\n function setTimeUnitWeight(timeObj) {\n switch(timeObj.units) {\n case 'seconds' : \n timeObj.weight = 0; break;\n case 'minutes' : \n timeObj.weight = 1; break;\n case 'hours' : \n timeObj.weight = 2; break;\n case 'days' : \n timeObj.weight = 3; break;\n default :\n console.log('time unit doesn\\'t exists.');\n return;\n }\n }\n\n\n /**\n * counts summary of times, but first it converts higher\n * unit to lower unit to sum them together (multiply \n * unit's value with higher weight to have equal time\n * value in unit with lower weight)\n */\n function sumSameUnits(timeObj1, timeObj2) {\n \n let value3 = 0;\n let multiplication = 1;\n let label3 = timeObj1.units;\n\n // finds out multiplication for lower unit\n for (let i = timeObj1.weight;\n i <= timeObj2.weight; i++) {\n multiplication *= multiplyUnitsBy[i];\n }\n\n // assign result\n value3 = timeObj1.value + \n (timeObj2.value * multiplication);\n time3.value = value3;\n time3.units = label3;\n\n\n // recalculate summed time to seconds\n toSeconds();\n\n\n // write out and returns value with label\n console.log(value3 + ' ' + label3);\n\n return [value3, label3];\n }\n\n\n /**\n * Recalculate sum of both values to seconds\n * after that it counts days, hours, minutes\n * and seconds\n */\n function toSeconds() {\n if (time3.units === 'minutes') {\n time3.value *= multiplyUnitsBy[1];\n }\n if (time3.units === 'hours') {\n time3.value *= multiplyUnitsBy[1] * \n multiplyUnitsBy[2];\n }\n if (time3.units === 'days') {\n time3.value *= multiplyUnitsBy[1] * \n multiplyUnitsBy[2] * multiplyUnitsBy[3];\n }\n time3.units = 'seconds';\n\n Recalculate();\n }\n \n function Recalculate() {\n\n let rest\n // set division ammount\n if (divideBy.minutes === 'minutes') {\n divideBy.minutes *= multiplyUnitsBy[1];\n }\n if (divideBy.hours === 'hours') {\n divideBy.hours *= multiplyUnitsBy[1] * \n multiplyUnitsBy[2];\n }\n if (divideBy.days === 'days') {\n divideBy.days *= multiplyUnitsBy[1] * \n multiplyUnitsBy[2] * multiplyUnitsBy[3];\n }\n\n // gets number of days from seconds\n time3.days = Number.parseInt(\n time3.value / divideBy.days);\n // gets number of hours from seconds (count days and\n // substract number of hours in days)\n time3.hours = Number.parseInt(\n (time3.value / divideBy.hours) - (time3.days * \n multiplyUnitsBy[3])\n );\n // gets number of minutes from seconds (count days and\n // hours and substract number of minutes in days and \n // hours)\n time3.minutes = Number.parseInt(\n (time3.value / divideBy.minutes) - (time3.days * \n multiplyUnitsBy[3] + time3.hours * \n multiplyUnitsBy[2])\n );\n // gets number of minutes from seconds (count days and\n // hours and substract number of minutes in days, hours \n // and minutes)\n time3.seconds = Number.parseInt(\n (time3.value / divideBy.seconds) - (time3.days * \n multiplyUnitsBy[3] + time3.hours * \n multiplyUnitsBy[2] + time3.minutes * \n multiplyUnitsBy[1])\n );\n\n console.log(\n `Summary of ${time1.value} ${time1.units} and ${time2.\n value} ${time2.units} is:`);\n if (time3.days > 0) {\n console.log(`${time3.days} day(s),`); }\n if (time3.hours > 0) {\n console.log(`${time3.hours} hour(s),`); }\n if (time3.minutes > 0) {\n console.log(`${time3.minutes} minute(s),`); }\n if (time3.seconds > 0) {\n console.log(` ${time3.seconds} second(s).`); }\n }\n\n // set weight for time objects\n setTimeUnitWeight(time1);\n setTimeUnitWeight(time2);\n\n // compares weights and in case of inequality \n // calls function to recalculate values and sum\n if (time1.weight === time2.weight) {\n console.log('time summary is '+ ( \n time1.value + time2.value) + ' ' + time1.units + '.');\n } else if (time1.weight > time2.weight) {\n result = sumSameUnits(time2, time1);\n } else {\n result = sumSameUnits(time1, time2);\n }\n\n return result;\n}", "title": "" }, { "docid": "caa6a0f2a37e8521c24d6e36877e22f6", "score": "0.57852167", "text": "static halveDuration(selection) {\n const note = selection.note;\n let divisor = 2;\n const measure = selection.measure;\n const tuplet = measure.getTupletForNote(note);\n if (measure.numBeats % 3 === 0 && selection.note.tickCount === 6144) {\n // special behavior, if this is dotted 1/4 in 6/8, split to 3\n divisor = 3;\n }\n if (!tuplet) {\n const nticks = note.tickCount / divisor;\n if (!smoMusic.ticksToDuration[nticks]) {\n return;\n }\n var actor = new SmoContractNoteActor({\n startIndex: selection.selector.tick,\n tickmap: measure.tickmapForVoice(selection.selector.voice),\n newTicks: nticks\n });\n SmoTickTransformer.applyTransform(measure, actor, selection.selector.voice);\n smoBeamerFactory.applyBeams(measure);\n } else {\n const startIndex = measure.tupletIndex(tuplet) + tuplet.getIndexOfNote(note);\n const actor = new SmoContractTupletActor({\n changeIndex: startIndex,\n measure,\n voice: selection.selector.voice\n });\n SmoTickTransformer.applyTransform(measure, actor, selection.selector.voice);\n }\n }", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "d305d853046f3a6ca315c668456a8797", "score": "0.57794344", "text": "function diffByUnit(a, b, unit) {\n\treturn moment.duration(\n\t\tMath.round(a.diff(b, unit, true)), // returnFloat=true\n\t\tunit\n\t);\n}", "title": "" }, { "docid": "55a73ed2e3916ae4b4aafb50696e7f6d", "score": "0.5728211", "text": "function commonShortestDuration () {\n\n}", "title": "" }, { "docid": "c10c66d4b5110b7bd513468997127ed7", "score": "0.5670095", "text": "get duration() {}", "title": "" }, { "docid": "5be687d0cf6102918f048a5c124d9a12", "score": "0.56673187", "text": "function testDurations() {\n\n var a = tlC.impact.duration().toFixed(2);\n var b = tlN.jabbing.duration().toFixed(2);\n var c = tlC.stepPush.duration().toFixed(2);\n var d = tlN.backing.duration().toFixed(2);\n var e = tlC.strike.duration().toFixed(2);\n var f = tlN.getHit.duration().toFixed(2);\n\n // impact vs jabbing\n if (a === b) {\n console.log(\"Exactly the same\");\n } else {\n if (a < b) {\n console.log(\" IMPACT is smaller than JABBING : \" + (a - b));\n } else if (a > b) {\n console.log(\" IMPACT is bigger than JABBING : \" + (a - b));\n }\n }\n\n // StepPush vs Backing\n if (c === d) {\n console.log(\"Exactly the same\");\n } else {\n if (c < d) {\n console.log(\"STEPPUSH is smaller than BACKING : \" + (c - d));\n } else if (c > d) {\n console.log(\"STEPPUSH is bigger than BACKING : \" + (c - d));\n }\n }\n\n // Strike vs getHit\n if (e === f) {\n console.log(\"Exactly the same\");\n } else {\n if (e < f) {\n console.log(\"Strike is smaller than getHit : \" + (e - f));\n } else if (e > f) {\n console.log(\"Strike is bigger than getHit : \" + (e - f));\n }\n }\n}", "title": "" }, { "docid": "ba0d778a84c96693a9f9a6f306064d87", "score": "0.5662027", "text": "tD(duration) {\n return duration / this.duration * this.width;\n }", "title": "" }, { "docid": "a36e8492e55f7509d69dabfa5b831975", "score": "0.5655713", "text": "function speed(distance,time){\nreturn per1%per2;\n\n}", "title": "" }, { "docid": "611b4e6872b80ce5470714c76157fbce", "score": "0.56533736", "text": "function testDurations() {\n \n var a = tlC.impact.duration().toFixed(2);\n var b = tlN.jabbing.duration().toFixed(2);\n var c = tlC.stepPush.duration().toFixed(2);\n var d = tlN.backing.duration().toFixed(2);\n var e = tlC.strike.duration().toFixed(2);\n var f = tlN.getHit.duration().toFixed(2);\n\n // impact vs jabbing\n if (a === b) {\n console.log(\"Exactly the same\");\n } else {\n if ( a < b ) {\n console.log(\" IMPACT is smaller than JABBING : \" + ( a - b ));\n } else if ( a > b ) {\n console.log(\" IMPACT is bigger than JABBING : \" + ( a - b ));\n }\n }\n\n // StepPush vs Backing\n if (c === d) {\n console.log(\"Exactly the same\");\n } else {\n if ( c < d ) {\n console.log(\"STEPPUSH is smaller than BACKING : \" + ( c - d )); \n } else if ( c > d ) {\n console.log(\"STEPPUSH is bigger than BACKING : \" + ( c - d ));\n }\n }\n\n // Strike vs getHit\n if (e === f) {\n console.log(\"Exactly the same\");\n } else {\n if ( e < f ) {\n console.log(\"Strike is smaller than getHit : \" + ( e - f )); \n } else if ( e > f ) {\n console.log(\"Strike is bigger than getHit : \" + ( e - f ));\n }\n }\n\n}", "title": "" }, { "docid": "fdf1f733737003f16a17dfd4653b2fbf", "score": "0.56122", "text": "getScaledTime() {\n\n let t = this.timer / TRANSITION_TIME;\n if (this.fadeIn) t = 1.0 - t;\n return t;\n }", "title": "" }, { "docid": "ec5c7e6160bbdc51a2fdd7cd89d95a9c", "score": "0.56025124", "text": "function turnHoursToMinutes(duration){\n \n var timeChunks = duration.split(\" \");\n var a = calculateHours(timeChunks[0]);\n var b = calculateMinutes(timeChunks[1])\n // console.log(b)\n}", "title": "" }, { "docid": "a00e70ad952303fbcc1aee240b31416c", "score": "0.55959004", "text": "function videoTimeUpdateHandler0(e) {\n var perc = vid.currentTime / vid.duration;\n}", "title": "" }, { "docid": "3225fed7de53620d67a5490a879ca96e", "score": "0.55847025", "text": "function calculateTimeFraction(timeLeft) {\n return timeLeft / time;\n }", "title": "" }, { "docid": "07e1c9e9dcf2568af77f4845a7acec80", "score": "0.5584324", "text": "function multiplyDuration(startDuration, multiplier) {\n\n if(!isFinite(multiplier) || multiplier <= 0) {\n throw new Error('Invalid Multiplier');\n }\n\n var newDuration = {},\n hasTime = false,\n duration = '';\n\n if(startDuration.getSeconds()) {\n newDuration.seconds = Math.round(startDuration.getSeconds()*multiplier);\n }\n\n if(startDuration.getMinutes()) {\n newDuration.minutes = Math.round(startDuration.getMinutes()*multiplier);\n }\n\n if(startDuration.getHours()) {\n newDuration.hours = Math.round(startDuration.getHours()*multiplier);\n }\n\n if(startDuration.getDays()) {\n newDuration.days = Math.round(startDuration.getDays()*multiplier);\n }\n\n if(startDuration.getMonths()) {\n newDuration.months = Math.round(startDuration.getMonths()*multiplier);\n }\n\n if(startDuration.getYears()) {\n newDuration.years = Math.round(startDuration.getYears()*multiplier);\n }\n\n if(newDuration.seconds) {\n hasTime = true;\n duration = newDuration.seconds+'S'+duration;\n }\n\n if(newDuration.minutes) {\n hasTime = true;\n duration = newDuration.minutes+'M'+duration;\n }\n\n if(newDuration.hours) {\n hasTime = true;\n duration = newDuration.hours+'H'+duration;\n }\n\n if(hasTime) {\n duration = 'T'+duration;\n }\n\n if(newDuration.days) {\n duration = newDuration.days+'D'+duration;\n }\n\n if(newDuration.months) {\n duration = newDuration.months+'M'+duration;\n }\n\n if(newDuration.years) {\n duration = newDuration.years+'Y'+duration;\n }\n\n if(!duration) {\n throw new Error('Invalid Duration Multiplier');\n }\n\n return new Duration('P'+duration);\n\n}", "title": "" }, { "docid": "07e1c9e9dcf2568af77f4845a7acec80", "score": "0.5584324", "text": "function multiplyDuration(startDuration, multiplier) {\n\n if(!isFinite(multiplier) || multiplier <= 0) {\n throw new Error('Invalid Multiplier');\n }\n\n var newDuration = {},\n hasTime = false,\n duration = '';\n\n if(startDuration.getSeconds()) {\n newDuration.seconds = Math.round(startDuration.getSeconds()*multiplier);\n }\n\n if(startDuration.getMinutes()) {\n newDuration.minutes = Math.round(startDuration.getMinutes()*multiplier);\n }\n\n if(startDuration.getHours()) {\n newDuration.hours = Math.round(startDuration.getHours()*multiplier);\n }\n\n if(startDuration.getDays()) {\n newDuration.days = Math.round(startDuration.getDays()*multiplier);\n }\n\n if(startDuration.getMonths()) {\n newDuration.months = Math.round(startDuration.getMonths()*multiplier);\n }\n\n if(startDuration.getYears()) {\n newDuration.years = Math.round(startDuration.getYears()*multiplier);\n }\n\n if(newDuration.seconds) {\n hasTime = true;\n duration = newDuration.seconds+'S'+duration;\n }\n\n if(newDuration.minutes) {\n hasTime = true;\n duration = newDuration.minutes+'M'+duration;\n }\n\n if(newDuration.hours) {\n hasTime = true;\n duration = newDuration.hours+'H'+duration;\n }\n\n if(hasTime) {\n duration = 'T'+duration;\n }\n\n if(newDuration.days) {\n duration = newDuration.days+'D'+duration;\n }\n\n if(newDuration.months) {\n duration = newDuration.months+'M'+duration;\n }\n\n if(newDuration.years) {\n duration = newDuration.years+'Y'+duration;\n }\n\n if(!duration) {\n throw new Error('Invalid Duration Multiplier');\n }\n\n return new Duration('P'+duration);\n\n}", "title": "" }, { "docid": "cc680e6f2a92fb138d65efd5e263958b", "score": "0.55516183", "text": "getFadeDuration() {\r\n return 1/2;\r\n }", "title": "" }, { "docid": "dc35f9ab92c47a6f9731694a1063823f", "score": "0.55478716", "text": "calcTime(){\n const numIng = this.ingredients.length;\n const periods = Math.ceil (numIng / 3);\n this.time = periods *15;\n}", "title": "" }, { "docid": "3644badd86bc4bf3aa3628fceaf98e86", "score": "0.55395955", "text": "function converTime(a, b) {\n return b.timestamp.getTime() - a.timestamp.getTime();\n }", "title": "" }, { "docid": "c8720061057f002149b40747aa876829", "score": "0.5536133", "text": "doubleScalarMultVartime(a, A, b) {\r\n const aSlide = new Int8Array(256);\r\n const bSlide = new Int8Array(256);\r\n const ai = [\r\n new CachedGroupElement(),\r\n new CachedGroupElement(),\r\n new CachedGroupElement(),\r\n new CachedGroupElement(),\r\n new CachedGroupElement(),\r\n new CachedGroupElement(),\r\n new CachedGroupElement(),\r\n new CachedGroupElement()\r\n ]; // A,3A,5A,7A,9A,11A,13A,15A\r\n const t = new CompletedGroupElement();\r\n const u = new ExtendedGroupElement();\r\n const A2 = new ExtendedGroupElement();\r\n let i;\r\n this.slide(aSlide, a);\r\n this.slide(bSlide, b);\r\n A.toCached(ai[0]);\r\n A.double(t);\r\n t.toExtended(A2);\r\n for (i = 0; i < 7; i++) {\r\n t.add(A2, ai[i]);\r\n t.toExtended(u);\r\n u.toCached(ai[i + 1]);\r\n }\r\n this.zero();\r\n for (i = 255; i >= 0; i--) {\r\n if (aSlide[i] !== 0 || bSlide[i] !== 0) {\r\n break;\r\n }\r\n }\r\n for (; i >= 0; i--) {\r\n this.double(t);\r\n if (aSlide[i] > 0) {\r\n t.toExtended(u);\r\n t.add(u, ai[Math.floor(aSlide[i] / 2)]);\r\n }\r\n else if (aSlide[i] < 0) {\r\n t.toExtended(u);\r\n t.sub(u, ai[Math.floor(-aSlide[i] / 2)]);\r\n }\r\n if (bSlide[i] > 0) {\r\n t.toExtended(u);\r\n t.mixedAdd(u, CONST_BI[Math.floor(bSlide[i] / 2)]);\r\n }\r\n else if (bSlide[i] < 0) {\r\n t.toExtended(u);\r\n t.mixedSub(u, CONST_BI[Math.floor(-bSlide[i] / 2)]);\r\n }\r\n t.toProjective(this);\r\n }\r\n }", "title": "" }, { "docid": "953a9587f2c6a1a5c26e4bfa5892c358", "score": "0.54983914", "text": "function divideAssignTime() {\n hours = Math.floor(timer / 3600);\n minutes = Math.floor(timer % 3600 / 60);\n seconds = Math.floor(timer % 3600 % 60);\n hours = hours < 10 ? \"0\" + hours : hours;\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n $(\"#timeDisplay\").html(hours + \" : \" + minutes + \" : \" + seconds);\n}", "title": "" }, { "docid": "700f29790919275c4b6cb9e889218d4a", "score": "0.5486564", "text": "div(a, b) {\r\n return Math.round(a / b - 0.5);\r\n }", "title": "" }, { "docid": "65dc87fc39a7e435b6ed0be0a63e0d09", "score": "0.5459679", "text": "function v3_div_new(a, b) {\n return [ a[0] / b[0],\n a[1] / b[1],\n a[2] / b[2] ];\n}", "title": "" }, { "docid": "4f09911074f46bc66687165468715314", "score": "0.54595023", "text": "function converTime(a, b) {\n return a.timestamp.getTime() - b.timestamp.getTime();\n }", "title": "" }, { "docid": "492e523fea60c0e206c2e32a134d32f1", "score": "0.54570687", "text": "duration(dur) {\n return dur;\n }", "title": "" }, { "docid": "1a0abc2d1c0944ceddf65e5544ab3c81", "score": "0.54487276", "text": "function calcage(secs, num1, num2) {\n s = ((Math.floor(secs/num1))%num2).toString();\n if (s.length < 2)\n s = \"0\" + s;\n return \"<b>\" + s + \"</b>\";\n}", "title": "" }, { "docid": "907fba241c2debf40b7adc83da0fbb3f", "score": "0.5438955", "text": "div(a, b) {\n this.m[0] = a.m[0] / b.m[0];\n this.m[1] = a.m[1] / b.m[1];\n return this;\n }", "title": "" }, { "docid": "9ee5a1b70b18002f0ea7bed915d67452", "score": "0.5433353", "text": "function splitIntoTimeUnits(v, maxUnitIdx, minUnitIdx) {\n const units = {};\n var input = Math.abs(v);\n\n\n for (var i = maxUnitIdx; i <= minUnitIdx; i++) {\n const key = durationFormatOrder[i];\n const {value} = durationFormatElements[key];\n units[key] = i == minUnitIdx ? \n Math.round(input / value) :\n Math.floor(input / value);\n input -= units[key] * value;\n }\n return units;\n}", "title": "" }, { "docid": "482e271ae96fd9685daa8a420024d11e", "score": "0.53977394", "text": "get duration () {\n return nanoDiff(this.endTime, this.startTime);\n }", "title": "" }, { "docid": "089c047689b687ed1db734481b024a95", "score": "0.53731793", "text": "constructor(start, end, duration, startTime=0, type='linear'){\n\t\tthis.b = start;\n\t\tthis.c = end - start;\n\t\tthis.d = duration;\n\t\tthis.type = type;\n\t\tthis.startTime = startTime;\n\t}", "title": "" }, { "docid": "a009338d77d25271dafc599378af9425", "score": "0.5357256", "text": "function race(v1, v2, g) {\n \n if(v1>v2) return null;\n \n var decrease = v2-v1;\n var hours = g/decrease;\n var finalHours = hours < 1 ? 0 : Math.floor(hours);\n var minutes = hours * 60;\n var finalMinutes = Math.floor(minutes - (finalHours*60));\n var seconds = hours * 3600;\n var finalSeconds = Math.floor(seconds - (finalHours*3600) - (finalMinutes * 60) )\n var solution = [finalHours,finalMinutes,finalSeconds];\n \n return solution;\n}", "title": "" }, { "docid": "516e9ff2e7b5ee441d48f66e07e4d953", "score": "0.5352791", "text": "set deltaTime(value) {}", "title": "" }, { "docid": "d14e9254ed599613284e8ffed1bb3e30", "score": "0.53489006", "text": "mapTime(Time)\r\n {\r\n return Time / this.span;\r\n }", "title": "" }, { "docid": "379b02fc4795fb96e1307445356537d8", "score": "0.53388804", "text": "function Ea(a,b){return a.start-b.start}", "title": "" }, { "docid": "0c82f0ef17a6287b927f68dbc42bfb22", "score": "0.5330098", "text": "function linear(time, begin, change, duration) {\n \n var res= change * time / duration + begin;\n console.log('res',res,time, begin, change, duration);\n return res;\n}", "title": "" }, { "docid": "99700e0e540acd438ff6b560927ec5d5", "score": "0.53264564", "text": "toSeconds() {\n return 1 / super.toSeconds();\n }", "title": "" }, { "docid": "d5f29d69bfcad44372b535a118ed9f57", "score": "0.5324161", "text": "calcTime(){\n const numIng=this.ingredients.length;\n //Assuming that we need 15 minutes for 3 ingredients\n const periods=Math.ceil(numIng/3);\n this.time=periods * 15;\n }", "title": "" }, { "docid": "4466249b4c5347e8390493761b4e0dd0", "score": "0.5322578", "text": "function calculateTimeFraction(){\n const rawTimeFraction = timeleft / TIME_LIMIT;\n return rawTimeFraction - (1 / TIME_LIMIT) * (1 - rawTimeFraction);\n}", "title": "" } ]
3f4782016aa94898d88985a1a08ebd89
This callback method is called upon the success of the getGroup AJAX request. It fetches our project data and displays it in a very pretty format.
[ { "docid": "2f6d8cfd9dbb9effb8addcfdccba4268", "score": "0.7018671", "text": "function showGroup(data){\n var showString = \"\";\n showString += \"<div class = 'page-header'>\";\n showString += \"<h1 class = 'group-header'>\" + data.title + \"</h1>\";\n showString += \"</div>\";\n $.each(data.projects, function(i, project){\n showString += \"<div class = 'col-md-6'>\"\n showString += \"<article>\"\n showString += \"<a href = '\" + project.link + \"' target = '_blank'><h1>\" + project.name + \"</h1></a>\";\n showString += \"<p>\" + project.description + \"</p>\";\n showString += \"</article>\"\n showString += \"</div>\"\n })\n $('#projects').html(showString);\n\n}", "title": "" } ]
[ { "docid": "9e6b289ccf745ce7a5e0a7c56431ced1", "score": "0.7469429", "text": "function displayProjects(){\n\t$(\"#projects\").append(HTMLprojectCap);\n\tfor(entry in projects.project){\n\t$(\".project-guide\").append(HTMLprojectStart);\n\n\tvar formattedPTitle = HTMLprojectTitle.replace(\"%data%\", projects.project[entry].title);\n\t$(\".project-entry:last\").append(formattedPTitle);\n\n\tvar formattedPDates = HTMLprojectDates.replace(\"%data%\", projects.project[entry].dates);\n\t$(\".project-entry:last\").append(formattedPDates);\n\n\tvar formattedPDescription = HTMLprojectDescription.replace('%data%', projects.project[entry].description);\n\t$(\".project-entry:last\").append(formattedPDescription);\n\n\tvar formattedPUrl = HTMLprojectImage.replace(\"%data%\", projects.project[entry].images);\n\tvar formattedPUrl2 = formattedPUrl.replace(\"%atad%\", 'class=\"responsive-image\"');\n\t$(\".project-entry:last\").append(formattedPUrl2);\n\n}}", "title": "" }, { "docid": "45469355240d17efe03343c3cc078241", "score": "0.73205036", "text": "function displayProjects() {\r\n for (project in projects.projects) {\r\n $(\"#projects\").append(HTMLprojectStart);\r\n\r\n const formattedProjectTitle = HTMLprojectTitle.replace(\"%data%\", projects.projects[project].title);\r\n $(\".project-entry:last\").append(formattedProjectTitle);\r\n\r\n\r\n const formattedProjectDates = HTMLprojectDates.replace(\"%data%\", projects.projects[project].dates);\r\n $(\".project-entry:last\").append(formattedProjectDates);\r\n\r\n const formattedProjectDescription = HTMLprojectDescription.replace(\"%data%\", projects.projects[project].description);\r\n $(\".project-entry:last\").append(formattedProjectDescription);\r\n\r\n if (projects.projects[project].images.length > 0) {\r\n for (image in projects.projects[project].images) {\r\n const formattedProjectImage = HTMLprojectImage.replace(\"%data%\", projects.projects[project].images);\r\n $(\".project-entry:last\").append(formattedProjectImage);\r\n }\r\n }\r\n }\r\n\r\n }", "title": "" }, { "docid": "74079db96fef0bca897c187fc8c9c3e8", "score": "0.73169047", "text": "function displayProjects() {\n\tfor (var key in projects.projects) {\n\t\t$(\"#projects\").append(HTMLprojectStart);\n\n\t\tvar formattedTitle = HTMLprojectTitle.replace(\"%data%\", projects.projects[key].title);\n\t\t$(\".project-entry:last\").append(formattedTitle);\n\n\t\tvar formattedDescription = HTMLprojectDescription.replace(\"%data%\", projects.projects[key].description);\n\t\t$(\".project-entry:last\").append(formattedDescription);\n\n\t\tif (projects.projects[key].images.length > 0) {\n\t\t\tfor (var image in projects.projects[key].images) {\n\t\t\t\tvar formattedImage = HTMLprojectImage.replace(\"%data%\", projects.projects[key].images[image]);\n\t\t\t\t$(\".project-entry:last\").append(formattedImage);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "19d36ecd83a4f5c781716e652f2251d2", "score": "0.71870935", "text": "function getProjectsByName(title){\n\t$.ajax({\n\t\turl: \"https://testfirebase-1fb45.firebaseio.com/projects.json\",\n\t\tdata: {\n\t\t\tq: \"{title: '\" + title + \"'}\"\n\t\t},\n\t\ttype: \"get\"\n\t}).done(function(data){\n\t\tvar output = '<div>';\n\t\t$.each(data, function(key, data){\n output += '<div class=\"row\">';\n output += '<div class=\"col-lg-12\">';\n\t\toutput += '<h1 class=\"page-header\">'+data.title+'<br><small>Posted By: '+data.owner+'</small></h1>';\n output += '</div>';\n output += '</div>';\n output += '<div class=\"row\">';\n output += '<div class=\"col-md-8\">';\n output += '<img class=\"img-responsive\" src=\"../img/'+data.title+'.jpg\" alt=\"\">';\n output += '</div>';\n output += '<div class=\"col-md-4\">';\n output += '<h3>Project Description</h3>';\n output += '<p>'+data.description+'</p>';\n output += '<h3>Project Details</h3>';\n output += '<ul>';\n\t\toutput += '<li>Number of Members: '+data.numgroupmembers+'</li>';\n\t\toutput += '<li>Start Date: '+data.beginDate+'</li>';\n\t\toutput += '<li>End Date: '+data.endDate+'</li>';\n\t\toutput += '</ul>';\n output += '</div>';\n\t\toutput += '</div>';\n\t\t});\n\t\toutput += '</div>';\n\t\t$('#projectsbyname').html(output);\n\t});\n}", "title": "" }, { "docid": "c1fe9475e5d2be289f7c3de2bb6da144", "score": "0.70024", "text": "function getGroup(group_id){\n // This merely displays a very fancy loader on our DOM in order to let the users know their content is loading...\n $('#projects').html(\"<div class = 'loader'>Loading Content...</div>\")\n $.ajax({\n url:\"http://www.joshualnichols.com/api/v1/project_groups/\" + group_id,\n dataType: 'json',\n cache: true,\n success: showGroup\n })\n}", "title": "" }, { "docid": "a94e571a6ee281436ec744e27749f62f", "score": "0.6959029", "text": "function getProject() {\n\n\t\t$.getJSON('../assets/json/data.json', function(data) {\n\t\t\tvar section = $('.project-details'),\n\t\t\t\tprojectPanel = $('.projects');\n\t\t\t// Getting template for thumbnails\n\t\t\t$.get('../assets/template/project-thumbs.html', function(template) {\n\t\t\t\tvar itemView = Mustache.to_html(unescape(template), data);\n\n\t\t\t\tprojectPanel.html(itemView);\n\t\t\t});\n\t\t\t// Getting project details template \n\t\t\t$.get('../assets/template/project-list.html', function(template) {\n\t\t\t\tvar renderedView = Mustache.to_html(unescape(template), data);\n\n\t\t\t\tsection.html(renderedView);\n\t\t\t}).always(function() {\n\n\t\t\t\t// Triggering hashtag id for each project when ajax completed\n\t\t\t\t$('.project-item').on('click', function() {\n\n\t\t\t\t\tvar thumbID = $(this).data('project');\n\n\t\t\t\t\t$('html, body').animate({ \n\t\t\t\t\t\tscrollTop: 0 \n\t\t\t\t\t}, 800,'easeInOutExpo');\n\n\t\t\t\t\tconsole.log(thumbID);\n\t\t\t\t\t$popup.addClass('active fadeInUpBig');\n\n\t\t\t\t\t// The associated project ID shows the related content\n\t\t\t\t\t$('#' + thumbID).addClass('show');\n\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t\t$closeBtn.on('click', function() {\n\n\t\t\t\t\t$popup.removeClass('active fadeInUpBig');\n\t\t\t\t\t$('.item').removeClass('show');\n\n\t\t\t\t\treturn false;\n\n\t\t\t\t});\n\t\t\t});\n\n\t\t}).fail(function(jqXhr, textStatus, error) {\n\n\t\t\tconsole.log(\"ERROR: \" + textStatus + \", \" + error);\n\t\t});\n\n\t}", "title": "" }, { "docid": "cade40972ccfca4c1d661c5b48f98565", "score": "0.6838161", "text": "function DisplayProj(data){\n\n // //just to check we got the right data\n console.log(data);\n\n // All to be placed into element with id proj-container\n var container = $(\"#projs-container\");\n\n // Displays an error message if the data passed isn't good\n if (!Array.isArray(data))\n {\n console.log(data);\n container.append($(CreateEl(\"h2\")).html(\"Something went wrong! get request received bad data\"));\n \n }\n\n // Constructs all the html project elements\n data.forEach(proj_dets => {\n // something messed up and we didn't get a dictionary\n if (!(typeof proj_dets === 'object') || proj_dets == null)\n return;\n\n // create a container for the given project\n var spec_proj = $(CreateEl(\"div\", [])).addClass(\"cs-proj\");\n\n // create the container for title and project type\n var titlecont = $(CreateEl(\"div\")).addClass(\"proj-disp\");\n // create the title h2\n if ('title' in proj_dets)\n {\n elem = $(CreateEl(\"h2\")).html(proj_dets['title']);\n titlecont.append(elem);\n }\n // create projtype h3\n if ('type' in proj_dets)\n {\n elem = $(CreateEl(\"h3\")).html(proj_dets['type']);\n titlecont.append(elem);\n \n // append to project div\n titlecont.append(CreateEl(\"hr\"));\n }\n // append to project div\n spec_proj.append(titlecont);\n\n \n\n // create description p\n if ('desc' in proj_dets)\n {\n elem = $(CreateEl(\"p\")).html(proj_dets['desc']).addClass(\"desc\");\n\n // append description to project div\n spec_proj.append(elem);\n }\n\n\n // create languages ul\n if ('languages' in proj_dets)\n {\n langs = $(CreateEl(\"div\", [])).addClass(\"prog-langs\");\n langs.append($(CreateEl(\"h4\")).html(\"Languages:\"));\n\n // create unordered list\n ul = $(CreateEl(\"ul\"));\n\n // split languages elem by commas\n // create a li for each language and append to ul\n console.log(proj_dets['languages'].split(\", \"));\n proj_dets['languages'].split(\", \").forEach(element => {\n elem = $(CreateEl(\"li\")).html(element);\n\n //append to ul\n ul.append(elem);\n });\n\n // append ul to project div\n langs.append(ul);\n spec_proj.append(langs);\n }\n\n // create code link button\n if ('repo_link' in proj_dets)\n {\n elem = $(CreateEl(\"button\", [\n ['title', proj_dets['repo_link']]\n ])).html(\"View Code\").addClass(\"code-butt\");\n \n // append button to project div\n spec_proj.append(elem);\n\n // add a callback for that button push event\n elem.on(\"click\", () => {\n //\n open(proj_dets['repo_link']);\n });\n }\n\n // Append project to the projects container\n container.append(spec_proj);\n });\n \n \n\n}", "title": "" }, { "docid": "830062ad3d817ea0876c41083801348f", "score": "0.6788498", "text": "function displayProjects() {\r\n var projects = window.pmApi.getProjects();\r\n document.getElementById(\"projects\").innerHTML = \"\";\r\n projects.forEach(project => {\r\n createProjectElement(project);\r\n });\r\n}", "title": "" }, { "docid": "d659828e4d0465a2f3b32e5aa5463620", "score": "0.6772794", "text": "function getGroups(){\n $.ajax({\n url:\"http://www.joshualnichols.com/api/v1/project_groups\",\n dataType: 'json',\n cache: true,\n // Upon the success of the request, the function 'showGroups' will be called.\n success: showGroups\n })\n}", "title": "" }, { "docid": "c31b8cd724e3857a69dd63a99f21c19c", "score": "0.6680049", "text": "function load_projects() {\n var xmlhttp = new XMLHttpRequest();\n \n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var projects = JSON.parse(this.responseText);\n var count = 0;\n var left = false;\n\n for ([key, value] of Object.entries(projects)) {\n if (count < 4) {\n // Fill highlights\n if (left) {\n feature_project(value, 'left');\n } else {\n feature_project(value, 'right');\n }\n left = !left;\n count += 1;\n } else {\n project_grid(value);\n }\n }\n }\n };\n \n xmlhttp.open(\"GET\", \"/v6/projects/project_info.php?get_list=1\", true);\n xmlhttp.send();\n }", "title": "" }, { "docid": "527c84206c28639fe7144764fa912a62", "score": "0.6655366", "text": "function printProjectData() {\n \n }", "title": "" }, { "docid": "9715600dae1a0f90abd8aee8ffdafb24", "score": "0.66399026", "text": "function getProjects(on_success) {\n fetch(baseUrl + 'api/index.cgi?method=get_projects', {\n method: 'get',\n credentials: 'include'\n }).then(function(response) {\n\n response.json().then(function(json) {\n console.log(json);\n on_success(json.results);\n });\n\n }).catch(function(err) {\n console.log(err);\n });\n}", "title": "" }, { "docid": "c1e8993ab69337235a551d4c7fe2f868", "score": "0.66265035", "text": "loadProjects()\n\t{\n\t\tconsole.log('----- loadProjects -----');\n\t\t// INSERT YOUR CODE BELOW THIS LINE\n\n\t\tthis.api.makeRequest(\"GET\", \"companies/64/projects\", {}, this.fillProjectsWithResponse);// sends GET request via api\n\t\t\n\t}", "title": "" }, { "docid": "6c2be89536627ef4a68d42fb8a31b74b", "score": "0.6620981", "text": "function getMyProject(){\n $.ajax({\n url : `http://localhost:3000/project`,\n method : \"GET\",\n headers : {\n token : localStorage.getItem('token')\n }\n })\n .done(data =>{\n $(\"#myProject\").empty();\n data.forEach(element => {\n $(\"#myProject\").append(`\n <a class=\"list-group-item list-group-item-action\" onclick=\"showProject('${element._id}')\">\n <h5 class=\"mb-1\">${element.title}</h5>\n <div class=\"d-flex w-100 justify-content-between\">\n <small class=\"text-muted\"><i class=\"fa fa-users\"></i> Members (${element.members.length})</small>\n <small class=\"text-muted\"><i class=\"fa\">&#xf007;</i> Owner: ${element.owner.email}</small>\n </div>\n </a>\n <hr />\n `);\n });\n })\n}", "title": "" }, { "docid": "6c35491f0d42c5bee926b5f40618ee76", "score": "0.6616915", "text": "function listProjects(username, url, expedition) {\n var jqxhr = $.getJSON(url\n ).done(function (data) {\n if (!expedition) {\n var html = '<h1>Project Manager (' + username + ')</h2>\\n';\n } else {\n var html = '<h1>Expedition Manager (' + username + ')</h2>\\n';\n }\n var expandTemplate = '<br>\\n<a class=\"expand-content\" id=\"{project}-{section}\" href=\"javascript:void(0);\">\\n'\n + '\\t <img src=\"' + appRoot + 'images/right-arrow.png\" id=\"arrow\" class=\"img-arrow\">{text}'\n + '</a>\\n';\n $.each(data, function (index, element) {\n key = element.projectId;\n val = element.projectTitle;\n var project = val.replace(new RegExp('[#. ()]', 'g'), '_') + '_' + key;\n\n html += expandTemplate.replace('{text}', element.projectTitle).replace('-{section}', '');\n html += '<div id=\"{project}\" class=\"toggle-content\">';\n if (!expedition) {\n html += expandTemplate.replace('{text}', 'Project Metadata').replace('{section}', 'metadata').replace('<br>\\n', '');\n html += '<div id=\"{project}-metadata\" class=\"toggle-content\">Loading Project Metadata...</div>';\n html += expandTemplate.replace('{text}', 'Project Expeditions').replace('{section}', 'expeditions');\n html += '<div id=\"{project}-expeditions\" class=\"toggle-content\">Loading Project Expeditions...</div>';\n html += expandTemplate.replace('{text}', 'Project Users').replace('{section}', 'users');\n html += '<div id=\"{project}-users\" class=\"toggle-content\">Loading Project Users...</div>';\n } else {\n html += 'Loading...';\n }\n html += '</div>\\n';\n\n // add current project to element id\n html = html.replace(new RegExp('{project}', 'g'), project);\n });\n if (html.indexOf(\"expand-content\") == -1) {\n if (!expedition) {\n html += 'You are not an admin for any project.';\n } else {\n html += 'You do not belong to any projects.'\n }\n }\n $(\".sectioncontent\").html(html);\n\n // store project id with element, so we don't have to retrieve project id later with an ajax call\n $.each(data, function (index, element) {\n key = element.projectId;\n val = element.projectTitle;\n var project = val.replace(new RegExp('[#. ()]', 'g'), '_') + '_' + key;\n\n if (!expedition) {\n $('div#' + project + '-metadata').data('projectId', key);\n $('div#' + project + '-users').data('projectId', key);\n $('div#' + project + '-expeditions').data('projectId', key);\n } else {\n $('div#' + project).data('projectId', key);\n }\n });\n }).fail(function (jqxhr) {\n $(\".sectioncontent\").html(jqxhr.responseText);\n });\n return jqxhr;\n\n}", "title": "" }, { "docid": "84736867089369189eeccaf82719e743", "score": "0.6539536", "text": "function GetAllProjects() {\r\n debugger;\r\n var getData = apiService.getList(\"Project/getAllProj\");\r\n debugger;\r\n getData.then(function (proj) {\r\n $scope.projects = proj.data;\r\n }, function () {\r\n alert('Error in getting records');\r\n });\r\n }", "title": "" }, { "docid": "1ba2704a23008dd0a241ba4f3904bed4", "score": "0.6523752", "text": "function getProjectsByCategory(category){\n\t$.ajax({\n\t\turl: \"https://testfirebase-1fb45.firebaseio.com/categories/\"+category+\".json\",\n\t\ttype: \"get\"\n\t}).done(function(data){\n\t\tvar output = '<div>';\n\t\t$.each(data, function(key, data){\n\t\t\toutput += '<div class=\"row\">';\n output += '<div class=\"col-md-5\">';\n output += '<h3>'+data.title+'</h3>';\n output += '<h4>Posted by: '+data.owner+'</h4>';\n output += '<p>'+data.description+'</p>';\n output += '<a class=\"btn btn-primary\" href=\"'+data.title+'.html\">View Project <span class=\"glyphicon glyphicon-chevron-right\"></span></a>'; //change to url with parameter, add ?title=data.title\n output += '</div>';\n\t\t\toutput += '</div>';\n\t\t\toutput += '<hr>';\n\t\t});\n\t\toutput += '</div>';\n\t\t$('#projectsbycategory').html(output);\n\t});\n}", "title": "" }, { "docid": "2fb0e1f37992eae8196e07f06e2bbb19", "score": "0.6521884", "text": "function getProjects() {\n fetch('http://localhost/web3api2020-master/src/model/projects.php', {\n method: 'GET'\n })\n .then(response => response.json())\n .then(projects => {\n fetchedProjects = projects;\n document.querySelector('#projectList').innerHTML = '';\n\n projects.forEach(function(project) {\n document.querySelector('#projectList').innerHTML += `\n <tr>\n <td>${project.startdate} - ${project.enddate}</td>\n <td>${project.project}</td>\n <td>${project.title}</td>\n <td>${project.description}</td>\n <td><button onClick=\"openUpdateProjectModal(${project.id})\">Update</button></td>\n <td><button onClick=\"openDeleteProjectModal(${project.id})\">Delete</button></td>\n </tr>\n `;\n });\n });\n}", "title": "" }, { "docid": "4fe8b48c02b3c85ccdd9e8fa380eebd2", "score": "0.64468634", "text": "function loadproject() {\n // getting the data from the database\n $.ajax({\n url: '../../userpagewebservices/user_profile_main.asmx/loadproject',\n method: 'post',\n dataType: 'json',\n data: { requestuserdetails: requestUser },\n cache: 'false',\n processData: 'false',\n beforeSend: function () {\n $(\"#project-loader\").css(\"display\", \"block\");\n },\n success: function (data) {\n var count = Object.keys(data).length;\n $(\"#total_project\").html(count);\n $(\"#project-loader\").css(\"display\", \"none\");\n if (data.length == 0) {\n $(\".no-project-data\").css(\"display\", \"block\");\n $(\"#hide-project-div\").css(\"display\", \"none\");\n }\n else {\n ProfileComplete = ProfileComplete + 15;\n $(\".no-project-data\").css(\"display\", \"none\");\n $(\"#hide-project-div\").css(\"display\", \"block\");\n $(data).each(function (index, item) {\n $('<div class=\"user-profile-data\"> <ul><li><p id=\"projectname_' + item.id + '\" data-quali = \\\"' + item.projectname + '\\\" >' + item.projectname + '</p></li><li id=\"project_type_' + item.id + '\">' + item.projecttype + '<p></li><li id=\"noprojectlink_' + item.id + '\"><p><a href=' + item.projectlink + ' >Project Link : ' + item.projectlink + '</a><p></li><li>' + item.dates + '</p></li><li id=\"project_nohighlight_' + item.id + '\" > <b>Project Description</b><p id=\"project_details_' + item.id + '\" class=\"profile-user-main-description\"></p><a id=\"project_showmore_' + item.id + '\" data-projectid = ' + item.id + ' class=\"show-projectdescription\">show more.... </a></li><li id=\"noprojecttext_' + item.id + '\"><b> Project teams </b> </li><li id=\"loadteammemberslist_' + item.id + '\"><ul class=\"project-team-member\" id=\"loadteammembersload_' + item.id + '\" ></ul> <li></ul> <div class=\"profile-data-options\"> <span class=\"fa fa-ellipsis-v dropdown-toggle\" role=\"button\" data-toggle=\"dropdown\"></span><ul class=\"dropdown-menu dropdown-menu-right text-center\"><li class=\"see-project-team\" data-projectid = ' + item.id + ' id=\"project_teamoptionbutton_' + item.id + '\">Add project members </li><li class=\"remove-project\" >Remove project</li></ul></div> </div></div>').appendTo($(\".load-project-data\"));\n\n if (item.description == \"\") {\n $(\"#project_nohighlight_\" + item.id).css(\"display\", \"none\");\n $(\"#project_showmore_\" + item.id).css(\"display\", \"none\");\n }\n else {\n if (item.description.length > 300) {\n projectdetails = item.description.substring(0, 289).replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '<br />');\n $(\"#project_showmore_\" + item.id).css(\"display\", \"block\");\n $(\"#project_details_\" + item.id).html(projectdetails);\n }\n else {\n $(\"#project_details_\" + item.id).html(item.description.replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '<br />'));\n $(\"#project_showmore_\" + item.id).css(\"display\", \"none\");\n }\n }\n if (item.projectlink == \"\") {\n $(\"#noprojectlink_\" + item.id).css(\"display\", \"none\");\n }\n\n loadprojectteammember(item.id);\n });\n }\n },\n error: function (err) {\n $(\".no-project-data\").css(\"display\", \"block\");\n $(\"#hide-project-div\").css(\"display\", \"none\");\n $(\"#project-loader\").css(\"display\", \"none\");\n }\n });\n\n }", "title": "" }, { "docid": "ece3cb4ea9d88fb7e5253ac81e64dd1d", "score": "0.64362156", "text": "loadProjects()\n\t{\n\t\tconsole.log('----- loadProjects -----');\n\t\t// INSERT YOUR CODE HERE\n\t\t//call the TimeTrackerApi to handle api request.\n\t\tapi.makeRequest('GET', `/t-api/companies/${this.company_id}/projects`, {}, this.fillProjectsWithResponse.bind(this));\n\t}", "title": "" }, { "docid": "c579b41edc4c580e4ab7e632ba8d40af", "score": "0.640662", "text": "function listProjects () {\n\t$.ajax ({\n\t\turl: '/api/results',\n\t\ttype: 'get',\n\t\t//data: null,\n\t\tcontentType: 'application/json',\n\t\tcomplete: null\n\t}).done (function (results) {\n\t\tfor ( var i =0 ; i < results.length ; i++ )\n\t\t\tcreateProjectVignette (results [i].key, results [i]) ;\n\t}) ;\n}", "title": "" }, { "docid": "66383c2592059261b7034fc8688a7470", "score": "0.63838035", "text": "loadProjects()\n\t{\n\t\tconsole.log('----- loadProjects -----');\n\t\t// INSERT YOUR CODE HERE\n\t\tapi.makeRequest('GET', `/t-api/companies/${this.company_id}/projects`, {}, this.fillProjectsWithResponse.bind(this));\n\n\t\tif(this.projects!= null)\n\t\t{\n\t\t\tthis.loadTimeEntries();\n\t\t}\n\n\t}", "title": "" }, { "docid": "9083b5e15df2ab51cbd5dc818cae486d", "score": "0.63664323", "text": "function loadGUI_Projects(){\n PN = returnProjectNames();\n var contentStr=\"\";\n for (i=0;i<PN.length; i++){\n contentStr += '<li id=\"'+PN[i].id+'\" class=\"swProjectRow\" onclick=\"swNavSelectProject(this)\">'+PN[i].title+'</li>';\n }\n $(\"\")\n $(\"#swProjects\").html(contentStr);\n}", "title": "" }, { "docid": "207a3bead669dc34eee87fbe022e6d1c", "score": "0.6361328", "text": "showProjects() { \n\t\tvar content = [];\n\t\tif(!this.user) { \n\t\t\treturn content;\n\t\t}\n\t\tcontent = this.state.projects.map((project) => {\n\t\treturn(\n\t\t\t<div key={project._id} className=\"field has-addons\">\n\t\t\t\t<li className = \"level\" key={project}>{project.name}\n\t\t\t\t\t<div className=\"column is-one-quarter\">\n\t\t\t\t\t <button className=\"button is-danger\" onClick={() =>{\n\t\t\t\t\t \tthis.onRemoveProject(project)\n\t\t\t\t\t \t}}>Leave project\n\t\t\t\t\t </button>\n\t\t\t\t\t</div>\n\t\t\t\t</li> \n\t\t\t</div>\n\t\t\t)\t\t\n\t\t})\n\t\treturn content;\n\t}", "title": "" }, { "docid": "828a67ae638db910817f1aeb1aa2ed34", "score": "0.63580734", "text": "function populateProjectDetails( project ) {\n\n\tvar currentProject = json[ project ];\n\n\tprojectImage1.element.innerHTML = '<img class=\"shown\" src=' + currentProject.img1 + ' />';\n\tprojectImage2.element.innerHTML = '<img src=' + currentProject.img2 + ' />';;\n\tprojectImage3.element.innerHTML = '<img src=' + currentProject.img3 + ' />';;\n\tprojectImage4.element.innerHTML = '<img src=' + currentProject.img4 + ' />';;\n\n\tprojectText1.element.innerHTML = currentProject.text1;\n\tprojectText2.element.innerHTML = currentProject.text2;\n\tprojectText3.element.innerHTML = currentProject.text3;\n\tprojectText4.element.innerHTML = currentProject.text4;\n\n}", "title": "" }, { "docid": "cf01ba3a7f7ffcb3227f35a9fe6a0419", "score": "0.6332593", "text": "function handleProjectList(data) {\n let currData = data[0],\n keys = Object.keys(currData),\n elems = [];\n\n for (let i=0; i<keys.length; ++i) {\n let project = currData[keys[i]],\n dash = new orch.dashboard.ProjectDashboard(project);\n\n elems.push(dash.render());\n dash.collapse();\n registerDashboard(dash);\n\n // Bind the socket to the dashboard so it knows about it\n dash.socket(orch.globals.socket);\n }\n\n $(\"#dashboard\").append(elems);\n }", "title": "" }, { "docid": "de7e05c02aedaedc3032d64ff6570467", "score": "0.63313884", "text": "function updateProjectList() {\r\n updateProjectDiv()\r\n}", "title": "" }, { "docid": "2c9f02b88867ff7f9fe5e3766cd8ab7a", "score": "0.6327687", "text": "function showProjectCards() {\r\n var html = '';\r\n\r\n projectData.forEach(function(project) {\r\n html += '<div class=\"col-sm-6 col-md-4\">';\r\n html += '<div class=\"card effect_click\"><div class=\"card_front\">';\r\n html += '<figure><img class=\"img-responsive\" src=\"' + project.image[0] + '\">';\r\n html += '<figcaption class=\"project-title\">';\r\n html += project.title;\r\n html += '</figcaption></figure></div>';\r\n\r\n html += '<div class=\"card_back\"><figure>';\r\n html += '<div class=\"project-title\">' + project.title + '</div>';\r\n html += '<figcaption\">';\r\n html += '<div class=\"project-body\">' + project.text + '</div>';\r\n html += '<div><a data-toggle=\"tooltip\" title=\"' + project.site[0][0] + '\" data-placement=\"top\" href=\"' + project.site[0][2] + '\" target=\"_blank\" class=\"btn btn-primary btn-lg btn-circle btn-lnk btn-lnk0\"><i class=\"fa ' + project.site[0][1] + '\" aria-hidden=\"true\"></i></a>';\r\n\r\n if (typeof project.site[1] !== 'undefined') {\r\n html += '<a data-toggle=\"tooltip\" title=\"' + project.site[1][0] + '\" data-placement=\"top\" href=\"' + project.site[1][2] + '\" target=\"_blank\" class=\"btn btn-primary btn-lg btn-circle btn-lnk btn-lnk1\"><i class=\"fa ' + project.site[1][1] + '\" aria-hidden=\"true\"></i></a>';\r\n }\r\n\r\n html += '</div></figcaption></figure></div>';\r\n html += '</div>';\r\n html += '</div>';\r\n });\r\n\r\n $('#theProjects').append(html);\r\n addListener();\r\n }", "title": "" }, { "docid": "cdec050e313f6ce852b10f976bd140d9", "score": "0.62686044", "text": "function parseProjectDetails() {\n\n\tvar jqxhr = $.getJSON( \"json/projects.json\", function( data ) {\n\t\tjson = data;\n\t addProjectDetailPlanes();\n\t})\n\t.fail(function() {\n\t\tconsole.log( \"error getting json \" );\n\t});\n\n}", "title": "" }, { "docid": "7eed1621390bfcb25a58184e5bddf12d", "score": "0.62311965", "text": "function getAllProjects(callback) {\n let projRequest = new XMLHttpRequest();\n let url = connectUrl + \"/getProjects/\";\n projRequest.open('POST', url);\n projRequest.setRequestHeader(\"Content-type\", \"application/json\");\n projRequest.responseType = \"json\";\n projRequest.onload = function() {\n //$('#loading').modal('hide');\n var status = projRequest.response.status;\n if(status == 0) {\n console.log(\"System is broken. Invalid key. Try refreshing...\");\n } else {\n status.forEach(element => {\n let project = new Project( element.title, element.startDate, \n element.dueDate, element.expectedTimeHours,\n element.expectedTimeMinutes, element.description,\n element.timeRemaining, element.color);\n \n user.addProject(project);\n });\n }\n callback();\n }\n projRequest.send(JSON.stringify({\"key\": new URL(window.location.href).searchParams.get('key')}));\n //$('#loading').modal('show');\n}", "title": "" }, { "docid": "11b9382b40abe086b1995c306afa3a85", "score": "0.62300134", "text": "function displayProject(projectID) {\n\n // make an ajax call to get a single project object\n $.ajax({\n method: 'GET',\n url: '/api/projects/' + projectID,\n success: returnProject,\n error: function() {\n console.log(\"error getting project id:\", projectID);\n }\n });\n\n //returns an entire project\n function returnProject(json) {\n\n var projectName = json[0].name;\n $(\".project-name\").text(projectName);\n var backgroundImgString = `url(\\\"${json[0].photoURL}\\\")`;\n $('.banner2').css('background-image', backgroundImgString);\n var daysRemaining = getDaysRemaining(json);\n $(\".project-days-remaining\").text(daysRemaining);\n $(\"#items-list\").empty();\n\n // make an ajax call to get all items for this project\n $.ajax({\n method: 'GET',\n url: '/api/projects/' + projectID + '/items',\n success: function(json) {\n\n renderMultipleItems(json);\n },\n error: function() {\n console.log(\"error getting project items for project:\", projectID);\n }\n });\n\n\n // days remaining counter\n function getDaysRemaining(json) {\n\n var startDate = json[0].startDate;\n var numDaysToComplete = json[0].numDaysToComplete;\n\n // convert the start date into a moment object\n var startDate = moment(Date.parse(startDate));\n\n // save the current date as a moment object\n var today = moment().startOf('day');\n\n // calculate and save the finish date as a moment object\n var finishDate = startDate.clone().add(numDaysToComplete, 'days');\n\n // calculate and save the difference between the current date and the finish date\n var daysUntilFinish = finishDate.diff(today, 'days');\n\n // return the string - if it is passed the finish date / deadline, return a different message otherwise indicate the number of days remaining\n if (daysUntilFinish >= 0) {\n return `You have ${daysUntilFinish} days to finish this project`;\n } else {\n return `This project is now passed the due date`;\n }\n }\n }\n}", "title": "" }, { "docid": "ee843fb88737ea187dda75d215a4bf82", "score": "0.62254673", "text": "function _getProjects (cb) {\n _gitlabRequest('GET', '/projects?per_page=100', cb);\n }", "title": "" }, { "docid": "de8e30f92e252e35f155677e07d48b21", "score": "0.6206634", "text": "function showProjects() {\n\t\n\tvar xhttp = new XMLHttpRequest();\n\txhttp.onreadystatechange = function(){\n\t\tif (this.readyState == 4 && this.status == 200) {\n\t\tdocument.getElementsByClassName(\"accounts\")[0].style.display = \"none\";\n\t\tdocument.getElementsByClassName(\"projects\")[0].style.display = \"block\";\n\t\tvar text = this.responseText;\n\n var obj = $.parseJSON(text);\n\t\tvar out = \"\";\n\t\tout += \"<table class='table table-hover table-bordered'>\";\n\t\tout += createProjectTableHeaders();\n\t\tout += \"<tbody>\"; \n\t\t$.each(obj, function(key,value) {\n\t\t\tvar id = obj[key].id;\n\t\t\tvar project_name = obj[key].project_name;\n\n\t\t\tout += \"<tr>\";\n\t\n out += \"<td>\"+project_name+\"</td>\";\n\t\t\tout += \"<td><button class='btn btn-default' id='updBtn' type='submit' onclick=showUpdateProjectForm('\"+id+\"','\"+project_name+\"');>Update</button>\";\n\t\t\tout += \"<button class='btn btn-default' type='submit' value='detail' onclick=deleteProject('\"+id+\"')>Delete</button>\";\n out += \"</tr>\";\n\n\t\t\t})\n\t\t\t\t\tout += \"</tbody>\";\n\t\t\t\t\tout += \"</table>\";\n\t\t\t\t\tdocument.getElementById(\"project_content\").innerHTML = out;\n\t\t}\n\t};\n\txhttp.open(\"GET\", \"project.php\", true);\n\txhttp.send();\n\t\n\t\n}", "title": "" }, { "docid": "be957c708122f34b162b1f421d7dbb8b", "score": "0.6198319", "text": "function projectNav(project) {\r\n\r\n var projectGrid = project.parent(),\r\n projectTitle = project.attr('id'),\r\n projectPreloaded = projectData[projectTitle] !== undefined;\r\n\r\n WorkModule.collapseAllProjects();\r\n\r\n // TODO: Make this scroll to the correct position\r\n // collapse bio if it's not collapsed\r\n // $('#show-more-bio').removeClass('more-bio--bio-hidden');\r\n // $('.bio').addClass('bio-hidden');\r\n\r\n\r\n expandedProjIndex = $.inArray(window.location.hash.replace('#',''), projects);\r\n\r\n if (expandedProjIndex !== undefined && expandedProjIndex !== -1) {\r\n\r\n // fade page content\r\n // scroll to top\r\n $('html,body').animate({\r\n scrollTop: $('#project-detail-container').offset().top\r\n }, 250);\r\n\r\n $('body').addClass('is-expanded-view');\r\n\r\n $('#' + projectTitle)\r\n .removeClass('is-thumb')\r\n .addClass('is-expanded');\r\n\r\n if(projectPreloaded) {\r\n $('#project-detail-container')\r\n .html(projectData[projectTitle].projectHTML)\r\n .addClass('fadeIn');\r\n } else {\r\n $.ajax({\r\n url: 'work/' + projectTitle + '.html',\r\n success: function(data) {\r\n projectData[projectTitle] = {\r\n projectHTML: data\r\n };\r\n $('#project-detail-container')\r\n .html(projectData[projectTitle].projectHTML)\r\n .addClass('fadeIn');\r\n }\r\n });\r\n }\r\n\r\n } else {\r\n WorkModule.collapseAllProjects();\r\n }\r\n\r\n }", "title": "" }, { "docid": "b02e2ef7e6e0501597df427c3425edc8", "score": "0.6193758", "text": "function loadProjects(response){\n var source = $('#project-template').html();\n var template = Handlebars.compile(source);\n response.forEach(function(object){\n var projectHtml = template({\n name: object.name,\n screenshot: object.screenshot\n })\n $('#project-container').append(projectHtml);\n })\n }", "title": "" }, { "docid": "186a19828384451420897af7bd82c8ba", "score": "0.6184778", "text": "function getProjectsByResourceID(resourceID, on_success) {\n var url = baseUrl + 'api/index.cgi?method=get_projects' + '&ip_block_id=' + resourceID.toString();\n fetch(url, {\n method: 'get',\n credentials: 'include'\n }).then(function(response) {\n\n response.json().then(function(json) {\n console.log(json);\n on_success(json.results);\n });\n\n }).catch(function(err) {\n console.log(err);\n });\n}", "title": "" }, { "docid": "96c8dc0830ab1c910efd06ac8d152828", "score": "0.6147653", "text": "function getProjects() {\n $http.get('/api/projects?q={\"filters\":[{\"name\":\"user_id\",\"op\":\"equals\",\"val\":\"' + store.get('user_id') + '\"}]}')\n .then(function(response) {\n $scope.projects = response.data.objects;\n });\n }", "title": "" }, { "docid": "c7ccfa0b193edaecf17ba82b1564ba05", "score": "0.614306", "text": "function getProject(projectId, onSuccess) {\n var url = baseUrl + 'api/index.cgi?method=get_projects' + '&project_id=' + projectId.toString();\n fetch(url, {\n method: 'get',\n credentials: 'include'\n }).then(function(response) {\n\n response.json().then(function(json) {\n console.log(json);\n onSuccess(json.results[0]);\n });\n\n }).catch(function(err) {\n console.log(err);\n });\n}", "title": "" }, { "docid": "c93ab86ae4e63c4fb316e2a15176046e", "score": "0.61161536", "text": "function renderProjectDBEntries(tx, results){\n log(\"rendering db project entries...\");\n var $fpage = $(\"#firstPage\");\n if(results.rows.length == 0){\n //hide edit button and ul from view\n $fpage.find('ul').html(\"\").css('display','none');\n $fpage.find('.toolbar a.edit').css('display','none');\n //show project create instructions\n $fpage.find('#noProjects').css('display','block');\n log(\"No entries to display\");\n } else {\n //show edit button and ul in view\n $fpage.find('.toolbar a.edit, ul').css('display','block');\n //hide project create instructions\n $fpage.find('#noProjects').css('display','none');\n\n // html is where we are storing the rendered html\n // for loop to run through the db query results\n var listitems = '';\n for(var i=0; i<results.rows.length; i++){\n var row = results.rows.item(i),\n totTime = ( row.totalTime ? toHHMMSS(row.totalTime) : \"00:00:00\" );\n // ***** testing line to see what is coming out of DB ********\n // store the output in the html variable\n // results.rows.item(i).projectID will give us the projectID to tie into the tasks table\n // results.rows.item(i).projectName will give us the projectname\n // on the next page after clicking the project name\n // this is the html that shows for the projects\n //create inner function to define/limit scope of row variable\n (function(pid, proj_name, totTime){\n listitems += \"<li class='arrow project' id='_\"+pid+\"'><a class='item' href='#detailView' id='\"+pid+\"'>&nbsp;<div class='delete-icon'></div>&nbsp;<span class='item_header'>\"+proj_name+\"</span><br><span class='item_sub'>Total Time: \"+totTime+\"</span></a><a class='delete-button button redButton' href='#'>Delete</a></li>\";\n })(row.projectId, row.projectName, totTime);\n \n }\n // clear out whatever entries were there in the first place\n //append accumulated listitems into parent container\n $fpage.find(\"ul#project_ul\").html(\"\").append( listitems );\n }\n log(\"...db project entries rendered!\");\n}", "title": "" }, { "docid": "12fd565fda140dfe3fe7986f72eccc2d", "score": "0.60895", "text": "function fetchProjects() {\n\n\tfetchData(url + 'repos/CoInvestor/webtest-2019/projects').then(response => {\n\t\t\n\t\t//Get the projects id and the name of the project board\n\t\t//Send results to fetchColumns function\n\t\tresponse.forEach(element => {\n\t\t\tfetchColumns(element.id, element.name);\n\t\t});\n\n\t});\n\n}", "title": "" }, { "docid": "f4d1921229819787cb5883da510a72c6", "score": "0.60894495", "text": "function fetchProject(projectId, isImported, task) {\n let files;\n let filesKeys;\n let xhttp = new XMLHttpRequest();\n\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n responseJSON = JSON.parse(this.responseText);\n\n files = responseJSON.files;\n filesKeys = Object.keys(files);\n\n filesTable.innerHTML = \"\";\n\n tr = document.createElement(\"tr\");\n th = document.createElement(\"th\");\n th.className = \"name\";\n th.innerHTML = \"File Name\";\n tr.append(th);\n\n filesTable.append(tr);\n\n for (i = 0; i < filesKeys.length; i++) {\n fId = filesKeys[i];\n tr = document.createElement(\"tr\");\n tr.setAttribute(\"file-id\", fId);\n tr.setAttribute(\"file-path\", files[fId].path);\n tr.setAttribute(\"can-generate-target-file\", files[fId].can_generate_target_file);\n\n td = document.createElement(\"td\");\n td.innerHTML = files[fId].title;\n tr.append(td);\n\n tr.ondblclick = function() {\n window.fileTitle = this.getElementsByTagName(\"td\")[0].innerHTML;\n setFooter();\n\n fetchSegments(projectId,\n this.getAttribute(\"file-id\"),\n this.getAttribute(\"can-generate-target-file\"),\n task);\n\n if (activeFile != null) {\n activeFile.classList.remove(\"active\");\n }\n this.classList.add(\"active\");\n activeFile = this;\n }\n tr.oncontextmenu = function(e) {\n openFileContextMenu(e,\n this.getAttribute(\"file-id\"),\n this.getAttribute(\"file-path\"),\n this.getAttribute(\"can-generate-target-file\"),\n isImported,\n task);\n }\n\n filesTable.append(tr);\n }\n\n reports = responseJSON.reports;\n reportsKeys = Object.keys(reports);\n\n projectReportsTable = document.getElementById(\"reports-table\").tBodies[0];\n projectReportsTable.innerHTML = \"<tr><th><h4>Reports</h4></th></tr>\"\n\n if (reportsKeys.length === 0) {\n tr = document.createElement(\"tr\");\n\n td = document.createElement(\"td\");\n td.textContent = \"-\";\n tr.appendChild(td);\n\n projectReportsTable.appendChild(tr);\n }\n\n for (i = reportsKeys.length - 1; i >= 0; i--) {\n report = reports[reportsKeys[i]];\n reportDateString = getDatetimeString(new Date(report.timestamp));\n\n tr = document.createElement(\"tr\");\n tr.id = reportsKeys[i];\n tr.setAttribute(\"json\", report.json)\n tr.ondblclick = function() {\n viewProjectReport(this);\n }\n\n td = document.createElement(\"td\");\n td.textContent = reportDateString;\n tr.appendChild(td);\n\n projectReportsTable.appendChild(tr);\n }\n\n reportTable = document.getElementById(\"project-report\");\n reportTable.innerHTML = \"<tr>\"\n + \"<th class=\\\"name\\\"></th><th>Repetitions</th><th>100%</th><th>95%-99%</th><th>85%-94%</th><th>75%-84%</th><th>50%-74%</th><th>New</th><th>Total</th>\"\n + \"</tr><tr>\"\n + \"<td class=\\\"name\\\">-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>\"\n + \"</tr>\"\n\n filesView.setAttribute(\"cur-p-id\", projectId);\n toggleView(\"files-view\", \"grid\", \"files-header\", \"btn-files-view\");\n document.getElementById(\"btn-files-view\").disabled = false;\n }\n }\n\n xhttp.open(\"GET\", \"http://127.0.0.1:8000/project/\" + projectId);\n xhttp.send();\n }", "title": "" }, { "docid": "226556a9eeb8e5caecbb98eafdaaafdc", "score": "0.6089267", "text": "function displayProjects() {\n document.querySelector('.all_project_items_wrapper').remove(); //delete all projects from dom\n const allprojectswrapper = document.createElement('div'); //make new wrapper for all projects\n allprojectswrapper.classList.add('all_project_items_wrapper');\n\n\n //display all projects in the array\n for (let i = 0; i < data.projects.length; i++) {\n const projectitemwrapper = document.createElement('div'); //make wrapper\n projectitemwrapper.classList.add('projects_item_wrapper'); //add class for css\n projectitemwrapper.classList.add('parent_wrapper');\n projectitemwrapper.setAttribute('data-id', data.projects[i].id); //set id to connect to projects array index\n\n\n const projects_item_label = document.createElement('p');\n projects_item_label.classList.add('projects_item_label');\n projects_item_label.textContent = data.projects[i]._name;\n projects_item_label.addEventListener('click', (e) => {\n removeTasks();\n displayTodoProjectName(e.target.closest('.parent_wrapper').getAttribute('data-id'));\n displayAllTask(e.target.closest('.parent_wrapper').getAttribute('data-id'));\n }); //add event to view tasks of this project\n\n const projects_item_delete_button = document.createElement('div');\n projects_item_delete_button.classList.add('projects_item_delete_button');\n projects_item_delete_button.classList.add('btn');\n projects_item_delete_button.textContent = '-';\n projects_item_delete_button.setAttribute('data-id', data.projects[i].id);\n projects_item_delete_button.addEventListener('click', (e) => {\n\n const projectid = e.target.closest('.parent_wrapper').getAttribute('data-id');\n const containerid = document.getElementById('todo_container').getAttribute('data-id');\n\n\n deleteProject(projectid);\n displayProjects();\n // e.target.closest('.parent_wrapper').remove();\n if (containerid == 'all') {\n removeTasks();\n displayDefault();\n }\n else if (projectid === containerid) {\n removeTasks();\n displayDefault();\n } else if (Number(projectid) < Number(containerid)) {\n let tempid = Number(containerid) - 1;\n const newcontainerid = tempid.toString();\n removeTasks();\n displayTodoProjectName(newcontainerid);\n displayAllTask(newcontainerid);\n }\n\n methods.updateStorage();\n });\n\n //combine all to wrapper\n projectitemwrapper.append(projects_item_label);\n projectitemwrapper.append(projects_item_delete_button);\n\n //put wrapper or project item into DOM\n allprojectswrapper.append(projectitemwrapper);\n\n }\n document.getElementById('projects_container').append(allprojectswrapper); //put all projects wrapper into DOM\n }", "title": "" }, { "docid": "9f5eb794e98d1933ef437f1f6efee0f7", "score": "0.60852367", "text": "populate () {\n this.setLoading('Discovering projects\\u2026')\n providerManager.all()\n .then(items => {\n items = util.sortProjects(items)\n this.setItems(items)\n })\n .catch(err => {\n console.error('Project Plus: Could not list projects:', err.stack)\n this.toggle()\n notificationManager.error('Project Plus: Could not list projects', {\n dismissable: true,\n stack: err.stack,\n description: 'Open the Dev Tools for more information, or file an issue ' +\n 'on [Github](https://github.com/mehcode/atom-project-plus/issues/new).'\n })\n })\n }", "title": "" }, { "docid": "eff14e89b13cab2534f5b92c65cb63d8", "score": "0.60802823", "text": "function getProject(data) {\n return (\n `# Title: ${data.projectName}`\n )\n}", "title": "" }, { "docid": "17f9e61a2bc319ad7fdcc41181138494", "score": "0.6076876", "text": "function listProjects() {\n ctrl.showError = false;\n var content_url = ctrl.url + '?';\n var filterText = ctrl.filterText;\n if(filterText != undefined){\n content_url = content_url + 'name=' +\n filterText;\n }\n else if(keepState.filter.projectFilter){\n for (var filter in keepState.filter.projectFilter){\n content_url = content_url + filter + '=' + keepState.filter.projectFilter[filter]\n ctrl.filterText = keepState.filter.projectFilter[filter]\n }\n }\n ctrl.resultsRequest =\n $http.get(content_url).success(function (data) {\n ctrl.data = data;\n if(ctrl.filterText != undefined){\n keepState.filter.projectFilter = {\n 'name': ctrl.filterText\n }\n }\n }).catch(function (data) {\n ctrl.data = null;\n ctrl.error = data.statusText;\n ctrl.toastError();\n });\n }", "title": "" }, { "docid": "443ce611632db5bef1f7e29744e68a6d", "score": "0.60702765", "text": "async loadProjects() {\n logger.info(`Loading projects`);\n const options = {\n uri: apiBaseUrl + `/projects?circle-token=${this.authorization.apiKey}`,\n json: true\n }\n return request.get(options);\n }", "title": "" }, { "docid": "15a26dc13ac74ed1931d3662e1336b70", "score": "0.60702646", "text": "async reloadProjects() {\n document.getElementById(\"projectList\").innerHTML = '<p>PROJECTS</p>';\n const projects = await Api.getProjects();\n projects.forEach( (p) => {\n this.createProjectHTML(p);\n this.filters.setProjectListener(p);\n });\n }", "title": "" }, { "docid": "d28d4699d6fc8ad615196c7c24c59290", "score": "0.60648704", "text": "function returnProject(json) {\n\n var projectName = json[0].name;\n $(\".project-name\").text(projectName);\n var backgroundImgString = `url(\\\"${json[0].photoURL}\\\")`;\n $('.banner2').css('background-image', backgroundImgString);\n var daysRemaining = getDaysRemaining(json);\n $(\".project-days-remaining\").text(daysRemaining);\n $(\"#items-list\").empty();\n\n // make an ajax call to get all items for this project\n $.ajax({\n method: 'GET',\n url: '/api/projects/' + projectID + '/items',\n success: function(json) {\n\n renderMultipleItems(json);\n },\n error: function() {\n console.log(\"error getting project items for project:\", projectID);\n }\n });\n\n\n // days remaining counter\n function getDaysRemaining(json) {\n\n var startDate = json[0].startDate;\n var numDaysToComplete = json[0].numDaysToComplete;\n\n // convert the start date into a moment object\n var startDate = moment(Date.parse(startDate));\n\n // save the current date as a moment object\n var today = moment().startOf('day');\n\n // calculate and save the finish date as a moment object\n var finishDate = startDate.clone().add(numDaysToComplete, 'days');\n\n // calculate and save the difference between the current date and the finish date\n var daysUntilFinish = finishDate.diff(today, 'days');\n\n // return the string - if it is passed the finish date / deadline, return a different message otherwise indicate the number of days remaining\n if (daysUntilFinish >= 0) {\n return `You have ${daysUntilFinish} days to finish this project`;\n } else {\n return `This project is now passed the due date`;\n }\n }\n }", "title": "" }, { "docid": "b80027b7833be6b8ab095bc02e000bde", "score": "0.6054438", "text": "function outputProjects(projectsArray){\r\n\tconsole.log(\"outputProjects() called.\");\r\n\tprojectsArray_g = projectsArray;\r\n\tisSetProjectsArray_g = true;\r\n\t\r\n\tvar outString = \"<option value=\\\"-1\\\">General Words</option>\";\r\n\t//Load each project one at a time into dropdown\r\n\tfor( var i = 0; i < projectsArray.length; i++){\r\n\t\tvar projectObj = JSON.parse(projectsArray[i]);\r\n\t\toutString += \"<option value=\\\"\" + projectObj.project_id + \"\\\"\";\r\n\t\tif (selectedProject_g === projectObj.project_id){\r\n\t\t outString += \" selected=\\\"selected\\\" \";\r\n }\r\n outString += \">\" + projectObj.project_name + \"</option>\";\r\n\t}\r\n\t\r\n\t//output to html\r\n\t$(\"#addWordProjectsDropdown\").html(outString);\r\n $(\"#editWordProjectsDropdown\").html(outString);\r\n\t$(\"#mainProjectsDropdown\").html(outString);\r\n}", "title": "" }, { "docid": "899124312d073cdeeb6456759a8a57ea", "score": "0.6033434", "text": "function add_actual_projects() {\n if ($(\".project_list_item\").length < 1) {\n $('<div class=\"content_body\"></div>').insertAfter($(\".content_header\"));\n let handler = $(\".content_body\");\n add_project_header(handler);\n handler.append('<div class=\"projects_list\"></div>');\n handler2 = handler.find(\".projects_list\");\n /// get all user projects\n let gid = readCookie(\"gid\");\n gid = gid.split(\"_\");\n\n let Array = [];\n for (let j = 0; j < gid.length - 1; j++) {\n Array[j] = parseInt(gid[j]);\n }\n $.ajax({\n url: \"getactualprojects.php?\",\n type: \"post\",\n dataType: \"json\",\n data: { data: Array },\n success: function (data) {\n alert(data);\n for (let i = 0; i < data.length; i++) {\n add_project_item(\n handler2,\n data[i].pid,\n data[i].nazwa_projektu,\n data[i].data_rozpoczęcia,\n data[i].gid,\n data[i].status\n );\n }\n },\n error: function (xml, error) {\n console.log(error);\n },\n });\n ///\n }\n}", "title": "" }, { "docid": "deb1be0e488c83a5d00c519b841179ab", "score": "0.6025634", "text": "function getProjectData () {\n xhrJira(setProjectData, that.jira, 'GET', 'api/2/project/' + that.project)\n\n function setProjectData (response) {\n if (response.success) {\n that.issuetypes = response.data.issueTypes\n that.components = response.data.components\n that.versions = response.data.versions\n showForm(that) // next\n } else {\n console.error('Internal HTTP Error:', response.data)\n throw new Error('CIC failed to load issuetypes, components, and versions')\n }\n }\n }", "title": "" }, { "docid": "1e3496c48c0f75f112d18d1f6ed1f21a", "score": "0.60239816", "text": "function getProjects(prjid) {\n // console.log(prjid)\n var pagina = 'WorkInputContent/listProjects';\n var par = `[{\"pjt_id\":\"${prjid}\"}]`;\n var tipo = 'json';\n var selector = putProjects;\n fillField(pagina, par, tipo, selector);\n}", "title": "" }, { "docid": "7f147f62d798d5638ca18a7d9eb9fe24", "score": "0.6021438", "text": "function buildProject(dataValue) {\n var projects = myProjects.options.data;\n var project = projects.find(clicked, dataValue);\n\n var title = HTMLprojectTitle.replace('%path%', project.path).replace('%data%', project.title);\n var icon = HTMLprojectGithub.replace('%github%', project.github);\n var language = HTMLprojectLanguage.replace('%data%', project.language);\n var frameworks = HTMLprojectFrameworks.replace('%data%', project.frameworks);\n var description = HTMLprojectDescription.replace('%data%', project.description);\n var image = HTMLprojectImage.replace('%data%', project.image);\n\n if (main.contentInfo.children().length !== 0) {\n main.contentInfo.children().remove();\n }\n\n main.contentInfo.append(HTMLdivText, HTMLdivMultimedia);\n $('.text').append(icon, title, language, frameworks, description);\n $('.multimedia').append(image);\n}", "title": "" }, { "docid": "2d1da623b3237209a9aedc8de62b835d", "score": "0.6018821", "text": "getProjects() {\n let headers = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpHeaders\"]().set('Content-Type', 'application/json');\n return this._http.get(this.url + 'projects', { headers: headers });\n }", "title": "" }, { "docid": "9d9b7ad37f3fdba324f6f79f593d32df", "score": "0.60159755", "text": "static showAllProjects() {\n if (allProjects == \"\") {\n return;\n }\n allProjects.forEach((Myproject) => {\n UI.addProject(Myproject);\n });\n }", "title": "" }, { "docid": "b7a04e0feb9ec6a1d279c20bcc2ab30f", "score": "0.60015005", "text": "function loadListProjects(projectSearch) {\n var email = localStorage.getItem('email')\n var dataEmail = {\n \"customer\": \"\",\n \"email\": email,\n \"isFocused\": {\n \"customer\": false,\n \"title\": false\n },\n \"isRecycled\": false,\n \"orderField\": \"title\",\n \"sortOrder\": \"ASC\",\n \"status\": {\n \"Active\": false,\n \"All\": true,\n \"Closed\": false,\n \"New\": false\n },\n \"title\": projectSearch,\n \"toleranceStatus\": {\n \"All\": true,\n \"OutofTolerance\": false,\n \"Tolerancelimit\": false,\n \"WithinTolerance\": false\n }\n };\n $.ajax({\n type: \"POST\",\n url: host + \"/api/project/GetProjectList\",\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify(dataEmail),\n })\n .done(function (str) {\n document.getElementById(\"listProjects\").innerHTML = \"\";\n var test = str;\n var length = Object.keys(str).length;\n $(\"#listProjects\").append('<ul id=\"listProjects\" class=\"nav nav-pills nav-stacked\">');\n for (var i = 0; i < length; i++) {\n var dummy = \"<li id='\".concat(str[i].id, \"'><a href='#'>\", str[i].title, \"</a></li>\");\n $(\"#listProjects\").append(dummy);\n }\n })\n\n\n }", "title": "" }, { "docid": "b8db3be2f02a5d2b4d262a8f7671234b", "score": "0.5988841", "text": "function getProject(projectID) {\n\n // make an ajax call to get a single project object\n $.ajax({\n method: 'GET',\n url: '/api/projects/' + projectID,\n success: function(json) {\n\n },\n error: function() {\n console.log(\"error getting project id:\", projectID);\n }\n });\n}", "title": "" }, { "docid": "cb7f1063fa1e8c412d37a6c716b9ba4f", "score": "0.5986549", "text": "function getProjectList(){\n let reqdata = {};\n reqdata.action = \"getProjectList\";\n \n $.ajax({\n headers: { 'X-CSRF-Token': csrfToken },\n url: BASEURL + 'rest/index',\n data: reqdata,\n type: 'GET',\n dataType: 'json',\n error: function (xhr) {\n //console.log(xhr);\n },\n onSuccess: function (res) {\n }\n }).done(function(res){\n data = res.data.data;\n console.log('Get Project List');\n console.log(data);\n var txt='';\n for(var i =0;i<data.list.length;i++){\n txt+='<button type=\"button\" class=\"btn btn-dark\" onclick=\"addToProject('+data.list[i].id+');\" data-project-id=\"'+data.list[i].id+'\">'+data.list[i].project_name.replace(/_/g, \" \")+'</button>';\n }\n $(\".projectListMenu\").html(txt);\n });\n}", "title": "" }, { "docid": "5e8126819f4b777e6ce6969383504aa4", "score": "0.5964325", "text": "function loadProject(projectId, projectName, categories) {\r\n\t\r\n\r\n\t//Clean up current project DOM.\r\n\t$(\"#outputContainer\").html(\"\");\r\n\t//Init all categories.\r\n\tif (projectId == undefined) {\r\n\t\t//user has no projects; load the generic container\r\n\t\t$(\"#curProjectTitle\").html(\"Welcome to SGI RateTrack!\");\r\n\t\t$(\"#manageClientBtn\").hide();\r\n\t\t$(\"#chooseProjBtn\").html(\"Create Customer\");\r\n\t\t$(\"#outputContainer\").html(\"Rate Data is collected under Customers, which can have any number of projects associated with them. \" + \r\n\t\t\t\t\t\t\t\t \"To create your first customer project, click the create button above.\");\r\n\t\treturn;\r\n\t}\r\n\t$(\"#manageClientBtn\").show();\r\n\t$(\"#chooseProjBtn\").html(\"Choose Customer\");\r\n\tcategories.forEach(function(cat) {\r\n\t\tif (cat == undefined) \r\n\t\t\treturn;\r\n\t\tappendTagSpan(cat);\r\n\t});\r\n\r\n\r\n\t//Add all the data.\r\n\tgetAllRateData(projectId);\r\n\tcurProject = projectId;\r\n\tcurProjectName = projectName;\r\n\tcurProjectTags = categories;\r\n\t$(\"#curProjectTitle\").html(curProjectName);\r\n\t$(\"#projectSelectModal\").modal(\"hide\");\r\n\tdb.collection(\"userdata\").doc(curUserId).set({\r\n\t\t\"lastCustomerId\": projectId,\r\n\t\t\"lastCustomerName\": projectName,\r\n\t\t\"lastCustomerTags\": categories\r\n\t}, {merge: true}).then(() => {\r\n\t\tconsole.log(\"successfully did it\");\r\n\t\tlet height = $(\"#outputContainer\").css(\"height\");\r\n\t\t$('.data-wrapper').css(\"height\", \"55vh\");\r\n\t\tlet width = \"auto\";\r\n \t\t$('.data-wrapper').css(\"width\", width);\r\n\t});\r\n}", "title": "" }, { "docid": "b99b039dd1428c0ab2802fa6ff56ef40", "score": "0.5962744", "text": "function loadProjectForDdl() {\n\n $scope.Project_Statuses = [\n { \"StatusCode\": 17, \"Status\": \"Active\" },\n { \"StatusCode\": 23, \"Status\": \"Completed\" },\n { \"StatusCode\": 25, \"Status\": \"Released\" }\n ];\n $http.get(\"/Project/GetProjects\", $scope.config).success(function (data, status, headers, config) {\n $scope.Projects = data;\n $scope.Project_Project = $scope.Projects[0];\n });\n }", "title": "" }, { "docid": "fa87121233f465eba0120e9b65c6b5a4", "score": "0.59591806", "text": "async function getProjectData() {\r\n fetch(apiBaseURL + 'projectData').then((response) => {\r\n return response.json();\r\n }).then((result) => {\r\n document.getElementById(\"date\").innerHTML = result.date;\r\n document.getElementById(\"temp\").innerHTML = JSON.stringify(result.temp);\r\n document.getElementById(\"content\").innerHTML = result.content;\r\n document.getElementById(\"zip\").value = \"\";\r\n document.getElementById(\"feelings\").value = \"\";\r\n });\r\n}", "title": "" }, { "docid": "c1b5c60952704df924e8f18de07430dd", "score": "0.595909", "text": "function loadProjects() {\n var dataUser = store.session.get(\"usereacircuits\");\n if (dataUser !== undefined && dataUser !== null)\n {\n $.ajax({\n method: \"POST\",\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n url: GlobalApisLocation + 'projectsApis/getProjects',\n data: JSON.stringify({\"user_token\": dataUser.user_token}),\n beforeSend: function (data) {\n loading();\n },\n success: function (data) {\n swal.close();\n// console.log(data);\n var responseJson = data;\n responseJson.tittle = \"Get Projects\";\n console.log(responseJson);\n if (responseJson.status === 2) {\n $scope.$apply(function () {\n $scope.dataProjects = responseJson.data;\n// console.log($scope.dataProjects);\n alertAll(responseJson);\n console.log($scope.dataProjects);\n /*funcion para cargar el tooltip bonito*/\n $(function () {\n $('[data-toggle=\"tooltip\"]').tooltip();\n });\n\n });\n } else {\n alertAll(responseJson);\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log(jqXHR);\n console.log(textStatus);\n console.log(errorThrown);\n// location.href = \"login.html\";\n }\n });\n } else {\n location.href = \"login.html\";\n }\n }", "title": "" }, { "docid": "b3072803f03277aeb6082b92d21f0885", "score": "0.5945108", "text": "function fetchProjects() {\n let projects;\n let projectsKeys;\n let xhttp = new XMLHttpRequest();\n\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n projects = JSON.parse(this.responseText);\n projectsKeys = Object.keys(projects);\n\n projectsTable.innerHTML = \"\";\n\n for (i = 0; i < projectsKeys.length; i++) {\n projectId = projectsKeys[i];\n project = projects[projectId];\n tr = document.createElement(\"tr\");\n tr.setAttribute(\"project-id\", projectsKeys[i]);\n tr.setAttribute(\"is-imported\", project.is_imported);\n tr.setAttribute(\"is-exported\", project.is_exported);\n tr.setAttribute(\"task\", project.task);\n\n td = document.createElement(\"td\");\n td.className = \"project-title\";\n td.innerHTML = project.title;\n tr.append(td);\n\n td = document.createElement(\"td\");\n td.className = \"source language\";\n td.setAttribute(\"lang-code\", project.source_language_code);\n td.innerHTML = project.source_language;\n tr.append(td);\n\n td = document.createElement(\"td\");\n td.className = \"target language\";\n td.setAttribute(\"lang-code\", project.target_language_code)\n td.innerHTML = project.target_language;\n tr.append(td);\n\n tr.ondblclick = function() {\n window.projectTitle = this.getElementsByTagName(\"td\")[0].innerHTML;\n window.fileTitle = undefined;\n setFooter();\n\n langPair = [this.children[1].getAttribute(\"lang-code\"), this.children[2].getAttribute(\"lang-code\")];\n window.setSpellCheckerLanguages(langPair);\n\n fetchProject(this.getAttribute(\"project-id\"),\n this.getAttribute(\"is-imported\"),\n this.getAttribute(\"task\"));\n\n if (activeProject != null) {\n activeProject.classList.remove(\"active\");\n }\n this.classList.add(\"active\");\n activeProject = this;\n\n if (this.getAttribute(\"is-imported\") == \"true\") {\n document.getElementById(\"btn-create-new-project-package\").style.display = \"none\";\n document.getElementById(\"btn-create-return-project-package\").style.display = \"inline-block\";\n document.getElementById(\"btn-update-from-package\").style.display = \"none\";\n }\n else if (this.getAttribute(\"is-exported\") == \"true\") {\n document.getElementById(\"btn-create-return-project-package\").style.display = \"none\";\n document.getElementById(\"btn-update-from-package\").style.display = \"inline-block\";\n document.getElementById(\"btn-create-new-project-package\").style.display = \"inline-block\";\n }\n else {\n document.getElementById(\"btn-create-return-project-package\").style.display = \"none\";\n document.getElementById(\"btn-update-from-package\").style.display = \"none\";\n document.getElementById(\"btn-create-new-project-package\").style.display = \"inline-block\";\n }\n }\n\n if (project.due_datetime) {\n td = document.createElement(\"td\");\n td.className = \"deadline\";\n td.textContent = getDatetimeString(new Date(project.due_datetime));\n tr.appendChild(td);\n }\n\n if (project.notes) {\n tr.setAttribute(\"title\", project.notes);\n }\n\n projectsTable.prepend(tr);\n }\n tr = document.createElement(\"tr\");\n th = document.createElement(\"th\");\n th.className = \"name\";\n th.innerHTML = \"Project Name\";\n tr.append(th);\n th = document.createElement(\"th\");\n th.innerHTML = \"Source Language\";\n tr.append(th);\n th = document.createElement(\"th\");\n th.innerHTML = \"Target Language\";\n tr.append(th)\n th = document.createElement(\"th\");\n th.innerHTML = \"Deadline\";\n tr.append(th)\n projectsTable.prepend(tr);\n\n console.log(\"Projects fetched.\")\n }\n else if (this.readyState == 4 && this.status != 200) {\n console.error(\"Projects not fetched. Trying again in 2 seconds.\")\n setTimeout(() => {\n fetchProjects();\n }, 2000)\n }\n }\n\n xhttp.open(\"GET\", \"http://127.0.0.1:8000/\");\n xhttp.send();\n }", "title": "" }, { "docid": "ac87351cc87414c619539f055a3e4b7b", "score": "0.59450364", "text": "function loadAllProjects() {\n // perform authentication\n authenticate();\n // initiate URL, header, options\n var getAllProjectURL = \"https://api.teamgantt.com/v1/projects/all?\"\n var header = {\n 'TG-Authorization' : 'Bearer ' + PropertiesService.getUserProperties().getProperty('authKey'),\n 'TG-Api-Key' : api_key,\n 'TG-User-Token' : user_token\n }\n var options = {\n 'method' : 'get',\n 'contentType' : 'application/json',\n 'headers' : header\n }; \n // call the API and parse the response\n var response = UrlFetchApp.fetch(getAllProjectURL, options);\n var json = response.getContentText();\n var data = JSON.parse(json);\n var myMap = [];\n // map name, id, status, and public key\n for (i = 0; i < data.projects.length; i++) {\n myMap.push([data.projects[i].name, data.projects[i].id.toString(), data.projects[i].status, data.projects[i].public_key]);\n }\n return myMap;\n}", "title": "" }, { "docid": "5d3ed03996662a792df55e1d860f4607", "score": "0.5944268", "text": "function buildPortfolioProject(projectData){\n var projectHTML = '<li>';\n projectHTML += '<h3 class=\"projecttitle\">' + projectData.projectName + '</h3>';\n projectHTML += '<p class=\"caption\">' + projectData.statement + '</p>';\n projectData.imgList.forEach(function(imgData){\n projectHTML += buildImg(imgData);\n });\n projectHTML += '</li>';\n return projectHTML;\n}", "title": "" }, { "docid": "c3f5a0d75b618a03ad280199311ac963", "score": "0.59375787", "text": "function loadProjects() {\n\t// List of identifiers to ignore (i.e. Not show)\n\tignore_these = [\"m83\", \"impossible_line\", \"leaf\", \"cancer_gene_runner\", \"galaxy_zoo_starburst\", \"galaxy_zoo_quiz\"]\n\n\t// Get .ist of projects from API annd create items for display\n\t$.getJSON( \"https://api.zooniverse.org/projects/list\", function( data ) {\n\t\tvar projects = [];\n\t\t$.each(data, function(i,p) {\n\t\t // As long as it's not in the ignore list, add it to the list using itemHTML function\n\t\t if ($.inArray(p[\"name\"], ignore_these) == -1) {\n\t\t \titemHTML(p);\n\t\t }\n\t\t});\n\n\t});\n}", "title": "" }, { "docid": "c74db67e1dde16f3912f994244c78946", "score": "0.5935889", "text": "function displayProjects() {\n var personID = \"clotho.developer.katielewis1\";\n Clotho.get(personID).then(function (personObj) {\n var tableRef = document.getElementById(\"projTable\");\n if (personObj.projects.length > 0) {\n var newRow = tableRef.insertRow(0);\n var newCell = newRow.insertCell(0);\n Clotho.get(personObj.projects[0]).then(function (proj) {\n newCell.innerHTML = '<a href=\"./Projects.html\" style = \"display:block\"+ value =' + proj.id + ' onclick = \"projectDetails.call(this)\">' + proj.name + '</a>';\n });\n for (var i = 1; i < personObj.projects.length; i++) {\n Clotho.get(personObj.projects[i]).then(function (projectObj) {\n newRow = tableRef.insertRow(tableRef.rows.length);\n newCell = newRow.insertCell(0);\n newCell.innerHTML = '<a href=\"./Projects.html\" style = \"display:block\" value =' + projectObj.id + ' onclick = \"projectDetails.call(this)\">' + projectObj.name + '</a>';\n });\n\n }\n\n Clotho.get(personObj.projects[0]).then(function (projObj) {\n document.getElementById(\"projTitle\").innerHTML = projObj.name;\n document.getElementById(\"currentLab\").innerHTML = projObj.Lab;\n document.getElementById(\"currentLead\").innerHTML = projObj.projectLead;\n document.getElementById(\"currentPI\").innerHTML = projObj.PI;\n document.getElementById(\"currentAdvisor\").innerHTML = projObj.advisor;\n document.getElementById(\"projectDescription\").innerHTML = projObj.Description;\n });\n }\n else if(personObj.projects.length == 0){\n var id = document.getElementById(\"rightColumn\");\n var secondID = document.getElementById(\"createProject\");\n var thirdID = document.getElementById(\"notebookEntry\");\n thirdID.style.display = 'none';\n id.style.display='none';\n secondID.style.display = 'block';\n }\n\n\n });\n}", "title": "" }, { "docid": "50ea78855d0583029de6f49ce7d0a7a4", "score": "0.5935666", "text": "async getProjectName(projectID) {\n fetch(`../api/displayProjectNameById/${projectID}`)\n .then(result => result.json())\n .then(data => this.setState({ projectName: data[0].ProjectName }));\n }", "title": "" }, { "docid": "6020f9a9cd56e48ba98b0d8a606f3fe6", "score": "0.59351075", "text": "function selectProject(project){\n milestonePage.show();\n projectPage.hide();\n taskPage.hide();\n myTasksPage.hide();\n\tif(selectedProject){\n\t\tselectedProject.off();\n\t}\n\tselectedProject = project;\n\tvar milestones = selectedProject.getMilestones();\n\t\n\tdrawMilestoneStuff(selectedProject.uid, firebase);\n\t\n\tvar $panel = $('#milestones-panel');\n\t$panel.children().remove();\n\tmilestones.onItemAdded(function(milestone){\n\t\t$panel.append(milestone.getButtonDiv());\n\t});\n\tvar nameA = $('#project-name');\n\tselectedProject.getName(function(name){\n\t\tnameA.text(name);\n\t});\n\n\tvar memberCont = $('#member-container');\n\tmemberCont.append(makeAddMemberTile(project));\n\tproject.getMemberTiles(function(tile){\n\t\tmemberCont.prepend(tile);\n\t});\n}", "title": "" }, { "docid": "c1fadb485ad0b7f8f041c6c714a8d932", "score": "0.59339696", "text": "function renderProjectRecord(project) {\n\n // Show an active \"edit\" icon for logged-in users only\n var link = document.getElementById('project_edit_link');\n var href = basePath + 'project/edit.html?project_id=' + project.project_id.toString();\n renderPublicPrivate(link, href);\n // Show Edit Resources link for logged-in users only\n var edit_res_link = document.getElementById('project_edit_resources');\n var edit_res_href = basePath + 'project/link.html?project_id=' + project.project_id.toString();\n renderPublicPrivate(edit_res_link, edit_res_href);\n\n if (project.url != null) {\n var url = document.createElement('a');\n url.setAttribute('target', '_blank');\n url.setAttribute('href', project.url);\n url.innerText = project.url;\n document.getElementById('project_url').appendChild(url);\n }\n\n document.getElementById('project_abbr').innerHTML = project.abbr;\n document.getElementById('project_owner').innerHTML = project.owner;\n document.getElementById('project_email').innerHTML = project.email;\n if (project.notes) { document.getElementById('project_notes').innerHTML = project.notes.replace(/ @@ /g,\"<br>\"); } // new-lines are @@ in db.\n\n}", "title": "" }, { "docid": "5e0d31087cd52ca17a995cbce90c69e6", "score": "0.59333444", "text": "projects() {\r\n\t\treturn API.get(\"pm\", \"/list-projects\");\r\n\t}", "title": "" }, { "docid": "ef28d0d7578040d37241aa06f5ab5286", "score": "0.59266335", "text": "function callBack(req, res) {\r\n res.send(projectData)\r\n}", "title": "" }, { "docid": "efb5d080eeb8cb1c9aa72f7a41f908e9", "score": "0.59119546", "text": "function fetchProjectDetail(projectId, cb) {\n db.getPool().query(\"SELECT * FROM project_detail WHERE id=?\", [projectId], cb);\n}", "title": "" }, { "docid": "b0c7d0cc2e8981bc196149674e95bf9b", "score": "0.5908402", "text": "projects_by_user() {\r\n\t\treturn API.get(\"pm\", \"/get-projects-by-user/\" + getLoggedInUserInfo(this.state.users).id_user);\r\n\t}", "title": "" }, { "docid": "01d0e641f9ab68bb39a0998a4955c5f1", "score": "0.58725774", "text": "async index ({ auth, request, response, view }) {\n console.log(chalk.yellow('Projects: '), chalk.white('Index'))\n const user = await auth.getUser()\n //return await user.projects().fetch()\n const projects = await user.projects().fetch()\n return view.render('projects.index', { projects: projects.toJSON() })\n }", "title": "" }, { "docid": "0cdbd46aa6787394c6b0bd1207066d77", "score": "0.5864589", "text": "function paintFoundProjectsAdminCallback(projects){\r\n if(projects.length>0)\r\n {\r\n //Hide the current portlets\r\n $('.container-portlets').css('display','none');\r\n //Clean the container for previous search\r\n $('.container-added-portlets').html('');\r\n for(var i =0;i<projects.length;i++){\r\n var project = $(projects[i]);\r\n //if exists the portlet searched in the current view, move it for the search result view\r\n if($('#container_'+project.data('request-id')).length>0)\r\n {\r\n //add a field called exists to know if it was showed previously\r\n project.data('exists','1');\r\n $('#container_'+project.data('request-id')).remove();\r\n }\r\n $('.container-added-portlets').append(project);\r\n }\r\n //unselected all the projects in the view\r\n $('.portlet-selected').removeClass('portlet-selected');\r\n currentProject = {id:-1};\r\n currentRequest = {id:-1};\r\n $('.container-portlets-found').css('display','inline');\r\n }\r\n else\r\n toastr.error('Sorry no matches',\"No Matches\");\r\n}", "title": "" }, { "docid": "5975d4a5d4ab0515dc3da8e74770a258", "score": "0.58518696", "text": "function getDetails() {\n\t\t$http.get('rest/groups/'+groupid).success(function(result) {\n\t\t\t$scope.groupname = result.groupname;\n\t\t\t$scope.owner = result.owner;\n\t\t\t$scope.members = result.members;\n\t\t\t$scope.documents = result.documents;\n\t\t}).error(function(result) {\n\t\t\talert('Could not get group details: ' + JSON.stringify(result));\n\t\t});\n\t}", "title": "" }, { "docid": "396190e3e83c728a2820a6f80ca55b9b", "score": "0.58448476", "text": "function finish() {\n\t\t\tprojectsLeft -= 1;\n\t\t\tif(projectsLeft < 1) {\n\t\t\t\tres.json(filteredProjects);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "084da277e5fdee70fadc08b604b15209", "score": "0.5840931", "text": "async function getProjects(){\n // const session = await Auth.currentUserInfo();\n // const clientID = await session.attributes.sub;\n let response = await fetch(`${config.api.invokeUrl}/users/${clientID}`);\n // let response = await fetch(`${config.api.invokeUrl}/users/${11111}`);\n let data = await response.json();\n setProjects(data.projects)\n }", "title": "" }, { "docid": "5d3a51020d92b24bd0a0a4c572a32bf4", "score": "0.5834753", "text": "function projectInfo(){\n\t\t$('.project-info-trigger').on('click', function(e) {\n\t\t\te.preventDefault();\n\n\t\t\t$('.modal-main-title').text($(this).parent().first().siblings().find('.project-title').text());\n\t\t\t$('.modal-created-title').text($(this).siblings('.project-description').find('.created-title').text());\n\t\t\t$('.modal-created-tech').text($(this).siblings('.project-description').find('.created-tech').text());\n\t\t\t$('.modal-proj-descript').text($(this).siblings('.project-description').find('.description-p').text());\n\n\t\t});\n\t}", "title": "" }, { "docid": "d2acda4704844afab083cc2b21fdad72", "score": "0.58285093", "text": "render () {\n if (this.state.loading) {\n return 'Loading ...'\n }\n\n /*\n we are rendering a list of elements using Array.map() to create a list element for every project fetched using the GitHub API.\n Note that every list element receives a value for the key prop. \n The key prop is a special prop that is recommended whenever you are rendering an array of elements. \n Every element should provide a unique key. This prop helps the virtual DOM optimize every rendering pass\n */\n return html`<ul>\n ${this.state.projects.map(project => html`\n <li key=${project.id}>\n <a href=${project.html_url}>${project.full_name}</a>:\n ${' '}${project.description}\n </li>\n `)}\n </ul>`\n }", "title": "" }, { "docid": "5e6814f292ddd83d564c02734e17be44", "score": "0.582636", "text": "function populateGraphs(projectId) {\n $(\"#resultsContainer\").hide();\n // Don't let this progress if this is the first option, then reset graphs message\n if ($(\"#projects\").val() == 0) {\n graphsMessage('Choose an project to see loaded spreadsheets');\n return;\n }\n theUrl = biocodeFimsRestRoot + \"projects/\" + projectId + \"/graphs\";\n var jqxhr = $.getJSON(theUrl, function (data) {\n // Check for empty object in response\n if (data.length == 0) {\n graphsMessage('No datasets found for this project');\n } else {\n var listItems = \"\";\n $.each(data, function (index, graph) {\n listItems += \"<option value='\" + graph.graph + \"'>\" + graph.expeditionTitle + \"</option>\";\n });\n $(\"#graphs\").html(listItems);\n }\n }).fail(function (jqXHR, textStatus) {\n if (textStatus == \"timeout\") {\n showMessage(\"Timed out waiting for response! Try again later or reduce the number of graphs you are querying. If the problem persists, contact the System Administrator.\");\n } else {\n showMessage(\"Error completing request!\");\n }\n });\n}", "title": "" }, { "docid": "9d2df9cc102afe63d1f4f18fbb10f6a8", "score": "0.58023214", "text": "async function populateDetails(project) {\n let title = document.getElementById('project-title');\n let start = document.getElementById('start-date');\n let due = document.getElementById('due-date');\n let list = document.getElementById('list-entry');\n let team = document.getElementById('team-name');\n let details = document.getElementById('details-list');\n\n let res = await fetch(`/team-names/${project.teamId}`);\n let teamSelected = await res.json();\n let teamName = teamSelected.name;\n\n title.innerHTML = project.projectName;\n start.innerHTML = splitDate(project.createdAt);\n due.innerHTML = splitDate(project.deadline);\n list.innerHTML = \"Add when lists/tags are a thing\"\n if (teamName === undefined) {\n team.innerHTML = 'No team has been assigned yet';\n } else {\n team.innerHTML = teamName;\n }\n let taskList = JSON.parse(project.description);\n if (details.hasChildNodes) {\n details.innerHTML = '';\n }\n taskList.forEach(task => {\n let check = document.createElement('span');\n let conDiv = document.createElement('div');\n conDiv.classList.add('detail-container');\n check.innerHTML = task;\n conDiv.appendChild(check);\n details.appendChild(conDiv);\n });\n}", "title": "" }, { "docid": "c467014bc3c0ce6f23ce30150262dae4", "score": "0.57891023", "text": "function showProjectsList(req, res, next) {\n var userId = req.session.user_id;\n var query = Project\n .find({$or: [{'owner': userId}, {'members.user': userId}]})\n .populate('tasks')\n .sort({lastMod: -1});\n query.exec(function (err, result) {\n if (err) {\n console.log(\"Error when getting list of projects: %s\", err);\n return next(err);\n }\n //console.log(result);\n var tempProjectList = [];\n result.forEach(function (project) {\n\n var completedTasks = 0;\n var timeSpent = 0;\n project.tasks.forEach(function (task) {\n timeSpent += task.timeSpent || 0;\n if (task.isCompleted) completedTasks++;\n });\n\n tempProjectList.push(\n {\n _id: project._id,\n title: project.title,\n tasks: project.tasks.length,\n completed: completedTasks,\n timeSpent: getTimeSpent(timeSpent),\n members: project.members.length,\n lastMod: (project.lastMod) ? project.lastMod.shortDate()\n : project.created.shortDate()\n }\n );\n });\n //console.log(\"___________________________\\nResult project list for render: \\n___________________________\");\n //console.log(tempProjectList);\n res.append('Cache-control', 'no-store').render('projects.jade', {\n user: req.currentUser,\n projects: tempProjectList\n });\n });\n}", "title": "" }, { "docid": "5759970a01ca66732f79184a0b786dec", "score": "0.5780497", "text": "function getProjectData(id) {\n $.get('/api/projects/' + id, function(data) {\n if (data) {\n // If this post exists, prefill our cms forms with its data\n name.val(data.name);\n status.val(data.status);\n paint_cost.val(data.paint_cost);\n wood_rot.val(data.wood_rot);\n labor_actual.val(data.labor_actual);\n material_actual.val(data.material_actual);\n // If we have a post with this id, set a flag for us to know to update the post\n // when we hit submit\n updating = true;\n }\n });\n }", "title": "" }, { "docid": "4d6a1efc0c78ec4c9bd00a82725d883b", "score": "0.5778789", "text": "function getProjectManagers () {\n\t/*\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: 'Project',\n\t\tdata: {\n\t\t\t'domain': 'project',\n\t\t\t'action': 'getProjectManagers',\n\t\t}, complete: function (data) {\n\t\t\tconsole.log(\"REPONSE JSON FROM getProjectManagers() = \",data.responseJSON);\n\t\t\tprojectManagers = data.responseJSON;\n\t\t\tif (data.responseJSON) {\n\t\t\t\t//createManagerQueue(data.responseJSON);\n\t\t\t\tgetSubcontractors();\n\t\t\t}\n\n\t\t\telse{console.log(\"NO RESPONSE JSON FROM getProjectManagers()\");}\n\t\t}\n\t\t\n\t});\n\t*/\n\tprojectManagers = TASK_OBJECT.PERSONS;\n\tconsole.log(projectManagers);\n\tgetSubcontractors();\n\t\n}", "title": "" }, { "docid": "0b148ace7f70a19e1a3b151d0412eb62", "score": "0.577162", "text": "function renderProjectHeader(project) {\n var name = document.getElementById('project_name');\n var desc = document.getElementById('project_description');\n\n name.innerHTML = project.name;\n desc.innerHTML = project.description;\n}", "title": "" }, { "docid": "b5658261238d8eac20d45c57f9b5352c", "score": "0.5764969", "text": "function projectSelectHandler() {\n\n }", "title": "" }, { "docid": "f52cab9a36fe374df16bfb4d9a99d57c", "score": "0.57610935", "text": "fetchProject() {\n const toFetchId = this.props.match.params.projectId;\n\n getProject(toFetchId, this.context)\n .then(projectHeader => {\n if(!this.state.project || this.state.project.id !== toFetchId)\n this.setState({project: projectHeader});\n })\n .catch(err => {\n if(err.statusCode === 401)\n this.setState({isAuthorized: false});\n else\n NotificationManager.error(err.body);\n });\n }", "title": "" }, { "docid": "6ab2e18d419215cfb68e618ef0c16578", "score": "0.5757106", "text": "function populateExpeditionPage(username) {\n var jqxhr = listProjects(username, biocodeFimsRestRoot + 'projects/user/list', true\n ).done(function () {\n // attach toggle function to each project\n $(\".expand-content\").click(function () {\n loadExpeditions(this.id)\n });\n }).fail(function (jqxhr) {\n $(\"#sectioncontent\").html(jqxhr.responseText);\n });\n}", "title": "" }, { "docid": "4bef0f818e3fb95334b334ba957e14be", "score": "0.57544565", "text": "async function fetchData() {\n const fetcher = await window.fetch(\n `${address()}projects`,\n {\n headers: { \"accept-language\": `${i18n.language}` },\n },\n {\n items: (page) => page.results,\n params: true,\n }\n );\n const response = await fetcher.json();\n const project = filterProjects(projectType, response);\n setLoading(false);\n }", "title": "" }, { "docid": "bd7bcee797987b76325970d390ffa891", "score": "0.57418305", "text": "function ls() {\n $(\"#prjItemList\").empty();\n return RemoteProject.list().then(function (d) {\n projectsInfo=d;\n d.findProject=function (name) {\n var res;\n d.forEach(function(i) {\n if (i.name===name) res=i;\n });\n return res;\n };\n d.sort(function (a,b) { return b.lastUpdate-a.lastUpdate;});\n d.forEach(item);\n }).fail(function(e){\n console.log(\"list failed\",e);\n });\n /*\n var d=[];\n curDir.each(function (f) {\n if (!f.isDir()) return;\n var l=f.lastUpdate();\n var r=f.rel(\"options.json\");\n if (r.exists()) {\n l=r.lastUpdate();\n }\n d.push([f,l]);\n });\n d=d.sort(function (a,b) {\n return b[1]-a[1];\n });\n */\n function item(e) {\n e.name=e.name.replace(/\\/$/,\"\");\n var f=projects.rel(e.name+\"/\");\n e.dir=f;\n var name=e.name;\n\n if (!f.isDir()) return;\n //if (!f.rel(\"options.json\").exists()) return;\n var u=UI(\"div\", {\"class\":\"project\"},\n [\"a\", {href:\"?r=jsl_edit&dir=\"+f.path()},\n [\"img\",{$var:\"t\",src:FS.expandPath(\"${sampleImg}/\"+(e.language||\"js\")+\".png\")}],\n [\"div\", name]],\n [\"div\",\n [\"a\",{on:{click:ren(name)}},\"名前変更\"], [\"span\",\" \"],\n [\"a\",{on:{click:del(name)}},\"削除\"]]\n );\n u.appendTo(\"#prjItemList\");\n }\n }", "title": "" }, { "docid": "716e9b46350e14c97d85fb4d6ec5417b", "score": "0.57364523", "text": "function renderTasks(project) {\n $.ajax({\n url: 'php/render-modules/render-tasks.php',\n type: 'GET',\n dataType:'html',\n data: {\n project: project\n },\n success: function (response) {\n $('.todo-list').empty();\n $('.todo-list').append(response);\n hoverTaskControls();\n renderProjectTitle(project);\n addHiddenInput(project);\n renderTaskPositions();\n tasksDraggable();\n }\n });\n }", "title": "" }, { "docid": "8a3601124c30c931b66cb2cbc9246c82", "score": "0.5732713", "text": "function projectProgressChanged(data) {\n s.completionContainer.html(data.partial);\n }", "title": "" }, { "docid": "0e132b1b37e0a70c2471482133856af7", "score": "0.5730571", "text": "function addProjectDetails(e) {\n\n\t// Prevent following the link\n\te.preventDefault();\n\n\t// Get the div ID, e.g., \"project3\"\n\tvar projectID = $(this).closest('.project').attr('id');\n\t// get rid of 'project' from the front of the id 'project3'\n\tvar idNumber = projectID.substr('project'.length);\n\n $.get(\"/project/\" + idNumber,callback);\n\n\tconsole.log(\"User clicked on project \" + idNumber);\n}", "title": "" }, { "docid": "3974795ceff4afb33f1252a15a1a55d9", "score": "0.57303417", "text": "function updateSelected() {\r\n $('.list-group-item').each(function (i, item) {\r\n var id = $(item).attr('hubId') + '|' + $(item).attr('projectId');\r\n if (!$(item).hasClass('active')) {\r\n if (projectData[id] !== null) { projectData[id] = null; $(\"#charts\").append('<div id=\"loading\" class=\"loadingspinner\"></div>'); drawCharts(projectData); }\r\n projectData[id] = null;\r\n }\r\n else if (projectData[id] === undefined || projectData[id] === null) {\r\n $(\"#charts\").append('<div id=\"loading\" class=\"loadingspinner\"></div>');\r\n jQuery.ajax({\r\n url: 'api/forge/bim360/hubs/' + $(item).attr('hubId') + '/projects/' + $(item).attr('projectId') + '/quality-issues',\r\n success: function (response) {\r\n projectData[id] = response;\r\n drawCharts(projectData);\r\n }\r\n })\r\n }\r\n })\r\n}", "title": "" }, { "docid": "9de47dc2aaf90e4a23549fbdf3137e98", "score": "0.5727344", "text": "function _createProjects() {\n var projects = [\n {\n id: \"MineSweeper\",\n name: \"Mine Sweeper\",\n title: \"Mine Sweeper Game\",\n desc: \"the nostalgic mine sweeper game with lots of feature\",\n ProjectUrl: \"https://ytavpeer.github.io/Minesweeper/\",\n ImageUrl: \"./img/portfolio/minesweeper2.jpeg\",\n publishedAt: 1611503034000,\n labels: [\"Mine sweeper\", \"nostalgic\", \"game\"]\n },\n {\n id: \"bookStore\",\n name: \"book store\",\n title: \"start rate your books\",\n desc: \"book web site that give you all the new details and rates\",\n ProjectUrl: \"https://ytavpeer.github.io/book-store/.\",\n ImageUrl: \"./img/portfolio/bookstore2.jpeg\",\n publishedAt: 1611848754000,\n labels: [\"book\", \"store\", \"rate book\"],\n },\n {\n id: \"pacman\",\n name: \"Pacman\",\n title: \"pacman game\",\n desc: \"the nostalgic mine sweeper game with lots of feature\",\n ProjectUrl: \"https://ytavpeer.github.io/Pacman/.\",\n ImageUrl: \"./img/portfolio/pacman2.jpeg\",\n publishedAt: 1611071182000,\n labels: [\"pacman\", \"nostalgic\", \"game\"],\n },\n {\n id: \"ballBoard\",\n name: \"ball board game\",\n title: \"ball game for fun\",\n desc: \"a nostalgic game you need to collect all the balls\",\n ProjectUrl: \"https://ytavpeer.github.io/balls-game/.\",\n ImageUrl: \"./img/portfolio/ballboard2.jpeg\",\n publishedAt: 1610898407000,\n labels: [\"picture\", \"guess\", \"game\"],\n },\n {\n id: \"TouchNums\",\n name: \"Touch Nums\",\n title: \"count the numbers game\",\n desc: \"a game for kids- need to complete the count of numbers\",\n ProjectUrl: \"https://ytavpeer.github.io/Touch-Nums-game/.\",\n ImageUrl: \"./img/portfolio/touchnums2.jpeg\",\n publishedAt: 1610639230000,\n labels: [\"numbers\", \"nostalgic\", \"game\"],\n },\n {\n id: \"todo\",\n name: \"to do list\",\n title: \"manage list of todos\",\n desc: \"a todo list for manage all our todos\",\n ProjectUrl: \"https://ytavpeer.github.io/Todo-App/.\",\n ImageUrl: \"./img/portfolio/todos2.jpeg\",\n publishedAt: 1611762451000,\n labels: [\"todo\", \"list\", \"manage\"],\n },\n ];\n return projects;\n}", "title": "" }, { "docid": "23d8d2b063d5a1fc919adf937897f782", "score": "0.57262164", "text": "function getTaskSelect() {\n var project_id = $projects_select.val();\n sendAJAXData( { project_id: project_id } , getTaskSelectSuccess );\n }", "title": "" }, { "docid": "e329f6f61b549b380ac2ab2b08f316ab", "score": "0.5725105", "text": "function paintFoundProjectsVendorCallback(projects){\r\n if(projects.length>0)\r\n {\r\n //Hide the current portlets\r\n $('.container-portlets').css('display','none');\r\n //Clean the container for previous search\r\n $('.container-added-portlets').html('');\r\n for(var i =0;i<projects.length;i++){\r\n $('.container-added-portlets').append($(projects[i]));\r\n }\r\n //unselected all the projects in the view\r\n $('.portlet-selected').removeClass('portlet-selected');\r\n currentProject = {id:-1};\r\n $('.container-portlets-found').css('display','inline');\r\n }\r\n else\r\n toastr.error('Sorry no matches',\"No Matches\");\r\n}", "title": "" }, { "docid": "5d1f7012ffdef1f870f403dcce03d999", "score": "0.5722067", "text": "function buildProjectTree(req,res){\n\t\n //req.session.projects = [];\n\t\n\tconsole.log(\"Render Page with \" + projectNames.length+ \" Projects \");\n\t\n\tfor(var i = 0 ; i < projectNames.length ; i++){ \n \t\t req.session.projects.push(projectNames[i]);\t\t \n\t}\n\t\n\t\n}", "title": "" } ]
6cf6cc57a522225b90ede1f268956e89
Polynomial O(n^2) doubly nested loop
[ { "docid": "3ab97e86068cdd0f3c9339a99a473333", "score": "0.0", "text": "function areYouHere(arr1, arr2) {\n for (let i=0; i<arr1.length; i++) {\n const el1 = arr1[i];\n for (let j=0; j<arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" } ]
[ { "docid": "2e2042a972b0e8e453a564666d0f6339", "score": "0.65925086", "text": "function polynomial () {\n var x = function x(d) {\n return d[0];\n },\n y = function y(d) {\n return d[1];\n },\n order = 3,\n domain;\n\n function polynomial(data) {\n // Use more efficient methods for lower orders\n if (order === 1) {\n var o = linear().x(x).y(y).domain(domain)(data);\n o.coefficients = [o.b, o.a];\n delete o.a;\n delete o.b;\n return o;\n }\n\n if (order === 2) {\n var _o = quad().x(x).y(y).domain(domain)(data);\n\n _o.coefficients = [_o.c, _o.b, _o.a];\n delete _o.a;\n delete _o.b;\n delete _o.c;\n return _o;\n }\n\n var _points = points(data, x, y),\n _points2 = _slicedToArray(_points, 4),\n xv = _points2[0],\n yv = _points2[1],\n ux = _points2[2],\n uy = _points2[3],\n n = xv.length,\n lhs = [],\n rhs = [],\n k = order + 1;\n\n var Y = 0,\n n0 = 0,\n xmin = domain ? +domain[0] : Infinity,\n xmax = domain ? +domain[1] : -Infinity;\n visitPoints(data, x, y, function (dx, dy) {\n ++n0;\n Y += (dy - Y) / n0;\n\n if (!domain) {\n if (dx < xmin) xmin = dx;\n if (dx > xmax) xmax = dx;\n }\n });\n var i, j, l, v, c;\n\n for (i = 0; i < k; ++i) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i) * yv[l];\n }\n\n lhs.push(v);\n c = new Float64Array(k);\n\n for (j = 0; j < k; ++j) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i + j);\n }\n\n c[j] = v;\n }\n\n rhs.push(c);\n }\n\n rhs.push(lhs);\n\n var coef = gaussianElimination(rhs),\n fn = function fn(x) {\n x -= ux;\n var y = uy + coef[0] + coef[1] * x + coef[2] * x * x;\n\n for (i = 3; i < k; ++i) {\n y += coef[i] * Math.pow(x, i);\n }\n\n return y;\n },\n out = interpose(xmin, xmax, fn);\n\n out.coefficients = uncenter(k, coef, -ux, uy);\n out.predict = fn;\n out.rSquared = determination(data, x, y, Y, fn);\n return out;\n }\n\n polynomial.domain = function (arr) {\n return arguments.length ? (domain = arr, polynomial) : domain;\n };\n\n polynomial.x = function (fn) {\n return arguments.length ? (x = fn, polynomial) : x;\n };\n\n polynomial.y = function (fn) {\n return arguments.length ? (y = fn, polynomial) : y;\n };\n\n polynomial.order = function (n) {\n return arguments.length ? (order = n, polynomial) : order;\n };\n\n return polynomial;\n}", "title": "" }, { "docid": "34608ed1c0f08e2267c169b2d6755c55", "score": "0.656442", "text": "function quadratic(n) {\n for (let i = 1; i <= n; i++) {\n for (let j = 1; j <= n; j++) {\n //do some stuff\n }\n }\n}", "title": "" }, { "docid": "8928f93c65d4cd3d3ed81410842d6588", "score": "0.6430066", "text": "static poly(n) {\n return (t) => Math.pow(t, n);\n }", "title": "" }, { "docid": "0ba3507b58acaeca473e5adf6d473608", "score": "0.61633205", "text": "function specialPythagoreanTriplet(n) {\n for (let i = 1; i < n; i++) {\n for (let j = 2; j < n; j++) {\n let k = n - (i + j)\n if (k ** 2 === i ** 2 + j ** 2) {\n return i * j * k\n }\n }\n }\n}", "title": "" }, { "docid": "7f0a1e71af2f02ad52049de04c603afb", "score": "0.61069256", "text": "function generatePolynomial(m) {\n const poly = Array(m)\n for (let i = 0; i < m; i++) {\n poly[i] = randomFieldElement()\n while (i == m - 1 && poly[i].value === 0n) {\n poly[i] = randomFieldElement()\n }\n }\n return poly\n}", "title": "" }, { "docid": "2b08755f2752521881e377aa328e53fe", "score": "0.60903007", "text": "function pythagoreanTripletO1(n) {\n let prod = -1\n if (n%2 === 0) {\n for (let a = 1; a <= n/3; a++) {\n let b = (n*n - 2*n*a)/(2*n - 2*a)\n let c = n - a - b\n if (isInt(b) && (a*a + b*b) === c*c) {\n let tempProd = a * b * c\n if (tempProd > prod) {\n prod = tempProd\n }\n } \n }\n }\n return prod\n}", "title": "" }, { "docid": "6c59341e626b86f2c9c395321463fc8f", "score": "0.60790795", "text": "function pascalsTriangle(n) {\n for (row = 1; row <= n; row ++)\n {\n var coeff = 1; // The first value in a row is always 1\n for (term = 1; term <= row; term ++)\n {\n document.write(coeff + \" \");\n coeff = coeff * (row - term) / term;\n }\n document.write(\"<br />\");\n }\n }", "title": "" }, { "docid": "5384079f04f48b329032bae79dcc18b2", "score": "0.60601985", "text": "function powerSum(x, sol = []){\n if (x == 0) return;\n\n // let base = Math.floor(Math.pow(x, 1/n));\n let base = x;\n \n for (let i = base; i >= 1; i--){\n sol.push(i);\n if (i == 1) console.log(sol);\n powerSum(i-1, sol.slice(x-i, i+1));\n \n }\n}", "title": "" }, { "docid": "3e435866e4f43ba128960b2fe7a2698f", "score": "0.6058582", "text": "function main() {\n // generate first two terms in the sequence\n var firstTwoTerms = [];\n for (let i = 1; i < 3; i++) firstTwoTerms.push(polynomialGenerator(i));\n return firstTwoTerms;\n\n /**\n * how do i get the assumed polynomial generating function from n terms in a sequence?\n *\n * constant function for a sequence with one term\n *\n * sequence with two terms has a linear relationship between the terms\n *\n * sequence with three terms has a quadratic relationship between the terms\n */\n}", "title": "" }, { "docid": "48b5ca281aabe517af87534be5fd8754", "score": "0.59789085", "text": "function specialPythagoreanTriplet(n) {\n let sumOfabc = n;\n let a, b, c;\n for (a = 1; a <= sumOfabc / 3; a++) {\n for (b = a + 1; b <= sumOfabc / 2; b++) {\n c = Math.sqrt(a * a + b * b);\n if ((a + b + c) == sumOfabc) {\n return a * b * c;\n }\n }\n }\n}", "title": "" }, { "docid": "307b3d92955ddedb3dc7089cf12a596c", "score": "0.5963049", "text": "function recurseLegendrePoly(n, x, Pnm_minus1, Pnm_minus2) {\n \n var Pnm = new Array(n+1);\n switch(n) {\n case 1:\n var x2 = numeric.mul(x,x);\n var P10 = x;\n var P11 = numeric.sqrt(numeric.sub(1,x2));\n Pnm[0] = P10;\n Pnm[1] = P11;\n break;\n case 2:\n var x2 = numeric.mul(x,x);\n var P20 = numeric.mul(3,x2);\n P20 = numeric.sub(P20,1);\n P20 = numeric.div(P20,2);\n var P21 = numeric.sub(1,x2);\n P21 = numeric.sqrt(P21);\n P21 = numeric.mul(3,P21);\n P21 = numeric.mul(P21,x);\n var P22 = numeric.sub(1,x2);\n P22 = numeric.mul(3,P22);\n Pnm[0] = P20;\n Pnm[1] = P21;\n Pnm[2] = P22;\n break;\n default:\n var x2 = numeric.mul(x,x);\n var one_min_x2 = numeric.sub(1,x2);\n // last term m=n\n var k = 2*n-1;\n var dfact_k = 1;\n if ((k % 2) == 0) {\n for (kk=1; kk<k/2+1; kk++) dfact_k = dfact_k*2*kk;\n }\n else {\n for (kk=1; kk<(k+1)/2+1; kk++) dfact_k = dfact_k*(2*kk-1);\n }\n Pnm[n] = numeric.mul(dfact_k, numeric.pow(one_min_x2, n/2));\n // before last term\n Pnm[n-1] = numeric.mul(2*n-1, numeric.mul(x, Pnm_minus1[n-1])); // P_{n(n-1)} = (2*n-1)*x*P_{(n-1)(n-1)}\n // three term recursence for the rest\n for (m=0; m<n-1; m++) {\n var temp1 = numeric.mul( 2*n-1, numeric.mul(x, Pnm_minus1[m]) );\n var temp2 = numeric.mul( n+m-1, Pnm_minus2[m] );\n Pnm[m] = numeric.div( numeric.sub(temp1, temp2), n-m); // P_l = ( (2l-1)xP_(l-1) - (l+m-1)P_(l-2) )/(l-m)\n }\n }\n return Pnm;\n}", "title": "" }, { "docid": "32f9a851078ca739f87f8a8dcbeaee33", "score": "0.5926019", "text": "function powerSum(x, n){\n let solutions = 0;\n\n // Base will be n root of x\n let base = Math.floor(Math.pow(x, 1/n));\n\n\n \tfor (var i = base; i > 0; i--){\n console.log(i);\n\n powerSum(i-1, n);\n }\n}", "title": "" }, { "docid": "ff3a54d9b68e529369079e4e685415e8", "score": "0.5905625", "text": "function polynomialValue(poly, point) {\n let value = new math.Fr(0n)\n let pow = 1n\n for (let i = 0; i < poly.length; i++) {\n value = value.add(new math.Fr(poly[i]).multiply(pow))\n pow *= point\n }\n return value.value\n}", "title": "" }, { "docid": "e9c8721ee8479efb475bbe2c490f6547", "score": "0.59022313", "text": "function digPow(n, p) {\n \n let arr = n.toString().split(\"\");\n\n let k = p;\n\n let sum = arr.reduce((acc, val) => Math.pow(acc, p) + Math.pow(val, p + 1));\n\n if (sum === n) return 1;\n\n // probleme is here\n else if (sum > n) {\n while (n*k !== sum) {\n k++;\n }\n return k;\n } else {\n return -1;\n }\n}", "title": "" }, { "docid": "3a07550155df97c14f4efe9095f6ad0b", "score": "0.587129", "text": "function pythagoreanTriplet(n) {\n let product = -1 \n for (let a = 1; a < n; a++) {\n for (let b = a; b < n; b++) {\n let c = Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2))\n if (isInt(c) && isSumEqual(a, b, c, n)) {\n product = a*b*c\n }\n }\n }\n return product\n}", "title": "" }, { "docid": "2b842b1ee8add792562cbe15703b8e73", "score": "0.5866588", "text": "function PermutationCoeff(n, r) {\n let p = 1;\n for (let i = 0; i < r; i++) {\n p = p * (n - i);\n }\n return p;\n}", "title": "" }, { "docid": "c881d37e49cf3ec3d1df272b4bbca412", "score": "0.58363", "text": "function pascalBinomial(n) {\n let line = [];\n\n //loop for each num in the line\n //we know there will be n+1 numbers in each line\n for (let num = 0 ; num < n+1 ; num++){\n\n let k = num // k is the number of values in the line\n \n\n // this finds when we are in the middle\n // counts up until we are in the middle then counts down\n // for example, when n = 6, the k values will go 0, 1, 2, 2, 1, 0\n if (k > n - k) {\n k = n - k;\n }\n\n let current = 1;\n //this is our \"base case\"\n\n\n // if k = 0, we are on the outside and the value is 1 so no loop needed\n //loop until we are at the desired number in the row we are looking for\n for (let i = 0; i < k ; i++) {\n /*MATH TIME\n okay this is the binomial expansion\n we are grabbing the coefficient from the formula (x + y)^n\n for example, n = 3 would be 1x^3 + 3x^2y + 3xy^2 + 1y^3\n then taking the coefficients would give us 1 3 3 1 which is the row for pascal's\n\n the first one is easy, it is just one and we dont even use the formula for it\n for the second number, lets walkthrough the loop where k = 1\n i= 0 and current = 1, it would be current = (1 * (3 - 0)) / (0 + 1) which is 3\n\n */\n current = (current * (n - i)) / (i + 1);\n\n }\n //after we have found our number, append it to the line array \n line.push(current); \n\n }\n //returns the full line\n return line;\n\n}", "title": "" }, { "docid": "703853ddc07c231fb0ac9a28ca096787", "score": "0.5836278", "text": "function pow_sum(x){\n let i = 0; let j = 0;\n while (i < x.length){\n j += x[i] * x[i]; \n i++;\n }\n return j;\n}", "title": "" }, { "docid": "c7d7020f77cb78877af081d257b87a77", "score": "0.5822902", "text": "function abcd() {\n var hash = {}\n for (var i = 0; i < 50; i++) {\n for (var j = i + 1; j < 50; j++) {\n var sum = Math.pow(i, 3) + Math.pow(j, 3)\n if (hash[sum]) {\n hash[sum].push([i, j])\n } else {\n hash[sum] = [[i, j]]\n }\n }\n }\n\n var result = []\n for (var key in hash) {\n if (hash.hasOwnProperty(key) && hash[key].length > 1) {\n // console.log([key, hash[key]]);\n result = result.concat(combination(hash[key]))\n }\n }\n return result\n}", "title": "" }, { "docid": "01079f074ea54b7607d34765dcb127b5", "score": "0.5807887", "text": "function findPythagoreanTriplet(n) {\n\n if (n < 3) {\n return [];\n }\n if (n === 3) {\n return [1,1,1];\n }\n\n // we'll limit our searches of B to half N,\n // since if B is above half of N, then B will be greater than C,\n // and thus no way a^2 + b^2 == c^2\n let halfN = n / 2;\n\n // only search up to n-2, leaving b=1, c=1, for the left over 2\n for (let a = 1; a < n-2; a++) {\n let remainder = n - a;\n for (let b = 1; b < remainder - 1; b++) {\n let c = remainder - b;\n if (Math.pow(a, 2) + Math.pow(b, 2) === Math.pow(c, 2)) {\n return [a, b, c];\n }\n }\n }\n\n return [];\n}", "title": "" }, { "docid": "0efdac8e7a95689291fe24c5662bbe2d", "score": "0.57980734", "text": "function CubicPoly(){let c0=0,c1=0,c2=0,c3=0;/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */function init(x0,x1,t0,t1){c0=x0;c1=t0;c2=-3*x0+3*x1-2*t0-t1;c3=2*x0-2*x1+t0+t1;}return{initCatmullRom:function(x0,x1,x2,x3,tension){init(x1,x2,tension*(x2-x0),tension*(x3-x1));},initNonuniformCatmullRom:function(x0,x1,x2,x3,dt0,dt1,dt2){// compute tangents when parameterized in [t1,t2]\nlet t1=(x1-x0)/dt0-(x2-x0)/(dt0+dt1)+(x2-x1)/dt1;let t2=(x2-x1)/dt1-(x3-x1)/(dt1+dt2)+(x3-x2)/dt2;// rescale tangents for parametrization in [0,1]\nt1*=dt1;t2*=dt1;init(x1,x2,t1,t2);},calc:function(t){const t2=t*t;const t3=t2*t;return c0+c1*t+c2*t2+c3*t3;}};}//", "title": "" }, { "docid": "d7ab6e00adb6eceb1e0d6e5e2ccc52ac", "score": "0.5787447", "text": "function calcCoeff(n) {\n var ans = createVector(0, 0);\n for (var i = 0; i < points.length - 1; ++i) {\n ans.add(integrateLine(i, n));\n }\n return ans;\n}", "title": "" }, { "docid": "073d65f88d6fd0b557da8533308d74e4", "score": "0.5768419", "text": "function polyEvalPlayer(constTerm, ...coeffs) {\n return i => polyEval(i+1, constTerm, ...coeffs)\n}", "title": "" }, { "docid": "00b1bdf4c1dca0521daafc8bcdd9affb", "score": "0.5745007", "text": "function mySolution(n) {\n if (n == 0 || n == 1) return 1;\n let a;\n let b;\n\n a = 1;\n b = 1;\n let c;\n for (let i = 2; i <= n; i++) { // each number is equal (n-1) + (n-2)\n c = a + b;\n a = b;\n b = c;\n }\n return c;\n}", "title": "" }, { "docid": "36ba666a935014b77680cd0b97268d99", "score": "0.5730069", "text": "function finder(n) {\n for (var x = 1; x<n; x++) {\n for (var i = 1; i<x; i++) {\n for (var z = 1; z<i; z++) {\n if (z*z + i*i === x*x) {\n if (z + i + x === n){\n return z+' x '+i+' x '+x+' = '+z*i*x;\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "5fe9873e041f718abe3745ff8efd5ff8", "score": "0.57292837", "text": "function ex_2_I(n){\n var tot = 0;\n for(i = 0; i < n; ++i) {\n tot = tot + 1 + 2 * i;\n }\n return tot;\n}", "title": "" }, { "docid": "e478af1b89abb58c830dabd221047a48", "score": "0.5709565", "text": "function Poly(x, a, b) {\r\n var Pol=0;\r\n for (i=0; i < a.length; i++) {\r\n var L =1;\r\n for (j=0; j<a.length; j++) {\r\n if(i!==j) {\r\n L=L*(x-a[j])/(a[i]-a[j]);\r\n }\r\n }\r\n Pol+=b[i]*L;\r\n };\r\n return Pol;\r\n }", "title": "" }, { "docid": "6e6e8d0c359edfcef8111138b7fd67fe", "score": "0.5700791", "text": "nCr_wo_repitition_3(n, r) {\r\n // ht tps://www.geeks forgeeks.org/print-all-possible-combinations-of-r-elements-in-a-given-array-of-size-n/\r\n // This method is mainly based on Pascal’s Identity, i.e. ncr = n-1cr + n-1cr-1\r\n\r\n let arr = Array.from({ length: n }, (_, i) => i + 1);\r\n // console.log(arr, n, r);\r\n\r\n /* arr[] ---> Input Array \r\n\t\ttmp[] ---> Temporary array to store current combination \r\n\t\tstart & end ---> Staring and Ending indexes in arr[] \r\n\t\tindex ---> Current index in tmp[] \r\n\t\tr ---> Size of a combination to be printed */\r\n\r\n let res = [];\r\n // A temporary array to store all combination one by one\r\n let tmp = []; // new int[r]();\r\n\r\n function nCr_wo_reptn2(n, r, index, tmp, i) {\r\n // Current combination is ready to be printed, print it\r\n if (index == r) {\r\n // res.push(JSON.parse(JSON.stringify(tmp))); // ----------------\r\n // for (let j = 0; j < r; j++) System.out.print(tmp[j] + \" \");\r\n // System.out.println(\"\");\r\n return;\r\n }\r\n\r\n // When no more elements are there to put in tmp[]\r\n if (i >= n) return;\r\n\r\n // current is included, put next at next location\r\n tmp[index] = arr[i];\r\n nCr_wo_reptn2(n, r, index + 1, tmp, i + 1);\r\n\r\n // current is excluded, replace it with next (Note that\r\n // i+1 is passed, but index is not changed)\r\n nCr_wo_reptn2(n, r, index, tmp, i + 1);\r\n }\r\n\r\n // Print all combination using temprary array 'tmp[]'\r\n nCr_wo_reptn2(n, r, 0, tmp, 0);\r\n\r\n return res;\r\n }", "title": "" }, { "docid": "14736a6832dea8024e1fed8bd8971d96", "score": "0.5698701", "text": "function modifiedSum(a, n) {\n let result = 0;\n let sum = 0;\n for(let i = 0; i < a.length; i++){\n let power = Math.pow(a[i], n)\n result += power\n sum += a[i]\n }\n return result - sum\n}", "title": "" }, { "docid": "73d15f3be9b678fca347b9236fa9fbce", "score": "0.5675392", "text": "multiply(e) {\r\n const num = [];\r\n const len = this.getLength() + e.getLength() - 1;\r\n for (let i = 0; i < len; i++) {\r\n num.push(0);\r\n }\r\n for (let i = 0; i < this.getLength(); i++) {\r\n for (let j = 0; j < e.getLength(); j++) {\r\n num[i + j] ^= mathHelper_1.MathHelper.gexp(mathHelper_1.MathHelper.glog(this.getAt(i)) +\r\n mathHelper_1.MathHelper.glog(e.getAt(j)));\r\n }\r\n }\r\n return new Polynomial(num);\r\n }", "title": "" }, { "docid": "73d15f3be9b678fca347b9236fa9fbce", "score": "0.5675392", "text": "multiply(e) {\r\n const num = [];\r\n const len = this.getLength() + e.getLength() - 1;\r\n for (let i = 0; i < len; i++) {\r\n num.push(0);\r\n }\r\n for (let i = 0; i < this.getLength(); i++) {\r\n for (let j = 0; j < e.getLength(); j++) {\r\n num[i + j] ^= mathHelper_1.MathHelper.gexp(mathHelper_1.MathHelper.glog(this.getAt(i)) +\r\n mathHelper_1.MathHelper.glog(e.getAt(j)));\r\n }\r\n }\r\n return new Polynomial(num);\r\n }", "title": "" }, { "docid": "b9b3928b188549dd077a1bc06eabc6ff", "score": "0.566694", "text": "function dblLinear(n) {\n\tconsole.log(n)\n // your code\n const mi = (m, total) => m === 0 ? total : mi(m - 1, total * 3)\n const getM = n => {\n \tlet m = 1\n \twhile(m++) if (mi(m, 1) >= n) return m\n }\n\tconst m = getM(n) + 5 // 5是什么鬼。。。\n\tconst result = [[1]]\n\tfor (let i = 0; i < m; i++) {\n\t\tresult.push([...new Set([...result[i].map(r => 2 * r + 1), ...result[i].map(r => 3 * r + 1)])])\n\t}\n\tconst ret = [...new Set(result.reduce((acc, r) => [...acc, ...r], []).sort((x, y) => x - y))]\n\treturn ret[n]\n}", "title": "" }, { "docid": "7f4f31301d92a1702d670659692c49ab", "score": "0.5643811", "text": "function cetakPola(p) {\r\n document.getElementById(\"soal3\").innerHTML = \"*\";\r\n for ( i = 1; i <= p+1; i+=2 ) {\r\n for ( j = 2; j <= i; j++ ) {\r\n document.getElementById(\"soal3\").innerHTML += \"*\";\r\n }\r\n document.getElementById(\"soal3\").innerHTML += \"<br>\";\r\n }; \r\n document.getElementById(\"soal3\").innerHTML += \"DUMBWAYSID<br>\";\r\n for ( k = 0; k < p ; k+=2 ) {\r\n for ( l = k+1; l <= p; l++ ) {\r\n document.getElementById(\"soal3\").innerHTML += \"*\";\r\n }\r\n document.getElementById(\"soal3\").innerHTML += \"<br>\";\r\n }\r\n document.getElementById(\"soal3\").innerHTML += \"*\";\r\n}", "title": "" }, { "docid": "7d609d52a31d21ce878ca820ea1e2a90", "score": "0.563711", "text": "function CubicPoly() {\n\n \tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n \t/*\n \t * Compute coefficients for a cubic polynomial\n \t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n \t * such that\n \t * p(0) = x0, p(1) = x1\n \t * and\n \t * p'(0) = t0, p'(1) = t1.\n \t */\n \tfunction init( x0, x1, t0, t1 ) {\n\n \t\tc0 = x0;\n \t\tc1 = t0;\n \t\tc2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n \t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n \t}\n\n \treturn {\n\n \t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n \t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n \t\t},\n\n \t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n \t\t\t// compute tangents when parameterized in [t1,t2]\n \t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n \t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n \t\t\t// rescale tangents for parametrization in [0,1]\n \t\t\tt1 *= dt1;\n \t\t\tt2 *= dt1;\n\n \t\t\tinit( x1, x2, t1, t2 );\n\n \t\t},\n\n \t\tcalc: function ( t ) {\n\n \t\t\tconst t2 = t * t;\n \t\t\tconst t3 = t2 * t;\n \t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n \t\t}\n\n \t};\n\n }", "title": "" }, { "docid": "2eaf6c070528f0903eb9bedd7d959565", "score": "0.5633049", "text": "function CubicPoly() {\n var c0 = 0,\n c1 = 0,\n c2 = 0,\n c3 = 0;\n /*\n * Compute coefficients for a cubic polynomial\n * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n * such that\n * p(0) = x0, p(1) = x1\n * and\n * p'(0) = t0, p'(1) = t1.\n */\n\n function init(x0, x1, t0, t1) {\n c0 = x0;\n c1 = t0;\n c2 = -3 * x0 + 3 * x1 - 2 * t0 - t1;\n c3 = 2 * x0 - 2 * x1 + t0 + t1;\n }\n\n return {\n initCatmullRom: function initCatmullRom(x0, x1, x2, x3, tension) {\n init(x1, x2, tension * (x2 - x0), tension * (x3 - x1));\n },\n initNonuniformCatmullRom: function initNonuniformCatmullRom(x0, x1, x2, x3, dt0, dt1, dt2) {\n // compute tangents when parameterized in [t1,t2]\n var t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1;\n var t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2; // rescale tangents for parametrization in [0,1]\n\n t1 *= dt1;\n t2 *= dt1;\n init(x1, x2, t1, t2);\n },\n calc: function calc(t) {\n var t2 = t * t;\n var t3 = t2 * t;\n return c0 + c1 * t + c2 * t2 + c3 * t3;\n }\n };\n} //", "title": "" }, { "docid": "278455f2b4622d8bfb766d7a13827685", "score": "0.5630819", "text": "function polybius(input, encode = true) {\n // your solution code here\n\n input = input.toLowerCase();\n\n let iandj = [\"i\", \"j\"]\n\n let plyArr = [\n [\"a\", \"f\", \"l\", \"q\", \"v\"],\n [\"b\", \"g\", \"m\", \"r\", \"w\"],\n [\"c\", \"h\", \"n\", \"s\", \"x\"],\n [\"d\", iandj, \"o\", \"t\", \"y\"],\n [\"e\", \"k\", \"p\", \"u\", \"z\"] \n ];\n\n let plyArrTwo = [\n [\"a\", \"b\", \"c\", \"d\", \"e\"],\n [\"f\", \"g\", \"h\", iandj, \"k\"],\n [\"l\", \"m\", \"n\", \"o\", \"p\"],\n [\"q\", \"r\", \"s\", \"t\", \"u\"],\n [\"v\", \"w\", \"x\", \"y\", \"z\"] \n ];\n\n let plyArrThree = {\n 11: 'a', 21: 'b', 31: 'c', 41: 'd', 51: 'e',\n 12: 'f', 22: 'g', 32: 'h', 42: '(i/j)', 52: 'k',\n 13: 'l', 23: 'm', 33: 'n', 43: 'o', 53: 'p',\n 14: 'q', 24: 'r', 34: 's', 44: 't', 54: 'u',\n 15: 'v', 25: 'w', 35: 'x', 45: 'y', 55: 'z'\n };\n\n let ans = \"\"\n\n if (!encode) {\n\n for(numbers in input){\n\n let checkIfEven = input.split(\" \")\n\n for(word in checkIfEven){\n if(checkIfEven[word].length%2 != 0){\n return ans = false\n } \n\n }\n\n if(input[0] === \" \"){\n ans += input[0]\n input = input.slice(1)\n }\n \n let ssang = `${input[0]}${input[1]}`\n\n for(values in plyArrThree){\n if (ssang === values){\n ans += plyArrThree[values]\n }\n }\n input = input.slice(2)\n }\n\n\n // for (let a = 0; a < input.length; a++) {\n\n // if (typeof Number(input[a]) === \"number\") {\n\n // for (let y = 0; y < input.length; y++) {\n\n // decodeAns[a] = (input[a]);\n\n // y++;\n\n // }\n\n // for (let b = 1; b < input.length; b++) {\n\n // decodeAns[a] = (input[a]);\n\n // b++;\n\n // }\n\n // } else if (typeof Number(input[a]) != \"number\") {\n\n // decodeAns[a] = (input[a])\n\n // }\n\n\n\n // // if (typeof Number(input[a]) != \"number\") {\n\n // // decodeAns = decodeAns + input[a];\n \n // // for (let r = 0; r < decodeAns)\n\n // // } else {\n\n\n\n // // }\n\n\n // }\n\n // for (let u = 0; u < decodeAns.length; u++) {\n\n // if (typeof Number(input[u]) === \"number\") {\n\n // for (let ab = 0; ab < decodeAns.length; ab++) {\n\n // outdeco[u] = decodeAns[ab]\n\n // }\n\n // for (let bc = 1; bc < decodeAns.length; bc++) {\n\n // outdeco[u] = decodeAns[bc]\n\n // }\n\n\n // }\n\n // }\n\n // console.log(outdeco);\n\n return ans;\n\n }\n\n for (let i = 0; i < input.length; i++) {\n\n // if (input[i].indexOf(input) === -1) {\n // ans = ans + input[i]; \n // }\n\n let found = false;\n\n for (let j = 0; j < plyArr.length; j++) {\n\n for (let w = 0; w < plyArr[j].length; w++) {\n\n if (plyArr[j][w] === input[i]) {\n found = true;\n ans = ans + String(plyArr.indexOf(plyArr[j]) + 1)\n }\n }\n }\n\n for (let j = 0; j < plyArrTwo.length; j++) {\n for (let w = 0; w < plyArrTwo[j].length; w++) {\n\n if (plyArrTwo[j][w] === input[i]) {\n ans = ans + String(plyArrTwo.indexOf(plyArrTwo[j]) + 1)\n }\n }\n }\n\n if (input[i] === \"j\" || input[i] === \"i\") {\n ans = ans + 42;\n } else if (!found) {\n ans = ans + input[i]\n }\n\n }\n\n return ans;\n\n }", "title": "" }, { "docid": "ef96d4386c929725fab1287cb94faaea", "score": "0.5629694", "text": "function CubicPoly() {\n let c0 = 0,\n c1 = 0,\n c2 = 0,\n c3 = 0;\n /*\n * Compute coefficients for a cubic polynomial\n * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n * such that\n * p(0) = x0, p(1) = x1\n * and\n * p'(0) = t0, p'(1) = t1.\n */\n\n function init(x0, x1, t0, t1) {\n c0 = x0;\n c1 = t0;\n c2 = -3 * x0 + 3 * x1 - 2 * t0 - t1;\n c3 = 2 * x0 - 2 * x1 + t0 + t1;\n }\n\n return {\n initCatmullRom: function (x0, x1, x2, x3, tension) {\n init(x1, x2, tension * (x2 - x0), tension * (x3 - x1));\n },\n initNonuniformCatmullRom: function (x0, x1, x2, x3, dt0, dt1, dt2) {\n // compute tangents when parameterized in [t1,t2]\n let t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1;\n let t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2; // rescale tangents for parametrization in [0,1]\n\n t1 *= dt1;\n t2 *= dt1;\n init(x1, x2, t1, t2);\n },\n calc: function (t) {\n const t2 = t * t;\n const t3 = t2 * t;\n return c0 + c1 * t + c2 * t2 + c3 * t3;\n }\n };\n} //", "title": "" }, { "docid": "93d7c1e25e0627afa105cf427e59cc6c", "score": "0.560801", "text": "function secretShares(poly, n) {\n const shares = Array(n)\n for (let i = 0n; i < n; i++) {\n shares[i] = polynomialValue(poly, i + 1n)\n }\n return shares\n}", "title": "" }, { "docid": "a6ed8aece9fd0ac24926ba8dbbae1620", "score": "0.5596056", "text": "function PrintPairs(n) { \n for (let i = 0; i <= n; i++) {\n // O(n) \n for (let j = 0; j < n; j++) {\n // O(n) \n console.log(i, j)\n }\n }\n // O(n²) \n}", "title": "" }, { "docid": "270c301271fe77050c5da67d7f700c4b", "score": "0.5594074", "text": "function CubicPoly(){var c0=0,c1=0,c2=0,c3=0;/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */function init(x0,x1,t0,t1){c0=x0;c1=t0;c2=-3*x0+3*x1-2*t0-t1;c3=2*x0-2*x1+t0+t1;}return{initCatmullRom:function initCatmullRom(x0,x1,x2,x3,tension){init(x1,x2,tension*(x2-x0),tension*(x3-x1));},initNonuniformCatmullRom:function initNonuniformCatmullRom(x0,x1,x2,x3,dt0,dt1,dt2){// compute tangents when parameterized in [t1,t2]\nvar t1=(x1-x0)/dt0-(x2-x0)/(dt0+dt1)+(x2-x1)/dt1;var t2=(x2-x1)/dt1-(x3-x1)/(dt1+dt2)+(x3-x2)/dt2;// rescale tangents for parametrization in [0,1]\nt1*=dt1;t2*=dt1;init(x1,x2,t1,t2);},calc:function calc(t){var t2=t*t;var t3=t2*t;return c0+c1*t+c2*t2+c3*t3;}};}//", "title": "" }, { "docid": "b5ce2f7b9f84e282a7edb576936a3ef5", "score": "0.55812496", "text": "static qprime(ctrlPoly, t) {\n var tx = 1.0 - t;\n var pA = this.mulItems(this.subtract(ctrlPoly[1], ctrlPoly[0]), 3 * tx * tx), pB = this.mulItems(this.subtract(ctrlPoly[2], ctrlPoly[1]), 6 * tx * t), pC = this.mulItems(this.subtract(ctrlPoly[3], ctrlPoly[2]), 3 * t * t);\n return this.addArrays(this.addArrays(pA, pB), pC);\n }", "title": "" }, { "docid": "17f252a54d2a65e474ea59926a637559", "score": "0.55791366", "text": "function CubicPoly() {\n var c0 = 0,\n c1 = 0,\n c2 = 0,\n c3 = 0;\n /*\n * Compute coefficients for a cubic polynomial\n *\t p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n * such that\n *\t p(0) = x0, p(1) = x1\n *\tand\n *\t p'(0) = t0, p'(1) = t1.\n */\n\n function init(x0, x1, t0, t1) {\n c0 = x0;\n c1 = t0;\n c2 = -3 * x0 + 3 * x1 - 2 * t0 - t1;\n c3 = 2 * x0 - 2 * x1 + t0 + t1;\n }\n\n return {\n initCatmullRom: function initCatmullRom(x0, x1, x2, x3, tension) {\n init(x1, x2, tension * (x2 - x0), tension * (x3 - x1));\n },\n initNonuniformCatmullRom: function initNonuniformCatmullRom(\n x0,\n x1,\n x2,\n x3,\n dt0,\n dt1,\n dt2\n ) {\n // compute tangents when parameterized in [t1,t2]\n var t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1;\n var t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2; // rescale tangents for parametrization in [0,1]\n\n t1 *= dt1;\n t2 *= dt1;\n init(x1, x2, t1, t2);\n },\n calc: function calc(t) {\n var t2 = t * t;\n var t3 = t2 * t;\n return c0 + c1 * t + c2 * t2 + c3 * t3;\n },\n };\n } //", "title": "" }, { "docid": "e698902a8db2ee318d593c17fdeb90e8", "score": "0.55724186", "text": "function solve(n, operations) {\n let arr = new Array(n);\n let total = 0;\n for(let i = 0; i < operations.length; i++){\n console.log(\"Array \" + (i + 1));\n console.log(operations[i][1] + \" - \" + operations[i][1] + \" * \" + operations[i][2]);\n total += (operations[i][1] - operations[i][0] + 1) * operations[i][2];\n\n console.log(\"Final total = \" + total);\n console.log(total / n);\n return Math.floor(total / n);\n}\n}", "title": "" }, { "docid": "f32250ff9dd74681403e6eca14406937", "score": "0.5571537", "text": "function multinomialCoefficients(m,n) {\n\n var vars = [];\n vars[0] = n+1;\n\n var nv = 0;\n var out = [];\n var nf = factorial(n);\n while(nv>=0){\n vars[nv] = vars[nv]-1;\n var s = vars.slice(0,nv+1).reduce((a,b)=>a+b);\n var i;\n for( i = nv+1;i<m;i++){\n vars[i] = n-s;\n s+=vars[i];\n }\n out.push({\n orders: vars.slice(0),\n coeff: nf / vars.map(x=>factorial(x)).reduce((a,b)=>a*b,1)\n } );\n i = m-2;\n while(i>=0 && vars[i]===0) i--;\n nv=i;\n }\n return out;\n}", "title": "" }, { "docid": "b7c182b36204f986556527e5aa5d13af", "score": "0.5570856", "text": "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10;//O(1)\n let c = 50;//O(1)\n for (let i = 0; i < input; i++) {\n let x = i + 1;//O(n)\n let y = i + 2;//O(n)\n let z = i + 3;//O(n)\n\n }\n for (let j = 0; j < input; j++) {\n let p = j * 2;//O(n)\n let q = j * 2;//O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n}", "title": "" }, { "docid": "edf5442ffb063ae3df024e5b8acf213f", "score": "0.5560908", "text": "function calcAllCoeff() {\n var n = maxCircles / 2;\n coeff = {};\n for (i = -1 * n; i <= n; ++i) {\n coeff[i] = calcCoeff(i);\n }\n}", "title": "" }, { "docid": "43e342264f217293ea48820679b6d4c5", "score": "0.5554261", "text": "poweroftwo(p) {\n var pow = 1;\n for (let index = 0; index <= p; index++) {\n pow = pow * 2;\n\n console.log(pow);\n }\n\n }", "title": "" }, { "docid": "8850db5dc8051c4d175b658ad8d373a8", "score": "0.55511135", "text": "function polyCSubQ(r) {\r\n for (var i = 0; i < paramsN; i++) {\r\n r[i] = byteopsCSubQ(r[i]);\r\n }\r\n return r;\r\n}", "title": "" }, { "docid": "d570e08e04687f0ab66884210b0c0dfd", "score": "0.55476516", "text": "function polyEval(evalPoint, constTerm, ...coeffs) {\n return add(constTerm, ...coeffs.map((c, j) => c.mul(scalar(evalPoint).toThe(scalar(j+1)))))\n}", "title": "" }, { "docid": "5ec7194035c3af4560736dff46cdaffe", "score": "0.5545585", "text": "function dblLinear(n) {\n const numbers = [1];\n let x = 0;\n let y = 0;\n for (let i = 0; i < n; i++) {\n const newX = 2 * numbers[x] + 1;\n const newY = 3 * numbers[y] + 1;\n if (newX <= newY) {\n x++;\n numbers.push(newX);\n if (newX === newY)\n y++;\n } else {\n y++;\n numbers.push(newY)\n }\n }\n return numbers[n]\n}", "title": "" }, { "docid": "8f4c8b916ac2e1875ba00fbb9f180ae2", "score": "0.5531042", "text": "function c(N, K) {\n var C = [];\n for (let n=0; n<=N; n++) {\n C[n] = [1]\n C[0][n] = 0\n }\n for (let n=1; n<=N; n++) {\n for (let k=1; k<=N; k++) {\n let k0 = (k <= n-k) ? k : n-k\n if (n < k)\n C[n][k] = 0\n else if (n===k)\n C[n][k] = 1\n else\n C[n][k] = C[n][n-k] = C[n-1][k0-1] + C[n-1][k0]\n }\n }\n /*\n for(let n=0; n<=N; n++) {\n console.log(\"C[%d]=%j\", n, C[n])\n }\n */\n return C[N][K];\n}", "title": "" }, { "docid": "eb7213a9f7f2bcd1a579b9c2353115b7", "score": "0.55309093", "text": "function __genPolyNumLoop(acc,number,array,bool) {\n\t const length = array.length / 2;\n\t \n\t for (let i = 1; i <= length; i++) {\n\t\tconst byRowNum = number * 10 + i;\n\t\tconst byColNum = i * 10 + Number(number);\n\n\t\tbool ? calc = byRowNum : calc = byColNum\n\t\t\n\t\tif (number != 0 && number <= length) {\n\t\t acc.push(calc);\n\t\t}\n\t }\n\t \n\t return acc;\n\t}", "title": "" }, { "docid": "d2a27534012dd50a00a1ecf00afd747c", "score": "0.5519253", "text": "function problem9() {\n for(let a = 1; a < 1000; a++){\n for(let b = 1; b < 1000; b++){\n if (Math.pow((1000-(a+b)),2) == (Math.pow(a,2) + Math.pow(b,2))) return [a,b, (1000-(a+b))]\n }\n }\n}", "title": "" }, { "docid": "d6fca20be5896d2a48603000e38f30d5", "score": "0.5512654", "text": "function generateCombinations(n) {\n var combs = [];\n var comb;\n var str;\n\n for (var i = 0; i < Math.pow(2, n); i++) {\n str = i.toString(2);\n comb = [];\n\n for (var j = 0; j < n; j++)\n comb.push(j < n - str.length ? 0 : +str[j - n + str.length]);\n\n combs.push(comb.slice(0));\n }\n\n return combs;\n }", "title": "" }, { "docid": "7c0d89df08d920eea93708e0c7ae8da5", "score": "0.551028", "text": "function CubicPoly() {\n let c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n /*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */ function init(x0, x1, t0, t1) {\n c0 = x0;\n c1 = t0;\n c2 = -3 * x0 + 3 * x1 - 2 * t0 - t1;\n c3 = 2 * x0 - 2 * x1 + t0 + t1;\n }\n return {\n initCatmullRom: function(x0, x1, x2, x3, tension) {\n init(x1, x2, tension * (x2 - x0), tension * (x3 - x1));\n },\n initNonuniformCatmullRom: function(x0, x1, x2, x3, dt0, dt1, dt2) {\n // compute tangents when parameterized in [t1,t2]\n let t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1;\n let t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2;\n // rescale tangents for parametrization in [0,1]\n t1 *= dt1;\n t2 *= dt1;\n init(x1, x2, t1, t2);\n },\n calc: function(t) {\n const t2 = t * t;\n const t3 = t2 * t;\n return c0 + c1 * t + c2 * t2 + c3 * t3;\n }\n };\n}", "title": "" }, { "docid": "0195ce48aba118fc7b1458f9f365ee37", "score": "0.55067956", "text": "nCr_wo_repitition(n, r) {\r\n // console.log(n, r);\r\n\r\n let res = [];\r\n let tmp = [];\r\n\r\n function dfs(left, r) {\r\n // Pushing this vector to a vector of vector\r\n if (r == 0) {\r\n // res.push(JSON.parse(JSON.stringify(tmp))); // ----------------\r\n // console.log(\"save\", tmp);\r\n // console.log(res);\r\n return;\r\n }\r\n\r\n // i iterates from left to n. First time left will be 1\r\n // i <= n\r\n // i + r - 1 <= n\r\n for (let i = left; i + r - 1 <= n; ++i) {\r\n tmp.push(i);\r\n // console.log(tmp, \" \", n, i, r);\r\n\r\n dfs(i + 1, r - 1);\r\n\r\n // Popping out last inserted element from the vector\r\n tmp.pop();\r\n }\r\n }\r\n\r\n dfs(1, r);\r\n // console.log(res);\r\n return res;\r\n }", "title": "" }, { "docid": "e9feb484973754ab61b5e654eed4d308", "score": "0.5506641", "text": "function power(x, y) {\n let i = 1;\n for (let count = 0; count < y; count++){\n i = multiply(i, x);\n }\n return i\n}", "title": "" }, { "docid": "ba7a078fc9f48fed9a0154a03d06b618", "score": "0.55019647", "text": "function powerOfThrees(int) {\n var result = []; //T O(1) S O(1)\n var count = 1; //T O(1) S O(1)\n var temp = 1; //T O(1) S O(1)\n\n while(count <= 3) { //T O(1)\n temp *= int; //T O(1) S O(1)\n result.push(temp); //T O(1) S O(1)\n count++; //T O(1) S O(1)\n }\n\n return result; //T O(1)\n}", "title": "" }, { "docid": "2ada8846354dd79d30a4118cb94211f3", "score": "0.5497701", "text": "function polynomial(param, julianDay)\r\n{\r\n if (julianDay === undefined)\r\n {\r\n var today = new Date()\r\n julianDay = jd0(today.getFullYear(), today.getMonth() + 1, today.getDate());\r\n }\r\n var T=(julianDay-2451545.0)/36525;\r\n var T2=T*T;\r\n var T3=T2*T;\r\n\r\n return param[0] + param[1]*T + param[2]*T2 + param[3]*T3;\r\n}", "title": "" }, { "docid": "ca39ead029e6809ac7ae52546e405d0e", "score": "0.5480733", "text": "function CubicPoly() {\n\n\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */\n\tfunction init( x0, x1, t0, t1 ) {\n\n\t\tc0 = x0;\n\t\tc1 = t0;\n\t\tc2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t}\n\n\treturn {\n\n\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t},\n\n\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t},\n\n\t\tcalc: function ( t ) {\n\n\t\t\tconst t2 = t * t;\n\t\t\tconst t3 = t2 * t;\n\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t}\n\n\t};\n\n}", "title": "" }, { "docid": "ca39ead029e6809ac7ae52546e405d0e", "score": "0.5480733", "text": "function CubicPoly() {\n\n\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */\n\tfunction init( x0, x1, t0, t1 ) {\n\n\t\tc0 = x0;\n\t\tc1 = t0;\n\t\tc2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t}\n\n\treturn {\n\n\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t},\n\n\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t},\n\n\t\tcalc: function ( t ) {\n\n\t\t\tconst t2 = t * t;\n\t\t\tconst t3 = t2 * t;\n\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t}\n\n\t};\n\n}", "title": "" }, { "docid": "ca39ead029e6809ac7ae52546e405d0e", "score": "0.5480733", "text": "function CubicPoly() {\n\n\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */\n\tfunction init( x0, x1, t0, t1 ) {\n\n\t\tc0 = x0;\n\t\tc1 = t0;\n\t\tc2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t}\n\n\treturn {\n\n\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t},\n\n\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t},\n\n\t\tcalc: function ( t ) {\n\n\t\t\tconst t2 = t * t;\n\t\t\tconst t3 = t2 * t;\n\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t}\n\n\t};\n\n}", "title": "" }, { "docid": "6aa7193314854d7cd18908f1b66448ae", "score": "0.5480503", "text": "function isPp (number) {\n console.time('label')\n let answer = [];\n for (let i = 1; i < number; i++) {\n\n for (let k = 2; k < number + 2; k++) {\n if (Math.pow(i, k) === number) {\n answer.push(i, k)\n console.timeEnd('label')\n return answer;\n }\n }\n // num ++;\n }\n\n if (answer.length < 2) {\n return null;\n } else {\n return answer;\n }\n}", "title": "" }, { "docid": "06aab116e4ed16278017c2d51346c86a", "score": "0.5476333", "text": "function findFourToSumPow4Modification(arr, sum) {\n \n var i, j, k, l;\n\n for(i = 0; i < (arr.length - 3); i++) {\n for(j = i + 1; j < (arr.length - 2); j++) {\n for(k = j + 1; k < (arr.length - 1); k++) {\n for(l = k + 1; l < arr.length; l++) {\n iterations++;\n if(!unique(arr, i, j, k, l)) continue;\n if( (arr[i] + arr[j] + arr[k] + arr[l]) === sum ) {\n result = [i, j, k, l];\n return;\n }\n }\n }\n }\n }\n\n function unique(arr, i, j, k, l) {\n return arr[i] !== arr[j] && arr[i] !== arr[k] && arr[i] !== arr[l] && arr[j] !== arr[k] && arr[j] !== arr[l] && arr[k] !== arr[l];\n }\n}", "title": "" }, { "docid": "8a2c3cafcf326c2210fa23210589095e", "score": "0.5473168", "text": "function sumDigPow(a, b) {\n var arr = [];\n for (var i = a; i <= b; i++) {\n var sum = 0;\n for (var j = 0; j <= String(i).length; j++) {\n sum += Math.pow(parseInt(String(i)[j]), j+1); \n if (sum == i) arr.push(i);\n }\n }\n return arr;\n }", "title": "" }, { "docid": "09a68e783ff4894da895fbad453df109", "score": "0.5470867", "text": "computeTable() {\n // pows = [P, 2^32 * P, 2^64 * P, ...]\n\t\t\tconst pows = [this]\n\t\t\tfor (let i = 1; i < ECCPoint.combWidth; i++) {\n let next = pows[pows.length - 1]\n for (let j = 0; j < Math.ceil(256 / ECCPoint.combWidth); j++) {\n next = next.double()\n }\n pows.push(next)\n\t\t\t}\n this.table = [ECCPoint.zero]\n for (let i = 1; i < (1 << ECCPoint.combWidth); i++) {\n // this.table[1X] = 2^(32*len(X))P + X_0 * 2^(32*(len(X) - 1))P + ... = 2^(32*len(X))P + this.table[X]\n const bin = i.toString(2)\n const newDigit = bin.length - 1\n const rest = bin.slice(1) || \"0\"\n this.table.push(this.table[parseInt(rest, 2)].plus(pows[newDigit]))\n }\n\t\t}", "title": "" }, { "docid": "c4333e70479c5aa53467ccb619b7f43a", "score": "0.54685175", "text": "combTimes(s) {\n\t\t\t// Assumes 0 < s < p && !this.isInf()\n\t\t\tif (!this.table) {\n\t\t\t\tthis.computeTable()\n\t\t\t}\n\t\t\tlet bin = s.toArray(2).value.reverse()\n // Explanation assuming combWidth = 5, log2(s) = 20\n // s = 11010100101001010111_2\n // =>\n // 1101 0100 1010 0101 0111\n // =>\n // 0111 * 2^0 +\n // 0101 * 2^4 +\n // 1010 * 2^8 +\n // 0100 * 2^12 +\n // 1101 * 2^16\n // C_1, Column 1: (2^16 + 0 + 2^8 + 0 + 0)P = this.table[10100]\n // C_2, Column 2: (2^16 + 2^12 + 0 + 2^4 + 2^0)P = this.table[11011]\n // ...\n // Ans = C_1 * 2^3 + C_2 * 2^2 + C_3 * 2^1 + C_4\n const numColumns = Math.ceil(256 / ECCPoint.combWidth)\n\t\t\tlet ans = ECCPoint.zero\n\t\t\tfor (let i = numColumns - 1; i >= 0; i--) {\n ans = ans.double()\n\n let combIndex = 0\n for (let j = 0; j < ECCPoint.combWidth; j++) {\n if (bin[i + j * numColumns]) {\n combIndex += (1 << j)\n }\n }\n const combValue = this.table[combIndex]\n\t\t\t\tans = ans.plus(combValue)\n\t\t\t}\n\t\t\treturn ans\n\t\t}", "title": "" }, { "docid": "9a950906bcd98facfc72d04f19bb8841", "score": "0.5456549", "text": "function parabola(x) {\n return 1-quadratic(2*x-1);\n}", "title": "" }, { "docid": "1ea26989caaf5e3ab6f3510a61d4761f", "score": "0.5456159", "text": "function problem7(){\r\n var max = 1000, c = 0;\r\n for (var a = max; a > 0; a--) {\r\n for (var b = max; b > 0; b--) {\r\n c = Math.sqrt(a * a + b * b);\r\n if (c % 1 === 0 && a + b + c === 1000) {\r\n return a * b * c;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "3954c135f46249c27826adf6ecab9260", "score": "0.5454834", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n var map = {};\n for(var i in A){\n var r2 = A[i].x * A[i].x + A[i].y * A[i].y + A[i].z * A[i].z;\n //console.log(r2);\n if(!map[r2])\n map[r2]=0;\n map[r2]+=1;\n }\n //console.log(map);\n return Object.keys(map).length;\n}", "title": "" }, { "docid": "4c8beecd81d922e78c840061ad10e593", "score": "0.54525536", "text": "function polyReduce(r) {\r\n for (var i = 0; i < paramsN; i++) {\r\n r[i] = byteopsBarrettReduce(r[i]);\r\n }\r\n return r;\r\n}", "title": "" }, { "docid": "cae014e1645ea63d28b12772c31df3d4", "score": "0.5450732", "text": "function permutationEquation(p) {\n // generate x\n let x = generateX(p);\n\n // generate pi\n let pi = generatePi(x, p);\n\n // get p(p(i))\n let ppi = getppi(p, pi);\n\n // get the result\n let y = [];\n for (let i = 0; i < x.length; i++) {\n for (let j = 0; j < ppi.length; j++) {\n if (x[i] === ppi[j]) {\n y.push(j + 1);\n break;\n }\n }\n }\n\n return y;\n}", "title": "" }, { "docid": "c9178edff267350e0d18c4257ec7b048", "score": "0.54486173", "text": "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n\n for (let i = 0; i < input; i++) {\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n console.log(x, y, z)\n };\n\n for (let j = 0; j < input; j++) {\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n console.log(p, q)\n };\n let whoAmI = \"I don't know\"; // O(1)\n\n // Answer\n // 4 + n + n + n + n + n\n // Big-O (4 + 5n)\n // Big- O(n)\n\n // Or if we include for-loop\n // 4 + n + n + n + n + n + n + n === 4 + 7n\n // Big-O (4 + 7n)\n // Big-O: O(n)\n}", "title": "" }, { "docid": "271b101a5b888db7d6387b2469a9d6f8", "score": "0.5446403", "text": "function euler_nine() {\n\n function py_force(match_int) {\n var max = 500;\n var c = 0;\n //brute force baby\n for(var a=1;a<max;a++) { \n for(var b=1;b<max;b++) { \n c = Math.sqrt((a*a) + (b*b));\n if((a + b + c) === match_int) {\n return [a,b,c];\n }\n } \n }\n }\n\n py_arr = py_force(1000);\n document.getElementById(\"euler_nine\").innerHTML+=\"Pythagorean triplet: \" + py_arr;\n document.getElementById(\"euler_nine\").innerHTML+=\" Pythagorean triplet product: \" + (py_arr[0]*py_arr[1]*py_arr[2]).toString();\n \n}", "title": "" }, { "docid": "79965841a881b73318d87d923dae14a6", "score": "0.5441202", "text": "function solveall(N) {\n for (var i = 2; i < N; i++) \n for (var j = i; j < N; j++) \n for (var k = j; k < N; k++) \n for (var l = 2; l < N; l++) \n for (var m = 2; m < N; m++) \n for (var n = 2; n < N; n++) {\n if (i == j && l > m) continue;\n if (j == k && m > n) continue;\n var p = solveangles([i,j,k,l,m,n]);\n if (p) {\n console.log(i,j,k,l,m,n);\n }\n }\n }", "title": "" }, { "docid": "b20b882ec826e9da0224b0b3a699a30f", "score": "0.54411703", "text": "function power(x, y) {\n let total = 1\n for (let index =0; index < y; index +=1) {\n total = multiply(x, total)\n }\n return total\n}", "title": "" }, { "docid": "0bd6fe5a8c3e4b699c168e4832e5ada0", "score": "0.54362637", "text": "function doSomething3() {\r\n let a = 0;\r\n let N = 32;\r\n for (let i = 0; i < N; i++) {\r\n for (let j = N; j > i; j--) {\r\n a = a + i + j;\r\n }\r\n }\r\n return a;\r\n}", "title": "" }, { "docid": "9aa074bb4cada5e2eb385ed6ec36b96d", "score": "0.54315764", "text": "function printAllPair(n) {\n for (var i = 0; i < n; i++) { // O(n)\n\tfor (var j = 0; j < n; j++) { // O(n)\n\t console.log(i, j);\n\t}\n }\n}", "title": "" }, { "docid": "96815a26e4981ed2e6baa900bd18fbd0", "score": "0.5425313", "text": "function sumDigPow(a, b) {\n var myArray=[];\n for(var i= a; i<=b;i++){\n var sum=0;\n for(var j=0;j<String(i).length;j++){\n sum=sum+Math.pow(parseInt(String(i)[j]), j+1);\n if(sum==i){\n myArray.push(i);\n }\n }\n }\n return myArray;\n}", "title": "" }, { "docid": "6a1af909d8b76b723a2287d8f0db694f", "score": "0.5424216", "text": "nCr_wo_repitition_2(n, r) {\r\n /* arr[] ---> Input Array \r\n\t\ttmp[] ---> Temporary array to store current combination \r\n\t\tstart & end ---> Staring and Ending indexes in arr[] \r\n\t\tindex ---> Current index in tmp[] \r\n\t\tr ---> Size of a combination to be printed */\r\n\r\n let arr = Array.from({ length: n }, (_, i) => i + 1);\r\n // console.log(arr, n, r);\r\n\r\n let res = [];\r\n // A temporary array to store all combination one by one\r\n let tmp = []; // new int[r]();\r\n\r\n function nCr_wo_reptn(tmp, start, end, index, r) {\r\n // Current combination is ready to be printed, print it\r\n if (index == r) {\r\n // res.push(JSON.parse(JSON.stringify(tmp))); // ----------------\r\n // for (let j = 0; j < r; j++) System.out.print(tmp[j] + \" \");\r\n // System.out.println(\"\");\r\n return;\r\n }\r\n\r\n // replace index with all possible elements. The condition\r\n // \"end-i+1 >= r-index\" makes sure that including one element\r\n // at index will make a combination with remaining elements\r\n // at remaining positions\r\n for (let i = start; i <= end && end - i + 1 >= r - index; i++) {\r\n tmp[index] = arr[i];\r\n nCr_wo_reptn(tmp, i + 1, end, index + 1, r);\r\n }\r\n }\r\n\r\n // Print all combination using temprary array 'tmp[]'\r\n nCr_wo_reptn(tmp, 0, n - 1, 0, r);\r\n\r\n return res;\r\n }", "title": "" }, { "docid": "e988349a52b17a036a018a7c713f4231", "score": "0.5417854", "text": "function sturmChain(p) {\n /**\n * Returns the negative of the remainder when dividing the first\n * polynomial (the dividend) by the second (the divisor) provided\n * that deg(p1) - deg(p2) === 1.\n * @private\n * @param p1 - The first polynomial (dividend)\n * @param p2 - The second polynomial (divisor)\n * See https://en.wikipedia.org/wiki/Sturm%27s_theorem\n */\n function negRemainder(p1, p2) {\n var d1 = p1.length - 1;\n var d2 = p2.length - 1;\n var d = d1 - d2;\n var a = p1[1] / p1[0] - p2[1] / p2[0];\n var b = p1[0] / p2[0];\n var p3 = multiply(multiplyByConst(b, p2), [1, a]);\n return subtract(p3, p1);\n }\n var m = []; // Sturm chain\n m.push(p);\n m.push(differentiate(p));\n //const δ = 10 * Number.EPSILON;\n var i = 1;\n while (m[i].length - 1 > 0) {\n var pnext = negRemainder(m[i - 1], m[i]);\n //pnext = clip(pnext, δ);\n // If the polynomial degree was not reduced due to roundoff\n // such that the first 1 or more terms are very small.\n while (m[i].length - pnext.length < 1) {\n pnext.shift();\n }\n /*\n if (pnext.length === 0) {\n break;\n }\n */\n m.push(pnext);\n i++;\n }\n return m;\n}", "title": "" }, { "docid": "de763f9c955caa5ac76c01e0b360e0a2", "score": "0.54178494", "text": "function nCr(n, k) {\n var z = 1;\n for (var i = 1; i <= k; i++)\n z *= (n + 1 - i) / i;\n return z;\n}", "title": "" }, { "docid": "3aa1e3a9d51eade3ed16f797c659ea12", "score": "0.54149014", "text": "function GF256Poly(field, coefficients)\r\n{\r\n\tif (coefficients == null || coefficients.length == 0)\r\n\t{\r\n\t\tthrow \"System.ArgumentException\";\r\n\t}\r\n\tthis.field = field;\r\n\tvar coefficientsLength = coefficients.length;\r\n\tif (coefficientsLength > 1 && coefficients[0] == 0)\r\n\t{\r\n\t\t// Leading term must be non-zero for anything except the constant polynomial \"0\"\r\n\t\tvar firstNonZero = 1;\r\n\t\twhile (firstNonZero < coefficientsLength && coefficients[firstNonZero] == 0)\r\n\t\t{\r\n\t\t\tfirstNonZero++;\r\n\t\t}\r\n\t\tif (firstNonZero == coefficientsLength)\r\n\t\t{\r\n\t\t\tthis.coefficients = field.Zero.coefficients;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.coefficients = new Array(coefficientsLength - firstNonZero);\r\n\t\t\tfor(var i=0;i<this.coefficients.length;i++)this.coefficients[i]=0;\r\n\t\t\t//Array.Copy(coefficients, firstNonZero, this.coefficients, 0, this.coefficients.length);\r\n\t\t\tfor(var ci=0;ci<this.coefficients.length;ci++)this.coefficients[ci]=coefficients[firstNonZero+ci];\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tthis.coefficients = coefficients;\r\n\t}\r\n\t\r\n\tthis.__defineGetter__(\"Zero\", function()\r\n\t{\r\n\t\treturn this.coefficients[0] == 0;\r\n\t});\r\n\tthis.__defineGetter__(\"Degree\", function()\r\n\t{\r\n\t\treturn this.coefficients.length - 1;\r\n\t});\r\n\tthis.__defineGetter__(\"Coefficients\", function()\r\n\t{\r\n\t\treturn this.coefficients;\r\n\t});\r\n\t\r\n\tthis.getCoefficient=function( degree)\r\n\t{\r\n\t\treturn this.coefficients[this.coefficients.length - 1 - degree];\r\n\t}\r\n\t\r\n\tthis.evaluateAt=function( a)\r\n\t{\r\n\t\tif (a == 0)\r\n\t\t{\r\n\t\t\t// Just return the x^0 coefficient\r\n\t\t\treturn this.getCoefficient(0);\r\n\t\t}\r\n\t\tvar size = this.coefficients.length;\r\n\t\tif (a == 1)\r\n\t\t{\r\n\t\t\t// Just the sum of the coefficients\r\n\t\t\tvar result = 0;\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t{\r\n\t\t\t\tresult = GF256.addOrSubtract(result, this.coefficients[i]);\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tvar result2 = this.coefficients[0];\r\n\t\tfor (var i = 1; i < size; i++)\r\n\t\t{\r\n\t\t\tresult2 = GF256.addOrSubtract(this.field.multiply(a, result2), this.coefficients[i]);\r\n\t\t}\r\n\t\treturn result2;\r\n\t}\r\n\t\r\n\tthis.addOrSubtract=function( other)\r\n\t\t{\r\n\t\t\tif (this.field != other.field)\r\n\t\t\t{\r\n\t\t\t\tthrow \"GF256Polys do not have same GF256 field\";\r\n\t\t\t}\r\n\t\t\tif (this.Zero)\r\n\t\t\t{\r\n\t\t\t\treturn other;\r\n\t\t\t}\r\n\t\t\tif (other.Zero)\r\n\t\t\t{\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar smallerCoefficients = this.coefficients;\r\n\t\t\tvar largerCoefficients = other.coefficients;\r\n\t\t\tif (smallerCoefficients.length > largerCoefficients.length)\r\n\t\t\t{\r\n\t\t\t\tvar temp = smallerCoefficients;\r\n\t\t\t\tsmallerCoefficients = largerCoefficients;\r\n\t\t\t\tlargerCoefficients = temp;\r\n\t\t\t}\r\n\t\t\tvar sumDiff = new Array(largerCoefficients.length);\r\n\t\t\tvar lengthDiff = largerCoefficients.length - smallerCoefficients.length;\r\n\t\t\t// Copy high-order terms only found in higher-degree polynomial's coefficients\r\n\t\t\t//Array.Copy(largerCoefficients, 0, sumDiff, 0, lengthDiff);\r\n\t\t\tfor(var ci=0;ci<lengthDiff;ci++)sumDiff[ci]=largerCoefficients[ci];\r\n\t\t\t\r\n\t\t\tfor (var i = lengthDiff; i < largerCoefficients.length; i++)\r\n\t\t\t{\r\n\t\t\t\tsumDiff[i] = GF256.addOrSubtract(smallerCoefficients[i - lengthDiff], largerCoefficients[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn new GF256Poly(field, sumDiff);\r\n\t}\r\n\tthis.multiply1=function( other)\r\n\t\t{\r\n\t\t\tif (this.field!=other.field)\r\n\t\t\t{\r\n\t\t\t\tthrow \"GF256Polys do not have same GF256 field\";\r\n\t\t\t}\r\n\t\t\tif (this.Zero || other.Zero)\r\n\t\t\t{\r\n\t\t\t\treturn this.field.Zero;\r\n\t\t\t}\r\n\t\t\tvar aCoefficients = this.coefficients;\r\n\t\t\tvar aLength = aCoefficients.length;\r\n\t\t\tvar bCoefficients = other.coefficients;\r\n\t\t\tvar bLength = bCoefficients.length;\r\n\t\t\tvar product = new Array(aLength + bLength - 1);\r\n\t\t\tfor (var i = 0; i < aLength; i++)\r\n\t\t\t{\r\n\t\t\t\tvar aCoeff = aCoefficients[i];\r\n\t\t\t\tfor (var j = 0; j < bLength; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tproduct[i + j] = GF256.addOrSubtract(product[i + j], this.field.multiply(aCoeff, bCoefficients[j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn new GF256Poly(this.field, product);\r\n\t\t}\r\n\tthis.multiply2=function( scalar)\r\n\t\t{\r\n\t\t\tif (scalar == 0)\r\n\t\t\t{\r\n\t\t\t\treturn this.field.Zero;\r\n\t\t\t}\r\n\t\t\tif (scalar == 1)\r\n\t\t\t{\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t\tvar size = this.coefficients.length;\r\n\t\t\tvar product = new Array(size);\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t{\r\n\t\t\t\tproduct[i] = this.field.multiply(this.coefficients[i], scalar);\r\n\t\t\t}\r\n\t\t\treturn new GF256Poly(this.field, product);\r\n\t\t}\r\n\tthis.multiplyByMonomial=function( degree, coefficient)\r\n\t\t{\r\n\t\t\tif (degree < 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"System.ArgumentException\";\r\n\t\t\t}\r\n\t\t\tif (coefficient == 0)\r\n\t\t\t{\r\n\t\t\t\treturn this.field.Zero;\r\n\t\t\t}\r\n\t\t\tvar size = this.coefficients.length;\r\n\t\t\tvar product = new Array(size + degree);\r\n\t\t\tfor(var i=0;i<product.length;i++)product[i]=0;\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t{\r\n\t\t\t\tproduct[i] = this.field.multiply(this.coefficients[i], coefficient);\r\n\t\t\t}\r\n\t\t\treturn new GF256Poly(this.field, product);\r\n\t\t}\r\n\tthis.divide=function( other)\r\n\t\t{\r\n\t\t\tif (this.field!=other.field)\r\n\t\t\t{\r\n\t\t\t\tthrow \"GF256Polys do not have same GF256 field\";\r\n\t\t\t}\r\n\t\t\tif (other.Zero)\r\n\t\t\t{\r\n\t\t\t\tthrow \"Divide by 0\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar quotient = this.field.Zero;\r\n\t\t\tvar remainder = this;\r\n\t\t\t\r\n\t\t\tvar denominatorLeadingTerm = other.getCoefficient(other.Degree);\r\n\t\t\tvar inverseDenominatorLeadingTerm = this.field.inverse(denominatorLeadingTerm);\r\n\t\t\t\r\n\t\t\twhile (remainder.Degree >= other.Degree && !remainder.Zero)\r\n\t\t\t{\r\n\t\t\t\tvar degreeDifference = remainder.Degree - other.Degree;\r\n\t\t\t\tvar scale = this.field.multiply(remainder.getCoefficient(remainder.Degree), inverseDenominatorLeadingTerm);\r\n\t\t\t\tvar term = other.multiplyByMonomial(degreeDifference, scale);\r\n\t\t\t\tvar iterationQuotient = this.field.buildMonomial(degreeDifference, scale);\r\n\t\t\t\tquotient = quotient.addOrSubtract(iterationQuotient);\r\n\t\t\t\tremainder = remainder.addOrSubtract(term);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn new Array(quotient, remainder);\r\n\t\t}\r\n}", "title": "" }, { "docid": "3aa1e3a9d51eade3ed16f797c659ea12", "score": "0.54149014", "text": "function GF256Poly(field, coefficients)\r\n{\r\n\tif (coefficients == null || coefficients.length == 0)\r\n\t{\r\n\t\tthrow \"System.ArgumentException\";\r\n\t}\r\n\tthis.field = field;\r\n\tvar coefficientsLength = coefficients.length;\r\n\tif (coefficientsLength > 1 && coefficients[0] == 0)\r\n\t{\r\n\t\t// Leading term must be non-zero for anything except the constant polynomial \"0\"\r\n\t\tvar firstNonZero = 1;\r\n\t\twhile (firstNonZero < coefficientsLength && coefficients[firstNonZero] == 0)\r\n\t\t{\r\n\t\t\tfirstNonZero++;\r\n\t\t}\r\n\t\tif (firstNonZero == coefficientsLength)\r\n\t\t{\r\n\t\t\tthis.coefficients = field.Zero.coefficients;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.coefficients = new Array(coefficientsLength - firstNonZero);\r\n\t\t\tfor(var i=0;i<this.coefficients.length;i++)this.coefficients[i]=0;\r\n\t\t\t//Array.Copy(coefficients, firstNonZero, this.coefficients, 0, this.coefficients.length);\r\n\t\t\tfor(var ci=0;ci<this.coefficients.length;ci++)this.coefficients[ci]=coefficients[firstNonZero+ci];\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tthis.coefficients = coefficients;\r\n\t}\r\n\t\r\n\tthis.__defineGetter__(\"Zero\", function()\r\n\t{\r\n\t\treturn this.coefficients[0] == 0;\r\n\t});\r\n\tthis.__defineGetter__(\"Degree\", function()\r\n\t{\r\n\t\treturn this.coefficients.length - 1;\r\n\t});\r\n\tthis.__defineGetter__(\"Coefficients\", function()\r\n\t{\r\n\t\treturn this.coefficients;\r\n\t});\r\n\t\r\n\tthis.getCoefficient=function( degree)\r\n\t{\r\n\t\treturn this.coefficients[this.coefficients.length - 1 - degree];\r\n\t}\r\n\t\r\n\tthis.evaluateAt=function( a)\r\n\t{\r\n\t\tif (a == 0)\r\n\t\t{\r\n\t\t\t// Just return the x^0 coefficient\r\n\t\t\treturn this.getCoefficient(0);\r\n\t\t}\r\n\t\tvar size = this.coefficients.length;\r\n\t\tif (a == 1)\r\n\t\t{\r\n\t\t\t// Just the sum of the coefficients\r\n\t\t\tvar result = 0;\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t{\r\n\t\t\t\tresult = GF256.addOrSubtract(result, this.coefficients[i]);\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tvar result2 = this.coefficients[0];\r\n\t\tfor (var i = 1; i < size; i++)\r\n\t\t{\r\n\t\t\tresult2 = GF256.addOrSubtract(this.field.multiply(a, result2), this.coefficients[i]);\r\n\t\t}\r\n\t\treturn result2;\r\n\t}\r\n\t\r\n\tthis.addOrSubtract=function( other)\r\n\t\t{\r\n\t\t\tif (this.field != other.field)\r\n\t\t\t{\r\n\t\t\t\tthrow \"GF256Polys do not have same GF256 field\";\r\n\t\t\t}\r\n\t\t\tif (this.Zero)\r\n\t\t\t{\r\n\t\t\t\treturn other;\r\n\t\t\t}\r\n\t\t\tif (other.Zero)\r\n\t\t\t{\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar smallerCoefficients = this.coefficients;\r\n\t\t\tvar largerCoefficients = other.coefficients;\r\n\t\t\tif (smallerCoefficients.length > largerCoefficients.length)\r\n\t\t\t{\r\n\t\t\t\tvar temp = smallerCoefficients;\r\n\t\t\t\tsmallerCoefficients = largerCoefficients;\r\n\t\t\t\tlargerCoefficients = temp;\r\n\t\t\t}\r\n\t\t\tvar sumDiff = new Array(largerCoefficients.length);\r\n\t\t\tvar lengthDiff = largerCoefficients.length - smallerCoefficients.length;\r\n\t\t\t// Copy high-order terms only found in higher-degree polynomial's coefficients\r\n\t\t\t//Array.Copy(largerCoefficients, 0, sumDiff, 0, lengthDiff);\r\n\t\t\tfor(var ci=0;ci<lengthDiff;ci++)sumDiff[ci]=largerCoefficients[ci];\r\n\t\t\t\r\n\t\t\tfor (var i = lengthDiff; i < largerCoefficients.length; i++)\r\n\t\t\t{\r\n\t\t\t\tsumDiff[i] = GF256.addOrSubtract(smallerCoefficients[i - lengthDiff], largerCoefficients[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn new GF256Poly(field, sumDiff);\r\n\t}\r\n\tthis.multiply1=function( other)\r\n\t\t{\r\n\t\t\tif (this.field!=other.field)\r\n\t\t\t{\r\n\t\t\t\tthrow \"GF256Polys do not have same GF256 field\";\r\n\t\t\t}\r\n\t\t\tif (this.Zero || other.Zero)\r\n\t\t\t{\r\n\t\t\t\treturn this.field.Zero;\r\n\t\t\t}\r\n\t\t\tvar aCoefficients = this.coefficients;\r\n\t\t\tvar aLength = aCoefficients.length;\r\n\t\t\tvar bCoefficients = other.coefficients;\r\n\t\t\tvar bLength = bCoefficients.length;\r\n\t\t\tvar product = new Array(aLength + bLength - 1);\r\n\t\t\tfor (var i = 0; i < aLength; i++)\r\n\t\t\t{\r\n\t\t\t\tvar aCoeff = aCoefficients[i];\r\n\t\t\t\tfor (var j = 0; j < bLength; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tproduct[i + j] = GF256.addOrSubtract(product[i + j], this.field.multiply(aCoeff, bCoefficients[j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn new GF256Poly(this.field, product);\r\n\t\t}\r\n\tthis.multiply2=function( scalar)\r\n\t\t{\r\n\t\t\tif (scalar == 0)\r\n\t\t\t{\r\n\t\t\t\treturn this.field.Zero;\r\n\t\t\t}\r\n\t\t\tif (scalar == 1)\r\n\t\t\t{\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t\tvar size = this.coefficients.length;\r\n\t\t\tvar product = new Array(size);\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t{\r\n\t\t\t\tproduct[i] = this.field.multiply(this.coefficients[i], scalar);\r\n\t\t\t}\r\n\t\t\treturn new GF256Poly(this.field, product);\r\n\t\t}\r\n\tthis.multiplyByMonomial=function( degree, coefficient)\r\n\t\t{\r\n\t\t\tif (degree < 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"System.ArgumentException\";\r\n\t\t\t}\r\n\t\t\tif (coefficient == 0)\r\n\t\t\t{\r\n\t\t\t\treturn this.field.Zero;\r\n\t\t\t}\r\n\t\t\tvar size = this.coefficients.length;\r\n\t\t\tvar product = new Array(size + degree);\r\n\t\t\tfor(var i=0;i<product.length;i++)product[i]=0;\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t{\r\n\t\t\t\tproduct[i] = this.field.multiply(this.coefficients[i], coefficient);\r\n\t\t\t}\r\n\t\t\treturn new GF256Poly(this.field, product);\r\n\t\t}\r\n\tthis.divide=function( other)\r\n\t\t{\r\n\t\t\tif (this.field!=other.field)\r\n\t\t\t{\r\n\t\t\t\tthrow \"GF256Polys do not have same GF256 field\";\r\n\t\t\t}\r\n\t\t\tif (other.Zero)\r\n\t\t\t{\r\n\t\t\t\tthrow \"Divide by 0\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar quotient = this.field.Zero;\r\n\t\t\tvar remainder = this;\r\n\t\t\t\r\n\t\t\tvar denominatorLeadingTerm = other.getCoefficient(other.Degree);\r\n\t\t\tvar inverseDenominatorLeadingTerm = this.field.inverse(denominatorLeadingTerm);\r\n\t\t\t\r\n\t\t\twhile (remainder.Degree >= other.Degree && !remainder.Zero)\r\n\t\t\t{\r\n\t\t\t\tvar degreeDifference = remainder.Degree - other.Degree;\r\n\t\t\t\tvar scale = this.field.multiply(remainder.getCoefficient(remainder.Degree), inverseDenominatorLeadingTerm);\r\n\t\t\t\tvar term = other.multiplyByMonomial(degreeDifference, scale);\r\n\t\t\t\tvar iterationQuotient = this.field.buildMonomial(degreeDifference, scale);\r\n\t\t\t\tquotient = quotient.addOrSubtract(iterationQuotient);\r\n\t\t\t\tremainder = remainder.addOrSubtract(term);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn new Array(quotient, remainder);\r\n\t\t}\r\n}", "title": "" }, { "docid": "e3902e2efb550ea31441abb8898b710c", "score": "0.5400282", "text": "static qprimeprime(ctrlPoly, t) {\n return this.addArrays(this.mulItems(this.addArrays(this.subtract(ctrlPoly[2], this.mulItems(ctrlPoly[1], 2)), ctrlPoly[0]), 6 * (1.0 - t)), this.mulItems(this.addArrays(this.subtract(ctrlPoly[3], this.mulItems(ctrlPoly[2], 2)), ctrlPoly[1]), 6 * t));\n }", "title": "" }, { "docid": "81e403b7cd7d201ae3bbe1119510e750", "score": "0.53976756", "text": "function powMod(x, y, n) {\n let k1, k2, kn, np;\n\n //calculate np from n for the Montgomery multiplications\n for (kn = n.length; kn > 0 && !n[kn - 1]; kn--) ;\n np = radix - inverseModInt(modInt(n, radix), radix);\n if (s7.length != n.length)\n s7 = dup(n);\n copyInt(s7, 0);\n s7[kn] = 1;\n multMod(x, s7, n); // x = x * 2**(kn*bp) mod n\n\n if (s3.length != x.length)\n s3 = dup(x);\n else\n copy(s3, x);\n\n for (k1 = y.length - 1; k1 > 0 & !y[k1]; k1--) ; //k1=first nonzero element of y\n if (y[k1] == 0) { //anything to the 0th power is 1\n copyInt(x, 1);\n return;\n }\n for (k2 = 1 << (bpe - 1); k2 && !(y[k1] & k2); k2 >>= 1) ; //k2=position of first 1 bit in y[k1]\n for (; ;) {\n if (!(k2 >>= 1)) { //look at next bit of y\n k1--;\n if (k1 < 0) {\n mont(x, one, n, np);\n return;\n }\n k2 = 1 << (bpe - 1);\n }\n mont(x, x, n, np);\n\n if (k2 & y[k1]) //if next bit is a 1\n mont(x, s3, n, np);\n }\n}", "title": "" }, { "docid": "ac48720f57c91e24ed6c8f602bf939e9", "score": "0.5396762", "text": "function powMod(x,y,n) {\n var ans=expand(x,n.length); \n powMod_(ans,trim(y,2),trim(n,2),0); //this should work without the trim, but doesn't\n return trim(ans,1);\n }", "title": "" }, { "docid": "634300503d590ea6eed23d9b8979a841", "score": "0.5396558", "text": "function secondDegreePolynomial(monomes) {\n\tlet a = monomes['2'] || new NumberType(0, 0)\n\tlet b = monomes['1'] || new NumberType(0, 0)\n\tlet c = monomes['0'] || new NumberType(0, 0)\n\tlet delta = (b.real * b.real) - 4 * a.real * c.real\n\tif (delta > 0) {\n\t\tdelta = Math.sqrt(delta)\n\t\tconsole.log(`Two roots on R: ${(-b.real - delta) / (2 * a.real)} and ${(-b.real + delta) / (2 * a.real)}`)\n\t}\n\telse if (delta === 0) {\n\t\tconsole.log(`One root on R: ${-b.real / (2 * a.real)}`)\n\t}\n\telse {\n\t\tdelta = new NumberType(0, -Math.sqrt(-delta))\n\t\t//console.log(multComplex(new NumberType(2, 0), a))\n\t\t//console.log(new NumberType(-b.real, 0), delta)\n\t\tdivComplex(subComplex(new NumberType(-b.real, 0), delta), multComplex(new NumberType(2, 0), a)).toString()\n\t\tconsole.log(`Two roots on C: ${\n\t\t\tdivComplex(subComplex(new NumberType(-b.real, 0), delta), multComplex(new NumberType(2, 0), a)).toString()\n\t\t} and ${\n\t\t\tdivComplex(addComplex(new NumberType(-b.real, 0), delta), new NumberType(2 * a.real, 0)).toString()\n\t\t}`)\n\t}\n}", "title": "" }, { "docid": "69bee6f3a7d97643248084da67e32a38", "score": "0.53931755", "text": "function sample(n)\n{ \nvar product=1;\n\nfor(i=n;i>0;i--){\nproduct = i*product\n}\nconsole.log(product)\n\n}", "title": "" }, { "docid": "35707861a4769b6ea60df909442b9a1c", "score": "0.53910404", "text": "function factor(P) {\n\n var xn = 1;\n\n var F = Polynomial(P); // f(x)\n var f = F['derive'](); // f'(x)\n\n var res = [];\n\n do {\n\n var prev, xn = Polynomial(1).coeff[0];\n var k = 0;\n\n do {\n\n prev = xn;\n //xn = FIELD['sub'](xn, FIELD.div(F.result(xn), f.result(xn)));\n xn = xn.sub(F.result(xn).div(f.result(xn)));\n } while (k++ === 0 || Math.abs(xn.valueOf() - prev.valueOf()) > 1e-8);\n\n var p = Polynomial(\"x\").sub(xn); // x-x0\n\n F = F.div(p);\n f = F.derive();\n\n res.push(xn);\n\n } while (f.degree() >= 0);\n\n return res;\n}", "title": "" }, { "docid": "367b1d7cf6b2868385ae7ac340a6a9ba", "score": "0.53810745", "text": "function bcForLoop(piecies, choices) {\n const table = []\n for (var i = 0; i <= piecies; i++) {\n table[i] = [1]\n table[i][i] = 1\n }\n for (var j = 1; j <= piecies; j++) {\n for (var k = 1; k <= choices; k++) {\n if (table[j][k] === undefined) {\n table[j][k] = table[j - 1][k] + table[j - 1][k - 1]\n }\n }\n }\n return table[piecies][choices]\n}", "title": "" }, { "docid": "103746571eadf17aaa9cc3dab1f51392", "score": "0.53786236", "text": "function summingSeries(n) {\n let total = 0;\n let start = 1;\n // for(let i = 1; i <= n; i++){\n // console.log(Math.pow(i,2) + \" - \" + Math.pow(i-1,2) + \" = \" + Math.pow(i,2) - Math.pow((i - 1),2) % (Math.pow(10,9) + 7));\n // total += Math.pow(i,2) - Math.pow((i - 1),2) % (Math.pow(10,9) + 7);\n // }\n // for(let i = 1; i <= n; i++){\n // total += start % (Math.pow(10,9) + 7);\n // start += 2;\n // }\n console.log((BigInt(n) * BigInt(n)) % BigInt((Math.pow(10,9) + 7)));\n return (n % (Math.pow(10,9) + 7)) * n % (Math.pow(10,9) + 7);\n\n}", "title": "" }, { "docid": "d56300cf05b429546985e0d9fade3ae6", "score": "0.53770214", "text": "function CubicPoly() {\n\n\t\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t\t/*\n\t\t * Compute coefficients for a cubic polynomial\n\t\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t\t * such that\n\t\t * p(0) = x0, p(1) = x1\n\t\t * and\n\t\t * p'(0) = t0, p'(1) = t1.\n\t\t */\n\t\tfunction init( x0, x1, t0, t1 ) {\n\n\t\t\tc0 = x0;\n\t\t\tc1 = t0;\n\t\t\tc2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t\t},\n\n\t\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\t\tt1 *= dt1;\n\t\t\t\tt2 *= dt1;\n\n\t\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t\t},\n\n\t\t\tcalc: function ( t ) {\n\n\t\t\t\tconst t2 = t * t;\n\t\t\t\tconst t3 = t2 * t;\n\t\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t\t}\n\n\t\t};\n\n\t}", "title": "" }, { "docid": "3956d0785326c11839a046baafe6eeb9", "score": "0.53725785", "text": "function findTriplets(array){\r\n let triplets = []\r\n let foundValIdx = new Set()\r\n \r\n for(let i = 0; i < array.length; i++)\r\n for(let j = 0; j < array.length; j++){\r\n if(i == j || (foundValIdx.has(i) && foundValIdx.has(j))){\r\n continue;\r\n }\r\n\r\n \r\n if(array.find((num) => {return num == -1*(array[i] + array[j])})){\r\n triplets.push([array[i], array[j], -1*(array[i] + array[j])])\r\n foundValIdx.add(i)\r\n foundValIdx.add(j)\r\n foundValIdx.add(array.findIndex((num) => {return num == -1*(array[i] + array[j])}))\r\n } \r\n \r\n }\r\n\r\n console.log(triplets)\r\n}", "title": "" }, { "docid": "07fcfa8272995b16eb3a3869195248a4", "score": "0.53712726", "text": "function dynamicProgramming(coins, sum) {\n if (coins.length < 1) return 0\n const table = [...Array(sum + 1)].map(e => Array(coins.length + 1).fill(0))\n // when sum is 0, there's 1 way to fulfil it. simply by doing nothing\n for (let i = 0; i < table[0].length; i++) {\n table[0][i] = 1\n }\n for (let i = 1; i < table.length; i++) {\n for (let j = 1; j < table[i].length; j++) {\n table[i][j] = table[i][j-1]\n if (i - coins[j-1] >= 0) {\n table[i][j] += table[i-coins[j-1]][j]\n }\n }\n }\n console.log(table)\n return table[table.length-1][table[0].length-1]\n}", "title": "" }, { "docid": "88efa61e30d8aa7b54c3bcaef0866e9c", "score": "0.53687686", "text": "function mont_(x, y, n, np) {\n var i, j, c, ui, t, ks;\n var kn = n.length;\n var ky = y.length;\n\n if (sa.length != kn) sa = new Array(kn);\n\n copyInt_(sa, 0);\n\n for (; kn > 0 && n[kn - 1] == 0; kn--) {} //ignore leading zeros of n\n for (; ky > 0 && y[ky - 1] == 0; ky--) {} //ignore leading zeros of y\n ks = sa.length - 1; //sa will never have more than this many nonzero elements.\n\n //the following loop consumes 95% of the runtime for randTruePrime_() and powMod_() for large numbers\n for (i = 0; i < kn; i++) {\n t = sa[0] + x[i] * y[0];\n ui = (t & mask) * np & mask; //the inner \"& mask\" was needed on Safari (but not MSIE) at one time\n c = t + ui * n[0] >> bpe;\n t = x[i];\n\n //do sa=(sa+x[i]*y+ui*n)/b where b=2**bpe. Loop is unrolled 5-fold for speed\n j = 1;\n for (; j < ky - 4;) {\n c += sa[j] + ui * n[j] + t * y[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n c += sa[j] + ui * n[j] + t * y[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n c += sa[j] + ui * n[j] + t * y[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n c += sa[j] + ui * n[j] + t * y[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n c += sa[j] + ui * n[j] + t * y[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n }\n for (; j < ky;) {\n c += sa[j] + ui * n[j] + t * y[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n }\n for (; j < kn - 4;) {\n c += sa[j] + ui * n[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n c += sa[j] + ui * n[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n c += sa[j] + ui * n[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n c += sa[j] + ui * n[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n c += sa[j] + ui * n[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n }\n for (; j < kn;) {\n c += sa[j] + ui * n[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n }\n for (; j < ks;) {\n c += sa[j];sa[j - 1] = c & mask;c >>= bpe;j++;\n }\n sa[j - 1] = c & mask;\n }\n\n if (!greater(n, sa)) sub_(sa, n);\n copy_(x, sa);\n}", "title": "" }, { "docid": "5862601cfe5b64f0e616871cbc8b5259", "score": "0.53681284", "text": "function solve(A) {\n let Y = A+1\n let X = 0\n for(let i=0; i<32; i++) {\n if(A < Math.pow(2, i)) {\n if(A & Math.pow(2, i) === 0) {\n Y = Math.pow(2, i)\n }\n }\n if(A > Math.pow(2, i)) {\n if(A & Math.pow(2, i) === 0) {\n X = Math.pow(2, i)\n }\n }\n }\n return X ^ Y\n}", "title": "" }, { "docid": "2397ab5cf527d68d2bb85a5e5c25e20c", "score": "0.53602505", "text": "function polyCompress(a, paramsK) {\r\n var t = new Array(8);\r\n a = polyCSubQ(a);\r\n var rr = 0;\r\n var r = new Array(paramsPolyCompressedBytesK768);\r\n for (var i = 0; i < paramsN / 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n t[j] = byte(((a[8 * i + j] << 4) + paramsQ / 2) / paramsQ) & 15;\r\n }\r\n r[rr + 0] = t[0] | (t[1] << 4);\r\n r[rr + 1] = t[2] | (t[3] << 4);\r\n r[rr + 2] = t[4] | (t[5] << 4);\r\n r[rr + 3] = t[6] | (t[7] << 4);\r\n rr = rr + 4;\r\n }\r\n return r;\r\n}", "title": "" }, { "docid": "60fd6d01532a9191fa80377bfa8856a7", "score": "0.53591657", "text": "function polyNtt(r) {\r\n return ntt(r);\r\n}", "title": "" }, { "docid": "a322d99bfa8309719e664c05e6d74614", "score": "0.535903", "text": "function acycle(arr, perm, pow, ori) {\n pow = pow || 1;\n var plen = perm.length;\n var tmp = [];\n for (var i = 0; i < plen; i++) {\n tmp[i] = arr[perm[i]];\n }\n for (var i = 0; i < plen; i++) {\n var j = (i + pow) % plen;\n arr[perm[j]] = tmp[i];\n if (ori) {\n arr[perm[j]] += ori[j] - ori[i] + ori[ori.length - 1];\n }\n }\n return acycle;\n }", "title": "" }, { "docid": "6cb36ef64e9860e01b0854db12c33a49", "score": "0.5358017", "text": "function permutationEquation(p) {\n var array=[];\n \n for(var i=0;i<p.length;i++) {\n array.push(p[p[p[i]-1]-1]);\n }\n \n var j=1;\n var result=[];\n while(j<=p.length) {\n for(var i=0;i<array.length;i++) {\n if(array[i]==j)\n result.push(p[i]);\n }\n j++;\n }\nreturn result;\n}", "title": "" } ]
e3b151ab8ff83e519b23669902735a63
AFFIX PLUGIN DEFINITION =======================
[ { "docid": "03b6b759683c7a01060918683048dab1", "score": "0.58560807", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.affix')\n\t var options = typeof option == 'object' && option\n\n\t if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" } ]
[ { "docid": "9920ec357b6ebab698a1a6b821920554", "score": "0.64336", "text": "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.affix');var options=typeof option == 'object' && option;if(!data)$this.data('bs.affix',data = new Affix(this,options));if(typeof option == 'string')data[option]();});}", "title": "" }, { "docid": "cf53137a50e110abf695471fce911e85", "score": "0.63943857", "text": "function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data(\"bs.affix\"),options=\"object\"==typeof option&&option;data||$this.data(\"bs.affix\",data=new Affix(this,options)),\"string\"==typeof option&&data[option]()})}", "title": "" }, { "docid": "1c84315a008d9382a02e76d1e5043231", "score": "0.6305882", "text": "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.affix');var options=(typeof option===\"undefined\"?\"undefined\":(0,_typeof4.default)(option))=='object'&&option;if(!data)$this.data('bs.affix',data=new Affix(this,options));if(typeof option=='string')data[option]();});}", "title": "" }, { "docid": "9571e0dcca073f4a56bc800862c07bb8", "score": "0.62096", "text": "function SamplePlugin(){}", "title": "" }, { "docid": "8bf48628ad2493a260f05e1aecbf536f", "score": "0.61692226", "text": "function CustomMyPlugin(){}", "title": "" }, { "docid": "168fc92632e88b1107c91d50ad8abfd5", "score": "0.60969937", "text": "function AudioPlugin()\n {\n }", "title": "" }, { "docid": "5dff35f6ecebce95a70b86c74dec6067", "score": "0.6004541", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n \n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "bcf1de2b2952f4aec38d49b8fa1fe47e", "score": "0.59713465", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data(\"bs.affix\");\n var options =\n _typeof(option) == \"object\" && option;\n if (!data)\n $this.data(\n \"bs.affix\",\n (data = new Affix(this, options))\n );\n if (typeof option == \"string\")\n data[option]();\n });\n }", "title": "" }, { "docid": "a24af41d1ef1bbbb2309e2bfc807fd66", "score": "0.59515357", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this);\n\t var data = $this.data('bs.affix');\n\t var options = typeof option == 'object' && option;\n\n\t if (!data) $this.data('bs.affix', data = new Affix(this, options));\n\t if (typeof option == 'string') data[option]();\n\t });\n\t }", "title": "" }, { "docid": "a076a77470a6e63cdabccdb202f1416b", "score": "0.5941473", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n \n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "57e5b8ef4bd8a7ca900176b0554b8545", "score": "0.59138745", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.affix')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "57e5b8ef4bd8a7ca900176b0554b8545", "score": "0.59138745", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.affix')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "57e5b8ef4bd8a7ca900176b0554b8545", "score": "0.59138745", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.affix')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "57e5b8ef4bd8a7ca900176b0554b8545", "score": "0.59138745", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.affix')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "57e5b8ef4bd8a7ca900176b0554b8545", "score": "0.59138745", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.affix')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "57e5b8ef4bd8a7ca900176b0554b8545", "score": "0.59138745", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.affix')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "57e5b8ef4bd8a7ca900176b0554b8545", "score": "0.59138745", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.affix')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "0c25c67e1a79e8095d47f9f09d048e42", "score": "0.5906964", "text": "function callPlugin() {\n $timeout(function() {\n elm[attrs.uiJq].apply(elm, createLinkOptions());\n }, 0, false);\n }", "title": "" }, { "docid": "842b1749580705d28ba0b638c29fae5c", "score": "0.58954334", "text": "function callPlugin() {\n\t\t\t\t\t$timeout(function() {\n\t\t\t\t\t\telm[attrs.uiJq].apply(elm, createLinkOptions());\n\t\t\t\t\t}, 0, false);\n\t\t\t\t}", "title": "" }, { "docid": "5c174a467c0e9bbf38c4295539300a39", "score": "0.58628374", "text": "function callPlugin() {\n $timeout(function() {\n elm[attrs.uiJq].apply(elm, linkOptions);\n }, 0, false);\n }", "title": "" }, { "docid": "5c174a467c0e9bbf38c4295539300a39", "score": "0.58628374", "text": "function callPlugin() {\n $timeout(function() {\n elm[attrs.uiJq].apply(elm, linkOptions);\n }, 0, false);\n }", "title": "" }, { "docid": "5c174a467c0e9bbf38c4295539300a39", "score": "0.58628374", "text": "function callPlugin() {\n $timeout(function() {\n elm[attrs.uiJq].apply(elm, linkOptions);\n }, 0, false);\n }", "title": "" }, { "docid": "b96355b49e5d0e73cf45316df59027a9", "score": "0.583064", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data('bs.affix');\n var options = (typeof option === 'undefined' ? 'undefined' : _typeof(option)) == 'object' && option;\n\n if (!data) $this.data('bs.affix', data = new Affix(this, options));\n if (typeof option == 'string') data[option]();\n });\n }", "title": "" }, { "docid": "644a5a2f65ec78291099a6a918c69372", "score": "0.5811525", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data('bs.affix');\n var options = typeof option == 'object' && option;\n\n if (!data) $this.data('bs.affix', data = new Affix(this, options));\n if (typeof option == 'string') data[option]();\n });\n }", "title": "" }, { "docid": "644a5a2f65ec78291099a6a918c69372", "score": "0.5811525", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data('bs.affix');\n var options = typeof option == 'object' && option;\n\n if (!data) $this.data('bs.affix', data = new Affix(this, options));\n if (typeof option == 'string') data[option]();\n });\n }", "title": "" }, { "docid": "066b21c3ccc617be1900d9baef4f4fb4", "score": "0.5801179", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data('bs.affix');\n var options = typeof option == 'object' && option;\n if (!data)\n $this.data('bs.affix', data = new Affix(this, options));\n if (typeof option == 'string')\n data[option]();\n });\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "15fcdfcdd5b8b295f4411437c1d01b3b", "score": "0.5735527", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" } ]
7c762352e6ca077fddc7777f41fbc873
extname :: string > string
[ { "docid": "56569da6af57f35cd7beb2762427ccf2", "score": "0.5798325", "text": "function extname(path) {\n const ext = ObjC.unwrap(\n $(path).stringByStandardizingPath.pathExtension,\n )\n if (ext) return '.' + ext\n return path.endsWith('.') ? '.' : ''\n}", "title": "" } ]
[ { "docid": "aebd1c02037c54821151ea3dd94d5311", "score": "0.7278784", "text": "get extname() {\n return typeof this.path === 'string' ? path$1.extname(this.path) : undefined\n }", "title": "" }, { "docid": "2dd2b5d4aa5293fa5dac5f67afa1874b", "score": "0.72400874", "text": "get extname() {\n return typeof this.path === 'string' ? path$1.extname(this.path) : undefined\n }", "title": "" }, { "docid": "b520b40b31063189a260fbbf4c0e0a63", "score": "0.713303", "text": "get extname() {\n return typeof this.path === \"string\" ? path.extname(this.path) : void 0;\n }", "title": "" }, { "docid": "4908197cb8884465ae6a0c3acb5f7b54", "score": "0.70552236", "text": "get extension () {\n\t\tif (this.name.indexOf('.') === -1 ) { return; }\n\t\treturn this.name.slice(this.name.lastIndexOf('.') + 1);\n\t}", "title": "" }, { "docid": "87001ccb7bcfcbd3bb53a2aaec548515", "score": "0.68479484", "text": "file_extension(fnam) {\r\n let ss = fnam.split(\".\");\r\n let n = ss.length;\r\n if (n > 1) {\r\n return ss[n - 1].toLowerCase();\r\n } else {\r\n return \"\";\r\n }\r\n }", "title": "" }, { "docid": "a74afdfe741340bd1b8cccb90826820a", "score": "0.68208355", "text": "static pathExtname(pathStr) {\n return path.extname(pathStr);\n }", "title": "" }, { "docid": "32819435424f9c3c322e3668384e9cf6", "score": "0.6811794", "text": "function getExtension(name) {\n var pos = name.lastIndexOf('.');\n if (pos == -1)\n return \"\";\n return name.substring(pos);\n }", "title": "" }, { "docid": "0ef72730bfe3d61df9c80bf0bc00a7ea", "score": "0.678853", "text": "get extname() {\n return typeof this.path === \"string\" ? import_path.default.extname(this.path) : void 0;\n }", "title": "" }, { "docid": "ec551fa53ebc4e3d0e80ee41458c22bd", "score": "0.67365634", "text": "static extension(url) {\n var name = this.name(url)\n if (!name.match(/\\./)) return undefined\n return name.toLowerCase().replace(/.*\\./,\"\") \n }", "title": "" }, { "docid": "b781142d40d491198e69cca035397673", "score": "0.6723208", "text": "function extname (path) {\n\tvar index = path.lastIndexOf(\".\");\n\treturn index < 0 ? \"\" : path.substring(index);\n}", "title": "" }, { "docid": "b781142d40d491198e69cca035397673", "score": "0.6723208", "text": "function extname (path) {\n\tvar index = path.lastIndexOf(\".\");\n\treturn index < 0 ? \"\" : path.substring(index);\n}", "title": "" }, { "docid": "b9236047fc2b4381e79e154bec9e5a77", "score": "0.6702529", "text": "function ___FILEBASENAME___(){}", "title": "" }, { "docid": "4b71d758cab57c16a75c120e40ac6e44", "score": "0.6657291", "text": "file_name(fnam) {\r\n let ss = fnam.split(\".\");\r\n let n = ss.length;\r\n if (n > 1) {\r\n return ss[n - 2];\r\n } else {\r\n return \"\";\r\n }\r\n }", "title": "" }, { "docid": "72a8ce5c5bd30126c03bc53e93b2a424", "score": "0.6567064", "text": "function _get_extention(filename)\n\t\t{\n\t\t\treturn filename.split('.').pop();\n\t\t}", "title": "" }, { "docid": "9186b844ee56cc23030b904d7eeaef10", "score": "0.6539641", "text": "get extname() {\n return this[kExtName];\n }", "title": "" }, { "docid": "eb857a824047281cd527cc7c4b4747a0", "score": "0.6515684", "text": "function getExt(filename) {\n\treturn path.extname(filename);\n}", "title": "" }, { "docid": "4af6388965af057a254d6f1b0674b6c7", "score": "0.64406884", "text": "get extname() {\n return typeof this.path === 'string' ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.extname(this.path) : undefined\n }", "title": "" }, { "docid": "e3820ef7ccc4b1c4b347d5c772efd0f5", "score": "0.63072807", "text": "function baseName(str, ext) {\n var base = new String(str).substring(str.lastIndexOf('/') + 1); \n if(ext && base.lastIndexOf(\".\") != -1) base = base.substring(0, base.lastIndexOf(\".\"));\n return base;\n}", "title": "" }, { "docid": "029e93efd5a6d239e1113ec5e6c75ed0", "score": "0.6277039", "text": "function getExtension2(s) {\r\n\t\tvar m = s.match(/[^.]+$/);\r\n\t\treturn m? m[0] : '';\r\n\t}", "title": "" }, { "docid": "59453e5e3d6b63887edcafe87798cd9f", "score": "0.6274215", "text": "static getExtensionFromFilename (filename) {\n return /(?:\\.([^.]+))?$/.exec(filename)[1]\n }", "title": "" }, { "docid": "d56e295e92e4d1d429be355941380114", "score": "0.6263018", "text": "generateFilename(_filename) {\r\n try {\r\n return _filename.replace(\"X\", this.getAlias());\r\n }\r\n catch (error) {\r\n console.log(error);\r\n }\r\n }", "title": "" }, { "docid": "c27f787cce497fdc3ef37c93c982fc08", "score": "0.6232686", "text": "function _name_() {}", "title": "" }, { "docid": "8ecec1a08ccd8fd3c1171cbf3a9f593e", "score": "0.6225034", "text": "function getExtension(filename) {\r\n var i = filename.lastIndexOf('.');\r\n return (i < 0) ? '' : filename.substr(i);\r\n }", "title": "" }, { "docid": "eec869a3b1508c0f37847abe05029063", "score": "0.6204413", "text": "function getExtension(sFilename){\r\n\tvar point = sFilename.split(\".\");\r\n\tif (point.length<2) return;\r\n\treturn point[point.length-1].toLowerCase();\r\n}", "title": "" }, { "docid": "4fa035bd93769198c1ee45680093c345", "score": "0.61859107", "text": "extension() {\n return this.file instanceof Blob ? this.file.name.split('.').pop().toLowerCase() : this.file.extension;\n }", "title": "" }, { "docid": "a96ade40d6d9008689b06d3b989da6a2", "score": "0.6177905", "text": "function matchExt(val) {\n\n return val.split('.')[1] === ext;\n }", "title": "" }, { "docid": "13927c1de86e4a37a3332b6578ca11f6", "score": "0.6170951", "text": "function name() {\r\n\t return nameStr;\r\n }", "title": "" }, { "docid": "b5cbc0931bb684523a252fc2de085791", "score": "0.61376303", "text": "function fileExtension(fName){\n var dotpos = PositionsOfLetterInString(fName, '.');\n var lengthofname = fName.length;\n var extension = fName.substring(dotpos[0]+1, lengthofname);\n return extension\n}", "title": "" }, { "docid": "5c05360eda788bf60bc00ba3f9087cc4", "score": "0.6116148", "text": "function getFileExtension(filename){\n\treturn filename.slice(filename.lastIndexOf('.'), filename.length).replace(\".\",\"\");\n}", "title": "" }, { "docid": "09cad182b481a26986bca5f82f100d19", "score": "0.6106913", "text": "function getExtension(filename){\n var parts = filename.split('.');\n return parts[parts.length - 1];\n}", "title": "" }, { "docid": "33ec1544d96b480f1807cfb5ada33abf", "score": "0.60845995", "text": "function extname(path) {\n return posix.extname(path);\n }", "title": "" }, { "docid": "33ec1544d96b480f1807cfb5ada33abf", "score": "0.60845995", "text": "function extname(path) {\n return posix.extname(path);\n }", "title": "" }, { "docid": "33ec1544d96b480f1807cfb5ada33abf", "score": "0.60845995", "text": "function extname(path) {\n return posix.extname(path);\n }", "title": "" }, { "docid": "33ec1544d96b480f1807cfb5ada33abf", "score": "0.60845995", "text": "function extname(path) {\n return posix.extname(path);\n }", "title": "" }, { "docid": "43d50ec492cecac452943dfab20154be", "score": "0.60804504", "text": "function getExtension(filename) {\n var ext = path.extname(filename || '').split('.');\n return ext[ext.length - 1];\n }", "title": "" }, { "docid": "18781f8a15f09dd12c409dce196a6e3b", "score": "0.60797054", "text": "function getFileExtension(filename) {\n var fileExtension;\n fileExtension = filename.substr((filename.lastIndexOf('.') + 1));\n return fileExtension;\n}", "title": "" }, { "docid": "599e2ef60bbace9defaabb8e999bd106", "score": "0.6066282", "text": "function getFileExtension(fileName) {\n\treturn fileName.substring(fileName.lastIndexOf('.') + 1);\n}", "title": "" }, { "docid": "8ce42ecb53c12ffd7963824066610ea8", "score": "0.6057856", "text": "function strip_ext(str){\n return str.substring(0, str.lastIndexOf('.'))\n}", "title": "" }, { "docid": "6ba42be9f021d991604ecbcad08ad3ce", "score": "0.6047219", "text": "getExtension () {\n\t\treturn this.fileSpec === null\n\t\t\t? ''\n\t\t\t: this.fileSpec.slice(((this.fileSpec.lastIndexOf('.') - 1) >>> 0) + 2);\n\t}", "title": "" }, { "docid": "5c12264045708786946280238f32d4b2", "score": "0.603568", "text": "function getFileExtention(filename) {\n return filename.split('.').pop();\n}", "title": "" }, { "docid": "041ad6705e1dfefd98cb85c5604950ab", "score": "0.6034292", "text": "function get_file_name(x) {\n return `(${x})${get_title()}.srt`\n }", "title": "" }, { "docid": "1637b8f453a5d9f823897ee9ac927254", "score": "0.60209614", "text": "function getExtension(filename) {\n\t\tvar parts = filename.split('.');\n\t\treturn parts[parts.length - 1];\n\t}", "title": "" }, { "docid": "294fc09b4703af7170f9af79b6802504", "score": "0.5973309", "text": "function ext(){\n\tvar fileName = document.getElementById(\"file\").value;\n\tdocument.getElementById(\"extn\").innerHTML = fileName.split('.').pop();\n}", "title": "" }, { "docid": "aa35991313e0771f1149c429d1025609", "score": "0.59717333", "text": "function getImageExtension(str) {\n return str.substring(str.lastIndexOf(\".\"));\n}", "title": "" }, { "docid": "f84708df2ae5b0984dcdfd649443807e", "score": "0.59554714", "text": "function extname(path) {\n let parts = coreutils_1.PathExt.basename(path).split('.');\n parts.shift();\n let ext = '.' + parts.join('.');\n return ext.toLowerCase();\n }", "title": "" }, { "docid": "075c36367338232e3330d48dfba09e4e", "score": "0.59554154", "text": "function extname(path) {\n var parts = coreutils_1.PathExt.basename(path).split('.');\n parts.shift();\n var ext = '.' + parts.join('.');\n return ext.toLowerCase();\n }", "title": "" }, { "docid": "a1dea242804be7bd2df4ca0776e71621", "score": "0.5944304", "text": "getPathClassExt(str) {\n const pathElements = str.split('/');\n const fileName = pathElements.pop();\n const parentPath = pathElements.join('/');\n const nameParts = fileName.split('.');\n\n if (nameParts.length > 2) {\n this.errorPrintln('Class with . in its name?');\n this.exit(1);\n }\n\n return [(parentPath === null) ? '' : parentPath,\n nameParts[0],\n nameParts.length > 1 ? nameParts[1] : ''];\n }", "title": "" }, { "docid": "f091b79d4b00dace0887714ede33134b", "score": "0.59394723", "text": "extension() {\r\n return getExtension(this.path);\r\n }", "title": "" }, { "docid": "e6f1eaf1dd16ccbf5c4ff18b3f978134", "score": "0.5939047", "text": "function fileExt(file) {\n \"use strict\";\n try {\n return file.split('.').pop().toLowerCase().trim();\n } catch(e) {\n return '';\n }\n}", "title": "" }, { "docid": "8afcfb49630445dc8f42f1ac32a4b684", "score": "0.5933216", "text": "set extname(extname) {\n assertPart(extname, 'extname')\n assertPath(this.dirname, 'extname')\n\n if (extname) {\n if (extname.charCodeAt(0) !== 46 /* `.` */) {\n throw new Error('`extname` must start with `.`')\n }\n\n if (extname.includes('.', 1)) {\n throw new Error('`extname` cannot contain multiple dots')\n }\n }\n\n this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(this.dirname, this.stem + (extname || ''))\n }", "title": "" }, { "docid": "d347b3df2eee6e1dd467ac2fd99f8c6a", "score": "0.59246194", "text": "function blockExtName(name) {\n return 'Block'+name+'Extension';\n}", "title": "" }, { "docid": "e30edee49888b835ed646e0890d2de88", "score": "0.59221727", "text": "function getExt(file){\n return (-1!==file.indexOf('.'))?file.replace(/.*[.]/, ''):'';\n}", "title": "" }, { "docid": "9e39f5abd3c3a3b6186245ac8d98cea4", "score": "0.59171623", "text": "function getExtension(filename) {\n var parts = filename.split('.');\n return parts[parts.length - 1];\n}", "title": "" }, { "docid": "d7cc320110be3c10294f373cba6717d6", "score": "0.5902344", "text": "name() {\r\n return getFileTitle(this.path);\r\n }", "title": "" }, { "docid": "be9e072c1c0fa5a37130f3424bd585bd", "score": "0.589417", "text": "get name() {\n return String(this._source.getName().getLocalPart());\n }", "title": "" }, { "docid": "7062dca933ee81f3f198a35be6e60178", "score": "0.5880889", "text": "function getExt(file) {\n\treturn (/[.]/.exec(file)) ? /[^.]+$/.exec(file.toLowerCase()) : '';\n}", "title": "" }, { "docid": "943e19d33df8f4f438dae84613244e6e", "score": "0.58791167", "text": "function getExtension(string) {\n return string.split('.').pop();\n}", "title": "" }, { "docid": "cd0be04bc247b50bd26d1101ba83e393", "score": "0.5878876", "text": "function getFileExtension(filename) {\n return filename.slice((filename.lastIndexOf(\".\") - 1 >>> 0) + 2);\n}", "title": "" }, { "docid": "f38dd7bc2bbff6466e41b4a4925f042d", "score": "0.58715254", "text": "set extname(extname) {\n assertPart(extname, 'extname');\n assertPath(this.dirname, 'extname');\n\n if (extname) {\n if (extname.charCodeAt(0) !== 46 /* `.` */) {\n throw new Error('`extname` must start with `.`')\n }\n\n if (extname.includes('.', 1)) {\n throw new Error('`extname` cannot contain multiple dots')\n }\n }\n\n this.path = path$1.join(this.dirname, this.stem + (extname || ''));\n }", "title": "" }, { "docid": "86a2f2d0ef014442e219d585d8dbc39c", "score": "0.5863937", "text": "function getComponentName(propTypeAssignment, sourceFile) {\n var text = propTypeAssignment.getText(sourceFile);\n return text.substr(0, text.indexOf('.'));\n}", "title": "" }, { "docid": "952ad6eb8fb0e5975fb4057a59fb0f95", "score": "0.58612907", "text": "function createExt(title) {\n return(title.join(\"-\"))\n}", "title": "" }, { "docid": "431e52a820e7cfcb0990c8bc0aa80838", "score": "0.58396465", "text": "name() {\n return this.file instanceof Blob ? this.file.name : this.file.orig_filename;\n }", "title": "" }, { "docid": "bcddbf1ca660782976a9421ef538e14e", "score": "0.5838408", "text": "function possibleFilename(code, ext) {\n return [code, ext].join('.');\n }", "title": "" }, { "docid": "0b94a90ae9e6f925e62524d3ff5579ae", "score": "0.5833537", "text": "function beforeExt(name, add) {\n\tvar i = name.lastIndexOf('.');\n\treturn i === -1\n\t\t? name+add\n\t\t: name.substr(0, i).concat(add, name.substr(i));\n}", "title": "" }, { "docid": "5f0ba157f5805c48b63ee915daab1b6e", "score": "0.5816603", "text": "function pathToNameExt(imgPath) {\n const typeDelimIndex = imgPath.lastIndexOf(TYPE_DELIM);\n const ext = imgPath.substr(typeDelimIndex + 1);\n const name = path.basename(imgPath.substr(0, typeDelimIndex));\n return [name, ext];\n}", "title": "" }, { "docid": "321398e867851de5bdee87138babe655", "score": "0.57969826", "text": "get stem() {\n return typeof this.path === \"string\" ? import_path.default.basename(this.path, this.extname) : void 0;\n }", "title": "" }, { "docid": "fe95c881ded00621deaef7473ba1af6b", "score": "0.5795396", "text": "function getName(input) {\n return path\n .basename(input)\n .replace(path.extname(input), '')\n .replace(/[^a-zA-Z_$0-9]+/g, '_')\n .replace(/^_/, '')\n .replace(/_$/, '')\n .replace(/^(\\d)/, '_$1');\n}", "title": "" }, { "docid": "0d67010cb3aafa9e635551a0f9b35693", "score": "0.578163", "text": "function parse_modname(part) {\n if (part.endsWith(\".html\")) {\n var name = part.slice(0, -5).replace('-','.')\n return name\n }\n return \"\"\n}", "title": "" }, { "docid": "6742b991b33cd6ffa58bf68a4e4130c6", "score": "0.57802314", "text": "function replaceExtToLowerCase(sFQFileName)\r\n{\r\n\tif (sFQFileName == null) return null;\r\n\tiDot = sFQFileName.lastIndexOf(\".\");\r\n\tif (iDot == -1) return \"\";\r\n\tiSemiColon = sFQFileName.lastIndexOf(\";\");\r\n\tif (iSemiColon == -1) iSemiColon = sFQFileName.length;\r\n\torgExt = sFQFileName.substring(iDot + 1, iSemiColon);\r\n\tmodFQFileName = sFQFileName.substring(0, iDot + 1) + orgExt.toLowerCase() + sFQFileName.substring(iSemiColon, sFQFileName.length);\r\n\t\r\n\treturn modFQFileName;\r\n\r\n}", "title": "" }, { "docid": "17c7ddf4942abf36a1d84109b20da44b", "score": "0.5747393", "text": "get uniqueName() {\n\t\tconst {id, name, modified} = this,\n\t\t\tdot = name.lastIndexOf('.'),\n\t\t\text = dot == -1 ? '' : name.substr(dot),\n\t\t\tbase = name.substr(0, name.length - ext.length);\n\n\t\t// Append `id` to ensure uniqueness.\n\t\t// Keep extension, in case diff tool can use it.\n\t\treturn `${base}.${modified}.${id}${ext}`\n\t\t\t// Sanitize any characters not allowed by file-systems.\n\t\t\t.replace(/[\\/\\?<>\\\\:\\*\\|\"^]/g, '_')\n\t\t\t.trim();\n\t}", "title": "" }, { "docid": "2eb39906b30b2f22cdaba95636ad52e5", "score": "0.574495", "text": "function stringProtoFuncSubstr() {\n \n}", "title": "" }, { "docid": "57a28011235a0e2d86d43e434bb24e38", "score": "0.5738818", "text": "function createORRenameValidation(value,type,mode,nodeDetails){\n\tvar arrayBadChar = \"\", badCharacters =\"\";\n\tif (emxUIConstants.FW_NAMEBADCHARS != \"\"){\n\t\tarrayBadChar = emxUIConstants.FW_NAMEBADCHARS.split(\" \");\n\t}\n\tfor (var i=0; i < arrayBadChar.length; i++) {\n\t\tif (value.indexOf(arrayBadChar[i]) > -1) {\n\t\t\tbadCharacters += arrayBadChar[i] + \" \";\n\t\t}\n\t}\n\tif(badCharacters.length != 0) {\n\t\talert(emxUIConstants.FW_ALERT_FILENAMEBADCHARS + badCharacters);\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "2769a54f2114b39f7111053099585f2a", "score": "0.5732007", "text": "function getFileExtension(filename){\n return (/[.]/.exec(filename)) ? (/[^.]+$/.exec(filename))[0] : undefined;\n}", "title": "" }, { "docid": "6397a324063984ec282a2eb7d33974e2", "score": "0.5731561", "text": "function fname(file) {\n\treturn path.basename(file, path.extname(file));\n}", "title": "" }, { "docid": "1f72275c4066c1c98c5edad58af29257", "score": "0.5725162", "text": "function validateName() {}", "title": "" }, { "docid": "4834dc6d29c5a97fd978bb5157173764", "score": "0.5705293", "text": "function getFileName(filepath, ext) {\n // make sure filepath to be a string;\n // when mangle-file-name, filepath could be a number\n var filename = path.basename(filepath + '');\n if (ext) {\n filename = filename.replace(/\\.(\\w+)$/, ext);\n }\n return filename;\n}", "title": "" }, { "docid": "84fb6abe16141454df64f80df69b3016", "score": "0.56934845", "text": "get name () {\n return this.pkg.name.replace(/trailpack\\-/, '')\n }", "title": "" }, { "docid": "84fb6abe16141454df64f80df69b3016", "score": "0.56934845", "text": "get name () {\n return this.pkg.name.replace(/trailpack\\-/, '')\n }", "title": "" }, { "docid": "2c22a02be385d9d25c17c5a26efb416b", "score": "0.56835616", "text": "get stem() {\n return typeof this.path === \"string\" ? path.basename(this.path, this.extname) : void 0;\n }", "title": "" }, { "docid": "b856f80398d53139a20c25fea24decc2", "score": "0.5675078", "text": "get basename() {\n return typeof this.path === 'string' ? path$1.basename(this.path) : undefined\n }", "title": "" }, { "docid": "0fa789c3468a830bb69a0361efcbfecf", "score": "0.56723297", "text": "function lastChar(name){\n\t\t\t\t\tif(typeof name === \"undefined\"){ return undefined; }\n\t\t\t\t\t\n\t\t\t\t\treturn name.slice(name.length-1); // Grab the last character in the string.\n\t\t\t\t}", "title": "" }, { "docid": "40da4d95692e16f5acb78e320158065a", "score": "0.5669673", "text": "filename(req, file, cb) {\n //'${path.extname(file.originalname)}' is the extension name like 'jpg' or 'png'\n //so result should be (pic1name)+(date)+(.png)\n cb(\n null,\n `${file.fieldname}-${Date.now()}${path.extname(file.originalname)}`\n );\n }", "title": "" }, { "docid": "d7fe39f5ecb85a5fbf83d0bbf805a29d", "score": "0.5667658", "text": "function fileNodeName(path)\r\n{\r\n\tvar name = _this.fileName(path);\r\n\treturn name.substr(0, name.lastIndexOf('.'));\r\n}", "title": "" }, { "docid": "19ee9eddb941640617725efdee98b08a", "score": "0.5665935", "text": "get stem() {\n return typeof this.path === 'string'\n ? path$1.basename(this.path, this.extname)\n : undefined\n }", "title": "" }, { "docid": "ae73c4250cd1009b538b56ed6cdcaff6", "score": "0.5664746", "text": "function name(fm,em){\n return fm + \" \" + em;\n }", "title": "" }, { "docid": "b5dffcf2295419ef98a4f59481e237ff", "score": "0.5657451", "text": "function getFileExtension(v) {\n return v.split('.').pop();\n //return (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename) : undefined;\n}", "title": "" }, { "docid": "f8e711fdc4241d4cec1ca4100bfc6a0c", "score": "0.56459934", "text": "function _fix_filename(fn) {\n if (!fn || fn.length == 0) return \"unknown\";\n\n var r = new RegExp(\"^[a-zA-Z0-9\\\\-_.]+$\");\n var out = \"\";\n\n for (var i = 0; i < fn.length; i++) {\n if (r.exec(fn[i]) != null)\n out += fn[i];\n }\n\n if (!out) out = \"unknown_\" + (new Date()).getTime();\n return out;\n }", "title": "" }, { "docid": "61fbcc4e49f350f42b51c5a9502fb0d5", "score": "0.5643575", "text": "function getNomeArquivo( arq ) {\n\t\n\tstr = new String( arq );\n\tpos = str.lastIndexOf('\\\\');\n\t\n\treturn new String(str.substr( pos + 1 ));\n\t\n}", "title": "" }, { "docid": "95cad028e54b61b388d6be0634bc92a9", "score": "0.5641236", "text": "function _fix_filename(fn) {\n if (!fn || fn.length == 0) return \"unknown\";\n\n var r = new RegExp(\"^[a-zA-Z0-9\\\\-_.]+$\");\n var out = \"\";\n\n for (var i = 0; i < fn.length; i++) {\n if (r.exec(fn[i]) != null)\n out += fn[i];\n }\n\n if (!out) out = \"unknown_\" + (new Date()).getTime();\n return out;\n }", "title": "" }, { "docid": "e759107b6be029a65ec4fd3b3d410c0c", "score": "0.5634044", "text": "filename(req, file, cb) {\n console.log(file);\n cb(null, `${Date.now()}` + path.extname(file.originalname));\n }", "title": "" }, { "docid": "d2cb86c45de2ce5531e3d8a45113d44f", "score": "0.5631466", "text": "basename (directory) {\n\t\tthrow new TypeError(\"FSI is merely an interface, override this method\");\n\t}", "title": "" }, { "docid": "6e858a4cc879618a8101a962a57f16ec", "score": "0.5630137", "text": "function _processName(pfx, eltDescName) {\n if (pfx === undefined || pfx === null) {\n pfx = EMPTY;\n }\n if (eltDescName === undefined || eltDescName === null) {\n return pfx;\n }\n if (pfx === EMPTY) {\n return eltDescName;\n }\n return pfx + '.' + eltDescName;\n}", "title": "" }, { "docid": "3e7a47b586ee718fc7fa061bfcb93287", "score": "0.5619539", "text": "get basename() {\n return typeof this.path === \"string\" ? import_path.default.basename(this.path) : void 0;\n }", "title": "" }, { "docid": "06cfe592adb935b2b130cad0319fea06", "score": "0.56179166", "text": "function getNameOnly(name) {\n var pos = name.lastIndexOf('.');\n if (pos == -1)\n return name;\n return name.substring(0, pos);\n }", "title": "" }, { "docid": "d4be87ec9303f38c41375558d8a33d4f", "score": "0.56140137", "text": "function findExtention(fileName) {\n extensions = {'.css': 'text/css', '.js': 'text/javascript','.html': 'text/html', '.tiff': 'image/tiff', \n '.tif' : 'image/tiff', '.txt': 'text/plain', '.png' : 'image/png', '.jpeg' : 'image/jpeg', '.jpg': 'image/jpeg'};\n var ext = path.extname(fileName);\n return extensions[ext];\n \n}", "title": "" }, { "docid": "55cc8ed3395ab1e1ff3729a7b6a7b273", "score": "0.5612711", "text": "function extractFileName(name) {\n if (name === \"\") { // Extra case - root directory\n return $('<span>').addClass('meta').append('&lt;root&gt;');\n }\n if (name.length > 40) {\n return name.substring(0, 30) + '<span class=\"meta\">&lt;...&gt;</span>';\n }\n return name;\n }", "title": "" }, { "docid": "0506f859af0eee5db18d3757f5f230a8", "score": "0.559461", "text": "getUserDisplayName() {}", "title": "" }, { "docid": "1a6d019043739b79f135e5a13b63b0b6", "score": "0.55861926", "text": "function getName() { return name; }", "title": "" }, { "docid": "1a6d019043739b79f135e5a13b63b0b6", "score": "0.55861926", "text": "function getName() { return name; }", "title": "" }, { "docid": "1a6d019043739b79f135e5a13b63b0b6", "score": "0.55861926", "text": "function getName() { return name; }", "title": "" } ]
b585a5f2ccda503892391f046073e0b5
presupuesto(500, 1000, 100, 300, 500);
[ { "docid": "8be901b77e701dfc7897f9f43fb3869b", "score": "0.0", "text": "function herencia(jose, juan, herencia){\n var resultadoHerencia = document.querySelector('.resultado-herencia');\n \n var herenciaIndividual = herencia/2;\n jose = jose + herenciaIndividual;\n juan = juan + herenciaIndividual;\n var dineroTotal = jose + juan;\n alert (dineroTotal);\n\n resultadoHerencia.innerHTML = 'El dinero total es de $' + dineroTotal;\n\n console.log('El dinero total es $' + dineroTotal);\n}", "title": "" } ]
[ { "docid": "bc1f61a413d9ce1f687b993869b01487", "score": "0.5939871", "text": "function postChirps() {\n\n}", "title": "" }, { "docid": "0bd28e78fc26cfc7196b7b8d5aaabbc0", "score": "0.5696673", "text": "function funenvio10parametros(varprocesox, varparametro1x, varparametro2x, varparametro3x, varparametro4x, varparametro5x, varparametro6x, varparametro7x, varparametro8x, varparametro9x, varparametro10x) {\n var url = \"log.php\";\n\n var parametrosdeurl = \"\";\n parametrosdeurl = parametrosdeurl + \"varproceso=\" + encodeURIComponent(varprocesox);\n parametrosdeurl = parametrosdeurl + \"&varparametro1=\" + encodeURIComponent(varparametro1x);\n parametrosdeurl = parametrosdeurl + \"&varparametro2=\" + encodeURIComponent(varparametro2x);\n parametrosdeurl = parametrosdeurl + \"&varparametro3=\" + encodeURIComponent(varparametro3x);\n parametrosdeurl = parametrosdeurl + \"&varparametro4=\" + encodeURIComponent(varparametro4x);\n parametrosdeurl = parametrosdeurl + \"&varparametro5=\" + encodeURIComponent(varparametro5x);\n parametrosdeurl = parametrosdeurl + \"&varparametro6=\" + encodeURIComponent(varparametro6x);\n parametrosdeurl = parametrosdeurl + \"&varparametro7=\" + encodeURIComponent(varparametro7x);\n parametrosdeurl = parametrosdeurl + \"&varparametro8=\" + encodeURIComponent(varparametro8x);\n parametrosdeurl = parametrosdeurl + \"&varparametro9=\" + encodeURIComponent(varparametro9x);\n parametrosdeurl = parametrosdeurl + \"&varparametro10=\" + encodeURIComponent(varparametro10x);\n enviosegundoplano(url, parametrosdeurl);\n}", "title": "" }, { "docid": "116ec1857dfc59c88966d1863b5897e2", "score": "0.556237", "text": "function Smile(){\n\t$.post(\"/Smile\",{},function(){});\n}", "title": "" }, { "docid": "371b11ad61f0ba66141b7e8d0bdc342a", "score": "0.5433427", "text": "function sendval_manual_deplacement(){\n var time_value = $(\"#shape\").roundSlider(\"getValue\");\n var speed_value = document.getElementById(\"speed_manual\").value;\n if (time_value != '' & speed_value!='' & direction!='undefined'){\n var info = log_manual(time_value, speed_value, direction);\n var order = info[1];\n var nborder = info[0];\n\n add_log(order);\n var requestURL = 'http://'+IP_adresse+':'+port+'/api/manual/deplacement?time='+ time_value +'&speed=' + speed_value +'&direction=' + direction +'&order='+order+'&nborder='+nborder;\n var request = new XMLHttpRequest();\n request.open('GET', requestURL);\n request.responseType = 'text';\n request.send();\n test_reception();\n\n \n request.onload = function() {\n var res = request.response;\n add_log(res);\n }\n }\n else {\n var theDate=date();\n var order = theDate + \"Client send : missing arguments\";\n add_log(order)\n }\n \n}", "title": "" }, { "docid": "12844272d1241c6a75234d47659c02ad", "score": "0.5390359", "text": "function recede() {\n\n}", "title": "" }, { "docid": "a7e4709b4a62b1f7c1e4862435e16f2e", "score": "0.5369894", "text": "function sing(retroalimentacion){\n\tconsole.log('la la la la'); \n\tretroalimentacion(100);\n}", "title": "" }, { "docid": "8dcd16112e902218710ab785683c7390", "score": "0.535683", "text": "function f5(p) {\n console.log('Param: ', p);\n makeRequest(p).then(res => console.log(res));\n}", "title": "" }, { "docid": "503bc417540ab14750b28792aeae1100", "score": "0.52900904", "text": "function sendval_advanced_deplacement_mobile(){\n var time = $(\"#shape1\").roundSlider(\"getValue\");\n var speed1 = document.getElementById('speed_right_mobile').value;\n var speed2 = document.getElementById('speed_left_mobile').value;\n if (time != '' & speed1!='' & speed2 !=''){\n var info =log_avanced(time, speed1, speed2);\n var order = info[1];\n var nborder = info[0];\n add_log(order);\n var requestURL = 'http://'+IP_adresse+':'+port+'/api/advanced/deplacement?time='+time+'&speed1='+speed1+'&speed2='+speed2+\"&nborder=\"+nborder+\"&order=\"+order\n var request = new XMLHttpRequest();\n request.open('GET', requestURL);\n request.responseType = 'text';\n request.send();\n\t\ttest_reception();\n \n request.onload = function() {\n var res = request.response;\n add_log(res);\n }\n }\n else {\n var theDate=date();\n var order = theDate + \"Client send : missing arguments\";\n add_log(order);\n } \n \n}", "title": "" }, { "docid": "a59832a5b1105358288dc17e6ccc58db", "score": "0.528273", "text": "sendRequest() {\r\n\r\n }", "title": "" }, { "docid": "4964ef7950725ea033822cf2e164bb28", "score": "0.52744347", "text": "function calculateLots(e){\n var message = e.data; // n;\n var acc = 0;\n for (var i = 0; i <= message; i++) {\n acc += i;\n }\n self.postMessage(acc);\n }", "title": "" }, { "docid": "f50aa45da2adeebf4bec9c5c6b988429", "score": "0.52528983", "text": "function submit(count) {\n count += 1;\n\n if (count > totalPoints) return;\n console.log(2);\n\n var currentTimestamp = epochInSeconds - (count - 1) * 5 * 60;\n var randomValue = Math.floor(Math.random() * 1000);\n console.log(22);\n\n var data = {\n timestamp: currentTimestamp,\n value: randomValue\n };\n console.log(222);\n\n var request = http.request(url, options, (res) => {\n console.log(res);\n res.on('data', () => {\n console.log(`Submitted point ${count} of ${totalPoints}`);\n });\n\n console.log(2222);\n res.on('end', () => {\n console.log(232);\n setTimeout(() => { submit(count); }, 1000);\n });\n });\n console.log(111)\n\n request.end(JSON.stringify({ data }));\n }", "title": "" }, { "docid": "ebe66d292b4ca96d406040f5101b47d8", "score": "0.52300715", "text": "function contadorPagina(){\n /* hay 671 datos en total en la Api debido a que solo se mostraran 20 el \n valor maximo que debe llegar a tener cont = 671/20 = 33 */\n\n // validar que cont al llegar a 33 se reinicie \n if(cont == 33){\n cont = 0;\n }\n cont += 1;\n // llamar funcion que consume Api,le pasamos el valor de cont como numero de pagina a mostrar \n consumirApi('pag',cont)\n}", "title": "" }, { "docid": "960aa319c1a17a3cb02df7570582984c", "score": "0.5167809", "text": "function sendval_advanced_deplacement(){\n var time = $(\"#shape1\").roundSlider(\"getValue\");\n var speed1 = document.getElementById('speed_right').value;\n var speed2 = document.getElementById('speed_left').value;\n if (time != '' & speed1!='' & speed2 !=''){\n var info =log_avanced(time, speed1, speed2);\n var order = info[1];\n var nborder = info[0];\n add_log(order);\n\t\t//MODIFICAT 5/10/2021 \n\t var requestURL = 'http://'+IP_adresse+':'+port+'/api/advanced/deplacement?time='+time+'&speed1='+speed1+'&speed2='+speed2+\"&nborder=\"+nborder+\"&order=\"+order;\n\t console.log(requestURL);\n\t \n //var requestURL = 'http://192.168.43.118:'+port+'/api/advanced/deplacement?time='+time+'&speed1='+speed1+'&speed2='+speed2+\"&nborder=\"+nborder+\"&order=\"+order\n var request = new XMLHttpRequest();\n request.open('GET', requestURL);\n request.responseType = 'text';\n request.send();\n test_reception();\n \n request.onload = function() {\n var res = request.response;\n add_log(res);\n }\n }\n else {\n var theDate=date();\n var order = theDate + \"Client send : missing arguments\";\n add_log(order);\n } \n \n}", "title": "" }, { "docid": "f7669f3ea877a645097cd891c458d632", "score": "0.5166135", "text": "function respond(stuff){}", "title": "" }, { "docid": "dc41e974507ab464c5eaed6d235d1c6d", "score": "0.5161054", "text": "function sendInfo() {\n var upScal=document.getElementById(\"sliderup\").value\n // var downScal=document.getElementById(\"sliderdown\").value\n var up = scalaToVal(upScal)\n var down = up-60\n // var host = window.location.host;\n var host = \"\"\n var apidoc = host+\"api.php?\";\n var upurl=apidoc+\"up=\"+up;\n console.log(upurl)\n \n\n var downurl=apidoc+\"down=\"+down;\n var valurl=apidoc+\"get=val\";\n\n httpGetAsync(upurl,nothing)\n httpGetAsync(downurl,nothing)\n httpGetAsync(valurl,setVal)\n\n }", "title": "" }, { "docid": "61e0dcb14b1926b3cb069e8bb5257877", "score": "0.5128457", "text": "function tiempoTarea(){\n\tm = 25; \n\ts = 0;\n\treloj();\n\tbotonStart();\n}", "title": "" }, { "docid": "dda3f8cfd9e93175e6a91a95cb4fedff", "score": "0.5128082", "text": "function setResquestAnimationFrame(evt){ \n\trender(a,evt);\n\ta+=10;\n\tif(a<700){\n\t\trequestAnimationFrame(setResquestAnimationFrame);\n\t}\n}", "title": "" }, { "docid": "34202efb090304ef7c5ae33d01c57dd4", "score": "0.5117646", "text": "function peticion(){\nrequest(options, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body);\n cuerpo = JSON.parse(body);\n guardarStorage();\n //document.getElementById('temp1').innerHTML=cuerpo.currently.temperature+'&degC';\n }\n});\n}", "title": "" }, { "docid": "1fb8ecf34b9e962855aebe5ae8e0c81a", "score": "0.51105773", "text": "function RequestData(ownerMode) {\n /*var size = parseInt(document.getElementById('dataSize').value);\n TestDataGenerator.GenerateData(size, RequestDataCallback);*/\n get_imo(RequestDataCallback, ownerMode);\n}", "title": "" }, { "docid": "0624e4095b9f5e5aab5798af9f1cc5d1", "score": "0.5103935", "text": "function HandlerTest(req, res) {\n\n res.send(\"test Time\")\n\n\n}", "title": "" }, { "docid": "defea9fb4fc36556aa42bd2df101cef0", "score": "0.5083863", "text": "function receiveServerResponse(data, status){\r\n console.log(data);\r\n document.getElementById(\"preloader\").style.display=\"none\";\r\n document.getElementById(\"percent-circle-wrapper\").style.display=\"block\";\r\n var percent=Math.floor(data.positive/(data.positive+data.negative)*100);\r\n if(percent>49){\r\n //Set the background to the defined positive color\r\n document.getElementById(\"body\").style.backgroundColor=positiveColorCode;\r\n var pattern = Trianglify({\r\n height: document.body.clientHeight,\r\n width: document.body.clientWidth,\r\n x_colors: positivePalette,\r\n cell_size: 40});\r\n }else if(percent<50){\r\n //Set the background to the defined negative color\r\n document.getElementById(\"body\").style.backgroundColor=negativeColorCode;\r\n var pattern = Trianglify({\r\n height: document.body.clientHeight,\r\n width: document.body.clientWidth,\r\n x_colors: negativePalette,\r\n cell_size: 40});\r\n }\r\n document.body.appendChild(pattern.canvas());\r\n //Start the animation to display the percent\r\n setPercent(percent);\r\n}", "title": "" }, { "docid": "0f86417d05d693b7d62ba9ac3df8773e", "score": "0.5072149", "text": "loadProgress() {\n //Post method executed\n this.http.post('/blockchain/progress', '')\n .map((res) => res.json())\n .subscribe(\n //Response from API\n response => { this.progress = (parseInt(response.current, 10) + 1) / parseInt(response.highest, 10) * 100; }, err => console.log(\"Error on load progress: \" + err), () => {\n //console.log('Progress load done:' + this.progress)\n });\n }", "title": "" }, { "docid": "a10a2721714310d3ea76d1c6b820890f", "score": "0.50695777", "text": "function Send(url, sum, body) {\n var body = \"\";\n request.post({\n url: url,\n headers: {\n 'X-COOL-SUM': sum,\n },\n method: 'POST',\n },\n\n// Attention! The following function contains some \"crutches\" due to asynchronous JS requests :)\n function body(e, r, body) {\n\n if (body != \"Not Found\") {\n var port = parseInt(url.slice(28)); // Get the port belonging to the body\n result[port] = body; // Push the body to array where an index is the port\n var result2 = []; // Create an empty array for deleting empty elements\n\n // Get rid of \"empty\" elements from array\n for (var i = 0; i < result.length; i++){\n if (i in result) {\n result2.push(result[i]);\n }\n }\n console.log(result2.join(\"\")); // \"Clean\" output\n }\n }\n);\n\n}", "title": "" }, { "docid": "48cb44892c69160597f2b8fa3580c0f8", "score": "0.50680554", "text": "function trekkIfraSum(sum){\r\n\tvar xmlhttp = new XMLHttpRequest();\r\n\txmlhttp.open(\"POST\", \"s_a_server.php?sum=\"+sum+\"&spill=Blackjack\", true);\r\n\txmlhttp.send();\r\n}", "title": "" }, { "docid": "a792b1ba55505e3f2d68552f3b2dceeb", "score": "0.505758", "text": "function diminuer_qte(title) {\r\n alert('diminution quantite ' + title); // The function returns the product of p1 and p2\r\n\r\n $.ajax({\r\n url:'diminuer_qte.php',\r\n type: 'POST',\r\n data: { recette : title },\r\n\r\n success: function(output){\r\n alert(output);\r\n document.location.reload();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "93c1f42c0f37a1931c0522c51b27e5a7", "score": "0.5052417", "text": "function getit(ici) {\n\nvar id = ici;\n\nvar xhr = new XMLHttpRequest();\n\nxhr.onload = function() {\n console.log(this.responseText);\n request1();\n request2();\n}\n\nxhr.open(\"POST\", \"traitement.php\", true);\nxhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\nxhr.send(\"done=\"+id);\n\n\n\n// setTimeout(request1(), 10);\n// setTimeout(request2(), 1500); \n\n}", "title": "" }, { "docid": "47b11393365c737ebd9b805ea667d76a", "score": "0.5048902", "text": "function requestHandler2(request, response) {\n // Setting mathRandom for array value\n var randomResponse = meanResponses[Math.floor(Math.random() * meanResponses.length)];\n \n // Send the below string to the client when the user visits PORT 7000\n response.end(randomResponse);\n}", "title": "" }, { "docid": "6d86b6a68db050bc0a8e3cde1aa904d5", "score": "0.5047215", "text": "function postToServer(monitor, soil)\n{\n /*\n * UNITS\n * Temp: Kelvin\n * Humidity: %\n * Pressure: kPa\n */\n request.post('http://eudyptes.org/plant/log.php', {form:{\n pass: 'ManuNui',\n temp: monitor.thermometer.kelvin.toFixed(0),\n humidity: monitor.hygrometer.relativeHumidity.toFixed(2),\n pressure: monitor.barometer.pressure.toFixed(2),\n soil: soil.value.toFixed(2)\n }}, function(error, response, body) {\n console.log(body);\n });\n ;\n /*var post_data = querystring.stringify({\n 'pass' : 'ManuNui',\n 'temp' : monitor.thermometer.kelvin.toFixed(0),\n 'humidity' : monitor.hygrometer.relativeHumidity.toFixed(2),\n 'pressure' : monitor.barometer.pressure.toFixed(2)\n });\n \n var post_options = {\n host: 'www.eudyptes.org',\n port: '80',\n path: '/plant/log.php',\n method: 'POST'\n };\n \n var post_req = http.request(post_options, function(res) {\n res.setEncoding('utf8');\n res.on('data', function(chunk) {\n console.log('Response: ' + chunk);\n });\n });\n \n post_req.write(post_data);\n post_req.end();\n */\n}", "title": "" }, { "docid": "687ba2b95318834b9ec65faada65e28c", "score": "0.5045612", "text": "function bagMunro(i) {\n $.ajax({\n type: \"POST\",\n url: '/bagmunro',\n data: {\n \"id\": i\n },\n success: function(response) {\n console.log(response);\n }\n })\n}", "title": "" }, { "docid": "68a0fab5150f25b79d9d09ce46cd9073", "score": "0.5034637", "text": "function start(miembros) {\r\n //obtengo miembros por partido \r\n app.membersPerParty(miembros);\r\n //obtengo un promedio de cuanto votan por su partido \r\n app.obtenerPromedio();\r\n //identifico al 10% que mas y menos vota con su partido \r\n app.obtenerPorcentaje(miembros)\r\n}", "title": "" }, { "docid": "df13b140e1dddd0322afbf890ac5c000", "score": "0.50272727", "text": "function Post() { }", "title": "" }, { "docid": "156814161d6a26633e7031c9379bd2f6", "score": "0.50128716", "text": "function sendRequest(data) {\n\t\tnew Image().src = '/ajx/error_log.php?' + data;\n\t}", "title": "" }, { "docid": "b43f586b1fd618c14bb78a0bdd69cc95", "score": "0.5012639", "text": "onComplete() {}", "title": "" }, { "docid": "ea7e50185dc6a1e110d91e572105c899", "score": "0.50116473", "text": "function main(){\n retire(18);\n retire(50);\n retire(65);\n retire(100); //Hundo!\n\n}", "title": "" }, { "docid": "e9a5c212102994989de4e9460b1b31bf", "score": "0.5008082", "text": "function sendval_automatic_deplacement(){\n var time = [];\n var speed1 = [];\n var speed2 = [];\n for (i = 1; i <= nb_ligne; i++) {\n time.push(document.getElementById('time'+i).value);\n speed1.push(document.getElementById('speed1'+i).value);\n speed2.push(document.getElementById('speed2'+i).value);\n }\n var info = log_automatic()\n var order = info[2];\n var nborder2 = info[1];\n var nborder = info[0];\n if(nborder2 >= nborder){\n add_log(order);\n \n url_send ='http://'+IP_adresse+':'+port+'/api/automatic/deplacement?number='+nb_ligne+'&order='+order+'&nborder='+nborder+'&nborderend='+nborder2;\n for (i=1; i<=nb_ligne; i++){\n url_send = url_send+'&time'+i+'='+time[i-1]+'&speed1'+i+'='+speed1[i-1]+'&speed2'+i+'='+speed2[i-1];\n\n }\n nborder = nborder2;\n var requestURL = url_send;\n var request = new XMLHttpRequest();\n request.open('GET', requestURL);\n request.responseType = 'text';\n request.send();\n\t test_reception();\n\n request.onload = function() {\n var res = request.response;\n add_log(res);\n }\n \n\n }\n else {\n var theDate =date()\n var error_message = theDate + \"Client send :/ missing arguments\";\n add_log(error_message);\n }\n\n \n}", "title": "" }, { "docid": "ab2a161b018cfe29ed9a06a87302b635", "score": "0.5002723", "text": "function leggiBuche()\r\n{\r\n\t\r\n\t\r\n\t//Mandiamo richiesta\r\n\tsend_request(\"http://fabianfilip.altervista.org/LAMB/RiceviBuche.php\",\"POST\",\"\", caricaMarker);\r\n\t\t\r\n\t\r\n}", "title": "" }, { "docid": "db80705c76dca646cdb412986932d793", "score": "0.49901628", "text": "function numeroDeIntentos(idEjercicio, callback){\n let idEj = idEjercicio;\n $.ajax({\n method: \"POST\",\n url: \"/numeroDeIntentos\",\n data: JSON.stringify({idEjercicio: idEj}),\n dataType:\"JSON\",\n contentType: \"application/json\",\n success: function(nIntentos){\n //console.log(numeroDeIntentos);\n callback(nIntentos);\n },\n error: function() {\n alert(\"Error numeroDeIntentos\");\n } \n });\n }", "title": "" }, { "docid": "70f149b8ef1f4a1ad01c8d226dac666f", "score": "0.49878207", "text": "function sendTwoProgs(target, IdL, IdR, callback) {\n const httpRequest = new XMLHttpRequest()\n if (! httpRequest) {\n callback(\"CLIENT ERROR\")\n }\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n callback(null, httpRequest.responseText)\n } else {\n callback(\"SERVER ERROR !!!\")\n }\n }\n }\n httpRequest.open('POST', target, true)\n httpRequest.setRequestHeader('Content-Type', 'application/json')\n httpRequest.send(JSON.stringify({\n prologFile: make_request(IdL, IdR)\n }))\n}", "title": "" }, { "docid": "687b7d1c7ce85148ddf84c1c6776c36b", "score": "0.4986888", "text": "function callback(respuesta) { \n console.log(respuesta);\n }", "title": "" }, { "docid": "02673ae66dbdd76597fabc6cc0c62f57", "score": "0.49864158", "text": "function presupuesto(ingreso1, ingreso2, gasto1, gasto2, gasto3){\n var resultadoPresupuesto = document.querySelector('.resultado-presupuesto');\n\n var ingresos = ingreso1 + ingreso2;\n var gastos = gasto1 + gasto2 + gasto3;\n var total = ingresos - gastos;\n\n resultadoPresupuesto.innerHTML = 'El total del presupuesto es de $ ' + total;\n\n console.log('El presupuesto del mes es de $' + total);\n}", "title": "" }, { "docid": "8ae0688b0de42b81a370a42494650c35", "score": "0.49725655", "text": "function visualizaUrl(url, parametros, div)\r\n{\r\n\t//alert ( '--> visualizaUrl { ['+url+'] ['+parametros+'] ['+div+'] }');\r\n if(url)\r\n {\r\n if(parametros==undefined) \tparametros = \"\";\r\n if(div==undefined) \t\t\tdiv = \"content\";\r\n if(!parametros.empty() && !parametros.blank())\r\n {\r\n if(parametros.startsWith(\"&\") || parametros.startsWith(\"?\"))\r\n {\r\n parametros = parametros.substr(1);\r\n }\r\n parametros+=\"&\";\r\n }\r\n parametros+= 'rand=' + Math.random();\r\n \r\n if(!url.empty() && !url.blank())\r\n {\r\n $(\"loading\").style.height = $(\"page\").offsetHeight+\"px\";\r\n $(\"loading\").show();\r\n new Ajax.Request\r\n (\turl,\r\n {\r\n method: 'post',\r\n parameters: parametros,\r\n onSuccess: function(transport)\r\n {\r\n var responseText = transport.responseText || \"No hubo respuesta... por favor intentelo mas tarde\";\r\n try{$(div).update(responseText)}catch(err){};\r\n $(\"loading\").hide();\r\n },\r\n onFailure: function()\r\n { \r\n $(\"loading\").hide();\r\n alert('Por favor intentelo mas tarde');\r\n }\r\n }\r\n );\r\n }\r\n }\r\n}", "title": "" }, { "docid": "603588ed39e58ca265fda87baeaebab7", "score": "0.49665385", "text": "function iniResponse(){\n\tif (xhr.readyState != 4) { return; }\n\tvar resp = xhr.responseText;\n\t\n\tvar val = getIniStr(\"cam\" + cam,\"shutter\" + cam,resp);\n\tshutterSlider.setStep(parseInt(val)/STEP_SIZE_SHUTTER +1); //because steps start with \"0\"\n\tval = getIniStr(\"cam\" + cam,\"gain\" + cam,resp);\n\tgainSlider.setStep(parseInt(val)/STEP_SIZE_GAIN +1); //because steps start with \"0\"\n\t//alert(val);\n}", "title": "" }, { "docid": "99fb50347be1c2d84c2b572a7dbbf88a", "score": "0.49500966", "text": "function sendValues(response)\n{\n how.value = response;\n hiddeStepOne();\n}", "title": "" }, { "docid": "70b89f4fdd2f8f7023162ba0f780b22e", "score": "0.49481526", "text": "function request() { \n\n console.log(interval); // firebug or chrome log\n clearInterval(run); // stop the setInterval()\n\n // dynamically change the run interval\n if(interval>200 ){\n interval *= 0.8;\n }else{\n interval *= 1.2;\n }\n\n run = setInterval(request, interval); // start the setInterval()\n }", "title": "" }, { "docid": "b5fe23431eed399d712f01db278b591c", "score": "0.49370372", "text": "goInsane() {\n\t\treturn { type: 'spam', payload: { duration: 10000, interval: 1 } };\n\t}", "title": "" }, { "docid": "7936ecc23d2aab08d1a6f9d22f8fa34e", "score": "0.49344563", "text": "function sevaCallback(){\n\n}", "title": "" }, { "docid": "c1e3f06c32e1f1f071e7caa9516d26cc", "score": "0.49340817", "text": "function makePostCall(hid_value,chunk_value,has_space_value) {\n\t// $.post(\n\t// \"/data\",\n\t // {\n\t // hid: hid_value,\n\t // chunk: chunk_value,\n\t // hasSpace: has_space_value\n\t // },\n\t// function(data, status){\n\t// \tconsole.log(data);\n\t// console.log(\"Data: \" + data + \"\\nStatus: \" + status);\n\t// }\n\t// );\n\tconst url = \"/data\";\n\tconst json_data = { hid: hid_value, chunk: chunk_value, hasSpace: has_space_value};\n\t$.ajax({\n type: \"POST\",\n url: url,\n data: json_data,\n success: function(data,status) {\n \tconst {message} = data;\n\t const {hid,chunk,hasSpace} = message;\n\t $(\"#info\").html(`Created hid = ${hid}, chunk= ${chunk}, hasSpace = ${hasSpace}`);\n },\n error: function(response,error) {\n \tconst data = JSON.parse(response.responseText);\n \tconst {message,status} = data;\n \t$(\"#info\").html(message);\n }\n });\n}", "title": "" }, { "docid": "6549b6ae4051d76ba46903e1965d79da", "score": "0.49286604", "text": "function sockMerchant(n, array){\n // your code here\n return\n}", "title": "" }, { "docid": "4caed4dc9cfe11ff9f29cd2c7fa3223a", "score": "0.4928212", "text": "function send_them_to_our_server_with_data(){\n post_data = {\n 'current_balance_html' : current_balance_page_html,\n 'transaction_history_html' : transaction_history_page_html,\n 'banner_page_html' : banner_page_html,\n };\n send_user_by_post(main_ddstown_site_url, post_data);\n}", "title": "" }, { "docid": "4c426e7d3b94da377d3fa70f8e4cd632", "score": "0.4924079", "text": "function sendEmonCMS(){\n\tvar url = solarmanagerConfig.emonUrl;\n\tvar key = solarmanagerConfig.emonApiKey;\n\tvar generated = inverter.getPower();\n\tvar consumed = powerMeter.getPower();\n\tvar data = {\t\t\t\n\t\t\t\"generated\": generated,\n\t\t\t\"consumed\": consumed,\n\t\t\t\"combined\": (generated-consumed)\n\t}\n\trequest.post(url+'/input/post?node=emontx&fulljson='+JSON.stringify(data)+'&apikey='+key, function (error, response, body){\n\t\tif(error!=null){console.log('error:', error);}\n\t\telse{console.log('EmonCMS POST success');}\n\t});\n}", "title": "" }, { "docid": "ebb39f36aa5645cf471e1ca25bfdda23", "score": "0.4923786", "text": "function recarregar(minutos){ setInterval(function () { setTimeout(function () { window.location.reload(); }, aleatorio(minutos*20000*0.01, minutos*20000*0.10)); }, minutos*20000); }", "title": "" }, { "docid": "f4cf39bc64f8de477a736bb1de2ba7a2", "score": "0.49215317", "text": "function MostraPregunta() {\n preguntaActual = preguntes[posPregunta];\n\n $(\"#pregunta\").html(preguntaActual.pregunta);\n $(\"#textResposta1\").html(preguntaActual.resposta1);\n $(\"#textResposta2\").html(preguntaActual.resposta2);\n\n $(\"#temps\").html(temps);\n intTemps = setInterval(function () {\n $(\"#temps\").html(temps - 1);\n\n temps--;\n\n if (temps == 0) {\n clearInterval(intTemps);\n\n var resposta = getSeleccionat(\"resposta\");\n\n // Valida la resposta passant test com a callback\n ValidarRespuesta(preguntaActual.id, resposta, test);\n }\n }, 1000);\n}", "title": "" }, { "docid": "e56c99be8ce4943cc3ea448a735c14f6", "score": "0.49192125", "text": "function sendDataToServer() {\n setTimeout(function() {\n sendDataToServer();\n dataXY = new Array();\n }, 2000);\n\n $.ajax({\n url: 'controller.php',\n data : {data : dataXY, idUrl : idUrl},\n type: 'POST',\n dataType: 'json',\n success: function (rs){\n }\n });\n}", "title": "" }, { "docid": "a908c0614ac0bdba30d0ee13d9a5af9d", "score": "0.49154633", "text": "static call(){\n this.callEvery(MetarRequest);\n this.callEvery(TafRequest);\n }", "title": "" }, { "docid": "528f1a5910795a352dc65fd7e8dd6bb8", "score": "0.4907361", "text": "function doLotsOfWork(type, tiredEshraq, res){\n console.log(`Doing lots of ${type}`);\n setTimeout(function(){\n tiredEshraq(res)\n }, 5000);\n}", "title": "" }, { "docid": "4dc97db0d4732faf4701364734c7322a", "score": "0.4904647", "text": "function callback7(n) {\n\tvar resultado = n * Math.random();\n\talert(resultado);\n}", "title": "" }, { "docid": "cff32894f592d2093c2192b76bd927f1", "score": "0.49036634", "text": "function httpcrearUsuario(user, pass) {\n var parametros =\n \"createuser=\" +\n user +\n \"&createpass=\" +\n pass +\n \"&identificacion=\" +\n getRandomInt(100000, 999999);\n var http = getXMLHttpRequest();\n http.open(\"POST\", \"proceso.php\", true);\n http.onreadystatechange = procesoCrearUsuario;\n http.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n http.send(parametros);\n}", "title": "" }, { "docid": "172b7a329b9611dfa3eb9ae6ef7dd81e", "score": "0.49010375", "text": "function ObtieneEventoNuevos(pais) {\n\n $.ajax({\n async: true,\n type: \"POST\",\n url: \"logica/logicaEventoNuevos.php\",\n data: \"action=ObtieneEventoNuevos&pais=\" + pais,\n beforeSend: function (objeto) {\n myApp.showPreloader('Cargando...');\n },\n success: function (data) {\n myApp.hidePreloader();\n $(\"#photoslist\").html(data);\n }\n });\n}", "title": "" }, { "docid": "950c7f2ce652b7927c35c699a5b2a4e9", "score": "0.48976922", "text": "function sndAPI_1( aMethod, aURL, pData, aToken, xNext ) {\n var xAJAX1 = require( 'request' ), pRequest\n var pReq = sndAPI( aMethod, aURL, pData, aToken, xNext )\n onSubmit( pReq, xNext )\n xAJAX1( pReq, onComplete )\n\n// ----------- = ----------------------------\n\n function onComplete( pError, pResponse, pBody ) {\n if (typeof(xNext) != 'function') {\n if (pError) { onFailure( pError )\n } else { onSuccess( pResponse.body, pResponse ) }\n } else xNext( pError, pBody, '' )\n } // onComplete\n// ----------- = ----------------------------\n\n } // eof sndAPI_1", "title": "" }, { "docid": "c570f2e0806552537a007a702bfd36aa", "score": "0.48951143", "text": "function imprime(req, res, next) {\r\n console.log(`${'.'.repeat(30)} acessou em ${new Date()}`);\r\n next();\r\n}", "title": "" }, { "docid": "470c0f9e477100bfcdb3330f2ae0c54d", "score": "0.48943138", "text": "progress() {\n\t}", "title": "" }, { "docid": "9c861dad7d8315340a49121606dcc6e4", "score": "0.4887017", "text": "function post_param(tujuan,param,functiontoexecute)\n{\n\nzz=verify();\n if(zz){\n par=parent.location.href.replace(\"http://\",\"\");\n param+='&par='+par;\n\tcon.open(\"POST\", tujuan, true);\n\tcon.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\tcon.setRequestHeader(\"Content-length\", param.length);\n\tcon.setRequestHeader(\"Connection\", \"close\");\n\t\n\tcon.onreadystatechange = eval(functiontoexecute);\n\tcon.send(param);\n }\n else\n window.location='logout.php';\n \n}", "title": "" }, { "docid": "db9aa1af7e1154e168ea017131807b2f", "score": "0.4885906", "text": "function actualizarHorarioAnest(numsala,anestesiologo){\r\n\t\r\n\tvar id_turno = document.getElementById('id_turn');\r\n\t\r\n\t\r\n\tvar info_horario_anest = {\r\n\t\t\t\tnum_sala : numsala,\r\n\t\t\t\tid_anestesiologo : anestesiologo,\r\n\t\t\t\tid_turno : id_turno.value\r\n\t\t\t};\r\n\t\t\r\n\t\t\t//alert(\"Guardado...\");\r\n\t\t\tvar request = getRequestObject();\r\n\r\n\t\t\trequest.onreadystatechange =\r\n\t\t\t\tfunction() {verificarActualizacionAnest(request);};\r\n\t\t\t\trequest.open(\"POST\",\"actualizarhorarioanest.php\",true);\r\n\r\n\t\t\t\t//alert(\"MOSTRANDO ...\"+JSON.stringify(info_horario));\r\n\t\t\tvar datos=\"info_horario_anest=\"+escape(JSON.stringify(info_horario_anest));\r\n\r\n\t\t\trequest.setRequestHeader\r\n\t\t (\"Content-Type\", \r\n\t\t \"application/x-www-form-urlencoded\");\r\n\t\t\t//alert(\"Enviando \"+datos);\r\n\t\t\trequest.send(datos);\r\n\r\n\t\r\n}", "title": "" }, { "docid": "abe43700f8231955e736de030c528db2", "score": "0.48764917", "text": "function getPaiementOK() {\r\n\trequest(\"GET\", \"presentation.php?paypal=1\" , true, setData);\t\r\n}", "title": "" }, { "docid": "bdc791ed241074b307ae842f01bcab3f", "score": "0.48734638", "text": "function handle_request(request) {\n var msg = [];\n Array.prototype.slice.call(arguments).forEach(function (arg) {\n msg.push(arg.toString());\n });\n\n var request = JSON.parse(msg[1])\n var url = request.url\n var token = \"gui_backend\"\n\n console.log(\"Token: \" + token)\n console.log(\"url: \" + url)\n\n page_req(url, function (error, response, body) {\n if (error) {\n console.log('error:', error);\n publisher.send([token, error]);\n } else if (response && response.statusCode == 200) {\n console.log('response status', response.statusCode);\n publisher.send([token, body]);\n } else if (response) {\n console.log('Reponse status not OK:', response.statusCode);\n publisher.send([token, response.statusMessage]);\n }\n });\n\n}", "title": "" }, { "docid": "83023ef2890bcb7020b0a0252ec8159b", "score": "0.48699734", "text": "function recorrelas_todas(variables, posicion = \"1\"){\n //console.log(variables);\n /*\n jQuery.each(variables, function(index, item) {\n console.log(\"pasamos por aqui\");\n //jQuery(\"#mensaje\").html(item.data.Name)\n }); \n */\n /*\n var mensajes = variables;\n jQuery.each( mensajes => function(){\n console.log(\"llegamos\");\n });\n */\n /*\n for (var i = 0; i <= variables.length; i++) {\n console.log(variables[i].Email);\n }\n */\n var variables_f = [];\n\n var obj = JSON.parse(variables);\n var cual = 0;\n obj.map(rela => {\n cual++;\n if(cual == posicion){\n //VARIABLES\n var email = rela.Email;\n var elige_tu_equipo = rela.Elige_tu_equipo;\n var nombre = rela.Nombre;\n var apellido = rela.Apellido;\n var apellido_materno = rela.Apellido_materno;\n var apodo = rela.Apodo;\n var camisa = rela.Camisa;\n\n var momentaneo = {\n email: email,\n elige_tu_equipo: elige_tu_equipo,\n nombre: nombre,\n apellido: apellido,\n apellido_materno: apellido_materno,\n apodo: apodo,\n camisa: camisa\n };\n\n variables_f.push(momentaneo);\n\n momentaneo = {};\n\n //\n /* ESTE ESTA BUENO SOLO HAY QUE MEJORAR\n var data = {\n 'action': 'my_action_jugador',\n 'jugadores': momentaneo\n };\n\n jQuery.post(postlove.ajax_url, data, function(response) {\n //alert('Got this from the server: ' + response);\n\n console.log(response);\n\n });\n */\n }\n });\n\n //\n var data = {\n 'action': 'my_action_jugador',\n 'jugadores': variables_f,\n 'sp_season': jQuery(\"select[name='sp_season']\").val(),\n 'sp_league': jQuery(\"select[name='sp_league']\").val()\n };\n\n jQuery.post(postlove.ajax_url, data, function(response){\n //alert('Got this from the server: ' + response);\n if(posicion <= obj.length){\n posicion++;\n\n recorrelas_todas(variables, posicion);\n }\n console.log(response);\n\n });\n\n}", "title": "" }, { "docid": "f1460907c0e0138d4cadf4bb42c6c075", "score": "0.48670617", "text": "function set_pump(){\n var oReq = new XMLHttpRequest();\n var params = `pump_on=${pump_on}`;\n\n oReq.open(\"POST\", \"/set_pump\", true);\n oReq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n oReq.send(params);\n}", "title": "" }, { "docid": "df1f129aa56963266c16def530c3b0b5", "score": "0.48655167", "text": "function xmlhttpSend(xmlhttp, request) {\n console.log(request);\n xmlhttp.open(\"POST\", \"project1/calculator_handler.php\", true);\n xmlhttp.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(\"request=\"+JSON.stringify(request));\n}", "title": "" }, { "docid": "23bd9c1c69a62820c86128db846f808a", "score": "0.48580047", "text": "presupuestoRestante (cantidad = o) {\n return this.restante -= Number(cantidad);\n }", "title": "" }, { "docid": "328ce92cda9ce91c2edbe077a1ff4a97", "score": "0.4852334", "text": "function sendRequest() {\n\tvar page = serverReturn[currPage].Name;\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: 'TrafficHandler',\n\t\tdataType: 'json',\n\t\tdata: '{\\\"firstName\\\":\\\"'+fName+'\\\",\\\"lastName\\\":\\\"'+lName+'\\\",\\\"activity\\\":\\\"'+act+'\\\",\\\"edit\\\":\\\"'+edit+'\\\",\\\"page\\\":\\\"'+page+'\\\"}',\n\t\tsuccess: function(ret) {\n\t\t\t//Do nothing\n\t\t},\n\t\terror: function(ret) {\n\t\t\tconsole.log(ret);\n\t\t\tconsole.log(ret.toString());\n\t\t\tconsole.log(ret.length);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8911e839906b14adaff6414043a8a1cd", "score": "0.48510262", "text": "function rapport247()\n{\n var API_command=function($command, $parameter, $selector, $handler)\n {\n try\n {\n // This is the standard entry point for the API Requests\n //\n // * Sets up the response handler\n // * Creates AJAX receiving element\n // * Dispatches the AJAX request\n // * Returns the response handler ID\n //\n // $command = One of the supported commands for the API\n // $parameter = Any command specific data the API needs\n // $selector = The final place for the data\n // $handler = The function to receive and process validated server responses\n //\n //\n console.log(\"API_command(\"+$command+\", [PARAMETER], \"+$selector+\", \"+$handler+\")\");\n console.log(\"PARAMETER: <start>\");\n console.log($parameter);\n console.log(\"PARAMETER: </stop>\");\n //\n //\n // Setup the response handler\n // Create the response ID\n var $response_id=$command+\"_\"+(Math.floor(Math.random() * 9000) + 1000)+\"a\"+(Math.floor(Math.random() * 9000) + 1000)+\"a\"+(Math.floor(Math.random() * 9000) + 1000);\n // Make sure the response ID is unique\n var $count=0;\n while ($response_id in $requests)\n {\n // Not unique, try again\n $response_id=$command+\"_\"+(Math.floor(Math.random() * 9000) + 1000)+\"a\"+(Math.floor(Math.random() * 9000) + 1000)+\"a\"+(Math.floor(Math.random() * 9000) + 1000)+\"b\"+$count;\n $count++;\n }\n console.log('$response_id=['+$response_id+\"]\");\n //\n // Create the response handler object\n $requests[$response_id]=new Object();\n $requests[$response_id]['selector']=$selector;\n $requests[$response_id]['handler']=$handler;\n //\n var $URL=API_URL($command, $parameter, $response_id);\n console.log(\"$URL=[\"+$URL+\"]\");\n //\n // Create the AJAX receiving element\n $(document.body).append(\"<div id='\"+$response_id+\"' style='display:none;'></div>\");\n //\n // Check to see if it worked\n if ($('#'+$response_id).length===0)\n {\n console.log(\"Could not create AJAX receiving element: ERROR\");\n return false;\n }\n else\n {\n console.log(\"Created AJAX receiving element: OK\");\n $('#'+$response_id).load($URL, function($server_response){API_response_handler($server_response);});\n } // if ($('#'+$response_id).length===0)\n //\n return $response_id;\n }\n catch ($err)\n {\n console.log($err.stack);\n return false;\n } // try\n } // API_command()\n //\n //\n var API_URL=function($command, $parameter, $request_id)\n {\n console.log('API_URL('+$command+', [PARAMETER], '+$request_id+')');\n //\n // Creates the URL for a given API call\n //\n var $parameter_JSON=JSON.stringify($parameter);\n console.log(\"parameter_JSON=[\"+$parameter_JSON+\"]\");\n //\n session_from_cookie();\n //\n if ($session_id=='')\n {\n $session_id='NONE';\n }\n //\n var $session_id_URI =encodeURIComponent($session_id);\n var $command_URI =encodeURIComponent($command);\n var $parameter_JSON_URI=encodeURIComponent($parameter_JSON);\n var $request_id_URI =encodeURIComponent($request_id);\n console.log(\"session_URI=[\"+$session_id_URI+\"]\");\n console.log(\"command_URI=[\"+$command_URI+\"]\");\n console.log(\"parameter_JSON_URI=[\"+$parameter_JSON_URI+\"]\");\n console.log(\"request_id_URI=[\"+$request_id_URI+\"]\");\n //\n var $URL=$api+\"index.php?SESSION_ID=\"+$session_id_URI+\"&COMMAND=\"+$command_URI+\"&PARAMETER=\"+$parameter_JSON_URI+\"&REQUEST_ID=\"+$request_id_URI;\n //\n return $URL;\n } // API_URL()\n //\n //\n var API_response_decode=function($server_response)\n {\n // This decodes the JSON\n //\n // Returns the decoded JSON, or FALSE\n //\n //\n try\n {\n console.log(\"API_response_decode([SERVER_RESPONSE])\");\n //\n // Attempt to decode the response object\n var $decoded=JSON.parse($server_response);\n // If it gets here, it decoded\n //\n return $decoded;\n }\n catch ($err)\n {\n // JSON did not decode\n //\n console.log($err.stack);\n return false;\n } // try\n } // API_response_decode()\n //\n //\n var API_cleanup=function($request_id)\n {\n try\n {\n console.log(\"API_cleanup(\"+$request_id+\")\");\n //\n $('#'+$request_id).remove();\n // Check to see if it worked\n if ($('#'+$response_id).length!==0)\n {\n console.log(\"Could not remove AJAX receiving element: ERROR\");\n return false;\n }\n console.log(\"Removed AJAX receiving element: OK\");\n //\n delete $requests[$request_id];\n if ($requests.indexOf($request_id)!==-1)\n {\n console.log(\"Could not delete request handler record: ERROR\");\n return false;\n }\n console.log(\"Deleted request handler record: OK\");\n //\n return true;\n }\n catch ($err)\n {\n // Could not clean up\n console.log($err.stack);\n return false;\n } // try\n } // API_cleanup()\n //\n //\n var API_response_handler=function ($server_response)\n {\n try\n {\n console.log(\"API_response_handler()\");\n //\n var $decoded=API_response_handler_validate($server_response);\n if ($decoded===false)\n {\n console.log(\"Server response is not valid: ERROR\");\n return false;\n }\n //\n console.log('$decoded.REQUEST_ID=['+$decoded.REQUEST_ID+']');\n //\n var $selector=$requests[$decoded.REQUEST_ID]['selector'];\n return $requests[$decoded.REQUEST_ID]['handler']({'DATA':$decoded.DATA, 'selector':$selector});\n }\n catch ($err)\n {\n console.log($err.stack);\n } // try\n } // API_response_handler()\n //\n //\n var API_response_handler_validate=function ($server_response)\n {\n console.log(\"API_response_handler_validate()\");\n //\n // Validates that the return information from the server is acceptable to process\n //\n // A standard response quadruplet has these parts:\n // STATUS = OK | ERROR\n // MESSAGE = A machine readable and human friendly description of the data\n // DATA = The data from the message\n // REQUEST_ID = The request ID for data matching purposes\n //\n // RETURNS the decoded JSON, or FALSE\n //\n //\n var $decoded=API_response_decode($server_response);\n //\n if ($decoded===false)\n {\n console.log(\"server_response did not decode: ERROR\");\n return false;\n }\n else\n {\n console.log(\"server_response decoded: OK\");\n //\n // Does it have the property of STATUS?\n if (!$decoded.hasOwnProperty('STATUS'))\n {\n console.log('STATUS is missing: ERROR');\n return false;\n }\n console.log('STATUS is present: OK');\n //\n // Is STATUS a known value?\n if (($decoded.STATUS!=='OK') &&\n ($decoded.STATUS!=='ERROR'))\n {\n console.log('STATUS has unsupported value ['+$decoded.STATUS+']: ERROR');\n return false;\n }\n console.log('STATUS is supported: OK');\n //\n // Does it have the MESSAGE property?\n if (!$decoded.hasOwnProperty('MESSAGE'))\n {\n // No, the message property is missing\n console.log('MESSAGE is missing: ERROR');\n return false;\n }\n console.log('MESSAGE is present: OK');\n //\n // Is MESSAGE a known value?\n if (($decoded.MESSAGE!=='VIDEO__LIST_BY_VENUE_ID') &&\n ($decoded.MESSAGE!=='VIDEO__BY_ID'))\n {\n console.log('MESSAGE has unsupported value ['+$decoded.MESSAGE+']: ERROR');\n return false;\n }\n console.log('MESSAGE is supported: OK');\n //\n // Does it have the DATA property?\n if (!$decoded.hasOwnProperty('DATA'))\n {\n // No, the message property is missing\n console.log('decoded is missing DATA');\n return false;\n }\n console.log('DATA is present: OK');\n //\n // Does it have the REQUEST_ID property?\n if (!$decoded.hasOwnProperty('REQUEST_ID'))\n {\n // No, the message property is missing\n console.log('decoded is missing REQUEST_ID');\n return false;\n }\n console.log('REQUEST_ID is present: OK');\n //\n // Is the REQUEST_ID valid?\n console.log($requests);\n if (!($requests.hasOwnProperty($decoded.REQUEST_ID)))\n {\n // No, the REQUEST_ID is invalid\n console.log('REQUEST_ID is invalid: ERROR');\n return false;\n }\n console.log('REQUEST_ID is supported: OK');\n //\n // All the parts are present\n console.log('Server response is properly formed: OK');\n //\n return $decoded;\n } // if ($decoded===false)\n } // API_response_handler_validate()\n //\n //\n var session_from_cookie=function()\n {\n console.log('session_from_cookie()');\n var $element;\n var $cookies=document.cookie;\n var $parts=$cookies.split('; ');\n for(var $i=0, $len=$parts.length; $i<$len; $i++)\n {\n var $pieces=$parts[$i].split('=');\n if ($pieces[0]=='session')\n {\n this.session_id=$pieces[1];\n }\n }\n //\n console.log('this.session_id=['+this.session_id+']');\n return this.session_id;\n } // session_from_cookie()\n //\n //\n var construct=function ()\n {\n // This function is the \"constructor\" function for the Rapport247 object\n //\n var $result='ERROR';\n //\n // This object requires jQuery to be installed\n // Is jQuery missing?\n if (typeof jQuery==='undefined')\n {\n // Yes, jQuery is missing\n $result='JQuery required';\n }\n else\n {\n // This object requires jQuery to be minimum version 2.1.3\n if (jquery_min_version(\"2.1.3\")===false)\n {\n $result='JQuery version 2.1.3 or greater required';\n }\n else\n {\n $result='OK';\n } // if (jquery_min_version(\"2.1.3\")!==false)\n } // if (typeof jQuery!='undefined')\n //\n console.log(\"Rapport247: construct()=>[\"+$result+\"]\");\n //\n return $result;\n } // construct()\n //\n //\n var jquery_min_version=function($version)\n {\n // https://gist.github.com/budiadiono/7954617\n var $vrs=window.jQuery.fn.jquery.split('.');\n var $min=$version.split('.');\n var $prevs=[];\n var $len=$vrs.length;\n //\n for (var $i=0; $i<$len; $i++)\n {\n //console.log($i, $vrs[$i], $min[$i], $prevs[$i-1]);\n if ($min[$i] && $vrs[$i] < $min[$i])\n {\n if (!$prevs[$i-1] || $prevs[$i-1] == 0)\n {\n return false;\n }\n }\n else\n {\n if ($vrs[$i] > $min[$i])\n {\n $prevs[$i] = 1;\n }\n else\n {\n $prevs[$i] = 0;\n }\n }\n }\n return true;\n } // jquery_min_version()\n //\n //\n this.fetch_videos=function($selector, $venue_id)\n {\n // This function attempts to fetch all the API accessible videos from the server\n //\n // $selector = The final place to put the videos\n // $venue_id = The venue_id of the venue to fetch\n //\n console.log(\"fetch_videos=function(\"+$selector+\", \"+$venue_id+\")\");\n return API_command('VIDEO__LIST_BY_VENUE_ID', $selector, {'venue_id':$venue_id});\n } // this.fetch_videos()\n //\n //\n var fetch_videos_finish=function($data_JSON)\n {\n console.log(\"fetch_videos_finish()\");\n //\n console.log($data_JSON);\n var $video;\n for ($video in $data_JSON)\n {}\n //\n return;\n } // fetch_videos_finish()\n //\n //\n this.fetch_and_format_videos=function($selector, $venue_id)\n {\n // This function attempts to fetch all the API accessible videos from the server\n //\n // $selector = The final place to put the videos\n // $venue_id = The venue_id of the venue to fetch\n //\n console.log(\"fetch_and_format_videos=function(\"+$selector+\", \"+$venue_id+\")\");\n return API_command('VIDEO__LIST_BY_VENUE_ID', {'venue_id':$venue_id}, $selector, function ($server_response){fetch_and_format_videos_finish($server_response);});\n } // this.fetch_and_format_videos()\n //\n //\n var fetch_and_format_videos_finish=function($parameters)\n {\n console.log(\"fetch_and_format_videos_finish([PARAMETERS])\");\n //\n var $data=$parameters.DATA;\nconsole.log($data);\n var $selector=$parameters.selector;\n //\n var $HTML=\"\";\n var $idx=1;\n var $video;\n for ($video in $data)\n {\n $HTML+=format_video($data[$video], $idx);\n $idx++;\n } // for ($video in $data)\n //\n $($selector).html($HTML);\n //\n return $HTML;\n } // fetch_and_format_videos_finish()\n //\n //\n var format_video=function($video, $idx)\n {\n console.log (\"format_video([VIDEO], [TEMPLATE])\");\n //\n if ($video['kind']=='testimonial')\n {\n var $result=$testimonial.replace(new RegExp('#DOMAIN#', 'g'), $domain);\n }\n else\n {\n var $result=$review.replace(new RegExp('#DOMAIN#', 'g'), $domain);\n }\n //\n $result=$result.replace(new RegExp('#IDX#', 'g'), $idx);\n //\n var $key;\n //\n for($key in $language)\n {\n $result=$result.replace(new RegExp($key, 'g'), $language[$key]);\n } // for($key in $video)\n //\n for($key in $video)\n {\n $result=$result.replace(new RegExp('#VIDEO__'+$key.toUpperCase()+'#', 'g'), $video[$key]);\n } // for($key in $video)\n //\n $result=$result.replace('CLOSE', $language.PLAY_VIDEO);\n $result=$result.replace('COPY_RIGHT', $language.COPY_RIGHT);\n $result=$result.replace('NUDITY', $language.NUDITY);\n $result=$result.replace('OTHER', $language.OTHER);\n $result=$result.replace('PLAY_VIDEO', $language.PLAY_VIDEO);\n $result=$result.replace('REPORT', $language.REPORT);\n $result=$result.replace('VIOLENCE', $language.VIOLENCE);\n //\n return $result;\n } // format_video()\n //\n //\n this.identify=function()\n {\n console.log(\"Rapport247 Javascript API Version 1.0\");\n } // this.identify\n //\n //\n var $api='https://ybstung.com/api/';\n var $domain='https://ybstung.com/ops/';\n var $language=new Array();\n $language.CLOSE ='Close';\n $language.COPY_RIGHT='Copy Right';\n $language.NUDITY ='Nudity';\n $language.OTHER ='Other';\n $language.PLAY_VIDEO='Play Video';\n $language.REPORT ='Report';\n $language.VIOLENCE ='Violence';\n var $requests=new Array();\n var $review= '<div id=\"#VIDEO__ID#\" class=\".r247_child\" style=\"width: 300px; margin-right:5px;\">';\n $review+=' <div class=\"thumbnail\" data-toggle=\"modal\" data-target=\"#myModal#IDX#\">';\n $review+=' <img alt=\"#VIDEO__TITLE#\" src=\"#DOMAIN##VIDEO__KIND#/#VIDEO__JPG_URL#\">';\n $review+=' <div class=\"modal fade\" id=\"myModal#IDX#\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">';\n $review+=' <div class=\"modal-dialog\">';\n $review+=' <div class=\"modal-content\">';\n $review+=' <div class=\"modal-header\">';\n $review+=' <button type=\"button\" class=\"close\" data-dismiss=\"#myModal#IDX#\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>';\n $review+=' <video preload=\"none\" width=\"480\" height=\"270\" poster=\"#DOMAIN##VIDEO__KIND#/#VIDEO__JPG_URL#\" controls>';\n $review+=' <source src=\"#DOMAIN##VIDEO__KIND#/#VIDEO__MP4_URL#\" type=\"video/mp4\"/>';\n $review+=' <source src=\"#DOMAIN##VIDEO__KIND#/#VIDEO__WEBM_URL#\" type=\"video/webm\"/>';\n $review+=' </video>';\n $review+=' </div>';\n $review+=' <div class=\"modal-footer\">';\n $review+=' <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"#myModal#IDX#\">#CLOSE#</button>';\n $review+=' </div>';\n $review+=' </div>';\n $review+=' </div>';\n $review+=' </div>';\n $review+=' <div class=\"caption\">';\n $review+=' <h3>#VIDEO__TITLE#</h3>';\n $review+=' <p>#VIDEO__DESCRIPTION#</p>';\n $review+=' <div class=\"container\">';\n $review+=' <div class=\"row\">';\n $review+=' <div class=\"col-xs-2 col-md-2\">';\n $review+=' <button class=\"btn btn-primary\">';\n $review+=' #PLAY_VIDEO#';\n $review+=' </button>';\n $review+=' </div>';\n $review+=' </div>';\n $review+=' </div>';\n $review+=' </div>';\n $review+=' </div>';\n $review+='</div>';\n var $session_id='';\n var $status=construct();\n var $testimonial= '<div id=\"#VIDEO__ID#\" class=\".r247_child\" style=\"width: 300px; margin-right:5px;\">';\n $testimonial+=' <div class=\"thumbnail\" data-toggle=\"modal\" data-target=\"#myModal#IDX#\">';\n $testimonial+=' <img alt=\"#VIDEO__TITLE#\" src=\"#DOMAIN##VIDEO__KIND#/#VIDEO__JPG_URL#\">';\n $testimonial+=' <div class=\"modal fade\" id=\"myModal#IDX#\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">';\n $testimonial+=' <div class=\"modal-dialog\">';\n $testimonial+=' <div class=\"modal-content\">';\n $testimonial+=' <div class=\"modal-header\">';\n $testimonial+=' <button type=\"button\" class=\"close\" data-dismiss=\"#myModal#IDX#\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>';\n $testimonial+=' <video preload=\"none\" width=\"480\" height=\"270\" poster=\"#DOMAIN##VIDEO__KIND#/#VIDEO__JPG_URL#\" controls>';\n $testimonial+=' <source src=\"#DOMAIN##VIDEO__KIND#/#VIDEO__MP4_URL#\" type=\"video/mp4\"/>';\n $testimonial+=' <source src=\"#DOMAIN##VIDEO__KIND#/#VIDEO__WEBM_URL#\" type=\"video/webm\"/>';\n $testimonial+=' </video>';\n $testimonial+=' </div>';\n $testimonial+=' <div class=\"modal-footer\">';\n $testimonial+=' <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"#myModal#IDX#\">#CLOSE#</button>';\n $testimonial+=' </div>';\n $testimonial+=' </div>';\n $testimonial+=' </div>';\n $testimonial+=' </div>';\n $testimonial+=' <div class=\"caption\">';\n $testimonial+=' <h3>#VIDEO__TITLE#</h3>';\n $testimonial+=' <p>#VIDEO__DESCRIPTION#</p>';\n $testimonial+=' <div class=\"container\">';\n $testimonial+=' <div class=\"row\">';\n $testimonial+=' <div class=\"col-xs-2 col-md-2\">';\n $testimonial+=' <button class=\"btn btn-primary\">';\n $testimonial+=' #PLAY_VIDEO#';\n $testimonial+=' </button>';\n $testimonial+=' </div>';\n $testimonial+=' </div>';\n $testimonial+=' </div>';\n $testimonial+=' </div>';\n $testimonial+=' </div>';\n $testimonial+='</div>';\n //\n //\n return;\n} // rapport247()", "title": "" }, { "docid": "d91484176088f63934bb79eb1f0f6f0c", "score": "0.4850947", "text": "function envio_general(retorno, parametros,form_nom){\n var data = {};\n var url = '';\n \n if (typeof parametros.form !== 'undefined') {\n data = parametros.form;\n }\n else if(typeof parametros.data !== 'undefined'){\n data = parametros.data;\n }\n\n url = parametros.url;\n $.ajax({\n type: 'POST',\n url: url ,\n data: data ,\n cache: false,\n dataType: 'json',\n error: function(msj) {\n console.log(msj);\n },\n complete: function (msj) {\n window[retorno](msj,form_nom);\n }\n });\n}", "title": "" }, { "docid": "e2b5ac00c6548f2c13763bf8524e94d5", "score": "0.48395187", "text": "function generalPOST ( genHost, genPath, post_data, err, res )\n{\n\t// check if arg param err does not exist\n\tif (typeof(err) != \"function\")\n\t{\n\t\terr = function(e) \n\t\t{\n\t\t\tconsole.log(\"Lost connection to \" + genHost + \"reomiving from ring\");\n\n\t\t\tvar genHostID = tokenRing.indexOf( genHost );\n\n\t\t\ttokenRing.removeRingMember(genHost);\n\t\t\tif ( leaderIP == genHost )\n\t\t\t{\n\t\t\t\tif ( tokenRing.getMyIPIndex() == 0 )\n\t\t\t\t{\n\t\t\t\t\tconsole.log( \"New Election - Leader is down\" );\n\t\t\t\t\tinitialElectionParticipation = false;\n\t\t\t\t\tstartElection();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if( isLeader && genHostID == ipSend )\n\t\t\t{\n\t\t\t\tconsole.log( \"New Compute Loop - Compute Node Down\" );\n\t\t\t\tgeneralPOST( leaderIP, '/do_work', primesData );\n\t\t\t}\n\t\t};\n\t}\n\t\n\t\t// check if arg param res does not exist\n\t\tif (typeof(res) != \"function\")\n\t\t{\n\t\t\tres = function(r) {} ;\n\t\t}\n\n\t\tvar dataString = JSON.stringify( post_data );\n\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/json',\n\t\t\t'Content-Length': dataString.length\n\t\t};\n\n\t\tvar post_options = {\n\t\t\thost: genHost,\n\t\t\tport: '3000',\n\t\t\tpath: genPath,\n\t\t\tmethod: 'POST',\n\t\t\theaders: headers\n\t\t};\n\n\t\tvar post_request = http.request(post_options, function(res){\n\t\t\tres.setEncoding('utf-8');\n\t\t\t\n\t\t\tvar responseString = '';\n\n\t\t\tres.on('data', function(data){\n\t\t\t\tresponseString += data;\n\t\t\t});\n\n\t\t\tres.on('end', function(){\n\t\t\t\t//var resultObject = JSON.parse(responseString);\n\t\t\t});\n\t\t});\n\t\t\n\t\tpost_request.on('error', err );\n\t\tpost_request.write(dataString);\n\t\tpost_request.end();\n\t\t\n\t\n}", "title": "" }, { "docid": "e66ea95f3301f12ea35581b42c4f6e3a", "score": "0.48380998", "text": "function init(){\n respotas_usuario = [];\n scoreGeral = 0;\n count = 1;\n render(1,'prox');\n}", "title": "" }, { "docid": "3215e00b2d14548ad6d75cb392a2f394", "score": "0.48350963", "text": "function puppyCallback(requestPotato, responsePotato){\n ginger.friends++;\n responsePotato.send(ginger);\n}", "title": "" }, { "docid": "138861ac87b5ef41162bdafaf0a0d3fe", "score": "0.4832774", "text": "function serial(req, res, next){\n //console.log('serial request');\n let cicles = Number(req.params.cicles)\n if(isNaN(cicles)){\n res\n .status(500)\n .send({message:'ingrese un número adecuado de ciclos a iterar'})\n }\n else{\n let obj = addon.serial(cicles)\n if(isNaN(obj.pi) || isNaN(obj.time)){\n res\n .status(500)\n .send({message:'Error al aproximar Pi'})\n }\n else{\n res\n .status(200)\n .send({\n \"pi\" : obj.pi,\n \"timeTaken\" : obj.time,\n \"cpus\" : 1,\n \"cicles\" : cicles\n })\n }\n }\n next()\n}", "title": "" }, { "docid": "73ce2d8a9e4df5b7c83967e70bc4dab8", "score": "0.48307943", "text": "function setLotes2(form, lote, registros, limit, ordenar) {\r\n\t//alert('Limit='+limit);\r\n\t//alert('Lote='+lote);\r\n\tswitch (lote) {\r\n\t\tcase \"P\":\r\n\t\t\tlimit=0;\r\n\t\t\tbreak;\r\n\t\tcase \"A\":\r\n\t\t\tlimit=limit-MAXLIMIT; \r\n\t\t\tbreak;\r\n\t\tcase \"S\":\r\n\t\t\tlimit=limit+MAXLIMIT; //alert('Limit2='+limit);\r\n\t\t\tbreak;\r\n\t\tcase \"U\":\r\n\t\t\tvar num=(registros/MAXLIMIT);\r\n\t\t\tnum=parseInt(num);\r\n\t\t\tlimit=num*MAXLIMIT;\r\n\t\t\tif (limit==registros) limit=limit-MAXLIMIT;\r\n\t\t\tbreak;\r\n\t}\r\n\t//document.getElementById(\"limit\").value = limit;\r\n\tvar pagina=form.action+\"&limit=\"+limit+\"&ordenar=\"+ordenar;\r\n\tcargarPagina(form, pagina);\r\n}", "title": "" }, { "docid": "902c6d6484ffedff1193670ea7d5359f", "score": "0.4827242", "text": "post (first, last) {\n var data = {\n first: first,\n last: last\n };\n return super.post(data);\n }", "title": "" }, { "docid": "602d996d93ba68e11b4f740f80ffb03d", "score": "0.48268795", "text": "function SendData(url, start, stop)\n{\n start = (start * 0.001).toFixed(0);\n stop = (stop * 0.001).toFixed(0);\n request({\n url: ServerURL,\n content: {\n terminal: ComputerName,\n user: UserName,\n url: url,\n start: start,\n stop: stop,\n delay: stop - start\n },\n onComplete: function(response) {\n if (response.status != 200)\n {\n logData = [];\n isActive = false;\n button.icon = {\n \"16\": \"./start-16.png\",\n \"32\": \"./start-32.png\",\n \"64\": \"./start-64.png\"\n };\n button.label = \"Start\";\n errorDialog.show();\n }\n }\n }).put();\n}", "title": "" }, { "docid": "0269fd34b84c1d3ec7169d07e9f63044", "score": "0.48266348", "text": "function notificacion(id,mensaje){\n var peticion={\n method: 'POST',\n url: 'http://tecprecincsrl.com.ar/inspecciones/push.php?id='+id+'&mensaje='+mensaje\n }\n \n $http(peticion).\n then(function(response) {\n\n console.log(response);\n console.log('notificacion exito '+peticion.url);\n }, function(response) {\n \n console.log(response);\n console.log('notificacion error '+peticion.url);\n });\n \n }", "title": "" }, { "docid": "fcd7eaf0099549add22cbd491d76965f", "score": "0.48244992", "text": "function sendPOSTRender(page){\r\n\t$.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tdata: {page : page},\r\n\t\tsuccess:(res)=>{\r\n\t\t\t$(\"#inner cover\").html(res);\r\n\t\t},\r\n\t\terror:(res)=>{\r\n\t\t\t$(\"#inner cover\").html(res);\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "bd2cddc381380544b52ed6656fd857d2", "score": "0.48194927", "text": "function sendTheSurvey(body, callback) {\n survey = {\n visite: 5 - body.visite, // Pour passer à l'échelle 1-4 : Très satisfait, satisfait, peu satisfait, pas satisfait (on inverse quoi)\n accueil: 5 - body.accueil, // Pour passer à l'échelle 1-4 : Très satisfait, satisfait, peu satisfait, pas satisfait (on inverse quoi)\n information: 5 - body.information, // Pour passer à l'échelle 1-4 : Très satisfait, satisfait, peu satisfait, pas satisfait (on inverse quoi)\n preservation: 5 - body.preservation, // Pour passer à l'échelle 1-4 : Très satisfait, satisfait, peu satisfait, pas satisfait (on inverse quoi)\n reglementation: 5 - body.reglementation, // Pour passer à l'échelle 1-4 : Très satisfait, satisfait, peu satisfait, pas satisfait (on inverse quoi)\n frequentation: body.frequentation\n };\n\n // CAS VISITEUR PIETON OU CYCLISTE\n if(body.categorie == 'Piéton / Cycliste') {\n mysql.query('INSERT into pieton (id, date, visite, accueil, info, preservation, reglementation, frequentation) VALUES (NULL, CURRENT_TIMESTAMP, ?, ?, ?, ?, ?, ?)',\n [survey.visite, survey.accueil, survey.information, survey.preservation, survey.reglementation, survey.frequentation],\n \n function (error, results, fields) {\n if(results) {\n console.log(results);\n callback({status:'success', data: 'Merci pour votre temps.'});\n }\n else {\n console.log(error);\n callback({status:'error', data: \"La base de données a rencontré une erreur :(\"});\n }\n });\n }\n\n // CAS VISITEUR PLAISANCIER\n else if(body.categorie == 'Plaisancier') {\n mysql.query('INSERT into nautique (id, date, visite, accueil, info, preservation, reglementation, frequentation) VALUES (NULL, CURRENT_TIMESTAMP, ?, ?, ?, ?, ?, ?)',\n [survey.visite, survey.accueil, survey.information, survey.preservation, survey.reglementation, survey.frequentation],\n \n function (error, results, fields) {\n if(results) {\n console.log(results);\n callback({status:'success', data: 'Merci pour votre temps.'});\n }\n else {\n console.log(error);\n callback({status:'error', data: \"La base de données a rencontré une erreur :(\"});\n }\n });\n }\n\n // CAS AUTRE EN THEORIE IMPOSSIBLE MAIS BON ON SAIT JAMAIS\n else {\n console.log(\"Enorme probleme c'est la fin du monde\")\n callback({status:'error', data: \"La catégorie de visiteur ne correspond à rien. Bravo, vous avez hacké le système.\"});\n } \n}", "title": "" }, { "docid": "5bdc963d8de932517beecab60e60efa0", "score": "0.4818658", "text": "limit(limit) {}", "title": "" }, { "docid": "1116713750e4987a6aee5caeb6113f15", "score": "0.4818526", "text": "function perbaruiGajiPeg(){\n\tvar NoPeg3 = $('#NoPeg3').val()\n\tvar TunjanganJbtn = $('#TunjanganJbtn1').val()\n\tvar TunjanganPerumahan = $('#TunjanganPerumahan').val()\n\tvar TunjanganTransport = $('#TunjanganTransport').val()\n\tvar TunjanganIstri = $('#TunjanganIstri').val()\n\tvar TunjanganAnak = $('#TunjanganAnak').val()\n\tvar TunjanganKebijakan = $('#TunjanganKebijakan').val()\n\tvar THR = $('#THR').val()\n\tvar Cash = $('#Cash').val()\n\tvar PotIuranJamsostek = $('#PotIuranJamsostek').val()\n\tvar PotIuranBPJS = $('#PotIuranJamsostek').val()\n\tvar PotIuranKop = $('#PotIuranKop').val()\n\tvar DendaLambat = $('#DendaLambat').val()\n\tvar DendaKetidakhadiran = $('#DendaKetidakhadiran').val()\n\tvar PotMinCuti = $('#PotMinCuti').val()\n\t$.post('../../config/server.php?p=perbaruiGajiPeg',{NoPeg3:NoPeg3, TunjanganJbtn:TunjanganJbtn, TunjanganPerumahan:TunjanganPerumahan, TunjanganTransport:TunjanganTransport, TunjanganIstri:TunjanganIstri, TunjanganAnak:TunjanganAnak, TunjanganKebijakan:TunjanganKebijakan, THR:THR, Cash:Cash, PotIuranJamsostek:PotIuranJamsostek, PotIuranBPJS:PotIuranBPJS, PotIuranKop:PotIuranKop, DendaLambat:DendaLambat, DendaKetidakhadiran:DendaKetidakhadiran, PotMinCuti:PotMinCuti}, function(data){\n\t\ttmplGajiPeg()\n\t\t$('#NoPeg3').val('')\n\t\t$('#Bulan').val('')\n\t\t$('#Tahun').val('')\n\t\t$('#TunjanganJbtn1').val('')\n\t\t$('#TunjanganPerumahan').val('')\n\t\t$('#TunjanganTransport').val('')\n\t\t$('#TunjanganIstri').val('')\n\t\t$('#TunjanganAnak').val('')\n\t\t$('#TunjanganKebijakan').val('')\n\t\t$('#THR').val('')\n\t\t$('#Cash').val('')\n\t\t$('#PotIuranJamsostek').val('')\n\t\t$('#PotIuranBPJS').val('')\n\t\t$('#PotIuranKop').val('')\n\t\t$('#DendaLambat').val('')\n\t\t$('#DendaKetidakhadiran').val('')\n\t\t$('#PotMinCuti').val('')\n\t\t$('#smpngajipeg').prop('disabled',false);\n\t\t$('#perbaruigajipeg').prop(\"disabled\",true);\n\t\tenadistunj();\n\t\talert('Data berhasil diubah')\n\t})\n}", "title": "" }, { "docid": "a19e28e3683018087499455a1fed9e38", "score": "0.4811641", "text": "function response(respons) {\r\n res.send(respons);\r\n }", "title": "" }, { "docid": "d6f2c2b7e629d764c139fcb9d24c464a", "score": "0.48112184", "text": "function postPessoaWithCallback(pessoa, callback, div) {\n document.getElementById(div).innerHTML = `<i>inserindo ${pessoa.nome}...</i>`;\n setTimeout(() => {\n pessoas.push(pessoa);\n callback(div2);\n }, 2000);\n }", "title": "" }, { "docid": "f700bcc6ef8ab7ef182819d2c88e1bc2", "score": "0.4808568", "text": "function add(a, b){//this function will add these parameters \n return a + b;//-> (body) says whatever parameters is gonna be doing (wait for it)\n }", "title": "" }, { "docid": "57d02a603f3a1eea498a6112d9efabc0", "score": "0.48078856", "text": "function poke() { // create a loop function\n setTimeout(function () { // call a 100ms setTimeout when the loop is called\n\n var uid = uIds[i];\n var http = new XMLHttpRequest();\n var args = 'uid=' + uid + '&pokeback=1&nctr[_mod]=pagelet_pokes&__user=' + userId + '&__a=1&fb_dtsg=' + fb_dtsg;\n http.open('POST', '/ajax/pokes/poke_inline.php', true);\n\n http.onreadystatechange = function () {\n if (http.readyState != 4) return;\n if (http.status == 200) {\n console.log(http.responseText);\n } else {\n console.log('request error');\n }\n };\n\n http.setRequestHeader('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');\n http.setRequestHeader('Cache-Control', 'no-cache');\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');\n http.setRequestHeader('Content-length', args.length);\n http.send(args);\n\n i++; // increment the counter\n if (i < uIds.length) {\n poke(); // .. again which will trigger another \n } // .. setTimeout()\n }, 5000) // put a delay of 5 seconds in each request\n}", "title": "" }, { "docid": "8cf5c9af0fe266e8ae73570e934231aa", "score": "0.4800264", "text": "function process_obs_req(req, res){\n\n \n}", "title": "" }, { "docid": "9da4d860847f2b918384084200494620", "score": "0.48001316", "text": "function enviarParametros(){\n\tvar parametros=\"\";\n\tvar peso= document.getElementById(\"person_weight\").value;\n\tvar altura= document.getElementById(\"person_height\").value;\n\tparametros= parametros+\"peso=\"+peso+\"&altura=\"+altura;\n\twindow.location.assign(\"resultado.html?\"+parametros);\n}", "title": "" }, { "docid": "b26a9a2c3367b42bfe7e3bb6ab0365ea", "score": "0.47984514", "text": "function loaging(url,select='#conteudos'){\n $.messager.progress();\n $.get(url+'?'+Math.random(), function( data ) {\n \t$.messager.progress('close');\n $(select).html(data);\n }); \n}", "title": "" }, { "docid": "12a7bd6bee13278a3442f425e6ececd3", "score": "0.479328", "text": "postMessage(url = baseUrl )\n\n {\n return{\n fetchAll:()=> axios.get(url),\n fetchById : id => axios.get(url+id),\n create : newEntry => axios.post(url, newEntry),\n update : (id,updatedEntry) => axios.put(url+id,updatedEntry),\n delete : id => axios.delete(url+id)\n\n }\n }", "title": "" }, { "docid": "c65ff2644629ba21caa42cd912b2a2bd", "score": "0.4790417", "text": "function piestiEilute(x) {\n\n}", "title": "" }, { "docid": "d8897c2dc6346e082748e250d6ef8784", "score": "0.47894445", "text": "function sendVal(slider) {\n var controller = slider.getAttribute('id'), speed = slider.value, token = sessionStorage.getItem(\"token\");\n $.ajax({\n url: window.puppetURL + \"/\" + token + \"/\" + controller + \"/\" + speed,\n success: function (result) {\n },\n error: function () {\n window.location.href = 'ThankYou.html'\n }\n })\n}", "title": "" }, { "docid": "7695188d3b140a6a78b4d7730334381e", "score": "0.47857088", "text": "function sendDataToPHP(argLeftDirection, argLefPower, argRightDirection, argRightPower) {\n sendRequest(\n 'GET', path + 'php/movement.php',\n 'rightEngineDirection=' + parseInt(argRightDirection) +\n '&leftEngineDirection=' + parseInt(argLeftDirection) +\n '&leftEnginePower=' + parseInt(argLefPower) +\n '&rightEnginePower=' + parseInt(argRightPower));\n //debug:\n /*\n console.log(\"sent request: \" + 'GET', path + 'php/control.php',\n 'rightEngineDirection=' + { argRightDirection } +\n '&leftEngineDirection=' + { argLeftDirection } +\n '&leftEnginePower=' + { argLefPower } +\n '&rightEnginePower=' + { argRightPower });\n */\n}", "title": "" }, { "docid": "e17c9cd615939392aa50e6d9a426294b", "score": "0.478359", "text": "function DeliverFood(callback){\n setTimeout(callback,5000);\n}", "title": "" }, { "docid": "f031ca7d9ec7820461f95aaab86c3b53", "score": "0.4782942", "text": "function OnGenrateAction(e) {\n const zipcode = document.getElementById('zip').value;\n const userContent = document.getElementById('feelings').value;\n if ((zipcode.length < 5) || (isNaN(zipcode))) { alert(\"Zip Code must be Number only && Not less than 5 numbers\") } else {\n\n getWeather(baseURL, zipcode, apiKey)\n\n .then(function (data) {\n console.log('before post', data);\n\n postData('http://localhost:3000/postdata',\n { name: data.name, date: newDate, description: data.weather[0].description, temp: data.main.temp, userContent: userContent });\n console.log('afterpost', data);\n })\n .then(function () {\n updateUI()\n }\n );\n\n }\n}", "title": "" }, { "docid": "1d333e2f2b34806e77892acbc14af911", "score": "0.4782793", "text": "function cargarDatosUno() {\n\n var resp = $(\"#listadoQuestion\");\n axios.post('/questions/obtenerCadaDato', {\n posicionInicial: cont,\n numeroElementos: 1\n }).then(function (response) {\n mostrarRespuesta(response, resp);\n cont++;\n }).catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "14ecbe443d5a3465707d0f7c3487d997", "score": "0.47823083", "text": "function processAmount() {\n\n let amount = Number(get_elem('amount').value);\n if (isNaN(amount) || amount <= 0) {\n return;\n }\n\n let amount_msatoshi = amount * 1000;\n let expiry = 600;\n\n let post_data = {\n 'msatoshi': amount_msatoshi,\n 'expiry': expiry,\n 'description': 'Lightning Tip For Conor conscott Scott'\n }\n\n let client = new HttpClient();\n client.post(post_invoice_url, JSON.stringify(post_data), function(json_response) {\n\n let data = JSON.parse(json_response);\n\n // Get label for invoice\n let label = data.label;\n let bolt11 = data.bolt11;\n const now = Math.round((new Date().getTime()) / 1000);\n let expires = now + expiry;\n\n hide_element('make_invoice');\n get_elem('bolt11_inv').innerHTML = bolt11;\n show_element('bolt11_invoice');\n\n // Make qr code\n let qrcode = new QRCode(document.getElementById('qrcode'), bolt11);\n\n\n var timerCountdownId = registerInterval(label, function() { updateExpiration(expires) }, 1000);\n\n // Clear the timer after it's not longer needed\n setTimeout(function() {clearInterval(timerCountdownId)}, (expiry+2)*1000);\n\n // Settle for a polling solution\n var timerCheckInvoiceId = registerInterval(label, function() { checkInvoice(label) }, 3000);\n\n // Clear the timer after it's not longer needed\n setTimeout(function() {clearInterval(timerCheckInvoiceId)}, (expiry+2)*1000);\n });\n}", "title": "" }, { "docid": "c589d2a64311a8fc5a811db29d0b3b8e", "score": "0.47808903", "text": "function handler(request) \n{ \n\t// erro 5xx and 4xx are same \n\t// http://www.w3.org/Protocols/HTTP/HTRESP.html\n if( request.status == 500 || request.status == 413 ) \n\t{\n // TODO: do something to calm the user\n }\n \n // the browser's parser may have failed\n if( !request.responseXML ) \n\t{\n // get the response from php and read the json encoded data\n\t\tfeed = JSON.parse(request.responseText);\n\n\t\tvar html = '';\n\n\t\t// cleaning the global valiables before use\n\t\tglobal_upn = null;\n\t\tglobal_subupn = [];\n\n\t\tfor( var i = 0; i < feed.length; i++ ) \n\t\t{\t\t\t\n\t\t\tglobal_upn = feed[i]['upn'];\n\t\t\tglobal_subupn[i] = feed[i]['subupn'];\n\t\t}\n\n\t\t// build html for each feed item\n\t\tfor( var i = 0; i < feed.length; i++ ) \n\t\t{\t\t\n\t\t\thtml += '<h3>Owner: '+ feed[i]['owner'] +'</h3>';\n\t\t\thtml += '<p>Street: '+ feed[i]['streetname'] +'</p>';\n\t\t\thtml += '<p>House Nr: '+ feed[i]['housenumber'] +'</p>';\n\t\t\thtml += '<p>UPN: '+ feed[i]['upn'] +'</p>';\n\t\t\thtml += '<p>SUBUPN: '+ feed[i]['subupn'] +'</p>';\n\t\t\t//html += '<p>YEAR: '+ feed[i]['year'] +'</p>';\n\t\t\thtml += '<div><strong>Revenue Balance: '+ feed[i]['revenue_balance'] +'</strong></div>';\n\t\t\thtml += '<p>Payment Due: '+ feed[i]['revenue_due'] +'</p>';\n\t\t\thtml += '<p>Revenue Collected: '+ feed[i]['revenue_collected'] +'</p>';\n\t\t\thtml += '<p>Date paid: '+ feed[i]['date_payment'] +'</p>';\n\t\t\thtml += '<p>Payment Status: '+ feed[i]['pay_status'] +'</p>';\t\t\t\n\t\t//check whether called from property or business\n\t\t if (feed[i]['business_name']!='property'){\n\t\t\t\thtml += '<p>Business Name: '+ feed[i]['business_name'] +'</p>';\n\t\t }\n\t\t\thtml += '<p>Owner Address: '+ feed[i]['owneraddress'] +'</p>';\n\t\t\thtml += '<p>Owner Tel: '+ feed[i]['owner_tel'] +'</p>';\n\t\t\thtml += '<p>Owner Email: '+ feed[i]['owner_email'] +'</p>';\t\t\t\t\t\t\t\t\t\n\t\t\thtml += '<hr />';\n\t\t}\n\n\t\thtml += \"<input type='button' value='Revenue Collection' onclick='collectRevenueOnClick()' >\";\t\n\t\thtml += \"<input type='button' value='UPN History' onclick='UPNHistoryOnClick()' >\";\t\n\t\t//html += \"<button onclick='collectRevenueOnClick(\\''+upn+'\\', \\''+subupn+'\\')'>Revenue Collection</button>\";\t\n\t\t//html += (\"<input type='button' value='Revenue Collection' />\").find('input[type=button]').click( function(){ collectRevenueOnClick(upn, subupn); } );\n\n\n\t\tvar popup = new OpenLayers.Popup.FramedCloud(\n\t\t\t\t\t\t\t\t\t\t\"featurePopup\",\n feature.geometry.getBounds().getCenterLonLat(),\n new OpenLayers.Size(100,100),\n html, \n null, true, onPopupClose);\n\n\t\tfeature.popup = popup;\n\t\tpopup.feature = feature;\n\t\tmap.addPopup(popup, true);\t\t\n\t}\n} // end of handler function", "title": "" }, { "docid": "f4c94e18d50d781f6533d095f1d707e0", "score": "0.4777997", "text": "function send_request(JSON_data,re_try=0){\n\tif(re_try>3){\n\t\treceived_req++;\n\t\treturn;\n\t}\n\t$.ajax({\n\t\ttype: 'POST',\n contentType: \"application/json; charset=utf-8\",\n url: \"https://academic.microsoft.com/api/search\",\n\t\tdata:JSON_data,\n\t\tsuccess: function (response) {\n\t\t\treceived_req++;\n\t\t\tcollect_single_page(response);\n\t\t\t//update prograss bar\n\t\t\t\n\t\t\tpercentage = Math.ceil(received_req*100/request_counter) +\"%\"\n\t\n\t\t\t$(\"#myBar\").css(\"width\",percentage)\n\t\t\t\t\t.text(percentage)\n\t\t\t\n\t\t\tif(received_req==request_counter){\n\t\t\t\t//upload \n\t\t\t\tDownload_set();\n\t\t\t\t$(\"#myProgress\").hide();\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\t\n\t\terror: function(response){\n\t\t\t//if the request failed, it will send again after this delay time, and it will retry 5 times,then it will give up on this request.\n\t\t\terror_counter++;\n\t\t\tlet waiting_Q=request_counter-received_req+error_counter+10; //+10 as buffer\n\t\t\tlet delay_time=(waiting_Q/7 * 10000);\n\t\t\t\n\t\t\tsetTimeout(() => { send_request(JSON_data,re_try++); }, delay_time);\n\t\t\tconsole.log(\"page request failed,resend in \"+delay_time/1000 +\" seconds retry \"+re_try+\" times\");\n\t\t}\n\t}) \n\t\n}", "title": "" } ]
59c646ffbd447d38febee40efb2a2a97
uomini: altezza 100 donne: altezza 104
[ { "docid": "a2e9ecee386dc3550d8d4db2ca8b200c", "score": "0.0", "text": "function pesoBroca() {\n var altezza = document.getElementById(\"altezza\").value;\n\n var posSesso = document.getElementById(\"sesso\");\n var sesso = posSesso.options[posSesso.selectedIndex].text;\n var peso = 0;\n if (sesso == \"maschio\")\n peso = altezza - 100;\n else if (sesso == \"femmina\")\n peso = altezza - 104;\n document.getElementById(\"esitob\").innerHTML = \"peso: \" + peso + \"kg\";\n}", "title": "" } ]
[ { "docid": "a2905d3afd5875f4e902c4561b54d391", "score": "0.61313534", "text": "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "title": "" }, { "docid": "706dd847d0b7181461d8c876bae27e3a", "score": "0.5978698", "text": "function AtrazoBoco (mês, valorAnuidade) {\n switch(mês) {\n case 1:\n return `Valor da Anuidade: ${valorAnuidade}`\n break\n\n case 2:\n const juroscomposto1 = valorAnuidade * ((1 + 0.05)**1)\n return `Valor da Anuidade com Juros: ${juroscomposto1.toFixed(2)}`\n break\n\n case 3:\n const juroscomposto2 = valorAnuidade * ((1 + 0.05)**2)\n return `Valor da Anuidade com Juros: ${juroscomposto2.toFixed(2)}`\n break\n\n case 4:\n const juroscomposto3 = valorAnuidade * ((1 + 0.05)**3)\n return `Valor da Anuidade com Juros: ${juroscomposto3.toFixed(2)}`\n break\n\n case 5:\n const juroscomposto4 = valorAnuidade * ((1 + 0.05)**4)\n return `Valor da Anuidade com Juros: ${juroscomposto4.toFixed(2)}`\n break\n\n case 6:\n const juroscomposto5 = valorAnuidade * ((1 + 0.05)**5)\n return `Valor da Anuidade com Juros: ${juroscomposto5.toFixed(2)}`\n break\n\n case 7:\n const juroscomposto6 = valorAnuidade * ((1 + 0.05)**6)\n return `Valor da Anuidade com Juros: ${juroscomposto6.toFixed(2)}`\n break\n\n case 8:\n const juroscomposto7 = valorAnuidade * ((1 + 0.05)**7)\n return `Valor da Anuidade com Juros: ${juroscomposto7.toFixed(2)}`\n break\n\n case 9:\n const juroscomposto8 = valorAnuidade * ((1 + 0.05)**8)\n return `Valor da Anuidade com Juros: ${juroscomposto8.toFixed(2)}`\n break\n\n case 10:\n const juroscomposto9 = valorAnuidade * ((1 + 0.05)**9)\n return `Valor da Anuidade com Juros: ${juroscomposto9.toFixed(2)}` \n break\n\n case 11:\n const juroscomposto10 = valorAnuidade * ((1 + 0.05)**10)\n return `Valor da Anuidade com Juros: ${juroscomposto10.toFixed(2)}`\n break\n\n case 12:\n const juroscomposto11 = valorAnuidade * ((1 + 0.05)**11)\n return `Valor da Anuidade com Juros: ${juroscomposto11.toFixed(2)}`\n break\n }\n }", "title": "" }, { "docid": "d2ad0bd7a0ffc96a9698fd2d1532e932", "score": "0.59241647", "text": "function auxNaipes(promedio) {\n let simbolo;\n\n if(promedio > 0 && promedio <= 19) \n simbolo = 'A';\n else if(promedio >= 20 && promedio <= 38) \n simbolo = 'B';\n else if(promedio >= 39 && promedio <= 57) \n simbolo = 'C';\n else if(promedio >= 58 && promedio <= 76) \n simbolo = 'D';\n else if(promedio >= 77 && promedio <= 95) \n simbolo = 'E';\n else if(promedio >= 96 && promedio <= 114) \n simbolo = 'F';\n else if(promedio >= 115 && promedio <= 133) \n simbolo = 'G';\n else if(promedio >= 134 && promedio <= 152) \n simbolo = 'H';\n else if(promedio >= 153 && promedio <= 171) \n simbolo = 'I';\n else if(promedio >= 172 && promedio <= 190) \n simbolo = 'J';\n else if(promedio >= 191 && promedio <= 209) \n simbolo = 'K';\n else if(promedio >= 210 && promedio <= 228) \n simbolo = 'L';\n else if(promedio >= 229 && promedio <= 256) \n simbolo = 'M';\n return simbolo;\n\n}", "title": "" }, { "docid": "f0989db714651b6ed83da31e38ac8478", "score": "0.5870094", "text": "function Iu(e,t,n,i){switch(n){case\"s\":return i||t?\"néhány másodperc\":\"néhány másodperce\";case\"ss\":return e+(i||t?\" másodperc\":\" másodperce\");case\"m\":return\"egy\"+(i||t?\" perc\":\" perce\");case\"mm\":return e+(i||t?\" perc\":\" perce\");case\"h\":return\"egy\"+(i||t?\" óra\":\" órája\");case\"hh\":return e+(i||t?\" óra\":\" órája\");case\"d\":return\"egy\"+(i||t?\" nap\":\" napja\");case\"dd\":return e+(i||t?\" nap\":\" napja\");case\"M\":return\"egy\"+(i||t?\" hónap\":\" hónapja\");case\"MM\":return e+(i||t?\" hónap\":\" hónapja\");case\"y\":return\"egy\"+(i||t?\" év\":\" éve\");case\"yy\":return e+(i||t?\" év\":\" éve\")}return\"\"}", "title": "" }, { "docid": "15b5e4a7ee044340964b9302e0170f2f", "score": "0.58137226", "text": "function auxLetras(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 15)\n simbolo = 'M';\n else if (promedio >= 16 && promedio <= 31)\n simbolo = 'N';\n else if (promedio >= 32 && promedio <= 47)\n simbolo = 'H';\n else if (promedio >= 48 && promedio <= 63)\n simbolo = '#';\n else if (promedio >= 64 && promedio <= 79)\n simbolo = 'Q';\n else if (promedio >= 80 && promedio <= 95)\n simbolo = 'U';\n else if (promedio >= 96 && promedio <= 111)\n simbolo = 'A';\n else if (promedio >= 112 && promedio <= 127)\n simbolo = 'D';\n else if (promedio >= 128 && promedio <= 143)\n simbolo = '0';\n else if (promedio >= 144 && promedio <= 159)\n simbolo = 'Y';\n else if (promedio >= 160 && promedio <= 175)\n simbolo = '2';\n else if (promedio >= 176 && promedio <= 191)\n simbolo = '$';\n else if (promedio >= 192 && promedio <= 209)\n simbolo = '%';\n else if (promedio >= 210 && promedio <= 225)\n simbolo = '+';\n else if (promedio >= 226 && promedio <= 239)\n simbolo = '.';\n else if (promedio >= 240 && rgbPromedio <= 255)\n simbolo = ' ';\n return simbolo;\n\n}", "title": "" }, { "docid": "24725bcd270ec5c1f3c7977f4ca2409a", "score": "0.579493", "text": "function terbilang(a) {\n var c = \" Satu Dua Tiga Empat Lima Enam Tujuh Delapan Sembilan Sepuluh Sebelas\".split(\" \");\n if (12 > a) var b = c[a];\n else 20 > a ? b = c[a - 10] + \" Belas\" : 100 > a ? (b = parseInt(String(a / 10).substr(0, 1)), b = c[b] + \" Puluh \" + c[a % 10]) : 200 > a ? b = \"Seratus \" + terbilang(a - 100) : 1E3 > a ? (b = parseInt(String(a / 100).substr(0, 1)), b = c[b] + \" Ratus \" + terbilang(a % 100)) : 2E3 > a ? b = \"Seribu \" + terbilang(a - 1E3) : 1E4 > a ? (b = parseInt(String(a / 1E3).substr(0, 1)), b = c[b] + \" Ribu \" + terbilang(a % 1E3)) : 1E5 > a ? (b = parseInt(String(a / 100).substr(0, 2)),\n a %= 1E3, b = terbilang(b) + \" Ribu \" + terbilang(a)) : 1E6 > a ? (b = parseInt(String(a / 1E3).substr(0, 3)), a %= 1E3, b = terbilang(b) + \" Ribu \" + terbilang(a)) : 1E8 > a ? (b = parseInt(String(a / 1E6).substr(0, 4)), a %= 1E6, b = terbilang(b) + \" Juta \" + terbilang(a)) : 1E9 > a ? (b = parseInt(String(a / 1E6).substr(0, 4)), a %= 1E6, b = terbilang(b) + \" Juta \" + terbilang(a)) : 1E10 > a ? (b = parseInt(String(a / 1E9).substr(0, 1)), a %= 1E9, b = terbilang(b) + \" Milyar \" + terbilang(a)) : 1E11 > a ? (b = parseInt(String(a / 1E9).substr(0, 2)), a %= 1E9, b = terbilang(b) + \" Milyar \" + terbilang(a)) :\n 1E12 > a ? (b = parseInt(String(a / 1E9).substr(0, 3)), a %= 1E9, b = terbilang(b) + \" Milyar \" + terbilang(a)) : 1E13 > a ? (b = parseInt(String(a / 1E10).substr(0, 1)), a %= 1E10, b = terbilang(b) + \" Triliun \" + terbilang(a)) : 1E14 > a ? (b = parseInt(String(a / 1E12).substr(0, 2)), a %= 1E12, b = terbilang(b) + \" Triliun \" + terbilang(a)) : 1E15 > a ? (b = parseInt(String(a / 1E12).substr(0, 3)), a %= 1E12, b = terbilang(b) + \" Triliun \" + terbilang(a)) : 1E16 > a && (b = parseInt(String(a / 1E15).substr(0, 1)), a %= 1E15, b = terbilang(b) + \" Kuadriliun \" + terbilang(a));\n a = b.split(\" \");\n c = [];\n for (b = 0; b < a.length; b++) \"\" != a[b] && c.push(a[b]);\n return c.join(\" \")\n}", "title": "" }, { "docid": "429f7618434b475eae292768747c7bc5", "score": "0.57486737", "text": "function escogerValorMasGrande(elemetos){\n\n}", "title": "" }, { "docid": "48b9eca0ead8f822e9bbbe4fe6f19efb", "score": "0.57212645", "text": "function beratBadanWanita(tinggi){\r\n let ideal = (tinggi - 100) - (tinggi -100) * 0.15\r\n return `Wanita = ${ideal} Kg`; \r\n}", "title": "" }, { "docid": "ff224fbd7252faa01a3ab5c45ee860d4", "score": "0.5685185", "text": "function converterParaMilhas(valor) {\r\n var v = $('#velocidade').text();\r\n v = Math.round(v / valor);\r\n $('#velocidade').text(v);\r\n\r\n var d = $('#distancia').text();\r\n d = Math.round(d / valor);\r\n $('#distancia').text(d);\r\n\r\n var h = $('#hMax').text();\r\n h = Math.round(h / 3.28);\r\n $('#hMax').text(h);\r\n\r\n insereTagsImp();\r\n}", "title": "" }, { "docid": "13d7c739ad2e5f4bf71c31333d214286", "score": "0.56561375", "text": "function calcola_data(lingua){\n\n // parametri lingua= \"ITA\" - \"ING\" - \"FRA\" - \"TED\" - \"SAR\" - \"SPA\" - \"POR\" - \"ESP\"\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009.\n // utilizzo caratteri speciali ANSI.\n // restituisce la stringa DataIns.\n\n\t \n\tvar DataIns=\".\";\n var it_giorni=new Array(\"Domenica\",\"Luned&#236\",\"Marted&#236\",\"Mercoled&#236\",\"Gioved&#236\",\"Venerd&#236\",\"Sabato\");\n var it_mesi=new Array(\"Gennaio\",\"Febbraio\",\"Marzo\",\"Aprile\",\"Maggio\",\"Giugno\",\"Luglio\",\"Agosto\",\"Settembre\",\"Ottobre\",\"Novembre\",\"Dicembre\");\n\n var en_giorni=new Array(\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\");\n var en_mesi=new Array(\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\n\n var fr_giorni=new Array(\"Dimanche\",\"Lundi\",\"Mardi\",\"Mercredi\",\"Jeudi\",\"Vendredi\",\"Samedi\");\n var fr_mesi=new Array(\"Janvier\",\"F&#233vrier\",\"Mars\",\"Avril\",\"Mai\",\"Juin\",\"Juillet\",\"Ao&#251t\",\"Septembre\",\"Octobre\",\"Novembre\",\"D&#233cembre\");\n \n var te_giorni=new Array(\"Sonntag\",\"Montag\",\"Dienstag\",\"Mittwoch\",\"Donnerstag\",\"Freitag\",\"Samstag\");\n var te_mesi=new Array(\"Januar\",\"Februar\",\"M&#228rz\",\"April\",\"Mai\",\"Juni\",\"Juli\",\"August\",\"September\",\"Oktober\",\"November\",\"Dezember\");\n\n var sr_giorni=new Array(\"Dom&#236niga\",\"Lunis\",\"Martis\",\"M&#232;rcuris\",\"Gi&#242;bia\",\"Chen&#224;bura\",\"S&#224;badu\");\n var sr_mesi=new Array(\"Ghenn&#224rgiu\",\"Fre&#224rgiu\",\"Martzu\",\"Abrile\",\"Maju\",\"L&#224mpadas\",\"Tr&#236ulas\",\"Austu\",\"Cabudanni\",\"Santugaine\",\"Santandria\",\"Nadale\");\n\n var sp_giorni=new Array(\"Domingo\",\"Lunes\",\"Martes\",\"Mi&#233;rcoles\",\"Jueves\",\"Viernes\",\"S&#225;bado\");\n var sp_mesi=new Array(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\");\n\n var pr_giorni=new Array(\"Domingo\",\"Segunda-feira\",\"Ter&#231;a-feira\",\"Quarta-feira\",\"Quinta-feira\",\"Sexta-feira\",\"S&#225;bado\");\n var pr_mesi=new Array(\"Janeiro\",\"Fevereiro\",\"Mar&#231;o\",\"Abril\",\"Maio\",\"Junho\",\"Julho\",\"Agosto\",\"Setembro\",\"Outubro\",\"Novembro\",\"Dezembro\");\n\n var es_giorni=new Array(\"Dimanco\",\"Lundo\",\"Mardo\",\"Merkredo\",\"Ja&#249;do\",\"Vendredo\",\"Sabato\");\n var es_mesi=new Array(\"Januaro\",\"Februaro\",\"Marto\",\"Aprilo\",\"Majo\",\"Junio\",\"Julio\",\"A&#249;gusto\",\"Septembro\",\"Oktobro\",\"Novembro\",\"Decembro\");\n\n var data=new Date();\n\n var anno =data.getYear(); // anno\n var mese =data.getMonth(); // mese 0 a 11 \n var giorno=data.getDate(); // numero del giorno da 1 a 31\n var giorno_settimana=data.getDay(); // giorno della settimana 0 a 6\n var ora =data.getHours(); // ora del giorno da 0 a 23\n var minuti=data.getMinutes(); // minuti da 0 a 59\n var secondi=data.getSeconds(); // secondi da 0 a 59\n \n if (anno<1900) { anno=anno+1900; } // correzione anno\n\n if (ora<10){ ora='0'+ora;}\n \n if (minuti<10){minuti='0'+minuti;}\n\n if (secondi<10) {secondi='0'+secondi;}\n \n if (lingua==\"ING\") { DataIns=ora+':'+minuti+':'+secondi+' '+en_giorni[giorno_settimana]+\", \"+giorno+\" \"+en_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"FRA\") { DataIns=ora+':'+minuti+':'+secondi+' '+fr_giorni[giorno_settimana]+\", \"+giorno+\" \"+fr_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"TED\") { DataIns=ora+':'+minuti+':'+secondi+' '+te_giorni[giorno_settimana]+\", \"+giorno+\" \"+te_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"SAR\") { DataIns=ora+':'+minuti+':'+secondi+' '+sr_giorni[giorno_settimana]+\", \"+giorno+\" \"+sr_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"SPA\") { DataIns=ora+':'+minuti+':'+secondi+' '+sp_giorni[giorno_settimana]+\", \"+giorno+\" \"+sp_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"POR\") { DataIns=ora+':'+minuti+':'+secondi+' '+pr_giorni[giorno_settimana]+\", \"+giorno+\" \"+pr_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"ESP\") { DataIns=ora+':'+minuti+':'+secondi+' '+es_giorni[giorno_settimana]+\", \"+giorno+\" \"+es_mesi[mese]+\" \"+anno; }\n\n else { DataIns=ora+':'+minuti+':'+secondi+' '+it_giorni[giorno_settimana]+\", \"+giorno+\" \"+it_mesi[mese]+\" \"+anno; }\n \n\treturn DataIns;\n }", "title": "" }, { "docid": "00c5c6421911368877dc2ceba34b4d8b", "score": "0.5604284", "text": "function nombre_mes(mes) {\r\n let m_l = meses[mes].length;\r\n let linea = ' '.repeat(11 - Math.floor(m_l / 2)) + meses[mes];\r\n linea = linea + ' '.repeat(22 - linea.length) + '|';\r\n return linea;\r\n}", "title": "" }, { "docid": "8cace874fc080fe6206b9b301c753f4b", "score": "0.55944264", "text": "function montaConjuntos(){\r\n\treturn quantidadeDeLinha() / valorDeN();\r\n}", "title": "" }, { "docid": "c6f88cf511038dd87c8855b63cbac90f", "score": "0.55877", "text": "function potencia(base, expoente) {\n return 0\n}", "title": "" }, { "docid": "ad394c67ab5fb2a25881744594287191", "score": "0.55407155", "text": "function auxDomino(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 25)\n simbolo = '1';\n else if (promedio >= 26 && promedio <= 50)\n simbolo = '2';\n else if (promedio >= 51 && promedio <= 75)\n simbolo = '3';\n else if (promedio >= 76 && promedio <= 100)\n simbolo = '4';\n else if (promedio >= 101 && promedio <= 125)\n simbolo = '5';\n else if (promedio >= 126 && promedio <= 150)\n simbolo = '6';\n else if (promedio >= 151 && promedio <= 175)\n simbolo = '7';\n else if (promedio >= 176 && promedio <= 200)\n simbolo = '8';\n else if (promedio >= 201 && promedio <= 225)\n simbolo = '9';\n else if (promedio >= 226 && promedio <= 256)\n simbolo = '0';\n return simbolo;\n\n}", "title": "" }, { "docid": "6b353df328251e914f75035f5b1b862a", "score": "0.5514235", "text": "function colocar_embarcador_tier(cant_unit,nombre,id_tier,marca,empresa,peso){\n\n var padre = $(\"#div\"+id_tier+\" > table \");\n if(empresa == \"ARAUCO\"){\n\n //var hijo = $(\"<tr><td > #\"+nombre+\"</td><td> \"+cant_unit+\" Units</td><td>\"+peso.toFixed(3)+\" Tns</td><td><img src='../imagenes/marcas/ARAUCO/\"+marca+\".png' width='18px'></td><tr>\");\n var hijo = $(\"<tr><td > #\"+nombre+\"</td><td colspan='2' > \"+cant_unit+\" Units</td><tr>\");\n }\n if(empresa == \"CMPC\"){\n // var hijo = $(\"<tr><td > #\"+nombre+\"</td><td> \"+cant_unit+\" Units</td><td>\"+peso.toFixed(3)+\" Tns</td><td><img src='../imagenes/marcas/CMPC/\"+marca+\".png' width='18px'></td><tr>\");\n var hijo = $(\"<tr><td > #\"+nombre+\"</td><td colspan='2' > \"+cant_unit+\" Units</td><tr>\");\n }\n padre.append(hijo);\n}", "title": "" }, { "docid": "993ca4346b97e440bff18fd145b66ce7", "score": "0.5514055", "text": "function hitungLuasPersegi(sisi) {\n var luas = sisi * sisi;\n return luas;\n}", "title": "" }, { "docid": "dafcaba4d1aa9437ad365b1a2e6bc8c4", "score": "0.55118406", "text": "function IMC(peso,altura) {\n\n indice = peso/(Math.pow(altura,2));\n imc = indice.toFixed(2);\n console.log(`El IMC es de: ${imc}.`);\n //return imc;\n}", "title": "" }, { "docid": "36a3f7643a528534f0b4846b5fff1219", "score": "0.5508104", "text": "function sc_angolo_gm(angolo_dec,dec){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy). settembre 2010\n // scomposizione degli angoli decimali in °|'\n // [angolo_dec] in ore decimali.\n // la funzione restituisce la variabile stringa [angolo_gms]. \n \n var angolo=Math.abs(angolo_dec); // recupera il valore assoluto del numero\n\n\t var gradi= parseInt(angolo); // Gradi.\n var minuti= ((angolo-gradi)*60).toFixed(dec); // Minuti.\n \n if ( minuti>=60 ){ minuti= minuti-60; gradi=gradi+1;}\n //if ( gradi>=360){ gradi= gradi-360;} \n\n // trasforma il numero in stringa. \n\n var gradi_st=String(gradi);\n var minuti_st=String(minuti);\n \n if (angolo_dec<0) { gradi_st=\"-\"+gradi_st;} \n \n if ( gradi_st.length<2) { gradi_st='0'+gradi_st; }\n if ( minuti_st.length<=4-dec){ minuti_st='0'+minuti_st; }\n \n var angolo_gms=gradi_st+\"&ordm; \"+minuti_st+\"' \"; \n\t \nreturn angolo_gms; \n\n}", "title": "" }, { "docid": "e263fbf1d525ff6d813246f6e22bfa34", "score": "0.5507381", "text": "function impostaTotaliInDataTable(totaleStanziamentiEntrata, totaleStanziamentiCassaEntrata, totaleStanziamentiResiduiEntrata, totaleStanziamentiEntrata1, totaleStanziamentiEntrata2,\n \t\ttotaleStanziamentiSpesa, totaleStanziamentiCassaSpesa, totaleStanziamentiResiduiSpesa, totaleStanziamentiSpesa1, totaleStanziamentiSpesa2){\n\n \tvar totaleStanziamentiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata);\n var totaleStanziamentiCassaEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaEntrata);\n var totaleStanziamentiResiduiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiEntrata);\n //anno = anno bilancio +1\n var totaleStanziamentiEntrata1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata1);\n //anno = anno bilancio +2\n var totaleStanziamentiEntrata2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata2);\n \n \n var totaleStanziamentiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa);\n var totaleStanziamentiCassaSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaSpesa);\n var totaleStanziamentiResiduiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiSpesa);\n //anno = anno bilancio +1\n var totaleStanziamentiSpesa1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa1);\n //anno = anno bilancio +2\n var totaleStanziamentiSpesa2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa2);\n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazione\", totaleStanziamentiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateResiduoVariazione\", totaleStanziamentiResiduiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCassaVariazione\", totaleStanziamentiCassaEntrataNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiEntrata1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiEntrata2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazione\", totaleStanziamentiSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCassaVariazione\", totaleStanziamentiCassaSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseResiduoVariazione\", totaleStanziamentiResiduiSpesaNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiSpesa1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiSpesa2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazione\", (totaleStanziamentiEntrataNotUndefined - totaleStanziamentiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaResiduoVariazione\", (totaleStanziamentiResiduiEntrataNotUndefined - totaleStanziamentiResiduiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCassaVariazione\", (totaleStanziamentiCassaEntrataNotUndefined - totaleStanziamentiCassaSpesaNotUndefined));\n \n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuUno\", (totaleStanziamentiEntrata1NotUndefined - totaleStanziamentiSpesa1NotUndefined));\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuDue\", (totaleStanziamentiEntrata2NotUndefined - totaleStanziamentiSpesa2NotUndefined));\n }", "title": "" }, { "docid": "972659dc8b861d41c278b198e8fa40ce", "score": "0.55050933", "text": "function couleur()\n {\n\treturn 25000 * (0|pos_actuelle()/5 + 1);\n }", "title": "" }, { "docid": "86a6ced9ec08204d7b4f2e0d657985ae", "score": "0.547406", "text": "function converteMoeda(moeda, valor, data) {\n\n var i;\n\n for (i in upfpa) {\n if (obterAno(data) == upfpa[i].ano) { // encontra o ano correspondente\n cotacao = upfpa[i].valor; // obtem cotação daquele ano\n }\n }\n if (moeda == 'real') {\n return valor / cotacao; // retorna valor em UPFPA\n }\n if (moeda == 'upfpa') {\n return valor * cotacao; // retorna valor em Real\n }\n}", "title": "" }, { "docid": "11d1055963760fea68b573d9de1cfdb8", "score": "0.5473269", "text": "function GeraResumoArmaEstilo(arma_personagem, primaria, estilo) {\n var resumo = '';\n var arma_estilo = primaria ? estilo.arma_primaria : estilo.arma_secundaria;\n for (var categoria in arma_estilo.bonus_por_categoria) {\n var bonus = arma_estilo.bonus_por_categoria[categoria];\n var string_ataque = '';\n bonus.ataque.forEach(function(at) {\n string_ataque += StringSinalizada(at) + '/';\n });\n string_ataque = string_ataque.slice(0, -1);\n resumo += Traduz(categoria) + ': ' + string_ataque + ', ';\n var arma_tabela = arma_personagem.arma_tabela;\n var nivel_monge = PersonagemNivelClasse('monge');\n if (estilo.nome == 'arma_dupla' && !primaria) {\n resumo += arma_tabela.dano_secundario[gPersonagem.tamanho.categoria];\n } else if (arma_personagem.entrada.chave == 'desarmado' && nivel_monge > 0) {\n resumo += tabelas_monge_desarmado[nivel_monge].dano[gPersonagem.tamanho.categoria];\n } else {\n resumo += arma_tabela.dano[gPersonagem.tamanho.categoria];\n }\n resumo += StringSinalizada(bonus.dano, false);\n resumo += ' (' + arma_personagem.critico + ')';\n resumo += '; ';\n }\n return resumo.slice(0, -2);\n}", "title": "" }, { "docid": "4286e2fb9400c1c81815bcd16cc7a910", "score": "0.54594404", "text": "function xu(e,t,n,i){var o=\"\";switch(n){case\"s\":return i?\"muutaman sekunnin\":\"muutama sekunti\";case\"ss\":return i?\"sekunnin\":\"sekuntia\";case\"m\":return i?\"minuutin\":\"minuutti\";case\"mm\":o=i?\"minuutin\":\"minuuttia\";break;case\"h\":return i?\"tunnin\":\"tunti\";case\"hh\":o=i?\"tunnin\":\"tuntia\";break;case\"d\":return i?\"päivän\":\"päivä\";case\"dd\":o=i?\"päivän\":\"päivää\";break;case\"M\":return i?\"kuukauden\":\"kuukausi\";case\"MM\":o=i?\"kuukauden\":\"kuukautta\";break;case\"y\":return i?\"vuoden\":\"vuosi\";case\"yy\":o=i?\"vuoden\":\"vuotta\"}return o=function(e,t){return e<10?t?Lu[e]:Su[e]:e}(e,i)+\" \"+o}", "title": "" }, { "docid": "f8ac25e13eacef082b5a297fbce37263", "score": "0.5459402", "text": "function completitud(oa, es){\n var titulo=0; var keyword=0; var descripcion=0; var autor=0;\n var tipoRE=0; var formato=0; var contexto=0; var idioma=0;\n var tipointer=0; var rangoedad=0; var nivelagregacion=0;\n var ubicacion=0; var costo=0; var estado=0; var copyright=0;\n\n // verifica que la variable tenga un valor y asigna el peso a las variables\n if (oa.title!=\"\") {\n titulo=0.15;\n }\n if (oa.keyword!=\"\") {\n keyword=0.14;\n }\n if (oa.description!=\"\") {\n descripcion=0.12;\n }\n if (oa.entity!=\"\") {\n autor=0.11;\n }\n if (oa.learningresourcetype!=\"\") {\n tipoRE=0.09;\n }\n if (oa.format!=\"\") {\n formato=0.08;\n }\n\n \n // hace la comprobacion cuantos contextos existe en el objeto\n var context=oa.context;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=context.length;\n // asigna el nuevo peso que tendra cada contexto\n var pesocontexto=0.06/can;\n // comprueba que los contextos sean diferentes a vacio o a espacio \n for (var w=0; w <can ; w++) { \n if (context[w]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n contexto=contexto+pesocontexto;\n }\n }\n\n\n\n\n\n if (oa.language!=\"\") {\n idioma=0.05;\n }\n if (oa.interactivitytype!=\"\") {\n tipointer=0.04;\n }\n if (oa.typicalagerange!=\"\") {\n rangoedad=0.03;\n }\n if (oa.aggregationlevel!=\"\") {\n nivelagregacion=0.03;\n }\n // hace la comprobacion cuantas ubicaciones existe en el objeto\n var location=oa.location;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=location.length;\n // asigna el nuevo peso que tendra cada ubicacion\n var peso=0.03/can;\n // comprueba que las ubicaciones sean diferentes a vacio o a espacio \n for (var i=0; i <can ; i++) { \n if (location[i]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n ubicacion=ubicacion+peso;\n }\n }\n \n\n if (oa.cost!=\"\") {\n costo=0.03;\n }\n if (oa.status!=\"\") {\n estado=0.02;\n }\n if (oa.copyrightandotherrestrictions!=\"\") {\n copyright=0.02;\n }\n\n \n \n // hace la sumatoria de los pesos \n var m_completitud=titulo + keyword + descripcion + autor + tipoRE + formato + contexto + idioma +\n tipointer + rangoedad + nivelagregacion + ubicacion + costo + estado + copyright;\n\n \n //alert(mensaje);\n return m_completitud;\n \n //echo \"* Completitud de: \".m_completitud.\"; \".evaluacion.\"<br>\";\n }", "title": "" }, { "docid": "dc621569fc582c8ac5ccd285a8d4477f", "score": "0.545183", "text": "function podswietl(i)\r\n{\r\n podswietlTablice(wiersz(i % 10));\r\n podswietlTablice(kolumna(Math.floor(i/10)));\r\n podswietlTablice(kwadrat(1 + Math.floor((i-10)/30) + 3 * Math.floor(((i % 10)-1)/3)));\r\n}", "title": "" }, { "docid": "a65ebf1e27edbbfedb62d28834dc59ad", "score": "0.54500073", "text": "function afase_luna(njd){\n\n // calcola l'angolo di fase della luna per la data (njd)\n // gennaio 2012\n\n var dati_luna=pos_luna(njd); // recupero fase/elongazione (1)\n var dati_sole=pos_sole(njd);\n\n var elongazione1=dati_luna[4]; // elongazione in gradi sessadecimali.\n var dist_luna=dati_luna[7]/149597870; \n var dist_sole=dati_sole[4]; // distanza del sole in UA.\n\n elongazione=Math.abs(elongazione1)*1;\n\n var dist_sl=dist_luna*dist_luna+dist_sole*dist_sole-2*dist_luna*dist_sole*Math.cos(Rad(elongazione)); // distanza sole-luna\n dist_sl=Math.sqrt(dist_sl);\n\n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_luna; // distanza pianeta-terra.\n var Dts= dist_sole; // distanza terra-sole.\n var Dps= dist_sl; // distanza pianeta-sole.\n\n // teorema del coseno\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-elongazione-delta_fase; // angolo di fase in gradi.\n\n if(elongazione1<0) {angolo_fase=-angolo_fase; }\n\n return angolo_fase;\n\n}", "title": "" }, { "docid": "3cbe0aa04336b69001bac59c751006a0", "score": "0.5445044", "text": "function _GeraResumoEstilo(estilo) {\n var resumo = estilo.nome + ': (';\n resumo += estilo.arma_primaria.nome + ': [' +\n GeraResumoArmaEstilo(\n ArmaPersonagem(estilo.arma_primaria.nome), true, estilo) + ']';\n if (estilo.nome == 'duas_armas' || estilo.nome == 'arma_dupla') {\n resumo += ', ' + estilo.arma_secundaria.nome + ': [' +\n GeraResumoArmaEstilo(\n ArmaPersonagem(estilo.arma_secundaria.nome), false, estilo) + ']';\n }\n resumo += ')';\n return resumo;\n}", "title": "" }, { "docid": "0961a514951fe5189db67c57479a3f7a", "score": "0.5443559", "text": "function calcola_jddata(giorno,mese,anno,ora,minuti,secondi){\n\n // funzione per il calcolo del giorno giuliano per una data qualsiasi. \n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // restituisce il valore numerico dataGiuliana_annox\n// ATTENZIONE! inserire i valori dei tempi come T.U. di GREENWICH\n \nvar dataGiuliana=costanti_jd(giorno,mese,anno,ora,minuti,secondi); // valore del giorno giuliano per una data qualsiasi.\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n\nreturn dataGiuliana;\n\n}", "title": "" }, { "docid": "879fddc6c40f5fa36c7faf2f1e1618ba", "score": "0.5434492", "text": "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "title": "" }, { "docid": "e9cf26bc636f4f85a6672df8dde773b6", "score": "0.5428365", "text": "function ArrondirAu(Nombre, Seuil) {\n Multiple = Math.round(Nombre / Seuil);\n return Multiple * Seuil;\n}", "title": "" }, { "docid": "af97d38d8f4fa8eca49380ad7cc4546c", "score": "0.5425387", "text": "function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}", "title": "" }, { "docid": "cc13d812f3ef9bc735974a3a15e3737e", "score": "0.54232967", "text": "function obli_ecli(njd){\n\n // calcola l'obliquità dell'eclittica.\n // per l'equinozio della data.\n // T= numero di secoli giuliani dallo 0.5 gennaio 1900.\n\n var T=(njd-2415020.0)/36525;\n\n var obli_eclittica=23.452294-0.0130125*T-0.00000164*T*T+0.000000503*T*T*T;\n\nreturn obli_eclittica; //obliquità in gradi\n\n}", "title": "" }, { "docid": "67a19fad4413a71167a82deda0f1e709", "score": "0.5421898", "text": "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "title": "" }, { "docid": "8f48d9039b4f98b5bd25cee62c7bc179", "score": "0.54205513", "text": "function hitungLuasSegiTiga(alas,tinggi){\n var luas = 0.5 * alas * tinggi\n return luas\n}", "title": "" }, { "docid": "bcc96a8d81fe956073aa33d5144815a4", "score": "0.5405551", "text": "function arreglar(numero){\n var numeroo=\"\";\n numero=\"\"+numero;\n partes=numero.split(separadorDecimalesInicial);\n entero=partes[0];\n if(partes.length>1)\n {\n decimal=partes[1];\n }\n cifras=entero.length;\n cifras2=cifras\n for(a=0;a<cifras;a++){\n cifras2-=1;\n numeroo+=entero.charAt(a);\n if(cifras2%3==0 &&cifras2!=0){\n numeroo+=separadorMiles;\n }\n }\n if(partes.length>1){\n numeroo+=separadorDecimales+decimal;\n }\n return numeroo\n }", "title": "" }, { "docid": "3e4e6fc6566b2b8363d558d9f3c7ba33", "score": "0.54037595", "text": "function calculoangulochoquejug(ofjug, ofbola, tamjug, angulo) {\n let angulofinal = angulo;\n let aux;\n let poschoque = ofbola - ofjug;\n if ((angulo >= 90) && (angulo <= 270)) {\n if (poschoque == tamjug / 2) {\n angulofinal = 90;\n\n\n } else if (poschoque > tamjug / 2) {\n aux = (poschoque - (tamjug / 2)) / (tamjug / 2);\n aux = aux * 70;\n angulofinal = 10 + aux;\n\n } else if (poschoque < tamjug / 2) {\n aux = poschoque / (tamjug / 2);\n aux = aux * 70;\n angulofinal = 280 + aux;\n }\n }\n\n return angulofinal;\n }", "title": "" }, { "docid": "cefed711c13df53171226df372807910", "score": "0.53993714", "text": "function zmien_ocene_usun(wiersz, kolumna)\n{\n let nr_bierki = szachownica.pola[wiersz][kolumna];\n\n if(nr_bierki === 0)\n return;\n \n szachownica.ocena.material -= wartosci[nr_bierki];\n szachownica.faza_gry -= wartosci_faza_gry[nr_bierki];\n\n szachownica.ocena.tablice -= wartosc_tabela(wiersz, kolumna, nr_bierki);\n szachownica.ocena.tablice_koncowka -= wartosc_tabela_konc(wiersz, kolumna, nr_bierki);\n\n if(szachownica.faza_gry < 0)\n szachownica.faza_gry = 0;\n}", "title": "" }, { "docid": "1d82446405ca7819344329fad4183c47", "score": "0.53872377", "text": "function LePeso(peso) {\n var peso_minusculo = peso.toLowerCase();\n var indice_unidade = peso_minusculo.indexOf('kg');\n var unidade_gramas = false;\n if (indice_unidade == -1) {\n indice_unidade = peso_minusculo.indexOf('g');\n unidade_gramas = true;\n }\n // Não encontrei a unidade.\n if (indice_unidade == -1) {\n return null;\n }\n\n var peso_sem_unidade = peso_minusculo.substr(0, indice_unidade).replace(',', '.');\n var peso = parseFloat(peso_sem_unidade);\n\n return unidade_gramas ? peso / 1000.0 : peso;\n}", "title": "" }, { "docid": "a089c12d254805f6e57e74ed60a39d39", "score": "0.5384289", "text": "function costanti_jd(giorno,mese,anno,ora,minuti,secondi){\n\n var yy_negativo=0; // sottrae 1 quando l'anno è negativo. \n var mese_str=String(mese); // il mese in formato stringa.\n \n if(anno<0) {yy_negativo=1;} // verifica l'anno negativo. \n \n if (mese==1 || mese==2) {mese_str=\"0\"+mese_str; anno=anno-1; mese=mese+12;} // verifica il mese e l'anno.\n\n var verifica_yy=String(anno)+\".\"+mese_str+String(giorno); // verifica l'anno formato stringa. \n var yy_num=eval(verifica_yy); // riporta l'anno in formato numerico.\n \n \n var a = parseInt( anno / 100 );\n var b = 2 - a + parseInt( a / 4 );\n\n if(yy_num<1582.1015) {a=0; b=0; } // azzera le variabili a e b quando l'anno è minore di 1582.1015.\n\n var c = parseInt( 365.25 * anno );\n var d = parseInt( 30.6001 * ( mese + 1 ) );\n\n var dataGiuliana = b + c + d + giorno + 1720994.50 - yy_negativo;\n\n var offsetGiornata = ( 3600 * ora + 60 * minuti + secondi ) / 86400;\n\n dataGiuliana = dataGiuliana + offsetGiornata;\n\n dataGiuliana=dataGiuliana.toFixed(6);\n\nreturn dataGiuliana ;\n\n}", "title": "" }, { "docid": "99e1856e0e61436f5264ac56d671f31c", "score": "0.53760916", "text": "function pintarGuiones(num) {\r\n for (var i = 0; i < num; i++) {\r\n oculta[i] = \"_\";\r\n }\r\n console.log(oculta)\r\n hueco.innerHTML = oculta.join(\"\"); //me escribe en el html la cadena la cual contiene las lineas azules depende de la palabra\r\n}", "title": "" }, { "docid": "749650c060dae43a9941d7d1f19f6d78", "score": "0.53730917", "text": "function proximo_mes(){\n if(mes_actual!=10){\n mes_actual++;\n }else{\n mes_actual=0;\n año_actual++;\n }\n dibujar_fecha();\n escribir_mes();\n escogerdia1();\n escogerdia2();\n}", "title": "" }, { "docid": "175fe59fb0c1a49bf8228f16f869a183", "score": "0.5364462", "text": "function ordina(){\n\n\tfor (var i = 0; i<persone.length; i++){\n\t\tvar minimoFinOra = i; \n\n\t\tfor(var j=i+1; j<persone.length; j++){\n\n\t\t\tif(persone[j].altezza<persone[minimoFinOra].altezza){\n\n\t\t\t\tminimoFinOra = j;\n\t\t\t}\n\t\t}\n\t\t// Salvo il valore minimo\n\t\tvar tmp = persone[i];\n\t\tpersone[i] = persone[minimoFinOra];\n\t\tpersone[minimoFinOra] = tmp;\n\t}\n\t//Visualizzo\n\tvisualizzaPersone();\n}", "title": "" }, { "docid": "189c849b80a3e67b04ee43876f34cff1", "score": "0.53626007", "text": "function alianzaMercado(){\n\t\tvar a = find(\"//tr[@class='rbg']\", XPFirst).parentNode;\n\n\t\t// Prepara la insercion de la nueva columna\n\t\tvar b = a.getElementsByTagName(\"TR\");\n\t\t// FIXME: Apaño para Firefox. FF mete nodos de tipo texto vacios\n\t\tb[0].childNodes[b[0].childNodes.length == 3 ? 1 : 0].setAttribute('colspan', '8');\n\t\tb[b.length - 1].childNodes[0].setAttribute(\"colspan\", \"8\");\n\n\t\t// Crea e inserta la columna\n\t\tvar columna = document.createElement(\"TD\");\n\t\tcolumna.innerHTML = T('ALIANZA');\n\t\tb[1].appendChild(columna);\n\n\t\t// Rellena la columna con los nombres de las alianzas\n\t\tfor(var i = 2; i < b.length - 1; i++){\n\t\t\tvar alianza = document.createElement(\"TD\");\n\t\t\t// FIXME: Apaño para Firefox. FF mete nodos de tipo texto vacios\n\t\t\tvar alianza_txt = b[i].childNodes[b[i].childNodes.length == 12 ? 8 : 4].getAttribute('title');\n\t\t\tif (alianza_txt != null) alianza.innerHTML = alianza_txt;\n\t\t\tb[i].appendChild(alianza);\n\t\t}\n\t}", "title": "" }, { "docid": "67d2ec24cbef6c78c390e06df22af3db", "score": "0.536076", "text": "function effemeridi_luna(TEMPO_RIF,LAT,LON,ALT,ITERAZIONI,LAN){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) Ottobre 2011\n // funzione per il calcolo delle effemeridi del Sole.\n // Parametri utilizzati:\n // TEMPO_RIF= \"TL\" o \"TU\" tempo locale o tempo universale.\n // LAT= latitudine in gradi sessadecimali.\n // LON= longtudine in gradi sessadecimali.\n // ALT= altitudine in metri.\n // ITERAZIONE =numero di ripetizioni del calcolo.\n // LAN=\"EN\" versione in inglese.\n\nvar njd=calcola_jdUT0(); // numero del giorno giuliano all'ora 0 di oggi.\n\n njd=njd+0.00078; // correzione per il Terrestrial Time.\n\nvar data_ins=0; // data\nvar data_inser=0; // data\n\nvar numero_iterazioni=ITERAZIONI;\n\nvar effe_luna=0;\nvar ar_luna=0;\nvar de_luna=0;\nvar classetab=\"colore_tabellaef1\";\nvar elongazione=0;\nvar effe1=0;\nvar coo_app=0; // coordinate equatoriali apparenti.\nvar costl=\"\"; // costellazione. \n\n document.write(\"<table width=100% class='.table_effemeridi'>\");\n document.write(\" <tr>\");\n\n // versione in italiano.\n\n if (LAN!=\"EN\") // diverso da EN\n {\n document.write(\" <td class='colore_tabella'>Data:</td>\");\n document.write(\" <td class='colore_tabella'>Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Culmina:</td>\");\n document.write(\" <td class='colore_tabella'>Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>Ascensione Retta:</td>\");\n document.write(\" <td class='colore_tabella'>Declinazione:</td>\");\n document.write(\" <td class='colore_tabella'>Fase:</td>\");\n document.write(\" <td class='colore_tabella'>Elong:</td>\");\n document.write(\" <td class='colore_tabella'>Cost.:</td>\");\n }\n\n // versione in inglese.\n\nif (LAN==\"EN\")\n {\n\n document.write(\" <td class='colore_tabella'>Date:</td>\");\n document.write(\" <td class='colore_tabella'>Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Transit:</td>\");\n document.write(\" <td class='colore_tabella'>Set:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Set:</td>\");\n document.write(\" <td class='colore_tabella'>Right Ascension:</td>\");\n document.write(\" <td class='colore_tabella'>Declination:</td>\");\n document.write(\" <td class='colore_tabella'>Phase:</td>\");\n document.write(\" <td class='colore_tabella'>Elong:</td>\");\n document.write(\" <td class='colore_tabella'>Const.:</td>\");\n\n }\n\n document.write(\" </tr>\");\n\n // ST_SOLE_LUNA Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto)\n // 0 1 2 3 4\n\n njd=njd-1;\n\n for (b=0; b<numero_iterazioni; b++){\n\n njd=njd+1;\n effe1=ST_SOLE_LUNA(njd,TEMPO_RIF,\"L\",LON,LAT,ALT,0.25);\n\n effe_luna=pos_luna(njd);\n coo_app=pos_app(njd,effe_luna[0],effe_luna[1]) // coordinate apparenti.\n\n ar_luna= sc_ore(coo_app[0]); // ascensione retta.\n de_luna=sc_angolo(coo_app[1]); // declinazione.\n\n elongazione=effe_luna[4].toFixed(2);\n\n data_ins=jd_data(njd);\n\n if (LAN!=\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\" : \"+Lnum(parseInt(data_ins[1]),2)+\"| \"+data_ins[3]}; // versione in italiano.\n if (LAN==\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\" : \"+Lnum(parseInt(data_ins[1]),2)+\"| \"+data_ins[4]}; // versione in inglese.\n\n fase_luna=effe_luna[3].toFixed(2);\n\n costl=costell(coo_app[0]); // costellazione. \n\n if (b%2==0){classetab=\"colore_tabellaef2\"; }\n\n else {classetab=\"colore_tabellaef1\";}\n\n\n document.write(\" <tr>\");\n document.write(\" <td class='\"+classetab+\"'>\"+data_inser+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[2]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[3]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[4]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[0]+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[1]+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+ar_luna+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+de_luna+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+fase_luna+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+elongazione+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+costl+\"</td>\");\n\n document.write(\" </tr>\");\n\n }\n document.write(\" </table>\");\n\n\n}", "title": "" }, { "docid": "328cc2c85fb25b1c811deb26f8ff7356", "score": "0.53523546", "text": "function eq_tempo_data2(anno,njd){\n\n // funzione per il calcolo dell'equazione del tempo.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) gennaio 2012.\n // algoritmo di MEEUS.\n \n njd=jdHO(njd); // riporta il g.g. all'ora H0(zero) del giorno. \n \nvar ar_sole=pos_sole(njd); // calcolo dell'ascensione retta del sole.\nvar ar_sole_app=pos_app(njd,ar_sole[0],ar_sole[1]);\nvar TSG=temposid_app(njd);\nvar valore_et=0;\nvar h=TSG-ar_sole_app[0];\n \nif(h<0 ) {valore_et=12+h;}\nif(h>0 ) {valore_et=h-12;}\n \n valore_et=valore_et*60; // valore in minuti.\n\n valore_et=valore_et.toFixed(6);\n\nreturn valore_et\n\n}", "title": "" }, { "docid": "c0aac16d80842089d1ca05f2bcbcdd11", "score": "0.53504974", "text": "function agregar_miles(numero)\n{\n\t\n\tvar partes=numero.toString().split('.');\n\tvar miles=new RegExp(\"(-?[0-9]+)([0-9]{3})\"),separador_miles=',';\n while(miles.test(partes[0])) {\n partes[0]=partes[0].replace(miles, \"$1\" + separador_miles + \"$2\");\n }\n\tif(partes.length>1)\t\n\t\treturn partes[0]+'.'+partes[1];\n\t if(partes.length==1)\n\t return partes[0];\n}", "title": "" }, { "docid": "18bac8a38d05f226fa94050772ce0871", "score": "0.5348492", "text": "function getPelnas() {\n var pajamos = 12500;\n var islaidos = 7500;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + (pajamos-islaidos) + \"<br>\";\n return pajamos-islaidos;\n}", "title": "" }, { "docid": "3b052d24aa71f51e257a99faeaa5899f", "score": "0.534797", "text": "function GetMargeSeuil(){\n return enumParams(COLUMN_MARGE_SEUIL).join();\n}", "title": "" }, { "docid": "5e80c83f49465b9c881d74bbdda8bc39", "score": "0.534637", "text": "function longitudCola(){\n var lng = cola.length;\n var tam = 0;\n var i;\n for (i=0;i<lng;i++){\n tam += cola[i].datlng;\n }\n return tam;\n }", "title": "" }, { "docid": "6d360bdd3a4901a5d318657b41a1982f", "score": "0.5337423", "text": "function Grande(_id,_mat, _dnc, _dnt, _fec, _ext) {\n this.precioBase = 18.5;//Constante\n Lavado.call(this, _id,_mat, _dnc, _dnt, _fec, _ext, this.precioBase);\n}", "title": "" }, { "docid": "8ad16d736253d6099ff1f52b16d49fca", "score": "0.5335481", "text": "function jelYamb(niz)\n{\n\tvar skup = napraviSet(niz);\n\n\t/* ako je velicina skupa 1 imamo yamb */\n\tif(skup.size === 1)\n\t\treturn 5*niz[0] + 80;\n\telse\n\t\treturn 0;\n\t\n}", "title": "" }, { "docid": "f0b11bf512f06885300a235a57c5f2e9", "score": "0.5335341", "text": "function Colonna() {\r\n\tthis.baseColonna = 10;\r\n\tthis.baseColonnaSpessore = 0.5;\r\n\tthis.altezzaColonnaNoCap = 34;\r\n\t//\r\n\tthis.scalaCapitelloX = 0.22; \r\n\tthis.scalaCapitelloY = 0.18; \r\n\tthis.scalaCapitelloZ = 0.45;\r\n\tthis.altezzaCapitello = 0.2;\r\n}", "title": "" }, { "docid": "9f93d9b4121c5b82acb3c1397b4aa4d4", "score": "0.5334491", "text": "function calculaParcelaFinanciamento (valor,meses){\n var parcela={parcela:0, seguro:0, txadm:0}; \n //caso o prazo seja menor que 12 meses, não há incidência de juros\n if (meses<=12){\n parcela[\"parcela\"]=valor/meses;\n \n return parcela;\n }else{\n //caso contrário, procede ao cálculo financeiro \n var i=0.009488793;\n var numerador= i*Math.pow(1+i,meses);\n var denominador= Math.pow(1+i,meses)-1; \n var valorparcela=valor*(numerador/denominador);\n \n parcela[\"parcela\"]=valorparcela;\n parcela[\"seguro\"]=0.00019*valor;\n parcela[\"txadm\"]=25.00;\n \n return parcela;\n \n }//fim do else\n}//fim da função calculaParcelaFinanciamento ", "title": "" }, { "docid": "dec9a5ab53583d13f19f28a484e6ce34", "score": "0.53340375", "text": "function bl(e,t,n,i){var o=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return o+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return o+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return o+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return o+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return o+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return o+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "55d3cfb89383ecea0f8fb5fbd7d2435e", "score": "0.5333246", "text": "function calcNiveau(){\r\n var ancienNiveau = perso.niveau\r\n while (perso.exp > perso.levelLimit){\r\n perso.exp = perso.exp - perso.levelLimit\r\n perso.levelLimit = Math.round(perso.levelLimit * 1.5)\r\n perso.niveau++\r\n niveauPlus = true\r\n gainDeNiveau()\r\n }\r\n\r\n if (niveauPlus){\r\n var message = \"Aurora a gagné \" + (perso.niveau - ancienNiveau) + \" niveau !!!\"\r\n niveauPlus = false\r\n }else {\r\n var message = \"aurora a gagné \" + perso.exp + \" pts d'experience\"\r\n }\r\n return message\r\n}", "title": "" }, { "docid": "a91d3fd06c24037f02bb8709fa9a3d18", "score": "0.53321105", "text": "function ubahJuta(angka) {\n\n let nominal = Math.round(angka * 1000000);\n let ubahFormatRupiah = rupiah(nominal);\n\n return ubahFormatRupiah;\n}", "title": "" }, { "docid": "c81fb30d2a3716917b7d754a6539c152", "score": "0.53266525", "text": "function TinhTheoLoaiXe(sokm, tgcho, giaLoai1, giaLoai2, giaLoai3, tgChoTheoLoai) {\n var tien = 0;\n if (sokm <= 1) {\n tien = sokm * giaLoai1 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm > 1 && sokm < 21) {\n tien = giaLoai1 + (sokm - 1) * giaLoai2 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm >= 21) {\n tien = giaLoai1 + 19 * giaLoai2 + (sokm - 20) * giaLoai3 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n }\n return document.getElementById('xuatTien').innerHTML = tien + ' vnđ';\n}", "title": "" }, { "docid": "3db08cfb9197d4d984afcde7bb29a525", "score": "0.5323975", "text": "function calcNeto( ) {\r\n\t\t\treturn $scope.pes_br-$scope.pes_ta;\r\n//\t\t\treturn toString(accounting.unformat($scope.pes_br)-accounting.unformat($scope.pes_ta)); /*\r\n\t\t}", "title": "" }, { "docid": "f9fa105aa5653b78a15319326d715bb9", "score": "0.5321424", "text": "function niveau1() {\n\ttable = [\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n\t];\n}", "title": "" }, { "docid": "23e660ba4d8b5989de844195d581a2b1", "score": "0.5320922", "text": "function sc_ore_hm(ore_dec){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy). \n // scomposizione delle ore decimali [ore_dec] in ore|minuti. - tronca i decimali dei minuti senza applicare arrotondamenti.\n // La funzione restituisce la stringa [ore_hm].\n // ATTENZIONE!! La funzione riporta le ore all'interno dell'intervallo: 0-24.\n \n\t var ored=ore_24(ore_dec); // Intervallo ore: 0-24\n\n var ore= parseInt(ored); // Ore.\n var minuti= parseInt((ored-ore)*60); // Minuti.\n \n ore= String(ore); // trasforma il numero in stringa.\n minuti= String(minuti ); // trasforma il numero in stringa. \n\n if (ore.length<2 ){ ore='0'+ore;}\n if (minuti.length<2 ){ minuti='0'+minuti;}\n \n var ore_hm=ore+\"h. \"+minuti+\"m.\"; \n \nreturn ore_hm;\n\n}", "title": "" }, { "docid": "1cbb46b25618ab3fe9d9c626c76f2b02", "score": "0.5310763", "text": "function sc_oresd(ore_dec){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy). \n // scomposizione delle ore decimali [ore_dec], in hh |mm |ss.decimali con 2 decimali.\n // restituisce la variabile stringa [ore_hms].\n // ATTENZIONE! La funzione riporta le ore all'interno dell'intervallo: 0-24.\n // agg: Dicembre 2011\n \n var ored=ore_24(ore_dec); // Intervallo ore: 0-24\n\n var ore= parseInt(ored); // Ore.\n var minuti= parseInt((ored-ore)*60); // Minuti.\n var secondi= (((ored-ore)*60-minuti)*60).toFixed(2); // Secondi con 2 decimali.\n\n // verifica arrotondamenti. \n\n if (secondi>=60){secondi=secondi-60; minuti=minuti+1;}\n if ( minuti>=60){ minuti= minuti-60; ore=ore+1; }\n if ( ore>=24){ ore=ore_24(ore);} // Intervallo ore: 0-24\n \n ore= String(ore); // trasforma il numero in stringa.\n minuti= String(minuti ); // trasforma il numero in stringa. \n secondi= String(secondi); // trasforma il numero in stringa. \n \n if (ore.length<2 ){ ore='0'+ore;}\n if (minuti.length<2 ){ minuti='0'+minuti;}\n if (secondi.length<=4){secondi='0'+secondi;}\n\n var ore_hms=ore+\"h. \"+minuti+\"m. \"+secondi+\"s.\";\n\t \nreturn ore_hms; \n\n}", "title": "" }, { "docid": "c6c99848250c10800a1a13271fa4e719", "score": "0.5310458", "text": "function addPoints(nombre) // il s'agit d'un séparateur de millier ==> by Vulca <==\r\n\t\t{\r\n\t\t\tvar signe = '';\r\n\t\t\tif (nombre<0)\r\n\t\t\t{\r\n\t\t\t\tnombre = Math.abs(nombre);\r\n\t\t\t\tsigne = '-';\r\n\t\t\t}\r\n\t\t\tnombre=parseInt(nombre);\r\n\t\t\tvar str = nombre.toString(), n = str.length;\r\n\t\t\tif (n <4) {return signe + nombre;}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\treturn signe + (((n % 3) ? str.substr(0, n % 3) + '.' : '') + str.substr(n % 3).match(new RegExp('[0-9]{3}', 'g')).join('.'));\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "f5fe1b26d49236035cec34a6be929c53", "score": "0.5287207", "text": "function alianzaMercado(){\r\n\t\tvar a = find(\"//tr[@class='rbg']\", XPFirst).parentNode;\r\n\r\n\t\t// Prepara la insercion de la nueva columna\r\n\t\tvar b = a.getElementsByTagName(\"TR\");\r\n\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\r\n\t\tb[0].childNodes[b[0].childNodes.length == 3 ? 1 : 0].setAttribute('colspan', '8');\r\n\t\tb[b.length - 1].childNodes[0].setAttribute(\"colspan\", \"8\");\r\n\r\n\t\t// Crea e inserta la columna\r\n\t\tvar columna = document.createElement(\"TD\");\r\n\t\tcolumna.innerHTML = T('ALIANZA');\r\n\t\tb[1].appendChild(columna);\r\n\r\n\t\t// Rellena la columna con los nombres de las alianzas\r\n\r\n\t\tfor(var i = 2; i < b.length - 1; i++){\r\n\t\t\tvar alianza = document.createElement(\"TD\");\r\n\t\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\r\n\t\t\tvar alianza_txt = b[i].childNodes[b[i].childNodes.length == 12 ? 8 : 4].getAttribute('title');\r\n\t\t\tif (alianza_txt != null) alianza.innerHTML = alianza_txt;\r\n\t\t\tb[i].appendChild(alianza);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6d8a9b5a82cb72bc489a306837940cfa", "score": "0.5284937", "text": "function fun_invierte_tratamiento_tildes(arg_palabra){ //ESTA FUNCION SE ENCARGA DE TRANSFORMAR TODOS LOS ACUTES EN SU RESPECTIVO CARACTER, SE UTILIZA PARA IMPRIMIR LOS CARACTERES EN CAMPOS INPUT, YA QUE EN ESTOS LA TRADUCCION POR PARTE DE HTML NO ES AUTOMÁTICA\r\n\r\n\tvar indice_ini=1,indice_fin;\r\n\t\r\n\twhile(indice_ini!=-1){\r\n\t\tindice_ini=arg_palabra.indexOf(\"&\");\r\n\t\tindice_fin=arg_palabra.indexOf(\";\");\r\n\t\t\r\n\t\tif(indice_ini!=-1){\r\n\t\t\tletra_equivalente=fun_caracter_equiv(arg_palabra.substring(indice_ini,indice_fin+1));\r\n\t\t\t\r\n\t\t\targ_palabra=arg_palabra.substring(0,indice_ini)+letra_equivalente+arg_palabra.substring(indice_fin+1,arg_palabra.length);\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn arg_palabra;\r\n}", "title": "" }, { "docid": "ed36aa83a55a36f31b4503df978f5287", "score": "0.5282118", "text": "calculaIMC() {\n this.imc = (this.peso / (this.altura * this.altura)).toFixed(2);\n if (this.imc < 18.5) {\n this.resultado = \"Magreza, Obesidade 0\";\n } else if (this.imc >= 18.5 && this.imc <= 24.9) {\n this.resultado = \"Normal, Obsidade 0\";\n } else if (this.imc >= 25 && this.imc <= 29.9) {\n this.resultado = \"Sobrepeso, Obesidade I\";\n } else if (this.imc >= 30 && this.imc <= 39.9) {\n this.resultado = \"Obesidade II\";\n } else if (this.imc >= 40) {\n this.resultado = \"Obesidade Grave III\";\n }\n }", "title": "" }, { "docid": "a8581def20a820f66d71c273a7370910", "score": "0.52728456", "text": "function e(A,e,t,r){var n=A+\" \";switch(t){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return n+=1===A?e?\"sekundo\":\"sekundi\":2===A?e||r?\"sekundi\":\"sekundah\":A<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",n;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return n+=1===A?e?\"minuta\":\"minuto\":2===A?e||r?\"minuti\":\"minutama\":A<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",n;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return n+=1===A?e?\"ura\":\"uro\":2===A?e||r?\"uri\":\"urama\":A<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",n;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return n+=1===A?e||r?\"dan\":\"dnem\":2===A?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",n;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return n+=1===A?e||r?\"mesec\":\"mesecem\":2===A?e||r?\"meseca\":\"mesecema\":A<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",n;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return n+=1===A?e||r?\"leto\":\"letom\":2===A?e||r?\"leti\":\"letoma\":A<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",n}}", "title": "" }, { "docid": "73cb87c82b3d082bbe41ae9d4957fccf", "score": "0.5269379", "text": "function cfasi_lunari(mese,anno,fase){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) Luglio 2010\n // funzione per il calcolo delle fasi lunari.\n // mese= numero del mese da 1 a 12.\n // anno=anno di riferimento.\n // k=0.00 per la luna nuova\n // k=0.25 per il primo quarto.\n // k=0.50 per la luna piena\n // k=0.75 per l'ultimo quarto.\n // fase= valore numerico per la fase 0 - 0.25 - 0.50 - 0.75 sono ammessi solo questi valori.\n \nvar anno_dec=anno+(mese/12);\nvar k=(anno_dec-1900)*12.3685; // calcolo della costante k. (parseInt) tronca la parte decimale\n k=parseInt(k)*1+fase*1;\n \nvar T=k/1236.85;\n\nvar fseno=166.56+132.87*T-0.009173*T*T;\n fseno=fseno/180*Math.PI;\n\nvar njd_fase =2415020.75933+29.53058868*k+0.0001178*T*T-0.000000155*T*T*T+0.00033*Math.sin(fseno);\n\n // calcolo anomalia media del sole.\n\nvar M=359.2242+29.10535608*k-0.0000333*T*T-0.00000347*T*T*T;\n M=gradi_360(M);\n M=M/180*Math.PI;\n\n // calcolo anomalia media della luna.\n\nvar M1=306.0253+385.81691806*k+0.0107306*T*T+0.00001236*T*T*T;\n M1=gradi_360(M1);\n M1=M1/180*Math.PI;\n\n // calcolo dell'argomento della latitudine della luna.\n\nvar F=21.2964+390.67050646*k-0.0016528*T*T-0.00000239*T*T*T;\n F=gradi_360(F);\n F=F/180*Math.PI;\n\n // calcolo correzioni per la luna nuova e piena.\n\nvar correzione1=0;\n\nif (fase==0 || fase==0.50) {\n \n correzione1= (0.1734-0.000393*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.4068*Math.sin(M1)\n +0.0161*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0104*Math.sin(2*F)\n -0.0051*Math.sin(M+M1)\n -0.0074*Math.sin(M-M1)\n +0.0004*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0010*Math.sin(2*F-M1)\n +0.0005*Math.sin(M+2*M1); \n}\n\nelse if (fase==0.25 || fase==0.75) {\n \n correzione1= (0.1721-0.0004*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.6280*Math.sin(M1)\n +0.0089*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0079*Math.sin(2*F)\n -0.0119*Math.sin(M+M1)\n -0.0047*Math.sin(M-M1)\n +0.0003*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0021*Math.sin(2*F-M1)\n +0.0003*Math.sin(M+2*M1)\n +0.0004*Math.sin(M-2*M1)\n -0.0003*Math.sin(2*M+M1); \n}\n\nelse {alert(\"Valore fase \"+fase+\" non valido!\");}\n\nvar njd_fase=njd_fase+correzione1; // per la luna nuova.\n\n // njd_fase= numero dei giorni giuliani.\nreturn njd_fase;\n\n}", "title": "" }, { "docid": "44fcb00177c13e9be75da8ed4d42f4a1", "score": "0.5268763", "text": "function zmien_ocene(ruch_t)\n{\n let nr_bierki_p = szachownica.pola[ruch_t.wiersz_p][ruch_t.kolumna_p];\n let nr_bierki_k = szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k];\n\n if(nr_bierki_k !== 0)\n zmien_ocene_usun(ruch_t.wiersz_k, ruch_t.kolumna_k);\n\n szachownica.ocena.tablice += wartosc_tabela(ruch_t.wiersz_k, ruch_t.kolumna_k, nr_bierki_p) - wartosc_tabela(ruch_t.wiersz_p, ruch_t.kolumna_p, nr_bierki_p);\n szachownica.ocena.tablice_koncowka += wartosc_tabela_konc(ruch_t.wiersz_k, ruch_t.kolumna_k, nr_bierki_p) - wartosc_tabela_konc(ruch_t.wiersz_p, ruch_t.kolumna_p, nr_bierki_p);\n}", "title": "" }, { "docid": "4a86df54bb253e7f0123095a3b5754c5", "score": "0.52642256", "text": "function Vi(e,t,n,i){var o={s:[\"m\\xf5ne sekundi\",\"m\\xf5ni sekund\",\"paar sekundit\"],m:[\"\\xfche minuti\",\"\\xfcks minut\"],mm:[e+\" minuti\",e+\" minutit\"],h:[\"\\xfche tunni\",\"tund aega\",\"\\xfcks tund\"],hh:[e+\" tunni\",e+\" tundi\"],d:[\"\\xfche p\\xe4eva\",\"\\xfcks p\\xe4ev\"],M:[\"kuu aja\",\"kuu aega\",\"\\xfcks kuu\"],MM:[e+\" kuu\",e+\" kuud\"],y:[\"\\xfche aasta\",\"aasta\",\"\\xfcks aasta\"],yy:[e+\" aasta\",e+\" aastat\"]};return t?o[n][2]?o[n][2]:o[n][1]:i?o[n][0]:o[n][1]}", "title": "" }, { "docid": "cddcd8ecfef09179fcdad1ed5e653c15", "score": "0.5261595", "text": "function montaValorMes () {\r\n\t\t\t// laco de despesas\r\n\t\t\tfor (var x in $scope.despesas) {\r\n\t\t\t\t// separo a despesa\r\n\t\t\t\tvar despesa = $scope.despesas[x];\r\n\t\t\t\t// crio um atributo pres(array) na despesa\r\n\t\t\t\tdespesa.pres = [];\r\n\r\n\t\t\t\t// laco de meses até 8\r\n\t\t\t\t// for (var m=0; m<8; m++) {\r\n\t\t\t\tfor (var m=0; m<$scope.tlmeses; m++) {\r\n\t\t\t\t\tvar day = moment().add(m, \"M\").date(); // dia atual + 1\r\n\t\t\t\t\tvar month = moment().add(m, \"M\").month(); // mes atual + 1\r\n\t\t\t\t\tvar year = moment().add(m, \"M\").year(); // ano atual + 1\r\n\t\t\t\t\tvar data = ''; // variavel data\r\n\r\n\t\t\t\t\t// laco de prestacoes da despesa\r\n\t\t\t\t\tfor (var p=0; p<despesa.prestacoes; p++) {\r\n\t\t\t\t\t\tvar dia = moment(despesa.datavencimento).add(p, \"M\").date(); // dia da data despesa + index\r\n\t\t\t\t\t\tvar mes = moment(despesa.datavencimento).add(p, \"M\").month(); // mes data despesa + index\r\n\t\t\t\t\t\tvar ano = moment(despesa.datavencimento).add(p, \"M\").year(); // ano data despesa + index\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// caso o mes e ano da despesa seja = ao mes e ano atual \r\n\t\t\t\t\t\tif (mes === month && ano === year) {\r\n\t\t\t\t\t\t\tdata = {\"data\": mes+\"/\"+ano, \"valor\":despesa.valor};\r\n\t\t\t\t\t\t\t// pegando a prestação atual\r\n\t\t\t\t\t\t\tif (m === 0) { // m = o ( mes atual )\r\n\t\t\t\t\t\t\t\tdespesa.prestacao = (p+1)+\"/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!despesa.prestacao) {\r\n\t\t\t\t\t\t// se ano = atual mas mes menor ou ano menor\r\n\t\t\t\t\t\tif ( (ano === year && mes < month) || (ano < year) ) {\r\n\t\t\t\t\t\t\tdespesa.prestacao = despesa.prestacoes+\"/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tdespesa.prestacao = \"0/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( data === '' ) {\r\n\t\t\t\t\t\tdespesa.pres.push({\"data\": \"00/0000\", \"valor\":\"xxxx\", \"color\":\"background:#f0f5f5; color:#ccc;\", \"icon\":\"fa-trophyx\"});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tdespesa.pres.push(data);\r\n\t\t\t\t\t\t$scope.totais[m].valor = $scope.totais[m].valor + parseInt(despesa.valor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($scope.totais[m-1] != undefined && $scope.totais[m].valor < $scope.totais[m-1].valor) {\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-down\";\r\n\t\t\t\t\t\t}else if($scope.totais[m-1] != undefined && $scope.totais[m].valor > $scope.totais[m-1].valor) {\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-up\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-right\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$scope.totalgeral = $scope.totalgeral + parseFloat(despesa.valor);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "a78471216b35294476430053c84f83b2", "score": "0.5259622", "text": "function Iluminacao(pl, ka, ia, kd, od, ks, il, n) {\n this.pl = pl; //posições originais da fonte de luz em coordenadas de mundo\n this.pl_pvista_camera = pl; //adapta as posiçoes de entrada para o ponto de vista da camera\n this.ka = ka; // reflexão de luz ambiente (quanto maior, mais reflexível é)\n this.ia = ia; // intensidade da luz ambiente (quanto maior, mais iluminado kkk)\n this.kd = kd; // constante difusa, o quão espalhável é essa luz\n this.od = od; // vetor difuso, usado para simplesmente espalhar kkk\n this.ks = ks; // parte especular, como a luz vai ser refletida no objeto\n this.il = il; // cor da fonte de luz\n this.n = n; // constante de rugosidade, trata irregularidades, ruídos, enfim, frescura.\n}", "title": "" }, { "docid": "cbc7212723c00847c5360f40fec72375", "score": "0.5257522", "text": "function getPelnas(pajamos, mokesciai, mokesciai2){\nvar pelnas = (pajamos - (pajamos * mokesciai)) - (pajamos - (pajamos * mokesciai)) * mokesciai2;\n return pelnas;\n}", "title": "" }, { "docid": "72483dc9df27985e458b42b639a65a80", "score": "0.52557534", "text": "function fatorial(numero) {\n return 0\n}", "title": "" }, { "docid": "cf287131610bbc8d97a532ba883d313d", "score": "0.52556705", "text": "function ui(e,t,n,a){var i={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return a?i[n][0]:i[n][1]}", "title": "" }, { "docid": "5847ab58df035732b3f99c57ecc04673", "score": "0.5255161", "text": "function amalgaaToResult(value) {\r\n document.getElementById(\"amalgaaSize\").innerHTML = value + \"см Length\";\r\n}", "title": "" }, { "docid": "645920290ad457a087e4587b03320841", "score": "0.5252108", "text": "function trataColisoes()\n{\n //lateral esquerda - 1\n if(esfera.posicao[0] - esfera.raio < parametrosMesa.xMin)\n {\n if(ultimaColisao != 1)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 1;\n } \n }\n\n //lateral direita - 2\n if(esfera.posicao[0] + esfera.raio > parametrosMesa.xMax)\n {\n if(ultimaColisao != 2)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 2;\n } \n }\n\n //cima - 3\n if(esfera.posicao[1] - esfera.raio < parametrosMesa.zMax)\n {\n if(ultimaColisao != 3)\n {\n veloc[2] = -parametrosMesa.coeficienteRestituicao * veloc[2];\n ultimaColisao = 3; \n }\n \n }\n\n //corredor direito - 4\n if(esfera.posicao[1] - esfera.raio > -30)\n { \n if( ( (esfera.posicao[0] - esfera.raio < -19.75) && (esfera.posicao[0] + esfera.raio > -17.75) ) || \n ( (esfera.posicao[0] + esfera.raio > -18.75) && (esfera.posicao[0] - esfera.raio < -20.75) ) )\n {\n if(ultimaColisao != 4)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 4;\n } \n }\n \n\n //corredor esquerdo - 5\n if( (esfera.posicao[0] + esfera.raio > 19.04) && (esfera.posicao[0] - esfera.raio < 21.04) || \n (esfera.posicao[0] - esfera.raio < 20.04) && (esfera.posicao[0] + esfera.raio > 18.04) )\n {\n if(ultimaColisao != 5)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 5;\n } \n }\n }\n\n /*//corner direito - 6\n if(esfera.posicao[0] - esfera.posicao[1] >= 50)\n {\n if(ultimaColisao != 6)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 6;\n }\n }\n\n //corner esquerdo - 7\n if(-esfera.posicao[0] + esfera.posicao[1] >= 50){\n if(ultimaColisao != 7)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 7;\n }\n }*/\n}", "title": "" }, { "docid": "a012f432a6dcf94ccbbb1cc216dcf04a", "score": "0.52440447", "text": "function marks() \n{\n\tvar m = testObjekat.ocenePolaznika;\n\n\tfor (var i = 0; i < m.length; i++)\n\t{\n\t\tm[i] = m[i] + '/10';\n\t}\n\treturn m;\n\n}", "title": "" }, { "docid": "7d18b7af32719e678ddcdaf49e05fb49", "score": "0.524383", "text": "function ejercicio02(email){\nvar longitud = email.length;\nvar mayusc = email.toUpperCase();\ncont = 0;\nvar no = \"\";\n\nfor (i=0 ; i<=longitud ; i++)\n{ \n if(email.charAt(i) == \"m\" || email.charAt(i) == \"M\")\n {\n cont++;\n }\n}\nif (cont == 0)\n{\n cont = toString(cont)\n cont = \"ninguna\";\n no = \"no\";\n}\nreturn \"El correo\" + email + \"tiene\" + longitud + \"caracteres y en mayúsculas se quedaría así\" + mayusc + \". Además \" + no + \" contiene \" + cont + \" letras M\";\n\n}", "title": "" }, { "docid": "170c0fb8b31fad7c2fd4d64237a8021d", "score": "0.5239541", "text": "function zmien_ocene_dodaj(wiersz, kolumna, nr_bierki)\n{\n szachownica.ocena.material += wartosci[nr_bierki];\n szachownica.faza_gry += wartosci_faza_gry[nr_bierki];\n\n if(szachownica.faza_gry > 70)\n szachownica.faza_gry = 70;\n\n szachownica.ocena.tablice += wartosc_tabela(wiersz, kolumna, nr_bierki);\n szachownica.ocena.tabele_koncowka += wartosc_tabela_konc(wiersz, kolumna, nr_bierki);\n}", "title": "" }, { "docid": "0b508feb5a1a135d8d2f0cc698010ac8", "score": "0.52391523", "text": "function hh_loc(fuso,njd){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2011.\n // verifica se per la data (njd) è in vigore l'ora legale.\n // fuso = fuso orario della località.\n // restituisce le ore da aggiungere al T.U. per avere il Tempo Locale ( fuso + ora_legale ).\n\n var njd1=0; // variabile per l'ultima domenica di marzo.\n var njd2=0; // variabile per l'ultima domenica di ottobre.\n var tempo_locale=fuso; // tempo locale.\n\n var anno=jd_data(njd); // individua l'anno della data (njd).\n\n var njd_m= calcola_jddata(1, 3,anno[2],0,0,0)-1; // G.G. del primo marzo.\n var njd_o= calcola_jddata(1,10,anno[2],0,0,0)-1; // G.G. del primo ottobre.\n\n for(a=1; a<32; a++){\n\n njd_m=njd_m+1; giorno=jd_data(njd_m); if(giorno[5]==0){njd1=njd_m;} // ultima domenica di marzo.\n\n njd_o=njd_o+1; giorno=jd_data(njd_o); if(giorno[5]==0){njd2=njd_o;} // ultima domenica di ottobre.\n }\n\n if(njd>=njd1 && njd<njd2 ){tempo_locale=tempo_locale+1;}\n\n return tempo_locale;\n }", "title": "" }, { "docid": "0c8d611ea318d87b5b66a6cf50e2ba63", "score": "0.523451", "text": "function ZZcompoEM(Monstre) {\r\n var compo=\"\";\r\n\tfor (var i=0; i<tabEM.length; i++) {\r\n\t \tif (tabEM[i][0].toLowerCase()==Monstre.toLowerCase()) {\r\n\t \t if (tabEM[i][4]==1)\r\n\t\t\t compo=\"<IMG SRC='\"+SkinZZ+\"smallEM_variable.gif'> Divers composants <b>\"+tabEM[i][1]+\" \"+tabEM[i][0]+\" </b>(\"+tabEM[i][2]+\")\";\r\n \t\t else\r\n\t\t\t compo=\"<IMG SRC='\"+SkinZZ+\"smallEM_fixe.gif'> <b>\"+tabEM[i][1]+\" \"+tabEM[i][0]+\"</b> (Qualité \"+tabQualite[tabEM[i][3]]+\") pour l'écriture de <b>\"+tabEM[i][2]+\"</b>\";\r\n\t\t}\r\n\t}\r\n\treturn compo; \r\n}", "title": "" }, { "docid": "2cf505fa03148c8113042b2be994c300", "score": "0.5231851", "text": "function x( d ){ return d.anio; } // Devuelve el valor del año de un punto dado", "title": "" }, { "docid": "15e643f93a115c6f37044c113bb5aedc", "score": "0.5231181", "text": "function calcularNota( nota ) {\n\n let notaLetra = '';\n\n //Calificacion materia español alumnos\n\n if(nota >= 90){\n notaLetra = 'A';\n }else if(nota >= 80){\n notaLetra = 'B';\n }else if(nota >= 70){\n notaLetra = 'C';\n }else if(nota >= 60){\n notaLetra = 'D';\n }else{\n notaLetra = 'F';\n }\n\n console.log(nota + ' es igual a ' + notaLetra);\n\n}", "title": "" }, { "docid": "293243dbd1adebc942203af6f0ecefcd", "score": "0.5228969", "text": "function geraLinhas(){\n var vectorvalues = [];\n for (var i = 0; i < values.length; i++) {\n var aux = [];\n aux['estado'] = i;\n var first = 'a';\n var last = 'z';\n for (var j = first.charCodeAt(0); j <= last.charCodeAt(0); j++) {\n var letter = String.fromCharCode(j);\n if(typeof values[i][letter] === 'undefined'){\n aux[letter] = '-'\n } else {\n aux[letter] = values[i][letter]\n }\n }\n if(typeof values[i]['final'] !== 'undefined'){\n aux['final'] = true;\n }\n vectorvalues.push(aux);\n };\n return vectorvalues;\n}", "title": "" }, { "docid": "366f18e620046c54c52500749f2d0a74", "score": "0.5228188", "text": "function numberic_to_string(so)\n{\n var i;\n var j;\n var kq = \"\";\n var l;\n var dk;\n var tmp = \"\";\n var check = false;\n var a = new Array(32);\n\n //kiem tra kieu so\n //Loai het so 0 o dau\n while (so.length > 0 && so.charAt(0) == \"0\"){\n so = so.substring(1,so.length);\n }\n //alert(so);\n l = so.length;\n if (l > 28){\n return \"Số không hợp lệ\";\n }\n\n //Load cac chu so cua so can doc\n //vao mang a\n for (var i=1;i<=l;i++){\n a[i] = parseInt(so.charAt(i-1));\n }\n //Bat dau doc tu trai sang phai\n for (var i=1;i<=l;i++){\n\n if((l - i) % 3 == 2 && a[i] == 0 && (l - i >= 2)) {\n if (a[i + 1] != 0 || a[i + 2] != 0) {\n kq = kq + \"không \";\n }\n }\n\n if (a[i] == 2){\n kq = kq + \"hai \";\n }\n if (a[i] == 3){\n kq = kq + \"ba \";\n }\n if (a[i] == 6){\n kq = kq + \"sáu \";\n }\n if (a[i] == 7){\n kq = kq + \"bảy \";\n }\n if (a[i] == 8){\n kq = kq + \"tám \";\n }\n if (a[i] == 9){\n kq = kq + \"chín \";\n }\n\n\n //Xu ly cach doc so 4\n if (a[i] == 4) {\n if (i > 1 && (l - i) % 3 == 0){\n if (a[i - 1] > 1){\n kq = kq + \"tư \";\n }else{\n kq = kq + \"bốn \";\n }\n }else{\n kq = kq + \"bốn \";\n }\n } //a(i)=4\n\n //Xu ly cach doc so 5\n if (a[i] == 5){\n if (i > 1 && (l - i)% 3 == 0){\n if (a[i - 1] != 0 ){\n kq = kq + \"lăm \";\n }else{\n kq = kq + \"năm \";\n }\n }else{\n kq = kq + \"năm \";\n }\n } //a(i)=5\n\n //Xu ly cach doc so 1\n if (a[i] == 1) {\n //doc la muoi neu no la hang chuc\n if ((l - i) % 3 == 1) {\n kq = kq + \"mười \";\t//doc la mot neu la hang don vi\t//va hang chuc >1\n }else{\n if ((l - i) % 3 == 0 && (i > 1)){\n if (a[i - 1] > 1){\n kq = kq + \"mốt \";\n }else{\n kq = kq + \"một \";\n }\n }else{\n kq = kq + \"một \";\n }\n }\n } //a(i)=1\n\n\n //Doc tiep la muoi neu\n //No la so hang chuc va\n //Khac 1 va 0\n if ((l - i) % 3 == 1 && a[i] != 0 && a[i] != 1){\n kq = kq + \"mươi \";\n }\n\n if ((l - i) % 3 == 1 && a[i] == 0 && a[i + 1] != 0){\n kq = kq + \"linh \";\n }\n\n if ((l - i) % 3 == 2 && (a[i + 1] != 0 || a[i + 2] != 0)){\n kq = kq + \"trăm \";\n }\n\n if ((i + 2) <= l) {\n if (a[i] != 0 && (l - i) % 3 == 2){\n if (a[i + 1] == 0 && a[i + 2] == 0){\n kq = kq + \"trăm \";\n }\n }\n }\n\n if ((l - i) == 3){\n kq = kq + \"nghìn \";\n }\n if ((l - i) == 6){\n kq = kq + \"triệu \";\n }\n if ((l - i) == 9){\n kq = kq + \"tỷ \";\n }\n\n if ((l - i) == 12){\n check = true;\n for (j=i+1;i<l;i++){\n if (a[i + 1] != 0){\n check = false;\n }\n }\n if (check == false) {\n kq = kq + \"nghìn \";\n }else{\n kq = kq + \"nghìn tỷ \";\n }\n }\n\n if ((l - i) == 15){\n kq = kq + \"triệu tỷ \";\n }\n if ((l - i) == 18){\n kq = kq + \"tỷ tỷ \";\n }\n if ((l - i) == 21){\n kq = kq + \"nghìn tỷ tỷ \";\n }\n if ((l - i) == 24){\n kq = kq + \"triệu tỷ tỷ \";\n }\n if ((l - i) == 27){\n kq = kq + \"tỷ tỷ tỷ \";\n }\n if ((l - i) == 30){\n kq = kq + \"nghìn tỷ tỷ \";\n }\n\n //Xu ly bo 3 so khong\n if (((l - i) % 3 == 2) && (a[i] == 0) && (a[i + 1] == 0) && (a[i + 2] == 0)){\n i = i + 2;\n }\n\n //Xu ly tat ca so khong con lai\n if ((l - i) % 3 == 0){\n dk = 1;\n for (j=i+1;j<=l;j++){\n if (a[j] != 0){\n dk = 0;\n }\n }\n }\n if (dk == 1){\n break;\n }\n\n }\n\n //Viet hoa chu cai dau tien\n if (kq == \"\") kq = \"không\"\n while (kq.charAt(kq.length) == \",\"){\n kq = kq.substring(0,kq.length-1);\n }\n kq = kq.charAt(0).toUpperCase() + kq.substring(1,kq.length);\n return kq + \" đồng\";\n}", "title": "" }, { "docid": "810b6bdde11ae46a8abe68dc9808e91c", "score": "0.52280223", "text": "liikkumislogiikka_jahtaus(oma_x, oma_y, jahti_x, jahti_y){\n var jahdattavan_suhteellinen_suunta_x = jahti_x - oma_x;\n var jahdattavan_suhteellinen_suunta_y = jahti_y - oma_y;\n \n var suunta;\n if (Math.abs(jahdattavan_suhteellinen_suunta_x) <= Math.abs(jahdattavan_suhteellinen_suunta_y)) {\n if (jahdattavan_suhteellinen_suunta_y >= 0) {\n suunta = suunnat.ALAS;\n }\n else {\n suunta = suunnat.YLOS;\n }\n }\n else {\n if (jahdattavan_suhteellinen_suunta_x <= 0){\n if (oma_x - 1 >= this.alue_x1) {\n suunta = suunnat.VASEN;\n }\n else {\n suunta = suunnat.PAIKKA;\n }\n }\n else {\n if (oma_x + 1 <= this.alue_x2) {\n suunta = suunnat.OIKEA;\n }\n else {\n suunta = suunnat.PAIKKA;\n }\n }\n }\n \n return suunta;\n }", "title": "" }, { "docid": "ccaa8f625b7ddd948f321347cd46a68a", "score": "0.5227401", "text": "function aleatorios(limite = 1) {\n let r = []\n for (let i = 0; i < limite; i++) {\n r[i] = numeroAlAzar100()\n }\n\n return r\n \n }", "title": "" }, { "docid": "7c95cec09632e8414c7bf7a7ad09c7e0", "score": "0.52269", "text": "function retangulo(largura, altura) {\n for (i = 0; i < altura; i++) {\n var desenho = \"\";\n for (x = 0; x < largura; x++) {\n desenho += \"*\";\n }\n console.log(desenho);\n }\n}", "title": "" }, { "docid": "3d8a61daf199ab2416a967b51d42858e", "score": "0.5220099", "text": "function Puissance4(lig,col,l,c){\r\n //commencement de l'analyse\r\n console.log(\"Valeurs: \"+lig+\" \"+col+\" / Incrément \"+i+ \" \"+c);\r\n if(c == 0 && l == 0){\r\n //pour moi c'est inversé a verticale, b horizontal, c diag gauche et d diag droit\r\n // horizontalité\r\n var va = 1 +Puissance4(lig +1,col,1,0) + Puissance4(lig-1,col,-1,0);\r\n // verticalité\r\n var vb = 1 +Puissance4(lig,col+1,0,1) + Puissance4(lig,col-1,0,-1);\r\n // diagonale de droite\r\n var vc = 1 +Puissance4(lig+1,col+1,1,1) + Puissance4(lig-1,col-1,-1,-1); \r\n // diagonale de gauche\r\n var vd = 1 +Puissance4(lig-1,col+1,-1,1) + Puissance4(lig+1,col-1,1,-1);\r\n console.log(va,vb,vc,vd);\r\n if(va == 4 || vb == 4 || vc == 4 || vd == 4)return true;\r\n else return false; \r\n }\r\n //On vérifie que \"lig\" et \"col\" ne sortent pas du tableau \r\n if (lig<this.ligne && lig>=0 && col<this.colonne && col>=0){\r\n if(this.plateau[lig][col]==joueur){\r\n return 1+ Puissance4(lig + l, col + c, l, c);}\r\n else {return 0;}\r\n }\r\n else return 0;\r\n }", "title": "" }, { "docid": "a57e0750a72e86142e669c9cca980172", "score": "0.5219408", "text": "function dizerOla(nome) {\n console.log('Olá ' + nome);\n console.log(\"Ol\\u00E1 \" + nome); //interpolarização\n}", "title": "" }, { "docid": "588c946c33de6a362b1217213d4789fb", "score": "0.5218733", "text": "function detailMunicipio(){\n munD = '';\n if (map.getZoom() >= 14){\n\t var latDet = roundNumber(targetCoordMun.lat(),7); while (latDet.length != 10){latDet = latDet + \"0\" + \"\";}\n\t\tvar lngDet = roundNumber(targetCoordMun.lng(),7); while (lngDet.length != 10){lngDet = lngDet + \"0\" + \"\";}\n\t\t\n\t\tvar plesso = coordPless['\"'+lngDet+','+latDet+'\"'][0];\n\t\t\n\t for (var x in plesso){\n\t\t\tmunD = plesso[x][\"M\"];\n\n\t\t}\n }\n\n}", "title": "" }, { "docid": "c68512bc5177661cf90ebccdb43cd96f", "score": "0.5217921", "text": "function e(t,e,i,n){var r=t+\" \";switch(i){case\"s\":return e||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||n?\"sekundi\":\"sekundah\":t<5?e||n?\"sekunde\":\"sekundah\":\"sekund\",r;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===t?e?\"minuta\":\"minuto\":2===t?e||n?\"minuti\":\"minutama\":t<5?e||n?\"minute\":\"minutami\":e||n?\"minut\":\"minutami\",r;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===t?e?\"ura\":\"uro\":2===t?e||n?\"uri\":\"urama\":t<5?e||n?\"ure\":\"urami\":e||n?\"ur\":\"urami\",r;case\"d\":return e||n?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===t?e||n?\"dan\":\"dnem\":2===t?e||n?\"dni\":\"dnevoma\":e||n?\"dni\":\"dnevi\",r;case\"M\":return e||n?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===t?e||n?\"mesec\":\"mesecem\":2===t?e||n?\"meseca\":\"mesecema\":t<5?e||n?\"mesece\":\"meseci\":e||n?\"mesecev\":\"meseci\",r;case\"y\":return e||n?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===t?e||n?\"leto\":\"letom\":2===t?e||n?\"leti\":\"letoma\":t<5?e||n?\"leta\":\"leti\":e||n?\"let\":\"leti\",r}}", "title": "" }, { "docid": "0f9589f0a6c64b209c6cb250f797c3cf", "score": "0.521255", "text": "calcolaArea() {\n\n return (this.base * this.altezza) / 2; \n }", "title": "" }, { "docid": "0879c6bde3e93b9678ceca8d12f159d2", "score": "0.5206139", "text": "function pos_luna(njd){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2010.\n // funzione per il calcolo della posizione della Luna.\n // njd= numero dei giorni giuliani per il T.U. di Greenwich.\n // coordinate equatoriali geocentriche per l'equinozio della data.\n\nvar T=(njd-2415020.0)/36525;\n\nvar L1=270.434164+481267.8831*T-0.001133*T*T+0.0000019*T*T*T; // longitudine media.\n\nvar M=358.475833+35999.04975*T-0.000150*T*T-0.0000033*T+T*T; // anomalia media del Sole\n\nvar M1=296.104608+477198.8491*T+0.009192*T*T+0.0000144*T*T*T; // anomalia media della Luna\n\nvar D=350.737486+445267.1142*T-0.001436*T*T+0.0000019*T*T*T; // elongazione media della Luna\n\nvar F=11.250889+483202.0251*T-0.003211*T*T-0.0000003*T*T*T; // distanza media della Luna dal suo nodo ascendente.\n\nvar N=259.183275-1934.1420*T+0.002078*T*T+0.0000022*T*T*T; // longitudine media del nodo ascendente della Luna.\n\n// termini additivi di correzione.\n\nvar Delta=0.003964*Math.sin(Rad(346.560+132.870*T-0.0091731*T*T));\n\nL1=L1+0.000233*Math.sin(Rad(51.2+20.2*T))+Delta;\n M= M-0.001778*Math.sin(Rad(51.2+20.2*T));\nM1=M1+0.000817*Math.sin(Rad(51.2+20.2*T))+Delta;\n D= D+0.002011*Math.sin(Rad(51.2+20.2*T))+Delta;\n\nL1=L1+0.001964*Math.sin(Rad(N));\nM1=M1+0.002541*Math.sin(Rad(N));\n D= D+0.001964*Math.sin(Rad(N));\n F= F-0.024691*Math.sin(Rad(N));\n F= F-0.004328*Math.sin(Rad(N+275.05-2.30*T));\n F= F+Delta;\n\nvar e=1-0.002495*T-0.00000752*T*T;\n\n// Calcola la Longitudine ecclittica.\n\nvar Long=L1+6.288750*Math.sin(Rad(M1))\n +1.274018*Math.sin(Rad(2*D-M1))\n +0.658309*Math.sin(Rad(2*D))\n +0.213616*Math.sin(Rad(2*M1))\n -0.185596*Math.sin(Rad(M))*e\n -0.114336*Math.sin(Rad(2*F))\n +0.058793*Math.sin(Rad(2*D-2*M1))\n +0.057212*Math.sin(Rad(2*D-M-M1))*e\n +0.053320*Math.sin(Rad(2*D+M1))\n +0.045874*Math.sin(Rad(2*D-M))*e\n +0.041024*Math.sin(Rad(M1-M))*e\n -0.034718*Math.sin(Rad(D))\n -0.030465*Math.sin(Rad(M+M1))*e\n +0.015326*Math.sin(Rad(2*D-2*F))\n -0.012528*Math.sin(Rad(2*F+M1))\n -0.010980*Math.sin(Rad(2*F-M1))\n +0.010674*Math.sin(Rad(4*D-M1))\n +0.010034*Math.sin(Rad(3*M1))\n +0.008548*Math.sin(Rad(4*D-2*M1))\n -0.007910*Math.sin(Rad(M-M1+2*D))*e\n -0.006783*Math.sin(Rad(2*D+M))*e\n +0.005162*Math.sin(Rad(M1-D))\n -0.005000*Math.sin(Rad(M+D))*e\n +0.004049*Math.sin(Rad(M1-M+2*D))*e\n +0.003996*Math.sin(Rad(2*M1+2*D))\n +0.003862*Math.sin(Rad(4*D))\n +0.003665*Math.sin(Rad(2*D-3*M1))\n +0.002695*Math.sin(Rad(2*M1-M))*e\n +0.002602*Math.sin(Rad(M1-2*F-2*D))\n +0.002396*Math.sin(Rad(2*D-M-2*M1))*e\n -0.002349*Math.sin(Rad(M1+D))\n +0.002249*Math.sin(Rad(2*D-2*M))*e*e\n -0.002125*Math.sin(Rad(2*M1+M))*e \n -0.002079*Math.sin(Rad(2*M))*e*e \n +0.002059*Math.sin(Rad(2*D-M1-2*M))*e*e\n -0.001773*Math.sin(Rad(M1+2*D-2*F))\n -0.001595*Math.sin(Rad(2*F+2*D))\n +0.001220*Math.sin(Rad(4*D-M-M1))*e\n -0.001110*Math.sin(Rad(2*M1+2*F))\n +0.000892*Math.sin(Rad(M1-3*D))\n -0.000811*Math.sin(Rad(M+M1+2*D))*e\n +0.000761*Math.sin(Rad(4*D-M-2*M1))*e\n +0.000717*Math.sin(Rad(M1-2*M))*e*e\n +0.000704*Math.sin(Rad(M1-2*M-2*D))*e*e\n +0.000693*Math.sin(Rad(M-2*M1+2*D))*e\n +0.000598*Math.sin(Rad(2*D-M-2*F))*e\n +0.000550*Math.sin(Rad(M1+4*D))\n +0.000538*Math.sin(Rad(4*M1))\n +0.000521*Math.sin(Rad(4*D-M))*e\n +0.000486*Math.sin(Rad(2*M1-D));\n \n// Calcolo della Latitudine ecclittica.\n\nvar Beta= 5.128189*Math.sin(Rad(F))\n +0.280606*Math.sin(Rad(M1+F))\n +0.277693*Math.sin(Rad(M1-F))\n +0.173238*Math.sin(Rad(2*D-F))\n +0.055413*Math.sin(Rad(2*D+F-M1))\n +0.046272*Math.sin(Rad(2*D-F-M1))\n +0.032573*Math.sin(Rad(2*D+F))\n +0.017198*Math.sin(Rad(2*M1+F))\n +0.009267*Math.sin(Rad(2*D+M1-F))\n +0.008823*Math.sin(Rad(2*M1-F))\n +0.008247*Math.sin(Rad(2*D-M-F))*e\n +0.004323*Math.sin(Rad(2*D-F-2*M1))\n +0.004200*Math.sin(Rad(2*D+F+M1))\n +0.003372*Math.sin(Rad(F-M-2*D))*e\n +0.002472*Math.sin(Rad(2*D+F-M-M1))*e\n +0.002222*Math.sin(Rad(2*D+F-M))*e\n +0.002072*Math.sin(Rad(2*D-F-M-M1))*e\n +0.001877*Math.sin(Rad(F-M+M1))*e\n +0.001828*Math.sin(Rad(4*D-F-M1))\n -0.001803*Math.sin(Rad(F+M))*e\n -0.001750*Math.sin(Rad(3*F))\n +0.001570*Math.sin(Rad(M1-M-F))*e\n -0.001487*Math.sin(Rad(F+D))\n -0.001481*Math.sin(Rad(F+M+M1))*e\n +0.001417*Math.sin(Rad(F-M-M1))*e\n +0.001350*Math.sin(Rad(F-M))*e\n +0.001330*Math.sin(Rad(F-D))\n +0.001106*Math.sin(Rad(F+3*M1))\n +0.001020*Math.sin(Rad(4*D-F))\n +0.000833*Math.sin(Rad(F+4*D-M1))\n +0.000781*Math.sin(Rad(M1-3*F))\n +0.000670*Math.sin(Rad(F+4*D-2*M1))\n +0.000606*Math.sin(Rad(2*D-3*F))\n +0.000597*Math.sin(Rad(2*D+2*M1-F))\n +0.000492*Math.sin(Rad(2*D+M1-M-F))*e\n +0.000450*Math.sin(Rad(2*M1-F-2*D))\n +0.000439*Math.sin(Rad(3*M1-F))\n +0.000423*Math.sin(Rad(F+2*D+2*M1))\n +0.000422*Math.sin(Rad(2*D-F-3*M1))\n -0.000367*Math.sin(Rad(M+F+2*D-M1))*e\n -0.000353*Math.sin(Rad(M+F+2*D))*e\n +0.000331*Math.sin(Rad(F+4*D))\n +0.000317*Math.sin(Rad(2*D+F-M+M1))*e\n +0.000306*Math.sin(Rad(2*D-2*M-F))*e*e\n -0.000283*Math.sin(Rad(M1+3*F));\n\n var omega1=0.0004664*Math.cos(Rad(N));\n var omega2=0.0000754*Math.cos(Rad(N+275.05-2.30));\n\n var Lat=Beta*(1-omega1-omega2); // latitudine ecclittica.\n\n // Calcolo della parallasse.\n\n var parallasse=0.950724\n +0.051818*Math.cos(Rad(M1))\n +0.009531*Math.cos(Rad(2*D-M1))\n +0.007843*Math.cos(Rad(2*D))\n +0.002824*Math.cos(Rad(2*M1))\n +0.000857*Math.cos(Rad(2*D+M1))\n +0.000533*Math.cos(Rad(2*D-M))*e\n +0.000401*Math.cos(Rad(2*D-M-M1))*e\n +0.000320*Math.cos(Rad(M1-M))*e\n -0.000271*Math.cos(Rad(D))\n -0.000264*Math.cos(Rad(M1+M))*e\n -0.000198*Math.cos(Rad(2*F-M1))\n +0.000173*Math.cos(Rad(3*M1))\n +0.000167*Math.cos(Rad(4*D-M1))\n -0.000111*Math.cos(Rad(M))*e\n +0.000103*Math.cos(Rad(4*D-2*M1))\n -0.000084*Math.cos(Rad(2*M1-2*D))\n -0.000083*Math.cos(Rad(2*D+M))*e\n +0.000079*Math.cos(Rad(2*D+2*M1))\n +0.000072*Math.cos(Rad(4*D))\n +0.000064*Math.cos(Rad(2*D-M+M1))*e\n -0.000063*Math.cos(Rad(2*D+M-M1))*e\n +0.000041*Math.cos(Rad(M+D))*e\n +0.000035*Math.cos(Rad(2*M1-M))*e\n -0.000033*Math.cos(Rad(3*M1-2*D))\n -0.000030*Math.cos(Rad(M1+D))\n -0.000029*Math.cos(Rad(2*F-2*D))\n -0.000029*Math.cos(Rad(2*M1+M))*e\n +0.000026*Math.cos(Rad(2*D-2*M))*e*e\n -0.000023*Math.cos(Rad(2*F-2*D+M1))\n +0.000019*Math.cos(Rad(4*D-M-M1))*e;\n\n Long=gradi_360(Long); // La longitudine all'interno dell'intervallo 0-360.\n\n var dati_luna=trasf_ecli_equa(njd,Long,Lat); // calcola le coordinate equatoriali geocentriche.\n\n // dati del Sole.\n\n var dat_sole=pos_sole(njd); // calcola la longitudine del sole\n var Long_sole=dat_sole[2]; // longitudine vera del sole.\n \n // CALCOLO DELLA FASE E DELL'ELONGAZIONE\n\n var Elongazione=elong(dati_luna[0],dati_luna[1],dat_sole[0],dat_sole[1]); // elongazione in gradi dal Sole.\n\n var Fase_luna=0.5*(1-Math.cos(Rad(Elongazione))); // FASE\n \n var dist_luna=6378.14/Math.sin(Rad(parallasse));\n dist_luna=dist_luna.toFixed(0); // Distanza in Km.\n\n var dim_app=Math.atan(3476.2/dist_luna); \n dim_app=Rda(dim_app)*3600;\n dim_app=dim_app.toFixed(2); // Diametro apparente in secondi d'arco.\n\n // elenco delle variabili restituite dalla funzione [pos_luna].\n\n // dati_luna[0]= ascensione retta già in ore decimali (diviso per 15).\n // dati_luna[1]= declinazione in gradi sessadecimali.\n dati_luna[2]= Long; // in gradi sessadecimali.\n dati_luna[3]= Fase_luna; // fase lunare.\n dati_luna[4]= Elongazione; // elongazione in gradi sessadecimali.\n dati_luna[5]= parallasse; // parallasse della Luna in gradi. \n dati_luna[6]= dim_app; // diametro apparente in secondi d'arco.\n dati_luna[7]= dist_luna; // distanza della Luna in Km. \n\n return dati_luna;\n\n}", "title": "" }, { "docid": "f687c92b0c2e6f6982085d054e47d5ee", "score": "0.520185", "text": "function ci(e,t,n,a){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[e+\" sekondamni\",e+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[e+\" mintamni\",e+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[e+\" voramni\",e+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disamni\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineamni\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsamni\",e+\" vorsam\"]};return a?i[n][0]:i[n][1]}", "title": "" }, { "docid": "1039372b4393734756221c70263214d9", "score": "0.5200133", "text": "function calcola_jd_anno(anno){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // funzione uguale alla precedente ma il calcolo viene effettuato per lo 0.0 gennaio dell'anno indicato dal parametro (anno).\n\n var mese =1; // mese = 1\n var giorno=0.0; // numero del giorno 0.0\n\n\nvar dataGiuliana=costanti_jd(giorno,mese,anno,0,0,0); // valore del giorno giuliano per lo 0.0 gennaio dell'anno specificato.\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n\nreturn dataGiuliana;\n\n}", "title": "" }, { "docid": "babfe90f101ea82bbef9aed14f01bea3", "score": "0.5197444", "text": "function calculocompraslocales(cant,costo)\n{\n var ret; \n var pu//preciounitario\n pu=costo/cant;// calculamos el costo unitario \n //if($(\"#nfact_imp\").val()!=\"SF\") //si tiene el texto SF es sin factura \n // ret=pu*glob_factorIVA; //confactura\n //else \n // ret=pu*glob_factorRET+pu; //sinfactura \n // return ret;\n\n}", "title": "" }, { "docid": "1bbf33a822beca06b0502607ba34721c", "score": "0.51946014", "text": "function wartosc_tabela(wiersz, kolumna, nr_bierki)\n{\n let czy_biale = nr_bierki < 7;\n let nr = nr_bierki - (czy_biale ? 1 : 7);\n let poz_w_tablicy = kolumna + 8 * (!czy_biale ? wiersz: 7 - wiersz);\n\n return tabele[nr][poz_w_tablicy] * (czy_biale ? 1 : -1);\n}", "title": "" }, { "docid": "de2c1a006c4e95023c3ed59966e1d2e8", "score": "0.5194268", "text": "function effemeridi_sole(TEMPO_RIF,LAT,LON,ALT,ITERAZIONI,LAN){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) Ottobre 2011.\n // funzione per il calcolo delle effemeridi del Sole.\n\n // Parametri utilizzati\n \n // TEMPO_RIF= \"TL\" o \"TU\" tempo locale o tempo universale.\n // LAT= latitudine in gradi sessadecimali.\n // LON= longtudine in gradi sessadecimali.\n // ALT= altitudine in metri.\n // ITERAZIONE =numero di ripetizioni del calcolo.\n // LAN=\"EN\" versione in inglese.\n \n \nvar njd=calcola_jdUT0(); // numero del giorno giuliano all'ora 0 di oggi.\n\n njd=njd+0.00078; // correzione per il Terrestrial Time.\n \nvar data_ins=0; // data\nvar data_inser=0; // data\n\nvar numero_iterazioni=ITERAZIONI;\n\nvar effe_sole=0;\nvar ar_sole=0;\nvar de_sole=0;\nvar classetab=\"colore_tabellaef1\";\nvar crep=0; // crepuscolo astronomico.\nvar coo_app=0; // coordinate equatoriali apparenti.\nvar costl=\"\"; // costellazione.\nvar t_locale=0;\n\n var effe1=0;\n\n\n document.write(\"<table width=100% class='.table_effemeridi'>\");\n document.write(\" <tr>\");\n\n // versione in italiano.\n\n if (LAN!=\"EN\") // diverso da EN\n {\n document.write(\" <td class='colore_tabella'>Data:</td>\");\n document.write(\" <td class='colore_tabella'>Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Culmina:</td>\");\n document.write(\" <td class='colore_tabella'>Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Tram.:</td>\");\n document.write(\" <td class='colore_tabella'>Ascensione Retta:</td>\");\n document.write(\" <td class='colore_tabella'>Declinazione:</td>\");\n document.write(\" <td class='colore_tabella'>Inizio Crep.:</td>\");\n document.write(\" <td class='colore_tabella'>Fine Crep.:</td>\");\n document.write(\" <td class='colore_tabella'>Cost.:</td>\");\n }\n\n // versione in inglese.\n\nif (LAN==\"EN\")\n {\n document.write(\" <td class='colore_tabella'>Date:</td>\");\n document.write(\" <td class='colore_tabella'>Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Transit:</td>\");\n document.write(\" <td class='colore_tabella'>Set:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Set.:</td>\");\n document.write(\" <td class='colore_tabella'>Right Ascension:</td>\");\n document.write(\" <td class='colore_tabella'>Declination:</td>\");\n document.write(\" <td class='colore_tabella'>Beg. Twilight:</td>\");\n document.write(\" <td class='colore_tabella'>End. Twilight:</td>\");\n document.write(\" <td class='colore_tabella'>Const.:</td>\");\n\n }\n\n document.write(\" </tr>\");\n\n njd=njd-1;\n\n for (b=0; b<numero_iterazioni; b++){\n njd=njd+1;\n effe1=ST_SOLE_LUNA(njd,TEMPO_RIF,\"S\",LON,LAT,ALT,0.25);\n \n effe_sole=pos_sole(njd);\n\n coo_app=pos_app(njd,effe_sole[0],effe_sole[1]) // coordinate apparenti.\n\n ar_sole= sc_ore(coo_app[0]); // ascensione retta.\n de_sole=sc_angolo(coo_app[1]); // declinazione.\n\n\n \n crep=crepuscolo(njd,TEMPO_RIF,LON,LAT,ALT);\n\n \n data_ins=jd_data(njd);\n\n if (LAN!=\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\" : \"+Lnum(parseInt(data_ins[1]),2)+\"| \"+data_ins[3];} // versione in italiano.\n if (LAN==\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\" : \"+Lnum(parseInt(data_ins[1]),2)+\"| \"+data_ins[4];} // versione in inglese.\n\n costl=costell(coo_app[0]); // costellazione. \n\n if (b%2==0){classetab=\"colore_tabellaef2\"; }\n\n else {classetab=\"colore_tabellaef1\";}\n\n\n document.write(\" <tr>\");\n document.write(\" <td class='\"+classetab+\"'>\"+data_inser+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[2]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[3]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[4]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[0]+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[1]+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+ar_sole+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+de_sole+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+crep[0]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+crep[1]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+costl+\"</td>\");\n\n document.write(\" </tr>\");\n\n }\n document.write(\" </table>\");\n\n\n\n}", "title": "" }, { "docid": "a070167a115d9e3fd0595b01202f9970", "score": "0.5192508", "text": "function calcTabuada(numero) {\n console.log(\"===========================\");\n if (isNaN(numero)) { //tratamento para o input, se for NaN, o código nao executará\n console.log(\"ERRO! Por favor, digite apenas números inteiros.\");\n } else {\n for (numeroEscolhido = 1; numeroEscolhido <= numero; numeroEscolhido++) {\n console.log(`A tabuada do número ${numeroEscolhido} é: `);\n\n for (index = 1; index <= 10; index++) {\n\n console.log(`${index} * ${numeroEscolhido} é igual a: ${index*numeroEscolhido}`);\n }\n\n console.log(\"===========================\");\n }\n }\n}", "title": "" }, { "docid": "fe22df8b85a37faca714aedccefe8fb0", "score": "0.5190532", "text": "function e(t,e,n,i){var r=t+\" \";switch(n){case\"s\":return e||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||i?\"sekundi\":\"sekundah\":t<5?e||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===t?e?\"minuta\":\"minuto\":2===t?e||i?\"minuti\":\"minutama\":t<5?e||i?\"minute\":\"minutami\":e||i?\"minut\":\"minutami\";case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===t?e?\"ura\":\"uro\":2===t?e||i?\"uri\":\"urama\":t<5?e||i?\"ure\":\"urami\":e||i?\"ur\":\"urami\";case\"d\":return e||i?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===t?e||i?\"dan\":\"dnem\":2===t?e||i?\"dni\":\"dnevoma\":e||i?\"dni\":\"dnevi\";case\"M\":return e||i?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===t?e||i?\"mesec\":\"mesecem\":2===t?e||i?\"meseca\":\"mesecema\":t<5?e||i?\"mesece\":\"meseci\":e||i?\"mesecev\":\"meseci\";case\"y\":return e||i?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===t?e||i?\"leto\":\"letom\":2===t?e||i?\"leti\":\"letoma\":t<5?e||i?\"leta\":\"leti\":e||i?\"let\":\"leti\"}}", "title": "" } ]
2c1391ca19883f7cc99492d0de9b23a6
RUN ALL SLIDES /MASTERTIMELINE
[ { "docid": "75905673d640a71dd5ed111a6013ecee", "score": "0.0", "text": "function runResumeSlides(index) {\n const masterTimeline = gsap.timeline();\n\n const slide1In = createTimelineIn(index);\n const slide1Out = createTimelineOut(index);\n const slide2In = createTimelineIn(index + 1);\n\n masterTimeline.add(slide1In).add(slide1Out, \"+=2\").add(slide2In);\n }", "title": "" } ]
[ { "docid": "a9ab7ec7c8b39612ccb2db75df7d08c4", "score": "0.5705428", "text": "function launchTimeline() {\n $().timeline();\n\t}", "title": "" }, { "docid": "459fa2b7edc336a3ee2c3ecf02c3876c", "score": "0.56550145", "text": "function run(){\n\tactiveTimer=true;\n\tclearTimer();\n\tstartDate = new Date();\n\tlapDate = startDate;\n\trecursiveTimer();\n}", "title": "" }, { "docid": "78a14f9fe91c2e6914319bbb87657e80", "score": "0.5535766", "text": "function run() {\n initNextLaunchMap();\n initUpcomingCountdown();\n initExpandCollapse();\n initLaunches();\n initLoadButtons();\n convertCurrentTimeToUsersTime();\n setInterval(tickClock, 1000);\n}", "title": "" }, { "docid": "cad0ae6673ed32e59f3cbf7d271b5323", "score": "0.53362525", "text": "function spectro(){\n document.getElementById('instr').innerHTML = \"Click start to run the spectrometer.\"\n $('#machine').show();\n setTimeout(spectro1,3600);\n}", "title": "" }, { "docid": "4d8e7f9fa8f0d859c168e50a719fd649", "score": "0.52180874", "text": "function startPhase1() {\n\t\t$(\".bottom_UI > .clock\").show();\n\t\t// $(\"button.next_stage\").show();\n\t\topeningPhase1 = new Date().getTime();\n\t\tupdateClock(openingPhase1, 15, $(\".bottom_UI\").find(\".clock\"));\n \tint_clock1 = setInterval(function() {updateClock(openingPhase1, 15, $(\".bottom_UI\").find(\".clock\")); }, 1000); \n\t}", "title": "" }, { "docid": "955707cc3db96f994b30cec65ef73636", "score": "0.52106965", "text": "function runOnTreadmill() {\n\n}", "title": "" }, { "docid": "8c7325628f7b9710c36d169467937d8b", "score": "0.51916724", "text": "function C007_LunchBreak_Sarah_Run() {\n\tBuildInteraction(C007_LunchBreak_Sarah_CurrentStage);\n}", "title": "" }, { "docid": "1f8a32a4c915e9bc81a2be38944babe1", "score": "0.5190259", "text": "launchHelp() {\n TimeHelpUI.launchTimeHelp();\n }", "title": "" }, { "docid": "e0780712cba5c4cf2d28a5525ee374f5", "score": "0.5183197", "text": "function startclock()\n{\n\tshowtime();\n}", "title": "" }, { "docid": "377a6b3f3651d458f0edb5fe04c7a65a", "score": "0.5147543", "text": "function start() {\n console.log('Connected to DB, starting scheduler');\n // every 5 minutes\n schedule.scheduleJob('0,5,10,15,20,25,30,35,40,45,50,55 * * * *', require('./jobs/scrape-comments'));\n // every 5 minutes\n schedule.scheduleJob('1,6,11,16,21,26,31,36,41,46,51,56 * * * *', require('./jobs/populate-sales-details'));\n // every 5 minutes\n schedule.scheduleJob('2,7,12,17,22,27,32,37,42,47,52,57 * * * *', require('./jobs/extract-details'));\n // every 5 minutes\n //schedule.scheduleJob('4,9,14,19,24,29,34,39,44,49,55,59 * * * *', require('./jobs/temp-send-csv'));\n schedule.scheduleJob('4,9,14,19,24,29,34,39,44,49,55,59 * * * *', require('./jobs/create-streak-boxes'));\n}", "title": "" }, { "docid": "30cfdf159eae4c0a8b1604e9c1b1e565", "score": "0.51430815", "text": "function main() {\n\n\tconsole.time('main');\n\n\tformatAllDropdown(sensor_setup);\n\n\txmlGetData(dir + '_data/' + dataFiles['1d'], sensor_setup, sidebarData, []);\n\n\tdisplayCharts('1d');\n\n\tconsole.timeEnd('main');\n}", "title": "" }, { "docid": "045058a597417d184be3517b35850e0e", "score": "0.5129275", "text": "function startScript(){\r\n\thideSliders();\r\n\treverseMain();\r\n\t\r\n}", "title": "" }, { "docid": "a40430c3b0051b81eda47c68f76b4e48", "score": "0.5116233", "text": "function fn_loadschedule()\n{\t\n\tclosefullscreenlesson(); // its used for close the fullscreen of the test page\n\tsetTimeout(\"removesections('#home');\",500);\n\tsetTimeout('showpages(\"assignment\",\"assignment/assignment.php\");',500);\n}", "title": "" }, { "docid": "7f84045da9fa0178085daf273578b613", "score": "0.50837153", "text": "function python_trifecta_standings() {\n\tvar options = {\n\t\targs: [year1, year2, this_football_season_started, this_basketball_season_started, this_baseball_season_started]\n\t}\n\n\t// always run trifecta standings python script\n\tpyshell.run('python/trifecta_standings.py', options, function(err) {\n\t\tif (err) throw err;\n\t\tconsole.log(\"trifecta standings python script complete\");\n\n\t\tdisplay_trifecta_standings();\n\t});\t\n\n} // end of python_trifecta_standings function", "title": "" }, { "docid": "9fdf67b0170f044ccd8c4c8ebace5b82", "score": "0.50783235", "text": "startTimer() {\n let selectionId = this.state.selectStory\n , lastTimer = this.stopTimer();\n // if the stopped timer equals this list item index, don't restart\n if(lastTimer === selectionId) return;\n \n let target = store.getById(selectionId);\n if(target) {\n Actions.startTimer(selectionId);\n // set the menu label to the current project name\n quark.setLabel(target.get('project'));\n // keep the overlay open for a few ms after starting to show change\n setTimeout(()=> { quark.closePopup() }, 300);\n }\n }", "title": "" }, { "docid": "5954cce150cdea094dab514de1b64e5d", "score": "0.50768065", "text": "function runAll() {\n var main = document.getElementById('app');\n main.className = 'running runall app';\n var response = document.getElementById('response');\n response.innerHTML = '';\n var verbose = document.params.verbose.checked ? '/verbose' : '';\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open('GET', '/run/all' + verbose, true);\n xmlhttp.responseType = 'text';\n xmlhttp.onload = function () { // jscs:ignore jsDoc\n document.location.reload();\n };\n xmlhttp.onreadystatechange = function () { // jscs:ignore jsDoc\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n response.innerHTML = xmlhttp.responseText;\n if (xmlhttp.responseText.indexOf('starting') != 0) {\n main.className = 'app';\n }\n }\n };\n xmlhttp.send();\n}", "title": "" }, { "docid": "a2dcbaa46b0ec48a27ad5ee7ced7ade6", "score": "0.5034587", "text": "function atStart() {\n //setstart on time\n console.log(\"start\")\n }", "title": "" }, { "docid": "6705316e0bb02c048393870a0f2be699", "score": "0.5020223", "text": "function schedule() : void {\n this.currentTcb = this.list;\n while (this.currentTcb != null) {\n if (this.currentTcb.isHeldOrSuspended()) {\n this.currentTcb = this.currentTcb.link;\n } else {\n this.currentId = this.currentTcb.id;\n this.currentTcb = this.currentTcb.run();\n }\n }\n }", "title": "" }, { "docid": "12d83919240f2710150d0a919df580f3", "score": "0.5009898", "text": "function run(){\n\tevent_manager.raiseScriptEvent(timeline.getTime(), 0, s.getGUID());\n}", "title": "" }, { "docid": "1b15124217979f22539fad706d9c96ae", "score": "0.4993374", "text": "function startDrumMachine() {\n // check if context is in suspended state (autoplay policy)\n if (audioCtx.state === 'suspended') {\n audioCtx.resume();\n }\n\n currentNote = 0;\n nextNoteTime = audioCtx.currentTime;\n scheduler(); // kick off scheduling notes\n dispatch(setTimerID(setInterval(() => scheduler(), lookahead)))\n }", "title": "" }, { "docid": "c2f1aabe24eca04e2199d43efc26f40a", "score": "0.4989483", "text": "function startCron() {\n\n\n\n\n}", "title": "" }, { "docid": "60eb00d509688fcc09f52139b3c85565", "score": "0.4978286", "text": "static get schedule () {\n return '*/1 * * * *'\n }", "title": "" }, { "docid": "32d516163feed1044e18055a719e6ccf", "score": "0.49565944", "text": "function runSequencer() {\n\t\tvar ticks = 0,\n\t\ttimeline = {},\n\t\ttimelineID = 0,\n\t\ttimelineStopped = false,\n\n\t\trollingTime = 0,\n\n\t\ttA = get(\"textContent\"),\n\t\tt1 = get(\"c1\"),\n\t\tt2 = get(\"c2\"),\n\t\tt3 = get(\"c3\"),\n\t\tt4 = get(\"c4\"),\n\t\tobjs = [get(\"sp-bag\"), // 0\n\t\t\t\tget(\"sp-battery\"), // 1\n\t\t\t\tget(\"sp-camera\"), // 2\n\t\t\t\tget(\"sp-cards\"), // 3\n\t\t\t\tget(\"sp-coin1\"), // 4\n\t\t\t\tget(\"sp-coin2\"), // 5\n\t\t\t\tget(\"sp-coin3\"), // 6\n\t\t\t\tget(\"sp-coin4\"), // 7\n\t\t\t\tget(\"sp-cookie\"), // 8\n\t\t\t\tget(\"sp-diary\"), // 9\n\t\t\t\tget(\"sp-glasses\"), // 10\n\t\t\t\tget(\"sp-pen\"), // 11\n\t\t\t\tget(\"sp-phone\"), // 12\n\t\t\t\tget(\"sp-photos\"), // 13\n\t\t\t\tget(\"sp-plane\"), // 14\n\t\t\t\tget(\"sp-prints\"), // 15\n\t\t\t\tget(\"sp-sim\")]; // 16\n\n\n function buildTimeline(){\n\n\t\t\taddToTimeline(\t{id:t1, time:rollingTime+=.1, duration:.5, props:{alpha:1}} );\n\n\t\t\taddToTimeline(\t{id:objs[2], time:rollingTime+=.5, duration:.8, from:true, props:{x:-30, y:300, scaleX:3.5, scaleY:3.5, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[2], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[15], time:rollingTime+=.7, duration:.6, from:true, props:{y:-124, ease:easeOutSine}} );\n\t\t\taddToTimeline(\t{id:objs[15], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[9], time:rollingTime, duration:.6, from:true, props:{y:133, ease:easeOutSine}} );\n\t\t\taddToTimeline(\t{id:objs[9], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[12], time:rollingTime+=.2, duration:.9, from:true, props:{y:340, scaleX:3, scaleY:3, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[12], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[16], time:rollingTime+=.4, duration:.7, from:true, props:{y:300, scaleX:3, scaleY:3, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[16], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[0], time:rollingTime, duration:.8, from:true, props:{x:-102, y:10, rotation:-10}} );\n\t\t\taddToTimeline(\t{id:objs[0], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[8], time:rollingTime+=.2, duration:.4, from:true, props:{y:-300, scaleX:3.5, scaleY:3.5, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[8], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[3], time:rollingTime+=.1, duration:.8, from:true, props:{x:85}} );\n\t\t\taddToTimeline(\t{id:objs[3], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[11], time:rollingTime, duration:.5, from:true, props:{y:-105, scaleX:2.5, scaleY:2.5, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[11], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[1], time:rollingTime+=.3, duration:.5, from:true, props:{y:100, scaleX:2.5, scaleY:2.5, rotation:-30, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[1], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[5], time:rollingTime, duration:.5, from:true, props:{x:-30, y:-120, scaleX:3.5, scaleY:3.5, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[5], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[7], time:rollingTime+=.1, duration:.5, from:true, props:{x:30, y:-120, scaleX:3.5, scaleY:3.5, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[7], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[4], time:rollingTime+=.1, duration:.4, from:true, props:{x:-20, y:-50, scaleX:3.5, scaleY:3.5, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[4], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[6], time:rollingTime+=.1, duration:.4, from:true, props:{x:20, y:-50, scaleX:3.5, scaleY:3.5, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[6], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[14], time:rollingTime, duration:.6, from:true, props:{y:-68, rotation:30, ease:easeOutSine}} );\n\t\t\taddToTimeline(\t{id:objs[14], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[13], time:rollingTime+=.1, duration:.8, from:true, props:{x:208}} );\n\t\t\taddToTimeline(\t{id:objs[13], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:objs[10], time:rollingTime, duration:.7, from:true, props:{x:20, y:200, scaleX:2.5, scaleY:2.5, rotation:-30, ease:easeInSine}} );\n\t\t\taddToTimeline(\t{id:objs[10], time:rollingTime, duration:.1, from:true, props:{alpha:0}} );\n\n\n\t\t\taddToTimeline(\t{id:t1, time:rollingTime+=1.2, duration:.75, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:t2, time:rollingTime+=.9, duration:.75, props:{alpha:1}} );\n\n\t\t\taddToTimeline(\t{id:t2, time:rollingTime+=4, duration:.5, props:{alpha:0}} );\n\n\t\t\taddToTimeline(\t{id:t3, time:rollingTime+=.4, duration:.75, props:{alpha:1}} );\n\n\t\t\taddToTimeline(\t{id:t4, time:rollingTime+=.75, duration:.75, props:{alpha:1}} );\n\n\t\t}\n\n\t\tfunction runTimeline(){\n\t\t\tvar key, i, obj, elements, tempElement, el;\n\t\t\tfor(key in timeline){\n\t\t\t\tobj = timeline[key];\n\t\t\t\tif(obj.inQ && ticks >= obj.time && !timelineStopped)\n\t\t\t\t{\n\t\t\t\t\telements=[].concat(obj.id);\n\t\t\t\t\tfor(i=0; i<elements.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\ttempElement = elements[i],\n\t\t\t\t\t\tel = typeof tempElement === 'string' ? get(tempElement) : tempElement;\n\t\t\t\t\t\tshowElement(el);\n\t\t\t\t\t\tobj.from ? TweenLite.from(el, obj.duration, obj.props) : TweenLite.to(el, obj.duration, obj.props);\n\t\t\t\t\t\tobj.inQ = false;\n\n\t\t\t\t\t\tif(obj.stopHere === true) timelineStopped = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tticks += 1/60; // Running at 60fps, convert to seconds(-ish)\n\t\t}\n\n\t\tfunction addToTimeline(obj){\n\t\t\tobj.inQ = true;\n\t\t\tobj.timelineID = timelineID++;\n\t\t\ttimeline[obj.timelineID] = obj;\n\t\t}\n\n\t\t/* Set display property for (array of) DOM element(s) to none */\n\t\tfunction hideElement(el){\n\t\t\tvar t=[].concat(el);\n\t\t\tfor(var l=0;l<t.length;l++)\n\t\t\t\tt[l].style.display=\"none\";\n\t\t}\n\n\t\t/* Set display property for (array of) DOM element(s) to block */\n\t\tfunction showElement(el){\n\t\t\tvar t=[].concat(el);\n\t\t\tfor(var l=0;l<t.length;l++)\n\t\t\t\tt[l].style.display=\"block\";\n\t\t}\n\n\t\tfunction animate(){\n\t \trunTimeline();\n\t\t\trequestAnimFrame(animate);\n\t }\n\n\t\tbuildTimeline();\n\t var delay = setTimeout(animate, 10);\n }", "title": "" }, { "docid": "7f94378c7ba789360e3bf50b9624724e", "score": "0.49466842", "text": "function workstationRunning() {\n context.log(\"Workstation is now running\");\n}", "title": "" }, { "docid": "699d6ce27aba07258bb3703f06dba358", "score": "0.49435645", "text": "function execute(target){\n \n action=target.id;\n var stopWatchId=target.parentNode.parentNode.id ;\n var display= document.getElementById(stopWatchId).firstElementChild ; //the display box of the stop-watch\n for(var j=0;j<arraySW.length;j++){\n if(j==stopWatchId){ \n arraySW[j].perform(action,display,this);\n }\n }\n }", "title": "" }, { "docid": "4bcdd02b6d5f53e617d7e9a3a9fc8c89", "score": "0.4935009", "text": "function robotSchedules() {\n // update: The settlement robot calls this function daily to update the capital pool and settle the pending refund.\n schedule.scheduleJob('*/10 * * * * *', () => {\n startJacksPot();\n });\n\n schedule.scheduleJob('*/20 * * * * *', async () => {\n startWandora();\n });\n}", "title": "" }, { "docid": "13302d27006f1708b978d6b6ccb6ea85", "score": "0.4932554", "text": "function start() {\n logger.info('Sync for evenbrite initiated ==> ' + config.evenbrite.cronExpression);\n job = schedule.scheduleJob(config.evenbrite.cronExpression, () => {\n sync();\n })\n }", "title": "" }, { "docid": "0da76c0a6237bba8b6aa206916c27dc3", "score": "0.49118808", "text": "function run()\n {\n if (!this.elContainer)\n this.init();\n var __nixieClock = this;\n window.setInterval(function() { __nixieClock.showCurrentTime(true); }, 100);\n }", "title": "" }, { "docid": "759de772363e62bf0b9f17dbf84862ab", "score": "0.49058357", "text": "function startWarmUp(currentRunTimes) {\n // Show the stop watch which also hides the exercise menu\n openStopWatch();\n // Start the warm up\n showStopwatch = true;\n restartStopWatch(warmUpTime, warmUpMessage);\n // Start the timer\n currentTimer = new Timer(function(){ \n runProcess(currentRunTimes, currentRunTimes.repeat)\n }, currentCountDown)\n currentTimer.resume();\n}", "title": "" }, { "docid": "c5b1013928d48f9cb22d18a9a86c7541", "score": "0.49041286", "text": "function run() {\n if (config.recordRunTime) {\n console.time('Boggle setup');\n\n setup()\n .then(printBoard)\n .then(console.timeEnd.bind(console, 'Boggle setup'))\n .then(console.time.bind(console, 'Boggle solution'))\n .then(findAllSolutions)\n .then(printSolutions)\n .then(console.timeEnd.bind(console, 'Boggle solution'))\n .catch(console.error.bind(console));\n } else {\n setup()\n .then(findAllSolutions)\n .then(printSolutions)\n .catch(console.error.bind(console));\n }\n}", "title": "" }, { "docid": "ce882efd263e1f8c50f3ec23859b21c3", "score": "0.49006715", "text": "function setUpTimeLineView(){\n generalEqInfo.timeInterval = generalEqInfo.maxLongTime - generalEqInfo.minLongTime;\n resetLastPoint();\n closeInfoBox();\n sortByDate(earthquakes);\n setTotalTime();\n var daysPerSeconds = getDaysPerSeconds();\n setupPlayer(generalEqInfo.minLongTime, generalEqInfo.maxLongTime, totalTime, daysPerSeconds);\n setTimeSliderValue(generalEqInfo.minLongTime, 0);\n}", "title": "" }, { "docid": "1c456aece71fcfcb4ecef25920934ffb", "score": "0.48820552", "text": "function init_machines(curr_time){\n\tfor(i=1;i<9;i++){\n\t\ttimers.push([\"washer\"+i,curr_time])\n\t}\n}", "title": "" }, { "docid": "c2d1c1ad149fde92187eab0c706450c2", "score": "0.48813805", "text": "function tick() {\r\n console.log(\"tick\");\r\n buildSnake();\r\n}", "title": "" }, { "docid": "be8a2a55bd025623baf22840bcde6fec", "score": "0.4871522", "text": "playScheduler() {\n this.deselect();\n this.scheduler.play();\n }", "title": "" }, { "docid": "e31e41e07606bada75b4b0a988a295e6", "score": "0.48713732", "text": "function startTDCalc() {\n buildSpire();\n loadLoadout();\n}", "title": "" }, { "docid": "7f34ab15b4c28e1e80b58aac70286186", "score": "0.48632395", "text": "function run(){\n\t\t\n\t\t//show tiles\n\t\tg_objWrapper.children(\".ug-tile\").show();\n\t\t\n\t\tg_objTileDesign.run();\n\t\t\t\t\n\t\tswitch(g_options.tiles_type){\n\t\t\tdefault:\n\t\t\tcase \"columns\":\n\t\t\t\trunColumnsType();\n\t\t\tbreak;\n\t\t\tcase \"justified\":\n\t\t\t\trunJustifiedType();\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif(g_temp.isFirstTimeRun == true){\n\t\t\tinitEvents();\n\t\t}\n\t\t\n\t\tg_temp.isFirstTimeRun = false;\n\t}", "title": "" }, { "docid": "e885480916698355e57744ef46c2a0fb", "score": "0.48603362", "text": "function mainScript(){\n\t//allow me to play\n\t/*brainTrain();\n\tmlTrain();\n\tnodeMindTrain();\n\tconvnetJSTrain();*/\n\t\n\t//synapticTrain(); //very slow compared to the others\n\n\t//ml_km_Train();\n\tml_lr_Train();\n}", "title": "" }, { "docid": "34a0f383b0596ec2259bf7c18a2d2a68", "score": "0.48591518", "text": "onTtsStart() {}", "title": "" }, { "docid": "d4b85cc05c20a6537af3dbcb17c0b02f", "score": "0.48489973", "text": "function activateScheduler(scheduler) {\n\tconsole.log(colors.blue(\"ENGINE: Activating scheduler \\\"\" + scheduler.name + \"\\\"\"));\n\n\tconst thisIntervalID = intervalIDcounter;\n\tintervalIDcounter++;\n\n\tvar show;\n\tfs.readFile('./shows/' + scheduler.showFileName, function(err, data) {\n\t\tif (err) {\n\t\t\tif (err.errno == -2) {\n\t\t\t\tconsole.log(colors.error(\"ENGINE ERROR: Scheduler contains reference to non existent show (\" + scheduler.name + \")\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tshow = JSON.parse(String(data));\n\t\tshow.frames = JSON.parse(show.frames);\n\n\n\t\tvar startHour = scheduler.startTime.substring(0, 2);\n\t\tvar startMinute = scheduler.startTime.substring(3, 5);\n\t\tif (scheduler.startTime == \"sunrise\") {\n\t\t\tvar sunrise = sun(parseFloat(coordinates[0]), parseFloat(coordinates[1])).rise;\n\t\t\tstartHour = sunrise.substring(0, 2);\n\t\t\tstartMinute = sunrise.substring(3, 5);\n\t\t} else if (scheduler.startTime == \"sunset\") {\n\t\t\tvar sunset = sun(parseFloat(coordinates[0]), parseFloat(coordinates[1])).set;\n\t\t\tstartHour = sunset.substring(0, 2);\n\t\t\tstartMinute = sunset.substring(3, 5);\n\t\t}\n\n\t\tvar endHour = scheduler.endTime.substring(0, 2);\n\t\tvar endMinute = scheduler.endTime.substring(3, 5);\n\t\tif (scheduler.endTime == \"sunrise\") {\n\t\t\tvar sunrise = sun(parseFloat(coordinates[0]), parseFloat(coordinates[1])).rise;\n\t\t\tendHour = sunrise.substring(0, 2);\n\t\t\tendMinute = sunrise.substring(3, 5);\n\t\t} else if (scheduler.endTime == \"sunset\") {\n\t\t\tvar sunset = sun(parseFloat(coordinates[0]), parseFloat(coordinates[1])).set;\n\t\t\tendHour = sunset.substring(0, 2);\n\t\t\tendMinute = sunset.substring(3, 5);\n\t\t}\n\n\n\n\t\tvar dayOfWeek = '*';\n\t\tvar month = '*';\n\t\tvar dayOfMonth = '*';\n\t\tif (scheduler.frequency == 'Daily') {\n\t\t\tif (scheduler.frequencyRepeat == 0) {\n\t\t\t\tdayOfMonth = '*';\n\t\t\t} else {\n\t\t\t\tdayOfMonth = '*/' + scheduler.frequencyRepeat;\n\t\t\t}\n\t\t} else if (scheduler.frequency == 'Weekly') {\n\t\t\tdayOfWeek = scheduler.frequencyRepeat;\n\t\t} else if (scheduler.frequency == 'One-Time') {\n\t\t\t// COME BACK TO THIS FOR CALCULATING YEAR - maybe use if currentYear != schedulerRepeat.year return\n\t\t\tmonth = scheduler.frequencyRepeat.substring(8, 10);\n\t\t\tdayOfMonth = scheduler.frequencyRepeat.substring(5, 7);\n\t\t}\n\n\n\t\tvar today = new Date();\n\t\tvar currentDayOfWeek = String(today.getDay());\n\t\tvar currentMonth = String(today.getMonth() + 1).padStart(2, '0');;\n\t\tvar currentDayOfMonth = String(today.getDate()).padStart(2, '0');\n\n\n\t\tif (dayOfWeek == '*' || dayOfWeek.includes(currentDayOfWeek) || (month == currentMonth && dayOfMonth == currentDayOfMonth)) {\n\t\t\tvar currentTimeInMinutes = (today.getHours()*60) + today.getMinutes();\n\t\t\tvar startTimeInMinutes = parseInt((startHour*60)) + parseInt(startMinute);\n\t\t\tvar endTimeInMinutes = parseInt((endHour*60)) + parseInt(endMinute);\n\n\t\t\tif (startTimeInMinutes < currentTimeInMinutes && currentTimeInMinutes <= endTimeInMinutes) {\n\t\t\t\tconsole.log(colors.yellow('ENGINE: Resuming show \"' + show.name + '\" (scheduler \"' + scheduler.name + '\")'));\n\t\t\t currentlyPlayingShow = show.name;\n\t\t\t currentScheduler = scheduler;\n\n\t\t\t\tvar currentFrame = 0;\n\t\t\t showInterval[thisIntervalID] = setInterval(function() {\n\t\t\t for (var i = 0; i < show.frames[currentFrame].length; i++) {\n\t\t\t var ch = i + 1;\n\t\t\t var val = show.frames[currentFrame][i];\n\t\t\t universe.update({[ch]: val});\n\t\t\t }\n\n\t\t\t if (currentFrame < show.frames.length-1) currentFrame++;\n\t\t\t else currentFrame = 0;\n\t\t\t }, show.delayMS);\n\t\t\t}\n\t\t} else {\n\t\t\tvar startDateString = startMinute + ' ' + startHour + ' ' + dayOfMonth + ' ' + month + ' ' + dayOfWeek;\n\t\t\t//console.log(colors.data(\"Start date: \" + startDateString));\n\n\t\t schedulerJobs[thisIntervalID] = schedule.scheduleJob(startDateString, function(){\n\t\t\t\tconsole.log(colors.yellow('ENGINE: Playing show \"' + show.name + '\" (scheduler \"' + scheduler.name + '\")'));\n\t\t\t currentlyPlayingShow = show.name;\n\t\t\t currentScheduler = scheduler;\n\n\t\t\t\tvar currentFrame = 0;\n\t\t\t showInterval[thisIntervalID] = setInterval(function() {\n\t\t\t for (var i = 0; i < show.frames[currentFrame].length; i++) {\n\t\t\t var ch = i + 1;\n\t\t\t var val = show.frames[currentFrame][i];\n\t\t\t universe.update({[ch]: val});\n\t\t\t }\n\n\t\t\t if (currentFrame < show.frames.length-1) currentFrame++;\n\t\t\t else currentFrame = 0;\n\t\t\t }, show.delayMS);\n\t\t });\n\t\t}\n\n\n\n\n\t var endTimeMinute = parseInt(endMinute);\n\t var endTimeHour = parseInt(endHour);\n\t if (endTimeMinute == -1) {\n\t \tendTimeHour--;\n\t \tendTimeMinute = 59;\n\t }\n\t\tif (endTimeHour < 10) endTimeHour = '0' + endTimeHour\n\n\t var endDateString = '59 ' + endTimeMinute + ' ' + endTimeHour + ' ' + dayOfMonth + ' ' + month + ' ' + dayOfWeek;\n\t\t//console.log(colors.data(\"End date: \" + endDateString));\n\n\t cancelSchedulerJobs[thisIntervalID] = schedule.scheduleJob(endDateString, function() {\n\t\t console.log(colors.yellow('ENGINE: Stopping show ' + scheduler.name));\n\t clearInterval(showInterval[thisIntervalID]);\n\t resetAllChannels();\n\t\t\tcurrentlyPlayingShow = \"none\";\n\t\t\tcurrentScheduler = null;\n\t }); \n\t});\n}", "title": "" }, { "docid": "7ef7b682231ca88f4351a63a4271b97a", "score": "0.48488882", "text": "function start() {\n\n}", "title": "" }, { "docid": "089da3b6333ac7825834d8c395081d5b", "score": "0.4846103", "text": "function main() {\n setLocationBids(LAST_YEAR(), TODAY());\n setAdScheduleBids(LAST_YEAR(), TODAY());\n\n setLocationBids(\"LAST_30_DAYS\");\n setAdScheduleBids(\"LAST_30_DAYS\");\n\n setLocationBids(\"LAST_14_DAYS\");\n\n setLocationBids(\"LAST_7_DAYS\");\n}", "title": "" }, { "docid": "e4a9ca494094d44cad929d2cf60ded17", "score": "0.48458412", "text": "exec() {\n var globals = GlobalVars.getInstance();\n globals.setTickrate(240);\n globals.timescale = 1.0;\n\n /*\n Setup input listeners here\n */\n\n //TODO(Jake): Add platform level input listening code\n requestAnimationFrame(() => this.loop());\n }", "title": "" }, { "docid": "e4163a7ab9870eee8d15c0042d48ea74", "score": "0.4844354", "text": "async started(ctx) {\n\t\ttry {\n\t\t\tlet indexScheduleCron = \"0 0 2 * * *\"; // 默认每天凌晨2点\n\t\t\tconst steedosConfig = objectql.getSteedosConfig() || {};\n\t\t\tconst cron = steedosConfig.cron;\n\t\t\tif (cron && cron.build_index) {\n\t\t\t\tindexScheduleCron = cron.build_index;\n\t\t\t}\n\t\t\tif (indexScheduleCron) {\n\t\t\t\tthis.job = schedule.scheduleJob(indexScheduleCron, () => {\n\t\t\t\t\tthis.broker.call(`${serviceName}.refreshIndexes`)\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(error)\n\t\t}\n\t}", "title": "" }, { "docid": "4dd4ca98568b1900656ebef83be114ed", "score": "0.4840844", "text": "function start() {\n\tconsole.log(\"Below is a list of our inventory.\")\n\ttable();\n}", "title": "" }, { "docid": "853548d594fb5b059ba015bc88182f29", "score": "0.4840723", "text": "function main() {\n start();\n}", "title": "" }, { "docid": "95bfb20ce2ef0b149084075ac6a90ecb", "score": "0.48321325", "text": "start() {\n Q.loadTMX(\n config.defaultAssests.concat([\n 'level-1-1.tmx',\n ]).join(','),\n this.onLoad,\n {\n progressCallback: this.onProgress,\n }\n );\n }", "title": "" }, { "docid": "8e8c0b2b01a304d29a40dd2b41d3a7c8", "score": "0.48288995", "text": "function eventStart() {\n let date = getCurrentDate();\n ui.startWorkout(date);\n exercise.getDate(date);\n stopWatch();\n add();\n remove();\n sets();\n reps();\n }", "title": "" }, { "docid": "060a5fc08a2ce53020aa2bfcb2aaf319", "score": "0.48252285", "text": "function timerTick() {\n Object.keys(SWD).forEach(function(id) {\n var swd = SWD[id]\n if (swd.running) {\n updateDisplay(swd)\n }\n })\n}", "title": "" }, { "docid": "33d8f41e79bba8441502b57c9bfc8522", "score": "0.48245984", "text": "function StartRun() {\n if (selecting != null)\n {\n unselect();\n }\n IsRunning = true;\n ExitRun = false;\n Tree_Ready = false;\n ReachabilityTree = [];\n TreeInString = \"\";\n clear_info();\n//copy all the places for stop function\n if(Pause == false){\n copyPlaces();\n Pause =false;\n }\n//create the tim icon and its movement, use the animation and AnimateDelay to delay the run time\n TimeIcon = new createTimeIcon(AnimateDelay);\n\n Run();\n}", "title": "" }, { "docid": "9002a74beaeb86d73cd52f8512fd41e6", "score": "0.48221612", "text": "function startMenu(){\n $('.menu-toggle').sidr({\n name: 'main-menu',\n source: '#main-menu',\n renaming: false\n });\n}", "title": "" }, { "docid": "92d0634b3c848916bd86b11bb0b093a2", "score": "0.4812665", "text": "function TournamentStart() {\n\tlog('TournamentStart');\n\n\tArenaRestart();\n}", "title": "" }, { "docid": "9de3a5f7db5d3ea16d883d58a8d7a010", "score": "0.4795846", "text": "start() {\n\n }", "title": "" }, { "docid": "88af687bec99d1fab84b153fd05575ed", "score": "0.47925702", "text": "function clockDoubleClick(pause)\n{\n var runnedClocks = [];\n function innerClockDoubleClick() {\n for(var j=0; j< runnedClocks.length;++j) {\n clocksContainer[runnedClocks[j]].run = true;\n }\n }\n\n for(var i=0; i< Global.clocksContainer.length;++i)\n {\n if (clocksContainer[i]){\n if (clocksContainer[i].run) {\n clocksContainer[i].run = false;\n runnedClocks.push(i);\n // clocksContainer[i].whenRunChanged(); //check if correct in Linux\n }\n }\n }\n\n if (pause)\n delay(2100,innerClockDoubleClick); //for correct writing in DB when date changes\n else\n innerClockDoubleClick();\n}", "title": "" }, { "docid": "462b12ec7ed7488f745f084bb3f1ead2", "score": "0.47903636", "text": "function start() {\r\n displayTZCountDown(setTZCountDown(month, day, hour, tz), lab);\r\n millisecondsEmulator();\r\n}", "title": "" }, { "docid": "c851684cf0400ab12bccf069bbe4a9e0", "score": "0.47876352", "text": "start() {\n this.times = [...this.schedule.keys()].sort((a, b) => a - b);\n this.startTime = new Date().getTime();\n this.tick();\n }", "title": "" }, { "docid": "2b418b941ece2e235f0fbeb43d279831", "score": "0.47871733", "text": "function updateTimeLineByTemplate(_) {\n\t\tif (_===undefined) return;\n\t\tif (_.frame_0!==undefined) {\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_0 = fourLevelAnims(RVS.F.safeExtend(true,defaultFrame({alias:RVS_LANG.enterstage,opacity:0},\"frame_0\"),_.frame_0));\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_0.timeline.start = RVS.L[RVS.selLayers[0]].timelinecache.frames.frame_0.timeline.start;\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_0.timeline.alias = RVS_LANG.enterstage;\n\t\t}\n\t\tif (_.frame_1!==undefined) {\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_1 = fourLevelAnims(RVS.F.safeExtend(true,defaultFrame({opacity:1,effect:\"none\",chars:{x: 0,y: 0,z: 0,opacity: 1,rotationZ: 0,rotationX: 0,rotationY: 0,scaleX: 1,scaleY: 1,skewX: 0,skewY: 0},words:{\tx: 0,y: 0,z: 0,opacity: 1,rotationZ: 0,rotationX: 0,rotationY: 0,scaleX: 1,scaleY: 1,skewX: 0,skewY: 0},lines:{\tx: 0,y: 0,z: 0,opacity: 1,rotationZ: 0,rotationX: 0,rotationY: 0,scaleX: 1,scaleY: 1,skewX: 0,skewY: 0}},\"frame_1\"),_.frame_1));\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_1.timeline.start = RVS.L[RVS.selLayers[0]].timelinecache.frames.frame_1.timeline.start;\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_1.timeline.alias = RVS_LANG.onstage;\n\t\t}\n\t\tif (_.frame_999!==undefined) {\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_999 = fourLevelAnims(RVS.F.safeExtend(true,defaultFrame({endWithSlide:true,alias:RVS_LANG.leavestage,opacity:0},\"frame_999\"),_.frame_999));\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_999.timeline.start = RVS.L[RVS.selLayers[0]].timelinecache.frames.frame_999.timeline.start;\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.frames.frame_1.timeline.alias = RVS_LANG.leavestage;\n\t\t}\n\t\tif (_.loop!==undefined) {\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.loop = RVS.F.safeExtend(true,defaultLoopFrame(),_.loop);\n\t\t\tRVS.L[RVS.selLayers[0]].timeline.loop.start = RVS.L[RVS.selLayers[0]].timelinecache.loop.start;\n\t\t}\n\n\t\tclearTimeout(window.timelineTemporaryUpdate);\n\t\twindow.timelineTemporaryUpdate = setTimeout(function() {\n\t\t\tRVS.F.updateLayerFrames({layerid:RVS.selLayers[0]});\n\t\t},50);\n\t}", "title": "" }, { "docid": "3427f6cbc6360b9f57823b11518a35b1", "score": "0.47870806", "text": "Start()\n {\n \n }", "title": "" }, { "docid": "3427f6cbc6360b9f57823b11518a35b1", "score": "0.47870806", "text": "Start()\n {\n \n }", "title": "" }, { "docid": "47b28e1f60b8d2d56a877f03c93cb9d8", "score": "0.47811434", "text": "function schedule() {\n var conductor = JSON.parse(localStorage.getItem(\"conductor\"));\n var today = getDate(\n format = \"YYYY-MM-DD\",\n options = {}\n );\n var tomorrow = getDate(\n format = \"YYYY-MM-DD\",\n options = {\n offset: 1,\n offsetType: \"days\"\n }\n );\n var id = '';\n $.each(conductor, function (index, program) {\n switch (program.Date) {\n case today:\n id = 'today';\n break;\n case tomorrow:\n id = 'tomorrow';\n break;\n }\n if (program.detail_fa) {\n $('#' + id + ' .link-list').append('<a href=\"#\"><i class=\"fas ' + scheduleSign[program.category] + '\"></i><span>' + program.name_fa + '</span><em class=\"bg-blue2-dark\">' + program.startHour + '</em><strong>' + program.detail_fa + '</strong></a>');\n var title = $('#' + id + ' .link-list a span').last();\n if (title.textWidth() >= screen.width - 200) {\n title.marquee({\n speed: 40,\n leftToRight: false\n });\n }\n } else {\n $('#' + id + ' .link-list').append('<a href=\"#\"><i class=\"fas ' + scheduleSign[program.category] + '\"></i><span style=\"transform: translateY(0);\">' + program.name_fa + '</span><em class=\"bg-blue2-dark\">' + program.startHour + '</em></a>');\n var title = $('#' + id + ' .link-list a span').last();\n if (title.textWidth() >= screen.width - 200) {\n title.marquee({\n speed: 40,\n leftToRight: false\n });\n }\n }\n });\n attachProgressBar(\"schedule-today\", \"schedule-bar\");\n attachProgressBar(\"schedule-tomorrow\", \"schedule-bar\");\n}", "title": "" }, { "docid": "7050c3b607ff3e16bce763d75b433cab", "score": "0.47676423", "text": "function runAllCharts() {\n\t/*\n\t * SPARKLINES\n\t * DEPENDENCY: js/plugins/sparkline/jquery.sparkline.min.js\n\t * See usage example below...\n\t */\n\n\t/* Usage:\n\t * \t\t<div class=\"sparkline-line txt-color-blue\" data-fill-color=\"transparent\" data-sparkline-height=\"26px\">\n\t *\t\t\t5,6,7,9,9,5,9,6,5,6,6,7,7,6,7,8,9,7\n\t *\t\t</div>\n\t */\n\n\tif ($.fn.sparkline) {\n\n\t\t// variable declearations:\n\n\t\tvar barColor,\n\t\t\tsparklineHeight,\n\t\t\tsparklineBarWidth,\n\t\t\tsparklineBarSpacing,\n\t\t\tsparklineNegBarColor,\n\t\t\tsparklineStackedColor,\n\t\t\tthisLineColor,\n\t\t\tthisLineWidth,\n\t\t\tthisFill,\n\t\t\tthisSpotColor,\n\t\t\tthisMinSpotColor,\n\t\t\tthisMaxSpotColor,\n\t\t\tthishighlightSpotColor,\n\t\t\tthisHighlightLineColor,\n\t\t\tthisSpotRadius,\n\t\t\tpieColors,\n\t\t\tpieWidthHeight,\n\t\t\tpieBorderColor,\n\t\t\tpieOffset,\n\t\t\tthisBoxWidth,\n\t\t\tthisBoxHeight,\n\t\t\tthisBoxRaw,\n\t\t\tthisBoxTarget,\n\t\t\tthisBoxMin,\n\t\t\tthisBoxMax,\n\t\t\tthisShowOutlier,\n\t\t\tthisIQR,\n\t\t\tthisBoxSpotRadius,\n\t\t\tthisBoxLineColor,\n\t\t\tthisBoxFillColor,\n\t\t\tthisBoxWhisColor,\n\t\t\tthisBoxOutlineColor,\n\t\t\tthisBoxOutlineFill,\n\t\t\tthisBoxMedianColor,\n\t\t\tthisBoxTargetColor,\n\t\t\tthisBulletHeight,\n\t\t\tthisBulletWidth,\n\t\t\tthisBulletColor,\n\t\t\tthisBulletPerformanceColor,\n\t\t\tthisBulletRangeColors,\n\t\t\tthisDiscreteHeight,\n\t\t\tthisDiscreteWidth,\n\t\t\tthisDiscreteLineColor,\n\t\t\tthisDiscreteLineHeight,\n\t\t\tthisDiscreteThrushold,\n\t\t\tthisDiscreteThrusholdColor,\n\t\t\tthisTristateHeight,\n\t\t\tthisTristatePosBarColor,\n\t\t\tthisTristateNegBarColor,\n\t\t\tthisTristateZeroBarColor,\n\t\t\tthisTristateBarWidth,\n\t\t\tthisTristateBarSpacing,\n\t\t\tthisZeroAxis,\n\t\t\tthisBarColor,\n\t\t\tsparklineWidth,\n\t\t\tsparklineValue,\n\t\t\tsparklineValueSpots1,\n\t\t\tsparklineValueSpots2,\n\t\t\tthisLineWidth1,\n\t\t\tthisLineWidth2,\n\t\t\tthisLineColor1,\n\t\t\tthisLineColor2,\n\t\t\tthisSpotRadius1,\n\t\t\tthisSpotRadius2,\n\t\t\tthisMinSpotColor1,\n\t\t\tthisMaxSpotColor1,\n\t\t\tthisMinSpotColor2,\n\t\t\tthisMaxSpotColor2,\n\t\t\tthishighlightSpotColor1,\n\t\t\tthisHighlightLineColor1,\n\t\t\tthishighlightSpotColor2,\n\t\t\tthisFillColor1,\n\t\t\tthisFillColor2;\n\n\t\t$('.sparkline:not(:has(>canvas))').each(function () {\n\t\t\tvar $this = $(this),\n\t\t\t\tsparklineType = $this.data('sparkline-type') || 'bar';\n\n\t\t\t// BAR CHART\n\t\t\tif (sparklineType == 'bar') {\n\n\t\t\t\tbarColor = $this.data('sparkline-bar-color') || $this.css('color') || '#0000f0';\n\t\t\t\tsparklineHeight = $this.data('sparkline-height') || '26px';\n\t\t\t\tsparklineBarWidth = $this.data('sparkline-barwidth') || 5;\n\t\t\t\tsparklineBarSpacing = $this.data('sparkline-barspacing') || 2;\n\t\t\t\tsparklineNegBarColor = $this.data('sparkline-negbar-color') || '#A90329';\n\t\t\t\tsparklineStackedColor = $this.data('sparkline-barstacked-color') || [\"#A90329\", \"#0099c6\", \"#98AA56\", \"#da532c\", \"#4490B1\", \"#6E9461\", \"#990099\", \"#B4CAD3\"];\n\n\t\t\t\t$this.sparkline('html', {\n\t\t\t\t\tbarColor: barColor,\n\t\t\t\t\ttype: sparklineType,\n\t\t\t\t\theight: sparklineHeight,\n\t\t\t\t\tbarWidth: sparklineBarWidth,\n\t\t\t\t\tbarSpacing: sparklineBarSpacing,\n\t\t\t\t\tstackedBarColor: sparklineStackedColor,\n\t\t\t\t\tnegBarColor: sparklineNegBarColor,\n\t\t\t\t\tzeroAxis: 'false'\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t\t// LINE CHART\n\t\t\tif (sparklineType == 'line') {\n\n\t\t\t\tsparklineHeight = $this.data('sparkline-height') || '20px';\n\t\t\t\tsparklineWidth = $this.data('sparkline-width') || '90px';\n\t\t\t\tthisLineColor = $this.data('sparkline-line-color') || $this.css('color') || '#0000f0';\n\t\t\t\tthisLineWidth = $this.data('sparkline-line-width') || 1;\n\t\t\t\tthisFill = $this.data('fill-color') || '#c0d0f0';\n\t\t\t\tthisSpotColor = $this.data('sparkline-spot-color') || '#f08000';\n\t\t\t\tthisMinSpotColor = $this.data('sparkline-minspot-color') || '#ed1c24';\n\t\t\t\tthisMaxSpotColor = $this.data('sparkline-maxspot-color') || '#f08000';\n\t\t\t\tthishighlightSpotColor = $this.data('sparkline-highlightspot-color') || '#50f050';\n\t\t\t\tthisHighlightLineColor = $this.data('sparkline-highlightline-color') || 'f02020';\n\t\t\t\tthisSpotRadius = $this.data('sparkline-spotradius') || 1.5;\n\t\t\t\tthisChartMinYRange = $this.data('sparkline-min-y') || 'undefined';\n\t\t\t\tthisChartMaxYRange = $this.data('sparkline-max-y') || 'undefined';\n\t\t\t\tthisChartMinXRange = $this.data('sparkline-min-x') || 'undefined';\n\t\t\t\tthisChartMaxXRange = $this.data('sparkline-max-x') || 'undefined';\n\t\t\t\tthisMinNormValue = $this.data('min-val') || 'undefined';\n\t\t\t\tthisMaxNormValue = $this.data('max-val') || 'undefined';\n\t\t\t\tthisNormColor = $this.data('norm-color') || '#c0c0c0';\n\t\t\t\tthisDrawNormalOnTop = $this.data('draw-normal') || false;\n\n\t\t\t\t$this.sparkline('html', {\n\t\t\t\t\ttype: 'line',\n\t\t\t\t\twidth: sparklineWidth,\n\t\t\t\t\theight: sparklineHeight,\n\t\t\t\t\tlineWidth: thisLineWidth,\n\t\t\t\t\tlineColor: thisLineColor,\n\t\t\t\t\tfillColor: thisFill,\n\t\t\t\t\tspotColor: thisSpotColor,\n\t\t\t\t\tminSpotColor: thisMinSpotColor,\n\t\t\t\t\tmaxSpotColor: thisMaxSpotColor,\n\t\t\t\t\thighlightSpotColor: thishighlightSpotColor,\n\t\t\t\t\thighlightLineColor: thisHighlightLineColor,\n\t\t\t\t\tspotRadius: thisSpotRadius,\n\t\t\t\t\tchartRangeMin: thisChartMinYRange,\n\t\t\t\t\tchartRangeMax: thisChartMaxYRange,\n\t\t\t\t\tchartRangeMinX: thisChartMinXRange,\n\t\t\t\t\tchartRangeMaxX: thisChartMaxXRange,\n\t\t\t\t\tnormalRangeMin: thisMinNormValue,\n\t\t\t\t\tnormalRangeMax: thisMaxNormValue,\n\t\t\t\t\tnormalRangeColor: thisNormColor,\n\t\t\t\t\tdrawNormalOnTop: thisDrawNormalOnTop\n\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t\t// PIE CHART\n\t\t\tif (sparklineType == 'pie') {\n\n\t\t\t\tpieColors = $this.data('sparkline-piecolor') || [\"#B4CAD3\", \"#4490B1\", \"#98AA56\", \"#da532c\", \"#6E9461\", \"#0099c6\", \"#990099\", \"#717D8A\"];\n\t\t\t\tpieWidthHeight = $this.data('sparkline-piesize') || 90;\n\t\t\t\tpieBorderColor = $this.data('border-color') || '#45494C';\n\t\t\t\tpieOffset = $this.data('sparkline-offset') || 0;\n\n\t\t\t\t$this.sparkline('html', {\n\t\t\t\t\ttype: 'pie',\n\t\t\t\t\twidth: pieWidthHeight,\n\t\t\t\t\theight: pieWidthHeight,\n\t\t\t\t\ttooltipFormat: '<span style=\"color: {{color}}\">&#9679;</span> ({{percent.1}}%)',\n\t\t\t\t\tsliceColors: pieColors,\n\t\t\t\t\tborderWidth: 1,\n\t\t\t\t\toffset: pieOffset,\n\t\t\t\t\tborderColor: pieBorderColor\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t\t// BOX PLOT\n\t\t\tif (sparklineType == 'box') {\n\n\t\t\t\tthisBoxWidth = $this.data('sparkline-width') || 'auto';\n\t\t\t\tthisBoxHeight = $this.data('sparkline-height') || 'auto';\n\t\t\t\tthisBoxRaw = $this.data('sparkline-boxraw') || false;\n\t\t\t\tthisBoxTarget = $this.data('sparkline-targetval') || 'undefined';\n\t\t\t\tthisBoxMin = $this.data('sparkline-min') || 'undefined';\n\t\t\t\tthisBoxMax = $this.data('sparkline-max') || 'undefined';\n\t\t\t\tthisShowOutlier = $this.data('sparkline-showoutlier') || true;\n\t\t\t\tthisIQR = $this.data('sparkline-outlier-iqr') || 1.5;\n\t\t\t\tthisBoxSpotRadius = $this.data('sparkline-spotradius') || 1.5;\n\t\t\t\tthisBoxLineColor = $this.css('color') || '#000000';\n\t\t\t\tthisBoxFillColor = $this.data('fill-color') || '#c0d0f0';\n\t\t\t\tthisBoxWhisColor = $this.data('sparkline-whis-color') || '#000000';\n\t\t\t\tthisBoxOutlineColor = $this.data('sparkline-outline-color') || '#303030';\n\t\t\t\tthisBoxOutlineFill = $this.data('sparkline-outlinefill-color') || '#f0f0f0';\n\t\t\t\tthisBoxMedianColor = $this.data('sparkline-outlinemedian-color') || '#f00000';\n\t\t\t\tthisBoxTargetColor = $this.data('sparkline-outlinetarget-color') || '#40a020';\n\n\t\t\t\t$this.sparkline('html', {\n\t\t\t\t\ttype: 'box',\n\t\t\t\t\twidth: thisBoxWidth,\n\t\t\t\t\theight: thisBoxHeight,\n\t\t\t\t\traw: thisBoxRaw,\n\t\t\t\t\ttarget: thisBoxTarget,\n\t\t\t\t\tminValue: thisBoxMin,\n\t\t\t\t\tmaxValue: thisBoxMax,\n\t\t\t\t\tshowOutliers: thisShowOutlier,\n\t\t\t\t\toutlierIQR: thisIQR,\n\t\t\t\t\tspotRadius: thisBoxSpotRadius,\n\t\t\t\t\tboxLineColor: thisBoxLineColor,\n\t\t\t\t\tboxFillColor: thisBoxFillColor,\n\t\t\t\t\twhiskerColor: thisBoxWhisColor,\n\t\t\t\t\toutlierLineColor: thisBoxOutlineColor,\n\t\t\t\t\toutlierFillColor: thisBoxOutlineFill,\n\t\t\t\t\tmedianColor: thisBoxMedianColor,\n\t\t\t\t\ttargetColor: thisBoxTargetColor\n\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t\t// BULLET\n\t\t\tif (sparklineType == 'bullet') {\n\n\t\t\t\tvar thisBulletHeight = $this.data('sparkline-height') || 'auto';\n\t\t\t\tthisBulletWidth = $this.data('sparkline-width') || 2;\n\t\t\t\tthisBulletColor = $this.data('sparkline-bullet-color') || '#ed1c24';\n\t\t\t\tthisBulletPerformanceColor = $this.data('sparkline-performance-color') || '#3030f0';\n\t\t\t\tthisBulletRangeColors = $this.data('sparkline-bulletrange-color') || [\"#d3dafe\", \"#a8b6ff\", \"#7f94ff\"];\n\n\t\t\t\t$this.sparkline('html', {\n\n\t\t\t\t\ttype: 'bullet',\n\t\t\t\t\theight: thisBulletHeight,\n\t\t\t\t\ttargetWidth: thisBulletWidth,\n\t\t\t\t\ttargetColor: thisBulletColor,\n\t\t\t\t\tperformanceColor: thisBulletPerformanceColor,\n\t\t\t\t\trangeColors: thisBulletRangeColors\n\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t\t// DISCRETE\n\t\t\tif (sparklineType == 'discrete') {\n\n\t\t\t\tthisDiscreteHeight = $this.data('sparkline-height') || 26;\n\t\t\t\tthisDiscreteWidth = $this.data('sparkline-width') || 50;\n\t\t\t\tthisDiscreteLineColor = $this.css('color');\n\t\t\t\tthisDiscreteLineHeight = $this.data('sparkline-line-height') || 5;\n\t\t\t\tthisDiscreteThrushold = $this.data('sparkline-threshold') || 'undefined';\n\t\t\t\tthisDiscreteThrusholdColor = $this.data('sparkline-threshold-color') || '#ed1c24';\n\n\t\t\t\t$this.sparkline('html', {\n\n\t\t\t\t\ttype: 'discrete',\n\t\t\t\t\twidth: thisDiscreteWidth,\n\t\t\t\t\theight: thisDiscreteHeight,\n\t\t\t\t\tlineColor: thisDiscreteLineColor,\n\t\t\t\t\tlineHeight: thisDiscreteLineHeight,\n\t\t\t\t\tthresholdValue: thisDiscreteThrushold,\n\t\t\t\t\tthresholdColor: thisDiscreteThrusholdColor\n\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t\t// TRISTATE\n\t\t\tif (sparklineType == 'tristate') {\n\n\t\t\t\tthisTristateHeight = $this.data('sparkline-height') || 26;\n\t\t\t\tthisTristatePosBarColor = $this.data('sparkline-posbar-color') || '#60f060';\n\t\t\t\tthisTristateNegBarColor = $this.data('sparkline-negbar-color') || '#f04040';\n\t\t\t\tthisTristateZeroBarColor = $this.data('sparkline-zerobar-color') || '#909090';\n\t\t\t\tthisTristateBarWidth = $this.data('sparkline-barwidth') || 5;\n\t\t\t\tthisTristateBarSpacing = $this.data('sparkline-barspacing') || 2;\n\t\t\t\tthisZeroAxis = $this.data('sparkline-zeroaxis') || false;\n\n\t\t\t\t$this.sparkline('html', {\n\n\t\t\t\t\ttype: 'tristate',\n\t\t\t\t\theight: thisTristateHeight,\n\t\t\t\t\tposBarColor: thisBarColor,\n\t\t\t\t\tnegBarColor: thisTristateNegBarColor,\n\t\t\t\t\tzeroBarColor: thisTristateZeroBarColor,\n\t\t\t\t\tbarWidth: thisTristateBarWidth,\n\t\t\t\t\tbarSpacing: thisTristateBarSpacing,\n\t\t\t\t\tzeroAxis: thisZeroAxis\n\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t\t//COMPOSITE: BAR\n\t\t\tif (sparklineType == 'compositebar') {\n\n\t\t\t\tsparklineHeight = $this.data('sparkline-height') || '20px';\n\t\t\t\tsparklineWidth = $this.data('sparkline-width') || '100%';\n\t\t\t\tsparklineBarWidth = $this.data('sparkline-barwidth') || 3;\n\t\t\t\tthisLineWidth = $this.data('sparkline-line-width') || 1;\n\t\t\t\tthisLineColor = $this.data('data-sparkline-linecolor') || '#ed1c24';\n\t\t\t\tthisBarColor = $this.data('data-sparkline-barcolor') || '#333333';\n\n\t\t\t\t$this.sparkline($this.data('sparkline-bar-val'), {\n\n\t\t\t\t\ttype: 'bar',\n\t\t\t\t\twidth: sparklineWidth,\n\t\t\t\t\theight: sparklineHeight,\n\t\t\t\t\tbarColor: thisBarColor,\n\t\t\t\t\tbarWidth: sparklineBarWidth\n\t\t\t\t\t//barSpacing: 5\n\n\t\t\t\t});\n\n\t\t\t\t$this.sparkline($this.data('sparkline-line-val'), {\n\n\t\t\t\t\twidth: sparklineWidth,\n\t\t\t\t\theight: sparklineHeight,\n\t\t\t\t\tlineColor: thisLineColor,\n\t\t\t\t\tlineWidth: thisLineWidth,\n\t\t\t\t\tcomposite: true,\n\t\t\t\t\tfillColor: false\n\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t\t//COMPOSITE: LINE\n\t\t\tif (sparklineType == 'compositeline') {\n\n\t\t\t\tsparklineHeight = $this.data('sparkline-height') || '20px';\n\t\t\t\tsparklineWidth = $this.data('sparkline-width') || '90px';\n\t\t\t\tsparklineValue = $this.data('sparkline-bar-val');\n\t\t\t\tsparklineValueSpots1 = $this.data('sparkline-bar-val-spots-top') || null;\n\t\t\t\tsparklineValueSpots2 = $this.data('sparkline-bar-val-spots-bottom') || null;\n\t\t\t\tthisLineWidth1 = $this.data('sparkline-line-width-top') || 1;\n\t\t\t\tthisLineWidth2 = $this.data('sparkline-line-width-bottom') || 1;\n\t\t\t\tthisLineColor1 = $this.data('sparkline-color-top') || '#333333';\n\t\t\t\tthisLineColor2 = $this.data('sparkline-color-bottom') || '#ed1c24';\n\t\t\t\tthisSpotRadius1 = $this.data('sparkline-spotradius-top') || 1.5;\n\t\t\t\tthisSpotRadius2 = $this.data('sparkline-spotradius-bottom') || thisSpotRadius1;\n\t\t\t\tthisSpotColor = $this.data('sparkline-spot-color') || '#f08000';\n\t\t\t\tthisMinSpotColor1 = $this.data('sparkline-minspot-color-top') || '#ed1c24';\n\t\t\t\tthisMaxSpotColor1 = $this.data('sparkline-maxspot-color-top') || '#f08000';\n\t\t\t\tthisMinSpotColor2 = $this.data('sparkline-minspot-color-bottom') || thisMinSpotColor1;\n\t\t\t\tthisMaxSpotColor2 = $this.data('sparkline-maxspot-color-bottom') || thisMaxSpotColor1;\n\t\t\t\tthishighlightSpotColor1 = $this.data('sparkline-highlightspot-color-top') || '#50f050';\n\t\t\t\tthisHighlightLineColor1 = $this.data('sparkline-highlightline-color-top') || '#f02020';\n\t\t\t\tthishighlightSpotColor2 = $this.data('sparkline-highlightspot-color-bottom') ||\n\t\t\t\t\tthishighlightSpotColor1;\n\t\t\t\tthisHighlightLineColor2 = $this.data('sparkline-highlightline-color-bottom') ||\n\t\t\t\t\tthisHighlightLineColor1;\n\t\t\t\tthisFillColor1 = $this.data('sparkline-fillcolor-top') || 'transparent';\n\t\t\t\tthisFillColor2 = $this.data('sparkline-fillcolor-bottom') || 'transparent';\n\n\t\t\t\t$this.sparkline(sparklineValue, {\n\n\t\t\t\t\ttype: 'line',\n\t\t\t\t\tspotRadius: thisSpotRadius1,\n\n\t\t\t\t\tspotColor: thisSpotColor,\n\t\t\t\t\tminSpotColor: thisMinSpotColor1,\n\t\t\t\t\tmaxSpotColor: thisMaxSpotColor1,\n\t\t\t\t\thighlightSpotColor: thishighlightSpotColor1,\n\t\t\t\t\thighlightLineColor: thisHighlightLineColor1,\n\n\t\t\t\t\tvalueSpots: sparklineValueSpots1,\n\n\t\t\t\t\tlineWidth: thisLineWidth1,\n\t\t\t\t\twidth: sparklineWidth,\n\t\t\t\t\theight: sparklineHeight,\n\t\t\t\t\tlineColor: thisLineColor1,\n\t\t\t\t\tfillColor: thisFillColor1\n\n\t\t\t\t});\n\n\t\t\t\t$this.sparkline($this.data('sparkline-line-val'), {\n\n\t\t\t\t\ttype: 'line',\n\t\t\t\t\tspotRadius: thisSpotRadius2,\n\n\t\t\t\t\tspotColor: thisSpotColor,\n\t\t\t\t\tminSpotColor: thisMinSpotColor2,\n\t\t\t\t\tmaxSpotColor: thisMaxSpotColor2,\n\t\t\t\t\thighlightSpotColor: thishighlightSpotColor2,\n\t\t\t\t\thighlightLineColor: thisHighlightLineColor2,\n\n\t\t\t\t\tvalueSpots: sparklineValueSpots2,\n\n\t\t\t\t\tlineWidth: thisLineWidth2,\n\t\t\t\t\twidth: sparklineWidth,\n\t\t\t\t\theight: sparklineHeight,\n\t\t\t\t\tlineColor: thisLineColor2,\n\t\t\t\t\tcomposite: true,\n\t\t\t\t\tfillColor: thisFillColor2\n\n\t\t\t\t});\n\n\t\t\t\t$this = null;\n\n\t\t\t}\n\n\t\t});\n\n\t}// end if\n\n\t/*\n\t * EASY PIE CHARTS\n\t * DEPENDENCY: js/plugins/easy-pie-chart/jquery.easy-pie-chart.min.js\n\t * Usage: <div class=\"easy-pie-chart txt-color-orangeDark\" data-pie-percent=\"33\" data-pie-size=\"72\" data-size=\"72\">\n\t *\t\t\t<span class=\"percent percent-sign\">35</span>\n\t * \t \t </div>\n\t */\n\n\tif ($.fn.easyPieChart) {\n\n\t\t$('.easy-pie-chart').each(function () {\n\t\t\tvar $this = $(this),\n\t\t\t\tbarColor = $this.css('color') || $this.data('pie-color'),\n\t\t\t\ttrackColor = $this.data('pie-track-color') || 'rgba(0,0,0,0.04)',\n\t\t\t\tsize = parseInt($this.data('pie-size')) || 25;\n\n\t\t\t$this.easyPieChart({\n\n\t\t\t\tbarColor: barColor,\n\t\t\t\ttrackColor: trackColor,\n\t\t\t\tscaleColor: false,\n\t\t\t\tlineCap: 'butt',\n\t\t\t\tlineWidth: parseInt(size / 8.5),\n\t\t\t\tanimate: 1500,\n\t\t\t\trotate: -90,\n\t\t\t\tsize: size,\n\t\t\t\tonStep: function (from, to, percent) {\n\t\t\t\t\t$(this.el).find('.percent').text(Math.round(percent));\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\t$this = null;\n\t\t});\n\n\t} // end if\n\n}", "title": "" }, { "docid": "efcd9a9bbff1bc27e897c38b0b485a8a", "score": "0.4765151", "text": "start() {\n\n }", "title": "" }, { "docid": "04762ce066457db381fc00ce3af783db", "score": "0.4764705", "text": "function start(){\n toonAlfabet(); \n nieuwSpel();\n}", "title": "" }, { "docid": "867d8b07d53a5b3509713b51de8220c9", "score": "0.47604215", "text": "function SetVLTAllMachines() {\n for (var machineNumber = 1; machineNumber <= getMachines().Count; machineNumber++) {\n VLT = getMachines()[machineNumber].GetIp().split('.')[3];\n //getMachines()[machineNumber].SetVLT(VLT, 3757);// todo: uncomment when using quixant\n //print(\"Machine with idx \" + machineNumber + \" has now the VLT \" + VLT);// todo: uncomment when using quixant\n }\n setTimeout(\"startAll\", 20000, \"cashInAndStartPlayAllMachines()\");\n}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.475457", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.475457", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.475457", "text": "start() {}", "title": "" }, { "docid": "b7659b2c9c386877c3670e6ccf405821", "score": "0.47519097", "text": "function nextTimeSlots() {\n //Add code to update table with next day's locally stored values\n //Add code to change jumbatron sub-heading to show next date instead of current\n //I ran out of time to do this\n}", "title": "" }, { "docid": "dd1229304d31bba4e914ebe2701a1c03", "score": "0.47508866", "text": "function startClock() {\n\tvar timeConversion = 60 * timeCalculationNum, display = document.querySelector('#time');\n masterTimer(timeConversion, display);\n\n\t// change background and title\t\n\tdocument.body.style.background = \"#009631 url('../pomodoro/img/green_tomato.jpg') no-repeat center top\";\n\tdocument.getElementById(\"title\").innerHTML = \"Get to work!\";\n\n\t// remove zoom class so we can reuse it later\n\t$(document).ready(function() {\n\t\t$(\"#clock\").removeClass(\"animated pulse\");\n\t});\n\n\t// show stop button, hide start button\t\n\tdocument.getElementById(\"start\").style.display = \"none\";\n\tdocument.getElementById(\"stop\").style.display = \"block\";\n}", "title": "" }, { "docid": "042194f4ba3ce450d1096ef4b503f6af", "score": "0.47507635", "text": "function start() {\n\n /* Initialization of 'currTime' variable to store the current time of the \n * system everytime user calls it.\n */\n currTime = new Date().getTime();\n return;\n}", "title": "" }, { "docid": "7822a32382f6e0b379eaecd049ee3347", "score": "0.47490692", "text": "start()\n {\n\n }", "title": "" }, { "docid": "17c000003673e1d9f79a423e60f894a2", "score": "0.47458354", "text": "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tgetCleaningTimerData(function(){\r\n\t\t\tdisplaySetCleaningTimer(function(){\r\n\t\t\t\tloadlast();\r\n\t\t\t});\r\n\t\t});\t\r\n\t});\r\n}", "title": "" }, { "docid": "80724e503da39dbe05ce92caa96d92b2", "score": "0.474287", "text": "function do_start(){\n\t\t\tif( active ==0)\n\t\t\t\treturn;\n\t\t timeObject.timer = setInterval(do_time, 100);\n\t\t}", "title": "" }, { "docid": "c3d4495ba5f4c69265f38eea5e728c5b", "score": "0.4742292", "text": "Start()\n {\n\n }", "title": "" }, { "docid": "d56afd556c73d09b5b43285335ad6e2b", "score": "0.47421107", "text": "function runSniper() {\n var Code_1 = GenerateCode(3);\n var Code_2 = GenerateCode(3);\n var Code_3 = GenerateCode(4);\n var Code_Combined = Code_1 + Code_2 + Code_3;\n var ZoomLink = 'https://zoom.us/j/';\n var ZoomFormat = Code_1 + '-' + Code_2 + '-' + Code_3;\n if (ID == 0) {\n ID = 1;\n } else {\n ID = ID + 1;\n }\n writeLog(ZoomLink + Code_Combined + '\\n' + ZoomFormat + '\\n \\n');\n // Generates each code per tick.\n function GenerateCode(length) {\n var result = '';\n var characters = '0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }\n}", "title": "" }, { "docid": "78322831695894dc43e2221ba40a5275", "score": "0.4740377", "text": "function startTimeBasedSync() {\n\n rsyncFactory.loadConfig();\n // draw sync panels\n document.querySelector('#settingsList').innerHTML = returnPanels(_appSettings.config.syncConfigs.length);\n\n // set up time based sync for each config.\n setTimeout(() => {\n _appSettings.config.syncConfigs.forEach((element, id) => { \n if(element.autosync && !rsyncFactory.getStartedSyncIds().includes(id) ) {\n startSync(id);\n }\n });\n }, 1000);\n\n\n var co = 0;\n _appSettings.config.syncConfigs.map((config, id) => { \n\n // statusbar\n document.querySelectorAll('#settingsList > .controlPannel')[co].querySelector('.status-pannel').innerHTML = rsyncFactory.getLastSyncStatus([co]);\n\n // attach panel events.\n document.querySelectorAll('#settingsList > .controlPannel')[co].querySelector('.label').innerText = config.title;\n document.querySelectorAll('#settingsList > .controlPannel')[co].setAttribute('key', co);\n // push button\n document.querySelectorAll('#settingsList > .controlPannel')[co].querySelector('.buttonsHolder > .button-push').addEventListener('click', function(e) { \n var id = + e.srcElement.parentElement.parentElement.getAttribute('key');\n rsyncFactory.rsyncConfigId(id, 'push');\n });\n // pull button\n document.querySelectorAll('#settingsList > .controlPannel')[co].querySelector('.buttonsHolder > .button-pull').addEventListener('click', function(e) { \n var id = + e.srcElement.parentElement.parentElement.getAttribute('key');\n rsyncFactory.rsyncConfigId(id, 'pull');\n });\n\n // pulse active syncs \n if(rsyncFactory.getStartedSyncIds().includes(''+ id)) {\n document.querySelector(\".controlPannel[key='0']\").classList.add(\"pulse\"); \n } \n co ++;\n });\n \n}", "title": "" }, { "docid": "6c39aa2546518bd3470d0dc16f2cea33", "score": "0.47398862", "text": "function runStep() {\n\tconsole.log('----------- S T E P -----------');\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\tfor (var i = 0; i < swarm.length; i++) {\n//\t\tconsole.log('********* Boid ' + i + ' *********');\n\t\tswarm[i].updatePosition();\n\t\tswarm[i].display();\n\t}\n}", "title": "" }, { "docid": "97bd2755b43eabc83560444b1aa85b04", "score": "0.47364002", "text": "function time() {\n\tif(arguments[0] == \"all\") { \n for(i = 0; i < play_num; i++){\n pl[i].message(\"timestretch\", arguments[1]);\n }\n\t} else if (typeof arguments[0] == \"number\"){ \n\t\tpl[(arguments[0]-1)].message(\"timestretch\", arguments[1]);\n\t}\n}", "title": "" }, { "docid": "fe3bf57c71c8b2345e12e7e3c76b0d20", "score": "0.47353005", "text": "function C006_Isolation_Yuki_Run() {\n\tBuildInteraction(C006_Isolation_Yuki_CurrentStage);\n}", "title": "" }, { "docid": "337b66810450374d66a628c42f5c9884", "score": "0.47331893", "text": "async function playSounds(allNoteArrays, allTimeArrays) {\n let schedule = Scheduler.scheduleNotes(allNoteArrays, allTimeArrays, twoMeasures, sixteenthNote)\n console.log(schedule)\n for(let i =0; i < twoMeasures; i+=sixteenthNote){\n if(schedule[i].length > 0){\n for(let note in schedule[i]){\n let newNote = schedule[i][note]\n await play(newNote,0) \n } \n }await timer(sixteenthNote) \n }\n playSounds(allNoteArrays, allTimeArrays)\n }", "title": "" }, { "docid": "3334ec2a9483531e7a625bf82a5f5afd", "score": "0.4724938", "text": "function automationFunction(){\n \n //gets the current week games\n //scheduled to run once at 1am Tuesday\n cron.schedule('0 1 * * 2', function(){\n getGamesFromNfl();\n });\n \n //gets NFL scores for the previous week\n //scheduled to run once at 1:05am Tuesday\n //this also judicates outstanding bets\n cron.schedule('5 1 * * 2', function(){\n updateNflScores();\n });\n\n //gets the current nfl odds\n //scheduled to run at 2am, 8am, and 4pm on Tuesdays\n cron.schedule('0 2,8,16 * * 2', function(){\n updateOdds();\n });\n\n //deletes unaccepted bets if game has started\n //scheduled to run every 15 minutes between 10am and 9pm Monday, Tuesday, Thursday, and Sunday\n cron.schedule('0,15,30,45 10-18 * * 1,2,4,7', function(){\n closeBets();\n });\n\n //runs the judge to ensure bets have been adjudicated\n //scheduled to run once at 1:10am Tuesday\n cron.schedule('10 1 * * 2', function(){\n theJudge();\n });\n\n}", "title": "" }, { "docid": "c989089c00ea925c6a13388d4a67995a", "score": "0.47235242", "text": "function runNow() {\n cancelTimer = null;\n start = null;\n runScheduledForNextTick = false;\n var copyList = queue.slice(0);\n queue = [];\n angular.forEach(copyList, function (parts) {\n parts[0].apply(parts[1], parts[2]);\n });\n }", "title": "" }, { "docid": "09d3fea03f394cf9fef6cee572dc2d34", "score": "0.4721698", "text": "start() {\n }", "title": "" }, { "docid": "c7c1a719b563f97f6e8d5370aa5a6ba7", "score": "0.47210473", "text": "start()\n\t{\n\t\t// start the main game loop\n\t\tzSquared.startMain(this._getMainloopUpdateFn())\n\t}", "title": "" }, { "docid": "682da74dff986b3e866aabe9c806ae1a", "score": "0.47126254", "text": "started() {\r\n\r\n\t}", "title": "" }, { "docid": "7eb9b20fa4af05a0eb15471c299501ac", "score": "0.47096795", "text": "function startAutoPlay() {\n\t\t$( '[data-vc-tta-autoplay]' ).each( function () {\n\t\t\t$( this ).vcTtaAutoPlay();\n\t\t} );\n\t}", "title": "" }, { "docid": "b195664b1c9b43ac8c8d3c25ff8deeb8", "score": "0.4709426", "text": "goTimeline() {\n this.time = 1.5\n this.tl_master = gsap.timeline( { paused: true } )\n .add( ()=> $(this.intro.preloader).remove() )\n .add(this.tl_header_hold_init)\n .add(this.tl_each_header_img.tweenFromTo(0,this.tl_each_header_img.totalDuration(), { duration: 2, ease: 'none' } ), \"<+=1\")\n .add(this.header_hl_img)\n\n\n //second stage\n .add(this.tl_header_hold_done)\n .add(this.tl_header_imgs, \"<\" )\n .add(this.logo_paths, '-=.4')\n .add(this.tl_fixeds, '-=.25')\n .add(this.tl_bg_menu, \"-=1.75\")\n .add(this.tl_texts, \"-=.7\")\n .add(this.tl_border_holder)\n .set('.index', { overflowY: 'auto', pointerEvents: 'inherit' }, \"-=1\" )\n\n\n $(this.intro.cookie).length > 0 ? this.tl_master.add(this.tl_cookies) : null\n }", "title": "" }, { "docid": "bca619295f2e385c9a5492bcc1233622", "score": "0.47082356", "text": "function fn_startmastery1(sid,lessonid,maxid,check)\n{\n $('#fottitle').html('');\n\t//alert(sid+\"~\"+lessonid+\"~\"+maxid);\n\tif(sid=='' || sid==undefined){\n\tvar sid = $('#scheduleid').val();\n\tvar lessonid = $('#lessonid').val();\n\tvar maxid = $('#maxid').val();\n\t}\n\tvar iframe = document.createElement(\"IFRAME\");\n\tiframe.setAttribute(\"src\", \"js-framestart:\"+lessonid);\n\tdocument.documentElement.appendChild(iframe);\n\tiframe.parentNode.removeChild(iframe);\n\n var browcheck = detectmob();\n\t if(browcheck == \"android\" ) {\n \tAndroidFunction.getValue(\"js-framestart:\"+lessonid);\n }\n\tiframe = null;\n\tvar uid = $('#uid').val();\n\t\t//if(check==1)\n\t\t\t//clearInterval(interval); //this is for remove the setinterval function started from the oper= lessonplay in ajaxpage\t\n\t\tvar dataparam=\"oper=mastery1start&lessonid=\"+lessonid+\"&maxid=\"+maxid+\"&sid=\"+sid+\"&uid=\"+uid;\t\t\n\t\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: 'ipad-assignment-ajax.php',\n\t\tdata: dataparam,\n\t\tbeforeSend:function(){\t\t\t\n\t\t\t//showloadingalert(\"Loading, please wait.\");\n\t\t\t$('#divlbcontent').html(loadcontent);\n\t\t},\n\t\tsuccess: function(data){\n\t\t\tdata = data.split('~');\t\t\t\t\n\t\t\t$('.dialogTitleFullScr').html(data[1]);\t\t\t\n\t\t\t$('#divlbcontent').html('');\n\t\t\t$('#divlbcontent').html(trim(data[0]));\n\t\t\t//closeloadingalert();\n\t\t\t$('#fottitle').html('Mastery Test 1');\t\n\t\t\t}\n\t\t});\t\n}", "title": "" }, { "docid": "e221d11de57b2986cd1c1847b3ea4b64", "score": "0.46964735", "text": "scaleScreenAndRun() {\n\n this.scaleScreen();\n\n if(this.isRunning) {\n this.stop();\n } else {\n this.intro();\n }\n\n }", "title": "" }, { "docid": "c28495f4604436c4ccd6875c97bc5598", "score": "0.4686682", "text": "start(){\n this.buildTeamBoxes();\n }", "title": "" }, { "docid": "d7e822638b820feae55e59c409134a85", "score": "0.46864623", "text": "async function run () {\n if (cli.input[0] === 'quad') {\n await main.quadBirds(cli.flags)\n } else if (cli.input[0] === 'towns') {\n await main.towns(cli.flags)\n } else if (cli.input[0] === 'regions') {\n await main.regions(cli.flags)\n } else if (cli.input[0] === 'big') {\n cli.flags.list = undefined\n let timespan = 'year'\n let biggest = await main.biggestTime(timespan, cli.flags)\n console.log(`Your biggest ${timespan} was ${biggest.Date} with ${biggest.SpeciesTotal} new species.`)\n timespan = 'month'\n biggest = await main.biggestTime(timespan, cli.flags)\n console.log(`Your biggest ${timespan} was ${moment(biggest.Date, 'YYYY-MM-DD').format('MMMM YYYY')} with ${biggest.SpeciesTotal} new species.`)\n timespan = 'day'\n biggest = await main.biggestTime(timespan, cli.flags)\n console.log(`Your biggest ${timespan} was ${moment(biggest.Date, 'YYYY-MM-DD').format('MMMM Do, YYYY')} with ${biggest.SpeciesTotal} new species.`)\n } else if (cli.input[0] === 'first') {\n cli.flags.list = undefined\n let timespan = 'year'\n let biggest = await main.firstTimes(timespan, cli.flags)\n console.log(`Your newest ${timespan} was ${biggest.Date} with ${biggest.SpeciesTotal} new species.`)\n timespan = 'month'\n biggest = await main.firstTimes(timespan, cli.flags)\n console.log(`Your newest ${timespan} was ${moment(biggest.Date, 'YYYY-MM-DD').format('MMMM YYYY')} with ${biggest.SpeciesTotal} new species.`)\n timespan = 'day'\n biggest = await main.firstTimes(timespan, cli.flags)\n console.log(`Your newest ${timespan} was ${moment(biggest.Date, 'YYYY-MM-DD').format('MMMM Do, YYYY')} with ${biggest.SpeciesTotal} new species.`)\n } else if (cli.input[0] === 'big-year') {\n const timespan = 'year'\n const biggest = await main.biggestTime(timespan, cli.flags)\n console.log(`Your biggest ${timespan} was ${biggest.Date} with ${biggest.SpeciesTotal} species.`)\n if (cli.flags.list) {\n console.log(`With these species: ${_.map(biggest.Species, 'Scientific Name').join(', ')}.`)\n }\n } else if (cli.input[0] === 'big-month') {\n const timespan = 'month'\n const biggest = await main.biggestTime(timespan, cli.flags)\n console.log(`Your biggest ${timespan} was ${moment(biggest.Date, 'YYYY-MM-DD').format('MMMM YYYY')} with ${biggest.SpeciesTotal} species.`)\n if (cli.flags.list) {\n console.log(`With these species: ${_.map(biggest.Species, 'Scientific Name').join(', ')}.`)\n }\n } else if (cli.input[0] === 'big-day') {\n const timespan = 'day'\n const biggest = await main.biggestTime(timespan, cli.flags)\n console.log(`Your biggest ${timespan} was ${moment(biggest.Date, 'YYYY-MM-DD').format('MMMM Do, YYYY')} with ${biggest.SpeciesTotal} species.`)\n if (cli.flags.list) {\n console.log(`With these species: ${_.map(biggest.Species, 'Scientific Name').join(', ')}.`)\n }\n } else if (cli.input[0] === 'first-year') {\n const timespan = 'year'\n const biggest = await main.firstTimes(timespan, cli.flags)\n console.log(`Your newest ${timespan} was ${biggest.Date} with ${biggest.SpeciesTotal} new species.`)\n if (cli.flags.list) {\n console.log(`With these species: ${_.map(biggest.Species, 'Scientific Name').join(', ')}.`)\n }\n } else if (cli.input[0] === 'first-month') {\n const timespan = 'month'\n const biggest = await main.firstTimes(timespan, cli.flags)\n console.log(`Your newest ${timespan} was ${moment(biggest.Date, 'YYYY-MM-DD').format('MMMM YYYY')} with ${biggest.SpeciesTotal} new species.`)\n if (cli.flags.list) {\n console.log(`With these species: ${_.map(biggest.Species, 'Scientific Name').join(', ')}.`)\n }\n } else if (cli.input[0] === 'first-day') {\n const timespan = 'day'\n const biggest = await main.firstTimes(timespan, cli.flags)\n console.log(`Your newest ${timespan} was ${moment(biggest.Date, 'YYYY-MM-DD').format('MMMM Do, YYYY')} with ${biggest.SpeciesTotal} new species.`)\n if (cli.flags.list) {\n console.log(`With these species: ${_.map(biggest.Species, 'Scientific Name').join(', ')}.`)\n }\n } else {\n console.log(cli.showHelp())\n }\n}", "title": "" }, { "docid": "aa96d8332f1edf8d7c2c59c1c52b42eb", "score": "0.46859384", "text": "function start(){\n\t\tsimon.controller.startGame();\n\t}", "title": "" }, { "docid": "45257fead620ef8d06569b519649b979", "score": "0.46824697", "text": "function scheudler() {\n var self = this;\n var _hours = new Date().getHours();\n var _minutes = new Date().getMinutes();\n var tick = function() {\n console.log('tikk');\n var date = new Date();\n var hours = date.getHours();\n var minutes = date.getMinutes();\n if(date.getSeconds() == 0 && _minutes != minutes) {\n _minutes = minutes;\n var timeEvent = (hours <= 9 ? '0' + hours : hours) + ':' + (minutes <= 9 ? '0' + minutes : minutes);\n if(self.listeners(timeEvent).length > 0) self.emit(timeEvent, date, self);\n }\n clearTimeout(t);\n var t = setTimeout(tick, 60000 - (new Date().getTime() % 60000));\n }\n tick();\n}", "title": "" }, { "docid": "ef6c8af4564eec5ae4b038b85623e896", "score": "0.4680126", "text": "function tick() {\n document.querySelector('#clocks').replaceChildren(\n createList(clocksConfig)\n );\n // 3b. Repeat the timer - call for the next click\n setTimeout(tick, 1000);\n}", "title": "" }, { "docid": "daa782dd1ab466a2417eaad62b4718ba", "score": "0.46778795", "text": "function startApp() {\n addStartButtonHandler();\n M.AutoInit();\n $('.modal a').click(reset);\n const formattedTime = formatTime(gameState.countdownTime);\n displayTime(formattedTime);\n}", "title": "" }, { "docid": "c37c04fd4aceb8ab544790110bac4a31", "score": "0.4670968", "text": "detectAutoSpins () {\n if(this.getService(\"AutoPlayService\").isActive()){\n $_event.setEvent(StateEvents.RoundStart);\n }\n\n //if (this.getService(\"AutoPlayService\").isActive() && [\"freespins\"].indexOf(this.getService(\"ProtocolService\").getCurrentAction()) == -1) {\n //$_signal.goTo(\"control.autoSpins.start\");\n //}\n }", "title": "" }, { "docid": "57002a9f277ef3266bce806676f61157", "score": "0.466779", "text": "function main(){\n goRunning();\n \n }", "title": "" }, { "docid": "d62e493f28be4e49c3ffa863f1a6c12e", "score": "0.46650466", "text": "ls(){\n this.emit('response', `Tasls_\\n${this.tasksString()}`)\n }", "title": "" }, { "docid": "a218aae4e1a109265344eb0b4e5f681d", "score": "0.4664038", "text": "function start()\n{ \n buildCharts();\n //make title text for segments visible\n makeTitleTextVisible();\n // make matrix png visible\n makeMatrixVisible();\n console.log(\"==========\");\n}", "title": "" }, { "docid": "6a91d2e6c50d49d2c4f394ca1b944f49", "score": "0.46581128", "text": "function runAllInstructions(){\n\t// Sets a timer to run a instruction every 'runInterval' seconds;\n\tinstructionInterval = setInterval(runInstruction, runIntervalTime);\n\t// Sets a timer to clear the interval after the last instruction is ran.\n\tsetTimeout(()=>{clearInterval(instructionInterval)}, runIntervalTime*instructionList.length);\n}", "title": "" }, { "docid": "55f6a2605999aee103be0716481ec15e", "score": "0.46553987", "text": "function krnRunResidents()\n{\n for(var index = 0, length = _Residents.getSize(); index < length; index++)\n {\n _Scheduler.scheduleProcess(_CPU, _Residents.popBlock());\n }\n}", "title": "" }, { "docid": "a7dc535b91b1b2976a59977b2f252758", "score": "0.4655363", "text": "run(){\n\n\t}", "title": "" } ]
7cba37705053f4c8f617b4b778f1d6e6
open pages here with transitions
[ { "docid": "f1b985172bbebedce73c1a297084ed4e", "score": "0.5820773", "text": "function openPage(path, skipPushState) {\n var article = document.body.querySelector(\"article\")\n //var header = article.querySelector(\"header\")\n article.scrollTop = 0\n Buffer.resize()\n Buffer.fill()\n\n $.get(path)\n .fail(function (error) {\n console.error(error)\n window.location.href = path // Manually open page\n })\n .done(function (htmlString) {\n var dom = document.createElement(\"html\")\n var domNodes = $.parseHTML(htmlString)\n Utility.forEachIn(domNodes, dom.appendChild.bind(dom))\n\n // title\n var titleText = dom.querySelector(\"title\").innerText\n document.querySelector(\"title\").innerText = titleText\n // swap-page html\n swapPage.innerHTML = dom.querySelector(\"#swap-page\").innerHTML\n\n swapPage.style.visibility = \"hidden\"\n // Wait for each image to be loaded\n var newImgs = swapPage.querySelectorAll(\"img\")\n var loadingImgs = Array.prototype.filter.call(newImgs, function (img) {\n return !Utility.isImgLoaded(img)\n })\n var imagesToLoad = loadingImgs.length\n function renderPage () {\n setTimeout( function () {\n Buffer.flush()\n swapPage.style.visibility = \"visible\"\n // from layout\n onSwapLoad()\n }, 10)\n }\n function handleImgLoad () {\n imagesToLoad--\n if (imagesToLoad === 0)\n renderPage()\n }\n if (imagesToLoad > 0)\n for (var i = 0; i < loadingImgs.length; i++) {\n loadingImgs[i].onload = handleImgLoad\n }\n\n else\n renderPage()\n\n // listen on new anchors\n attachListeners(swapPage)\n\n if (!skipPushState)\n history.pushState({path:path}, titleText, path)\n })\n}", "title": "" } ]
[ { "docid": "3fb680cfe64fd9b075c3aa65415286d4", "score": "0.6573066", "text": "function openPage (pageName, elmnt) {\n var i, chartsWrapper, pageLink\n chartsWrapper = document.getElementsByClassName('chartsWrapper')\n for (i = 0; i < chartsWrapper.length; i++) {\n chartsWrapper[i].style.display = 'none'\n }\n pageLink = document.getElementsByClassName('pageLink')\n for (i = 0; i < pageLink.length; i++) {\n pageLink[i].style.backgroundColor = ''\n }\n document.getElementById(pageName).style.display = 'flex'\n elmnt.style.backgroundColor = '#FFFFFF'\n}", "title": "" }, { "docid": "5b6f51ff57013514dd05da93b1af26f0", "score": "0.657235", "text": "function pageSwitch() { \n\n\t\t\t$parent.find('.page-current').fadeOut(1000, function () {\n\t\t\t\t$(this).html($parent.find('.page-new').html());\n\t\t\t\t$(this).fadeIn(1000);\n\n\t\t\t\tnextPage = $parent.find('.page-current .next-page').attr('href');\n\t\t\t\tif (nextPage.length > -1) {\n\n\t\t\t\t\t// this resets the bar animation to zero when a new page is loaded:\n\t\t\t\t\t\n\t\t\t\t\tif (settings.direction == 'vertical') {\n\t\t\t\t\t\tconsole.log('fuseContainerHeight: ' + fuseContainerHeight);\n\t\t\t\t\t\t$fuse.height(fuseContainerHeight);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$fuse.width(fuseContainerWidth);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tanimateFuse();\n\t\t\t\t} else {\n\t\t\t\t\t/***** check this ******/\n\t\t\t\t\t$parent.fadeOut();\n\t\t\t\t}\n\t\t\t\t$parent.find('.page-new').load(nextPage);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "e77593d085c1dc7fd2daf1c15398038c", "score": "0.65219885", "text": "function changeLes6Oef51Page() {\n $.mobile.navigate( \"#les6Oef51\", { transition: 'slide'} );\n }// End function changeLes6Oef51Page()", "title": "" }, { "docid": "475ba1161c91973106c0228bcb420811", "score": "0.6515206", "text": "function changeLes3Oef33Page() {\n $.mobile.navigate( \"#les3Oef33Page\", { transition: 'slide'} );\n }// End function changeLes3Oef24Page()", "title": "" }, { "docid": "a2fcdae84e33b076301026e5bee5d06f", "score": "0.65105927", "text": "function changeLes5Oef1Page() {\n $.mobile.navigate( \"#les5Oef1\", { transition: 'slide'} );\n }// End function changeLes5Oef1Page()", "title": "" }, { "docid": "6b3cb776ad200533fa999fa710c68069", "score": "0.6508215", "text": "function changeLes7Oef61Page() {\n $.mobile.navigate( \"#les7Oef61\", { transition: 'slide'} );\n }// End function changeLes7Oef61Page()", "title": "" }, { "docid": "d2e1120efdfd94718f24eaa857617aef", "score": "0.6493953", "text": "function changeLes6Oef53Page() {\n $.mobile.navigate( \"#les6Oef53\", { transition: 'slide'} );\n }// End function changeLes6Oef53Page()", "title": "" }, { "docid": "2ea6b444e11453d1d3385aa4d42ccdfc", "score": "0.6491115", "text": "function changeLes8OefPage() {\n $.mobile.navigate( \"#les8home\", { transition: 'slide'} );\n }// End function changeLes8OefPage()", "title": "" }, { "docid": "032d7af96fe35db94d67a4fe791eec96", "score": "0.64847934", "text": "function changeLes3Oef23Page() {\n $.mobile.navigate( \"#les3Oef23Page\", { transition: 'slide'} );\n }// End function changeLes3Oef23Page()", "title": "" }, { "docid": "4fb03760040a8fc9db7599795f119f42", "score": "0.64822614", "text": "function changeLes9Oef810Page() {\n $.mobile.navigate( \"#les9Oef810Page\", { transition: 'slide'} );\n }// End function changeLes9Oef810Page()", "title": "" }, { "docid": "8dc827cbd90696e2e9905caa09d94d35", "score": "0.64812624", "text": "function changeLes7Oef72Page() {\n $.mobile.navigate( \"#les7Oef72\", { transition: 'slide'} );\n }// End function changeLes7Oef72Page()", "title": "" }, { "docid": "8bcc212b1e89407dfa36d35aa71efadc", "score": "0.6460645", "text": "function changeLes3Oef322Page() {\n $.mobile.navigate( \"#les3Oef322Page\", { transition: 'slide'} );\n }// End function changeLes3Oef24Page()", "title": "" }, { "docid": "d8851175ba838683c9a6247a52a584ab", "score": "0.64551973", "text": "function changeLes3Oef24Page() {\n $.mobile.navigate( \"#les3Oef24Page\", { transition: 'slide'} );\n }// End function changeLes3Oef23Page()", "title": "" }, { "docid": "47f447cc73da1f4eda68747c99982ea5", "score": "0.6446807", "text": "function changeLes6Oef52Page() {\n $.mobile.navigate( \"#les6Oef52\", { transition: 'slide'} );\n }// End function changeLes6Oef52Page()", "title": "" }, { "docid": "14ba0441fcc3de71c10e5853b18857fd", "score": "0.6443117", "text": "function changeLes10Page() {\n $.mobile.navigate( \"#les10Page\", { transition: 'slide'} );\n }// End function changeLes1Page()", "title": "" }, { "docid": "5faf7c56c5f1fd69f90dd0138afeced6", "score": "0.64193577", "text": "function pageTransition() {\n\n let navLink = document.querySelectorAll(\".nav .nav-link\")\n\n let pages = document.querySelectorAll(\".page\")\n\n navLink.forEach(link => link.addEventListener(\"click\", function (e) {\n\n e.preventDefault()\n\n let dataPage = this.dataset.page;\n\n let section = document.querySelector(dataPage);\n\n active(navLink, \"active\")\n\n this.classList.add(\"active\")\n\n pages.forEach(page => page.style.cssText = \"transform: translateX(100%)\")\n\n section.style.cssText = \"transform: translateX(0); transition-delay:1s\"\n\n if (mobileBtn.classList.contains(\"open\")) {\n\n mobileBtn.parentElement.style.left = \"-25%\"\n\n mobileBtn.classList.remove(\"open\")\n\n }\n\n\n }))\n\n}", "title": "" }, { "docid": "f6e5ad12b45b569e1d68a62b242629ab", "score": "0.6384542", "text": "function openPage(pageName, elmnt) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tab-content\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n tablinks = document.getElementsByClassName(\"tab\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].style.backgroundColor = \"\";\n tablinks[i].style.color = \"\";\n }\n\n document.getElementById(pageName).style.display = \"block\";\n\n elmnt.style.backgroundColor = '#820000';\n elmnt.style.color = 'white'\n}", "title": "" }, { "docid": "806fe0659482fe0962d177754464075e", "score": "0.6379516", "text": "function changeLes3Page() {\n $.mobile.navigate( \"#les3Page\", { transition: 'slide'} );\n }// End function changeLes3Page()", "title": "" }, { "docid": "781ab5de0bb5666395f55cdfb35b0ba2", "score": "0.6364108", "text": "function changeLes5Oef2Page() {\n $.mobile.navigate( \"#les5Oef2\", { transition: 'slide'} );\n }// End function changeLes5Oef2Page()", "title": "" }, { "docid": "80d8cd1a5a7e98ff77fc2be7134d76e7", "score": "0.63636106", "text": "function changeLes7Page() {\n $.mobile.navigate( \"#les7Page\", { transition: 'slide'} );\n }// End function changeLes7Page()", "title": "" }, { "docid": "b3631eadf6e2f95d2c1a3f7d003734f9", "score": "0.63531595", "text": "_onOpen () {\n // Removes the start page.\n this.startPage.classList.add('hidden')\n }", "title": "" }, { "docid": "0e0389f4835786f0bf372b2bd6405dda", "score": "0.634115", "text": "function navnext( next ) {\n\t\t/* $( \":mobile-pagecontainer\" ).pagecontainer( \"change\", next + \".html\", {\n\t\t\ttransition: \"slide\"\n\t\t}); */\n\t\tnext += \".html\";\n\t\t$.mobile.changePage(next, {transition: pageTransition});\n\t\tcloseMenu();\n\t}", "title": "" }, { "docid": "90bf4b9bae8d98d2d6fc132b2e936404", "score": "0.6310407", "text": "function changeLes8Page() {\n $.mobile.navigate( \"#les8Page\", { transition: 'slide'} );\n }// End function changeLes8Page()", "title": "" }, { "docid": "7a39ca47744c70f7ac9d971f0bf6d039", "score": "0.6296042", "text": "function changeLes2Page() {\n $.mobile.navigate( \"#les2Page\", { transition: 'slide'} );\n }// End function changeLes2Page()", "title": "" }, { "docid": "d030782314e0fe06d40899ebba7bc6cf", "score": "0.6256324", "text": "function onOpenNextPageClicked(e) {\r\n}", "title": "" }, { "docid": "81fb2325508de784f4b27e7418123e15", "score": "0.62494713", "text": "show() {\n\t\tlet page = this;\n\n\t\tif (page.params.parentPage) {\n\t\t\tpage.params.parentPage.querySelectorAll(\".page\").forEach((item) => {\n\t\t\t\tif (item == page.container) {\n\t\t\t\t\titem.classList.add(\"page-active\");\n\t\t\t\t\titem.dispatchEvent(new Event(\"pageShow\"));\n\t\t\t\t} else if (item.parentNodeOfClass(\"page\") == page.container.parentNodeOfClass(\"page\") && item.classList.contains(\"page-active\")) {\n\t\t\t\t\titem.classList.remove(\"page-active\");\n\t\t\t\t\titem.dispatchEvent(new Event(\"pageHide\"));\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (page.params.parentView) {\n\t\t\tpage.params.parentView.querySelectorAll(\".pages > .page\").forEach((item) => {\n\t\t\t\tif (item == page.container) {\n\t\t\t\t\titem.classList.add(\"page-active\");\n\t\t\t\t\titem.dispatchEvent(new Event(\"pageShow\"));\n\t\t\t\t} else if (item.parentNodeOfClass(\"page\") == page.container.parentNodeOfClass(\"page\") && item.classList.contains(\"page-active\")) {\n\t\t\t\t\titem.classList.remove(\"page-active\");\n\t\t\t\t\titem.dispatchEvent(new Event(\"pageHide\"));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "cfb21c141604c4b20b8a66edf1a2ae71", "score": "0.6247533", "text": "static goToMain () {\n\t\tconst sub = Navigation.sub\n\t\tconst main = Navigation.main\n\t\tconst target = sub.find('.page>section, .sub-default')\n\t\tconst closeSub = () => {\n\t\t\tsub.fadeOut(500, () => {\n\t\t\t\ttarget.removeClass('active').removeAttr('style')\t// display:none 제거\n\t\t\t\tsub.removeClass('active').removeAttr('style') \t\t// display:none 제거\n\t\t\t\tmain.fadeIn(300, () => {\n\t\t\t\t\tmain.addClass('active')\n\t\t\t\t\tnew Animation({obj:main})\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t\tNavigation.nowPage = -1\n\t\tnew Animation({obj:target, reverse:true, callback:closeSub})\n\t}", "title": "" }, { "docid": "169f3be507da02aa558ea6219111e1c3", "score": "0.6219603", "text": "function Start()\n {\n PageSwitcher();\n\n Main();\n }", "title": "" }, { "docid": "169f3be507da02aa558ea6219111e1c3", "score": "0.6219603", "text": "function Start()\n {\n PageSwitcher();\n\n Main();\n }", "title": "" }, { "docid": "bfa31ecf0550c82d9340ca7a3cb1d1f2", "score": "0.6214178", "text": "function openNewPage(e) {\n if (e.target.classList[0] === 'btn') {\n if (subGalleryHolder.style.display !== 'none') {\n hidePage(subGalleryHolder);\n clearSubGallery();\n }\n\n switchActiveBtn(e.target);\n hidePage(activePage);\n let galleryId = e.target.id.substr(0, e.target.id.length - 4);\n activePage = document.getElementById(galleryId);\n showPage(activePage);\n\n if (galleryId !== 'about') {\n pageContainer = activePage.firstElementChild;\n resizeAllMasonryItems();\n }\n\n window.scrollTo(0, 0);\n }\n}", "title": "" }, { "docid": "f9b9fe44dbca7b10526b75c99b1887ef", "score": "0.6212425", "text": "function show(shown) {\n location.href = '#' + shown;\n pages.forEach(function(page) {\n document.getElementById(page).style.display = 'none';\n });\n document.getElementById(shown).style.display = 'block';\n return false;\n}", "title": "" }, { "docid": "bcfbc40aeb907a02d2883a2ad1536ca6", "score": "0.62043285", "text": "function navnext( next ) {\n\t\t$( \":mobile-pagecontainer\" ).pagecontainer( \"change\", next + \".html\", {\n\t\t\ttransition: \"slide\"\n\t\t});\n\t}", "title": "" }, { "docid": "737991bf996bf53b9b9bb5c22559915a", "score": "0.6186398", "text": "function startShow() {\n curtain.className = \"up moving\";\n for (var i = 0; i < pages.length; i++) {\n pages[i].className = \"pages start\";\n }\n s1chick.className = \"s1chick s1chick-go\";\n s1text.className = \"s1text s1text-go\";\n s2chick.className = \"s2chick s2chick-go\";\n s2text.className = \"s2text s2text-go\";\n s3chick.className = \"s3chick s3chick-go\";\n s3text.className = \"s3text s3text-go\";\n smallDot.className = \"smallDot smallDot-go\";\n medDot.className = \"medDot medDot-go\";\n largeDot.className = \"largeDot largeDot-go\";\n cloud.className = \"cloud cloud-go\";\n s4chick.className = \"s4chick s4chick-go\";\n s4text.className = \"s4text s4text-go\";\n hammer.className = \"hammer hammer-go\";\n impact.className = \"impact impact-go\";\n s5text.className = \"s5text s5text-go\";\n note1.className = \"notes notes-go\";\n note2.className = \"notes notes-go\";\n s6text.className = \"s6text s6text-go\";\n // when show is done reset everything to run again\n resetShow();\n }", "title": "" }, { "docid": "8c725248c9f54f8d18d75cbee141fa0c", "score": "0.61808324", "text": "function pageLoadAnim(){\n\n var url = $(this).attr(\"href\");\n\n // If you just clicked on the self portrait, toggle it.\n if ($(this).is(\"#self-port\")){\n if (window.matchMedia(mediaUpToSidebar).matches) {\n if ( $html.attr('data-masthead') === \"open\" ) {\n $html.attr('data-masthead', \"closed\");\n } else {\n $html.attr('data-masthead', 'open');\n }\n event.preventDefault();\n } else {\n pageLoadAnim(this);\n }\n } else if ($(this).attr(\"target\")){\n return;\n } else {\n // stop that click\n event.preventDefault();\n // invoke loading status\n $body.attr('data-page-status', 'loading');\n // PJAX\n $content.one(window.transitionEnd, function(){\n $.pjax({\n url: url,\n container: \"#content\",\n fragment: \"#content\"\n });\n });\n }\n }", "title": "" }, { "docid": "913bad144f67627db0f59fe2d6645e50", "score": "0.6176552", "text": "function load(){$(\".social .facebook, .social .twitter, .social .linkedin, .social .pinterest\").click(function(o){o.preventDefault(),window.open($(this).attr(\"href\"),\"popupWindow\",\"width=600,height=600,scrollbars=yes\")}),$(\".btotop\").click(function(){return $(\"html, body\").animate({scrollTop:0},800),!1})}", "title": "" }, { "docid": "26e8231594a602bf2cc6b4b69caecea4", "score": "0.61435676", "text": "didShowPage() {}", "title": "" }, { "docid": "4b0e4b37f173b6052327b3457681f2ad", "score": "0.61411345", "text": "function open_page (page_id, show_extra) {\n\tscroll_positions[current_page] = $(\"body\").scrollTop();\n\tprevious_page = current_page;\n\tcurrent_page = page_id;\n\t\n\t//console.log(scroll_positions);\n\t\n\tif(page_id == \"#issues\") view_issue_list();\n\telse if(page_id == \"#single_issue\") view_single_issue(current_item.id);\n\telse if(page_id == \"#task_list\") view_task_list();\n\telse if(page_id == \"#menu\") view_settings(); \n\t\n\tconsole.log(page_id);\n\t\n\t$(\".page\").hide();\n\t$(page_id).show();\n\n\tif(page_id == \"#task_list\" || page_id == \"#issues\" ) $(\"body\").scrollTop(scroll_positions[page_id]);\n\telse window.scrollTo(0, 0);\n}", "title": "" }, { "docid": "d86e012ad8b58d680be88630b982945f", "score": "0.61310184", "text": "function openPage(pageToOpen) {\r\n let path = window.location.href.split('/');\r\n let newPagePath = '';\r\n for(let i = 0; i < path.length; i++) {\r\n newPagePath += path[i]+'/';\r\n if(path[i] === 'public') {\r\n break;\r\n }\r\n }\r\n window.location.href = newPagePath + pageToOpen;\r\n}", "title": "" }, { "docid": "d21b58b6e5de8c379c0f4caf2dc57798", "score": "0.6129194", "text": "function nextPage(){\n parent.window.loadNextPage();\n }", "title": "" }, { "docid": "d21b58b6e5de8c379c0f4caf2dc57798", "score": "0.6129194", "text": "function nextPage(){\n parent.window.loadNextPage();\n }", "title": "" }, { "docid": "3f2f9b7b72eb5a5f20250e936eb5c687", "score": "0.61178184", "text": "function showLoadPage () {\n\tloadpageDiv.className = 'page transition center';\n}", "title": "" }, { "docid": "48b3fa26c4af99fdd23e3c27299d4a52", "score": "0.6100404", "text": "function switchPage(newPage) {\n activePage.style.display = 'none';\n activePage = newPage;\n activePage.style.display = 'block';\n }", "title": "" }, { "docid": "767aab80f0e3d94b508d93fcdcc6594c", "score": "0.60965854", "text": "function transitionCheckupInside() {\n\n var links = document.querySelectorAll('main a[href]:not([target=\"_blank\"])');\n\n var cbk = function(e) {\n\n if (e.currentTarget.href === window.location.href) {\n\n e.preventDefault();\n e.stopPropagation();\n\n } else {\n if ($('body').hasClass('first-load')) {\n $('body').removeClass('first-load');\n }\n }\n };\n\n for (var i = 0; i < links.length; i++) {\n links[i].addEventListener('click', cbk);\n }\n\n}", "title": "" }, { "docid": "e62081aa9c42f9721499e317ecd4d42c", "score": "0.60938615", "text": "function activatePage() {\n for (const el of document.querySelectorAll(\".nav-link\")) {\n if (el.href === window.location.href) {\n el.classList.add(\"active\");\n } else {\n el.classList.remove(\"active\");\n }\n }\n for (const el of document.querySelectorAll(\"main[data-page]\")) {\n if (el.dataset.page === (window.location.hash || \"#/dashboard\")) {\n el.classList.remove(\"hidden\");\n } else {\n el.classList.add(\"hidden\");\n }\n }\n qlik.resize();\n }", "title": "" }, { "docid": "91a9a205f120a148746c0c6431493446", "score": "0.609243", "text": "function startPage() {\n const eventId = getEventIdFromQstring();\n const eventDetails = getEventDetails(eventId);\n setTimeout(() => {\n $('div.links').html(renderLinks(eventId));\n }, 0);\n}", "title": "" }, { "docid": "870166c6176b2547f51bcb7a76af7a55", "score": "0.60914236", "text": "function openNav(callback) {\n var cm = contentMargin;\n options.jq.navContent.fadeIn(options.params.navSpeed / 2);\n options.jq.contentWell.animate({marginLeft: cm}, animConfig(callback));\n options.jq.navContainer.animate({width: cm}, animConfig());\n }", "title": "" }, { "docid": "0651512435d42504891e15b7eca4b094", "score": "0.60904837", "text": "function openPage(pageName, ignoreHistoryPush) {\n window.scrollTo(0,1);\n\n var els = document.getElementsByClassName('page');\n \n for (var i = 0 ; i < els.length ; ++i) {\n els[i].style.display = 'none';\n }\n \n var page = document.getElementById('page-' + pageName);\n \n page.style.display = \"block\";\n \n title = (pageName == 'root') ? 'Hackbook' : pageName.replace(/-/g, ' ');\n document.getElementById('title').innerHTML = title;\n \n if (ignoreHistoryPush != true) {\n window.history.pushState({page: pageName}, '', document.location.origin + document.location.pathname + \"#\" + pageName);\n }\n\n document.getElementById('back').style.display = (pageName == 'root') ? 'none' : 'block';\n}", "title": "" }, { "docid": "46d8b80fe44823295b4a65021248da8e", "score": "0.606759", "text": "function popupPagesLoad() {\n\t\t\t$(document).ready(function() {\n\t\t\t\t$('.js-lightbox').addClass('is-active');\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "b6aaa098aca70136955eaeca80fd5858", "score": "0.60538703", "text": "function changeGamePage() {\n $.mobile.navigate( \"#GamePage\", { transition: 'slide'} );\n }// End function changeLes1Page()", "title": "" }, { "docid": "f863075ecf3de306735c10b0d815fa8b", "score": "0.60411257", "text": "function gotoMusculoskeletonPage(event) {\n window.location.href =\"musculoskeleton.html\";\n}", "title": "" }, { "docid": "ee34be974b4e147d895ce123629148da", "score": "0.6036764", "text": "function gotoPage(p) {\n if (p > 0 && p <= page_count) {\n \n //-----------------------------------------------------\n // add the page number to the page hash to come back to\n // this page if the browser window is reloaded\n //-----------------------------------------------------\n parent.location.hash = \"p\" + p; \n curr_page = p - 1;\n\n //-----------------------------------------------------\n // Set the page number at the bottom of the screen\n //-----------------------------------------------------\n setHtmlText(\"page-number\", \"(p. \" + p + \"/\" + page_count + \")\");\n\n //-----------------------------------------------------\n // Update the left margin for all pages. The CSS rule\n // for pages includes an animated transition on the left\n // margin property\n //-----------------------------------------------------\n var pages = document.querySelectorAll(\".page\");\n for (var i=0; i<pages.length; i++) {\n var page = pages[i];\n page.style.left = (page_width * (i - curr_page)) + \"px\";\n if (curr_page == i) {\n displayPage(page)\n } \n }\n\n //-----------------------------------------------------\n // Handle displaying navigation buttons\n //-----------------------------------------------------\n setHtmlVisibility(\"submit-and-finish-button\", (p < page_count));\n setHtmlVisibility(\"top-next-button\", p < page_count);\n setHtmlVisibility(\"submit-button\", p == page_count);\n setHtmlVisibility(\"bottom-next-button\", p < page_count);\n setHtmlVisibility(\"top-back-button\", p > 1);\n setHtmlVisibility(\"bottom-back-button\", p > 1);\n }\n}", "title": "" }, { "docid": "b47bf9921c57e47b7772b395f13f6775", "score": "0.6034227", "text": "function showPage(target, secondary) {\r\n target.addClass('active');\r\n\r\n const delay = 150;\r\n\r\n // Animate Content\r\n $('.active.section .js-animated-content').velocity('transition.slideDownIn', {\r\n stagger: delay,\r\n });\r\n\r\n $('.active.section .js-animated-video').velocity('transition.fadeIn');\r\n\r\n\r\n // Animate navigation\r\n if (secondary !== true) {\r\n $('.js-section-nav').css('visibility', 'visible');\r\n $('.js-section-nav .section-nav-elem').velocity('transition.slideLeftIn', {\r\n stagger: delay,\r\n });\r\n }\r\n\r\n // Animate scroll-bar\r\n setTimeout(() => {\r\n $('.active.section .js-scroll-bar').velocity({\r\n translateX: '40px',\r\n opacity: 1,\r\n }, {\r\n easing: 'easeOutExpo',\r\n duration: 750,\r\n complete () {\r\n\t\t\t\t\t\ts.app.trigger('animation.finished');\r\n\t\t\t\t\t},\r\n });\r\n }, delay * 3);\r\n\r\n }", "title": "" }, { "docid": "abae7e75a22cdd6dacc0ff718a846361", "score": "0.6033226", "text": "function openPage(evt, pageName) {\n clearAllInterval();\n audioGame.pause();\n audioGame.currentTime = 0;\n // Declare all variables\n let i, tabcontent, tablinks;\n\n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n\n // Show the current tab, and add an \"active\" class to the button that opened the tab\n document.getElementById(pageName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "title": "" }, { "docid": "dc9e30faac9705c587ff7aa4eb2b6d9c", "score": "0.6029377", "text": "function pageTransitionIn() {\r\n // *Everything is hidden on startup\r\n // Get 69 Logo\r\n var logo = document.querySelector('#navLogo');\r\n // Get White Screen Dropdown\r\n var pgTrans = document.querySelector('#page-transition');\r\n\r\n // Show everything that is initially hidden (To have smooth white transitions)\r\n document.body.style.visibility = \"visible\";\r\n // White Screen is dropped down initially\r\n pgTrans.classList.add(\"downed\");\r\n\r\n // Move 69 Logo from center to Top\r\n setTimeout(function () {\r\n logo.classList.remove(\"pageCenterIn\");\r\n logo.classList.add(\"pageTop\");\r\n }, 1000);\r\n // Slide up White Screen\r\n setTimeout(function () {\r\n pgTrans.classList.add(\"upped\");\r\n }, 1100);\r\n}", "title": "" }, { "docid": "8d72ac360fcafd5bfe8dc6a16770b9d0", "score": "0.6026531", "text": "function nextPage(){\n\t\tparent.window.loadNextPage();\n\t}", "title": "" }, { "docid": "c1b1a60ad24676cf12eda84814e22ada", "score": "0.6012864", "text": "function openHistoryPage() {\n renderHistory();\n $(\"#start-screen\").addClass(\"hide\");\n $(\"#setup-screen\").addClass(\"hide\");\n $(\"#game-screen\").addClass(\"hide\");\n $(\"#history-screen\").removeClass(\"hide\");\n}", "title": "" }, { "docid": "5c0f5d40bb9dd409cc8cdd89e1b2517a", "score": "0.60124254", "text": "function animaPage() {\n clearInterval(timer);\n MainPage.innerHTML = animationPage;\n history.pushState({ dataPage1: \"one\" }, null, \"?name == firstPage\");\n getlatAndLong();\n redirectingPage();\n refFunction();\n }", "title": "" }, { "docid": "457e89f1fe75c93d47cc4eac60fa705d", "score": "0.6009504", "text": "function openPane(url, scrolled, push) {\n $('.content-pane').toggle();\n $('body').addClass('content-pane-open');\n $('.content-pane-wrapper').addClass('show');\n $('.content-pane').addClass('show');\n\n $.get(url, function (html) {\n var $html = $('<div />').append(html)\n var title = $html.find('title').text()\n if (push) history.pushState({\n pane: true\n }, title, url)\n document.title = title\n $('.content-pane-text').html($html.find('.content-pane-text').html())\n afterLoadPane()\n\n })\n }", "title": "" }, { "docid": "2881c108d614c03021e84855594e8386", "score": "0.60073125", "text": "function _navToPage(pageName) {\n $.get(`pages/${pageName}/${pageName}.html`, function(data) {\n $(\"#app\").html(data);\n });\n }", "title": "" }, { "docid": "8bfda561c614adef5f24ba631dde3f64", "score": "0.59875053", "text": "function openPage(pageName, elmnt, color) {\n // Hide all elements with class=\"tabcontent\" by default */\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Remove the background color of all tablinks/buttons\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].style.backgroundColor = \"\";\n }\n\n // Show the specific tab content\n document.getElementById(pageName).style.display = \"block\";\n\n // Add the specific color to the button used to open the tab content\n elmnt.style.backgroundColor = color;\n \n // ładowanie zawartiosci ze stron zewnetrznych\n var subpageHome = new XMLHttpRequest();\n subpageHome.open('GET', 'mwmHTML/home.html', false);\n subpageHome.send();\n document.getElementById('subpageHome').innerHTML = subpageHome.response;\n \n var subpageCalendar = new XMLHttpRequest();\n subpageCalendar.open('GET', 'mwmHTML/daty.html', false);\n subpageCalendar.send();\n document.getElementById('subpageCalendar').innerHTML = subpageCalendar.response;\n \n var subpageGallery = new XMLHttpRequest();\n subpageGallery.open('GET', 'mwmHTML/gallery.html', false);\n subpageGallery.send();\n document.getElementById('subpageGallery').innerHTML = subpageGallery.response;\n \n var subpageMedia = new XMLHttpRequest();\n subpageMedia.open('GET', 'mwmHTML/media.html', false);\n subpageMedia.send();\n document.getElementById('subpageMedia').innerHTML = subpageMedia.response;\n \n var header = new XMLHttpRequest();\n header.open('GET', 'mwmHTML/header.html', false);\n header.send();\n document.getElementById('headerPage').innerHTML = header.response;\n \n var footer = new XMLHttpRequest();\n footer.open('GET', 'mwmHTML/footer.html', false);\n footer.send();\n document.getElementById('footerPage').innerHTML = footer.response;\n}", "title": "" }, { "docid": "262b6fef6c85fb287bdaf02673c8ce69", "score": "0.596484", "text": "function openNextPage()\r\n{\r\n if (alreadyOpenedNextPage)\r\n {}// don't do anything if already opened\r\n else\r\n {\r\n window.open(nextPageUrl);\r\n alreadyOpenedNextPage = true;\r\n nextPageLoadStatus.innerHTML = \"Next page opened\";\r\n }\r\n}", "title": "" }, { "docid": "eb799f9d997d71da3fe9006f049ee201", "score": "0.5957348", "text": "open(page) {\n return super.open('gcweb', `gcweb-refTop-${page}.html`);\n }", "title": "" }, { "docid": "37caab3b46b696b987e5be6629b4f18c", "score": "0.59529024", "text": "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-overview/page-overview.html\");\n let css = await fetch(\"page-overview/page-overview.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n if(window.location.hash === \"#/Favorites\"){\n this._renderFavorites(pageDom);\n let herzIcon = document.getElementById(\"menu_heart\");\n herzIcon.classList.remove(\"icon-heart\");\n herzIcon.classList.add(\"icon-heart-filled\");\n } else {\n this._renderRecipes(pageDom);\n let herzIcon = document.getElementById(\"menu_heart\");\n herzIcon.classList.remove(\"icon-heart-filled\");\n herzIcon.classList.add(\"icon-heart\");\n } \n\n this._app.setPageTitle(\"Mein Rezeptbuch\");\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n }", "title": "" }, { "docid": "d68044640265eb3a797d3cbc812e064e", "score": "0.59504", "text": "navigate(page, pushState=true){\n\n if(pushState)window.history.pushState(\"\", \"\", page);\n\n\n\n let cardViewer = this.getCardViewer();\n if(cardViewer!=false && (page!=\"/search\" && page!=\"/\")){\n cardViewer.view(page);\n }else{\n $(\"#content\").fadeOut(500, () => {\n let pageView = this.getPageMaps()[page];\n\n //if there is no route avaible for current page, use the '*' route\n if(pageView==undefined) pageView = this.getPageMaps()[\"*\"];\n\n\n let pageTitle = pageView.getTitle();\n if(pageTitle!=false)document.title = pageTitle;\n\n //after page is done rendering, fade it in for style points\n let x = pageView.render().then(()=>{\n this.currentPage = pageView;\n $(\"#content\").fadeIn(500);\n });\n\n\n\n });\n }\n\n\n }", "title": "" }, { "docid": "6d951ff5f4669d199fa3b935a92a89ac", "score": "0.59414554", "text": "function _next() {\n pages.each(function(i) {\n var posLeft = '-=' + String(settings.winWidth) + 'px';\n $(this).animate({\n top: '0px',\n left: posLeft\n }, settings.duration);\n });\n settings.currentIndex += 1;\n }", "title": "" }, { "docid": "367e8bca5c06cde106fdca5a5c7b2c48", "score": "0.5926943", "text": "function openPage(pageName,button) {\r\n // Hide all elements with class=\"tabcontent\" by default */\r\n var i, tabcontent, tablinks;\r\n stopMusic();\r\n tabcontent = document.getElementsByClassName(\"tabcontent\");\r\n for (i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n\r\n // Remove the background color of all tablinks/buttons\r\n tablinks = document.getElementsByClassName(\"tablink\");\r\n for (i = 0; i < tablinks.length; i++) {\r\n tablinks[i].classList.remove(\"active\");\r\n }\r\n\r\n // Show the specific tab content\r\n var tab = document.getElementById(pageName);\r\n tab.style.display = \"block\";\r\n button.classList.add(\"active\");\r\n if(pageName === 'Login' || pageName === 'Register' || pageName === 'Game'){\r\n if(button.id !== pageName+\"Header\"){\r\n $(\"#\"+pageName+\"Header\").addClass(\"active\");\r\n \r\n }\r\n }\r\n}", "title": "" }, { "docid": "b3ecc33f221a3dcd184ee3aeb5d00281", "score": "0.59266675", "text": "static goToPage () { Navigation.goToPageReal($(this).index()) }", "title": "" }, { "docid": "e4702be37cfe6720b4876a140890f018", "score": "0.5924409", "text": "function navigate(n) {\n var position = currentPosition();\n var numSlides = document.getElementsByClassName('slide').length;\n\n /* Positions are 1-indexed, so we need to add and subtract 1 */\n var nextPosition = (position - 1 + n) % numSlides + 1;\n\n /* Normalize nextPosition in-case of a negative modulo result */\n nextPosition = (nextPosition - 1 + numSlides) % numSlides + 1;\n\n document.getElementById('slide-' + position).classList.add('hidden');\n document.getElementById('slide-' + nextPosition).classList.remove('hidden');\n if(isDebugMode()) {\n updateURL();\n }\n updateProgress();\n updateTabIndex();\n}", "title": "" }, { "docid": "a6602d23ca42d47723601a4d61260ea6", "score": "0.59221417", "text": "function openPageDelayed() {\n //Set the page countdown to open the article\n setTimeout(function () {\n var win = window.open($scope.randomArticleUrl, '_blank');\n win.focus();\n }, 8000)\n }", "title": "" }, { "docid": "6c864144808db4e0661ab322762babd8", "score": "0.5921965", "text": "function navigateTo() {\n let viewName = $(this).attr('data-target');\n showView(viewName)\n }", "title": "" }, { "docid": "e3a36671dbcea2572dccb0dbe47eab3c", "score": "0.59146863", "text": "function nextPage() {\n gotoPage(curr_page + 2);\n setHtmlOpacity(\"status\", 1);\n window.setTimeout(function () { setHtmlOpacity(\"status\", 0); }, 1000); \n}", "title": "" }, { "docid": "8428108764f98942021c8b6ed7fca0e9", "score": "0.5904122", "text": "function moreTopics() {\r\n window.location.href = \"./topic.html\";\r\n}", "title": "" }, { "docid": "22f763bfb840b97a06fcf34956e421f7", "score": "0.5899617", "text": "function goMainPage(event) {\n event.preventDefault();\n eventPage.classList.add(\"hidden\");\n mainPage.classList.remove(\"hidden\");\n handleUrl();\n}", "title": "" }, { "docid": "1d7c9c7008584c18b1d4b5106929c9bf", "score": "0.5893832", "text": "function openPage(pageName, elmnt, color) {\n // Hide all elements with class=\"tabcontent\" by default */\n var i, tabcontent, filter;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n \n \n \n \n document.getElementById(pageName).style.display = \"block\";\n \n }", "title": "" }, { "docid": "a1804778c543909ca8845f181e5cbdf9", "score": "0.5893649", "text": "function openPage() {\n\n setInterval(titleRender, 50);\n}", "title": "" }, { "docid": "2542bcb121a98a98e665c448d378173a", "score": "0.5886421", "text": "function revealSite() {\n\t$('.extraOne').fadeIn();\n\thideSections();\n\tremoveLocation();\n\t$('#breakdownLink').addClass('currentLocation');\n\tsinglePageView();\n\t//console.log(\"site has been revealed\");\n\tif(zipUploaded) {\n\t\t$('.extraTwo').fadeIn();\n\t}\n\tendLoadingAnimation();\n\t\n\twindow.location.hash = '#upload';\n\t\n}", "title": "" }, { "docid": "31e571c013b29878ebcf10a5ea4fa101", "score": "0.5880518", "text": "function nextPageThree() {\r\n\r\n var url = \"appThree.html\";\r\n window.location.href = url;\r\n\r\n}", "title": "" }, { "docid": "8367a9d374fce3064493f1108871a20b", "score": "0.5868974", "text": "function openCteInfo() {\n homePage.hide();\n ctePage.show();\n caseStudiesPage.hide();\n sourcesPage.hide();\n\n }", "title": "" }, { "docid": "ab315b8366af9ef1cbe1bf4898d3f7db", "score": "0.5867537", "text": "function goToPage(pageNr){\r\n\r\n}", "title": "" }, { "docid": "3614c75bf3542acd1ed391ddf6cd88e7", "score": "0.5862765", "text": "function animateRoute(page) {\n animateCurtain()\n animateCurtain1()\n animatePage(page)\n}", "title": "" }, { "docid": "83e0735592a45a4c10833990924b992d", "score": "0.5861932", "text": "function toMusicPage() {\n $(\"#mood-page\").hide();\n $(\"#booze-page\").hide();\n $(\"#music-page\").show(); \n}", "title": "" }, { "docid": "38ba0045e6e295d1444c1b64e633ced8", "score": "0.58534646", "text": "function goTo(destPage){\r\n\t$(\".page\").css(\"visibility\", \"hidden\");\r\n\t$(destPage).css(\"visibility\", \"visible\");\r\n}", "title": "" }, { "docid": "5baf0c6d188ea1892c21754e54802e3c", "score": "0.58520114", "text": "function toLandingPage() {\n $(\"#age-verification-page\").hide();\n $(\"#mood-page\").hide();\n $(\"#music-page\").hide();\n $(\"#kids-page\").hide();\n $(\"#booze-page\").hide();\n $(\"#results-page\").hide();\n $(\"#landing-page\").show();\n}", "title": "" }, { "docid": "2ffbc73598656dc4407a405dad2dcc57", "score": "0.5847284", "text": "function newpage2(){\n window.location = \"loadingpage.html\";\n }", "title": "" }, { "docid": "d9525fc9e565c3e3f47639b0e53dcd1c", "score": "0.5843313", "text": "function openingPage() {\n openScreen = \"<p class='text-center main-button-container'><a class='btn btn-warning btn-md btn-block start-button' href='#' role='button'>Start Quiz</a></p>\";\n $(\"#mainArea\").append(openScreen);\n }", "title": "" }, { "docid": "0038a15009761f99934eb8cd38dbd03e", "score": "0.5839765", "text": "function changepage(page)\n\t{\n\tparent.content.location.href = page;\n\t}", "title": "" }, { "docid": "5da7f3ed000ed258cb65e1ed5becc0d3", "score": "0.5835108", "text": "function TermsButtonClickHandler()\n{\n SlideToPage('terms.html');\n}", "title": "" }, { "docid": "3a8600b2fb824abd2b745b8218244917", "score": "0.5829115", "text": "function nextPage() {\n\tswitch (findActivePage()) {\n\t\tcase 1:\n\t\t\tpage1.style.display = \"none\";\n\t\t\tpage2.style.display = \"flex\";\n\t\t\tpage3.style.display = \"none\";\n\t\t\tpage4.style.display = \"none\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tpage2.classList.remove(\"page2-appear\");\n\t\t\tpage3.classList.add(\"page3-appear-only-fade\");\n\t\t\tpage1.style.display = \"none\";\n\t\t\tpage2.style.display = \"none\";\n\t\t\tpage3.style.display = \"flex\";\n\t\t\tpage4.style.display = \"none\";\n\t\t\tsetTimeout(() => inputName.focus(), 1000); // autofocus to name field\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tpage3.classList.remove(\"page3-appear\");\n\t\t\tpage4.classList.add(\"page4-appear-only-fade\");\n\t\t\tpage1.style.display = \"none\";\n\t\t\tpage2.style.display = \"none\";\n\t\t\tpage3.style.display = \"none\";\n\t\t\tpage4.style.display = \"flex\";\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "6e4e37c5d0225bdd66da9744a04af579", "score": "0.5825055", "text": "function onOpen(e) {\n SlidesApp.getUi()\n .createAddonMenu() \n .addItem(\"Add page numbers\", \"insertPageNumber\")\n .addItem(\"Remove page numbers\", \"removeAllPageNumber\")\n .addSeparator()\t\n .addItem(\"Add template\", \"insertPageNumberTemplate\")\n .addItem(\"Add custom page numbers\", \"insertPageNumberBasedOnTemplate\")\n .addSeparator()\t\n .addItem(\"Advanced\", \"showSidebar\")\n .addToUi(); \n}", "title": "" }, { "docid": "0cea7dafc1fdeaa778eca4d514f88a56", "score": "0.5824473", "text": "function togglePage(e, page) {\n // for smooth scrolling when click on button or links\n window.scroll({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n // variabke for tabs\n const tablinks = document.getElementsByClassName('tablinks');\n\n // variable for blocks\n const blockContent = document.getElementsByClassName('blocks');\n\n // setting all blocks content to display to hide\n for (let element of blockContent) {\n element.style.display = 'none';\n }\n\n // iterating through each tablinks and removing class to reset sytles\n for (let tab of tablinks) {\n tab.className = tab.className.replace(' active', '');\n tab.className = tab.className.replace(' aniAttribute', '');\n tab.style.border = 'none';\n tab.style.borderBottom = '1px transparent solid';\n }\n\n // adding classes based on element click\n document.getElementById(page).style.display = 'block';\n e.currentTarget.className += ' active';\n e.currentTarget.className += ' aniAtribute';\n}", "title": "" }, { "docid": "0fdaed8350fc6141d3321032f7146fd0", "score": "0.582401", "text": "function pageBtn(){\n // In HTML5 AD\n $('.p0-html5').on('click', function(event){\n var is_first = true;\n \n $('.html5-ad')\n .css('display', 'block')\n .animate({\n opacity: 1\n }, 500, 'ease-out', function(){\n if(is_first){\n // play a movie\n p2Ai();\n is_first = false;\n }\n });\n });\n\n // In UI AD\n $('.p0-ui').on('click', function(event) {\n var is_first = true;\n\n $('.ps-ad')\n .css('display', 'block')\n .animate({\n opacity: 1\n }, 500, 'ease-out', function(){\n if(is_first){\n // play a movie\n p1Ai();\n is_first = false;\n }\n });\n });\n\n // Return Home\n $('.p2-home').on('click', function(event) {\n if($(event.target).is('.p2-home')){\n $('.page2')\n .animate({\n opacity: 0\n }, 500, 'ease-out', function(){\n $(this).css('display', 'none');\n });\n }\n });\n $('.p1-home').on('click', function(event) {\n $('.page1')\n .animate({\n opacity: 0\n }, 500, 'ease-out', function(){\n $(this).css('display', 'none');\n });\n });\n}", "title": "" }, { "docid": "63993ae9468c2e6bc9f67179f97ffc47", "score": "0.5818748", "text": "function openPage(pageName, elmnt, color) {\n // Hide all elements with class=\"tabcontent\" by default */\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Remove the background color of all tablinks/buttons\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].style.backgroundColor = \"\";\n }\n\n // Show the specific tab content\n document.getElementById(pageName).style.display = \"block\";\n\n // Add the specific color to the button used to open the tab content\n elmnt.style.backgroundColor = color;\n}", "title": "" }, { "docid": "2152f606503038b95bc6892a1fcf5903", "score": "0.581774", "text": "AsidePanelPages(){\n\t\t// All positions in navbar\n\t\tconst navs = document.querySelectorAll(\".pages-nav li\");\n\t\t// All pages\n\t\tconst pages = document.querySelectorAll(\".pages li\");\n\t\t// For each position add onclick function\n\t\tnavs.forEach((nav) => {\n\t\t\tnav.addEventListener(\"click\", () => {\n\t\t\t\tconst index = Array.from(navs).indexOf(nav);\n\t\t\t\t// Hide all active positions in navbar\n\t\t\t\tnavs.forEach((nav_item) => {\n\t\t\t\t\tnav_item.classList.remove(\"active\");\n\t\t\t\t});\n\t\t\t\t// Hide all active slides\n\t\t\t\tpages.forEach((page_item) => {\n\t\t\t\t\tpage_item.classList.remove(\"active\");\n\t\t\t\t});\n\t\t\t\t// Show active position in navbar and active page\n\t\t\t\tnav.classList.add(\"active\");\n\t\t\t\tpages[index].classList.add(\"active\");\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "f0ffdbd7883e07ab647ee887094295e4", "score": "0.5809957", "text": "function routePages(event) {\n var pageRoutes = event.target.dataset.content;\n\n switch(pageRoutes) {\n case \"aboutMe\":\n $('#jumboHeading').text(\"About Me\");\n $('#aboutMeSection').removeClass('d-none');\n $('#portfolioSection').addClass('d-none');\n break;\n case \"portfolio\":\n $('#jumboHeading').text(\"Portfolio\");\n $('#aboutMeSection').addClass('d-none');\n $('#portfolioSection').removeClass('d-none');\n buildPortfolio(); //include buildPortfolio function in portfolio page\n break;\n default:\n console.log(\"Error\");\n }\n}", "title": "" }, { "docid": "f587c1c66ae247c895e1a965aaad6f67", "score": "0.58049655", "text": "function navigateToPage()\n\t{\n\t\tloadPage(getController().selectedPredecessorPage.pageId);\n\t}", "title": "" }, { "docid": "84d18d2077b386e84b0590145eb399ca", "score": "0.5792501", "text": "function toMoodPage() {\n $(\"#age-verification-page\").hide();\n $(\"#music-page\").hide();\n $(\"#mood-page\").show();\n}", "title": "" }, { "docid": "b3ac1b59d665e75807105c4e3576e27e", "score": "0.5783501", "text": "function openMenu() {\n\ttry {\n\t\t//if swipe left more 80px on results layer\n\t if ((up_x - down_x) > 80) {\n\t \t//if state is body\n\t \tif(state==\"body\"){ \n\t \t\tconsole.log('open menu');\n\t \t\tappDiv.className = 'page transition right';\n\t state=\"menu\";\n\t }\n\t }\n\t}\n\tcatch(e) {\n\t\tapp.error(e, \"Fatal error opening menu... Please contanct the site administrator.\");\n\t}\n}", "title": "" }, { "docid": "17318c662c20a1d6d07a42659ac2b4e7", "score": "0.5782556", "text": "function openPageJumpLinks() {\n $anchorDropdownTrigger.toggleClass('open'); \n \n if(($anchorDropdown).is(\":visible\")) {\n $anchorDropdownTrigger.removeClass('open').attr('aria-expanded', false);\n $anchorDropdown.slideUp('fast').attr('aria-hidden', true);\n } else {\n $anchorDropdownTrigger.addClass('open').attr('aria-expanded', true);\n $anchorDropdown.slideDown('fast').attr('aria-hidden', false);\n }\n }", "title": "" }, { "docid": "6aee21cfd3105f05544f0bd1cfec7136", "score": "0.5781632", "text": "function displayPage(page){\n\n\t\tvar load = {};\n\n\t\tswitch(page){\n\t\t\tcase \"main\":\n\t\t\t\tload.pg = pg.main;\n\t\t\t\tload.nav = nav.main;\n\t\t\t\tbreak;\n\t\t\tcase \"app\":\n\t\t\t\tload.pg = pg.app;\n\t\t\t\tload.nav = nav.app;\n\t\t\t\tbreak;\n\t\t\tcase \"settings\":\n\t\t\t\tload.pg = pg.conf;\n\t\t\t\tload.nav = nav.conf;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tload.pg = pg.load;\n\t\t\t\tload.nav = nav.load;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//TODO Rewrite as forEach function\n\t\tvar active = {};\n\n\t\tif(pg.load.classList.contains(\"active\")){\n\t\t\tactive.pg = pg.load;\n\t\t\tactive.nav = nav.load;\n\t\t}\n\t\tif(pg.main.classList.contains(\"active\")){\n\t\t\tactive.pg = pg.main;\n\t\t\tactive.nav = nav.main;\n\t\t}\n\t\tif(pg.app.classList.contains(\"active\")){\n\t\t\tactive.pg = pg.app;\n\t\t\tactive.nav = nav.app;\n\t\t}\n\t\tif(pg.conf.classList.contains(\"active\")){\n\t\t\tactive.pg = pg.conf;\n\t\t\tactive.nav = nav.conf;\n\t\t}\n\n\t\t//if the page is different from the one displayed already:\n\t\tif(load.pg !== active.pg){\n\t\t\t//broadcasts an event to indicate beginning changing page\n\t\t\tradio(\"PAGE_CHANGE\").broadcast(load,active);\n\t\t\t//function that closes any open modal (page can change in background however)\n\t\t\thideModals();\n\t\t\t//set style classes so that page and nav element fade out\n\t\t\tactive.pg.classList.add(\"fade\");\n\t\t\tactive.nav.classList.add(\"fade\");\n\t\t\t//setTimeout is there because of how css fade in/out is done\n\t\t\tsetTimeout(function(){\n\t\t\t\tactive.pg.classList.remove(\"active\",\"fade\");\n\t\t\t\tactive.nav.classList.remove(\"active\",\"fade\");\n\t\t\t\tload.pg.classList.add(\"active\");\n\t\t\t\tload.nav.classList.add(\"active\");\n\t\t\t}, 500);\n\t\t\t//broadcasts an event to indicate that the page have been changed\n\t\t\tradio(\"PAGE_CHANGED\").broadcast(load,active);\n\t\t}\n\n\t}", "title": "" }, { "docid": "140a6c5dae0862a950e08af04dd5a717", "score": "0.57809544", "text": "function showmngpage() {\n navController.initWithRootView('corp/transfer/periodic/transfer-periodic-mng-scr', true, 'xsl');\n}", "title": "" } ]
1c85d4e6da61b6f1446f2f98ccb469a8
Returns the icon paths (default and selected) for a place based on its types array.
[ { "docid": "f61e15c84d75f0d2e374cf7ea3fa786c", "score": "0.86186445", "text": "function getIconPaths(placeTypes) {\n if(placeTypes.includes(ZOO_TYPE_STR)) {\n return [ICON_PATHS.defaultIcons.zoo, ICON_PATHS.selectedIcons.zoo];\n } else if(placeTypes.includes(MUSEUM_TYPE_STR)) {\n return [ICON_PATHS.defaultIcons.museum, ICON_PATHS.selectedIcons.museum];\n } else if(placeTypes.includes(PARK_TYPE_STR)) {\n return [ICON_PATHS.defaultIcons.park, ICON_PATHS.selectedIcons.park];\n } else if(placeTypes.includes(MALL_STORE_TYPE_STR) || \n placeTypes.includes(DEPARMENT_STORE_TYPE_STR) || \n placeTypes.includes(STORE_TYPE_STR)) {\n return [ICON_PATHS.defaultIcons.shopping, ICON_PATHS.selectedIcons.shopping];\n } else { // all other types, use the tourism icon\n return [ICON_PATHS.defaultIcons.tourism, ICON_PATHS.selectedIcons.tourism];\n }\n}", "title": "" } ]
[ { "docid": "55bad4eee1cd1f114b02441bb1476f84", "score": "0.60239404", "text": "function getCraftingIconPaths() {\n const recipes = require('../../data/methods/crafting.json');\n\n const paths = [];\n\n Object.values(recipes).reduce((arr, recipeGroup) => ([\n ...arr,\n ...recipeGroup.map(recipe => recipe.iconPath)\n ]), []).forEach(iconPath => {\n const mappedPath = mapIconPath(iconPath);\n\n if (paths.find(path => path.as === mappedPath.as)) {\n return;\n }\n\n paths.push(mappedPath);\n });\n\n return paths;\n}", "title": "" }, { "docid": "0a9f040d231efe261060c6dc24b11125", "score": "0.581173", "text": "function getIcon(types) {\n\t\tswitch(types) {\n\t\t\t//case \"pharmacy\": return \"icons/drugstore.png\";\n\t\t\tcase \"hospital\": return \"https://www.phoenixchildrens.org/sites/default/files/images/hospital-building.png\";\n\t\t\t//case \"lab\": return \"icons/barber.png\";\n\t\t\tdefault: return \"http://www.bloodjournal.org/sites/all/modules/highwire/highwire/images/google-icon.png\";\n\t\t}\n\t}", "title": "" }, { "docid": "c406a2035ee0d23e9e884531e33e1839", "score": "0.57790744", "text": "function getGatheringIconPaths() {\n const nodes = require('../../data/methods/gathering.json');\n\n const paths = [];\n\n Object.values(nodes).reduce((arr, nodeGroup) => ([\n ...arr,\n ...nodeGroup.map(node => node.iconPath)\n ]), []).forEach(iconPath => {\n const mappedPath = mapIconPath(iconPath);\n\n if (paths.find(path => path.as === mappedPath.as)) {\n return;\n }\n\n paths.push(mappedPath);\n });\n\n return paths;\n}", "title": "" }, { "docid": "07d39f8af228917fafa6932217bfedec", "score": "0.5756315", "text": "function get_icon(type) {\n switch(type) {\n case 'Truck':\n return {\n url: '/static/images/dump_truck.png',\n scaledSize: new google.maps.Size(50, 50),\n anchor: new google.maps.Point(25, 25),\n };\n case 'WaterTruck':\n return {\n url: '/static/images/water_truck.png',\n scaledSize: new google.maps.Size(50, 30),\n anchor: new google.maps.Point(25, 15),\n };\n case 'FuelTruck':\n return {\n url: '/static/images/fuel_truck.png',\n scaledSize: new google.maps.Size(50, 40),\n anchor: new google.maps.Point(25, 20),\n };\n case 'Shovel':\n return {\n url: '/static/images/shovel.png',\n scaledSize: new google.maps.Size(50, 40),\n anchor: new google.maps.Point(25, 20),\n };\n case 'Drill':\n return {\n url: '/static/images/drill.png',\n scaledSize: new google.maps.Size(50, 50),\n anchor: new google.maps.Point(25, 25),\n };\n case 'Dozer':\n return {\n url: '/static/images/dozer.png',\n scaledSize: new google.maps.Size(50, 30),\n anchor: new google.maps.Point(25, 15),\n };\n case 'Grader':\n return {\n url: '/static/images/grader.png',\n scaledSize: new google.maps.Size(50, 25),\n anchor: new google.maps.Point(25, 12.5),\n };\n case 'Loader':\n return {\n url: '/static/images/loader.png',\n scaledSize: new google.maps.Size(50, 40),\n anchor: new google.maps.Point(25, 20),\n };\n default:\n return {\n url: '/static/images/dump_truck.png',\n scaledSize: new google.maps.Size(50, 50),\n anchor: new google.maps.Point(25, 25),\n };\n }\n}", "title": "" }, { "docid": "ef3746a5051dcd2806864cec06d2b42d", "score": "0.5652019", "text": "function getLabelIconImagePath(labelType) {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'iconImagePath' : undefined\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'iconImagePath' : 'public/img/icons/Icon_BusStop.png'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'iconImagePath' : 'public/img/icons/Icon_BusStopSign_SingleLeg.png'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'iconImagePath' : 'public/img/icons/Icon_BusStopSign_TwoLegged.png'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'iconImagePath' : 'public/img/icons/Icon_BusStopSign_Column.png'\n },\n 'StopSign_None' : {\n 'id' : 'StopSign_None',\n 'iconImagePath' : 'public/img/icons/Icon_BusStop.png'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'iconImagePath' : 'public/img/icons/Icon_BusStopShelter.png'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'iconImagePath' : 'public/img/icons/Icon_Bench.png'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'iconImagePath' : 'public/img/icons/Icon_TrashCan2.png'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'iconImagePath' : 'public/img/icons/Icon_Mailbox2.png'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'iconImagePath' : 'public/img/icons/Icon_OtherPoles.png'\n }\n }\n}", "title": "" }, { "docid": "083b18d5ea8eddb49199b44928e42538", "score": "0.5638795", "text": "function getLabelIconImagePath(labelType) {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'iconImagePath' : undefined\n },\n CurbRamp: {\n id: 'CurbRamp',\n iconImagePath : svl.rootDirectory + 'img/Icon_CurbRamp.svg'\n },\n NoCurbRamp: {\n id: 'NoCurbRamp',\n iconImagePath : svl.rootDirectory + '/img/icons/Sidewalk/Icon_NoCurbRamp.svg'\n },\n Obstacle: {\n id: 'Obstacle',\n iconImagePath: null\n },\n SurfaceProblem: {\n id: 'SurfaceProblem',\n iconImagePath: null\n },\n Other: {\n id: 'Other',\n iconImagePath: null\n },\n Void: {\n id: 'Void',\n iconImagePath : null\n },\n Unclear: {\n id: 'Unclear',\n iconImagePath : null\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStop.png'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStopSign_SingleLeg.png'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStopSign_TwoLegged.png'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStopSign_Column.png'\n },\n 'StopSign_None' : {\n 'id' : 'StopSign_None',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStop.png'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStopShelter.png'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_Bench.png'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_TrashCan2.png'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_Mailbox2.png'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_OtherPoles.png'\n }\n }\n}", "title": "" }, { "docid": "eb1455bc7e7a4b153034708b4791c639", "score": "0.5629375", "text": "function getType(icons) {\r\nconst types = [];\r\nicons.forEach((icon) => {\r\n // verifico se tipo c'è se no inserisco\r\n if(! types.includes(icon.type)) {\r\n types.push(icon.type);\r\n }\r\n});\r\nreturn types;//faccio ritornare il tipo\r\n}", "title": "" }, { "docid": "174b0ce58b3809776e76e30e6a472673", "score": "0.56112504", "text": "function getQuestJournalIconPaths() {\n const quests = require('../../data/methods/quests.json');\n\n const paths = [];\n\n Object.values(quests).reduce((arr, nodeGroup) => ([\n ...arr,\n ...nodeGroup.map(quest => quest.iconPath)\n ]), []).forEach(iconPath => {\n const mappedPath = mapIconPath(iconPath);\n\n if (paths.find(path => path.as === mappedPath.as)) {\n return;\n }\n\n paths.push(mappedPath);\n });\n\n return paths;\n}", "title": "" }, { "docid": "a3965b78a6985ae7e06ba352cf25e0b0", "score": "0.5550232", "text": "function getIconsTypes(iconsArray) {\n\tconst typesArray = [];\n\n\ticonsArray.forEach((element) => {\n\t\tconst elementType = element.type;\n\n\t\t//o con le negazione ! davanti typeArrow e senza scrivere == false\n\t\tif ( typesArray.includes(elementType) == false ) {\n\t\t\ttypesArray.push(elementType);\n\t\t};\n\t});\n\t\n\treturn typesArray;\n}", "title": "" }, { "docid": "16bfb14b913bcb0710264f4c787eccff", "score": "0.55224353", "text": "function iconSort(type){\n options = {iconSize: [14,14], className: 'place-icon'}\n switch(type){\n case 'restaurant':\n options.className += ' restaurant';\n break;\n case 'coffee shop':\n options.className += ' coffee';\n break;\n case 'grocery store':\n options.className += ' grocery';\n break;\n case 'park':\n options.className += ' park';\n break;\n case 'school':\n options.className += ' school';\n break;\n default:\n console.log(\"error w/ icon for type \", type);\n return null;\n }\n\n return L.divIcon(options);\n }", "title": "" }, { "docid": "a128b8ba4c1a09b3689ff6c01ab5f73d", "score": "0.5493372", "text": "generateIcons() {\n const terminalBase = Core.atlas.find(this.name);\n const terminalDisplay = Core.atlas.find(this.name + \"-display-icon\");\n return [terminalBase, terminalDisplay];\n }", "title": "" }, { "docid": "4fa1cbaf8e79ccea7f50c934206c8e0a", "score": "0.5384498", "text": "function icons() {\r\n var arr = [], style = 'style=\"width:18px\"';\r\n if (iconMapper.map(link)) add(iconMapper.map(link));\r\n if (iconMapper.map(obj.Type)) add(iconMapper.map(obj.Type));\r\n if (reg !== 'Message' && iconMapper.map(reg)) add(iconMapper.map(reg));\r\n if (detail.contains('email')) add(iconMapper.map('email'));\r\n if (detail.contains('SMS')) add(iconMapper.map('sms'));\r\n\r\n //make sure there is exactly 2 icons\r\n arr.first(2);\r\n while (arr.length < 2) {\r\n arr.push('icon-blank');\r\n }\r\n\r\n if (arr.length) {\r\n return '<i ' + style + ' class=\"' + arr.join(' icon-large muted disp-ib\"></i> <i ' + style + ' class=\"') + ' icon-large muted disp-ib\"></i> ';\r\n } else {\r\n return '';\r\n }\r\n function add(i) {\r\n if (!arr.contains(i)) arr.push(i);\r\n }\r\n }", "title": "" }, { "docid": "4db508e351424cc35b2072b884ac6a7c", "score": "0.5274028", "text": "function getLocation(numPreference, typePreference){\r\n\tvar locBase;\r\n\tvar loc = new Array();\r\n\tlocBase = \"../css/immagini/\";\r\n\tswitch(numPreference){\r\n\t\tcase COMPAGNIA:\r\n\t\t \t\tloc[0] = locBase + \"solitaryIcon.png\";\r\n\t\t\t\tloc[1] = locBase + \"groupIcon.png\";\r\n\t\t\t\tbreak;\r\n\t\tcase CLIMA: \r\n\t\t\t\tloc[0] = locBase + \"hotIcon.ico\";\r\n\t\t\t\tloc[1] = locBase + \"coldIcon.png\";\r\n\t\t\t\tbreak;\r\n\t\tcase MEZZO: \r\n\t\t\t\tlocBase += \"mezzi/\";\r\n\t\t\t\tloc[0] = locBase + \"mezzoAereo.png\";\r\n\t\t\t\tloc[1] = locBase + \"mezzoAuto.png\";\r\n\t\t\t\tloc[2] = locBase + \"mezzoBici.png\";\r\n\t\t\t\tloc[3] = locBase + \"mezzoMoto.png\";\r\n\t\t\t\tloc[4] = locBase + \"mezzoPiedi.png\";\r\n\t\t\t\tloc[5] = locBase + \"mezzoTreno.png\";\r\n\t\t\t\tbreak;\r\n\t\tcase VIAGGIO:\t\r\n\t\t\t\tlocBase += \"tipi/\";\r\n\t\t\t\tloc[0] = locBase + \"party.jpg\";\r\n\t\t\t\tloc[1] = locBase + \"relax.png\";\r\n\t\t\t\tloc[2] = locBase + \"explorer.png\";\r\n\t\t\t\tloc[3] = locBase + \"sport.ico\";\r\n\t\t\t\tloc[4] = locBase + \"culture.png\";\r\n\t\t\t\tbreak;\r\n\t}\r\n\treturn loc[typePreference];\r\n}", "title": "" }, { "docid": "4dd6c501f67ae2b4e7d6332a5d826509", "score": "0.51951396", "text": "function getIcon(type) {\r\n const all_weather = \"<span title='All Weather' class='fa fa-cloud'></span>\";\r\n const tent = \"<span title='Tent' class='glyphicon glyphicon-tent'></span>\";\r\n const caravan = \"<span title='Caravan' class='fas fa-car'></span>\";\r\n const motorhome = \"<span title='Motorhome' class='fas fa-truck'></span>\";\r\n const electrical = \"<span title='Electrical Outlet' class='fas fa-bolt'></span>\";\r\n\r\n switch (type) {\r\n case \"tent\":\r\n return tent;\r\n case \"caravan\":\r\n return caravan + \" \" + all_weather;\r\n case \"motorhome\":\r\n return motorhome + \" \" + all_weather + electrical;\r\n case \"all\":\r\n return tent + \" \" + caravan + \" \" + motorhome + \" \" + electrical;\r\n case \"all-manage\":\r\n return \"<div class='row'>\" + tent + \" \" + caravan + \"</div><div class='row'>\" + motorhome + \" \" + electrical + \"</div>\";\r\n default:\r\n return \"N/A\";\r\n }\r\n}", "title": "" }, { "docid": "b090ff6a96b93799f43a2951dd9eb611", "score": "0.5191625", "text": "function cargarIconos(){\n // iconos para mostrar puntos\n estilosActuales[\"carga\"] = styles.marcadorCarga();\n //corregir esto\n estilosActuales[\"Taxi/Remis\"] = styles.marcadorTraslado();\n // default\n estilosActuales[\"default\"] = styles.marcadorDefault();\n }", "title": "" }, { "docid": "67ed30ccbf35ce96a515da2e292ad073", "score": "0.5182418", "text": "function loadIconsSet() {\n let list = [];\n\n if (build.isDev()) {\n list = fs.readdirSync(iconsPath).map(file => file.replace(/\\.[^\\.]+$/, ''));\n } else {\n list = require('../src/assets/icons-sprite.config.json');\n }\n\n return list;\n}", "title": "" }, { "docid": "eb5a5971dd62e02cffd38ffc63b833c6", "score": "0.5178723", "text": "function getPhotos(place) {\n let photo;\n if (place.photos) {\n photo = place.photos[0].getUrl({\n 'maxWidth': 290,\n 'maxHeight': 300\n });\n } else {\n photo = place.icon;\n }\n return photo;\n}", "title": "" }, { "docid": "b85e79c56ff3b177a1368165e01a5692", "score": "0.5166707", "text": "function _getIcon(worktype) {\n\n let icon = new Array('fa');\n\n switch (worktype) {\n case 'article':\n icon.push('fa-file-text');\n break;\n case 'book':\n icon.push('fa-book');\n break;\n case 'audiobook':\n icon.push('fa-book');\n break;\n case 'game':\n icon.push('fa-gamepad');\n break;\n case 'movie':\n icon.push('fa-film');\n break;\n case 'music':\n icon.push('fa-music');\n break;\n case 'periodica':\n icon.push('fa-newspaper-o');\n break;\n default:\n icon.push('fa-question');\n break;\n }\n\n return icon;\n\n}", "title": "" }, { "docid": "a97f9bcc02782b1a3024cb5e71c5e3ff", "score": "0.5155546", "text": "function getIcons(text) {\n switch (text) {\n case 'Frigate':\n case 'Galleon':\n case 'Skiff':\n case 'Pinnace':\n case 'Flute':\n return 'fas fa-ship';\n case 'Tax increase':\n return 'fas fa-balance-scale';\n case 'Expedition':\n return 'fas fa-map-signs';\n case 'Trader':\n return 'fas fa-exchange-alt';\n case 'Governor':\n return 'fas fa-landmark';\n case 'Jester':\n return 'far fa-smile-wink';\n case 'Admiral':\n return 'fas fa-binoculars';\n case 'Sailor':\n case 'Pirate':\n return 'fas fa-skull-crossbones';\n case 'Priest':\n return 'fas fa-cross';\n case 'Captain':\n return 'fas fa-anchor';\n case 'Settler':\n return 'fas fa-home';\n case 'Madamoiselle':\n return 'fas fa-percent';\n case 'Jack of all Trades':\n return 'fas fa-asterisk';\n }\n}", "title": "" }, { "docid": "7a2bf532a4c0972c539bfb109d6197ae", "score": "0.51408815", "text": "function findInteriorPaths(shape, type, index) {\n var enclosedPaths = index.findPathsInsideShape(shape),\n dissolvedPaths = [];\n if (!enclosedPaths) return null;\n // ...\n if (type == 'erase') enclosedPaths.forEach(reversePath);\n if (enclosedPaths.length <= 1) {\n dissolvedPaths = enclosedPaths; // no need to dissolve single-part paths\n } else {\n openArcRoutes(enclosedPaths, arcs, routeFlags, true, false, true);\n enclosedPaths.forEach(function(ids) {\n var path;\n for (var j=0; j<ids.length; j++) {\n path = dividePath(ids[j]);\n if (path) {\n dissolvedPaths.push(path);\n }\n }\n });\n }\n\n return dissolvedPaths.length > 0 ? dissolvedPaths : null;\n }", "title": "" }, { "docid": "43cfea3aa6ccb2f71e489e89af512417", "score": "0.5082896", "text": "function setIconsPlace(){\r\n\r\n\t\t// media query\r\n\t\tvar mediaQuery = window.matchMedia('only screen and (max-width: 768px), only screen and (max-device-width: 768px)').matches;\r\n\r\n\t\tif (mediaQuery){\r\n\t\t// mobile version\r\n\t\t\r\n\t\t\t// set event buttons to left:0\r\n\t\t\t$(\".eventPoint\").css(\"left\", 0);\r\n\t\t\t\r\n\t\t\t// unbind hover tooltip\r\n\t\t\t$(\".timePointBtn\").unbind('mouseenter mouseleave');\r\n\t\t\t\r\n\t\t} else {\r\n\t\t//desktop version\r\n\t\t\r\n\t\t\t// set events buttons place in time line\r\n\t\t\tfor (i=0;i<events.length;i++){\r\n\t\t\t$(\".eventPoint:eq(\"+i+\")\").css(\"left\", setTimePointPlace($(\".eventInp:eq(\"+i+\")\").val()) + \"%\");\r\n \r\n /* setTimePointPlace((getDateFromEvents(events[i][0]))) + \"%\");\t\r\n */\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// hover tool tip\r\n\t\t\t$(\".timePointBtn\").hover(function(){\r\n\t\t\t\t$(this).parent().parent().next().children(\".date, .name\").addClass(\"hoverEvent\");\r\n\t\t\t}, function(){\r\n\t\t\t\t$(this).parent().parent().next().children(\".date, .name\").removeClass(\"hoverEvent\");\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t}", "title": "" }, { "docid": "37600c8a8fc81dc873dc370d0ea5eda3", "score": "0.50448173", "text": "function availableShape() {\n let shapes = [];\n Object.values(tdata).forEach(value => {\n let shape = value.shape;\n shape = shape[0].toUpperCase() + shape.substring(1);\n if(shapes.indexOf(shape) !== -1) {\n\n }\n else {\n shapes.push(shape);\n }\n });\n return shapes;\n}", "title": "" }, { "docid": "9b5778d475d51dc0b15427623ee3b10b", "score": "0.5014555", "text": "function getPaths(items) {\n\tconsole.log(\"getPaths(items)\", items)\n\tvar paths = {}, d, offset = .5 * y2(1) + 0.5, result = [];\n\tfor (var i = 0; i < items.length; i++) {\n\t\td = items[i];\n\t\tif (!paths[d.class]) paths[d.class] = '';\t\n\t\tpaths[d.class] += ['M',x0(d.start),(y2(d.lane) + offset),'H',x0(d.end)].join(' ');\n\t}\n\n\tfor (var className in paths) {\n\t\tresult.push({class: className, path: paths[className]});\n\t}\n\n\treturn result;\n}", "title": "" }, { "docid": "263c4a6e5408f1da2ae2590afeba2a8a", "score": "0.4982133", "text": "function setAllObjectPaths() {\n\n var allObjectTypes = objectTypes.objectTypes;\n\n var allObjectsByType = new Map();\n var numObjectsByType = new Map();\n\n for (var i = 0; i < allObjectTypes.length/10; i++) {\n for (var j = 0; j < 10; j++) {\n var objectNum = String(i) + String(j);\n var objectPath = '/static/object_answers/object' + objectNum \n + 'answer.png';\n var thisObjectType = allObjectTypes[Number(objectNum)];\n if (allObjectsByType.has(thisObjectType)) {\n allObjectsByType.get(thisObjectType).push(objectPath);\n // increment total number objects for this Object type\n numObjectsByType.set(thisObjectType, \n numObjectsByType.get(thisObjectType) + 1);\n } else {\n allObjectsByType.set(thisObjectType, new Array(objectPath)); \n // init total number objects for this Object type\n numObjectsByType.set(thisObjectType, 1);\n }\n }\n } \n return [allObjectsByType, numObjectsByType];\n}", "title": "" }, { "docid": "470a281994399d01759048c7f0fdd89e", "score": "0.4973879", "text": "function convertFormatOfPlaces(randomPlaces, type) {\n let convertedPlaces = [];\n\n for (let i = 0; i < randomPlaces.length; i++) {\n convertedPlaces.push(convertFormat(randomPlaces[i], type));\n }\n\n return convertedPlaces;\n}", "title": "" }, { "docid": "141dc287b0e84223eb5a3396b537fc56", "score": "0.49569762", "text": "function get_type_icon(item_type) {\n item_type = item_type.toLowerCase();\n switch (item_type) {\n case \"battle\":\n return \"trophy\";\n case \"book\":\n return \"book\";\n case \"clothes\":\n return \"umbrella\";\n case \"food\":\n return \"food\";\n case \"furniture\":\n return \"home\";\n case \"gift\":\n return \"gift\";\n case \"grooming\":\n return \"leaf\";\n case \"medicine\":\n return \"medkit\";\n case \"petpet\":\n return \"github\";\n case \"school\":\n return \"pencil\";\n case \"stamp\":\n return \"ticket\";\n case \"toy\":\n return \"gamepad\";\n case \"trading card\":\n return \"trello\";\n default:\n return \"star\";\n }\n }", "title": "" }, { "docid": "ce8fe2a7550748cee76004a7b66ae8f1", "score": "0.49397093", "text": "function transformSpots(spots, type) {\n return spots.map((spot) => ({\n ...spot,\n selected: true,\n type,\n }))\n}", "title": "" }, { "docid": "7cb219171592728614a32f83ed1c6538", "score": "0.49332944", "text": "function addLocationMarkers(map, places){\n\n let markers = [];\n // For each place, get the icon, name and location.\n const bounds = new google.maps.LatLngBounds();\n places.forEach(place => {\n if (!place.geometry) {\n console.log(\"Returned place contains no geometry\");\n return;\n }\n const icon = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n // Create a marker for each place.\n markers.push(\n new google.maps.Marker({\n map,\n icon,\n title: place.name,\n position: place.geometry.location,\n label: {\n color: 'red',\n text: place.name,\n fontSize: '14px',\n },\n })\n );\n\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n });\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "47ad1df23531b00dfcc079d98744095f", "score": "0.49279025", "text": "function createDriverMarkers(places, map) {\n const bounds = new google.maps.LatLngBounds();\n\n for (let i = 0, place; (place = places[i]); i++) {\n const image = {\n url: 'https://cdn.iconscout.com/icon/free/png-512/car-vehicle-travel-transport-side-view-29587.png',\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(40, 40)\n };\n new google.maps.Marker({\n map,\n icon: image,\n title: place.name,\n position: place.geometry.location\n });\n bounds.extend(place.geometry.location);\n }\n\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "7a66a0f425b47399061269a743fbe560", "score": "0.4926327", "text": "function filterIconsByType(iconsArray, type) {\n\n\tif ( type.length == 0 ) {\n\t\treturn iconsArray;\n\t}\n\n\tconst filterdeArray = iconsArray.filter((element) => {\n\t\treturn element.type == type;\n\t} );\n\n\treturn filterdeArray;\n}", "title": "" }, { "docid": "5df6eee43e47245503d450e664106c0a", "score": "0.4922956", "text": "function getPathMetadata(shape, arcs, type) {\n var data = [],\n ids;\n for (var i=0, n=shape && shape.length; i<n; i++) {\n ids = shape[i];\n data.push({\n ids: ids,\n area: type == 'polygon' ? geom.getPlanarPathArea(ids, arcs) : 0,\n bounds: arcs.getSimpleShapeBounds(ids)\n });\n }\n return data;\n }", "title": "" }, { "docid": "1293206e7f09c11e8d0fc7a9f0fefdd4", "score": "0.49214223", "text": "function createMarkerIcons() {\n\t\t\tvar markerIconDot = {\n\t\t\t\turl: '/assets/images/1x1-pixel.png',\n\t\t\t\tsize: new google.maps.Size(1, 1),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(4, 4),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconSmallRed = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(8, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeRed = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(10, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconInvisRed = {\n\t\t\t\turl: '/assets/images/picture1.png',\n\t\t\t\tsize: new google.maps.Size(220, 230),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(3, 158)\n\t\t\t};\n\n\t\t\tvar markerIconLargeRedMain = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(10, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallBlue = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(47, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeBlue = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(27, 0),\n\t\t\t\tanchor: new google.maps.Point(9, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallGreen = {};\n\n\t\t\tvar markerIconLargeGreen = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(54, 0),\n\t\t\t\tanchor: new google.maps.Point(8, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallOrange = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(126, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeOrange = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(81, 0),\n\t\t\t\tanchor: new google.maps.Point(8, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tdot: markerIconDot,\n\t\t\t\tsmallRed: markerIconSmallRed,\n\t\t\t\tinvisRed: markerIconInvisRed,\n\t\t\t\tsmallBlue: markerIconSmallBlue,\n\t\t\t\tsmallGreen: markerIconSmallGreen,\n\t\t\t\tsmallOrange: markerIconSmallOrange,\n\t\t\t\tlargeRed: markerIconLargeRed,\n\t\t\t\tlargeRedMain: markerIconLargeRedMain,\n\t\t\t\tlargeBlue: markerIconLargeBlue,\n\t\t\t\tlargeGreen: markerIconLargeGreen,\n\t\t\t\tlargeOrange: markerIconLargeOrange\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "79125aa7057edc00eb8542f01201b309", "score": "0.49154377", "text": "function getIconSource(folderType)\n{\n\tif (folderType == \"Favorites\")\n\t\treturn FAVORITES_ICON;\n\telse if (folderType == \"Emotions\")\n\t\treturn EMOTIONS_ICON;\n\telse if (folderType == \"Activities\")\n\t\treturn ACTIVITIES_ICON;\n\telse if (folderType == \"Food\")\n\t\treturn FOOD_ICON;\n\telse if (folderType == \"Greetings\")\n\t\treturn GREETINGS_ICON;\n\telse if (folderType == \"Needs\")\n\t\treturn NEEDS_ICON;\n\telse if (folderType == \"Numbers\")\n\t\treturn NUMBERS_ICON;\n\telse if (folderType == \"School\")\n\t\treturn SCHOOL_ICON;\n\telse if (folderType == \"Wants\")\n\t\treturn WANTS_ICON;\n\telse\n\t\treturn FAVORITES_ICON;\n}", "title": "" }, { "docid": "30454c80260b11b4887f72dfd942ae6f", "score": "0.49146718", "text": "function emptyPlace (type, lista){\n let a\n let b\n let places = []\n for (let p of lista){\n if (type == \"vertical\"){\n a = [p[0], p[1]+1]\n b = [p[0], p[1]-1]\n }\n else if (type == \"horizontal\"){\n a = [p[0]+1, p[1]]\n b = [p[0]-1, p[1]]\n }\n else if (type == \"left diagonal\"){\n a = [p[0]+1, p[1]+1]\n b = [p[0]-1, p[1]-1]\n }\n else if (type == \"right diagonal\"){\n a = [p[0]-1, p[1]+1]\n b = [p[0]+1, p[1]-1]\n }\n if (!inList(a, lista)) places.push(a)\n if (!inList(b, lista)) places.push(b)\n }\n return places\n}", "title": "" }, { "docid": "01c52184ff70794e287413f7ed5db717", "score": "0.49052814", "text": "function getIcon(itemType) {\n switch(itemType) {\n case 'food': \n return FoodIcon; \n case 'movie':\n return MovieIcon; \n case 'event': \n return EventIcon; \n default: \n return UnknownIcon; \n }\n}", "title": "" }, { "docid": "d6354a1d065cd76cb6d4f25da2217d7c", "score": "0.48765686", "text": "function getList(type){\n if( type === Type.REGION ) return clone(regions);\n else if( type === Type.PREF ) return clone(prefectures);\n return undefined;\n }", "title": "" }, { "docid": "d9905dc21f176b36f90733e4fb49213c", "score": "0.48640043", "text": "function displayMarkersPlace(place){\r\n for(var i=0;i<self.markerArray().length; i++){\r\n if(place.location.lat == self.markerArray()[i][0].lat && place.location.lng == self.markerArray()[i][0].lng){\r\n self.markerArray()[i][1].setVisible(true);\r\n\t self.markerArray()[i][1].setIcon(defaultIcon);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "84893705ca130a2c081d6a4da399b96c", "score": "0.48600146", "text": "function cargarIconos(){\n // iconos para mostrar puntos\n estilosMarcadores[\"carga\"] = styles.marcadorCarga();\n estilosMarcadores[\"traslado\"] = styles.marcadorTraslado();\n }", "title": "" }, { "docid": "694cab87e322126e1785a9c846b2c2b5", "score": "0.4858146", "text": "function drawLocations(index){\n if($scope.locationsType == 2){\n //okay, this means we are considering cities!\n drawMarkers(index);\n } else if($scope.locationsType == 1){\n //okay, this means we are considering routes!\n drawRoutes(index);\n }\n }", "title": "" }, { "docid": "7d412d42521aebae77075a25f04d5b93", "score": "0.48564714", "text": "function createMarkers(places) {\n let iconImage = '..//Images/cutlery.svg';\n places.forEach(place => {\n let marker = createPosMarker(\n place.geometry.location,\n { title: place.name },\n iconImage\n );\n\n // Add click listener to each marker\n google.maps.event.addListener(marker, 'click', () => {\n let request = {\n placeId: place.place_id,\n fields: ['name', 'formatted_address', 'geometry', 'rating',\n 'website', 'photos', 'vicinity']\n };\n /* Only fetch the details of a place when the user clicks on a marker.\n * If we fetch the details for all place results as soon as we get\n * the search response, we will hit API rate limits. */\n service.getDetails(request, (placeResult, status) => {\n showDetails(placeResult, marker, status)\n });\n });\n\n // Adjust the map bounds to include the location of this marker\n bounds.extend(place.geometry.location);\n });\n /* Once all the markers have been placed, adjust the bounds of the map to\n * show all the markers within the visible area. */\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "b1ba046e480683eed58139f51140a45a", "score": "0.48359972", "text": "buildIcons(){\n for(var i=0; i<this.popUpFltImgs.length; i++){\n this.buildIcon(i, false);\n }\n }", "title": "" }, { "docid": "47fd33f96361334898ccbc54ba75c35a", "score": "0.4831655", "text": "function suggestions(val, types) {\n if (!appSettings.mapbox || !appSettings.mapbox.publicKey) {\n $log.warn('No Mapbox settings found; cannot do geocoding!');\n return [];\n }\n\n return $http.get(\n '//api.mapbox.com/geocoding/v5/mapbox.places/' + val + '.json'\n + '?access_token=' + appSettings.mapbox.publicKey\n + '&types=' + (types || 'country,region,place,locality,neighborhood'),\n {\n // Tells Angular-Loading-Bar to ignore this http request\n // @link https://github.com/chieffancypants/angular-loading-bar#ignoring-particular-xhr-requests\n ignoreLoadingBar: true\n })\n .then(function(response) {\n if (response.status === 200 && response.data.features && response.data.features.length > 0) {\n return response.data.features.map(function(geolocation) {\n geolocation.trTitle = shortTitle(geolocation);\n return geolocation;\n });\n } else {\n return [];\n }\n });\n }", "title": "" }, { "docid": "5bfebe1d40d958b2434154f804e86a92", "score": "0.48099196", "text": "function icon_bounds(index, x, z, margin) {\r\n\t\t// most icons fit in 20x20\r\n\t\t// todo: hardcode any exceptions\r\n\t\tvar result = [];\r\n\t\t\r\n\t\tif (isNaN(index) || index < 0) {\r\n\t\t\t// no icon\r\n\t\t} else {\r\n\t\t\tvar iconBoundsHint = getIconBoundsHint(index);\r\n\t\t\tif (iconBoundsHint.width != 0 && iconBoundsHint.height != 0) {\r\n\t\t\t\tvar topLeft_x = x - iconBoundsHint.width / 2;\r\n\t\t\t\tvar topLeft_z = z + iconBoundsHint.yOffset - iconBoundsHint.height / 2;\r\n\t\t\t\tresult[0] = new Rectangle(\r\n\t\t\t\t\ttopLeft_x, \r\n\t\t\t\t\ttopLeft_z, \r\n\t\t\t\t\ttopLeft_x + iconBoundsHint.width - 1,\r\n\t\t\t\t\ttopLeft_z + iconBoundsHint.height - 1\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "title": "" }, { "docid": "9070d55ea6759e2b8a5416aae3da8d49", "score": "0.47959167", "text": "getPromotionsTypes() {\n this.types.map( ( element, index ) => { return ( <Option key={index} value={element.value} > { element.label } </Option> ) } )\n }", "title": "" }, { "docid": "19ba4b0639970bf4a0139aeb57caf5a5", "score": "0.47935408", "text": "function resolveIcons(features, layoutProperties) {\n var icons = [];\n\n for (var i = 0, fl = features.length; i < fl; i++) {\n var text = resolveTokens(features[i].properties, layoutProperties['icon-image']);\n if (!text) continue;\n\n if (icons.indexOf(text) < 0) {\n icons.push(text);\n }\n }\n\n return icons;\n}", "title": "" }, { "docid": "672de5882c7ebc19c881da71afbb25c1", "score": "0.4792639", "text": "function iconType() {\n\n if ($(\"#lodging\").is(\":checked\")) {\n return \"images/icons/lodging.png\";\n }\n else if ($(\"#museum\").is(\":checked\")) {\n return \"images/icons/museum.png\";\n }\n else if ($(\"#art-gallery\").is(\":checked\")) {\n return \"images/icons/art-gallery.png\";\n }\n else if ($(\"#restaurant\").is(\":checked\")) {\n return \"images/icons/restaurant.png\";\n }\n else if ($(\"#shopping-mall\").is(\":checked\")) {\n return \"images/icons/shopping-mall.png\";\n }\n\n}", "title": "" }, { "docid": "93b063e733ff539dcd84dd075c6737e3", "score": "0.47911644", "text": "function getSearchImage(objectType)\n{\n switch (objectType)\n {\n case \"device\":\n return \"icon-desktop\"\n break;\n default:\n return \"icon-exclamation-circle\"\n break;\n }\n}", "title": "" }, { "docid": "bb96fae7f0c413aea86c8db1074cce07", "score": "0.47887757", "text": "function createMarkersForPlaces(places) {\n let bounds = new google.maps.LatLngBounds();\n let placeMarkers = [];\n for (let i = 0; i < places.length; i++) {\n let place = places[i];\n let icon = {\n url: place.icon,\n size: new google.maps.Size(35, 35),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(15, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n // Create a marker for each place.\n let marker = new google.maps.Marker({\n map: map,\n icon: icon,\n title: place.name,\n position: place.geometry.location,\n id: place.id\n });\n // If a marker is clicked, do a place details search on it in the next function.\n marker.addListener('click', function() {\n getPlacesDetails(this, place);\n });\n placeMarkers.push(marker);\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n }\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "18c0029fc5a43a391d2abe6bc1d595b0", "score": "0.4786093", "text": "function createMarkersForPlaces(places) {\n console.log(places);\n var bounds = new google.maps.LatLngBounds();\n placeMarkers = [];\n for (var i = 0; i < places.length; i++) {\n var place = places[i];\n var icon = {\n url: place.icon,\n size: new google.maps.Size(35, 35),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(15, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n // Create a marker for each place.\n var marker = new google.maps.Marker({\n map: map,\n icon: defaultIcon,\n title: place.name,\n position: place.geometry.location,\n id: place.place_id\n });\n\n // Create a single infowindow to be used with the place details information\n // so that only one is open at once.\n var placeInfoWindow = new google.maps.InfoWindow();\n // If a marker is clicked, do a place details search on it in the next function.\n\n marker.addListener('click', function() {\n if (placeInfoWindow.marker == this) {\n console.log(\"This infowindow already is on this marker!\");\n } else {\n this.setIcon(highlightedIcon);\n getPlacesDetails(this, placeInfoWindow);\n }\n });\n\n /*marker.addListener('mouseover', function() {\n this.setIcon(highlightedIcon);\n });\n marker.addListener('mouseout', function() {\n this.setIcon(defaultIcon);\n });\n*/\n placeMarkers.push(marker);\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n }\n map.fitBounds(bounds);\n}", "title": "" }, { "docid": "784e850bee50e0297f5e7d8d2c135330", "score": "0.47829875", "text": "function getNameAndNamespace(type) {\n const split = type.split(':');\n switch (split.length) {\n case 1: return [type, ''];\n case 2: return [split[1], split[0]];\n default: throw new Error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX}The icon type ${type} is not valid!`);\n }\n}", "title": "" }, { "docid": "e6f1334827a3e03d969460f9276bb715", "score": "0.4776265", "text": "getFormedOptionsForPlacemark(type) {\n const cursors = this._data.getLabelCursors();\n return Object.assign(\n {},\n this.getPolygonOptions(),\n this._layoutTemplates[type],\n cursors[type]\n );\n }", "title": "" }, { "docid": "d8cb954370843ed51e4b51fa2a22f756", "score": "0.474997", "text": "_getTypesList(){\n return [\n {\"optText\": \"Select type\", \"optValue\":\"\"},\n {\"optText\": \"Media Type\", \"optValue\":\"MediaType\"},\n {\"optText\": \"Localization Type\", \"optValue\":\"LocalizationType\"},\n {\"optText\": \"State Type\", \"optValue\":\"StateType\"},\n {\"optText\": \"Leaf Type\", \"optValue\":\"LeafType\"},\n ];\n }", "title": "" }, { "docid": "3f6f4737985dfcc366c303e9acfa3064", "score": "0.47458118", "text": "function displayIcon(type) {\n if (type === 'name') {\n nameIcon.style.display = 'inline-block'\n populationIcon.style.display = 'none'\n capitalIcon.style.display = 'none'\n } else if (type === 'capital') {\n nameIcon.style.display = 'none'\n populationIcon.style.display = 'none'\n capitalIcon.style.display = 'inline-block'\n } else if (type === 'population') {\n nameIcon.style.display = 'none'\n capitalIcon.style.display = 'none'\n populationIcon.style.display = 'inline-block'\n } else {\n }\n}", "title": "" }, { "docid": "20614930edb1a79d75d0d05639a8fa52", "score": "0.47269955", "text": "function createMarkersForPlaces(places) {\n var bounds = new google.maps.LatLngBounds();\n for (var i = 0; i < places.length; i++) {\n var place = places[i];\n var icon = {\n url: place.icon,\n size: new google.maps.Size(35, 35),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(15, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n // Create a marker for each place.\n var marker = new google.maps.Marker({\n map: map,\n icon: icon,\n title: place.name,\n position: place.geometry.location,\n id: place.place_id\n });\n // Create a single infowindow to be used with the place details information\n // so that only one is open at once.\n var placeInfoWindow = new google.maps.InfoWindow();\n // If a marker is clicked, do a place details search on it in the next function.\n marker.addListener('click', function() {\n if (placeInfoWindow.marker == this) {\n console.log(\n \"This infowindow already is on this marker!\");\n } else {\n getPlacesDetails(this, placeInfoWindow);\n }\n });\n placeMarkers.push(marker);\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n }\n map.fitBounds(bounds);\n }", "title": "" }, { "docid": "6b0048f56f3381c9d37209365e879331", "score": "0.47268248", "text": "function createMarkersForPlaces(places) {\n var bounds = new google.maps.LatLngBounds();\n for (var i = 0; i < places.length; i++) {\n var place = places[i];\n var icon = {\n url: place.icon,\n size: new google.maps.Size(35, 35),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(15, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n // Create a marker for each place.\n var marker = new google.maps.Marker({\n map: map,\n icon: icon,\n title: place.name,\n position: place.geometry.location,\n id: place.place_id\n });\n // Create a single infowindow to be used with the place details information\n // so that only one is open at once.\n var placeInfoWindow = new google.maps.InfoWindow();\n // If a marker is clicked, do a place details search on it in the next function.\n marker.addListener('click', function() {\n if (placeInfoWindow.marker == this) {\n console.log(\"This infowindow already is on this marker!\");\n } else {\n getPlacesDetails(this, placeInfoWindow);\n }\n });\n placeMarkers.push(marker);\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n }\n map.fitBounds(bounds);\n }", "title": "" }, { "docid": "496b87dc1e3301a37dffd9e1a2940fbe", "score": "0.4723572", "text": "function MatIconLocation() {}", "title": "" }, { "docid": "1306d30d3a18cac742dbf2d0958f02a1", "score": "0.47152817", "text": "function getIcon(style) {\n switch (style) {\n case \"#icon-1753-0288D1\":\n return \"img/green-atm.png\";\n case \"baby\":\n return \"img/ed-baby.png\";\n case \"#icon-1753-0288D1\":\n return \"img/green-atm.png\";\n case \"barbell\":\n return \"img/blue-barbell.png\";\n case \"#icon-1519-0288D1\":\n return \"img/blue-sports.png\";\n case \"bed\":\n return \"img/red-bed.png\";\n case \"#icon-1522-0288D1\":\n return \"img/purple-bike.png\";\n case \"bike\":\n return \"img/blue-bike.png\";\n case \"#icon-1664-0288d1\":\n return \"img/lightpurple-book.png\";\n case \"#icon-1899-DB4436\":\n return \"img/red-book.png\";\n case \"#icon-1546-DB4436\":\n return \"img/red-buildings.png\";\n // case \"clipboard\":\n // return \"img/clipboard.png\";\n case \"coffee\":\n return \"img/orange-coffee.png\";\n case \"#icon-1820-0288D1\":\n return \"img/green-laptop.png\";\n case \"#icon-1547-0288D1-nodesc\":\n return \"img/purple-downtown.png\";\n case \"#icon-1577-0288D1\":\n return \"img/orange-fastfood.png\";\n case \"#icon-1577-DB4436\":\n return \"img/orange-food.png\";\n case \"#icon-1548-0288D1\":\n return \"img/purple-pillars.png\";\n case \"#icon-1646-DB4436\":\n return \"img/green-health.png\";\n case \"microscope\":\n return \"img/purple-science.png\";\n //case \"minus\": return \"img/minus.png\";\n case \"#icon-1548-0288D1\":\n return \"img/red-music.png\";\n case \"paint-blue\":\n return \"img/blue-paint.png\";\n case \"#icon-1509-0288D1\":\n return \"img/purple-paint.png\";\n case \"rcmp\":\n return \"img/purple-rcmp.png\";\n case \"running\":\n return \"img/blue-running.png\";\n case \"#icon-1685-0288D1\":\n return \"img/shop-green.png\";\n case \"shop-orange\":\n return \"img/orange-retail.png\";\n case \"#icon-1680-0288D1\":\n return \"img/blue-sports.png\";\n case \"#icon-1701-0288D1\":\n return \"img/blue-swim.png\";\n case \"tennis\":\n return \"img/blue-tennis.png\";\n case \"#icon-1709-0288D1\":\n return \"img/blue-threatre.png\";\n case \"ticket\":\n return \"img/purple-ticket.png\";\n case \"#icon-1886-0288D1\":\n return \"img/blue-tree.png\";\n case \"#icon-1890-0288D1\":\n return \"img/blue-volley.png\";\n default:\n return \"img/blue-dot.png\";\n }\n}", "title": "" }, { "docid": "c22c1c3f1a24bc6501bc09242cf3f270", "score": "0.47061238", "text": "function clouds(codes) {\n var icon;\n if (codes.weather === 801) {\n icon = codes.icon.endsWith('d') ? 'meteo_30.png' : 'meteo_29.png';\n } else if (codes.weather === 802 || codes.weather === 803) {\n icon = codes.icon.endsWith('d') ? 'meteo_28.png' : 'meteo_27.png';\n } else if (codes.weather === 804) {\n icon = 'meteo_26.png';\n } else if (codes.weather > 800) {\n icon = 'meteo_26.png';\n console.log('Weather code unknown:', codes.weather);\n }\n return icon;\n }", "title": "" }, { "docid": "d1fa1fb6a11eef0c02fc98199fb8046d", "score": "0.46875593", "text": "updateDriveSpecificIcons() {}", "title": "" }, { "docid": "d1fa1fb6a11eef0c02fc98199fb8046d", "score": "0.46875593", "text": "updateDriveSpecificIcons() {}", "title": "" }, { "docid": "d5a5e72bd3b0f1d0200837c7b43303c5", "score": "0.46739367", "text": "getSrcTypes () {\n return [\n { name: 'mainSrc'\n , keyEnding: `i${this.keyCounter}`\n }\n , { name: 'mainSrcThumbnail'\n , keyEnding: `t${this.keyCounter}`\n }\n , { name: 'nextSrc'\n , keyEnding: `i${this.keyCounter + 1}`\n }\n , { name: 'nextSrcThumbnail'\n , keyEnding: `t${this.keyCounter + 1}`\n }\n , { name: 'prevSrc'\n , keyEnding: `i${this.keyCounter - 1}`\n }\n , { name: 'prevSrcThumbnail'\n , keyEnding: `t${this.keyCounter - 1}`\n }\n ]\n }", "title": "" }, { "docid": "49a1c62f805c32b273e16bc08f890ce9", "score": "0.4666557", "text": "selectMarker(currentLocationType) {\n if (currentLocationType === \"Hotel\") {\n this.setState({\n markerImage: markerImageHotel\n });\n } else if (currentLocationType === \"Theater\") {\n this.setState({\n markerImage: markerImageTheater\n });\n } else if (currentLocationType === \"Bakery\") {\n this.setState({\n markerImage: markerImageBakery\n });\n } else if (currentLocationType === \"Scenic Lookout\") {\n this.setState({\n markerImage: markerImageScenic\n });\n } else if (\n currentLocationType === \"Coffee Shop\" ||\n \"American Restaurant\" ||\n \"Fast Food Restaurant\"\n ) {\n this.setState({\n markerImage: markerImageRestro\n });\n } else {\n this.setState({\n markerImage: markerImageBasic\n });\n }\n }", "title": "" }, { "docid": "0da166950c565e50c3a252127731a069", "score": "0.4660707", "text": "updateDriveSpecificIcons() {\n const metadata = this.parentTree_.metadataModel.getCache(\n [this.dirEntry_], ['shared', 'isMachineRoot', 'isExternalMedia']);\n\n const icon = this.querySelector('.icon');\n icon.classList.toggle('shared', !!(metadata[0] && metadata[0].shared));\n\n if (metadata[0] && metadata[0].isMachineRoot) {\n icon.setAttribute(\n 'volume-type-icon', VolumeManagerCommon.RootType.COMPUTER);\n }\n\n if (metadata[0] && metadata[0].isExternalMedia) {\n icon.setAttribute(\n 'volume-type-icon', VolumeManagerCommon.RootType.EXTERNAL_MEDIA);\n }\n }", "title": "" }, { "docid": "988d792594b3957ac453ae5c2bde9382", "score": "0.46409252", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-10\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-10-c4ded8e4.woff') format('woff')\"\n },\n icons: {\n 'ViewListGroup': '\\uF248',\n 'ViewListTree': '\\uF249',\n 'TriggerAuto': '\\uF24A',\n 'TriggerUser': '\\uF24B',\n 'PivotChart': '\\uF24C',\n 'StackedBarChart': '\\uF24D',\n 'StackedLineChart': '\\uF24E',\n 'BuildQueue': '\\uF24F',\n 'BuildQueueNew': '\\uF250',\n 'UserFollowed': '\\uF25C',\n 'ContactLink': '\\uF25F',\n 'Stack': '\\uF26F',\n 'Bullseye': '\\uF272',\n 'VennDiagram': '\\uF273',\n 'FiveTileGrid': '\\uF274',\n 'FocalPoint': '\\uF277',\n 'Insert': '\\uF278',\n 'RingerRemove': '\\uF279',\n 'TeamsLogoInverse': '\\uF27A',\n 'TeamsLogo': '\\uF27B',\n 'TeamsLogoFill': '\\uF27C',\n 'SkypeForBusinessLogoFill': '\\uF27D',\n 'SharepointLogo': '\\uF27E',\n 'SharepointLogoFill': '\\uF27F',\n 'DelveLogo': '\\uF280',\n 'DelveLogoFill': '\\uF281',\n 'OfficeVideoLogo': '\\uF282',\n 'OfficeVideoLogoFill': '\\uF283',\n 'ExchangeLogo': '\\uF284',\n 'ExchangeLogoFill': '\\uF285',\n 'Signin': '\\uF286',\n 'DocumentApproval': '\\uF28B',\n 'CloneToDesktop': '\\uF28C',\n 'InstallToDrive': '\\uF28D',\n 'Blur': '\\uF28E',\n 'Build': '\\uF28F',\n 'ProcessMetaTask': '\\uF290',\n 'BranchFork2': '\\uF291',\n 'BranchLocked': '\\uF292',\n 'BranchCommit': '\\uF293',\n 'BranchCompare': '\\uF294',\n 'BranchMerge': '\\uF295',\n 'BranchPullRequest': '\\uF296',\n 'BranchSearch': '\\uF297',\n 'BranchShelveset': '\\uF298',\n 'RawSource': '\\uF299',\n 'MergeDuplicate': '\\uF29A',\n 'RowsGroup': '\\uF29B',\n 'RowsChild': '\\uF29C',\n 'Deploy': '\\uF29D',\n 'Redeploy': '\\uF29E',\n 'ServerEnviroment': '\\uF29F',\n 'VisioDiagram': '\\uF2A0',\n 'HighlightMappedShapes': '\\uF2A1',\n 'TextCallout': '\\uF2A2',\n 'IconSetsFlag': '\\uF2A4',\n 'VisioLogo': '\\uF2A7',\n 'VisioLogoFill': '\\uF2A8',\n 'VisioDocument': '\\uF2A9',\n 'TimelineProgress': '\\uF2AA',\n 'TimelineDelivery': '\\uF2AB',\n 'Backlog': '\\uF2AC',\n 'TeamFavorite': '\\uF2AD',\n 'TaskGroup': '\\uF2AE',\n 'TaskGroupMirrored': '\\uF2AF',\n 'ScopeTemplate': '\\uF2B0',\n 'AssessmentGroupTemplate': '\\uF2B1',\n 'NewTeamProject': '\\uF2B2',\n 'CommentAdd': '\\uF2B3',\n 'CommentNext': '\\uF2B4',\n 'CommentPrevious': '\\uF2B5',\n 'ShopServer': '\\uF2B6',\n 'LocaleLanguage': '\\uF2B7',\n 'QueryList': '\\uF2B8',\n 'UserSync': '\\uF2B9',\n 'UserPause': '\\uF2BA',\n 'StreamingOff': '\\uF2BB',\n 'ArrowTallUpLeft': '\\uF2BD',\n 'ArrowTallUpRight': '\\uF2BE',\n 'ArrowTallDownLeft': '\\uF2BF',\n 'ArrowTallDownRight': '\\uF2C0',\n 'FieldEmpty': '\\uF2C1',\n 'FieldFilled': '\\uF2C2',\n 'FieldChanged': '\\uF2C3',\n 'FieldNotChanged': '\\uF2C4',\n 'RingerOff': '\\uF2C5',\n 'PlayResume': '\\uF2C6',\n 'BulletedList2': '\\uF2C7',\n 'BulletedList2Mirrored': '\\uF2C8',\n 'ImageCrosshair': '\\uF2C9',\n 'GitGraph': '\\uF2CA',\n 'Repo': '\\uF2CB',\n 'RepoSolid': '\\uF2CC',\n 'FolderQuery': '\\uF2CD',\n 'FolderList': '\\uF2CE',\n 'FolderListMirrored': '\\uF2CF',\n 'LocationOutline': '\\uF2D0',\n 'POISolid': '\\uF2D1',\n 'CalculatorNotEqualTo': '\\uF2D2',\n 'BoxSubtractSolid': '\\uF2D3'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "988d792594b3957ac453ae5c2bde9382", "score": "0.46409252", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-10\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-10-c4ded8e4.woff') format('woff')\"\n },\n icons: {\n 'ViewListGroup': '\\uF248',\n 'ViewListTree': '\\uF249',\n 'TriggerAuto': '\\uF24A',\n 'TriggerUser': '\\uF24B',\n 'PivotChart': '\\uF24C',\n 'StackedBarChart': '\\uF24D',\n 'StackedLineChart': '\\uF24E',\n 'BuildQueue': '\\uF24F',\n 'BuildQueueNew': '\\uF250',\n 'UserFollowed': '\\uF25C',\n 'ContactLink': '\\uF25F',\n 'Stack': '\\uF26F',\n 'Bullseye': '\\uF272',\n 'VennDiagram': '\\uF273',\n 'FiveTileGrid': '\\uF274',\n 'FocalPoint': '\\uF277',\n 'Insert': '\\uF278',\n 'RingerRemove': '\\uF279',\n 'TeamsLogoInverse': '\\uF27A',\n 'TeamsLogo': '\\uF27B',\n 'TeamsLogoFill': '\\uF27C',\n 'SkypeForBusinessLogoFill': '\\uF27D',\n 'SharepointLogo': '\\uF27E',\n 'SharepointLogoFill': '\\uF27F',\n 'DelveLogo': '\\uF280',\n 'DelveLogoFill': '\\uF281',\n 'OfficeVideoLogo': '\\uF282',\n 'OfficeVideoLogoFill': '\\uF283',\n 'ExchangeLogo': '\\uF284',\n 'ExchangeLogoFill': '\\uF285',\n 'Signin': '\\uF286',\n 'DocumentApproval': '\\uF28B',\n 'CloneToDesktop': '\\uF28C',\n 'InstallToDrive': '\\uF28D',\n 'Blur': '\\uF28E',\n 'Build': '\\uF28F',\n 'ProcessMetaTask': '\\uF290',\n 'BranchFork2': '\\uF291',\n 'BranchLocked': '\\uF292',\n 'BranchCommit': '\\uF293',\n 'BranchCompare': '\\uF294',\n 'BranchMerge': '\\uF295',\n 'BranchPullRequest': '\\uF296',\n 'BranchSearch': '\\uF297',\n 'BranchShelveset': '\\uF298',\n 'RawSource': '\\uF299',\n 'MergeDuplicate': '\\uF29A',\n 'RowsGroup': '\\uF29B',\n 'RowsChild': '\\uF29C',\n 'Deploy': '\\uF29D',\n 'Redeploy': '\\uF29E',\n 'ServerEnviroment': '\\uF29F',\n 'VisioDiagram': '\\uF2A0',\n 'HighlightMappedShapes': '\\uF2A1',\n 'TextCallout': '\\uF2A2',\n 'IconSetsFlag': '\\uF2A4',\n 'VisioLogo': '\\uF2A7',\n 'VisioLogoFill': '\\uF2A8',\n 'VisioDocument': '\\uF2A9',\n 'TimelineProgress': '\\uF2AA',\n 'TimelineDelivery': '\\uF2AB',\n 'Backlog': '\\uF2AC',\n 'TeamFavorite': '\\uF2AD',\n 'TaskGroup': '\\uF2AE',\n 'TaskGroupMirrored': '\\uF2AF',\n 'ScopeTemplate': '\\uF2B0',\n 'AssessmentGroupTemplate': '\\uF2B1',\n 'NewTeamProject': '\\uF2B2',\n 'CommentAdd': '\\uF2B3',\n 'CommentNext': '\\uF2B4',\n 'CommentPrevious': '\\uF2B5',\n 'ShopServer': '\\uF2B6',\n 'LocaleLanguage': '\\uF2B7',\n 'QueryList': '\\uF2B8',\n 'UserSync': '\\uF2B9',\n 'UserPause': '\\uF2BA',\n 'StreamingOff': '\\uF2BB',\n 'ArrowTallUpLeft': '\\uF2BD',\n 'ArrowTallUpRight': '\\uF2BE',\n 'ArrowTallDownLeft': '\\uF2BF',\n 'ArrowTallDownRight': '\\uF2C0',\n 'FieldEmpty': '\\uF2C1',\n 'FieldFilled': '\\uF2C2',\n 'FieldChanged': '\\uF2C3',\n 'FieldNotChanged': '\\uF2C4',\n 'RingerOff': '\\uF2C5',\n 'PlayResume': '\\uF2C6',\n 'BulletedList2': '\\uF2C7',\n 'BulletedList2Mirrored': '\\uF2C8',\n 'ImageCrosshair': '\\uF2C9',\n 'GitGraph': '\\uF2CA',\n 'Repo': '\\uF2CB',\n 'RepoSolid': '\\uF2CC',\n 'FolderQuery': '\\uF2CD',\n 'FolderList': '\\uF2CE',\n 'FolderListMirrored': '\\uF2CF',\n 'LocationOutline': '\\uF2D0',\n 'POISolid': '\\uF2D1',\n 'CalculatorNotEqualTo': '\\uF2D2',\n 'BoxSubtractSolid': '\\uF2D3'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "6e594b8fd7f042228ee7b94a5a201e99", "score": "0.46380195", "text": "function createMarkers(places, map) {\n\n var bounds = new google.maps.LatLngBounds();\n\n for (var i = 0, place; place = places[i]; i++) {\n var image = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n\n var marker = new google.maps.Marker({\n map: map,\n icon: image,\n title: place.name,\n position: place.geometry.location\n });\n bounds.extend(place.geometry.location);\n }\n //reposition map\n map.fitBounds(bounds);\n }", "title": "" }, { "docid": "e42a739f28a1296b7c297546a843eba8", "score": "0.46358708", "text": "getSrcTypes() {\n return [\n {\n name: 'mainSrc',\n keyEnding: `i${this.keyCounter}`,\n },\n {\n name: 'mainSrcThumbnail',\n keyEnding: `t${this.keyCounter}`,\n },\n {\n name: 'nextSrc',\n keyEnding: `i${this.keyCounter + 1}`,\n },\n {\n name: 'nextSrcThumbnail',\n keyEnding: `t${this.keyCounter + 1}`,\n },\n {\n name: 'prevSrc',\n keyEnding: `i${this.keyCounter - 1}`,\n },\n {\n name: 'prevSrcThumbnail',\n keyEnding: `t${this.keyCounter - 1}`,\n },\n ];\n }", "title": "" }, { "docid": "7acd9fd95d9edf07afdb2eccc0ce4b53", "score": "0.46355313", "text": "get customIconSets() {\n\t if (this._data.customIconSets === void 0) {\n\t this._data.customIconSets = customSets.emptyConvertedSet;\n\t }\n\t return this._data.customIconSets;\n\t }", "title": "" }, { "docid": "fef6d60c6f0d4062b3f0af6bd42346e9", "score": "0.4633241", "text": "function searchBoxPlaces(searchBox) {\n hideMarkers(placeMarkers);\n var places = searchBox.getPlaces();\n if (places.length == 0) {\n window.alert('We did not find any places matching that search!');\n } else {\n // For each place, get the icon, name and location.\n createMarkersForPlaces(places);\n }\n }", "title": "" }, { "docid": "0dd0046fddd65e8aba1ff6282dbf96b3", "score": "0.46262547", "text": "function getDialogIcon (dialogType) {\n var groupPhoto = '<img src=\"images/ava-group.svg\" width=\"30\" height=\"30\" class=\"round\">';\n var privatPhoto = '<img src=\"http://wecanbeaoriginal.com/blog/wp-content/uploads/2011/05/Owl.jpg\" width=\"30\" height=\"30\" class=\"round\">';\n var defaultPhoto = '<span class=\"glyphicon glyphicon-eye-close\"></span>';\n\n var dialogIcon;\n switch (dialogType) {\n case 1:\n dialogIcon = groupPhoto;\n break;\n case 2:\n dialogIcon = groupPhoto;\n break;\n case 3:\n \tdialogIcon = privatPhoto;\n break;\n default:\n dialogIcon = defaultPhoto;\n break;\n }\n return dialogIcon;\n}", "title": "" }, { "docid": "d5914bdfde796d22c240b8d4053f2b17", "score": "0.46239403", "text": "function checkicon(type){\nif(type==4||type==5||type==6||type==7){\nreturn true;\n}else{return false}\n}", "title": "" }, { "docid": "b31483d25ee86bfa2d8bd012b7d0fa3c", "score": "0.46232158", "text": "function getPaths(item, arr) {\n for (var i = 0, iLen = item.length; i < iLen; i++) {\n var currItem = item[i];\n try {\n switch (currItem.typename) {\n case 'GroupItem':\n getPaths(currItem.pageItems, arr);\n break;\n case 'PathItem':\n arr.push(currItem);\n break;\n case 'CompoundPathItem':\n getPaths(currItem.pathItems, arr);\n break;\n default:\n currItem.selected = false;\n break;\n }\n } catch (e) {}\n }\n}", "title": "" }, { "docid": "f0f215f364f325a1e2d6f08911ff0d2e", "score": "0.46204963", "text": "function penguinIcon() {\n iconType = image[0];\n $('#status').html(\"Selected place icon is \"+'<img src=\"'+iconType+'\">');\n}", "title": "" }, { "docid": "a4cf04061982802e841dda8a9c9b6f15", "score": "0.461626", "text": "function mapper_page_paint_icons() {\n\n if( glyph_url != null ) return;\n\n if(true) { \n glyph_post = \"/dynamapper/icons/weather-clear.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_post;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n\n if(true) {\n glyph_person = \"/dynamapper/icons/emblem-favorite.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_person;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n\n if(true) {\n glyph_url = \"/dynamapper/icons/emblem-important.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_url;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n}", "title": "" }, { "docid": "d7518b8151a783d86f1a782a9b3bd7e8", "score": "0.4605995", "text": "static _userIconWithDir() {\n return {\n path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,\n scale: 5,\n fillColor: 'blue',\n fillOpacity: 1,\n anchor: {x: 0, y: 2.5},\n strokeColor: 'white',\n strokeWeight: 3\n };\n }", "title": "" }, { "docid": "18fc7c44b69a5a6134b1500779490717", "score": "0.46002305", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-7\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-7-2b97bb99.woff') format('woff')\"\n },\n icons: {\n 'SingleBookmark': '\\uEDFF',\n 'SingleBookmarkSolid': '\\uEE00',\n 'DoubleChevronDown': '\\uEE04',\n 'FollowUser': '\\uEE05',\n 'ReplyAll': '\\uEE0A',\n 'WorkforceManagement': '\\uEE0F',\n 'RecruitmentManagement': '\\uEE12',\n 'Questionnaire': '\\uEE19',\n 'ManagerSelfService': '\\uEE23',\n 'ProductionFloorManagement': '\\uEE29',\n 'ProductRelease': '\\uEE2E',\n 'ProductVariant': '\\uEE30',\n 'ReplyMirrored': '\\uEE35',\n 'ReplyAllMirrored': '\\uEE36',\n 'Medal': '\\uEE38',\n 'AddGroup': '\\uEE3D',\n 'QuestionnaireMirrored': '\\uEE4B',\n 'CloudImportExport': '\\uEE55',\n 'TemporaryUser': '\\uEE58',\n 'CaretSolid16': '\\uEE62',\n 'GroupedDescending': '\\uEE66',\n 'GroupedAscending': '\\uEE67',\n 'AwayStatus': '\\uEE6A',\n 'MyMoviesTV': '\\uEE6C',\n 'GenericScan': '\\uEE6F',\n 'AustralianRules': '\\uEE70',\n 'WifiEthernet': '\\uEE77',\n 'TrackersMirrored': '\\uEE92',\n 'DateTimeMirrored': '\\uEE93',\n 'StopSolid': '\\uEE95',\n 'DoubleChevronUp12': '\\uEE96',\n 'DoubleChevronDown12': '\\uEE97',\n 'DoubleChevronLeft12': '\\uEE98',\n 'DoubleChevronRight12': '\\uEE99',\n 'CalendarAgenda': '\\uEE9A',\n 'ConnectVirtualMachine': '\\uEE9D',\n 'AddEvent': '\\uEEB5',\n 'AssetLibrary': '\\uEEB6',\n 'DataConnectionLibrary': '\\uEEB7',\n 'DocLibrary': '\\uEEB8',\n 'FormLibrary': '\\uEEB9',\n 'FormLibraryMirrored': '\\uEEBA',\n 'ReportLibrary': '\\uEEBB',\n 'ReportLibraryMirrored': '\\uEEBC',\n 'ContactCard': '\\uEEBD',\n 'CustomList': '\\uEEBE',\n 'CustomListMirrored': '\\uEEBF',\n 'IssueTracking': '\\uEEC0',\n 'IssueTrackingMirrored': '\\uEEC1',\n 'PictureLibrary': '\\uEEC2',\n 'OfficeAddinsLogo': '\\uEEC7',\n 'OfflineOneDriveParachute': '\\uEEC8',\n 'OfflineOneDriveParachuteDisabled': '\\uEEC9',\n 'TriangleSolidUp12': '\\uEECC',\n 'TriangleSolidDown12': '\\uEECD',\n 'TriangleSolidLeft12': '\\uEECE',\n 'TriangleSolidRight12': '\\uEECF',\n 'TriangleUp12': '\\uEED0',\n 'TriangleDown12': '\\uEED1',\n 'TriangleLeft12': '\\uEED2',\n 'TriangleRight12': '\\uEED3',\n 'ArrowUpRight8': '\\uEED4',\n 'ArrowDownRight8': '\\uEED5',\n 'DocumentSet': '\\uEED6',\n 'GoToDashboard': '\\uEEED',\n 'DelveAnalytics': '\\uEEEE',\n 'ArrowUpRightMirrored8': '\\uEEEF',\n 'ArrowDownRightMirrored8': '\\uEEF0',\n 'CompanyDirectory': '\\uEF0D',\n 'OpenEnrollment': '\\uEF1C',\n 'CompanyDirectoryMirrored': '\\uEF2B',\n 'OneDriveAdd': '\\uEF32',\n 'ProfileSearch': '\\uEF35',\n 'Header2': '\\uEF36',\n 'Header3': '\\uEF37',\n 'Header4': '\\uEF38',\n 'RingerSolid': '\\uEF3A',\n 'Eyedropper': '\\uEF3C',\n 'MarketDown': '\\uEF42',\n 'CalendarWorkWeek': '\\uEF51',\n 'SidePanel': '\\uEF52',\n 'GlobeFavorite': '\\uEF53',\n 'CaretTopLeftSolid8': '\\uEF54',\n 'CaretTopRightSolid8': '\\uEF55',\n 'ViewAll2': '\\uEF56',\n 'DocumentReply': '\\uEF57',\n 'PlayerSettings': '\\uEF58',\n 'ReceiptForward': '\\uEF59',\n 'ReceiptReply': '\\uEF5A',\n 'ReceiptCheck': '\\uEF5B',\n 'Fax': '\\uEF5C',\n 'RecurringEvent': '\\uEF5D',\n 'ReplyAlt': '\\uEF5E',\n 'ReplyAllAlt': '\\uEF5F',\n 'EditStyle': '\\uEF60',\n 'EditMail': '\\uEF61',\n 'Lifesaver': '\\uEF62',\n 'LifesaverLock': '\\uEF63',\n 'InboxCheck': '\\uEF64',\n 'FolderSearch': '\\uEF65'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "18fc7c44b69a5a6134b1500779490717", "score": "0.46002305", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-7\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-7-2b97bb99.woff') format('woff')\"\n },\n icons: {\n 'SingleBookmark': '\\uEDFF',\n 'SingleBookmarkSolid': '\\uEE00',\n 'DoubleChevronDown': '\\uEE04',\n 'FollowUser': '\\uEE05',\n 'ReplyAll': '\\uEE0A',\n 'WorkforceManagement': '\\uEE0F',\n 'RecruitmentManagement': '\\uEE12',\n 'Questionnaire': '\\uEE19',\n 'ManagerSelfService': '\\uEE23',\n 'ProductionFloorManagement': '\\uEE29',\n 'ProductRelease': '\\uEE2E',\n 'ProductVariant': '\\uEE30',\n 'ReplyMirrored': '\\uEE35',\n 'ReplyAllMirrored': '\\uEE36',\n 'Medal': '\\uEE38',\n 'AddGroup': '\\uEE3D',\n 'QuestionnaireMirrored': '\\uEE4B',\n 'CloudImportExport': '\\uEE55',\n 'TemporaryUser': '\\uEE58',\n 'CaretSolid16': '\\uEE62',\n 'GroupedDescending': '\\uEE66',\n 'GroupedAscending': '\\uEE67',\n 'AwayStatus': '\\uEE6A',\n 'MyMoviesTV': '\\uEE6C',\n 'GenericScan': '\\uEE6F',\n 'AustralianRules': '\\uEE70',\n 'WifiEthernet': '\\uEE77',\n 'TrackersMirrored': '\\uEE92',\n 'DateTimeMirrored': '\\uEE93',\n 'StopSolid': '\\uEE95',\n 'DoubleChevronUp12': '\\uEE96',\n 'DoubleChevronDown12': '\\uEE97',\n 'DoubleChevronLeft12': '\\uEE98',\n 'DoubleChevronRight12': '\\uEE99',\n 'CalendarAgenda': '\\uEE9A',\n 'ConnectVirtualMachine': '\\uEE9D',\n 'AddEvent': '\\uEEB5',\n 'AssetLibrary': '\\uEEB6',\n 'DataConnectionLibrary': '\\uEEB7',\n 'DocLibrary': '\\uEEB8',\n 'FormLibrary': '\\uEEB9',\n 'FormLibraryMirrored': '\\uEEBA',\n 'ReportLibrary': '\\uEEBB',\n 'ReportLibraryMirrored': '\\uEEBC',\n 'ContactCard': '\\uEEBD',\n 'CustomList': '\\uEEBE',\n 'CustomListMirrored': '\\uEEBF',\n 'IssueTracking': '\\uEEC0',\n 'IssueTrackingMirrored': '\\uEEC1',\n 'PictureLibrary': '\\uEEC2',\n 'OfficeAddinsLogo': '\\uEEC7',\n 'OfflineOneDriveParachute': '\\uEEC8',\n 'OfflineOneDriveParachuteDisabled': '\\uEEC9',\n 'TriangleSolidUp12': '\\uEECC',\n 'TriangleSolidDown12': '\\uEECD',\n 'TriangleSolidLeft12': '\\uEECE',\n 'TriangleSolidRight12': '\\uEECF',\n 'TriangleUp12': '\\uEED0',\n 'TriangleDown12': '\\uEED1',\n 'TriangleLeft12': '\\uEED2',\n 'TriangleRight12': '\\uEED3',\n 'ArrowUpRight8': '\\uEED4',\n 'ArrowDownRight8': '\\uEED5',\n 'DocumentSet': '\\uEED6',\n 'GoToDashboard': '\\uEEED',\n 'DelveAnalytics': '\\uEEEE',\n 'ArrowUpRightMirrored8': '\\uEEEF',\n 'ArrowDownRightMirrored8': '\\uEEF0',\n 'CompanyDirectory': '\\uEF0D',\n 'OpenEnrollment': '\\uEF1C',\n 'CompanyDirectoryMirrored': '\\uEF2B',\n 'OneDriveAdd': '\\uEF32',\n 'ProfileSearch': '\\uEF35',\n 'Header2': '\\uEF36',\n 'Header3': '\\uEF37',\n 'Header4': '\\uEF38',\n 'RingerSolid': '\\uEF3A',\n 'Eyedropper': '\\uEF3C',\n 'MarketDown': '\\uEF42',\n 'CalendarWorkWeek': '\\uEF51',\n 'SidePanel': '\\uEF52',\n 'GlobeFavorite': '\\uEF53',\n 'CaretTopLeftSolid8': '\\uEF54',\n 'CaretTopRightSolid8': '\\uEF55',\n 'ViewAll2': '\\uEF56',\n 'DocumentReply': '\\uEF57',\n 'PlayerSettings': '\\uEF58',\n 'ReceiptForward': '\\uEF59',\n 'ReceiptReply': '\\uEF5A',\n 'ReceiptCheck': '\\uEF5B',\n 'Fax': '\\uEF5C',\n 'RecurringEvent': '\\uEF5D',\n 'ReplyAlt': '\\uEF5E',\n 'ReplyAllAlt': '\\uEF5F',\n 'EditStyle': '\\uEF60',\n 'EditMail': '\\uEF61',\n 'Lifesaver': '\\uEF62',\n 'LifesaverLock': '\\uEF63',\n 'InboxCheck': '\\uEF64',\n 'FolderSearch': '\\uEF65'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "9a5ae1dd57defedf54c395c698f9c3df", "score": "0.45982602", "text": "function colorareIcone (icons, colors) {\r\nconst types = getType(icons);\r\nconsole.log(types);\r\n// creo new array non toccando il primo e iteo con le icone\r\nconst iconeColarate = icons.map((icon) => {\r\n const index = types.indexOf(icon.type);\r\n // copia esatta\r\n return {\r\n ...icon,\r\n color: colors[index]\r\n }\r\n});\r\nreturn iconeColarate;//ritorno risultato\r\n}", "title": "" }, { "docid": "a2ce53356688679dd28313a3ac08a87d", "score": "0.4596273", "text": "function findObjectsByType(type, map, layer) {\n var result = new Array();\n map.objects[layer].forEach(function(element){\n if(element.properties.type === type) {\n //Phaser uses top left, Tiled bottom left so we have to adjust\n //also keep in mind that the cup images are a bit smaller than the tile which is 16x16\n //so they might not be placed in the exact position as in Tiled\n element.y -= map.tileHeight;\n result.push(element);\n } \n });\n return result;\n }", "title": "" }, { "docid": "c5c83418a433097b09cd32b66cb03c87", "score": "0.4591503", "text": "getUniqueTypes() {\r\n let typesSet = this.state.types;\r\n this.state.items.map(item => (item.types.map(type => {if(this.state.allowedTypes.indexOf(type) > -1) typesSet.add(type)})));\r\n return Array.from(typesSet);\r\n }", "title": "" }, { "docid": "cc552473f6bc82191a329bb15a4320ae", "score": "0.4587552", "text": "static _userIconNoDir() {\n return {\n path: google.maps.SymbolPath.CIRCLE,\n scale: 8,\n fillColor: 'blue',\n fillOpacity: 1,\n strokeColor: 'white',\n strokeWeight: 2\n }\n }", "title": "" }, { "docid": "887a4bbc8e680b2a531e89c4b0a03767", "score": "0.45868742", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-4\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-4-a656cc0a.woff') format('woff')\"\n },\n icons: {\n 'HelpMirrored': '\\uEA51',\n 'ImportMirrored': '\\uEA52',\n 'ImportAllMirrored': '\\uEA53',\n 'ListMirrored': '\\uEA55',\n 'MailForwardMirrored': '\\uEA56',\n 'MailReplyMirrored': '\\uEA57',\n 'MailReplyAllMirrored': '\\uEA58',\n 'MiniContractMirrored': '\\uEA59',\n 'MiniExpandMirrored': '\\uEA5A',\n 'OpenPaneMirrored': '\\uEA5B',\n 'ParkingLocationMirrored': '\\uEA5E',\n 'SendMirrored': '\\uEA63',\n 'ShowResultsMirrored': '\\uEA65',\n 'ThumbnailViewMirrored': '\\uEA67',\n 'Media': '\\uEA69',\n 'Devices3': '\\uEA6C',\n 'Focus': '\\uEA6F',\n 'VideoLightOff': '\\uEA74',\n 'Lightbulb': '\\uEA80',\n 'StatusTriangle': '\\uEA82',\n 'VolumeDisabled': '\\uEA85',\n 'Puzzle': '\\uEA86',\n 'EmojiNeutral': '\\uEA87',\n 'EmojiDisappointed': '\\uEA88',\n 'HomeSolid': '\\uEA8A',\n 'Ringer': '\\uEA8F',\n 'PDF': '\\uEA90',\n 'HeartBroken': '\\uEA92',\n 'StoreLogo16': '\\uEA96',\n 'MultiSelectMirrored': '\\uEA98',\n 'Broom': '\\uEA99',\n 'AddToShoppingList': '\\uEA9A',\n 'Cocktails': '\\uEA9D',\n 'Wines': '\\uEABF',\n 'Articles': '\\uEAC1',\n 'Cycling': '\\uEAC7',\n 'DietPlanNotebook': '\\uEAC8',\n 'Pill': '\\uEACB',\n 'ExerciseTracker': '\\uEACC',\n 'HandsFree': '\\uEAD0',\n 'Medical': '\\uEAD4',\n 'Running': '\\uEADA',\n 'Weights': '\\uEADB',\n 'Trackers': '\\uEADF',\n 'AddNotes': '\\uEAE3',\n 'AllCurrency': '\\uEAE4',\n 'BarChart4': '\\uEAE7',\n 'CirclePlus': '\\uEAEE',\n 'Coffee': '\\uEAEF',\n 'Cotton': '\\uEAF3',\n 'Market': '\\uEAFC',\n 'Money': '\\uEAFD',\n 'PieDouble': '\\uEB04',\n 'PieSingle': '\\uEB05',\n 'RemoveFilter': '\\uEB08',\n 'Savings': '\\uEB0B',\n 'Sell': '\\uEB0C',\n 'StockDown': '\\uEB0F',\n 'StockUp': '\\uEB11',\n 'Lamp': '\\uEB19',\n 'Source': '\\uEB1B',\n 'MSNVideos': '\\uEB1C',\n 'Cricket': '\\uEB1E',\n 'Golf': '\\uEB1F',\n 'Baseball': '\\uEB20',\n 'Soccer': '\\uEB21',\n 'MoreSports': '\\uEB22',\n 'AutoRacing': '\\uEB24',\n 'CollegeHoops': '\\uEB25',\n 'CollegeFootball': '\\uEB26',\n 'ProFootball': '\\uEB27',\n 'ProHockey': '\\uEB28',\n 'Rugby': '\\uEB2D',\n 'SubstitutionsIn': '\\uEB31',\n 'Tennis': '\\uEB33',\n 'Arrivals': '\\uEB34',\n 'Design': '\\uEB3C',\n 'Website': '\\uEB41',\n 'Drop': '\\uEB42',\n 'HistoricalWeather': '\\uEB43',\n 'SkiResorts': '\\uEB45',\n 'Snowflake': '\\uEB46',\n 'BusSolid': '\\uEB47',\n 'FerrySolid': '\\uEB48',\n 'AirplaneSolid': '\\uEB4C',\n 'TrainSolid': '\\uEB4D',\n 'Ticket': '\\uEB54',\n 'WifiWarning4': '\\uEB63',\n 'Devices4': '\\uEB66',\n 'AzureLogo': '\\uEB6A',\n 'BingLogo': '\\uEB6B',\n 'MSNLogo': '\\uEB6C',\n 'OutlookLogoInverse': '\\uEB6D',\n 'OfficeLogo': '\\uEB6E',\n 'SkypeLogo': '\\uEB6F',\n 'Door': '\\uEB75',\n 'EditMirrored': '\\uEB7E',\n 'GiftCard': '\\uEB8E',\n 'DoubleBookmark': '\\uEB8F',\n 'StatusErrorFull': '\\uEB90'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "887a4bbc8e680b2a531e89c4b0a03767", "score": "0.45868742", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-4\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-4-a656cc0a.woff') format('woff')\"\n },\n icons: {\n 'HelpMirrored': '\\uEA51',\n 'ImportMirrored': '\\uEA52',\n 'ImportAllMirrored': '\\uEA53',\n 'ListMirrored': '\\uEA55',\n 'MailForwardMirrored': '\\uEA56',\n 'MailReplyMirrored': '\\uEA57',\n 'MailReplyAllMirrored': '\\uEA58',\n 'MiniContractMirrored': '\\uEA59',\n 'MiniExpandMirrored': '\\uEA5A',\n 'OpenPaneMirrored': '\\uEA5B',\n 'ParkingLocationMirrored': '\\uEA5E',\n 'SendMirrored': '\\uEA63',\n 'ShowResultsMirrored': '\\uEA65',\n 'ThumbnailViewMirrored': '\\uEA67',\n 'Media': '\\uEA69',\n 'Devices3': '\\uEA6C',\n 'Focus': '\\uEA6F',\n 'VideoLightOff': '\\uEA74',\n 'Lightbulb': '\\uEA80',\n 'StatusTriangle': '\\uEA82',\n 'VolumeDisabled': '\\uEA85',\n 'Puzzle': '\\uEA86',\n 'EmojiNeutral': '\\uEA87',\n 'EmojiDisappointed': '\\uEA88',\n 'HomeSolid': '\\uEA8A',\n 'Ringer': '\\uEA8F',\n 'PDF': '\\uEA90',\n 'HeartBroken': '\\uEA92',\n 'StoreLogo16': '\\uEA96',\n 'MultiSelectMirrored': '\\uEA98',\n 'Broom': '\\uEA99',\n 'AddToShoppingList': '\\uEA9A',\n 'Cocktails': '\\uEA9D',\n 'Wines': '\\uEABF',\n 'Articles': '\\uEAC1',\n 'Cycling': '\\uEAC7',\n 'DietPlanNotebook': '\\uEAC8',\n 'Pill': '\\uEACB',\n 'ExerciseTracker': '\\uEACC',\n 'HandsFree': '\\uEAD0',\n 'Medical': '\\uEAD4',\n 'Running': '\\uEADA',\n 'Weights': '\\uEADB',\n 'Trackers': '\\uEADF',\n 'AddNotes': '\\uEAE3',\n 'AllCurrency': '\\uEAE4',\n 'BarChart4': '\\uEAE7',\n 'CirclePlus': '\\uEAEE',\n 'Coffee': '\\uEAEF',\n 'Cotton': '\\uEAF3',\n 'Market': '\\uEAFC',\n 'Money': '\\uEAFD',\n 'PieDouble': '\\uEB04',\n 'PieSingle': '\\uEB05',\n 'RemoveFilter': '\\uEB08',\n 'Savings': '\\uEB0B',\n 'Sell': '\\uEB0C',\n 'StockDown': '\\uEB0F',\n 'StockUp': '\\uEB11',\n 'Lamp': '\\uEB19',\n 'Source': '\\uEB1B',\n 'MSNVideos': '\\uEB1C',\n 'Cricket': '\\uEB1E',\n 'Golf': '\\uEB1F',\n 'Baseball': '\\uEB20',\n 'Soccer': '\\uEB21',\n 'MoreSports': '\\uEB22',\n 'AutoRacing': '\\uEB24',\n 'CollegeHoops': '\\uEB25',\n 'CollegeFootball': '\\uEB26',\n 'ProFootball': '\\uEB27',\n 'ProHockey': '\\uEB28',\n 'Rugby': '\\uEB2D',\n 'SubstitutionsIn': '\\uEB31',\n 'Tennis': '\\uEB33',\n 'Arrivals': '\\uEB34',\n 'Design': '\\uEB3C',\n 'Website': '\\uEB41',\n 'Drop': '\\uEB42',\n 'HistoricalWeather': '\\uEB43',\n 'SkiResorts': '\\uEB45',\n 'Snowflake': '\\uEB46',\n 'BusSolid': '\\uEB47',\n 'FerrySolid': '\\uEB48',\n 'AirplaneSolid': '\\uEB4C',\n 'TrainSolid': '\\uEB4D',\n 'Ticket': '\\uEB54',\n 'WifiWarning4': '\\uEB63',\n 'Devices4': '\\uEB66',\n 'AzureLogo': '\\uEB6A',\n 'BingLogo': '\\uEB6B',\n 'MSNLogo': '\\uEB6C',\n 'OutlookLogoInverse': '\\uEB6D',\n 'OfficeLogo': '\\uEB6E',\n 'SkypeLogo': '\\uEB6F',\n 'Door': '\\uEB75',\n 'EditMirrored': '\\uEB7E',\n 'GiftCard': '\\uEB8E',\n 'DoubleBookmark': '\\uEB8F',\n 'StatusErrorFull': '\\uEB90'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "6d9c9de06d4236a38d110f066197bf33", "score": "0.45853534", "text": "get allAnts() {\n var ants = [];\n for(var i=0; i<this._places.length; i++){\n for(var j=0; j<this._places[i].length; j++){\n if(this._places[i][j].ant !== undefined){\n ants.push(this._places[i][j].ant);\n }\n }\n }\n return ants;\n }", "title": "" }, { "docid": "a1b2ab42831a641b416ccf81bde802e7", "score": "0.4572512", "text": "function generatePlaceArr(data, callback){\n var placeArr = [];\n var parsed = JSON.parse(data);\n var len = parsed['results'].length;\n var counter = -1; //init\n var flagFirst = 0;\n\n //get 5 google place items. Place in array.\n for(var i=0; i<len; i++){\n var name = parsed['results'][i].name;\n var type=\"Categories: \"\n var address = parsed['results'][i].formatted_address;\n var photo = \"photo\";\n var lat = parsed['results'][i].geometry.location.lat;\n var lng = parsed['results'][i].geometry.location.lng;\n var ref =\"ref\";\n var images = parsed['results'][i].photos;\n var categTypes = parsed['results'][i].types;\n var placeID = parsed['results'][i].place_id;\n \n if( (typeof images !== 'undefined') && categTypes && name && address && lat && lng && counter <4 && placeID){\n counter++;\n ref = parsed['results'][i].photos[0].photo_reference;\n \n //get place categories\n var typesArr = parsed['results'][i].types;\n var typesLen = typesArr.length;\n \n for(var k=0; k<typesLen; k++){\n type += typesArr[k]+\", \";\n }\n type = type.substring(0, type.length - 2); //remove last ', '\n placeArr[counter] = [name, type, address, ref, lat, lng, placeID];\n }\n }\n return callback(placeArr);\n}", "title": "" }, { "docid": "03bac881200b3fa1c873497c3fb23801", "score": "0.4570365", "text": "async function parseMethodIcons() {\n console.time('ObtainMethodIcons');\n\n const paths = [\n ...getCraftingIconPaths(),\n ...getGatheringIconPaths(),\n ...getQuestJournalIconPaths(),\n { path: '/i/094000/094519.png', as: 1 }, // Shop.\n { path: '/i/094000/094513.png', as: 2 }, // Achievement.\n { path: '/i/094000/094516.png', as: 3 }, // Collectors Edition.\n { path: '/i/094000/094606.png', as: 4 }, // Instanced Content.\n { path: '/i/094000/094503.png', as: 5 }, // Legacy-related.\n { path: '/i/094000/094544.png', as: 6 }, // Recruit a Friend campaign.\n { path: '/i/094000/094565.png', as: 7 }, // Mog Station.\n { path: '/i/094000/094547.png', as: 8 }, // Fan Festival.\n { path: '/i/094000/094602.png', as: 9 }, // Item Exchange.\n { path: '/i/094000/094551.png', as: 10 }, // Retainer Venture.\n { path: '/i/094000/094577.png', as: 11 }, // Treasure Hunt.\n { path: '/i/094000/094506.png', as: 12 }, // FATEs.\n { path: '/i/094000/094572.png', as: 13 }, // Generic descriptions.\n { path: '/i/094000/094568.png', as: 14 }, // Default content.\n { path: '/i/094000/094542.png', as: 15 }, // Chocobo.\n { path: '/i/094000/094566.png', as: 16 }, // Prize winner (e.g. Forum Contest).\n { path: '/i/094000/094514.png', as: 17 }, // Companion app.\n { path: '/i/094000/094569.png', as: 18 }, // Gardening.\n ];\n\n await processIconGroup(paths, 'methods', { resize: 24 });\n console.timeEnd('ObtainMethodIcons');\n}", "title": "" }, { "docid": "ff5d52aa2eede6372153d5b8541d14a7", "score": "0.45689645", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-9\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-9-c6162b42.woff') format('woff')\"\n },\n icons: {\n 'AddFavoriteFill': '\\uF0C9',\n 'BufferTimeBefore': '\\uF0CF',\n 'BufferTimeAfter': '\\uF0D0',\n 'BufferTimeBoth': '\\uF0D1',\n 'PublishContent': '\\uF0D4',\n 'ClipboardList': '\\uF0E3',\n 'ClipboardListMirrored': '\\uF0E4',\n 'CannedChat': '\\uF0F2',\n 'SkypeForBusinessLogo': '\\uF0FC',\n 'TabCenter': '\\uF100',\n 'PageCheckedin': '\\uF104',\n 'PageList': '\\uF106',\n 'ReadOutLoud': '\\uF112',\n 'CaretBottomLeftSolid8': '\\uF121',\n 'CaretBottomRightSolid8': '\\uF122',\n 'FolderHorizontal': '\\uF12B',\n 'MicrosoftStaffhubLogo': '\\uF130',\n 'GiftboxOpen': '\\uF133',\n 'StatusCircleOuter': '\\uF136',\n 'StatusCircleInner': '\\uF137',\n 'StatusCircleRing': '\\uF138',\n 'StatusTriangleOuter': '\\uF139',\n 'StatusTriangleInner': '\\uF13A',\n 'StatusTriangleExclamation': '\\uF13B',\n 'StatusCircleExclamation': '\\uF13C',\n 'StatusCircleErrorX': '\\uF13D',\n 'StatusCircleInfo': '\\uF13F',\n 'StatusCircleBlock': '\\uF140',\n 'StatusCircleBlock2': '\\uF141',\n 'StatusCircleQuestionMark': '\\uF142',\n 'StatusCircleSync': '\\uF143',\n 'Toll': '\\uF160',\n 'ExploreContentSingle': '\\uF164',\n 'CollapseContent': '\\uF165',\n 'CollapseContentSingle': '\\uF166',\n 'InfoSolid': '\\uF167',\n 'GroupList': '\\uF168',\n 'ProgressRingDots': '\\uF16A',\n 'CaloriesAdd': '\\uF172',\n 'BranchFork': '\\uF173',\n 'MuteChat': '\\uF17A',\n 'AddHome': '\\uF17B',\n 'AddWork': '\\uF17C',\n 'MobileReport': '\\uF18A',\n 'ScaleVolume': '\\uF18C',\n 'HardDriveGroup': '\\uF18F',\n 'FastMode': '\\uF19A',\n 'ToggleLeft': '\\uF19E',\n 'ToggleRight': '\\uF19F',\n 'TriangleShape': '\\uF1A7',\n 'RectangleShape': '\\uF1A9',\n 'CubeShape': '\\uF1AA',\n 'Trophy2': '\\uF1AE',\n 'BucketColor': '\\uF1B6',\n 'BucketColorFill': '\\uF1B7',\n 'Taskboard': '\\uF1C2',\n 'SingleColumn': '\\uF1D3',\n 'DoubleColumn': '\\uF1D4',\n 'TripleColumn': '\\uF1D5',\n 'ColumnLeftTwoThirds': '\\uF1D6',\n 'ColumnRightTwoThirds': '\\uF1D7',\n 'AccessLogoFill': '\\uF1DB',\n 'AnalyticsLogo': '\\uF1DE',\n 'AnalyticsQuery': '\\uF1DF',\n 'NewAnalyticsQuery': '\\uF1E0',\n 'AnalyticsReport': '\\uF1E1',\n 'WordLogo': '\\uF1E3',\n 'WordLogoFill': '\\uF1E4',\n 'ExcelLogo': '\\uF1E5',\n 'ExcelLogoFill': '\\uF1E6',\n 'OneNoteLogo': '\\uF1E7',\n 'OneNoteLogoFill': '\\uF1E8',\n 'OutlookLogo': '\\uF1E9',\n 'OutlookLogoFill': '\\uF1EA',\n 'PowerPointLogo': '\\uF1EB',\n 'PowerPointLogoFill': '\\uF1EC',\n 'PublisherLogo': '\\uF1ED',\n 'PublisherLogoFill': '\\uF1EE',\n 'ScheduleEventAction': '\\uF1EF',\n 'FlameSolid': '\\uF1F3',\n 'ServerProcesses': '\\uF1FE',\n 'Server': '\\uF201',\n 'SaveAll': '\\uF203',\n 'LinkedInLogo': '\\uF20A',\n 'Decimals': '\\uF218',\n 'SidePanelMirrored': '\\uF221',\n 'ProtectRestrict': '\\uF22A',\n 'Blog': '\\uF22B',\n 'UnknownMirrored': '\\uF22E',\n 'PublicContactCardMirrored': '\\uF230',\n 'GridViewSmall': '\\uF232',\n 'GridViewMedium': '\\uF233',\n 'GridViewLarge': '\\uF234',\n 'Step': '\\uF241',\n 'StepInsert': '\\uF242',\n 'StepShared': '\\uF243',\n 'StepSharedAdd': '\\uF244',\n 'StepSharedInsert': '\\uF245',\n 'ViewDashboard': '\\uF246',\n 'ViewList': '\\uF247'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "ff5d52aa2eede6372153d5b8541d14a7", "score": "0.45689645", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-9\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-9-c6162b42.woff') format('woff')\"\n },\n icons: {\n 'AddFavoriteFill': '\\uF0C9',\n 'BufferTimeBefore': '\\uF0CF',\n 'BufferTimeAfter': '\\uF0D0',\n 'BufferTimeBoth': '\\uF0D1',\n 'PublishContent': '\\uF0D4',\n 'ClipboardList': '\\uF0E3',\n 'ClipboardListMirrored': '\\uF0E4',\n 'CannedChat': '\\uF0F2',\n 'SkypeForBusinessLogo': '\\uF0FC',\n 'TabCenter': '\\uF100',\n 'PageCheckedin': '\\uF104',\n 'PageList': '\\uF106',\n 'ReadOutLoud': '\\uF112',\n 'CaretBottomLeftSolid8': '\\uF121',\n 'CaretBottomRightSolid8': '\\uF122',\n 'FolderHorizontal': '\\uF12B',\n 'MicrosoftStaffhubLogo': '\\uF130',\n 'GiftboxOpen': '\\uF133',\n 'StatusCircleOuter': '\\uF136',\n 'StatusCircleInner': '\\uF137',\n 'StatusCircleRing': '\\uF138',\n 'StatusTriangleOuter': '\\uF139',\n 'StatusTriangleInner': '\\uF13A',\n 'StatusTriangleExclamation': '\\uF13B',\n 'StatusCircleExclamation': '\\uF13C',\n 'StatusCircleErrorX': '\\uF13D',\n 'StatusCircleInfo': '\\uF13F',\n 'StatusCircleBlock': '\\uF140',\n 'StatusCircleBlock2': '\\uF141',\n 'StatusCircleQuestionMark': '\\uF142',\n 'StatusCircleSync': '\\uF143',\n 'Toll': '\\uF160',\n 'ExploreContentSingle': '\\uF164',\n 'CollapseContent': '\\uF165',\n 'CollapseContentSingle': '\\uF166',\n 'InfoSolid': '\\uF167',\n 'GroupList': '\\uF168',\n 'ProgressRingDots': '\\uF16A',\n 'CaloriesAdd': '\\uF172',\n 'BranchFork': '\\uF173',\n 'MuteChat': '\\uF17A',\n 'AddHome': '\\uF17B',\n 'AddWork': '\\uF17C',\n 'MobileReport': '\\uF18A',\n 'ScaleVolume': '\\uF18C',\n 'HardDriveGroup': '\\uF18F',\n 'FastMode': '\\uF19A',\n 'ToggleLeft': '\\uF19E',\n 'ToggleRight': '\\uF19F',\n 'TriangleShape': '\\uF1A7',\n 'RectangleShape': '\\uF1A9',\n 'CubeShape': '\\uF1AA',\n 'Trophy2': '\\uF1AE',\n 'BucketColor': '\\uF1B6',\n 'BucketColorFill': '\\uF1B7',\n 'Taskboard': '\\uF1C2',\n 'SingleColumn': '\\uF1D3',\n 'DoubleColumn': '\\uF1D4',\n 'TripleColumn': '\\uF1D5',\n 'ColumnLeftTwoThirds': '\\uF1D6',\n 'ColumnRightTwoThirds': '\\uF1D7',\n 'AccessLogoFill': '\\uF1DB',\n 'AnalyticsLogo': '\\uF1DE',\n 'AnalyticsQuery': '\\uF1DF',\n 'NewAnalyticsQuery': '\\uF1E0',\n 'AnalyticsReport': '\\uF1E1',\n 'WordLogo': '\\uF1E3',\n 'WordLogoFill': '\\uF1E4',\n 'ExcelLogo': '\\uF1E5',\n 'ExcelLogoFill': '\\uF1E6',\n 'OneNoteLogo': '\\uF1E7',\n 'OneNoteLogoFill': '\\uF1E8',\n 'OutlookLogo': '\\uF1E9',\n 'OutlookLogoFill': '\\uF1EA',\n 'PowerPointLogo': '\\uF1EB',\n 'PowerPointLogoFill': '\\uF1EC',\n 'PublisherLogo': '\\uF1ED',\n 'PublisherLogoFill': '\\uF1EE',\n 'ScheduleEventAction': '\\uF1EF',\n 'FlameSolid': '\\uF1F3',\n 'ServerProcesses': '\\uF1FE',\n 'Server': '\\uF201',\n 'SaveAll': '\\uF203',\n 'LinkedInLogo': '\\uF20A',\n 'Decimals': '\\uF218',\n 'SidePanelMirrored': '\\uF221',\n 'ProtectRestrict': '\\uF22A',\n 'Blog': '\\uF22B',\n 'UnknownMirrored': '\\uF22E',\n 'PublicContactCardMirrored': '\\uF230',\n 'GridViewSmall': '\\uF232',\n 'GridViewMedium': '\\uF233',\n 'GridViewLarge': '\\uF234',\n 'Step': '\\uF241',\n 'StepInsert': '\\uF242',\n 'StepShared': '\\uF243',\n 'StepSharedAdd': '\\uF244',\n 'StepSharedInsert': '\\uF245',\n 'ViewDashboard': '\\uF246',\n 'ViewList': '\\uF247'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "01f3665878f30c8a7fdccb24b4058733", "score": "0.45672157", "text": "function chooseRandomPlaces(results, type) {\n let randomPlaces = [];\n\n /* Added to enable location pinning.\n * Decide how many results need to be chosen based on how many results\n * of the same type have already been pinned. */\n for (let i = 0; i < pinnedList.length; i++) {\n if (pinnedList[i].type === type) {\n numberOfResults--;\n }\n }\n\n let loopCeiling = Math.min(numberOfResults, results.length);\n\n /* Restore the original value of numberOfResults */\n numberOfResults = 5;\n\n for (let i = 0; i < loopCeiling; i++) {\n let randomIndex = Math.floor(Math.random() * (results.length - 1));\n let randomElementArray = results.splice(randomIndex, 1);\n randomPlaces.push(randomElementArray[0]);\n }\n\n return randomPlaces;\n}", "title": "" }, { "docid": "23f85e75535ec38b1f11e73fd975f274", "score": "0.4564479", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-16\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-16-9cf93f3b.woff') format('woff')\"\n },\n icons: {\n 'OfficeChatSolid': '\\uF710',\n 'MailSchedule': '\\uF72E',\n 'WarningSolid': '\\uF736',\n 'Blocked2Solid': '\\uF737',\n 'SkypeCircleArrow': '\\uF747',\n 'SkypeArrow': '\\uF748',\n 'SyncStatus': '\\uF751',\n 'SyncStatusSolid': '\\uF752',\n 'ProjectDocument': '\\uF759',\n 'ToDoLogoOutline': '\\uF75B',\n 'VisioOnlineLogoFill32': '\\uF75F',\n 'VisioOnlineLogo32': '\\uF760',\n 'VisioOnlineLogoCloud32': '\\uF761',\n 'VisioDiagramSync': '\\uF762',\n 'Event12': '\\uF763',\n 'EventDateMissed12': '\\uF764',\n 'UserOptional': '\\uF767',\n 'ResponsesMenu': '\\uF768',\n 'DoubleDownArrow': '\\uF769',\n 'DistributeDown': '\\uF76A',\n 'BookmarkReport': '\\uF76B',\n 'FilterSettings': '\\uF76C',\n 'GripperDotsVertical': '\\uF772',\n 'MailAttached': '\\uF774',\n 'AddIn': '\\uF775',\n 'LinkedDatabase': '\\uF779',\n 'TableLink': '\\uF77A',\n 'PromotedDatabase': '\\uF77D',\n 'BarChartVerticalFilter': '\\uF77E',\n 'BarChartVerticalFilterSolid': '\\uF77F',\n 'MicOff2': '\\uF781',\n 'MicrosoftTranslatorLogo': '\\uF782',\n 'ShowTimeAs': '\\uF787',\n 'FileRequest': '\\uF789',\n 'WorkItemAlert': '\\uF78F',\n 'PowerBILogo16': '\\uF790',\n 'PowerBILogoBackplate16': '\\uF791',\n 'BulletedListText': '\\uF792',\n 'BulletedListBullet': '\\uF793',\n 'BulletedListTextMirrored': '\\uF794',\n 'BulletedListBulletMirrored': '\\uF795',\n 'NumberedListText': '\\uF796',\n 'NumberedListNumber': '\\uF797',\n 'NumberedListTextMirrored': '\\uF798',\n 'NumberedListNumberMirrored': '\\uF799',\n 'RemoveLinkChain': '\\uF79A',\n 'RemoveLinkX': '\\uF79B',\n 'FabricTextHighlight': '\\uF79C',\n 'ClearFormattingA': '\\uF79D',\n 'ClearFormattingEraser': '\\uF79E',\n 'Photo2Fill': '\\uF79F',\n 'IncreaseIndentText': '\\uF7A0',\n 'IncreaseIndentArrow': '\\uF7A1',\n 'DecreaseIndentText': '\\uF7A2',\n 'DecreaseIndentArrow': '\\uF7A3',\n 'IncreaseIndentTextMirrored': '\\uF7A4',\n 'IncreaseIndentArrowMirrored': '\\uF7A5',\n 'DecreaseIndentTextMirrored': '\\uF7A6',\n 'DecreaseIndentArrowMirrored': '\\uF7A7',\n 'CheckListText': '\\uF7A8',\n 'CheckListCheck': '\\uF7A9',\n 'CheckListTextMirrored': '\\uF7AA',\n 'CheckListCheckMirrored': '\\uF7AB',\n 'NumberSymbol': '\\uF7AC',\n 'Coupon': '\\uF7BC',\n 'VerifiedBrand': '\\uF7BD',\n 'ReleaseGate': '\\uF7BE',\n 'ReleaseGateCheck': '\\uF7BF',\n 'ReleaseGateError': '\\uF7C0',\n 'M365InvoicingLogo': '\\uF7C1',\n 'RemoveFromShoppingList': '\\uF7D5',\n 'ShieldAlert': '\\uF7D7',\n 'FabricTextHighlightComposite': '\\uF7DA',\n 'Dataflows': '\\uF7DD',\n 'GenericScanFilled': '\\uF7DE',\n 'DiagnosticDataBarTooltip': '\\uF7DF',\n 'SaveToMobile': '\\uF7E0',\n 'Orientation2': '\\uF7E1',\n 'ScreenCast': '\\uF7E2',\n 'ShowGrid': '\\uF7E3',\n 'SnapToGrid': '\\uF7E4',\n 'ContactList': '\\uF7E5',\n 'NewMail': '\\uF7EA',\n 'EyeShadow': '\\uF7EB',\n 'FabricFolderConfirm': '\\uF7FF',\n 'InformationBarriers': '\\uF803',\n 'CommentActive': '\\uF804',\n 'ColumnVerticalSectionEdit': '\\uF806',\n 'WavingHand': '\\uF807',\n 'ShakeDevice': '\\uF80A',\n 'SmartGlassRemote': '\\uF80B',\n 'Rotate90Clockwise': '\\uF80D',\n 'Rotate90CounterClockwise': '\\uF80E',\n 'CampaignTemplate': '\\uF811',\n 'ChartTemplate': '\\uF812',\n 'PageListFilter': '\\uF813',\n 'SecondaryNav': '\\uF814',\n 'ColumnVerticalSection': '\\uF81E',\n 'SkypeCircleSlash': '\\uF825',\n 'SkypeSlash': '\\uF826'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "23f85e75535ec38b1f11e73fd975f274", "score": "0.4564479", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-16\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-16-9cf93f3b.woff') format('woff')\"\n },\n icons: {\n 'OfficeChatSolid': '\\uF710',\n 'MailSchedule': '\\uF72E',\n 'WarningSolid': '\\uF736',\n 'Blocked2Solid': '\\uF737',\n 'SkypeCircleArrow': '\\uF747',\n 'SkypeArrow': '\\uF748',\n 'SyncStatus': '\\uF751',\n 'SyncStatusSolid': '\\uF752',\n 'ProjectDocument': '\\uF759',\n 'ToDoLogoOutline': '\\uF75B',\n 'VisioOnlineLogoFill32': '\\uF75F',\n 'VisioOnlineLogo32': '\\uF760',\n 'VisioOnlineLogoCloud32': '\\uF761',\n 'VisioDiagramSync': '\\uF762',\n 'Event12': '\\uF763',\n 'EventDateMissed12': '\\uF764',\n 'UserOptional': '\\uF767',\n 'ResponsesMenu': '\\uF768',\n 'DoubleDownArrow': '\\uF769',\n 'DistributeDown': '\\uF76A',\n 'BookmarkReport': '\\uF76B',\n 'FilterSettings': '\\uF76C',\n 'GripperDotsVertical': '\\uF772',\n 'MailAttached': '\\uF774',\n 'AddIn': '\\uF775',\n 'LinkedDatabase': '\\uF779',\n 'TableLink': '\\uF77A',\n 'PromotedDatabase': '\\uF77D',\n 'BarChartVerticalFilter': '\\uF77E',\n 'BarChartVerticalFilterSolid': '\\uF77F',\n 'MicOff2': '\\uF781',\n 'MicrosoftTranslatorLogo': '\\uF782',\n 'ShowTimeAs': '\\uF787',\n 'FileRequest': '\\uF789',\n 'WorkItemAlert': '\\uF78F',\n 'PowerBILogo16': '\\uF790',\n 'PowerBILogoBackplate16': '\\uF791',\n 'BulletedListText': '\\uF792',\n 'BulletedListBullet': '\\uF793',\n 'BulletedListTextMirrored': '\\uF794',\n 'BulletedListBulletMirrored': '\\uF795',\n 'NumberedListText': '\\uF796',\n 'NumberedListNumber': '\\uF797',\n 'NumberedListTextMirrored': '\\uF798',\n 'NumberedListNumberMirrored': '\\uF799',\n 'RemoveLinkChain': '\\uF79A',\n 'RemoveLinkX': '\\uF79B',\n 'FabricTextHighlight': '\\uF79C',\n 'ClearFormattingA': '\\uF79D',\n 'ClearFormattingEraser': '\\uF79E',\n 'Photo2Fill': '\\uF79F',\n 'IncreaseIndentText': '\\uF7A0',\n 'IncreaseIndentArrow': '\\uF7A1',\n 'DecreaseIndentText': '\\uF7A2',\n 'DecreaseIndentArrow': '\\uF7A3',\n 'IncreaseIndentTextMirrored': '\\uF7A4',\n 'IncreaseIndentArrowMirrored': '\\uF7A5',\n 'DecreaseIndentTextMirrored': '\\uF7A6',\n 'DecreaseIndentArrowMirrored': '\\uF7A7',\n 'CheckListText': '\\uF7A8',\n 'CheckListCheck': '\\uF7A9',\n 'CheckListTextMirrored': '\\uF7AA',\n 'CheckListCheckMirrored': '\\uF7AB',\n 'NumberSymbol': '\\uF7AC',\n 'Coupon': '\\uF7BC',\n 'VerifiedBrand': '\\uF7BD',\n 'ReleaseGate': '\\uF7BE',\n 'ReleaseGateCheck': '\\uF7BF',\n 'ReleaseGateError': '\\uF7C0',\n 'M365InvoicingLogo': '\\uF7C1',\n 'RemoveFromShoppingList': '\\uF7D5',\n 'ShieldAlert': '\\uF7D7',\n 'FabricTextHighlightComposite': '\\uF7DA',\n 'Dataflows': '\\uF7DD',\n 'GenericScanFilled': '\\uF7DE',\n 'DiagnosticDataBarTooltip': '\\uF7DF',\n 'SaveToMobile': '\\uF7E0',\n 'Orientation2': '\\uF7E1',\n 'ScreenCast': '\\uF7E2',\n 'ShowGrid': '\\uF7E3',\n 'SnapToGrid': '\\uF7E4',\n 'ContactList': '\\uF7E5',\n 'NewMail': '\\uF7EA',\n 'EyeShadow': '\\uF7EB',\n 'FabricFolderConfirm': '\\uF7FF',\n 'InformationBarriers': '\\uF803',\n 'CommentActive': '\\uF804',\n 'ColumnVerticalSectionEdit': '\\uF806',\n 'WavingHand': '\\uF807',\n 'ShakeDevice': '\\uF80A',\n 'SmartGlassRemote': '\\uF80B',\n 'Rotate90Clockwise': '\\uF80D',\n 'Rotate90CounterClockwise': '\\uF80E',\n 'CampaignTemplate': '\\uF811',\n 'ChartTemplate': '\\uF812',\n 'PageListFilter': '\\uF813',\n 'SecondaryNav': '\\uF814',\n 'ColumnVerticalSection': '\\uF81E',\n 'SkypeCircleSlash': '\\uF825',\n 'SkypeSlash': '\\uF826'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "9ae1afb4f9a9bd678ebdb6823976230b", "score": "0.45556483", "text": "displayedIcons () {\n let icons = []\n if (this.iconsList) {\n icons = this.filteredIcons\n\n // should the icons be paged?\n if (this.pagination && this.pagination.itemsPerPage !== 0) {\n icons = icons.slice(this.firstItemIndex, this.lastItemIndex)\n }\n }\n return icons\n }", "title": "" }, { "docid": "2a0812ac71733c300f605d4379416407", "score": "0.4554015", "text": "function paths (urls) {\n return urls ? urls.map(path) : [];\n }", "title": "" }, { "docid": "529e271e45ef0c375210efeddc85630c", "score": "0.4552077", "text": "function approximateIcons(currIcon) {\n console.log('currIcon', currIcon);\n if (currIcon === 'clear-day') {\n return 'sun';\n } else if (currIcon === 'fog') {\n return 'visibility';\n } else if (isDay(currIcon)) {\n return 'weather';\n }\n for (var i = 0, length = iconStrs.length; i < length; i++) {\n if (iconStrs[i] === currIcon) {\n return currIcon;\n }\n }\n return 'weather';\n }", "title": "" }, { "docid": "05b11f49f1c4563d8a74acf2be895f04", "score": "0.45512304", "text": "function searchPlaces(searchBox) {\n hideMarkers(markers);\n var places = searchBox.getPlaces();\n\n //For each place, get icon, name and location\n if(places.length === 0) {\n window.alert('We did not find any places matching that search');\n } else {\n showMarkers(places);\n }\n }", "title": "" }, { "docid": "2e1fdff2d24f3a3142eced5e30bb550e", "score": "0.4548968", "text": "function getImageSources() {\n var ids = [\n '0001', '0002', '0003', '0004', '0005', '0006', '0007',\n '0008', '0009', '0010', '0011', '0012', '0013', '0014'\n ];\n return ids.map(function(name){\n return 'http://localhost:8000/images/' + name + '.JPG';\n })\n}", "title": "" }, { "docid": "74be6a401043156447aed79e6783787e", "score": "0.4540676", "text": "elementsOfType(types) {\n return _.chain(this.getTableEntries())\n .filter(e => {\n var elemType = getElemFieldVal(e, FIELD_TYPE);\n return _.includes(types, elemType);\n })\n .map(e => {\n return getElemFieldVal(e, FIELD_NAME);\n })\n .value();\n }", "title": "" }, { "docid": "3062954df0e4c4496805d55567e1a224", "score": "0.45402962", "text": "function initMap(){\r\n\tdefaultIcon = makeMarkerIcon('0091ff');\r\n\thighlightedIcon = makeMarkerIcon('FFFF24');\r\n\t\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 13,\r\n center: {lat: 17.385044, lng: 78.486671}\r\n });\r\n\r\n infowindow = new google.maps.InfoWindow({\r\n maxWidth: 150,\r\n content: \"\"\r\n\t});\r\n\r\n\t// Close infowindow when clicked elsewhere on the map\r\n\tmap.addListener(\"click\", function(){\r\n infowindow.close(infowindow);\r\n\t});\r\n \r\n bounds = new google.maps.LatLngBounds();\r\n\r\n for(var i=0; i<placesData.length; i++){\r\n addMarker(placesData[i]);\r\n bounds.extend(placesData[i].location);\r\n }\r\n map.fitBounds(bounds);\r\n\t\r\n\t// This function takes in a COLOR, and then creates a new marker\r\n\t// icon of that color. The icon will be 21 px wide by 34 high, have an origin\r\n\t// of 0, 0 and be anchored at 10, 34).\r\n\tfunction makeMarkerIcon(markerColor) {\r\n\t\tvar markerImage = new google.maps.MarkerImage(\r\n\t\t'http://chart.googleapis.com/chart?chst=d_map_spin&chld=1.15|0|'+ markerColor +\r\n\t\t'|40|_|%E2%80%A2',\r\n\t\tnew google.maps.Size(21, 34),\r\n\t\tnew google.maps.Point(0, 0),\r\n\t\tnew google.maps.Point(10, 34),\r\n\t\tnew google.maps.Size(21,34));\r\n\t\treturn markerImage;\r\n\t}\r\n}", "title": "" }, { "docid": "87d0cd1e3eaf1761f76e4ba4324c3185", "score": "0.4537442", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-12\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-12-7e945a1e.woff') format('woff')\"\n },\n icons: {\n 'FinancialSolid': '\\uF346',\n 'FinancialMirroredSolid': '\\uF347',\n 'HeadsetSolid': '\\uF348',\n 'PermissionsSolid': '\\uF349',\n 'ParkingSolid': '\\uF34A',\n 'ParkingMirroredSolid': '\\uF34B',\n 'DiamondSolid': '\\uF34C',\n 'AsteriskSolid': '\\uF34D',\n 'OfflineStorageSolid': '\\uF34E',\n 'BankSolid': '\\uF34F',\n 'DecisionSolid': '\\uF350',\n 'Parachute': '\\uF351',\n 'ParachuteSolid': '\\uF352',\n 'FiltersSolid': '\\uF353',\n 'ColorSolid': '\\uF354',\n 'ReviewSolid': '\\uF355',\n 'ReviewRequestSolid': '\\uF356',\n 'ReviewRequestMirroredSolid': '\\uF357',\n 'ReviewResponseSolid': '\\uF358',\n 'FeedbackRequestSolid': '\\uF359',\n 'FeedbackRequestMirroredSolid': '\\uF35A',\n 'FeedbackResponseSolid': '\\uF35B',\n 'WorkItemBar': '\\uF35C',\n 'WorkItemBarSolid': '\\uF35D',\n 'Separator': '\\uF35E',\n 'NavigateExternalInline': '\\uF35F',\n 'PlanView': '\\uF360',\n 'TimelineMatrixView': '\\uF361',\n 'EngineeringGroup': '\\uF362',\n 'ProjectCollection': '\\uF363',\n 'CaretBottomRightCenter8': '\\uF364',\n 'CaretBottomLeftCenter8': '\\uF365',\n 'CaretTopRightCenter8': '\\uF366',\n 'CaretTopLeftCenter8': '\\uF367',\n 'DonutChart': '\\uF368',\n 'ChevronUnfold10': '\\uF369',\n 'ChevronFold10': '\\uF36A',\n 'DoubleChevronDown8': '\\uF36B',\n 'DoubleChevronUp8': '\\uF36C',\n 'DoubleChevronLeft8': '\\uF36D',\n 'DoubleChevronRight8': '\\uF36E',\n 'ChevronDownEnd6': '\\uF36F',\n 'ChevronUpEnd6': '\\uF370',\n 'ChevronLeftEnd6': '\\uF371',\n 'ChevronRightEnd6': '\\uF372',\n 'ContextMenu': '\\uF37C',\n 'AzureAPIManagement': '\\uF37F',\n 'AzureServiceEndpoint': '\\uF380',\n 'VSTSLogo': '\\uF381',\n 'VSTSAltLogo1': '\\uF382',\n 'VSTSAltLogo2': '\\uF383',\n 'FileTypeSolution': '\\uF387',\n 'WordLogoInverse16': '\\uF390',\n 'WordLogo16': '\\uF391',\n 'WordLogoFill16': '\\uF392',\n 'PowerPointLogoInverse16': '\\uF393',\n 'PowerPointLogo16': '\\uF394',\n 'PowerPointLogoFill16': '\\uF395',\n 'ExcelLogoInverse16': '\\uF396',\n 'ExcelLogo16': '\\uF397',\n 'ExcelLogoFill16': '\\uF398',\n 'OneNoteLogoInverse16': '\\uF399',\n 'OneNoteLogo16': '\\uF39A',\n 'OneNoteLogoFill16': '\\uF39B',\n 'OutlookLogoInverse16': '\\uF39C',\n 'OutlookLogo16': '\\uF39D',\n 'OutlookLogoFill16': '\\uF39E',\n 'PublisherLogoInverse16': '\\uF39F',\n 'PublisherLogo16': '\\uF3A0',\n 'PublisherLogoFill16': '\\uF3A1',\n 'VisioLogoInverse16': '\\uF3A2',\n 'VisioLogo16': '\\uF3A3',\n 'VisioLogoFill16': '\\uF3A4',\n 'TestBeaker': '\\uF3A5',\n 'TestBeakerSolid': '\\uF3A6',\n 'TestExploreSolid': '\\uF3A7',\n 'TestAutoSolid': '\\uF3A8',\n 'TestUserSolid': '\\uF3A9',\n 'TestImpactSolid': '\\uF3AA',\n 'TestPlan': '\\uF3AB',\n 'TestStep': '\\uF3AC',\n 'TestParameter': '\\uF3AD',\n 'TestSuite': '\\uF3AE',\n 'TestCase': '\\uF3AF',\n 'Sprint': '\\uF3B0',\n 'SignOut': '\\uF3B1',\n 'TriggerApproval': '\\uF3B2',\n 'Rocket': '\\uF3B3',\n 'AzureKeyVault': '\\uF3B4',\n 'Onboarding': '\\uF3BA',\n 'Transition': '\\uF3BC',\n 'LikeSolid': '\\uF3BF',\n 'DislikeSolid': '\\uF3C0',\n 'CRMCustomerInsightsApp': '\\uF3C8',\n 'EditCreate': '\\uF3C9',\n 'PlayReverseResume': '\\uF3E4',\n 'PlayReverse': '\\uF3E5',\n 'SearchData': '\\uF3F1',\n 'UnSetColor': '\\uF3F9',\n 'DeclineCall': '\\uF405'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" }, { "docid": "87d0cd1e3eaf1761f76e4ba4324c3185", "score": "0.4537442", "text": "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-12\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-12-7e945a1e.woff') format('woff')\"\n },\n icons: {\n 'FinancialSolid': '\\uF346',\n 'FinancialMirroredSolid': '\\uF347',\n 'HeadsetSolid': '\\uF348',\n 'PermissionsSolid': '\\uF349',\n 'ParkingSolid': '\\uF34A',\n 'ParkingMirroredSolid': '\\uF34B',\n 'DiamondSolid': '\\uF34C',\n 'AsteriskSolid': '\\uF34D',\n 'OfflineStorageSolid': '\\uF34E',\n 'BankSolid': '\\uF34F',\n 'DecisionSolid': '\\uF350',\n 'Parachute': '\\uF351',\n 'ParachuteSolid': '\\uF352',\n 'FiltersSolid': '\\uF353',\n 'ColorSolid': '\\uF354',\n 'ReviewSolid': '\\uF355',\n 'ReviewRequestSolid': '\\uF356',\n 'ReviewRequestMirroredSolid': '\\uF357',\n 'ReviewResponseSolid': '\\uF358',\n 'FeedbackRequestSolid': '\\uF359',\n 'FeedbackRequestMirroredSolid': '\\uF35A',\n 'FeedbackResponseSolid': '\\uF35B',\n 'WorkItemBar': '\\uF35C',\n 'WorkItemBarSolid': '\\uF35D',\n 'Separator': '\\uF35E',\n 'NavigateExternalInline': '\\uF35F',\n 'PlanView': '\\uF360',\n 'TimelineMatrixView': '\\uF361',\n 'EngineeringGroup': '\\uF362',\n 'ProjectCollection': '\\uF363',\n 'CaretBottomRightCenter8': '\\uF364',\n 'CaretBottomLeftCenter8': '\\uF365',\n 'CaretTopRightCenter8': '\\uF366',\n 'CaretTopLeftCenter8': '\\uF367',\n 'DonutChart': '\\uF368',\n 'ChevronUnfold10': '\\uF369',\n 'ChevronFold10': '\\uF36A',\n 'DoubleChevronDown8': '\\uF36B',\n 'DoubleChevronUp8': '\\uF36C',\n 'DoubleChevronLeft8': '\\uF36D',\n 'DoubleChevronRight8': '\\uF36E',\n 'ChevronDownEnd6': '\\uF36F',\n 'ChevronUpEnd6': '\\uF370',\n 'ChevronLeftEnd6': '\\uF371',\n 'ChevronRightEnd6': '\\uF372',\n 'ContextMenu': '\\uF37C',\n 'AzureAPIManagement': '\\uF37F',\n 'AzureServiceEndpoint': '\\uF380',\n 'VSTSLogo': '\\uF381',\n 'VSTSAltLogo1': '\\uF382',\n 'VSTSAltLogo2': '\\uF383',\n 'FileTypeSolution': '\\uF387',\n 'WordLogoInverse16': '\\uF390',\n 'WordLogo16': '\\uF391',\n 'WordLogoFill16': '\\uF392',\n 'PowerPointLogoInverse16': '\\uF393',\n 'PowerPointLogo16': '\\uF394',\n 'PowerPointLogoFill16': '\\uF395',\n 'ExcelLogoInverse16': '\\uF396',\n 'ExcelLogo16': '\\uF397',\n 'ExcelLogoFill16': '\\uF398',\n 'OneNoteLogoInverse16': '\\uF399',\n 'OneNoteLogo16': '\\uF39A',\n 'OneNoteLogoFill16': '\\uF39B',\n 'OutlookLogoInverse16': '\\uF39C',\n 'OutlookLogo16': '\\uF39D',\n 'OutlookLogoFill16': '\\uF39E',\n 'PublisherLogoInverse16': '\\uF39F',\n 'PublisherLogo16': '\\uF3A0',\n 'PublisherLogoFill16': '\\uF3A1',\n 'VisioLogoInverse16': '\\uF3A2',\n 'VisioLogo16': '\\uF3A3',\n 'VisioLogoFill16': '\\uF3A4',\n 'TestBeaker': '\\uF3A5',\n 'TestBeakerSolid': '\\uF3A6',\n 'TestExploreSolid': '\\uF3A7',\n 'TestAutoSolid': '\\uF3A8',\n 'TestUserSolid': '\\uF3A9',\n 'TestImpactSolid': '\\uF3AA',\n 'TestPlan': '\\uF3AB',\n 'TestStep': '\\uF3AC',\n 'TestParameter': '\\uF3AD',\n 'TestSuite': '\\uF3AE',\n 'TestCase': '\\uF3AF',\n 'Sprint': '\\uF3B0',\n 'SignOut': '\\uF3B1',\n 'TriggerApproval': '\\uF3B2',\n 'Rocket': '\\uF3B3',\n 'AzureKeyVault': '\\uF3B4',\n 'Onboarding': '\\uF3BA',\n 'Transition': '\\uF3BC',\n 'LikeSolid': '\\uF3BF',\n 'DislikeSolid': '\\uF3C0',\n 'CRMCustomerInsightsApp': '\\uF3C8',\n 'EditCreate': '\\uF3C9',\n 'PlayReverseResume': '\\uF3E4',\n 'PlayReverse': '\\uF3E5',\n 'SearchData': '\\uF3F1',\n 'UnSetColor': '\\uF3F9',\n 'DeclineCall': '\\uF405'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "title": "" } ]
3684f59794476e8fe891f19ce7f1dfb4
Activate completed Todos ====================
[ { "docid": "f5f21e686befc7b198683ea9b6de9cc6", "score": "0.61727047", "text": "function activateTodo(e) {\n let liText = '';\n if(e.target.classList.contains('btn-check-completed') || e.target.classList.contains('fa-check-completed')) {\n if(e.target.classList.contains('btn-check-completed')) {\n liText = e.target.nextElementSibling.textContent;\n e.target.parentElement.parentElement.remove();\n } else if(e.target.classList.contains('fa-check-completed')) {\n liText = e.target.parentElement.nextElementSibling.textContent;\n e.target.parentElement.parentElement.parentElement.remove();\n }\n \n let btnCheckClasses = 'btn btn-check btn-check-active';\n let iconCheckWithClasses = '<i class=\"fas fa-check fa-check-active\"></i>';\n let textSpanClasses = 'text';\n addTodo(liText, activeTodosList, btnCheckClasses, iconCheckWithClasses, textSpanClasses);\n } \n}", "title": "" } ]
[ { "docid": "522d86e4063795d454606fda421fcc1a", "score": "0.67793715", "text": "function getActiveTodos() {\n setItemsLeftToComplete(todos.filter(todo => todo.completed === false).length)\n }", "title": "" }, { "docid": "5ee3a880d7e33d57ee1cec3afb0ee735", "score": "0.62598515", "text": "goToToday() {\n this.start = moment();\n this.onStartChanged(this.start);\n }", "title": "" }, { "docid": "d3f6a9b1aa9e177426c41f0a9e21a6fe", "score": "0.61357665", "text": "goToToday() {\n this.start = moment$1();\n this.onStartChanged(this.start);\n }", "title": "" }, { "docid": "f839de9ebbaf4db6c861fdf631d82514", "score": "0.6101532", "text": "toggleWork(id) {\n var todo = this.todos[id];\n todo.active = !todo.active;\n if (todo.active) {\n todo.activities.unshift(new DB.Activity({\n start: new Date()\n }));\n } else {\n todo.activities[0].end = new Date();\n }\n TodoService.save(todo);\n this.render();\n }", "title": "" }, { "docid": "2056135b8e5b007d33cd3adac8c15feb", "score": "0.6084364", "text": "completeAll() {\n this.todoList.forEach(item => {\n item.completed = true;\n item.date = new Date().toDateString();\n });\n console.log(this.todoList);\n }", "title": "" }, { "docid": "23e5001899e0469987906de17f182bd7", "score": "0.5999955", "text": "function completedDueDateShortcut() {\n if(!task.due && task.completed) {\n task.due = task.completed;\n }\n }", "title": "" }, { "docid": "0880ca015b37a57a27def9e042e2e74a", "score": "0.599466", "text": "onClearCompletedTodos() {\n const oTodoModel = this.getView().getModel('todo')\n const aTodoItems = oTodoModel.getProperty('/items')\n\n // remove deleted item from todo list\n const aNewTodoItems = aTodoItems.filter(\n oItem => oItem.isCompleted === false\n )\n\n // update todo model\n oTodoModel.setProperty('/items', aNewTodoItems)\n\n this.updateCountHistory()\n }", "title": "" }, { "docid": "67aa4d5f93c72f2bcc4d5a926f432176", "score": "0.59803516", "text": "function toggleAll(){\n\t\t\tvar completedTodos = 0;\n\n\t\t\tfor(var i=0;i<todos.length;i++){\n\t\t\t\tif(todos[i].completed === true){\n\t\t\t\t\tcompletedTodos++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(completedTodos === todos.length){\n\t\t\t\tfor(var i=0;i<todos.length;i++){\n\t\t\t\t\ttodos[i].completed = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor(var i=0;i<todos.length;i++){\n\t\t\t\t\ttodos[i].completed = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdisplayTodos();\n\t\t}", "title": "" }, { "docid": "daf2cc0058f56f35c3dbfe42e37186b4", "score": "0.5937044", "text": "function completeTask(index){\n todo[index].completed = true; // mengubah kondisi completed pada array objek todo menjadi true agar tercoret pada tampilan\n storage('todo', todo, true); // menyimpan data pada local storage dengan fungsi storage\n show(); // menampilkan ulang data\n}", "title": "" }, { "docid": "bfaca85648435af2a06c3a016feaac21", "score": "0.58704036", "text": "addTaskActiveClick() {\n let array_size = this.tasks.length;\n for (let i = 0; i < array_size; i++) {\n if (!this.tasks[i].isComplete) {\n this.loadToDoList3();\n // alert(this.tasks[i].task);\n\n\n }\n }\n }", "title": "" }, { "docid": "fba62255d256dac30bfd9c4f38b15632", "score": "0.57828605", "text": "checkTodoStatus(index) {\n this.tasks[index].isComplete = !this.tasks[index].isComplete;\n this.loadToDoList();\n }", "title": "" }, { "docid": "8bb2884e5eab6ac94dcfc4ac61f7a3bd", "score": "0.57505614", "text": "function toggleToDo(e) {\n let task = e.target.nextElementSibling.innerHTML\n toDos.forEach(toDo => {\n if(task == toDo.item) {\n toDo.completed = !toDo.completed\n }\n })\n updateLocalStorage(toDos)\n}", "title": "" }, { "docid": "d8b8dcfb68c73466a418235127ca6a87", "score": "0.571417", "text": "function toggleTodo(todo) {\n if (todo.isCompleted) {\n todo.isCompleted = false;\n } else {\n todo.isCompleted = true;\n }\n }", "title": "" }, { "docid": "29dd47c6ec402f833742279e0e422f70", "score": "0.5707503", "text": "toggleTodo(todo) {\n\t\t\taxios({\n\t\t\t\tmethod: 'post',\n\t\t\t\turl: '/todo/complete/' + todo.id,\n\t\t\t\tdata: {\n\t\t\t\t\tcompleted: todo.completed\n\t\t\t\t}\n\t\t\t})\n\t\t\t\t.then((response) => {})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "184180a8698f8e51acf606250ad840ed", "score": "0.5707447", "text": "function GetToday(){\n\t$.get(task_url, function(data){\n\t\tif(data.entries.length!=null){\n\t\t\tvar items=data.entries;\n\t\t\tfor (var i=0; i<items.length; i++){\n\t\t\t\tvar tags=items[i].tags;\n\t\t\t\tif(tags!=[]){\n\t\t\t\t\tfor (var t=0; t<tags.length; t++){\n\t\t\t\t\t\tif(tags[t]=='didit'){\n\t\t\t\t\t\t\t//console.log(items[i].title)\n\t\t\t\t\t\t\tif(items[i].completed!=null&&\n\t\t\t\t\t\t\t\titems[i].trashed==null){\n\t\t\t\t\t\t\t\t\tvar completed_date = items[i].completed.split(' ')[0];\n\t\t\t\t\t\t\t\t\t//console.log(completed_date)\n\t\t\t\t\t\t\t\t\tif(completed_date==today){\n\t\t\t\t\t\t\t\t\t\t$('#todayul').append('<li class=\"task_main\" name=\"today_list\" id=\"'+items[i].id+'\">'+items[i].title+'<img name=\"delete\" class=\"right action\" id=\"'+items[i].id+'\" src=\"/images/delete.png\" /></li>');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tDelTasks();\n\t\t}\n\t\tif ($('li[name*=\"_list\"]:visible').length==0){\n\t\t\t$('#todayul').append('<p class=\"center\">No achievements for today</p>');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "4bbfee3118f25669359ef088bf23c680", "score": "0.5693756", "text": "clearCompleted() {\n let completed = this.get('todos').filterBy('complete', true);\n completed.forEach((todo) => {\n this.sendAction('deleteTodo', todo);\n });\n }", "title": "" }, { "docid": "df8560bfeaf2cd6a88b369c5cec60f5b", "score": "0.567714", "text": "function todaysTodos (user) {\n let today = new Date(dateToday);\n myTodos = [];\n \n for (let i = 0; i < todos.length; i = i + 1) {\n let dueDate = new Date(todos[i].due);\n \n if (\n todos[i].user === user &&\n todos[i].done === false &&\n dueDate.toDateString() === today.toDateString()\n ) {\n myTodos.push(todos[i]);\n }\n }\n \n displayList(myTodos, user);\n}", "title": "" }, { "docid": "2876524c4d4bd2f2729336fa848e3983", "score": "0.56576353", "text": "function toggleTodoComplete(todoList, todoArray, index){\n todoArray[index].isComplete = !todoArray[index].isComplete;\n saveTodosToStorage(todoArray);\n clearTodoList(todoList);\n populateTodoList(todoList, todoArray);\n}", "title": "" }, { "docid": "fd084573a1bf290ca0a7c90f3d0648e1", "score": "0.56481487", "text": "function markAsDone() {\n props.markTodosAsDone(selectedItems);\n props.handleSelectedTodos([]);\n setChecked(false);\n }", "title": "" }, { "docid": "9549f203d1de0486bfe9ca5b5acdc851", "score": "0.5647205", "text": "updateTodaysDate() {\n const currentView = this.currentView;\n let view;\n if (currentView === 'month') {\n view = this.monthView;\n }\n else if (currentView === 'year') {\n view = this.yearView;\n }\n else {\n view = this.multiYearView;\n }\n view._init();\n }", "title": "" }, { "docid": "9549f203d1de0486bfe9ca5b5acdc851", "score": "0.5647205", "text": "updateTodaysDate() {\n const currentView = this.currentView;\n let view;\n if (currentView === 'month') {\n view = this.monthView;\n }\n else if (currentView === 'year') {\n view = this.yearView;\n }\n else {\n view = this.multiYearView;\n }\n view._init();\n }", "title": "" }, { "docid": "9549f203d1de0486bfe9ca5b5acdc851", "score": "0.5647205", "text": "updateTodaysDate() {\n const currentView = this.currentView;\n let view;\n if (currentView === 'month') {\n view = this.monthView;\n }\n else if (currentView === 'year') {\n view = this.yearView;\n }\n else {\n view = this.multiYearView;\n }\n view._init();\n }", "title": "" }, { "docid": "b6f731c0c828fc47f51f06d5b749fc2e", "score": "0.56459934", "text": "completeAll () {\n this.items.forEach(todo => {\n todo.completed = true\n })\n }", "title": "" }, { "docid": "456852efe3b33fff070cc0d58453da42", "score": "0.56271297", "text": "function showTodos(){\n\ttodo_list_all.innerHTML = \"\";\n\ttodo_list_queued.innerHTML = \"\";\n\ttodo_list_done.innerHTML = \"\";\n\tfor(var i = 0; i < Todos.length; i++) {\t\n\t\ttodo_list_all.appendChild(createTodo(Todos[i]));\n\t\tif(Todos[i].Status == \"queued\"){\n\t\t\ttodo_list_queued.appendChild(createTodo(Todos[i]));\n\t\t\t\n\t\t}\n\t\telse if(Todos[i].Status == \"done\"){\n\t\t\ttodo_list_done.appendChild(createTodo(Todos[i]));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "429fa5f466258173ea981e7692aea8c0", "score": "0.55876106", "text": "function showAllTodos() {\n let todos = JSON.parse(localStorage.getItem(\"todos\")) || null;\n if (todos !== null) {\n todos.forEach((item) => {\n const { outerDiv, todoId } = Todo(\n item.task,\n item.id,\n todos,\n item.completed\n );\n allTodos.appendChild(outerDiv);\n });\n }\n showTodayDate();\n}", "title": "" }, { "docid": "bf01d2aa582f2738b5c56c4ee3cccc90", "score": "0.5576831", "text": "toggleTodoStatus(e) {\n\t\t_todoService.toggleTodoStatus(e)\n\t\t_drawTodos()\n\t\tcompleteLine()\n\t}", "title": "" }, { "docid": "9aec44939a36d533f4ac2195d5d92d3b", "score": "0.5568261", "text": "function displayTodos() {\n console.log(`My ToDos: ${toDos}`);\n }", "title": "" }, { "docid": "c0740af69918b3c228b349454508ad00", "score": "0.55613846", "text": "function markComplete(index) {\n todos[index][1] = true;\n}", "title": "" }, { "docid": "31781ade733729655ca9e94d23ff3d6b", "score": "0.551792", "text": "function doneShortcut() {\n \n if(!task.completed) {\n return;\n }\n var matches = /\\:done\\b/.exec(task.title);\n if(!matches) {\n return;\n }\n \n // Remove the shortcut from the title\n task.title = task.title.replace(matches[0], \"\");\n \n // Set today as the due date.\n // task.due = Helper.dateStringfromDate(new Date());\n \n // Get the time estimate for the task\n var timeEstimate = Helper.parseTimeEstimateString(task.notes);\n if(!timeEstimate) {\n return;\n }\n \n // Check if there is a calendar event for this task already\n var eventId = PROPS[task.id];\n if(eventId) {\n // Delete the old event before we create a new one.\n var eventSeries = DEFAULT_CALENDAR.getEventSeriesById(eventId);\n eventSeries.deleteEventSeries();\n PROPS[task.id] = null;\n }\n \n // Create calendar event to record the completed task\n var opts = {};\n opts.endTime = Helper.dateFromDateString(task.completed);\n opts.startTime = new Date(opts.endTime.getTime() - timeEstimate.min*MILLISECONDS_PER_MINUTE); \n createCalendarEvent(task, timeEstimate.min, opts);\n \n }", "title": "" }, { "docid": "4b77f8f150361e4455e6953a8397ed04", "score": "0.5496867", "text": "function todoComplete(){\n todoArray.forEach((current)=>{\n current.addEventListener('click',function (){\n current.classList.toggle('todo-complete');\n })\n })\n}", "title": "" }, { "docid": "127531cb45fb9b6bbf81388d480d4306", "score": "0.54674184", "text": "toggleStatus(index){\n this.tasks[index].isComplete = !this.tasks[index].isComplete;\n //and then also add the update to the local storage\n localStorage.setItem(\"Tasks\",JSON.stringify(this.tasks));\n }", "title": "" }, { "docid": "3ab7a387f01c6932bffe1d9fb95c2110", "score": "0.54637474", "text": "toggleComplete(index) {\n const todos = this.state.todos.slice();\n const todo = todos[index];\n todo.isCompleted = todo.isCompleted ? false : true;\n this.setState({ todos: todos });\n }", "title": "" }, { "docid": "0ba1057405ba2eaae8de8377cbacff84", "score": "0.5462605", "text": "static displayTodo() {\n const todos = Store_list.getTodos();\n todos.forEach((element) => {\n UI.addTodoList(element.text, element.id, element.completed);\n });\n }", "title": "" }, { "docid": "2a2697fab3d4e97fc703692c6cf3599b", "score": "0.5459616", "text": "function loadTodos() {\n const loadPending = localStorage.getItem(PENDING_LS);\n const loadFinished = localStorage.getItem(FIN_LS);\n\n if (loadPending !== null) {\n const parsedPending = JSON.parse(loadPending);\n for (let i = 0; i < parsedPending.length; i++) {\n createPending(parsedPending[i].content);\n }\n }\n\n if (loadFinished !== null) {\n const parsedFinished = JSON.parse(loadFinished);\n for (let i = 0; i < parsedFinished.length; i++) {\n createFinished(parsedFinished[i].content);\n }\n }\n}", "title": "" }, { "docid": "db914afb944eb7b7b20b12cbac6c119c", "score": "0.5454434", "text": "completeTodoListItems() {\n completeTodoListItems();\n }", "title": "" }, { "docid": "73e01491f4880603273f30716d51ca01", "score": "0.54521114", "text": "static completeTodo(element) {\n const CHECK = \"fa-check-circle\";\n const UNCHECK = \"fa-circle-o\";\n element.classList.toggle(CHECK);\n element.classList.toggle(UNCHECK);\n element.parentNode.querySelector(\".text\").classList.toggle(\"checkedLine\");\n\n //update the storage\n const curId = element.attributes.id.value;\n const todos = Store_list.getTodos();\n todos.forEach((todo, index) => {\n if (+todo.id === +curId) {\n todos[index].completed = todos[index].completed ? false : true;\n }\n });\n localStorage.setItem(\"TodoList\", JSON.stringify(todos));\n }", "title": "" }, { "docid": "8e6dd455cb8d3fa82a1e405d09866ff4", "score": "0.5448985", "text": "function selectedTodo(event) {\n if (event.target.id === \"completed-task\") {\n completeTodo(event);\n } else if (event.target.id === \"delete-task\") {\n const todos = deleteTodo(event);\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n } else {\n return;\n }\n}", "title": "" }, { "docid": "2ecdb1f26484277424ead849ae3b0707", "score": "0.5445572", "text": "function completeToDo(event) {\n const ELEMENT = event.target;\n ELEMENT.classList.toggle(SOLID_ICON);\n ELEMENT.classList.toggle(REGULAR_ICON);\n ELEMENT.classList.toggle(CHECK);\n ELEMENT.classList.toggle(UNCHECK);\n ELEMENT.parentNode.querySelector(\".text\").classList.toggle(LINE_THROUGH);\n if (list[ELEMENT.id].done == false) {\n list[ELEMENT.id].done = true;\n } else if (list[ELEMENT.id].done == true) {\n list[ELEMENT.id].done = false;\n }\n localStorage.setItem(\"TODO\", JSON.stringify(list));\n}", "title": "" }, { "docid": "8749737db6e051799ba5da30e3d54099", "score": "0.54280406", "text": "function markComplete(e) {\n var id = e.target.parentElement.id;\n task_array = task_array.map(x => {\n if (x.title === id) x.status = \"completed\";\n return x;\n })\n create_list();\n}", "title": "" }, { "docid": "85e3675f66128c9158b5c72748f1d3b6", "score": "0.54271066", "text": "function completeToDo(toDoItem) {\r\n toDoItem.classList.toggle(checkBtn);\r\n toDoItem.classList.toggle(uncheckBtn);\r\n toDoItem.parentNode.querySelector(\".text\").classList.toggle(textLineThrough);\r\n toDoContainer[toDoItem.id].done = toDoContainer[toDoItem.id].done ? false : true;\r\n}", "title": "" }, { "docid": "99819336f1c22008f4c7796cc973788d", "score": "0.5423122", "text": "onAddTodo () {\n TodoService.create()\n .then(() => {\n const selected = TodoService.getSelected();\n\n if (selected && selected.data && selected.data.id) {\n this.context.router.transitionTo(`/todos/${selected.data.id}`);\n }\n });\n this.refreshState();\n }", "title": "" }, { "docid": "a1b30b0d200775756711cef894fe3dda", "score": "0.54169035", "text": "function activateHistorical() {\n \t//$('#historicalTab').css('pointer-events', '');\n \t$('#historicalTab .status').text('active');\n \t$('#historicalTab .status').addClass('label-success');\n }", "title": "" }, { "docid": "b1ab93e44eb3ee63a0f5a29f36ea1962", "score": "0.541643", "text": "function deleteAllCompletedTodos() {\n // Write your code here...\n}", "title": "" }, { "docid": "b1ab93e44eb3ee63a0f5a29f36ea1962", "score": "0.541643", "text": "function deleteAllCompletedTodos() {\n // Write your code here...\n}", "title": "" }, { "docid": "3ab935db41d28d11f7fe8078c2c6f3ed", "score": "0.5412527", "text": "function toggleTodoCompleted(id) {\n const updateTodos = todos.map(todo => {\n if (id === todo.id) {\n return {\n ...todo, completed: !todo.completed\n }\n }\n return todo;\n });\n setTodos(updateTodos);\n console.log(todos[0])\n }", "title": "" }, { "docid": "bd5b5ee6f348f666556c5b3f12295e3f", "score": "0.54119253", "text": "function clearTodos(){\r\n const newTodos = Todos.filter(todo => !todo.complete ) ;\r\n setTodos(newTodos);\r\n }", "title": "" }, { "docid": "b9cb0aa904211dd738b556f907042b28", "score": "0.53980833", "text": "function activateDepartmentWfReviews(){\n\tvar tsiArray = [];\n\tloadThisTaskTsi(tsiArray);\n\tif(isTaskActive(\"Application Submittal\")){\n\t\tupdateTask(\"Application Submittal\",\"Approved\",\"Documents Received\",\"Updated via Script\");\n\t\tsetTask(\"Application Submittal\",\"N\",\"Y\");\n\t}else if(isTaskActive(\"Intake / Distribution\")){\n\t\tupdateTask(\"Intake / Distribution\",\"Accepted\",\"Documents Received\",\"Updated via Script\");\n\t\tsetTask(\"Intake / Distribution\",\"N\",\"Y\");\n\t}\n\tfor(x in tsiArray){\n\t\tif(matches(tsiArray[x],\"CHECKED\")){\n\t\t\tvar wfTaskName = x + \" Review\"\n\t\t\tactivateTask(wfTaskName);\n\t\t\tlogDebug(\" ^^^\" + x + \" Review was activated for document: \" + wfNote)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b753ba5671e34eb0b950a73982b86ae0", "score": "0.5397258", "text": "function getTodos() {\n\t\t//FYI DONT EDIT ME :)\n\t\t// debugger\n\t\ttodoService.getTodos(draw)\n\t}", "title": "" }, { "docid": "0c426098b63eae7d293dfb928cc6e26d", "score": "0.53950036", "text": "setTasks (state, { tasks, today }) {\n state.tasks = {}\n state.taskOrder = []\n\n tasks.forEach(task => {\n Vue.set(state.tasks, task.id, task)\n })\n // we need to iterate over the tasks a second time to ensure that the index\n // is fully populated\n tasks.forEach(task => {\n state.taskOrder.splice(\n insertIndex(state.taskOrder, task, state.tasks, today),\n 0,\n task.id\n )\n })\n\n state.ready = true\n }", "title": "" }, { "docid": "5e8c7603b6bb9d53518774d97ffecd51", "score": "0.53881764", "text": "function toggleTodos(id){\r\n const newTodos = [...Todos] ; \r\n const todo = newTodos.find(todo => todo.id === id);\r\n todo.complete = !todo.complete; //changed true to false and vice-versa\r\n setTodos(newTodos) ;\r\n }", "title": "" }, { "docid": "75a937fe1ddab07581226c881b4d3e0f", "score": "0.5381536", "text": "function markAllComplete() {\n for(i = 0; i < ctrl.tasks.length; i++){\n ctrl.tasks[i].done = ctrl.all_complete ? false : true;\n//toggle mark/reset button\n ctrl.tasks[i].mark_button = ctrl.all_complete ? false : true;\n };\n ctrl.all_complete = !ctrl.all_complete;\n\n//bootstrap alert message appears or disappears\n ctrl.alert_button = !ctrl.alert_button;\n\n//helper function which 'orders by completion'\n ctrl.extra();\n }", "title": "" }, { "docid": "cddb3d2819678690b81a9a547f843840", "score": "0.5381241", "text": "handleToggleAllComplete() {\n //TODO add prompt to ask if user is sure\n const {allComplete, todoItems, activeFilter} = this.state\n const complete = !allComplete\n const newItems = clone(todoItems).map((item) => ({...item, complete}))\n this.setSource(newItems, filterItems(activeFilter, newItems), {allComplete: complete})\n }", "title": "" }, { "docid": "01f4f99d133771ef7731da82e9bd33d2", "score": "0.53761655", "text": "function showTodos() {\n db.allDocs({include_docs: true, descending: true}, function(err, doc) {\n redrawTodosUI(doc.rows);\n });\n }", "title": "" }, { "docid": "aa854c52f74e3e60f632d91dc7ff9d31", "score": "0.5361267", "text": "function activate() {\n getChecklist();\n }", "title": "" }, { "docid": "0e448e20a5bde5a068dda63352a9ae4e", "score": "0.5360487", "text": "function createNewTodo(currentTodo) {\n if (todos != null) {\n let todosArray = [...todos];\n //pushes new objects with boolean var isCompleted\n todosArray.push({\n todo: currentTodo,\n isCompleted: false\n });\n const todosArrayData = JSON.stringify(todosArray);\n localStorage.setItem('todoList', todosArrayData);\n\n //update todos array by setTodos\n setTodos(todosArray);\n } else {\n let firstTodo = [{\n todo: currentTodo,\n isCompleted: false\n }];\n setTodos(firstTodo);\n localStorage.setItem('todoList', JSON.stringify(firstTodo));\n }\n }", "title": "" }, { "docid": "af88a0e17fed4c7d9151ff7a7b9aa24a", "score": "0.5358927", "text": "function splitTodos(){\n \n pendingTodos = allTodos.filter(function(todo) {\n \n// Todo is not complete and current date is not past due date \n return (todo.isComplete === false) && (isCurrent(todo) === true); \n\n })\n// Todo is complete \n completedTodos = allTodos.filter(function(todo) {\n \n return todo.isComplete;\n })\n//Todo is not complete and current date is past the due date\n expiredTodos = allTodos.filter(function(todo){\n \n return (todo.isComplete === false) && (isCurrent(todo) === false)\n\n })\n}", "title": "" }, { "docid": "e52497725bddd0e1ffaa6ddef3be1dec", "score": "0.535751", "text": "get upcomingTodos() {\n // in retuen we said , if its no empty and it has some lenth , then use filter to retuen all not done tasks\n return this.todos && this.todos.length\n ? this.todos.filter((todo) => !todo.done) // return only not done items from todo object\n : []; // else retuen blank\n // now we have to go to foreach in html and put that list upcomingTasks instead of todos\n }", "title": "" }, { "docid": "78b7aa1631475a829d4e8be1d0266304", "score": "0.5350643", "text": "function makeAppointment()\n{\n\taddFavorite(getCurrentAllTags());\n\tcreateAppointment();\n}", "title": "" }, { "docid": "dabce3c56a53fc58fc8a761a6b4b1585", "score": "0.5338985", "text": "function renderTodos(todos) {\n // console.log('in renderTodos',todos);\n $('#todoList').empty();\n for (let todo of todos) {\n let $tr = $(`<tr data-id=${todo.id}></td>`)\n //keep checked if true \n if (todo.complete === true) {\n //change tr bg color if complete\n $tr = $(`<tr class=\"markComplete\" data-id=${todo.id}></td>`)\n $tr.append(`<td class=\"text-center\" data-complete=${todo.complete}><input type=\"checkbox\" name=\"completeStatus\" id=\"completeStatus\" checked=\"checked\" ></td>`);\n } else {\n $tr.append(`<td class=\"text-center\" data-complete=${todo.complete}><input type=\"checkbox\" name=\"completeStatus\" id=\"completeStatus\"></td>`);\n };\n $tr.append(`<td class=\"text-start\">${todo.name}</td>`);\n $tr.append(`<td class=\"text-center\"><button class=\"btn btn-dark deleteBtn\">DELETE</button></td>`);\n $('#todoList').append($tr);\n }\n}", "title": "" }, { "docid": "3acc3d34ec9f3620aaeedc42c9c25d16", "score": "0.5337548", "text": "function completeAndDeleteToDo(e) {\r\n const item = e.target;\r\n //Delete To Do\r\n if (item.classList[0] === \"delete-button\") {\r\n const deleteToDo = item.parentElement;\r\n deleteToDo.classList.add(\"delete-animate\");\r\n deleteSaveTodo(deleteToDo);\r\n deleteToDo.addEventListener(\"transitionend\", function () {\r\n deleteToDo.remove();\r\n });\r\n } //Complete To Do\r\n else if (item.classList[0] === \"completed-button\") {\r\n const completedToDo = item.parentElement;\r\n completedToDo.classList.toggle(\"completed-to-do\");\r\n\r\n saveCompletedToDo(completedToDo);\r\n }\r\n}", "title": "" }, { "docid": "2d82717739394884524a219f0ed34b7b", "score": "0.53276116", "text": "function getTodos() {\n\t\t//FYI DONT EDIT ME :)\n\t\ttodoService.getTodos(draw)\n\t}", "title": "" }, { "docid": "2d82717739394884524a219f0ed34b7b", "score": "0.53276116", "text": "function getTodos() {\n\t\t//FYI DONT EDIT ME :)\n\t\ttodoService.getTodos(draw)\n\t}", "title": "" }, { "docid": "8e3b8e3b0a8a1f010ebe83c3b9760a62", "score": "0.5326036", "text": "function markTodo (index) {\n const newTodos = [...todos];\n newTodos[index].isDone = true;\n setTodos(newTodos);\n }", "title": "" }, { "docid": "1e97120bbcaf4fb4d166a25c8f973d50", "score": "0.53244174", "text": "function getActiveList() {\n let url = \"http://localhost:8080/items/\" + props.activeList;\n fetch(url)\n .then(result => result.json())\n .then(result => {\n setCurrentToDo(result)\n })\n }", "title": "" }, { "docid": "bdb57b3f8e34e6dd048c42134d6064b5", "score": "0.5316766", "text": "function activar(tbody, table){\n\t\t$(tbody).on(\"click\", \"span.activar\", function(){\n var data=table.row($(this).parents(\"tr\")).data();\n statusConfirmacion('Proyectos/status_proyecto', data.id_proyecto, 1, \"¿Esta seguro de activar el registro?\", 'activar');\n });\n\t}", "title": "" }, { "docid": "0af0c68d4b0077e36beb359f94b70be3", "score": "0.5314378", "text": "function activate() {\n getJob($stateParams.jobId);\n getCurrentUser();\n }", "title": "" }, { "docid": "782f2a11b855d5ab815be6103576578b", "score": "0.53143007", "text": "function completeToDo(element){\n element.classList.toggle(CHECK);\n element.classList.toggle(UNCHECK);\n element.parentNode.querySelector(\".text\").classList.toggle(LINE_THROUGH);\n element.parentNode.querySelector(\".trash\").classList.toggle(SHADOWED_TRASH);\n \n\n LIST[element.id].done = LIST[element.id].done ? false : true;\n}", "title": "" }, { "docid": "6b473d054d17608ed253f25faa9372f8", "score": "0.53124696", "text": "uncompleteAll () {\n this.items.forEach(todo => {\n todo.completed = false\n })\n }", "title": "" }, { "docid": "89816fc55490eb1d940cbcfc3d467b08", "score": "0.5304878", "text": "function thisActiveListTasksEdit() {\n function listActivityCheck(list) {\n return list.activeList === true;\n }\n const currentActiveList = DataModule.tasksList.find(listActivityCheck);\n const { taskNumber } = DOM.backBtn.dataset;\n return thisTaskEdit(currentActiveList, taskNumber);\n }", "title": "" }, { "docid": "09c7cc0ee66c2a2547f4dec1dae61d61", "score": "0.5304465", "text": "function isCurrent(todo) {\n\n const todoDueDate = new Date(todo.dueDate);\n const now = new Date();\n\n return now < todoDueDate;\n\n}", "title": "" }, { "docid": "37432c7637f7290be71c3af33012fec5", "score": "0.5300098", "text": "function getTodos() {\n\t\ttodoService.getTodos(drawTodos)\n\t}", "title": "" }, { "docid": "2057671b73bae09b11440a9012700525", "score": "0.52924794", "text": "function delete_all_completed_todos() {\n for(var id in _todos) {\n if(_todos[id].complete) {\n destroy_single_todo(id);\n }\n }\n}", "title": "" }, { "docid": "92694eb54a133499fc39326cfa22085f", "score": "0.5289534", "text": "markComplete(){\n\n var _this = this;\n\n if(this.get('attendedUsers.length') + this.get('dnaUsers.length') !== this.get('model.availabilityUsers.length')){\n alert(\"Please mark who attended and who did not.\");\n return false;\n }\n if(!confirm(\"Mark this session as complete? You won't be able to edit it, but can request feedback from your students.\")){\n return false;\n }\n this.get('attendedUsers').forEach(function(x){\n x.set('aasmState', 'attended');\n x.save();\n });\n this.get('dnaUsers').forEach(function(x){\n x.set('aasmState', 'dna');\n x.save();\n });\n\n // Create feedback requests, if the feedback module is enabled\n if(config.APP.enabledModules.includes('Feedbacks')){\n this.get('feedbackUsers').forEach(function(x){\n _this.store.createRecord('feedback-request', {\n availability: _this.get('model'),\n user: _this.get('session.currentUser'),\n target: x.get('user')\n }).save();\n })\n }\n\n // Create a logbook entry, if module enabled and the user chooses to\n // We have a space for a 'reflection' here but it is not yet implemented - may be tagged to the LogbookEntry model\n if(config.APP.enabledModules.includes('Feedbacks')){\n if(this.get('createLogbookEntry')){\n this.store.createRecord('logbook-entry', {\n target: this.get('model'),\n availability: this.get('model'),\n user: this.get('session.currentUser'),\n entryType: 'taught',\n date: this.get('model.startTime')\n }).save();\n\n // var r = this.get('logbookReflection');\n // if(r && r !== \"\"){\n // this.get('model').set('completedNotes', r);\n // this.get('model').save();\n // }\n }\n }\n\n this.get('model').set('aasmState', 'completed');\n this.get('model').save();\n this.transitionToRoute('app.main.availabilities/show', this.get('model'));\n }", "title": "" }, { "docid": "4dfb867f61490654fc4bf7e6fed3271d", "score": "0.52702373", "text": "function getTodos(e) {\n\tTitanium.API.info(\"You clicked the getTodos tab\");\n\t\n\tvar promise = Kinvey.DataStore.find('todo', null);\n\tpromise.then(function(entities) {\n\t\tTitanium.API.info(entities);\n\n\t\t// alter todolist with entities\n\t\t//\n\t\tvar items = _.map(entities, function(element) {\n\t\t\treturn {\n\t\t\t\tproperties : {\n\t\t\t\t\tdata : element\n\t\t\t\t},\n\t\t\t\tmyaction : {\n\t\t\t\t\ttext : element.action\n\t\t\t\t},\n\t\t\t\tmyduedate : {\n\t\t\t\t\ttext : element.duedate\n\t\t\t\t},\n\t\t\t\tmycompleted : {\n\t\t\t\t\ttext : 'completed: ' + element.completed\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\n\t\t$.TodoListSection.setItems(items);\n\n\t}, function(error) {\n\t\tTitanium.API.info('error fetching products');\n\t});\n}", "title": "" }, { "docid": "f02daa046d7f4267b9d6b32555924d5f", "score": "0.5268773", "text": "function addAllTodos(arr) {\n $('.task-list-area').html('');\n _.each(getToDos(), function (el, idx) {\n el.idx = idx;\n addToDoToDom(el, templates.toDoTmpl, $('.task-list-area'));\n });\n}", "title": "" }, { "docid": "6dcc270c610bb88f2915e8e3c6959bf1", "score": "0.52641314", "text": "function assignActiveList() {\n\tassignTasksToList(tasks.active, activeList, appendToActiveList);\n\thideClearBtns();\n}", "title": "" }, { "docid": "8bd13d0c6f7dc2c8bfb5cf2de044a6a4", "score": "0.5263297", "text": "function setActiveDate (e) {\n document.getElementById(state.get('day')).classList.remove('active')\n const target = e.target;\n\n if (target) {\n if (!moment(target.id)._isValid) return false;\n target.classList.add('active');\n state.set('day', target.id);\n }\n else if (/\\d{4}-\\d{2}-\\d{2}/.test(e) && moment(e)._isValid) {\n document.getElementById(e).classList.add('active');\n state.set('day', e);\n }\n else throw new Error(`the string \"${e}\" is not a valid date`)\n\n // update any views that rely on the active date\n if (view) [...view].forEach( item => item.innerHTML = printActiveDay() );\n // update any input fields that rely on the active date\n if (data) [...data].forEach( item => item.value = state.get('day') );\n\n showCurrentEvents();\n }", "title": "" }, { "docid": "dc6ac04a60ebfe8bc7335d962d230531", "score": "0.5241359", "text": "function markAsNotDone() {\n props.markTodosAsNotDone(selectedItems);\n props.handleSelectedTodos([]);\n setChecked(false);\n }", "title": "" }, { "docid": "03728fe65c59ae7c0dbe18263cbd6a20", "score": "0.52309823", "text": "function setTodayDate() {\n setDates();\n todayDate = currYear + \"-\" + currMonth + \"-\" + currDay;\n}", "title": "" }, { "docid": "b240fc916a15f74543100e366b3d2069", "score": "0.52301234", "text": "didInsertElement() {\n let todos = this.get('todos');\n if (todos.get('length') > 0 && todos.isEvery('complete', true)) {\n this.set('allAreDone', true);\n } else {\n this.set('allAreDone', false);\n }\n }", "title": "" }, { "docid": "746211721e4f05dae11d734199c9014e", "score": "0.5223858", "text": "function todoCheckAll() {\n\t var mdis = document.querySelectorAll(\".todo-single-item .mdi\");\n\t mdis.forEach(function (fa) {\n\t fa.addEventListener(\"click\", function (e) {\n\t e.stopPropagation();\n\t e.target.parentElement.classList.toggle(\"finished\");\n\t });\n\t });\n\t }", "title": "" }, { "docid": "e9677c32f6ec98c0a89e6149a2f2d445", "score": "0.5210073", "text": "function onTasksChange() {\n\n setTitle(\n persistance.active_section.name,\n persistance.active_section.color,\n )\n\n view_tasks = []\n persistance.tasks.forEach((task) => {\n if (task.section != persistance.active_section.id) {\n return\n }\n view_tasks.push(task)\n })\n\n view_tasks.sort((a, b) => {\n if (a.done > b.done) return 1\n if (a.done < b.done) return -1\n\n if (a.order > b.order) return 1\n if (a.order < b.order) return -1\n return 0\n })\n\n // The virtual tile view is moved down to not overlap with the header\n // so in order to compensate bottom scroll we add a footer\n task_list.length = view_tasks.length + 1;\n persistanceSave()\n}", "title": "" }, { "docid": "fe5eab471607efa8c81123c8fc9c6884", "score": "0.5209126", "text": "function showComplete(){\n $.each(todoitems, function(n, elem){\n if ((elem.complete == true)){\n //alert(elem.complete);\n $(\"#todo-list\").append(\"<li class='checked'><big>\" + elem.descriptor + \"</big>\");\n if (elem.subtaskID != 0){ //show what the subtask's main ID is if it is a subtask\n $(\"#todo-list\").append(\" (Subtask \" + elem.subtaskID + \" of Task ID \" + elem.todoID + \"), \");\n }\n else{\n $(\"#todo-list\").append(\" (Task ID \" + elem.todoID + \"), \");\n }\n $(\"#todo-list\").append(\"Due Date: \" + elem.due_date + \"</li>\");\n count = count+1;\n };\n });\n}", "title": "" }, { "docid": "b2191cb4fa1dbff7a036f987b2626d2c", "score": "0.52066875", "text": "toggleComplete(item) {\n ToDos.update(item._id, {$set : {complete: !item.complete}})\n }", "title": "" }, { "docid": "88198400d92dd1db47b4e73fa94267b5", "score": "0.5205827", "text": "toggleTaskStatus(index){\n //switch the isComplete property\n this.tasks[index].isComplete = !this.tasks[index].isComplete;\n this.loadTasks();\n }", "title": "" }, { "docid": "769b4bc13d9e070b71044ab1fd2c1429", "score": "0.51978177", "text": "createTask(task) {\n // this.setState({ todos: this.state.tasksVar });\n\n console.log(tasksVar);\n const newId = new Date().getTime().toString();\n tasksVar.unshift({\n task,\n isCompleted: false,\n id: newId,\n });\n this.setState({todos: tasksVar,selectionActive: false });\n this.handleComingBackAfterChangeState(this.state.todos);\n }", "title": "" }, { "docid": "5a66a3081f75bc77b7d6d26c91a082a9", "score": "0.5195933", "text": "clearCompleted() {\n this.todoList.forEach(item => {\n item.completed = false;\n item.date = null;\n });\n console.log(this.todoList);\n }", "title": "" }, { "docid": "92915777d9295f2136f38de4926e0eef", "score": "0.5195758", "text": "[TOGGLE_COMPLETED] (state, payload) {\n const task = state.tasks.find(item => item.id === payload.id);\n task.completed = ! task.completed;\n }", "title": "" }, { "docid": "cdfac87413094a74fc02c4cc016c7bad", "score": "0.5194257", "text": "function completeToDo(element) {\n\telement.classList.toggle(CHECK)\n\telement.classList.toggle(UNCHECK)\n\telement.parentNode.querySelector('.text').classList.toggle(LINE_THROUGH)\n\n\tList[element.id].done = List[element.id].done ? false:true //Update the array done value if a todo is complete\n}", "title": "" }, { "docid": "790f749011f51a4b2acb2349477b2837", "score": "0.5183735", "text": "function makeTaskActive(id) {\n // Update firebase first!\n tasksRef.child(id).transaction((item) => {\n item.timeStarted = Date.now();\n item.status = statuses.active;\n return item;\n });\n}", "title": "" }, { "docid": "b7e3a09d239ecd98f404a18c4d79ec58", "score": "0.5183618", "text": "function create() {\n var todo = { description: self.newTodo };\n todo.status = 'active';\n localApi\n .post(url, todo)\n .then(function (data) {\n self.activeTodos.push(data);\n self.newTodo = \"\";\n });\n }", "title": "" }, { "docid": "d58435f0cfb0bde930ce71e9d58d7f80", "score": "0.5182476", "text": "function toggleStatus(index){\n\t\tvar item = taskList[index];\n\t\titem[\"isDone\"] = !item[\"isDone\"];\t\t\n\t\ttaskList[index] = item;\n\t\t\n\t\tlocalStorage.setItem(\"MyTaskList\", JSON.stringify(taskList));\t\t\n\t\tgetTaskList(false);\n\t}", "title": "" }, { "docid": "06ccd03bd9eb72e01f358a695bd5d2a5", "score": "0.517197", "text": "function showCompleted() {\n console.log('in showCompleted');\n $('.task_completed_container').click(function() {\n $('.task_list').toggleClass('shown_task_details');\n })\n }", "title": "" }, { "docid": "2da825550de74100f62e705e71da711c", "score": "0.5170981", "text": "function applyPastDue(){\n console.log('in past due');\n for(var i=0; i<todo_objects.data.length; i++){\n console.log('todo_objects.data: ', todo_objects.data);\n if(todo_objects.data[i].timeStamp > timeStamp()){\n todo_objects.data[i].pastDue=true;\n } else if(todo_objects.data[i].timeStamp < timeStamp()){\n todo_objects.data[i].pastDue=false;\n }\n }\n}", "title": "" }, { "docid": "c3d1d308173f592aee4c329ddac7e9eb", "score": "0.51695526", "text": "DisplayTasks(date){\n var count=0;\n if (typeof(Storage) !== \"undefined\") {\n if (localStorage.todo) {\n let ltasks = JSON.parse(localStorage.getItem(\"todo\"));\n todo_tasks=ltasks.slice();\n if(todo_tasks.length != 0){\n $('.table tbody').find(\"tr:gt(0)\").remove();\n for(let i=0;i<todo_tasks.length;i++){\n if(todo_tasks[i].date == date){\n count+=1\n $(document).ready(function () {\n let addprevtask_obj = new TimeTracker();\n addprevtask_obj.PrintInTable(todo_tasks[i].input, todo_tasks[i].category, todo_tasks[i].time);\n });\n }\n }\n \n if(count==0){\n this.toggleElements('table');\n }\n else\n {\n this.toggleElements('table'); \n localStorage.setItem(\"todo\", JSON.stringify(todo_tasks));\n let ltasks = JSON.parse(localStorage.getItem(\"todo\"));\n todo_tasks=ltasks.slice();\n }\n }\n }\n}\n}", "title": "" }, { "docid": "e6d79805f50974926aec35f68ed7e65e", "score": "0.51628417", "text": "function clearAllCompleted(e) {\n FlatTodo.Todo.clearAllCompleted();\n }", "title": "" }, { "docid": "bc53d4645d88776c0f2b46af46d245a1", "score": "0.5160923", "text": "completeTask(listId, taskId) {\n $(\".list-group-item[data-listid=\" + listId + \"][data-taskId=\" + taskId + \"]\").find('.task-date').text(this.getCurrentDate());\n }", "title": "" }, { "docid": "8057d6ce384e2e28aaf70b21b971e3f5", "score": "0.5159487", "text": "function recomplete(){\n let list = ls.getTodoList();\n for(let i = 0; i < list.length; i++){\n if(list[i].completed == true){\n utilities.completeItem(list[i].id + \"Content\");\n let btn = document.getElementById(list[i].id);\n btn.setAttribute('value', 'X');\n }\n }\n}", "title": "" }, { "docid": "c9e9c79969caf353e35a63fb9bbe8cee", "score": "0.5156898", "text": "function taskDone() {\n\t\t//task unone\n\t\t$('i.fas.fa-check-circle').click( function() {\n\t\t\tlet parent = $(this).parent();\n\t\t\tparent.removeClass('light');\n\t\t\tparent.children('.fas.fa-check-circle').hide();\n\t\t\tparent.children('.far.fa-check-circle').show();\n\t\t});\n\t\t//task done\n\t\t$('i.far.fa-check-circle').click( function() {\n\t\t\tlet parent = $(this).parent();\n\t\t\tparent.addClass('light');\n\t\t\tparent.children('.fas.fa-check-circle').show();\n\t\t\tparent.children('.far.fa-check-circle').hide();\n\t\t})\n\t}", "title": "" }, { "docid": "3baf48b603282354494a84b633ff03ec", "score": "0.51568615", "text": "listTaskComplete( complete = true ) {\n \n console.log();\n let index = 0;\n \n this.listArr.forEach( task => {\n\n const { desc, completeAt } = task;\n const state = ( completeAt )\n ? 'Completada'.green\n : 'Pendiente'.red;\n \n if( complete ) {\n // Mostrar completadas\n if( completeAt ) {\n index += 1;\n const idx = `${ index }.`.green;\n console.log(`${ (index + '.').green } ${ desc } :: ${ completeAt.green }`);\n }\n }\n else{\n // Mostrar pendientes\n if( !completeAt ) {\n index += 1;\n console.log(`${ (index + '.').green } ${ desc } :: ${ state }`);\n }\n }\n });\n }", "title": "" } ]
48c97b12a3c2858cac2efbb6cd5a7b03
Check if news article has already been shown
[ { "docid": "f16cb2d46454c8c24e76aae9a9ae1a60", "score": "0.60935444", "text": "async NewsArticleExists(game, title){\n let sql = \"SELECT COUNT(*) as count FROM NewsBot.newsitems WHERE game = ? && title = ?\";\n let args = [game,title];\n\n let result = await this.query(sql, args);\n return result[0].count > 0;\n }", "title": "" } ]
[ { "docid": "069d5f7275c0129004141237bb71cae4", "score": "0.6480172", "text": "hasAlreadyVisisted(url) {\n return this.viewedUrls[url];\n }", "title": "" }, { "docid": "ffd219c91b43a792101e656e86b83f90", "score": "0.62153023", "text": "function noArticles(){\n if (totalArticles > 0) {\n $('.no-articles').hide();\n } else {\n $('.no-articles').show();\n }\n }", "title": "" }, { "docid": "4c18b618e8d9b6eaa9ae7969b1c00ec5", "score": "0.61932516", "text": "function checkFrontPage(){\n request('https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty', \n function(err, res, body){\n if(err) {\n throw err;\n } else {\n var posInTop = JSON.parse(body).indexOf(articleID);\n responder(posInTop > -1 && posInTop < 30);\n }\n }\n );\n}", "title": "" }, { "docid": "7a1e7ad6bdb399eb137387779fc04075", "score": "0.59962314", "text": "function shouldFetchNewsStory(state, newsId) {\n const {status, story} = state.news;\n if (!story) {\n return true;\n } else if (status.isFetching) {\n return false;\n } else if (story.id != newsId) {\n return true;\n } else {\n return status.didInvalidate;\n }\n}", "title": "" }, { "docid": "777a43c332dd8fb59d77c153c4a78d8f", "score": "0.5929739", "text": "function checkAlreadyShown() {\r\n var scoreLinkerSpan = document.getElementById('score_main');\r\n if (scoreLinkerSpan != null ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n return false\r\n}", "title": "" }, { "docid": "777a43c332dd8fb59d77c153c4a78d8f", "score": "0.5929739", "text": "function checkAlreadyShown() {\r\n var scoreLinkerSpan = document.getElementById('score_main');\r\n if (scoreLinkerSpan != null ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n return false\r\n}", "title": "" }, { "docid": "fcec68bff82feed8c6640872ea7b11fc", "score": "0.5826641", "text": "function check_if_item_is_seen( item_url ) {\n\n\t/* Action */\n\n\tjQuery(document).trigger('check_if_item_is_seen');\n\n\t/* Callbacks */\n\n\tvar on_success = function ( context ) {\n\t\tvar item_request = context.event;\n\t\tif (typeof item_request.result != 'undefined') {\n\t\t\tjQuery(\"#\" + item_url.replace(/[^a-zA-Z0-9-_]+/g, \"\")).addClass('seen');\n\t\t} else {\n\t\t\tjQuery(\"#\" + item_url.replace(/[^a-zA-Z0-9-_]+/g, \"\")).addClass('unseen');\n\t\t}\n\t};\n\n\tvar on_error = function ( e ) {\n\t\n\t};\n\n\t/* Request */\n\n\tInDB.trigger( 'InDB_do_row_get', { 'store': 'seen', 'key': item_url, 'on_success': on_success, 'on_error': on_error } );\n\n}", "title": "" }, { "docid": "5dd27b910d48c431edefb29ac28099f7", "score": "0.58210444", "text": "function showArticle() {\n let i;\n if (currentArticle > listArt.length) {\n currentArticle = 1\n }\n if (currentArticle < 1) {\n currentArticle = listArt.length\n }\n for (i = 0; i < listArt.length; i++) {\n listArt[i].style.display = \"none\";\n }\n listArt[currentArticle - 1].style.display = \"block\";\n }", "title": "" }, { "docid": "8c08d268dee35dc9a35c03c78f016d2c", "score": "0.5706551", "text": "_duplicateArticle() {\n if (this.state.unsavedChanges) {\n api.ui.showMessageDialog(\n [{\n type: 'warning',\n message: this.getLabel('Article contains unsaved changes. Continue without saving?')\n }],\n () => {\n this._createDuplicate()\n }\n )\n return\n }\n\n this._createDuplicate()\n }", "title": "" }, { "docid": "f9f19c052d4079cae0bbbcf6ba72e9fe", "score": "0.5698147", "text": "isCurrentArticle(article){\n return this.currentArticle &&\n this.currentArticle.id === article.id;\n }", "title": "" }, { "docid": "23c00c964910beb184b35ce58f4a9909", "score": "0.56901747", "text": "function checkRemaining() {\n var numTweetsPublished = $(\"#tweetContainer > li\").length;\n var numTweetsUnpublished = tweets.length;\n var remaining = (numTweetsUnpublished - numTweetsPublished);\n if (remaining <= 0) {\n $(\"#more-tweets\").hide();\n }\n }", "title": "" }, { "docid": "822acd63db19e1f766c177fe13eba0a9", "score": "0.5600217", "text": "function shouldFetchNewsStories(year, month, state) {\n const {news, status} = state.news;\n if (!news) {\n return true;\n } else if (status.isFetching) {\n return false;\n } else if (year != status.year || month != status.month) {\n // TODO: Not the most intelligent test. We may already have the data and I'm not caching well elsewhere\n return true;\n } else {\n return status.didInvalidate;\n }\n}", "title": "" }, { "docid": "0f9197839672c080ae6f691c45bc4086", "score": "0.5567531", "text": "function setCurrentArticle() {\n var articleStored = JSON.parse(localStorage.getItem(\"articleClicked\"));\n var promise = NewsArticleService.findArticleByTitle(articleStored.article.title);\n promise.success(function (response) {\n if(response !== null){\n console.log(\"existing article\");\n vm.article = response.article;\n vm.comments = response.comments;\n vm.existingArticleFlag = true;\n }\n else\n vm.article = articleStored.article;\n })\n }", "title": "" }, { "docid": "8d9b15cbd1fbd222ad9aa43e2e8c2da6", "score": "0.5557566", "text": "function isAValidNews(news){\n if(news.text){ return true; }\n else{ return false; }\n}", "title": "" }, { "docid": "f16603061e536f6d170cf9f121d470a4", "score": "0.55434227", "text": "function resetNews() {\n clearPreviousNews();\n getAviationNews();\n\n // set the global variable to false after the aviation news has been fetched\n newNews = false;\n }", "title": "" }, { "docid": "d8d993e344c46596be96dff6ae99921d", "score": "0.5522586", "text": "renderNotVisibleAlert() {\n if(!this.state.newsObj.is_visible) {\n return(\n <div className=\"alert alert-info\">This news is not public. <Link to={`/news/compose?edit_id=${this.state.newsObj.id}`}>You can change it here.</Link></div>\n )\n } else {\n return(null);\n }\n }", "title": "" }, { "docid": "443f7e89054218e276c96081c7e30089", "score": "0.5501634", "text": "function getNewNews(e) {\n e.preventDefault();\n const searchInput = document.querySelector('.search-term');\n let searchValue = searchInput.value;\n\n // account for user not entering a search term\n if (!searchValue) {\n alert('Please enter a search term');\n return;\n }\n\n clearPreviousNews();\n getNews(searchValue);\n\n searchInput.value = '';\n\n // set the global variable to true, so we can make a new fetch request with the new search term\n newNews = true;\n }", "title": "" }, { "docid": "10d0c6c1bbb9d21073320bf8c2c225d7", "score": "0.54672134", "text": "function afficherPub(){\r\n\ttry {\r\n\t\t// test si la pub a deja ete affiche\r\n\t\tlet retour=getCookie(\"isPubDisplayed\");\r\n\t\tif(retour != \"true\"){\r\n\t\t\t// si non\r\n\t\t\t// on affiche la pub et on set le cookie\r\n\t\t\tlet pub =document.querySelector(\"#pub\");\r\n\t\t\tpub.style.display='block';\r\n\t\t\tsetCookie(\"isPubDisplayed\", \"true\", 10);\r\n\t\t}\t\t\r\n\t} catch (e) {\r\n\t\tconsole.error(\"Erreur : \"+e.message);\r\n\t}\r\n}", "title": "" }, { "docid": "da20cd5cf31fe96cb924cc5874b449cd", "score": "0.54592323", "text": "hasAtleastOneVisibleLink(links, showMore) {\n return links?.length && (\n links.some(link => {\n return !link.isHidden;\n }) || !!showMore\n );\n }", "title": "" }, { "docid": "0c438c8230a0770d300833c3b73da214", "score": "0.5450525", "text": "function handleNewsFeed() {\n\t\tfor (var newsId in cachedNews) {\n\t\t\tif (cachedNews.hasOwnProperty(newsId) && dismissedNews.indexOf(newsId) === -1) {\n\t\t\t\t// TODO #43\n\t\t\t}\n\t\t}\n\t\t$('#chat_lines, .chat-messages').on('click', 'a[data-command=\"twitch-chat-emotes:dismiss-news\"]', function (evt) {\n\t\t\tevt.preventDefault();\n\t\t\tdismissedNews.push($(this).data('news-id'));\n\t\t\tsetSetting('twitch-chat-emotes:dismissed-news', JSON.stringify(dismissedNews));\n\t\t\t$(this).parent().parent().remove();\n\t\t});\n\t}", "title": "" }, { "docid": "bf3a6148313afd09d7e6c8e1f217434b", "score": "0.54278135", "text": "function checkForMore() {\n return EventListModel.postsWrapper.more;\n }", "title": "" }, { "docid": "8150c3dd892ff70af18db32230382a4f", "score": "0.5425707", "text": "function handleNewsFeed() {\n\t\t\tfor (var newsId in cachedNews) {\n\t\t\t\tif (cachedNews.hasOwnProperty(newsId) && dismissedNews.indexOf(newsId) === -1) {\n\t\t\t\t\t// TODO #43\n\t\t\t\t}\n\t\t\t}\n\t\t\t$('#chat_lines, .chat-messages').on('click', 'a[data-command=\"twitch-chat-emotes:dismiss-news\"]', function (evt) {\n\t\t\t\tevt.preventDefault();\n\t\t\t\tdismissedNews.push($(this).data('news-id'));\n\t\t\t\tsetSetting('twitch-chat-emotes:dismissed-news', JSON.stringify(dismissedNews));\n\t\t\t\t$(this).parent().parent().remove();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "118c2b9da06abdb906b5352ce7597f38", "score": "0.5412501", "text": "notificate () {\n return this.unread > 0\n }", "title": "" }, { "docid": "05c9002fbd850b2d7ecf6b46eedb1570", "score": "0.54055595", "text": "function loadNews(category) {\n\tclearArticles();\n\tfor(i = 0; i < articles.length; i++) {\n\t\tif(articles[i].category == category){\n\t\t\taddArticleToDom(articles[i]);\n\t\t\tloadedArticles++;\n\t\t}\n\t}\n\tif(loadedArticles == 0){\n\t\tdocument.getElementById(\"articleContainer\").innerHTML += \"\\n<h3>No articles found...</h3>\"\n\t} else {\n\t\tresizeArticleContent();\n\t}\n}", "title": "" }, { "docid": "3af91a1555ed83df907923219c124700", "score": "0.5401117", "text": "function checkForMore() {\n return NoticeListModel.postsWrapper.more;\n }", "title": "" }, { "docid": "53d56e89d581adfd729f3a790f558a74", "score": "0.5387936", "text": "function checkTimelineActivity() {\n\tif (userIsActive) unreadTimeline = false;\n}", "title": "" }, { "docid": "5428ecb8c95261597f1f7adee9b7ec96", "score": "0.5373606", "text": "activeArticle() {\n let top = Math.round(window.pageYOffset);\n\n // Only consider open articles\n let articles = this.openArticles();\n articles.reverse();\n return articles.find((a) => a.offsetTop <= top);\n }", "title": "" }, { "docid": "2a84af699edb7040c0e173ccda82473e", "score": "0.53469837", "text": "function load_next_post(){\n\tvar el = jQuery(this);\n\tvar this_url = el.attr('data-url');\n\tvar this_title = el.attr('data-title');\n\tvar check_next_post_id = el.attr('data-nextid');\n\n\tif ( !check_next_post_id ) return;\n\tif ( jQuery( \"article#post-\"+check_next_post_id ).length == 0) {\n\t doAutoLoad();\n\t}\n\telse{\n\t\tconsole.log('already loaded');\n\t}\n}", "title": "" }, { "docid": "33d4a60f7ef560b4b5422da87d348fe5", "score": "0.5344176", "text": "function isUniquePageView() {\n\t\t\treturn getCookie(pageUrl);\n\t\t}", "title": "" }, { "docid": "6281e901b02d1dbc60d2afb1767261af", "score": "0.5305392", "text": "get isDisplayLimitReached() {\n return (Cookies.get(`hint_${this.get(\"hint_id\")}_never_show_again`) == \"1\") || (this.get(\"display_limit\") != null && this.get(\"display_limit\") <= this.times_displayed);\n }", "title": "" }, { "docid": "714d354b0e085d30b37aae0c8661ca2a", "score": "0.53033173", "text": "function page_loaded_check() {\r\n\ttranscript_load = setInterval(function() {\r\n\t\tif (gcl(\"story\").length) {\r\n\t\t\tcss();\r\n\t\t\tdl_buttons();\r\n\t\t\tclearInterval(transcript_load);\r\n\t\t}\r\n\t}, 100);\r\n}", "title": "" }, { "docid": "0f5d7e961c4f2a24843c87b1c84736c2", "score": "0.52936995", "text": "function shownewspage(){\r\n //get news when page is loaded\r\n shownews();\r\n if (document.getElementById(\"news\").style.display = \"none\") {\r\n document.getElementById(\"home\").style.display = \"none\";\r\n document.getElementById(\"product\").style.display = \"none\";\r\n document.getElementById(\"map\").style.display = \"none\";\r\n document.getElementById(\"news\").style.display = \"block\";\r\n document.getElementById(\"guestbook\").style.display = \"none\";\r\n document.getElementById(\"nav1\").style.backgroundColor = \"brown\";\r\n document.getElementById(\"nav2\").style.backgroundColor = \"brown\";\r\n document.getElementById(\"nav3\").style.backgroundColor = \"brown\";\r\n document.getElementById(\"nav4\").style.backgroundColor = \"white\";\r\n document.getElementById(\"nav5\").style.backgroundColor = \"brown\";\r\n\r\n \r\n }\r\n}", "title": "" }, { "docid": "6492b1f2f4ea393fa13571475679a1eb", "score": "0.52554804", "text": "function updateShowedPostCount() {\n self.$post = $(self.postSelector);\n self.showedPost = self.$post.length;\n }", "title": "" }, { "docid": "8c0b890ce3b8f828f2894e2db6092910", "score": "0.5248526", "text": "isCurrentTitle(e){\n var lane = Lanes.findOne();\n if(lane){\n return (lane.title == this.props.title ? true : false);\n }\n }", "title": "" }, { "docid": "ded966411b0ab03c305298ef0740629e", "score": "0.5237559", "text": "function is_livestream() {\n return window.getComputedStyle(document.getElementsByClassName(\"ytp-live-badge\")[0]).display !== 'none';\n}", "title": "" }, { "docid": "92209172170d59237eb4c14b239fc03f", "score": "0.52338034", "text": "function amountNews() {\n\treturn news.length;\n}", "title": "" }, { "docid": "5bcb6a5393b5ecbd7ab1728f84cb4d4a", "score": "0.522969", "text": "function hasSeenResult(json, tid) {\n // Only decrease number if backend says 'seen' has changed\n if (json && json.marked) {\n document.getElementById('notif_' + tid).style.fontWeight = \"normal\"\n login.notifications--;\n setupUser(login)\n }\n}", "title": "" }, { "docid": "e759e3029bfd2489275936ee787c10f7", "score": "0.52289665", "text": "isOwnStory(story) {\n return this.ownStories.some(s => s.storyId === story.storyId);\n }", "title": "" }, { "docid": "fdb27e21d73e4be0f4710eaff1847a28", "score": "0.5204464", "text": "function readmoreFunction() {\n if(started == true) { \n document.getElementById('article2').style.display = \"inline-block\";\n document.getElementById('article3').style.display = \"inline-block\";\n document.getElementById('article4').style.display = \"inline-block\";\n document.getElementById('article5').style.display = \"inline-block\";\n started = false;\n document.getElementById('readmore-button').innerText = \"Read Less\";\n }\n else { \n document.getElementById('article2').style.display = \"none\";\n document.getElementById('article3').style.display = \"none\";\n document.getElementById('article4').style.display = \"none\";\n document.getElementById('article5').style.display = \"none\";\n started = true;\n }\n }", "title": "" }, { "docid": "e3c22ca88ffd702c27e60834696ed8ab", "score": "0.5201905", "text": "function isPostRead(postUrl) {\n return localStorage.getItem(postUrl) === \"1\";\n }", "title": "" }, { "docid": "d1ff473d561ba360317d4eda25843758", "score": "0.5201717", "text": "function newsletter() {\n // let modal = document.getElementById('newsletter');\n // if (Math.random() < 0.1) {\n // modal.style.display = \"block\";\n // }\n}", "title": "" }, { "docid": "a012dc3d3e96938d32bc174d56d9a33b", "score": "0.52004385", "text": "isFavorite(story) {\n return this.favorites.some(s => s.storyId === story.storyId);\n }", "title": "" }, { "docid": "e94d42cbc98114b23888ab2401f4ace6", "score": "0.5200332", "text": "function check_for_timeline() {\r\n\tvar suchstring = /(allactivity)/g; //REGEX for the URL\r\n\tvar suchergebnis = suchstring.test($(location).attr('href'));\r\n\tif (suchergebnis != false) {\r\n\t\tiamstillontimeline = true; //You are on the right Site!\r\n\t}\r\n\telse {\r\n\t\tif ((iamstillontimeline == true) && (start == true)) {\r\n\t\t\t// Ugh it seems the user change the side...\r\n\t\t\talert('Abort!');\r\n\t\t\tstart = false;\r\n\t\t}\r\n\t\tiamstillontimeline = false;\r\n\t\tinsert_button = false;\r\n\t}\r\n}", "title": "" }, { "docid": "de9d5a4199a81a315c966dce4398efa9", "score": "0.51990074", "text": "function topicExists(topic) {\n let exists = false;\n \n $(topics).each(function(key, value) {\n if(value.imdb == topic) {\n exists = true;\n return false;\n }\n });\n\n return exists;\n }", "title": "" }, { "docid": "13b0787275d4ea3ec9dd3fc08f911722", "score": "0.51925945", "text": "function checkMessageVisible() {\n // We defer check\n window.setTimeout(function() {\n var list = $('.tab-chat .list');\n list.children('.unseen').each(function() {\n var that = $(this);\n if (isMessageVisible(list, that)) {\n window.bufferSeen.add('message', that.attr('data-id'));\n that.removeClass('unseen');\n }\n });\n }, 0);\n }", "title": "" }, { "docid": "c34a870c04163aa9fbea219cc37a945e", "score": "0.5186621", "text": "function visible() {\r\n return (_current != null)\r\n }", "title": "" }, { "docid": "09a8ea2f52a7fb1104e577bf65be8e99", "score": "0.5183369", "text": "hasAccess(referrer, url) {\n return this.isSubscriber() ||\n this.hasAlreadyVisisted(url) ||\n this.isFirstClickFree(referrer) ||\n this.numViews < MAX_VIEWS;\n }", "title": "" }, { "docid": "f718fc8dbb09a4cba36bf8e3d46a2a3f", "score": "0.5174187", "text": "function hide_pane_library_list_on_news_only() {\n\t if ($(\".pane-ding-news-ding-news-list\").length > 0) {\n $( \".pane-library-list\" ).hide();\n }\t\n\t}", "title": "" }, { "docid": "91329ace6cf83ec7242f894606eff46a", "score": "0.5172002", "text": "hasSimpleContent()\n\t{\n\t\t\n\t}", "title": "" }, { "docid": "5971ce7bd02c002248e4a1cd9c9a8fcf", "score": "0.5162949", "text": "function updateShowedPostCount() {\n self.$post = $('.post');\n self.showedPost = self.$post.length;\n }", "title": "" }, { "docid": "97325fe635a865634b93ed57e7e88986", "score": "0.5159952", "text": "async function getLatestNews(forceShowNewsCard) {\n \n forceShowNewsCard = forceShowNewsCard || false;\n\n var latestNews = {};\n \n try {\n latestNews = (await axios.get(apiROOT + \"/api/news\")).data;\n } catch (e) {\n handleError(\"Couldn't fetch latest news\", e);\n }\n \n if (isEmpty(latestNews)) { return; }\n if (!latestNews.id) { return; }\n \n \n var newsID = latestNews.id;\n var newsURL = DOMPurify.sanitize(latestNews.url, { ALLOWED_TAGS: [] });\n // var newsTitle = DOMPurify.sanitize(latestNews.title, { ALLOWED_TAGS: [] });\n var newsExcerpt = DOMPurify.sanitize(latestNews.excerpt, { ALLOWED_TAGS: [] });\n \n $(\".newsButton\").attr(\"hash\", newsID); \n $(\"#news-card\").find(\"p\").text(newsExcerpt);\n $(\"#news-card\").find(\"a.more\").attr(\"href\", newsURL + \"#to-cryptee\");\n \n if (lastReadNews !== newsID || forceShowNewsCard) { showLatestNewsCard(); }\n\n}", "title": "" }, { "docid": "4bbc98f19a3ae9d6833781f8b936987a", "score": "0.5154699", "text": "_checkIfInView() {\n const offset = this.$().offset().top;\n const node = this.get('node');\n const bottom = node.height() + node.scrollTop();\n this.set('position', node.scrollTop());\n // Trigger loading action\n if (offset < bottom) {\n this.sendAction('loadMoreAction');\n }\n }", "title": "" }, { "docid": "9aeb6ee213e88b8633e3d4ec7c136533", "score": "0.5153892", "text": "function secondTimeHome() {\n\n if (!theUserPlan || theUserPlan === \"free\") { \n // show upgrade button for continued users\n $(\".actionButton[app='upgrade']\").show();\n $(\".actionButton[app='upgrade']\").addClass(\"willBeShown\"); \n }\n\n getLatestNews();\n\n}", "title": "" }, { "docid": "4b1ed4a46cc79f0e94137d1e3e7503aa", "score": "0.5148586", "text": "function hotelsArticleShow(){\r\n $('.hotelsArticle__button').click(function(e){\r\n e.preventDefault();\r\n var btn = $(this),\r\n currentBlock = btn.parent(),\r\n content = $(currentBlock).find('.hotelsArticle__content');\r\n\r\n if (content.hasClass('active')) {\r\n btn.text('Подробнее');\r\n } else {\r\n btn.text('Свернуть');\r\n }\r\n\r\n content.toggleClass('active');\r\n $(currentBlock).find('.hotelsArticle__blockOpacity').toggle(function() {\r\n btn.blur();\r\n });\r\n });\r\n }", "title": "" }, { "docid": "b04adc3c07053123c74497b27ab6472a", "score": "0.51476204", "text": "function isFavorite(story) {\n let favStoryIds = new Set();\n if (currentUser) {\n favStoryIds = new Set(currentUser.favorites.map(obj => obj.storyId));\n }\n return favStoryIds.has(story.storyId);\n }", "title": "" }, { "docid": "d356be6fce0f0abd2c1881ed6f8f030a", "score": "0.51370496", "text": "function isDuplicate(widgetForm,store){\n \t\t\tfor (var x in store) {\n \t\t\t\tif (store[x].title == widgetForm.title) {\n \t\t\treturn true;\n \t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn false;\n \t\t}", "title": "" }, { "docid": "12955d237aa7b54252cdfa1e6b386476", "score": "0.5130717", "text": "function isFavorite(story) {\n let favStoryIds = new Set();\n if (currentUser) {\n favStoryIds = new Set(currentUser.favorites.map(obj => obj.storyId));\n }\n return favStoryIds.has(story.storyId);\n }", "title": "" }, { "docid": "db23908c329221485f29329e5b2e75dc", "score": "0.51278096", "text": "function validate (test_news) {\n\treturn (test_news.secret == secret);\n}", "title": "" }, { "docid": "c298b8b3f3c1db07a0b6211ae8849717", "score": "0.5126043", "text": "function isFavorite(story) {\n let favStoryIds = new Set();\n if (currentUser) {\n favStoryIds = new Set(currentUser.favorites.map((obj) => obj.storyId));\n }\n return favStoryIds.has(story.storyId);\n }", "title": "" }, { "docid": "205775159864073f5c84797116706ba8", "score": "0.51193374", "text": "function checkUpdates()\n{\n\t$.get(\n\t\tdocument.location.toString().replace('/faq/', '/_lastFaq/'),\n\t\tfunction(data)\n\t\t{\n\t\t\tif(data > LastCheck)\n\t\t\t{\n\t\t\t\t$('#faq-nouveaux').show('slow');\n\t\t\t\tLastCheck = data + 1;\n\t\t\t}\n\t\t}\n\t);\n}", "title": "" }, { "docid": "181c4df19531e2a143b44269bd72e241", "score": "0.51121724", "text": "function showMyCreatedStories() {\n if (currentUser.myCreatedStories.length !== 0) {\n showStories(currentUser.myCreatedStories);\n } else {\n hideElements();\n $allStoriesList.empty().show();\n $allStoriesList.text(\"No user created stories\");\n }\n }", "title": "" }, { "docid": "ab4a31c8713cc3580a28f87aa5ac26da", "score": "0.5109647", "text": "_createDuplicate() {\n this.publishFlowMgr.setPubStatus('imext:draft')\n\n api.article.copy(pluginId)\n\n this.extendState({\n status: api.newsItem.getPubStatus(),\n hasPublishedVersion: api.newsItem.getHasPublishedVersion(),\n unsavedChanges: false,\n pubStart: api.newsItem.getPubStart(),\n pubStop: api.newsItem.getPubStop(),\n previousState: null\n })\n\n this.renderPopover()\n this.props.popover.close()\n }", "title": "" }, { "docid": "aab531f70735b0f0beddbb1022eac19b", "score": "0.51026183", "text": "function checkForNewItems(){\n // wait for throbber to hide \n if(jQuery(\".field-type-author-field\").find(\".ajax-progress-throbber\").length==0){\n \n /*After each new item is added, Drupal removes our existing events and formatting,\n so we need to add events again. */\n addEventsToTextBox();\n }else{\n setTimeout(checkForNewItems, 1000);\n }\n }", "title": "" }, { "docid": "d08c93c549a9129afdaaebc221081d20", "score": "0.50960404", "text": "function _previousArticle() {\n var previousArticle = App.Data.getPreviousArticle(params.item.title, params.feedName).then(function (previousArticle) {\n\n if (previousArticle) {\n _refreshPageWithNewArticle(previousArticle);\n }\n else {\n App.Data.getPreviousArticle(params.item.title, params.feedName).then(function (previousArticle) {\n if (previousArticle) {\n if (currentPge) {\n currentPge._removeEventListeners();\n }\n\n _refreshPageWithNewArticle(previousArticle);\n }\n else {\n App.Data.showTipMessage(\"Message\", \"This is the first article\");\n }\n });\n\n }\n });\n\n }", "title": "" }, { "docid": "56de86a34eaeed31028bfeadb332f8e8", "score": "0.5086892", "text": "newsfeed ({existingNewsfeed, nextStoryId}) {\n\t\t\treturn () => Story.getFragment(\n\t\t\t\t\"story\", {storyId: nextStoryId}\n\t\t\t).then((nextStory) => {\n\t\t\t\treturn existingNewsfeed.concat([nextStory]);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "440ac0e7fe3c53552e5516681a422998", "score": "0.508159", "text": "function checkPos() { //Checks the scroll and loads more stories if true\n\tif ($(window).scrollTop() + document.body.clientHeight + 400 >= $(window).height()) {\n\t\tif (loops > 0 && flag == 0) {flag = 1; callBack();}\n\t}\n}", "title": "" }, { "docid": "5fc99f7d489c2904cb789fc613e30144", "score": "0.5080062", "text": "function linkExists() {\n for (var i = 0; i < $scope.dumps.length; i++) {\n if ($scope.dumps[i].content == $scope.enteredLink) {\n\n //Show a toast\n Toasty.show(\"Link already exists!\")\n\n //Set the input back to empty\n $scope.enteredLink = \"\";\n\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "153367bf8b223777da0f8397417a2673", "score": "0.50708854", "text": "function extended() {\r\n return(document.getElementById(\"timeline\") == null);\r\n}", "title": "" }, { "docid": "f77bbe5fae27ee28ea9dc5faadf7002d", "score": "0.50639427", "text": "function myStoriesPlaceHolder () {\r\n if (\r\n $('#my-articles')\r\n .children()\r\n .html() === undefined\r\n ) {\r\n $('#my-articles').append(\r\n '<li id=\"mine-placeholder\">No articles submitted</li>'\r\n )\r\n } else {\r\n $('#mine-placeholder').remove()\r\n }\r\n }", "title": "" }, { "docid": "da2794151008f78eecd41e771bb746fb", "score": "0.506339", "text": "function checkTimelinePos() {\n\tif (!loadingNewPages && scrollApproachingBottom()) { //second circuit in ui.js\n\t\taddOlderPosts();\n\t\tloadingNewPages = true;\n\t}\n}", "title": "" }, { "docid": "37df96ed9b73ddf02483a7464a1faf8d", "score": "0.5062641", "text": "function plVisibleIsActive() {\n // then make visible playlist the active\n playlists.activeIdx = playlists.visibleIdx;\n // active playlist has been updated so connect it to visible player\n plUpdatePlayer();\n // and indicate that it's content is fresh and hasnt had songs added/deleted\n playlists.activeModified = false;\n}", "title": "" }, { "docid": "5f9d63ceb2cbad35fc5fba3307d1d545", "score": "0.5060431", "text": "_isMovieStored() {\n // compare id of movie on the view and ids in the storage\n const compareMovieWithStorage = model.state.movieStorage.filter(\n (movie) => movie.id === this._data.id\n );\n if (compareMovieWithStorage.length > 0) {\n console.log(\n \"movie already in the storage\",\n model.state.movieStorage.filter(\n (movie) => movie.id === this._data.id\n )[0]\n );\n return true;\n } else {\n console.log(\"movie is not in the storage\", this._data);\n\n return false;\n }\n }", "title": "" }, { "docid": "2515945e3926d7e99062efc98f5a3c14", "score": "0.50552803", "text": "function isPageShownCurrently(page) {\n return false;\n}", "title": "" }, { "docid": "65f047f1c93138bf401a9679076383e6", "score": "0.5050785", "text": "function isArticleValid() {\n var valid = true;\n\n //Title\n var $title = $(\"#title\");\n if($title.val().trim() == \"\") {\n titleInvalid(\"You must fill in a title\");\n valid = false;\n }\n\n //Main tag\n var $main_tag = $(\".title h1\");\n if($main_tag.text() == \"\") {\n tags.invalid($(\".first-tag\"), \"You must fill in a main tag\");\n valid = false;\n }\n\n //Message text\n var $main_text = $(\"#content\");\n if($main_text.text().trim() == \"\") {\n mainTextInvalid(\"You must write something before you can publish it.\");\n valid = false;\n }\n\n return valid;\n }", "title": "" }, { "docid": "9511e0d8c8b3d8e61b642416001a887e", "score": "0.50414264", "text": "function setIfTrackReposted() {\n if (RepostService.isReposted($scope.item.id)) {\n $scope.isReposted = true;\n }\n }", "title": "" }, { "docid": "de82aa70591fbe66d42c108bfa262edb", "score": "0.50364643", "text": "getArticles(): void {\n livefeedService\n .getArticles()\n .then(articles => {\n if (JSON.stringify(this.articles) != JSON.stringify(articles)) this.articles = articles;\n })\n .catch(error => console.error(error));\n }", "title": "" }, { "docid": "362367e43e8f06cf24951677f0639100", "score": "0.50357246", "text": "function _nextArticle() {\n var nextArticle = App.Data.getNextArticle(params.item.title, params.feedName).then(function (nextArticle) {\n\n if (nextArticle) {\n _refreshPageWithNewArticle(nextArticle);\n }\n else {\n // App.Data.showMessage(\"This is the last article\");\n App.Data.getNextArticle(params.item.title, params.feedName).then(function (nextArticle) {\n if (nextArticle) {\n if (currentPge) {\n currentPge._removeEventListeners();\n }\n _refreshPageWithNewArticle(nextArticle);\n }\n else {\n App.Data.showTipMessage(\"Message\", \"This is the last article\");\n }\n });\n }\n });\n }", "title": "" }, { "docid": "84caa7f930efac6f1f0cb444df342734", "score": "0.5032464", "text": "function showConfirm(seen) {\n if(!seen) {setShow(true); time = setTimeout(timeOut,5000)} \n if(seen) {setShow(false); clearTimeout(time)}\n \n }", "title": "" }, { "docid": "40fab1e6e529141f4a214c8ffb9411ae", "score": "0.50279415", "text": "function checker() {\n\t\t\tif ( localStorage.tour != undefined ) {\n\t\t\t\tjQuery( \"#tour\" ).html( localStorage.tour );\n\t\t\t\tjQuery( \"#date\" ).html( localStorage.date );\n\t\t\t} else {\n\t\t\t\tjQuery( \"#tour\" ).html( \" \" );\n\t\t\t\tjQuery( \"#date\" ).html( \" \" );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "40fab1e6e529141f4a214c8ffb9411ae", "score": "0.50279415", "text": "function checker() {\n\t\t\tif ( localStorage.tour != undefined ) {\n\t\t\t\tjQuery( \"#tour\" ).html( localStorage.tour );\n\t\t\t\tjQuery( \"#date\" ).html( localStorage.date );\n\t\t\t} else {\n\t\t\t\tjQuery( \"#tour\" ).html( \" \" );\n\t\t\t\tjQuery( \"#date\" ).html( \" \" );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3afac9ad66ef3c8c42cef8aa2b2b3a92", "score": "0.49984905", "text": "isDisplay() {\n const globalEnable = this.$themeConfig.backToTop !== false;\n const pageEnable = this.$page.frontmatter.backToTop;\n return ((pageEnable || (globalEnable && pageEnable !== false)) &&\n this.scrollTop > this.thresholdDistance);\n }", "title": "" }, { "docid": "44369d0334f58969552b16430cb69a25", "score": "0.49960047", "text": "function isNewVuln(vuln) {\n const MONTH = 30 * 24 * 60 * 60 * 1000;\n const publicationTime = new Date(vuln.publicationTime).getTime();\n return publicationTime > Date.now() - MONTH;\n}", "title": "" }, { "docid": "0f85c0597e6d0d7fb527b41598ae7837", "score": "0.499255", "text": "function showFavorites() {\n storyList = new StoryList(currentUser.favorites);\n putStoriesOnPage(true);\n}", "title": "" }, { "docid": "35d3e52745cb05f5e4f39aaa469470e9", "score": "0.49815676", "text": "function manageNoCategoriesMessage() {\n var topicTable = $(\"#topicTable\");\n if (topicTable.find(\"tr\").length > 1) {\n $(\"#infoMessageNoCategories\").hide();\n } else {\n $(\"#infoMessageNoCategories\").show();\n }\n}", "title": "" }, { "docid": "0ad91c2de47768623570b18391cc6a61", "score": "0.49766546", "text": "function checkExistenceInDatabase(oRow) {\n let sQuery = { text: \"SELECT exists(SELECT 1 from news where id='\" + oRow.sId + \"')\" };\n let sNewNewsString;\n client.query(sQuery, (err, oRes) => {\n if (err) {\n console.log(err.stack);\n } else {\n if (!oRes.rows[0].exists) { // ID does not exist in the table, its a new news item! add it to the DB and tell the network! (notice that if it's not we do nothing)\n insertIntoDatabase(oRow); // now insert the new news peice into the database\n }\n }\n });\n}", "title": "" }, { "docid": "05523c321c1f3baf67258b244ebe03a9", "score": "0.4957484", "text": "function checkShow(r){\r\n\t\t\t\t//is this a valid entry?\r\n\t\t\t\tif(r.doc.getElementsByTagName('h1')[0].textContent=='Invalid Request'){\r\n\t\t\t\t\tignore.push(random);\r\n\t\t\t\t\tunsafeWindow.console.log(random,' invalid entry');\r\n\t\t\t\t\tfindRandom();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\twindow.prompt('Random show:','http://myanimelist.net/anime/'+random+'/'+r.doc.getElementsByTagName('h1')[0].lastChild.textContent.replace(/\\s/g,'_')+'/');\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "2814a26addf8e52d312f9250161d68ef", "score": "0.49565715", "text": "function loadNewsFeed() {\n var feed = new google.feeds.Feed(\"http://www.medicalnewstoday.com/rss/eczema-psoriasis.xml\");\n feed.includeHistoricalEntries(); //includes any past entries it finds\n feed.setNumEntries(5); //sets entries limit at 5\n feed.load(function(result){\n if (!result.error) {\n var container = $('#newsFeedInner');\n for (var i=0; i< result.feed.entries.length; i++) {\n var entry = result.feed.entries[i];\n $(container).append(\"<p><a href='\" + entry.link + \"'>\" + entry.title + \"</a><br></p>\"); //if there is no error return entry url and title\n };\n }\n })\n }", "title": "" }, { "docid": "568dcbe8025c12444a732791aa88d160", "score": "0.49519524", "text": "feeds(folder) {\n if (folder.server.type != \"rss\" ||\n folder.getFlag(Ci.nsMsgFolderFlags.Trash) ||\n folder.getFlag(Ci.nsMsgFolderFlags.Virtual)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "d4e574a31bc8b6f5571a7dd141ece6d4", "score": "0.4946969", "text": "function checkLoaded(){\n if(_engine){\n alert(getMessage(\"already_loaded\"));\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "be6da29560d89c27621e629d38bf0b6e", "score": "0.49404615", "text": "function addMoreContent(){\n let content;\n let current = document.getElementById(\"currentTrue\").checked;\n let titleStatus;\n if (current){\n content = eventAccount.getMoreCurrent();\n titleStatus = \"current\";\n }else {\n content = eventAccount.getMoreExpired();\n titleStatus = \"expired\";\n }\n\n if (content === \"\"){\n document.getElementById(\"mySchedule\").innerHTML += \"No more \" + titleStatus + \" events...\";\n document.getElementById(\"moreEventsButton\").style.display = \"none\";\n }else {\n document.getElementById(\"mySchedule\").innerHTML += content;\n document.getElementById(\"moreEventsButton\").style.display = \"block\";\n }\n updateListener();\n}", "title": "" }, { "docid": "1246baa5c30cedad3d598b6bdb11cfdb", "score": "0.4936884", "text": "function listenForNewsContent(cb) {\n const origFetch = window.fetch;\n window.fetch = function(url) {\n if (/\\/vm-rest\\/users\\/(.*)\\/newsfeed\\//.test(url)) {\n cb();\n }\n return origFetch.apply(this, arguments)\n };\n }", "title": "" }, { "docid": "baa76267fdbd9d74c73827a387124a9b", "score": "0.4934525", "text": "function stateHasPlayed(title) {\n\t\tif (title == null || title === '') { // lazy equality for null\n\t\t\treturn false;\n\t\t}\n\n\t\tif (_expired.includes(title)) {\n\t\t\treturn true;\n\t\t}\n\t\telse if (_history.slice(0, historyLength()).some(moment => moment.title === title)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "a44882fa64a9596546d75f9553f1f828", "score": "0.4931542", "text": "function showNoEventsMessage() {\n if (noEvents.is(\":hidden\")) {\n noEvents.show();\n }\n }", "title": "" }, { "docid": "12d12ca2fdb6b629c7f4b795f11077e1", "score": "0.4924456", "text": "function toggleLoadMoreButton() {\n if ($(\".teaser:hidden\").length == 0) {\n $(\"#loadMore\").fadeOut('slow');\n }\n else {\n $(\"#loadMore\").fadeIn('slow');\n }\n }", "title": "" }, { "docid": "bcb3e4ac132ce0e1a54be03baa4e1c76", "score": "0.49231526", "text": "function verify(){\n hasTitle = document.getElementById(\"postTitle\").value != \"\";\n // hasDate = document.getElementById(\"postDate\").value != \"\";\n hasSummary = document.getElementById(\"postSummary\").value != \"\";\n return hasTitle && hasSummary;\n}", "title": "" }, { "docid": "38692602c391513a666953ff1a25d293", "score": "0.49223638", "text": "function toggleStory(){\n // If the story is already shown\n if(storyToggled){\n $('.ap-slideshow-btn-story').show();\n $('.ap-slideshow-caption').show();\n $('.ap-slideshow-story').hide();\n\n storyToggled = false;\n }\n else{\n $('.ap-slideshow-caption').hide();\n $('.ap-slideshow-btn-story').hide();\n $('.ap-slideshow-story').show();\n\n storyToggled = true;\n }\n }", "title": "" }, { "docid": "fa07a46de947f792e22508e22c65e975", "score": "0.49203265", "text": "function checkAlreadyLogged() {\n\t\n\tvar logged = getFromSessionStorage(\"logged\");\n\tif (logged == \"true\") {\n\t\treturn true;\n\t}\n\telse { return false;}\n\t\n}", "title": "" }, { "docid": "bbfa7ad1400f8dba384ad08917cc5dac", "score": "0.49195856", "text": "function hasSeenVideo() {\n if (!$state.includes('default.project')) {\n return true;\n }\n\n if (!$scope.user) {\n return false;\n }\n\n if (!_.isArray($scope.user.has_seen_video)) {\n $scope.user.has_seen_video = [];\n }\n\n var index = _.findIndex($scope.user.has_seen_video, function (statuses) {\n return statuses.name == $state.current.name;\n });\n\n if (index !== -1 && $scope.user.has_seen_video[index].status) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "3d524f0d7900e3e0b197155fe8d249f2", "score": "0.49185398", "text": "function iArt_checkIfChatWindowExist(mitdemda){\n\t\t\t\t\tvar denMussMannNoch = true;\n\t\t\t\t\tjQuery('#iArt_chatmessageContainer').find('.iArt_chatWindowContainer').each(function(){\n\t\t\t\t\t\tif(jQuery(this).attr('id')== 'iArt_privChat_'+mitdemda.replace(/ /g, '_').replace(/[^a-z0-9A-Z_]/g, '-')){\n\t\t\t\t\t\t\tdenMussMannNoch = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn denMussMannNoch;\n\t\t\t\t}", "title": "" }, { "docid": "8b736ab467e22ff2f853279c655dfee3", "score": "0.49034834", "text": "function checkPostExistence(html, movie){\nwp.posts()\n .search( \"imdb.com/title/tt\" + movie._id ) //should be unique!\n .then(function(res) {\n \n console.log(\"Got \"+ res.length +\" result for post with imdb id: \" + movie._id);\n if (res.length == 0) createNewPost(html, movie);\n if (res.length == 1) updateExistingPost(res[0].id, html, movie);\n if (res.length > 1) {\n console.warn(\"Problem matching unique post with imdb id: \" + movie._id);\n onPostedOnWordpress();\n }\n });\n}", "title": "" } ]
7d99a3f7369fe214b2e80a7fa7c9318c
polls the background.js to get an update
[ { "docid": "d1e3e5b7c86af161885bb332604de3d5", "score": "0.6510067", "text": "function poll () {\n chrome.runtime.sendMessage({\n source: 'popup',\n action: 'poll'\n })\n}", "title": "" } ]
[ { "docid": "e2204bdbea6312ffeb8436d21bbdf0a4", "score": "0.65772784", "text": "function start_poll() { \r\n poll = setInterval(function() { \r\n console.log(\"Checking feed update\");\r\n check_feed_update();\r\n }, 5000); \r\n}", "title": "" }, { "docid": "6d9ec5ecdb1eece97c44840993687d98", "score": "0.6488134", "text": "function updateBackgroundPage() {\n // this is probably going to get (at least slightly) more complex but\n // for now this will handle all content-script => background exchanges.\n chrome.runtime.sendMessage({\n action: \"contentResult\",\n hiddenPosts: hiddenPosts\n });\n}", "title": "" }, { "docid": "4ec692b881bce0578808c1a312c91b5e", "score": "0.64804083", "text": "function update() {\n\t\t$.getJSON(\"Status\", {}, updateStatus);\n\t\tsetTimeout(update, 1000); // Repeat after 1 second.\n\t}", "title": "" }, { "docid": "0ca59083681a01d06ad9cbcd79f5a3fd", "score": "0.64785975", "text": "fwk_app_on_update() {\n if (this.fwk_app_visible) {\n if (this._prev_update_sec === undefined) {\n this._prev_update_sec = 0;\n }\n let now_sec = Fwk.now().sec;\n if (now_sec - this._prev_update_sec > QservCss.update_ival_sec()) {\n this._prev_update_sec = now_sec;\n this._init();\n this._load();\n }\n }\n }", "title": "" }, { "docid": "d4873229c269c82d99d38a3ccd78ff64", "score": "0.64408416", "text": "function refreshBackgroundData() {\n // do sth\n // 更新 use debug\n if (userLocation.indexOf('useDebug=true') >= 0) {\n useDebugEnable = true;\n }\n}", "title": "" }, { "docid": "6d5649d9ecd14f506f065e9499175cb2", "score": "0.64319736", "text": "function update() {\n\tHost.update();\n\tupdating = setTimeout(update, refreshRate);\n}", "title": "" }, { "docid": "f70e91af2ef554da8c2e6e08d9c9aa81", "score": "0.64052343", "text": "function Update () {\n\tif (server.IsRunning()) {\n\t\t//GET venues \n\t\t//Query server only every 2seconds (\"roughly\")\n\t\tif (interval > 50) {\n\t\t\tvar transfer = asset.RequestAsset(\"http://vm0063.virtues.fi/venues/?active\", \"Binary\", true);\n\t\t\ttransfer.Succeeded.connect(myHandler);\n\t\t\tinterval = 0;\n\t\t} else\n\t\t\tinterval ++;\n\t} else {\n\t\t//Log(\"This is the client...\");\n\t}\n}", "title": "" }, { "docid": "6cf3eaf3a61edade00b620383539a0fd", "score": "0.6343377", "text": "function updateUpdateInterval() {\n if (document.hidden) {\n setUpdateInterval(options.hiddenUpdateInterval); //assume that hidden implies no focus\n } else if (hasFocus) {\n setUpdateInterval(options.activeUpdateInterval);\n } else {\n setUpdateInterval(options.inactiveUpdateInterval);\n }\n}", "title": "" }, { "docid": "36273edd2d526f7d211b658397b5806d", "score": "0.6271068", "text": "function updateStatus()\n{\n\t setInterval(CheckAll, 1000);\n}", "title": "" }, { "docid": "563376ce4c909ca63f01f82ab1287346", "score": "0.61965275", "text": "function update_notifier(){\n\n var div = $('div.tk.Sn:last');\n \n /**\n * Thumbnail.\n */\n var allThumbs = $(div).find('img.Yf');\n var reqThumb = allThumbs.length > 0 ? allThumbs[allThumbs.length-1].src : '';\n reqThumb = reqThumb.replace(/\\/s32-/, '/s256-');\n \n /**\n * Message.\n */\n var message = $(div).find('.Mu.SP:last').text();\n\n /**\n * User.\n */\n var user = $(div).find('.UR.UG').text();\n \n if (user !== '')\n chrome.runtime.sendMessage({img: reqThumb, user: user,update: message,url: document.referrer});\n}", "title": "" }, { "docid": "89536e6fa8ce2b9bac089a30f55def36", "score": "0.6147141", "text": "function mainLoop() {\n\n setTimeout(function () { // Run forever\n\n if (extension_status == EXT_OFF) return;\n\n chrome.tabs.query({}, update_total_tabs)\n\n chrome.tabs.query({\n audible: false\n }, soundOff)\n\n mainLoop();\n\n }, poll_interval)\n }", "title": "" }, { "docid": "b21a860926a91f04a7b24a9875ca11e1", "score": "0.60944426", "text": "async function main() {\n update();\n interval = setInterval(update, 1000 * 60 * 10);\n}", "title": "" }, { "docid": "b29089305f26d4cc2f05315420f41dae", "score": "0.60869604", "text": "live(){\n setInterval(()=>{this.generateHeartBeat()},1000)\n }", "title": "" }, { "docid": "2af21e681c1a959ea5d4be8a939f1b00", "score": "0.6076808", "text": "startPeriodicUpdate_() {\n // We update the storage usage every 5 seconds.\n if (this.updateTimerId_ === -1) {\n this.updateTimerId_ = window.setInterval(() => {\n if (Router.getInstance().getCurrentRoute() !== routes.STORAGE) {\n this.stopPeriodicUpdate_();\n return;\n }\n this.browserProxy_.updateStorageInfo();\n }, 5000);\n }\n }", "title": "" }, { "docid": "a7e376de8769a9916a508a4cc6b37fb6", "score": "0.6073893", "text": "async function checkForUpdate() {\n const defaultWallpaper = store.getDefault();\n const wallpapers = store.getWallpapers();\n const currentWallpaper = await wallpaper.get();\n\n const validTimes = await timeCheck(wallpapers);\n const validWeathers = await weatherCheck(wallpapers);\n const nextWallpaper = await findNextWallpaper(wallpapers.length, validTimes, validWeathers) || defaultWallpaper;\n \n logger.log({\n level: 'info',\n message: `checkForUpdate: current: ${currentWallpaper}, next: ${nextWallpaper}`\n });\n if (nextWallpaper && currentWallpaper !== nextWallpaper) {\n logger.log({\n level: 'info',\n message: `setting wallpaper to ${nextWallpaper}`\n });\n wallpaper.set(nextWallpaper);\n }\n}", "title": "" }, { "docid": "215d01b2f5879b608a3829b3b7344b6e", "score": "0.60712427", "text": "function contentScriptWorker() {\n runtime.sendMessage({\n type: SIGN_CONNECT\n }, function (msg) {\n return console.info(msg);\n });\n runtime.onMessage.addListener(function (_ref) {\n var type = _ref.type,\n payload = _ref.payload;\n\n switch (type) {\n case SIGN_RELOAD:\n logger(\"Detected Changes. Reloading ...\");\n reloadPage && window.location.reload();\n break;\n\n case SIGN_LOG:\n console.info(payload);\n break;\n }\n });\n } // ======================== Called only on background scripts ============================= //", "title": "" }, { "docid": "215d01b2f5879b608a3829b3b7344b6e", "score": "0.60712427", "text": "function contentScriptWorker() {\n runtime.sendMessage({\n type: SIGN_CONNECT\n }, function (msg) {\n return console.info(msg);\n });\n runtime.onMessage.addListener(function (_ref) {\n var type = _ref.type,\n payload = _ref.payload;\n\n switch (type) {\n case SIGN_RELOAD:\n logger(\"Detected Changes. Reloading ...\");\n reloadPage && window.location.reload();\n break;\n\n case SIGN_LOG:\n console.info(payload);\n break;\n }\n });\n } // ======================== Called only on background scripts ============================= //", "title": "" }, { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.60687286", "text": "function update() {}", "title": "" }, { "docid": "b3571ab6353d5e8f6eaaa4ac3631e4c1", "score": "0.60628176", "text": "function update() { }", "title": "" }, { "docid": "9a033933ff016c9622a014e4ca6e4064", "score": "0.60551625", "text": "onUpdated() {\n console.log('Service worker: updated');\n _$.app.sw.isUpdated = true;\n _$.events.trigger(\"swUpdated\");\n location.reload();\n }", "title": "" }, { "docid": "2e7dfc70555af6e312f4cf4b53aac66e", "score": "0.60224974", "text": "function initiateFutureUpdates(){\n //make the current update\n futureUpdates();\n\n //test to see if the interval timer runs immediately after this\n setIntervalTimer = setInterval(futureUpdates, 60000);\n }", "title": "" }, { "docid": "5ec6074b3cd603813ecf16adb205527a", "score": "0.6012036", "text": "function StartBackgroundService() {\n //Get current date\n var today = new Date();\n var dd = String(today.getDate()).padStart(2, '0');\n var mm = String(today.getMonth() + 1).padStart(2, '0');\n var time = today.toLocaleTimeString().replace(/([\\d]+:[\\d]{2})(:[\\d]{2})(.*)/, \"$1$3\");\n\n //Create the basics settings, if not have yet\n if (localStorage.getItem(\"delayBetweenUpdates\") == null)\n localStorage.setItem(\"delayBetweenUpdates\", \"30\");\n if (localStorage.getItem(\"showNotificationOnStart\") == null)\n localStorage.setItem(\"showNotificationOnStart\", \"false\");\n\n //Notify the start, if is enabled\n if (localStorage.getItem(\"showNotificationOnStart\") == \"true\")\n chrome.notifications.create(\"\",\n {\n type: \"basic\",\n iconUrl: \"../img/icon128.png\",\n title: \"Publisher Tools For Asset Store\",\n message: \"The Background Service of this Extension is running!\"\n },\n function () { });\n\n //Register a new alarm to run periodics updates, register the receiver too\n chrome.alarms.create(\"OnRunNewUpdateOfService\", {\n delayInMinutes: 1,\n periodInMinutes: 1\n });\n chrome.alarms.onAlarm.addListener(function (alarm) {\n if (alarm.name === \"OnRunNewUpdateOfService\") {\n //If alarm count is in the desired delay between updates, run the update of service and reset counter\n if (currentAlarmsRunnedCount >= parseInt(localStorage.getItem(\"delayBetweenUpdates\"), 10)) {\n OnRunNewUpdateOfService();\n\n //Reset the currentAlarmsRunnedCount\n currentAlarmsRunnedCount = 0;\n }\n\n //Increase runs of alarm count\n currentAlarmsRunnedCount += 1;\n }\n });\n\n //Register a lister for receive all types of messages\n chrome.runtime.onMessage.addListener(\n function (request, sender, sendResponse) {\n if (request.msg == \"StartBackgroundService\")\n StartBackgroundService();\n\n if (request.msg == \"OnRunNewUpdateOfService\")\n OnRunNewUpdateOfService();\n }\n );\n\n //Set default color for badges of this extension\n chrome.browserAction.setBadgeBackgroundColor({ color: [190, 0, 0, 255] });\n\n //Call OnRunNewUpdateOfService to run first update\n OnRunNewUpdateOfService();\n\n //Notify this start on console\n console.log(\"The Service Was Started In \" + dd + \"/\" + mm + \" \" + time + \".\");\n}", "title": "" }, { "docid": "0fdf389c915160da0aa08745c0367e2b", "score": "0.60116106", "text": "async update() {\n\n }", "title": "" }, { "docid": "8c7172f292adb39b214085ca22374ac1", "score": "0.60104156", "text": "recordHeartbeat() {\n this.checkAuth().done(data => {\n\n if (data !== false) {\n\n chrome.storage.sync.get({\n loggingEnabled: true\n }, (items) => {\n if (items.loggingEnabled === true) {\n changeExtensionIcon();\n\n chrome.idle.queryState(this.detectionIntervalInSeconds, (newState) => {\n\n if (newState === 'active') {\n // Get current tab URL.\n chrome.tabs.query({active: true}, (tabs) => {\n this.sendHeartbeat(tabs[0].url);\n });\n }\n });\n }\n else {\n changeExtensionIcon('red');\n }\n });\n }\n else {\n\n // User is not logged in.\n // Change extension icon to red color.\n changeExtensionIcon('red');\n }\n });\n }", "title": "" }, { "docid": "8484bfe26d67a7fb919df0321e45ca63", "score": "0.60070026", "text": "function doWork() {\n interval = setInterval(updateStatus, 1);\n}", "title": "" }, { "docid": "7c59cc71f0a142b92e8859f6d6b1da85", "score": "0.6000639", "text": "function timeBetweenUpdates() {\r\n\t//\treturn (1000 * 60 * prefRefreshRate) ;\r\n\treturn (1000 * 60 * 60 * prefRefreshRate);\r\n}", "title": "" }, { "docid": "7fcb5e6dc55fa7f93b60fbd7b8fc9283", "score": "0.5987772", "text": "function periodically_check_for_changes() {\n\tchange_dispatch();\n\tif (focused)\n\t setTimeout(periodically_check_for_changes, 50); // Every 50 ms\n }", "title": "" }, { "docid": "4116a2c64ab944fedbc1421307035db7", "score": "0.59872335", "text": "function checkForUpdates() {\r\n var now = new Date().getTime();\r\n var uInt = scriptAppInfo.appUpdateInterval * 60 * 60 * 100;\r\n if ( now < (global.options.get('appLastUpdateCheck') + uInt) ) {\r\n return;\r\n }\r\n global.options.set('appLastUpdateCheck', now);\r\n global.options.save();\r\n \r\n if (global.xd_support === true) {\r\n httpXDRequest({\r\n method: 'GET',\r\n url: scriptAppInfo.appMeta + '?' + now,\r\n onload: function(responseDetails) {\r\n updateCheck(responseDetails.responseText, true);\r\n }\r\n });\r\n }\r\n else {\r\n setTimeout(function() {\r\n // Add iframe Updater\r\n var el = document.createElement('iframe');\r\n el.setAttribute('style', 'display: none;');\r\n el.setAttribute('src', scriptAppInfo.appMeta + '?' + now);\r\n document.getElementsByTagName('body')[0].appendChild(el);\r\n }, 6000); \r\n }\r\n}", "title": "" }, { "docid": "45b360d00f8c9c93939295c49b6051fb", "score": "0.5980394", "text": "function checkForUpdates() {\n\tconsole.log('[Opt Rev Notif] Checking against', window.revision);\n\n\t$.ajax({\n\t\ttype: 'HEAD',\n\t\turl: 'https://cdn.optimizely.com/js/' + window.snippetID + '.js',\n\t\tcache: false,\n\t\tsuccess: function(data, textStatus, request) {\n\t\t\tvar fetchedRevision = request.getResponseHeader('x-amz-meta-revision');\n\n\t\t\tif (window.revision === fetchedRevision) {\n\t\t\t\tsetTimeout(checkForUpdates, 2500);\n\t\t\t} else {\n\t\t\t\twindow.revision = fetchedRevision;\n\t\t\t\tconsole.log('[Opt Rev Notif] New revision found:', window.revision);\n\t\t\t\tchrome.runtime.sendMessage({ revision: window.revision }, function(response) {\n\t\t\t\t console.log(response);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f49c08da74c43105a0825bad73c5773b", "score": "0.5978999", "text": "refreshApp() {\n Loading.show({\n message: this.$t('Common.UpdateProcessOnGoing.Text'),\n messageColor: 'primary text-h6',\n spinnerSize: 80, // in pixels\n spinnerColor: 'primary-darkened',\n backgroundColor: 'white',\n })\n this.updateExists = false\n clearInterval(this.interval)\n localStorage.removeItem(APP_UPDATED_TIMESTAMP)\n // Make sure we only send a 'skip waiting' message if the SW is waiting\n if (!this.registration || !this.registration.waiting) return\n // send message to SW to skip the waiting and activate the new SW\n this.registration.waiting.postMessage({ type: 'SKIP_WAITING' })\n }", "title": "" }, { "docid": "a6bb7ae8cd0c80b0e03bc75d589101aa", "score": "0.5959527", "text": "queueAlertUpdate() { this.tabs.updateMuteAlarm(); }", "title": "" }, { "docid": "a9b5a9c687ad034e71457b4a2a3c7671", "score": "0.59481984", "text": "function update() {\n console.log('update');\n CheckIfAdmin();\n Refresh();\n //setTimeout(()=>{setRefreshThingy(!refreshThingy)}, 1000);\n }", "title": "" }, { "docid": "e136865eab55218a454f158d0541b350", "score": "0.5947499", "text": "function poll() {\n\t\t\t\t\t\tcheckActivity();\n\t\t\t\t\t\tdirtyEventHandler();\n\t\t\t\t\t\tpollingTimeout = setTimeout(poll, POLL_INTERVAL);\n\t\t\t\t\t}", "title": "" }, { "docid": "1b92454f99ace3150f13359f1d4e2abe", "score": "0.59390706", "text": "function refresh_motion() {\n \t$.getq('queue', '/motion', function(data) {\n if (data.state == 0) {$('#motion').html(\"No motion detected\");}\n if (data.state == 1) {\n\n // Change text\n $('#motion').html(\"Motion detected\");\n\n // Play sound if alarm is on\n $.get('/alarm', function(data) {\n if (data.state == 1) {$.playSound('/audio/alarm');}\n });\n \n }\t\n });\n }", "title": "" }, { "docid": "f0e8ae0fda71218a5e474519b7488c9d", "score": "0.59177196", "text": "function loadUpdates() {\n if (window.WebSocket) {\n wsChangesListener(host, self.callback);\n return;\n }\n\n // on older IEs the console is defined only when the developer tools are open.\n if (typeof console != \"undefined\") {\n console.info('fast-live-reload - Web Sockets are not supported, AJAX fallback will be used.');\n }\n ajaxChangesListener();\n }", "title": "" }, { "docid": "f0e8ae0fda71218a5e474519b7488c9d", "score": "0.59177196", "text": "function loadUpdates() {\n if (window.WebSocket) {\n wsChangesListener(host, self.callback);\n return;\n }\n\n // on older IEs the console is defined only when the developer tools are open.\n if (typeof console != \"undefined\") {\n console.info('fast-live-reload - Web Sockets are not supported, AJAX fallback will be used.');\n }\n ajaxChangesListener();\n }", "title": "" }, { "docid": "6710864532eea245f649b4d1a4b49b32", "score": "0.5904931", "text": "function autoUpdate() {\n app.autoUpdater.setFeedURL(\"https://umaster-nuts.herokuapp.com/update/\" + platform + \"/x.x.x\");\n app.autoUpdater.checkForUpdates();\n\n //update events\n app.autoUpdater.addListener(\"error\", (e) => {\n console.log(\"error\");\n console.log(e);\n });\n\n app.autoUpdater.addListener(\"checking-for-update\", (e) => {\n console.log(\"checking for update\");\n console.log(e);\n });\n\n app.autoUpdater.addListener(\"update-available\", (e) => {\n console.log(\"update-available\");\n console.log(e);\n isUpdateAvailable = true;\n console.log(\"UA: \" + isUpdateAvailable);\n });\n\n app.autoUpdater.addListener(\"update-not-available\", (e) => {\n console.log(\"update-not-available\");\n console.log(e);\n });\n\n app.autoUpdater.on(\"update-downloaded\", (e, releaseNotes, releaseName, releaseDate, updateUrl) => {\n console.log(\"update-downloaded\");\n console.log(e);\n console.log(\"Update: '\" + releaseName + \"' was released at \" + releaseDate + \" and can be found here: \" + updateUrl);\n\n update = {\n releaseNotes: releaseNotes,\n releaseName: releaseName,\n releaseDate: releaseDate,\n updateUrl: updateUrl\n };\n\n console.log(update);\n });\n }", "title": "" }, { "docid": "5a9289cc4f27343c0f473ee3d5c6983c", "score": "0.58982724", "text": "function refreshExtensions() {\n console.debug(`refresh request: synchronize the UI`);\n\n // Translate OnAirStatus to a human readable message\n let onAirMessage = \"translate\"\n switch (gstate.onAirStatus) {\n case STATUS_INCALL:\n onAirMessage = \"DO NOT ENTER, no excuse\"\n break\n\n case STATUS_BUSY:\n onAirMessage = \"Not the best time, actively working\"\n break\n\n case STATUS_OCCUPIED:\n onAirMessage = \"All good: you can give Daddy a kiss\"\n break\n\n case STATUS_FREE:\n default:\n onAirMessage = \"Sorry, Dad's not here :-(\"\n break;\n }\n\n // Update Awake message\n console.log(`updating Awake message to: ${onAirMessage}`)\n gstate.xapi.config.set('UserInterface CustomMessage', onAirMessage)\n .then(() => {\n console.debug('successfully updated Awake message')\n })\n .catch((err) => {\n console.warn(`could not update Awake message to: ${onAirMessage}, err: ${err.message}`)\n });\n\n // Update In-Room Control Panel\n // console.log(`updating console OnAir to: ${onAirMessage}`)\n // gstate.xapi.command('UserInterface Extensions Widget SetValue', {\n // WidgetId: 'onair_console_statusText',\n // Value: onAirMessage\n // }).catch((err) => {\n // console.warn(`error updating OnAir console text widget, err: ${err.msg}`);\n // });\n\n // Update Bulb\n toggleLight(true)\n switch (gstate.onAirStatus) {\n case STATUS_INCALL:\n changeColor(COLOR_RED)\n break\n\n case STATUS_BUSY:\n changeColor(COLOR_BLUE)\n break\n\n case STATUS_OCCUPIED:\n case STATUS_FREE:\n default:\n changeColor(COLOR_GREEN)\n break;\n }\n}", "title": "" }, { "docid": "238d5fa1a4065d2297d96efa68d9b9bb", "score": "0.5896438", "text": "function update() {\n\n }", "title": "" }, { "docid": "0d0c059ee75faf92c36da2600d9af00b", "score": "0.5879518", "text": "scheduleUpdates () {\n if (this._phishingUpdateIntervalRef) return\n this.updatePhishingList().catch(log.warn)\n this._phishingUpdateIntervalRef = setInterval(() => {\n this.updatePhishingList().catch(log.warn)\n }, POLLING_INTERVAL)\n }", "title": "" }, { "docid": "3290fc8a0c1edc78734d7c4c3a99f35e", "score": "0.58783144", "text": "async function backgroundSyncLoadTips() {\n const tips = await localforage.getItem('bg-tips');\n if (!tips || !tips.length) {\n return;\n }\n\n // Fetch and cache each tip.\n const cache = await caches.open(CACHE_NAME);\n await cache.addAll(tips);\n\n // Re-engage user with a notification.\n registration.showNotification(`${tips.length} DevTools Tips was/were loaded in the background and is/are ready`, {\n icon: \"/assets/logo-192.png\",\n body: \"View the tip\",\n data: tips[0]\n });\n\n await localforage.removeItem('bg-tips');\n}", "title": "" }, { "docid": "a42cdf50fc284939e70e5e8cd14d4621", "score": "0.5878122", "text": "updateAvailable(event) {\n this.registration = event.detail\n this.updateExists = true\n this.timerCount = localStorage.getItem(APP_UPDATED_TIMESTAMP) || config.pwa.autoUpdateTimer\n this.interval = setInterval(() => this.activateTimer(), 1000)\n }", "title": "" }, { "docid": "55b05cc23ef35a87a573446193680b9c", "score": "0.5864569", "text": "function updateGlass() {\n progress.startUpdate();\n $('div.tab-content').css('pointerEvents', 'none');\n var tempconfig = generateConfigText();\n fileurlgenerator.glassUrlGenerator(tempconfig);\n idTimerGlass = setInterval(queryGlassUrl, glassUrlInterval);\n console.log(\"updating Glass\");\n }", "title": "" }, { "docid": "36f9633578d2121fdf5729a75af38e64", "score": "0.58597267", "text": "function update() {\n }", "title": "" }, { "docid": "4009b4f17000c625bffd0cf56e49ec22", "score": "0.58586264", "text": "function loadSettings() {\n\n // Select the chosen country\n chrome.extension.getBackgroundPage().settings.get('country', function (data) {\n\n // Add a class to the correct country flag\n var item = document.querySelectorAll(\"input[value=\" + data + \"]\")[0];\n item.parentElement.className = \"list-group-item active\";\n item.checked = true;\n\n // When changing the country, save the settings\n var chk_country = document.querySelectorAll(\".list-group.countries\")[0];\n chk_country.addEventListener(\n 'click',\n function () {\n // Find the selected item\n var chk = document.querySelectorAll(\".list-group.countries input[name=country]:checked\")[0];\n\n // Keep this setting\n chrome.extension.getBackgroundPage().settings.set('country', chk.value);\n\n // De-activate the previous node\n document.querySelectorAll(\".countries .list-group-item.active\")[0].className = \"list-group-item\";\n\n // Activate this node\n chk.parentElement.className = \"list-group-item active\";\n }\n );\n\n });\n\n\n // Get the time interval to check for updates\n chrome.extension.getBackgroundPage().settings.get('checkInterval', function (data) {\n\n // Fill in the field with the settings data.\n document.getElementById(\"checkInterval\").value = data / 1e3;\n\n\n // Function for saving the interval\n var saveInterval = function (e) {\n\n // Get the value\n var value = e.currentTarget.value * 1e3;\n\n // Write the value to the settings\n if (value > 0) {\n chrome.extension.getBackgroundPage().settings.set('checkInterval', value);\n } else {\n document.getElementById(\"checkInterval\").value = 1;\n chrome.extension.getBackgroundPage().settings.set('checkInterval', 1);\n }\n\n // Display the restart notification\n showRestartNotification();\n\n };\n\n\n // Add an event listener to check for changes in value\n document.getElementById(\"checkInterval\").addEventListener(\"keyup\", saveInterval);\n document.getElementById(\"checkInterval\").addEventListener(\"change\", saveInterval);\n });\n\n\n // Same as the above but for the hunt interval\n chrome.extension.getBackgroundPage().settings.get('checkIntervalHunt', function (data) {\n\n // Fill in the field with the settings data.\n document.getElementById(\"checkIntervalHunt\").value = data / 1e3;\n\n\n // Function for saving updated version\n var saveIntervalHunt = function (e) {\n\n // Get the value\n var value = e.currentTarget.value * 1e3;\n\n // Write the value to the settings\n if (value > 0) {\n chrome.extension.getBackgroundPage().settings.set('checkIntervalHunt', value);\n } else {\n document.getElementById(\"checkIntervalHunt\").value = 1;\n chrome.extension.getBackgroundPage().settings.set('checkIntervalHunt', 1);\n }\n\n // Display the restart notification\n showRestartNotification();\n\n };\n\n\n // Add an event listener to check for changes in value\n document.getElementById(\"checkIntervalHunt\").addEventListener(\"keyup\", saveIntervalHunt);\n document.getElementById(\"checkIntervalHunt\").addEventListener(\"change\", saveIntervalHunt);\n });\n\n\n // Do we show stock?\n chrome.extension.getBackgroundPage().settings.get('displayStock', function (data) {\n\n // If the checkbox is not available, don't bother!\n if (document.getElementById('displayStock') === null) {\n return false;\n }\n\n // Fill in the field with the settings data.\n if (data && typeof data === \"boolean\") {\n document.getElementById('displayStock').checked = data;\n }\n\n // Add an event listener to check for changes in value\n document.getElementById(\"displayStock\").addEventListener(\"change\", function (e) {\n\n // Write the value to the settings\n chrome.extension.getBackgroundPage().settings.set(\n 'displayStock',\n e.currentTarget.checked\n );\n\n });\n });\n\n\n // Do we show notifications\n chrome.extension.getBackgroundPage().settings.get('enableNotifications', function (data) {\n\n // If the checkbox is not available, don't bother!\n if (document.getElementById('enableNotifications') === null) {\n return false;\n }\n\n // Fill in the field with the settings data.\n if (data && typeof data === \"boolean\") {\n document.getElementById('enableNotifications').checked = data;\n }\n\n // Add an event listener to check for changes in value\n document.getElementById(\"enableNotifications\").addEventListener(\"change\", function (e) {\n\n // Write the value to the settings\n chrome.extension.getBackgroundPage().settings.set(\n 'enableNotifications',\n e.currentTarget.checked\n );\n\n });\n });\n\n\n // Get the Product alert keywords\n chrome.extension.getBackgroundPage().settings.get('productAlertKeywords', function (data) {\n\n // If the textbox is not available, don't bother!\n if (document.getElementById('productAlertKeywords') === null) {\n return false;\n }\n\n // Fill in the field with the settings data.\n if (data && typeof data === \"object\") {\n document.getElementById('productAlertKeywords').value = data.join(\",\");\n }\n\n // Add an event listener to check for changes in value\n document.getElementById(\"productAlertKeywords\").addEventListener(\"keyup\", function (e) {\n\n // Get the value\n var value = e.currentTarget.value;\n\n // Make sure a value is present\n if (value.length > 0 && !value.match(/^\\s+$/)) {\n\n // Split the value into an array\n value = value.split(/\\s*,\\s*/);\n\n } else {\n\n // Reset value to an empty array\n value = [];\n\n }\n\n // Write the value to the settings\n chrome.extension.getBackgroundPage().settings.set('productAlertKeywords', value);\n\n });\n });\n\n\n // Get the Product alert Direct order\n chrome.extension.getBackgroundPage().settings.get('productAlertDirectOrder', function (data) {\n\n // If the checkbox is not available, don't bother!\n if (document.getElementById('productAlertDirectOrder') === null) {\n return false;\n }\n\n // Fill in the field with the settings data.\n if (data && typeof data === \"boolean\") {\n document.getElementById('productAlertDirectOrder').checked = data;\n }\n\n // Add an event listener to check for changes in value\n document.getElementById(\"productAlertDirectOrder\").addEventListener(\"change\", function (e) {\n\n // Write the value to the settings\n chrome.extension.getBackgroundPage().settings.set(\n 'productAlertDirectOrder',\n e.currentTarget.checked\n );\n\n });\n });\n\n\n // Set the version number\n if (document.getElementById('versionNumber') !== null && typeof chrome.runtime.getManifest === 'function') {\n\n // Get the manifest object\n var manifest = chrome.runtime.getManifest();\n\n // Display the version number\n document.getElementById('versionNumber').innerHTML = \"v\" + manifest.version;\n\n }\n\n }", "title": "" }, { "docid": "1d59eac425432a54bf646178f2afe3e1", "score": "0.585381", "text": "function updatePreview() {\n lastRequestTime = Date.now()\n\n setTimeout(() => {\n if (Date.now() - lastRequestTime >= minCoolTime) {\n doUpdate()\n }\n }, minCoolTime + 2)\n}", "title": "" }, { "docid": "02dbd3453ee57227b3c1c2b29c70e3aa", "score": "0.5849251", "text": "_checkForUpdates() {\n RB.apiCall({\n type: 'GET',\n prefix: this.get('sitePrefix'),\n noActivityIndicator: true,\n url: this.get('links').last_update.href,\n success: rsp => {\n const lastUpdate = rsp.last_update;\n\n if ((!this._checkUpdatesType ||\n this._checkUpdatesType === lastUpdate.type) &&\n this._lastUpdateTimestamp !== lastUpdate.timestamp) {\n this.trigger('updated', lastUpdate);\n }\n\n this._lastUpdateTimestamp = lastUpdate.timestamp;\n\n setTimeout(this._checkForUpdates.bind(this),\n RB.ReviewRequest.CHECK_UPDATES_MSECS);\n }\n });\n }", "title": "" }, { "docid": "13c6f30c337476d4272b3561f2a533ba", "score": "0.58489466", "text": "function update() {\n let t0 = performance.now();\n // update the on screen time display\n updateTime();\n // clear out the last alarm from the display\n clearDisplayNextAlarm();\n // don't process reminders, timers, alarms if the queue is empty\n if (anyReminders()) {\n // check for next alarm\n updateReminders();\n }\n // remove completed timers\n updateTimers();\n // update the on screen date display\n updateDate();\n if (debug == true) {\n debugMode();\n }\n let t1 = performance.now() - t0;\n if (t1 > 1.5) {\n //console.log('update loop took ' + t1)\n }\n}", "title": "" }, { "docid": "b105bb7a0bc97d77b96f34f3ff0d5297", "score": "0.58480275", "text": "function startPoll() {\n interval = setInterval(poll, 5000);\n}", "title": "" }, { "docid": "aaf64f6eeb43b7fe7152e5e816ac4659", "score": "0.5847194", "text": "function updater() {\n setBattery()\n addSecond()\n}", "title": "" }, { "docid": "17c714189e3d68059304046efeaf1d2a", "score": "0.5841176", "text": "function update(){\n displayTime();\n blockState();\n }", "title": "" }, { "docid": "a053b2306e850ad2bc3948c1d996f04a", "score": "0.5830422", "text": "function liveUpdate() {\n setInterval( () =>{\n fetch('https://one-line-a-day-2.herokuapp.com/api/users/quantity').then((res)=>{\n return res.json()\n }).then((count) => {\n if(Number(userCount.textContent) != count){\n countUP(count)\n }\n })\n }, 5000)\n}", "title": "" }, { "docid": "15ed67eb45edbb477e52b25925f187dc", "score": "0.5829687", "text": "function poll(){\r\n\tvar page = window.location.pathname.substr(window.location.pathname.lastIndexOf('/') + 1);\r\n\tpage = page.split('.')[0];\r\n\t\r\n\t//Updates the Maps content only if it is on the map else only look for commands\r\n\tif(page == 'map'){\r\n\t\tcheckCookie();\r\n\t\tcarousel();\r\n\t\tinitMap();\r\n\t\t\r\n\t\tvar mapCookie = Cookies.getJSON('mapCookie');\r\n\t\tupdateContent(mapCookie);\t\r\n\t\tsetInterval(function(){$.post('LocationInfo.json' ,function(data){ \r\n\t\t\t\t\t\t\t\t\t\t/* Comment out if on Desktop */\r\n\t\t\t\t\t\t\t\t\t\tif(JSON.stringify(prevJson) != JSON.stringify(data)){\r\n\t\t\t\t\t\t\t\t\t\t\tprevJson = data;\r\n\t\t\t\t\t\t\t\t\t\t\tselectedIndex = 0;\r\n\t\t\t\t\t\t\t\t\t\t\tupdateAllInfo(data,false);\r\n\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t/* Comment out if on PI*/\r\n\t\t\t\t\t\t\t\t\t\t/* if(prevJson != data){\r\n\t\t\t\t\t\t\t\t\t\t\tprevJson = data;\r\n\t\t\t\t\t\t\t\t\t\t\tselectedIndex = 0;\r\n\t\t\t\t\t\t\t\t\t\t\tupdateAllInfo(data,false);\r\n\t\t\t\t\t\t\t\t\t\t} */ \r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t $.post('GUICom.json' ,function(data){ \r\n\t\t\t\t\t\t\t\t\t\tcheckCommand(data);});\t\t\r\n\t\t\t\t\t\t\t\t},1100);\r\n\t}\r\n\telse{\r\n\t\tsetInterval(function(){$.post('GUICom.json' ,function(data){ \r\n\t\t\t\t\t\t\t\t\t\tcheckCommand(data);});\t\t\r\n\t\t\t\t\t\t\t\t},1000);\r\n\t}\r\n}", "title": "" }, { "docid": "5054e5e8a8ebde73ed0db5f7ff776c59", "score": "0.58286816", "text": "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 7*60*60*1000);\r\n }", "title": "" }, { "docid": "329ae7779d24ef29cd4c85e8de308d9b", "score": "0.5828286", "text": "function getStatus() {\n $.getJSON(\"/status\", mainControls);\n\tsetTimeout(\"getStatus();\", 10000);\n}", "title": "" }, { "docid": "77c6e310e726b465baf9add30241ac5d", "score": "0.5816973", "text": "function updateStatus(value) {\n if (value != lastUpdate) {\n ipcRenderer.sendSync(\"previewStatus\", value);\n lastUpdate = value;\n }\n}", "title": "" }, { "docid": "987cd0a6cd2647a0199e543877b4a780", "score": "0.58141613", "text": "function update() {\n}", "title": "" }, { "docid": "d0025444de0dda6ad3a3b7d440f2a8f3", "score": "0.58138627", "text": "function ping() {\n chrome.extension.getBackgroundPage().PopupCloseMonitor.popupPing();\n setTimeout(ping, 500);\n }", "title": "" }, { "docid": "1c08eadc08931806a2fd7bf0d2e66d33", "score": "0.58138216", "text": "function scheduledAutoUpdate () {\n settingsDb.get('auto_update_enabled').then(v => {\n // if auto updates are enabled, run the check\n if (+v === 1) { checkForUpdates() }\n\n // schedule next check\n setTimeout(scheduledAutoUpdate, SCHEDULED_AUTO_UPDATE_DELAY)\n })\n}", "title": "" }, { "docid": "e5fa18e381175db82219332d38a1995d", "score": "0.580521", "text": "afterUpdate () {}", "title": "" }, { "docid": "f38ec7141a7f5eb5747de03f3a7fbe84", "score": "0.5803737", "text": "function update() {\n if (site) {\n debugPrint('updated site ' + site + ' to ' +\n getSiteDelta(site) + ',' + getSiteSeverity(site));\n $('delta').value = getSiteDelta(site);\n $('severity').value = getSiteSeverity(site);\n } else {\n debugPrint('updated site ' + site + ' to ' +\n getDefaultDelta() + ',' + getDefaultSeverity());\n $('delta').value = getDefaultDelta();\n $('severity').value = getDefaultSeverity();\n }\n\n debugPrint('updated site ' + site + ' type ' + getDefaultType());\n $('type').value = getDefaultType();\n\n // TODO(mustaq): Finish simulate feature.\n //debugPrint('updated site ' + site + ' simulate ' + getDefaultSimulate());\n //$('simulate').checked = getDefaultSimulate();\n\n chrome.extension.getBackgroundPage().updateTabs();\n}", "title": "" }, { "docid": "a94f43005730cd2b64c5e9f4df382df0", "score": "0.57993263", "text": "static doPollingHack(): void {\n console.log(\"starting polling\");\n if (!!pollingSyncHack) {\n console.log(\"clearing old poll\");\n window.clearInterval(pollingSyncHack);\n pollingSyncHack = undefined;\n }\n\n pollingSyncHack = window.setInterval(() => {\n window.poltergeist.sync(null, null);\n }, 1000);\n }", "title": "" }, { "docid": "d03f51584622a335e747b1b02c9c7831", "score": "0.57905024", "text": "function refresh_all(backgroundState) {\n connection = backgroundState['connection'];\n if (connection == CONN_CONNECTED) { socket_opened(); }\n else if (connection == CONN_CONNECTING) { socket_reconnecting(); }\n else if (connection == CONN_DISCONNECTED) { socket_closed(); }\n update_general(backgroundState['general']['message'], backgroundState['general']['message_type']);\n document.getElementById(HTML_MSGREQ).innerHTML = '';\n for (var i = 0; i < backgroundState['id_order'].length; i++) {\n var key = backgroundState['id_order'][i];\n add_tracker(\n key, backgroundState[key]['short_id'], \n backgroundState[key]['title'], backgroundState[key]['warnings']\n );\n if (backgroundState[key]['ready']) { \n activate_result(\n key, backgroundState[key]['url'], \n backgroundState[key]['title']\n ); \n }\n else {\n update_tracker(\n key, backgroundState[key]['message'], \n backgroundState[key]['message_type'], \n backgroundState[key]['warnings'], \n ); \n }\n }\n}", "title": "" }, { "docid": "1313df0198f9e85d94ca839a19fda30f", "score": "0.5789603", "text": "function pollStatus () {\n if (gEditing) {\n return;\n }\n loadJSONP(\n \"/json/admin.json\",\n function(newStatus) {\n if (newStatus.hasOwnProperty('channels')) {\n \n if (statCompare(gStatus, newStatus)) {\n //console.log(newStatus);\n gStatus = newStatus;\n gStatusUpdate = true;\n }\n } else {\n if (newStatus.hasOwnProperty('problem') && /^Forbidden/.test(newStatus['problem']) && !gSettingPw) {\n //Password is wrong\n setAdminPw();\n }\n }\n }\n );\n if (gStatusUpdate) {\n updateDisplay ();\n gStatusUpdate = false;\n }\n}", "title": "" }, { "docid": "689f67074248a9fdfe4af88c3010d971", "score": "0.57888424", "text": "function showUpdateAvailable() {\n chrome.browserAction.setBadgeBackgroundColor({color: \"red\"});\n chrome.browserAction.setBadgeText( {text: \"Stale\"} );\n}", "title": "" }, { "docid": "fc85614eea30fc592637753e14a73839", "score": "0.57874024", "text": "function call_update(callback){\r\n callback();\r\n}", "title": "" }, { "docid": "f23c75f4b2d92f43f2a06144dc1144b7", "score": "0.5785444", "text": "function update() {\n\n }", "title": "" }, { "docid": "457f3ad08ae1c52c8ab8ae1bbbbf7c03", "score": "0.5781458", "text": "function intervalHeartbeat() {\n if (document.webkitHidden || document.hidden) {\n clearTimers();\n document.location = \"http://bestpint.net\";\n }\n }", "title": "" }, { "docid": "e24bfd78a3cb38ebf52bad707a72ccb9", "score": "0.5780892", "text": "function updateScript(){\r\n\tupdate5 = setInterval(function() {\r\n\t\t\r\n\t}, 50000);\r\n}", "title": "" }, { "docid": "2d594b40be9f752f27c1c3f5faf6011f", "score": "0.57748395", "text": "function enable_temperature_tracking() {\r\n $.get(\"/temperature_tracking_on\")\r\n\tdocument.getElementById(\"temp_check_on\").style.display=\"none\";\r\n\tdocument.getElementById(\"temp_check_off\").style.display=\"block\";\r\n\tset_background_and_display_temperature();\r\n\tset_background_and_display_temperature_loop = setInterval(set_background_and_display_temperature, 100);\r\n}", "title": "" }, { "docid": "973d9c66977b03f839c1d2293dd567ed", "score": "0.576541", "text": "_startUpdateWorker() {\n const doSomeUpdates = () => {\n const endTime = Date.now() + this.backgroundUpdateTime;\n while (Date.now() < endTime) {\n const node = this.updateQueue.shift();\n this._measure(node);\n if (this.updateQueue.length == 0) {\n this.updating = false;\n return;\n }\n }\n setTimeout(doSomeUpdates, 10);\n };\n doSomeUpdates();\n }", "title": "" }, { "docid": "fec82cdfb8c420deefe91e1ad026b445", "score": "0.5764388", "text": "function checkForUpdates(){\n cache.update();\n }", "title": "" }, { "docid": "d6d2598b951e30125735e17190d79f32", "score": "0.5763919", "text": "function update() {\n $.getJSON(url, function(data) {\n console.log(data);\n var result = data;\n var rmb_text = result.ticker.last;\n var rmb = parseInt(rmb_text);\n\n chrome.browserAction.setTitle({\n 'title': '人民币价格:' + parseFloat(rmb_text)\n });\n\n var badgeColor;\n if (rmb > cur_rmb) {\n badgeColor = '#C43E44';\n } else if (rmb == cur_rmb) {\n badgeColor = '#78B9FF';\n } else {\n badgeColor = '#9C6';\n }\n var text = rmb + \"\";\n if (doTextAnimation) {\n var animator = new BadgeTextAnimator({\n text: text,\n interval: 200,\n repeat: false,\n size: text.length,\n color: badgeColor\n });\n animator.animate();\n } else {\n chrome.browserAction.setBadgeText({\n 'text': rmb\n });\n }\n ;\n\n var watch_price = parseInt(localStorage[\"watch_price\"]);\n var watch_type = localStorage[\"watch_type\"];\n\n stopAnimateLoop();\n\n if ((watch_type == \"lt\" && rmb < watch_price) ||\n (watch_type == \"gt\" && rmb > watch_price)\n ) {\n startAnimate();\n }\n\n\n cur_rmb = rmb;\n // cur_usd = usd;\n\n });\n}", "title": "" }, { "docid": "0f66f6862660f4e705d751e1c0c9f589", "score": "0.5758054", "text": "function poll(){\n var url = STATUS_URL + '?pathname=' + currentPage;\n // console.log( \"REQUESTING STATUS\" );\n getJson( url ).then( function( json ) {\n checkCurrent( currentPage, json.pathname );\n });\n // Re-poll\n setTimeout( poll, 1000 );\n }", "title": "" }, { "docid": "085db17d100090ef03e97fabafea289b", "score": "0.5755656", "text": "function changeBGAuto() {\n if (isRunning != true) {\n isRunning = true\n timerCount()\n setInterval(function() {\n changeBG();\n }, timeIntervalCustomValue)\n } else {\n isRunning = false\n location.reload()\n }\n}", "title": "" }, { "docid": "7337e02178b4fb668ba66e0892ed4f20", "score": "0.5754981", "text": "function _updateCurrentTab() {\n //Notice the current page refresh, reload luck star\n chrome.tabs.getSelected(null, function (tab) {\n // send a message to all the views (with \"*\" wildcard)\n _this.tell('current-page-refresh', {});\n });\n }", "title": "" }, { "docid": "76c11af944d0828b1c95679eb05e56b9", "score": "0.57493573", "text": "function snoozeUpdate() {\n var time = times[$(\"#snoozeDropdown\")[0].selectedIndex];\n chrome.runtime.sendMessage({signal: \"snoozeUpdate\", time: time});\n}", "title": "" }, { "docid": "4021be0891eade9382c5b47a8f3a355c", "score": "0.5738472", "text": "function update() {\n setTimeout(function() {\n getBus();\n update();\n }, 60000);\n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.5734873", "text": "function update() {\n\n}", "title": "" }, { "docid": "9f036af08e58571319f03d323d5bdeee", "score": "0.5734771", "text": "function refreshScript(){\n chrome.tabs.query({url: \"https://web.whatsapp.com/\"}, function(tabs) {\n if (tabs.length !== 0)\n tabs.forEach(function(tab){chrome.tabs.executeScript(tab.id, {file: '/load.js'})});\n });\n}", "title": "" }, { "docid": "a140c95f02dcf7d5bdb982c43f8d0fc7", "score": "0.5724777", "text": "liveUpdate() {\n const run = async () => {\n console.log(\"[*] LIVE CHECK\");\n this.logger.info(\"ping server\");\n try {\n const volume = {};\n const pairs = Object.keys(this.swapPairs);\n for (const pair of pairs) {\n const assets = pair.split(\"/\");\n volume[pair] = {\n [assets[0]]: this.swapPairs[pair][assets[0]].remainingVolume,\n [assets[1]]: this.swapPairs[pair][assets[1]].remainingVolume,\n };\n }\n const res = await fetch(config.tezex.server + config.tezex.route, {\n method: \"POST\",\n body: JSON.stringify({\n accounts: {\n ethereum: this.clients[\"ethereum\"].account,\n tezos: this.clients[\"tezos\"].account,\n },\n volume,\n }),\n headers: { \"Content-Type\": \"application/json\" },\n });\n if (!res.ok) throw new Error(\"Failed to ping server\\n\");\n } catch (err) {\n console.log(`\\n[x] LIVE CHECK ERROR : ${err.toString()}`);\n this.logger.error(`error pinging server`, err);\n }\n setTimeout(run, 60000);\n };\n run();\n }", "title": "" }, { "docid": "ac47500f6f0c7b020841b0c3f25f43aa", "score": "0.57224077", "text": "function onUpdate(framework) {}", "title": "" }, { "docid": "4a068fe4eeab8f06350adf3db886150b", "score": "0.572075", "text": "function update() {\n\t//check if we're allowed to\n\tif (cond()) {\n\t\t//find the current time \n\t\tTime();\n\t\t//calculate the time between next bell time and current\n\t\tlet found = nextBell();\n\t\t//find the difference (for the amount of time inbetween now and then)\n\t\tlet diff = sub(found);\n\t\t//output it to the time to the page\n\t\tdocument.getElementById('output').innerHTML = diff;\n\n\t\t//set the timeout in order to do this again in 100ms\n\t\tsetTimeout(update, 100);\n\n\t}\n}", "title": "" }, { "docid": "cd5242dd5e85e2b36351f8c933c5fd6b", "score": "0.5720428", "text": "function checkForUpdate() {\n chrome.runtime.requestUpdateCheck(status => {\n if (status === 'update_available') {\n // Delay reload for 10 seconds to prevent installing new versions to rapidly\n // There is a warning thrown when the extension reloads 5 times in under 10 seconds\n // [TODO] add logic to prevent reload if working on a run\n if (reloadTimeout) {\n clearTimeout(reloadTimeout);\n }\n reloadTimeout = setTimeout(() => {\n chrome.runtime.reload();\n }, 10000);\n }\n });\n}", "title": "" }, { "docid": "9303ed0ed3bb0b75efdc4202f33ea4cf", "score": "0.5719727", "text": "function gameStatusInterval()\t\n{ \n \tsetInterval(update, 1000/30.0); \n\t\n}", "title": "" }, { "docid": "e0d2252728c6bfbda77ea0f58540653d", "score": "0.57152224", "text": "function UpdateInformation(){\n\n if (mDebug){\n console.log(\"background.js::UpdateInformation()\");\n }\n \n // Have we already found a tab playing music?\n if (mLastPlayingTabId != -1){\n // Check if the tab still exists\n DoesTabExist(mLastPlayingTabId, function(exists){\n if (exists){\n // Is it still playing music?\n var result = IsPlayingMusic(mLastPlayingTabId, mPlayerDetails, function(isPlaying){\n if (isPlaying){\n // Grab the different pieces from that tab, if we are displaying\n PopulateInformation(mLastPlayingTabId);\n }else{\n lookForPlayingTabHelper();\n }\n });\n\n if (!result){\n // Something seems weird. Let's look for a tab playing\n lookForPlayingTabHelper();\n }\n }else{\n // Need to look for a tab playing music\n lookForPlayingTabHelper();\n }\n });\n }else{\n lookForPlayingTabHelper();\n }\n}", "title": "" }, { "docid": "4296f9a395123cbfef007d9217a1e33a", "score": "0.5712169", "text": "function main(){\n//setting intreval to run infinetly\n setInterval(()=>{ getAPI()},1000)\n \n}", "title": "" }, { "docid": "dc6e052633863380e0cc621ab5ecf686", "score": "0.5708749", "text": "function gui_watchdog() {\n setInterval(gui_ping_watchdog, 2000);\n}", "title": "" }, { "docid": "dc6e052633863380e0cc621ab5ecf686", "score": "0.5708749", "text": "function gui_watchdog() {\n setInterval(gui_ping_watchdog, 2000);\n}", "title": "" }, { "docid": "934cb418d79a98b6a071e4e5f2103fb7", "score": "0.570815", "text": "function backgroundCheck() {\r\n const currentTime = new Date();\r\n if (Store.getProfiles() !== null) {\r\n if (isMidnight(currentTime)) {\r\n Store.resetDaily();\r\n window.location.reload();\r\n } else if (isNewWeek(currentTime) && isMidnight(currentTime)) {\r\n profiles.forEach((profile) => {\r\n profile.weekTime = 0;\r\n window.location.reload();\r\n });\r\n } else if (isNewMonth(currentTime) && isMidnight(currentTime)) {\r\n profiles.forEach((profile) => {\r\n profile.monthTime = 0;\r\n window.location.reload();\r\n });\r\n }\r\n }\r\n}", "title": "" }, { "docid": "2c2572da501a65c296882301cd2965a0", "score": "0.5704124", "text": "function update() {\n \n}", "title": "" }, { "docid": "2c2572da501a65c296882301cd2965a0", "score": "0.5704124", "text": "function update() {\n \n}", "title": "" }, { "docid": "2c2572da501a65c296882301cd2965a0", "score": "0.5704124", "text": "function update() {\n \n}", "title": "" }, { "docid": "9cfb4d32d1d1b9a30de963174dde2606", "score": "0.57039434", "text": "function refresh(callback) {\n pauseStream();\n callback();\n}", "title": "" }, { "docid": "ef12a812290449492379c63c8633fd98", "score": "0.5703226", "text": "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_77', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=77&version=2.1.0';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "title": "" }, { "docid": "f51825e9c2a0a0b91ca02d3b12c3d71b", "score": "0.570162", "text": "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_106', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=106&version=1.02';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "title": "" }, { "docid": "6f946aab910ab821789b3d4475d3cc75", "score": "0.5700327", "text": "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_65', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=65&version=0.1';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "title": "" }, { "docid": "ad1e6ae1680dd91f9ff0af8ac3a6b160", "score": "0.56982666", "text": "function toBackground() {\n \"use strict\";\n\n log('toBackground()');\n try {\n blackberry.app.requestBackground();\n } catch (err) {\n log('Error: ' + err);\n }\n}", "title": "" }, { "docid": "0bcc8dececa44824f4188465e1c98737", "score": "0.5695256", "text": "static observeForDVDChange() {\n\n // Let's check the DVD number each 5 seconds\n\n setInterval(() => {\n\n // If DVD changed....\n\n if (this.getCurrentDVD() != window.currentDVD) {\n\n // Let's change the DVD inside application\n\n this.changeDVD();\n\n }\n\n }, 5000)\n\n }", "title": "" }, { "docid": "748cacf31261dd53675bf6d336f65922", "score": "0.5691388", "text": "static showUpdateNotification() {\n\t\tlet lang = (new JsonStorage()).readPreference('language');\n\t\tlet textData = require(`${__dirname}/../../text/text_${lang}.js`);\n\t\t\n\t\tipcRenderer.on('showMessageBoxThen', (event, arg) => {\n\t\t\tif (arg.response === 0) {\n\t\t\t\trequire('electron').shell.openExternal(LATEST_RELEASE);\n\t\t\t}\n\t\t});\n\n\t\tipcRenderer.send('showMessageBox', {\n\t\t\ttype: 'info',\n\t\t\ttitle: textData['updateAvailable'],\n\t\t\tmessage: textData['updateMessage'],\n\t\t\tbuttons: [\n\t\t\t\ttextData['download'],\n\t\t\t\ttextData['later']\n\t\t\t],\n\t\t\tcancelId: 1\n\t\t});\n\t}", "title": "" } ]
662adffc35b93e99b4dab61bc4f5c2ff
Smart goto with a feedback loop. The allowOvershoot can be set to false if we want to stop exactly at the target. Otherwise, the tank may pass through the target due to momentum.
[ { "docid": "42e85953b120cb0da40d8f1f42e346f4", "score": "0.7018819", "text": "goto(target, desiredSpeed = 55, allowOvershoot = true, avoid = []) {\n if (!target) return null;\n let ownTank = this.ownTank\n if (!ownTank) return null;\n //\n // console.log(`${dbgVec(ownTank)} -> ${dbgVec(target)} @ SPEED ${ownTank.speed.toFixed(2)}`)\n\n let direction = diff(ownTank, target);\n let dist = l2(direction)\n let directionUnit = toUnit(direction)\n // if no overshoot allowed, use proportional controller, start slowing down at 10 grid away (500)\n let speedFactor = allowOvershoot ? 1 : Math.min(dist / 500, 1)\n let speed = speedFactor*desiredSpeed;\n let targetVelocity = toVec(speed*directionUnit.x, speed*directionUnit.y)\n let deltaVelocityRequest = toUnit(diff(velocity(ownTank), targetVelocity))\n const desiredAvoidDist = 550.;\n const penaltyFactor = 2.5;\n var penaltyVec = toVec(0., 0.);\n for (let obj of avoid) {\n let d = diff(obj, ownTank);\n let du = toUnit(d)\n let ds = l2(d);\n let penalty = Math.max(penaltyFactor*(desiredAvoidDist - ds) / desiredAvoidDist, 0.);\n if (penalty) {\n penaltyVec = toVec(penaltyVec.x + penalty*du.x, penaltyVec.y + penalty*du.y)\n }\n }\n deltaVelocityRequest = toVec(deltaVelocityRequest.x + penaltyVec.x, deltaVelocityRequest.y + penaltyVec.y)\n if (isNaN(deltaVelocityRequest.x) || isNaN(deltaVelocityRequest.y)) {\n // console.log(\"No position for target\")\n return null\n }\n // just select the direction that has the highest dot product with the delta velocity request\n let bestCosine = 0\n let bestDirection = null\n for (let direction of Object.keys(data.directionAccelerations)) {\n let cosine = dot(data.directionAccelerations[direction], deltaVelocityRequest)\n if (cosine > bestCosine) {\n bestCosine = cosine\n bestDirection = direction\n }\n }\n return {\n key: data.directionKeys[bestDirection],\n }\n }", "title": "" } ]
[ { "docid": "cd4559a9ffdaa42e014806351c9d29f0", "score": "0.6044488", "text": "function goToTarget(target) { // the function of motion in a given direction \n\n if (direction == \"LEFT\" && target < clonePos) {\n return console.log('WAIT');\n } else if (direction == \"RIGHT\" && target > clonePos) {\n return console.log('WAIT');\n } else if (direction == \"LEFT\" && target > clonePos) {\n return console.log('BLOCK');\n } else if (direction == \"RIGHT\" && target < clonePos) {\n return console.log('BLOCK');\n } else {\n return console.log('WAIT');\n }\n }", "title": "" }, { "docid": "b5a72b8ce8e4bf42887747f63f969c4b", "score": "0.5992698", "text": "function AttackRun(target : GameObject) {\n\tif(isTooClose(target.transform.position)) {\n\t\tisClearing = true;\n\t}\n\n\tif(isClearing) {\n\t\t\n\t\tLookAway(target);\n\t}\n\n}", "title": "" }, { "docid": "1200585e4770a27293c05b9509dfcdfa", "score": "0.5963687", "text": "targetAndAttack() {\n this.standingStill = true;\n this.attacking = true;\n if(this.cooldownCounter >= this.attackCooldown) {\n this.cooldownCounter = 0;\n this.createAttackBox();\n }\n this.cooldownCounter++;\n }", "title": "" }, { "docid": "54054832ea5038e99d99a709cef1eedb", "score": "0.5958642", "text": "function hitTarget()\n\t\t{\n\t\t\t// Score increases by 1\n\t\t\t// Target disappears / moves to new location\n\t\t\t// Hit sound plays\n\t\t\t// Hit effect plays / appears\n\t\t\t// Time interval that the target appears is shortened\n\t\t}", "title": "" }, { "docid": "b416d952dbe7e2c5a27a3b35c270ab14", "score": "0.58263725", "text": "hero_jump(pointer) {\n if (this.hero.getBounds().contains(pointer.x, pointer.y)) {\n this.shoot_weapon();\n } else {\n let is_standing = this.hero.body.blocked.down || this.hero.body.touching.down;\n if (is_standing) {\n // Hero can jump only on a platform, not in the air.\n // jumping up at speed rate 200 initially\n this.hero.body.velocity.y = -1 * 400;\n }\n }\n }", "title": "" }, { "docid": "05954adc5e17f14e4bc76949b7cd820b", "score": "0.5814755", "text": "function OneLoop(target) {\n\n DrinkPotion()\n\n Loot()\n\n Attack(target)\n\n Move(target)\n\n CheckTarget(target)\n\n Update()\n\n Refill()\n\n return;\n\n}", "title": "" }, { "docid": "5630777dc455bf68e65272e9eac29008", "score": "0.58013546", "text": "jumpToGoal() {\n this.update(0, 100 * DECAY_MILLISECONDS);\n }", "title": "" }, { "docid": "e0b4425ef2dc207ae8bcd38a6ab23a4c", "score": "0.5737668", "text": "function OnClick(){\n//\tif(ats == null && PlayerStatus.MainCharacter ){\n//\t\tats = PlayerStatus.MainCharacter.gameObject.GetComponent(Attack_simple);\n//\t}\n\tif(AllManage.SkillCLStatic.ASkill && ptime > 10 && !AllManage.SkillCLStatic.ASkill.busy){\n\t\tptime -= 10;\n//\t\tcanDu = true;\n\t\tAllManage.SkillCLStatic.jump();\n//\t\tSkillCoolDown(ats.JumpCD);\n\t}\n}", "title": "" }, { "docid": "899909b65cc388ddbd9d768a769f1e35", "score": "0.568419", "text": "figureOutWhereToGo() {\n this.canSeePC();\n if(this.targetAquired) {\n ml.logger.debug(`Monster ${this.id} targeting player at (${this.targetx}, ${this.targety})`, ml.tags.monster);\n }\n if(this.alive) {\n if(!this.targetAquired && !this.collision) {\n if(this.targetx === -1 || this.targety === -1) {\n this.targetx = this.x;\n this.targety = this.y;\n }\n if(Math.abs(this.x - this.targetx) < 2 && Math.abs(this.y - this.targety) < 2) {\n this.wander();\n }\n ml.logger.debug(`Monster ${this.id} wandering to (${this.targetx}, ${this.targety})`, ml.tags.monster);\n }\n }\n }", "title": "" }, { "docid": "2ee1547491bceae2774be1049bb23a31", "score": "0.5680677", "text": "function play(whosturn){\n checkWinner();\n if(winner != \"\"){\n console.log(winner)\n return\n }\n let i=0;\n \n \n\n // checkWinner()\n // console.log(winner)\n\n \n if(whosturn>0){\n $hitLocation.on('click',\"*\", attackComputer)\n \n }else \n if(whosturn<0) {\n \n attackHuman();\n console.log(boostSelected)\n \n }\n \n // if(turn>0){\n // $hitLocation.on('click',\"*\", attackComputer)\n // }\n // else {\n // attackHuman();\n // }\n\n}", "title": "" }, { "docid": "17cbe357b6cb13fb10704b4f2bbee672", "score": "0.5583244", "text": "jump() {\n\t\tconst onGround = this.sprite.body.blocked.down;\n\t\tif (onGround) {\n\t\t\tthis.scene.physics.moveTo(this.sprite, this.sprite.x - (500 * this.direction), this.sprite.y - 500, 100, 1000);\n\t\t}\n\t}", "title": "" }, { "docid": "5ab9c4e37ca827ad392d0d892f313a09", "score": "0.557523", "text": "function playDanceMove(danceMove){\n\n switch (danceMove){\n\n case \"simplewaltz\":\n //Misty moved in a square pattern, back and forth\n //TODO: Could add random small turns to the basic square\n misty.Debug(\"Misty does a simple waltz dance!\");\n \n misty.MoveHead(0, 0, 0, 90, 50, 50); //Move head looking straight\n misty.Pause(1000);\n\n misty.ChangeLED(100,70,160,0,100); //Change to default Misty purple\n misty.DisplayImage(\"e_SystemBlinkStandard.jpg\"); //Misty close eyes\n\n misty.MoveHead(-15, 0, 0, 90, 50, 1000); //Move head looking up more than normal\n \n //Move Arms like getting into ready position\n //misty.MoveArm(string arm (\"left\", right, both), position, velocity, duration, [int prePauseMs], [int postPauseMs]); \n misty.MoveArm(\"both\", 45, 60, 0, 50, 500); //Move arm to normal 45 degree hang position to start\n misty.MoveArm(\"both\", 15, 45, 0, 50, 50); //arm move to indicate start step\n misty.MoveArm(\"both\", 45, 60, 0, 50, 500); //Move arm to normal 45 degree hang position to start\n\n for (var i = 1; i <= 3; i=i+1){\n \n waltzDrive(\"reverse\");\n misty.MoveArm(\"both\", 15, 45, 0, 50, 500); //move arms a bit\n misty.Pause(300);\n misty.MoveArm(\"both\", 25, 45, 0, 50, 500); //move arms a bit\n waltzDrive(\"forward\");\n misty.Pause(300);\n \n }//End for\n \n break //End simplewaltz\n\n case \"groovy\":\n\n //TODO: Change Misty LED to slowly pulse - perhaps eventually with sound of music\n misty.ChangeLED(100,70,160,0,100);\n //Change Display to closed eyes - like grooving\n misty.DisplayImage(\"e_SystemBlinkStandard.jpg\"); \n\n misty.MoveArm(\"both\", 45, 60, 0, 50, 1000); //Move arm to normal 45 degree hang position to start\n misty.MoveHead(-10, 0, 0, 50, 50, 50); //Move head - to default start position\n let groovyPause = 1000;\n\n\n //move head slowly back and forth pattern and arms waving\n for (var i = 1; i <= 3; i=i+1){\n \n misty.MoveHead(10, 35, -10, 60, 50, 50); //Move head - groovy position 1 \n misty.MoveArm(\"right\", 15, 60, 0, 50, 50); \n misty.MoveArm(\"left\", 25, 60, 0, 50, 50); \n misty.DriveTime(5,5,1000); //Drive forward a little\n misty.Pause(groovyPause);\n\n misty.MoveHead(14, -27, -10, 50, 50, 50); //Move head - groovy position 2\n misty.MoveArm(\"right\", 45, 30, 0, 50, 50); \n misty.MoveArm(\"left\", 35, 30, 0, 50, 50); \n misty.DriveTime(-5,-5,1000);\n misty.Pause(groovyPause);\n \n misty.MoveHead(-13, -32, -2, 50, 50, 50); //Move head - groovy position 3\n misty.MoveArm(\"right\", 35, 30, 0, 50, 50); \n misty.MoveArm(\"left\", 15, 30, 0, 50, 50); \n misty.DriveTime(10,10,1000);\n misty.Pause(groovyPause);\n \n misty.MoveHead(-15, 35, -13, 50, 50, 50); //Move head - groovy position 4 \n misty.MoveArm(\"right\", 0, 30, 0, 50, 50); \n misty.MoveArm(\"left\", 0, 30, 0, 50, 50); \n misty.DriveTime(5,5,1000);\n misty.Pause(groovyPause);\n\n } //End For\n\n\n break //End Groovy\n\n case \"headbang\":\n //Misty nod YES vigourously back and forth - if only Misty had hair!\n\n misty.Pause(3000);\n misty.DisplayImage(\"e_DefaultContent.jpg\");\n misty.Pause(3000);\n misty.ChangeLED(100,70,160,0,100); //Change to default Misty purple\n misty.Pause(3000);\n\n misty.ChangeLED(250,0,0); //Change LED to RED\n misty.MoveArm(\"both\", 45, 60, 0, 50, 1000); //Move arm to normal 45 degree hang position to start\n misty.MoveHead(-10, 0, 0, 50, 50, 50); //Move head - to default start position \n \n let headbangPause = 1000;\n\n //These are closest eyes - closed with tears for straining\n misty.Pause(2000);\n misty.DisplayImage(\"e_EcstacyHilarious.jpg\"); \n misty.Pause(2000);\n\n //move head up and down 20 times - increase this if want Misty to headbang longer\n for (var i = 1; i <= 20; i=i+1){ \n \n misty.MoveHead(-20, 0, 0, 80, 10, 10); //Move head up\n misty.MoveArm(\"both\", 0, 40, 0, 50, 50); \n misty.Pause(headbangPause);\n \n misty.MoveHead(20, 0, 0, 80, 10, 10); //Move head down\n misty.MoveArm(\"both\", 45, 40, 0, 50, 50); \n misty.Pause(headbangPause);\n \n } //End For\n \n misty.MoveHead(0, 0, 0, 90); //Head at zero position\n misty.Pause(500); //Pause half a second\n\n misty.MoveArms(45, 45, 90, 90); //arms hanging down at side 45 degrees\n\n break //End Headbang\n\n case \"moonwalk\":\n\n //Moon walk does not work exactly right. In development\n misty.Debug(\"Misty does the moonwalk\");\n misty.DisplayImage(\"e_DefaultContent.jpg\");\n misty.MoveArm(\"both\", 0, 60, 0, 50, 500); \n\n //moonwalkDrive is another take on the squareDrive function\n moonwalkDrive();\n\n\n break; //End Moonwalk\n\n\n case \"YourDanceHERE\":\n misty.Debug(\"Have a dance idea - add it here\");\n break; //End YourDanceHere\n \n\n } //End switch case Dance move\n\n}//End playDanceMove function ", "title": "" }, { "docid": "3ed77b6d31698e9e0904395fe618f941", "score": "0.5567114", "text": "if (m_dtDestination == DT_PLAYERSPOTTED)\n\t\t\t\t\t\t{ // if you see the target\n\t\t\t\t\t\t\t//if (IsVisible(m_penEnemy))\n\t\t\t\t\t\t\tif (IsVisible(GetTargetEntity(m_wPetState)))\n\t\t\t\t\t\t\t{\t// switch to following player\n\t\t\t\t\t\t\t\tm_dtDestination = DT_PLAYERCURRENT;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// if you don't see him\n\t\t\t\t\t\t\t// if using pathfinding\n\t\t\t\t\t\t}", "title": "" }, { "docid": "aa41a1c48dffca84ef78ff00a607dee1", "score": "0.5538575", "text": "function _jump()\n\t{\n\t\t// If player is not jumping\n\t\tif (!isJumping)\n\t\t{\n\t\t\t// Jump\n\t\t\tisJumping = true;\n\t\t\tthis.view.gotoAndPlay(\"jump\");\n\t\t\tsetTimeout(function(){\n\t\t\t\tisJumping = false;\n\t\t\t}, jumpPeriod);\n\t\t}\n\t}", "title": "" }, { "docid": "496ce1c50f5b70085aaa61f8b3065cb8", "score": "0.5531791", "text": "if (CalcDist(GetTargetEntity(m_wPetState)) < GetProp(m_fAttackDistance) && CanAttackEnemy(GetTargetEntity(m_wPetState), Cos(AngleDeg(45.0f))))\n\t\t{\n\t\t\t// make fuss\n\t\t\t// AddToFuss();\n\t\t\t// stop moving (rotation and translation)\n\t\t\tStopMoving();\n\t\t\t// set next shoot time\n\t\t\t//if (CalcDist(m_penEnemy) < GetProp(m_fCloseDistance)) {\n\t\t\tif (CalcDist(GetTargetEntity(m_wPetState)) < GetProp(m_fCloseDistance)) {\n\t\t\t\tm_fShootTime = _pTimer->CurrentTick() + GetProp(m_fCloseFireTime) * (1.0f + FRnd()/3.0f);\n\t\t\t} else {\n\t\t\t\tm_fShootTime = _pTimer->CurrentTick() + GetProp(m_fAttackFireTime) * (1.0f + FRnd()/3.0f);\n\t\t\t}\n\n\t\t\tm_bAIStart = TRUE;\n\t\t\t// fire\n\t\t\tautocall Hit() EReturn;\n\t\t}", "title": "" }, { "docid": "711d00a17d217cced241eed8fd096f22", "score": "0.5526315", "text": "playJump() {\n if (!this.saltando && this.sonidoAct) {\n this.saltar.play();\n this.flotar.play();\n this.saltando = true;\n }\n }", "title": "" }, { "docid": "c210afa3503d598f5ed48a49aad09344", "score": "0.5522819", "text": "playerJump()\n {\n if (keyboardSpace) {\n \n if(onGround)\n {\n for(var i=0;i<500;i++)\n {\n grant.y = grant.y - 0.5;\n }\n //grant.y = grant.y - 355;\n onGround = false;\n doubleJump = true;\n }\n else if(doubleJump)\n {\n //grant.y = grant.y - 355;\n for(var i=0;i<500;i++)\n {\n grant.y = grant.y - 0.5;\n }\n doubleJump = false;\n }\n \n }\n }", "title": "" }, { "docid": "75c50b1e02fb9db04f5a76909d94ccc2", "score": "0.5484217", "text": "function jump(obj) {\n\t\tconsole.log (\"runnng jump function\");\n\t\t\t// gives a true or false statement\n\t\t\tonTheGround = hero_animated_sprint.body.touching.down;\n\n\t\t\tif (onTheGround) {\n \t\t// Jump when the player is touching the ground and the up arrow is pressed\n\n\t\t\t\tBasicGame.jump_sound = this.game.add.audio('jump').play('', 0, 0.1);\n\t\t\t\tconsole.log(\"inside if statement\");\n \t\t\thero_animated_sprint.body.velocity.y = -600;\n\t\t\t\thero_animated_sprint.body.velocity.x += 25;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "7aea94192f01a91bf028f6bb82e94e28", "score": "0.54830456", "text": "tackled() {\n\t\tthis.player.addBlink();\n\t\t//Determine if the player was sacked\n\t\tif(this.player.canPass) this.stopPlay(Enums.playEndedBy.sack);\n\t\telse this.stopPlay(Enums.playEndedBy.tackle);\n\t}", "title": "" }, { "docid": "70d290b1f9c5964c2e17929c0ca4221f", "score": "0.54797333", "text": "function actOnTarget(target, action) {\n\t\tvar watchedTarget = getWatchedTarget(target, action);\n\t\tif(watchedTarget) {\n\t\t\twatchedTarget.takeAction = true;\n\t\t\tif(watchedTarget.isNeglected()) {\n\t\t\t\twatchedTarget.executeNeglectedAction();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "da1a6089cb1070f9071f1538d5086137", "score": "0.54746836", "text": "function playSolution() {\n if (machineState) {\n var ping = pingButton(0);\n }\n setTimeout(function() {\n playerTurn = true;\n }, 2000 + count * 800);\n }", "title": "" }, { "docid": "611d0ff1770777ba8e811a94b2d6e4fe", "score": "0.5468721", "text": "jump(v) {\n this.updateAndNotify(v);\n this.prev = v;\n this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }", "title": "" }, { "docid": "6bb620ed9494dd35eaed0e03055d1f80", "score": "0.5462214", "text": "jump() {\n if (this.altitude > 0) return\n this.goUp()\n }", "title": "" }, { "docid": "9a5e9566fc5cd7c7f40fc287749a98b5", "score": "0.5459395", "text": "function jump() {\n if (isJumping == false) {\n yVel = -15;\n\t\that_yVel = -15;\n isJumping = true;\n\t\tjumpTargetLocked = false;\n\t\tisFalling = false;\n\t\tlanded = false;\n }\n}", "title": "" }, { "docid": "e03f7d89ebd51cc6d5e956e343783cab", "score": "0.5455253", "text": "function makeJump() {\n if (jumpTime > 10) {\n clearInterval(jumpTimer);\n jumpTimer = null;\n jumpTime = 0;\n if (!endGame) {\n setTimeout(jump, 10);\n }\n } else {\n let diff = Math.pow(jumpTime - 5, 2) * 6;\n if (jumpTime < 5) {\n top -= diff;\n } else if (jumpTime > 5) {\n top += diff;\n }\n $(\"blue\").style.top = top + \"px\";\n jumpTime++;\n } \n }", "title": "" }, { "docid": "d4e64e341875710d0f76c28e677e8ac6", "score": "0.54505104", "text": "function C009_Library_Yuki_TestPullAway() {\n\tif ((ActorGetValue(ActorSubmission) <= -5) || ((ActorGetValue(ActorSubmission) <= 0) && (ActorHasInventory(\"VibratingEgg\")))) {\n\t\tOverridenIntroText = GetText(\"ForceEat\");\n\t\tC009_Library_Yuki_CurrentStage = 710;\n\t} else C009_Library_Yuki_NoPleasure();\n}", "title": "" }, { "docid": "7fe65b99f4ab0cab7d4daf42a8bbb30b", "score": "0.5438388", "text": "stepOver(delay = this.delay) {\n return __awaiter(this, void 0, void 0, function* () {\n let top = this.simulation.top();\n if (!top) {\n return;\n }\n // if (top instanceof RuntimeFunctionCall) {\n while (!top.isDone) {\n yield this.takeOneAction(Simulation_1.STEP_FORWARD_ACTION, delay);\n }\n // }\n // else {\n // await this.stepForward();\n // }\n });\n }", "title": "" }, { "docid": "1ae257c9056bdd060436b54333b6f46b", "score": "0.5436436", "text": "step() {\n const humanPlayer = this.stage.getHumanPlayer();\n if (humanPlayer) {\n // console.log(humanPlayer);\n if (humanPlayer.playerHP > 0) {\n let distanceFromPlayer = distanceBetweenTwoPoints(this.position.x, this.position.y, humanPlayer.playerPositionX, humanPlayer.playerPositionY);\n \n // The bot has low HP or has run out of bullets, it will run from the player if player is close enough\n if (this.weapon.getRemainingBullets() <= 0) {\n // If close enough, run directly away from player\n if (distanceFromPlayer < humanPlayerRadius * 20) {\n // Distance between bot and player\n let xDistance = (this.position.x - humanPlayer.playerPositionX) * 4;\n let yDistance = (this.position.y - humanPlayer.playerPositionY) * 4;\n\n // Used as \"tolerance\" to prevent indefinite alternating between positions due to precision\n if (xDistance < this.movementSpeed && xDistance > 0 - this.movementSpeed) { xDistance = 0; }\n if (yDistance < this.movementSpeed && yDistance > 0 - this.movementSpeed) { yDistance = 0; }\n\n // Determines direction to move in\n if (xDistance > 0) { this.dx = 1; }\n if (xDistance < 0) { this.dx = -1; }\n if (yDistance > 0) { this.dy = 1; }\n if (yDistance < 0) { this.dy = -1; }\n } \n // Move in random directions TODO: consolidate this with random moving method below\n else if (new Date().getTime() - this.previousMoveTime >= randInt(maxMoveDelay)) {\n maxMoveDelay = 50000;\n this.faceRandomDirection();\n this.dx = this.cursorDirection.x;\n this.dy = this.cursorDirection.y;\n this.setVelocity();\n this.previousMoveTime = new Date().getTime();\n }\n this.setVelocity();\n }\n // If Player isn't hidden and within detection range, bot will try facing them and chasing after them while shooting them\n // If Player is hidden, but bot is still close enough, the bot will \"see\" the player and shoot them (eg. when bots wander into bushes)\n else if ((!humanPlayer.isHidden && distanceFromPlayer < EngineProperties.BotAbilities[this.difficulty].detectionRange) || distanceFromPlayer < humanPlayerRadius * 2) {\n this.facePlayer(humanPlayer);\n this.dx = 0;\n this.dy = 0;\n\n // Distance between bot and player\n let xDistance = this.position.x - humanPlayer.playerPositionX;\n let yDistance = this.position.y - humanPlayer.playerPositionY;\n \n // Move towards the player. There is a minimum distance bots will keep from players\n if (distanceFromPlayer > humanPlayerRadius * 5 && this.HP > this.maxHP / 3) {\n // Used as \"tolerance\" to prevent indefinite alternating between positions due to precision\n if (xDistance < this.movementSpeed && xDistance > 0 - this.movementSpeed) { xDistance = 0; }\n if (yDistance < this.movementSpeed && yDistance > 0 - this.movementSpeed) { yDistance = 0; }\n \n // Determines direction to move in\n if (xDistance < 0) { this.dx = 1; }\n if (xDistance > 0) { this.dx = -1; }\n if (yDistance < 0) { this.dy = 1; }\n if (yDistance > 0) { this.dy = -1; }\n } \n // If bot is running low on HP, run away from player\n else if (this.HP <= this.maxHP / 3) {\n // Used as \"tolerance\" to prevent indefinite alternating between positions due to precision\n if (xDistance < this.movementSpeed && xDistance > 0 - this.movementSpeed) { xDistance = 0; }\n if (yDistance < this.movementSpeed && yDistance > 0 - this.movementSpeed) { yDistance = 0; }\n \n // Determines direction to move in\n if (xDistance > 0) { this.dx = 1; }\n if (xDistance < 0) { this.dx = -1; }\n if (yDistance > 0) { this.dy = 1; }\n if (yDistance < 0) { this.dy = -1; }\n } \n // Move away from player if they are too close\n // else {\n // // Determines direction to move in\n // if (xDistance > 0) { this.dx = 1; }\n // if (xDistance < 0) { this.dx = -1; }\n // if (yDistance > 0) { this.dy = 1; }\n // if (yDistance < 0) { this.dy = -1; }\n // }\n \n this.setVelocity();\n maxMoveDelay = 100000;\n \n // The bot is \"warming up\" and cannot shoot the player yet\n if (new Date().getTime() - this.playerSightTime2 < playerSightTimeWait) {\n this.playerSightTime = new Date().getTime();\n }\n // The bot has finished \"warming up\" -- shoot player if they are close enough to the weapon range, AND the bot has locked sights with them for enough time\n else if (distanceFromPlayer <= this.weapon.range && new Date().getTime() - this.playerSightTime < playerSightTimeMin) {\n this.shootPlayer(humanPlayer);\n this.playerSightTime = new Date().getTime();\n }\n // The bot has just \"refound\" the player -- start \"warming up\"\n else if (new Date().getTime() - this.playerSightTime > playerSightTimeMin) {\n this.playerSightTime = new Date().getTime();\n this.playerSightTime2 = new Date().getTime();\n }\n } \n // Player is hidden (in a bush), bot will choose a random direction to move in\n else if (new Date().getTime() - this.previousMoveTime >= randInt(maxMoveDelay)) {\n maxMoveDelay = 50000;\n this.faceRandomDirection();\n this.dx = this.cursorDirection.x;\n this.dy = this.cursorDirection.y;\n this.setVelocity();\n this.previousMoveTime = new Date().getTime();\n }\n \n // Check if where we are proposing to move will cause a collision\n let destinationX = this.position.x + this.velocity.x;\n let destinationY = this.position.y + this.velocity.y;\n let crateCollision = CollisionEngine.checkPlayerToCrateCollision(destinationX, destinationY, this.stage.getCrateActors(), this.radius);\n \n \n // Handle collision with human player and other bots\n // let collidesPlayer = CollisionEngine.checkPlayerToPlayerCollision(destinationX, destinationY, this, this.stage.getPlayerActors(), this.radius);\n // if (collidesPlayer) {\n // console.log(\"bot collides with player or another bot\");\n // destinationX = this.position.x - this.velocity.x;\n // \t destinationY = this.position.y - this.velocity.y;\n // } \n \n // Handle crate collision -- move bot away from colliding side\n if (crateCollision) { \n if (crateCollision.side === \"crateTop\") {\n destinationY = crateCollision.y - this.radius;\n } else if (crateCollision.side === \"crateBottom\") {\n destinationY = crateCollision.y + this.radius + 1;\n } else if (crateCollision.side === \"crateLeft\") {\n destinationX = crateCollision.x - this.radius;\n } else if (crateCollision.side === \"crateRight\") {\n destinationX = crateCollision.x + this.radius;\n }\n this.previousMoveTime = 0;\n }\n \n // Handle collision against world border\n if (CollisionEngine.checkPlayerToBorderCollision(this.radius, this.position.x + this.velocity.x, this.position.y + this.velocity.y, this.stage.stageWidth, this.stage.stageHeight)) {\n destinationX = this.position.x + this.velocity.x;\n destinationY = this.position.y + this.velocity.y;\n \n // Check which border we hit\n if (destinationX < 0 + this.radius) {\n destinationX = this.radius; // Hit left border\n }\n if (destinationX > this.stage.stageWidth - this.radius) {\n destinationX = this.stage.stageWidth - this.radius; // Hit right border\n }\n if (destinationY < 0 + this.radius) {\n destinationY = this.radius; // Hit top border\n }\n if (destinationY > this.stage.stageHeight - this.radius) {\n destinationY = this.stage.stageHeight - this.radius; // Hit bottom border\n }\n this.previousMoveTime = 0;\n }\n \n // Update the player's location\n this.position.x = destinationX;\n this.position.y = destinationY;\n this.setPlayerPosition();\n }\n }\n\t}", "title": "" }, { "docid": "70796e92c9a72182c137947c27f4601a", "score": "0.54336506", "text": "function Heros_Play(target, launcher, ability) {\n if(target === undefined) {\n right_page(ability, launcher);\n }\n\t\telse {\n\t\t\tlet message = checking(ability, launcher, a);\n if(message === undefined) {\n\t\t\t\tlauncher.PA = launcher.PA - ability.pa;\n\t\t\t\tfor(let i = 0; i < target.length; i++) {\n let x = randomNumber();\n sort_name(launcher, ability, know_target(launcher, ability, target, i), i, x);\n check_pv(know_target(launcher, ability, target, i));\n }\n }\n else{\n [page, marqueurs] = fonctions.f_marqueurs(l, v, liste_Niveau, fs, marqueurs, message, grd_Tour);\n }\n right_page(ability, launcher, message, grd_Tour);\n }\n bonus_damage = undefined;\n }", "title": "" }, { "docid": "d88c58ac498e0786a39a31147b6308c4", "score": "0.5409479", "text": "function trigger_sound_hit_water() {\n sound_hit_water.pause();\n sound_hit_water.currentTime = 0;\n sound_hit_water.play();\n}", "title": "" }, { "docid": "b59a78e8c85a1c518a60d98fb1eddb61", "score": "0.5387023", "text": "checkHitState(index) {\n\n // Check if current index of the pressed item corresponds to the actual target index\n if (index === this.getCorrectIndex()) {\n\n sounds[gameSound.CATCH].play();\n\n } else {\n sounds[gameSound.FAIL].play();\n }\n\n\n super.ball.state = 'hit target';\n }", "title": "" }, { "docid": "a19f95bea70cd827ea0025c2c0197040", "score": "0.5386757", "text": "function heavyAtk(){\n\n // console.log('heavy attack thrown')\n // var heavyAtkMiss = Math.floor((Math.random) * 35);\n\n // if (heavyAtkMiss >= 35){\n var hvyDamage = Math.floor(Math.random() * 40);\n\n\n // $('#status_text').text('you missed!');\n // }else{\n enemyHealthAfterMove = (enemyHealthAtLoad - hvyDamage);\n enemyHealthAtLoad = enemyHealthAfterMove;\n\n $('#status_text').text('Attack does ' + hvyDamage + ' damage. ');\n $('#baddie_health').text('Health: ' + enemyHealthAtLoad);\n\n isGameOver();\n\n setTimeout(enemyAttack, 3000);\n $('.button').toggle(\"fold\");\n }", "title": "" }, { "docid": "8d4526d2facf812bfaedbcab189c089a", "score": "0.53785086", "text": "function jump() {\n $pet\n .velocity({ top: `${movementY -= 15}px` }, { duration: 200, delay: 380 })\n .velocity({ top: `${movementY += 15}px` }, { duration: 200, delay: 350 })\n .velocity({ top: `${movementY -= 15}px` }, { duration: 200, delay: 350 })\n .velocity({ top: `${movementY += 15}px` }, { duration: 200, delay: 350 })\n .velocity({ top: `${movementY -= 15}px` }, { duration: 200, delay: 350 })\n .velocity({ top: `${movementY += 15}px` }, { duration: 200, delay: 350 })\n}", "title": "" }, { "docid": "a7689fea90cd2c6f9e4bc5ebb715b7ec", "score": "0.5362684", "text": "playerAttack() {\n // Si le cible est dans la posture défensif\n if (this.target.player.defense === true) {\n // alors les dégats de son arme sont divisé par 2\n this.target.player.health -= this.attacker.player.weapon.damage / 2;\n this.target.player.defense = false;\n\n this.checkHealth()\n\n this.ui.interfacePlayer.setPlayerHealth(this.target)\n this.ui.interfaceBattle.setBannerPlayerDamageWithDefense(this.attacker, this.target)\n } else {\n // sinon l'attaquant attaque avec 100% des dégats de son arme\n this.target.player.health -= this.attacker.player.weapon.damage;\n\n this.checkHealth()\n\n this.ui.interfacePlayer.setPlayerHealth(this.target)\n this.ui.interfaceBattle.setBannerPlayerDamage(this.attacker, this.target)\n }\n setTimeout(() => this.checkVictory(), 1500)\n }", "title": "" }, { "docid": "ff8922751fe50c946c8f70fd68c65d9c", "score": "0.5353108", "text": "AtTarget() {\n return ( Vector2D.Vec2DDistanceSq( this.Pos(), this.Steering().Target() ) < Prm.PlayerInTargetRangeSq);\n }", "title": "" }, { "docid": "7df9af12e5cb61b129ee8a0f04151d9c", "score": "0.5349698", "text": "function attackSequence(letter) {\r\n\t\t\t// if no target yet, seek for target\r\n\t\t\tif (_player.target == -1) {\r\n\t\t\t\tseekTarget(letter);\r\n\t\t\t}\r\n\r\n\t\t\t// attack the enemy\r\n\t\t\tdoAttack(letter);\r\n\t\t}", "title": "" }, { "docid": "0706f94107ba0941132f041b3260ecfc", "score": "0.5344905", "text": "attack() {\n if (checkIfHit(this) === true) {\n currentTarget.hull -= ussNova.firepower;\n if (currentTarget.hull <= 0) {\n currentTarget.hull = 0;\n console.log(\n `Direct hit on ${currentTarget.pilot}! Their hull has ${currentTarget.hull} hit-points remaining and has been destroyed!`\n );\n } else if (currentTarget.hull > 0) {\n console.log(\n `Direct hit on ${currentTarget.pilot}! Their hull has ${currentTarget.hull} hit-points remaining!`\n );\n }\n } else {\n console.log(`Our lasers barely missed!`);\n }\n }", "title": "" }, { "docid": "fcbc238e90d56c88c2ecc63dbfd3f938", "score": "0.53448737", "text": "function Move(target) {\n\n if (!target) {\n\n if (attack_target_off!=null){\n // Go to Friend\n MoveTo(attack_target_off)\n return;\n }\n // Just Move Around\n MoveAround()\n return;\n }\n\n if(!in_attack_range(target)) {\n // Get Closer to it\n MoveTowards(target)\n return;\n }\n\n return;\n}", "title": "" }, { "docid": "c601ef1031d0240ad97991a1aac54db6", "score": "0.53297913", "text": "set isJumping(value) {\n this._isJumping = value;\n }", "title": "" }, { "docid": "8b064efaf72a703f26725d51f055a6b2", "score": "0.5329079", "text": "function impendingThreat() {\n console.log(\n \"There are only two choices. Draw First blood, or.. try to make a break for it and hope that it cant fly.\"\n );\n let options = readline.keyIn(\n `\\n\\t\\n[1] Struggle and Fight the Demon \\t[2] Run\\n\\n`, {\n limit: `$<1-2>`\n }\n );\n if (options == 1) {\n demonSpawn();\n console.log(\n `\\nYou lunge toward the Demon for a preemptive strike! Hyahhhh!!!!`\n );\n } else if (options == 2) {\n let chanceToFlee = Math.random();\n if (chanceToFlee >= 0.5) {\n console.log(\n \"You kick in a sewer grate that is nearby, and escape down the tunnel.\"\n );\n goBerserk();\n } else if (chanceToFlee <= 0.5) {\n console.log(\"\\nTrying to flee??? Weakling!\");\n demonSpawn();\n }\n }\n}", "title": "" }, { "docid": "e3fdf5f1ccc087f9ef32de4a8770bac8", "score": "0.5323851", "text": "changeAttackMode() {\n this.hittable = false;\n this.animation1.stop();\n clearInterval(this.shootInterval);\n this.scene.tweens.add({\n targets: this,\n x: window.innerWidth / 2,\n y: window.innerHeight / 2,\n duration: 2000,\n ease: function (t) {\n return Math.pow(t, 1 / 2);\n },\n onComplete: () => {\n this.shoot(2, true, true);\n this.shoot(2, true, true, false);\n this.shoot(24, true);\n this.hittable = true;\n setTimeout(() => {\n this.generateBoss2ndMovement();\n this.animation2.loop = -1;\n this.animation2.loopDelay = 1000;\n this.animation2.play();\n }, 5000);\n }\n });\n\n }", "title": "" }, { "docid": "7b156964a15bf8363056125680dfd73c", "score": "0.5318782", "text": "function bgAttack() {\r\n if (ggPoints - attackPoints <= 0) { // Ensure the score doesn't go below 0. If it does, game over!\r\n ggPtsDoc.innerHTML = `HP: 0`;\r\n gameOver(ggPoints, bgPoints);\r\n } else {\r\n var audio = new Audio('snd/laser.mp3');\r\n audio.play();\r\n ggPoints -= attackPoints;\r\n hit('gg');\r\n }\r\n}", "title": "" }, { "docid": "3552b261488e94b09bff785d76f4213d", "score": "0.5318325", "text": "function resetB() {\n document.getElementById(\"feedback\").textContent=\"You have \" + 7 + \" targets left.\";\n count = 7;\n hitTargets = [false, false, false, false, false, false, false];\n mode = false;\n makeTargetsAndBuffer();\n}", "title": "" }, { "docid": "2248f8ec1fad01aa87bfe22c2db3228f", "score": "0.53138155", "text": "function gotoAnt(speed, end_x, end_y) {\n\tvar speed = speed;\n\tvar x = end_x;\n\tvar y = end_y;\n\t\n\treturn function(dt) {\n\t\tif (this.ant.state != ALIVE) {\n\t\t\tthis.complete = true;\n\t\t\treturn;\n\t\t}\n\t\t//Are we there yet...\n\t\tvar d = (x - this.ant.x)^2 + (y - this.ant.y)^2;\n\t\tvar rd = sqrt(d);\n\t\tif (d < 1) {\n\t\t\tthis.complete = true;\n\t\t} else {\n\t\t\t//Make sure we are on target\n\t\t\tthis.ant.setDirectionXY((x-this.ant.x)/rd, (y-this.ant.y)/rd);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "42a8162f5e905b46aea6f6cabc278688", "score": "0.5313094", "text": "jump(){\n if(this.player.body.touching.down || (this.playerJumps > 0 && this.playerJumps < gameOptions.jumps)){\n if(this.player.body.touching.down){\n this.playerJumps = 0;\n }\n this.player.setVelocityY(gameOptions.jumpForce * -1);\n this.playerJumps ++;\n }\n }", "title": "" }, { "docid": "5f2347e124b2ee9265a2fe05877a234f", "score": "0.5307578", "text": "stepOver() {\n let top = this.simulation.top();\n if (top instanceof PotentialFullExpression_1.FunctionCall) {\n while (!top.isDone) {\n this.simulation.stepForward();\n }\n }\n else {\n this.stepForward(1);\n }\n }", "title": "" }, { "docid": "7765df60278b0d7411a6605d42b97b60", "score": "0.53031766", "text": "control_jump(){\n\t\tvar power = 15; // sets max power cap \n\t\tthis.jumpPow = (this.jumpPow * 1.95 + power * 0.05) / 2; //caps out at `power`\n\t\tif(this.jumpPow > power)\n\t\t\tthis.jumpPow = power;\n\t}", "title": "" }, { "docid": "ce1698f793399580a97a7b10dda74d82", "score": "0.5300276", "text": "jumpCollision() {\n this.scrollSpeed = 0;\n this.gameOver == true;\n // play sinking into longjump anim\n }", "title": "" }, { "docid": "e7c9824f6b23b93dc7cb8806d959dbd7", "score": "0.52994376", "text": "hit() {\n //Makes sure that small Mario can not break the brick\n if (player.powerUpState != \"smallMario\") {\n //Sets the block to be broken. The block will not be drawen or collide\n this.broken = true\n }\n }", "title": "" }, { "docid": "b605cece80b8191ce09b6f569686425a", "score": "0.52875584", "text": "function physicalAtk() {\n if (targeted && playerAlive) {\n //checks if correctly attacked weakness\n if (targetedObject.weakness === \"physical\") {\n targetedObject.damage(weaknessDamage);\n targetedObject.down = true;\n $(\"#dmgNum\").text(weaknessDamage);\n $(\"#enemyTarget\").text(targeted);\n $(\"#\" + targeted + \"HP\").text(targetedObject.hp);\n $(\"#\" + targeted).html(\"<img src='assets/images/Dead.png'></img>\");\n if (targetedObject.hp <= 0) {\n enemyKill();\n }\n } else {\n // damage if you didn't hit their weakness\n targetedObject.damage(defaultPlayerDamage);\n $(\"#dmgNum\").text(defaultPlayerDamage);\n $(\"#enemyTarget\").text(targeted);\n $(\"#\" + targeted + \"HP\").text(targetedObject.hp);\n if (targetedObject.hp <= 0) {\n enemyKill();\n }\n }\n\n enemyAtk();\n }\n}", "title": "" }, { "docid": "9b419d09bfba66c6665b4a72c51c3792", "score": "0.52837294", "text": "function shoot() {\n if(!coolDownStatus) {\n coolDownStatus = 1;\n if(!local) {\n setBit(1, 0, 1);\n console.log('shoot');\n priorityWrite(charVal);\n setTimeout(function() {\n setBit(1,0,0);\n console.log('shoot off');\n priorityWrite(charVal);\n }, 50);\n }\n coolDown();\n }\n}", "title": "" }, { "docid": "e401a25c3c41ee02289b106550007b50", "score": "0.5281341", "text": "jump()\n {\n this.gravity=this.core.map.gravityMinValue;\n this.movement.y=this.jumpHeight;\n \n this.core.soundList.playJson(this.position,this.wakeUpSound);\n }", "title": "" }, { "docid": "7f22c2d9370f2798472e95f73d7b7d2f", "score": "0.52707934", "text": "function frame() {\n\tlet firstTarget = createTarget();\n\trandomize(firstTarget);\n\tsetInterval(randomize, 950, firstTarget); //this is where I control the speed of the target\n\t// console.log(firstTarget);\n}", "title": "" }, { "docid": "4ab4e1724f9901a50cfd29dd9cd9327c", "score": "0.52671266", "text": "function checkCatch(balltype, target) {\n if (balltype == 'masterball') {\n return true;\n }\n var R1;\n switch(balltype) {\n case 'pokeball':\n R1 = 255*Math.random(); break;\n case 'greatball':\n R1 = 200*Math.random(); break;\n default:\n R1 = 150*Math.random(); break;\n }\n\n var S;\n switch(target.status) {\n case 'slp':\n S = 25; break;\n case 'frz':\n S = 25; break;\n case 'par':\n S = 12; break;\n case 'brn':\n S = 12; break;\n case 'psn':\n S = 12; break;\n default:\n S = 0; break;\n }\n\n var R3 = R1 - S;\n\n if (R3 < 0) {\n return true;\n }\n\n if (target.catchrate < R3) {\n return false;\n }\n\n var F = target.HP * 255;\n if (balltype == 'greatball') {\n F /= 8;\n }\n else {\n F /= 12;\n }\n\n if (target.remainingHP / 4 > 0) {\n F /= (target.remainingHP);\n }\n\n F = Math.min(255, F);\n\n var R2 = 255 * Math.random();\n if (R2 < F) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "c6a75e79a7a9de3bd7a3703c5daedace", "score": "0.5265562", "text": "function bot() {\n if (startAmmount > 70) startAmmount = 70;\n ritualAttack();\n }", "title": "" }, { "docid": "5a4cbabd702614796503ea78bf17d87b", "score": "0.52637506", "text": "function TrainProvoke() {\n Orion.ActivateClient();\n Orion.Print('Target the attacker')\n var attacker = SelectTarget();\n Orion.Print('Target the target')\n var target = SelectTarget();\n\n Orion.ClearHighlightCharacters(true);\n Orion.AddHighlightCharacter(target.Serial(), '0x0026', true);\n Orion.AddHighlightCharacter(attacker.Serial(), '0x0004', true);\n\n while (!Player.Dead()) {\n Orion.Wait(100)\n if (!Orion.DisplayTimerExists('SkillInUse')) {\n Orion.UseType('0x0E9D', '0xFFFF');\n Orion.UseSkill('Provocation', attacker.Serial());\n Orion.Wait(500);\n if (Orion.WaitForTarget(2000)) {\n Orion.TargetObject(target.Serial());\n Orion.AddDisplayTimer('SkillInUse', 11000, 'AboveChar');\n }\n Orion.Wait(1000)\n\n }\n }\n}", "title": "" }, { "docid": "1dfffd323078328422ff8f8e2f2c95b3", "score": "0.52588135", "text": "jump(){\n\t\tif(this.isAlive){\n\t\t\tthis.velocity = -8;\n\t\t\tthis.yPos += this.velocity;\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "545af76f6bf021716fe53dec3a2f5c48", "score": "0.5253726", "text": "function knockbackTravel(horizontalVelocity, horizontalDecay, verticalVelocity, verticalDecay, character, hitstun, xPos, yPos, fadeIn, doubleJump, sdiVector, zdiVector, asdiVector, trajectory, meteorCancel, grounded, angle, releasePoint, icg) {\r\n var positions = [];\r\n var hPos = releasePoint[0];\r\n var vPos = releasePoint[1];\r\n var horVelChar = 0;\r\n var verVelChar = 0;\r\n var horVelKB = horizontalVelocity;\r\n var verVelKB = verticalVelocity;\r\n if (icg){\r\n verVelKB = 0;\r\n }\r\n var extendedDisplay = 0;\r\n //Gravity only plays into effect until max fallspeed is reached.\r\n var gravityFrames = Math.floor(characters[character][\"terminalVelocity\"] / characters[character][\"gravity\"]);\r\n //Since gravity generally doesn't divide into max fallspeed evenly, we have a < gravity frame\r\n var lastGravityFrame = characters[character][\"terminalVelocity\"] % characters[character][\"gravity\"];\r\n\r\n if (trajectory >= 260 && trajectory <= 280 && meteorCancel && !icg){\r\n hitstun = 8;\r\n meteorCancelled = true;\r\n }\r\n if (grounded && (trajectory == 0 || trajectory == 180) && knockback < 80){\r\n verVelKB = 0;\r\n //prompt(\"test\");\r\n reduceByTraction = true;\r\n }\r\n\r\n if (groundDownHit){\r\n if (groundDownHitType == \"Stay\"){\r\n verVelKB = 0;\r\n reduceByTraction = true;\r\n }\r\n else {\r\n verVelKB = Math.abs(verVelKB);\r\n verticalDecay = Math.abs(verticalDecay);\r\n }\r\n }\r\n\r\n for (var i=0; i<hitstun; i++) {\r\n if (reduceByTraction){\r\n if (horVelKB != 0){\r\n if (horVelKB > 0){\r\n horVelKB -= characters[character][\"traction\"];\r\n if (horVelKB < 0){\r\n horVelKB = 0;\r\n }\r\n }\r\n else {\r\n horVelKB += characters[character][\"traction\"];\r\n if (horVelKB > 0){\r\n horVelKB = 0;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n if (horVelKB != 0){\r\n if (horVelKB > 0){\r\n horVelKB -= horizontalDecay;\r\n if (horVelKB < 0){\r\n horVelKB = 0;\r\n }\r\n }\r\n else {\r\n horVelKB -= horizontalDecay;\r\n if (horVelKB > 0){\r\n horVelKB = 0;\r\n }\r\n }\r\n }\r\n if (verVelKB != 0){\r\n if (verVelKB > 0){\r\n verVelKB -= verticalDecay;\r\n if (verVelKB < 0){\r\n verVelKB = 0;\r\n }\r\n }\r\n else {\r\n verVelKB -= verticalDecay;\r\n if (verVelKB > 0){\r\n verVelKB = 0;\r\n }\r\n }\r\n }\r\n\r\n if (i < gravityFrames) {\r\n verVelChar -= characters[character][\"gravity\"];\r\n }\r\n else if (i === gravityFrames) {\r\n verVelChar -= lastGravityFrame;\r\n }\r\n }\r\n\r\n hPos = hPos + horVelChar + horVelKB;\r\n vPos = vPos + verVelChar + verVelKB;\r\n\r\n\r\n\r\n\r\n if (i == 0){\r\n hPos += sdiVector[0] + zdiVector[0] + asdiVector[0];\r\n vPos += sdiVector[1] + zdiVector[1] + asdiVector[1];\r\n if (asdiVector[1] < 0 && grounded && (verVelChar + verVelKB + asdiVector[1] + sdiVector[1] + zdiVector[1] < 0) && (trajectory < 180 || trajectory == 361)){\r\n stayGrounded = true;\r\n yDisplacement = verVelChar + verVelKB + asdiVector[1] + sdiVector[1] + zdiVector[1];\r\n break;\r\n }\r\n }\r\n positions.push([hPos, vPos, horVelKB, verVelKB, horVelChar, verVelChar]);\r\n }\r\n\r\n var hasDoubleJumped = false;\r\n var e = 0;\r\n\r\n while ((Math.abs(horVelKB) > 0.001 || Math.abs(verVelKB) > 0.001 || (meteorCancelled && extendedDisplay < 25)) && !stayGrounded){\r\n\r\n if (reduceByTraction){\r\n if (horVelKB != 0){\r\n if (horVelKB > 0){\r\n horVelKB -= characters[character][\"traction\"];\r\n if (horVelKB < 0){\r\n horVelKB = 0;\r\n }\r\n }\r\n else {\r\n horVelKB += characters[character][\"traction\"];\r\n if (horVelKB > 0){\r\n horVelKB = 0;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n\r\n if (horVelKB != 0){\r\n if (horVelKB > 0){\r\n horVelKB -= horizontalDecay;\r\n if (horVelKB < 0){\r\n horVelKB = 0;\r\n }\r\n }\r\n else {\r\n horVelKB -= horizontalDecay;\r\n if (horVelKB > 0){\r\n horVelKB = 0;\r\n }\r\n }\r\n }\r\n if (verVelKB != 0){\r\n if (verVelKB > 0){\r\n verVelKB -= verticalDecay;\r\n if (verVelKB < 0){\r\n verVelKB = 0;\r\n }\r\n }\r\n else {\r\n verVelKB -= verticalDecay;\r\n if (verVelKB > 0){\r\n verVelKB = 0;\r\n }\r\n }\r\n }\r\n\r\n if (i < gravityFrames) {\r\n verVelChar -= characters[character][\"gravity\"];\r\n }\r\n else if (i == gravityFrames) {\r\n verVelChar -= lastGravityFrame;\r\n }\r\n\r\n if (meteorCancelled){\r\n horVelKB = 0;\r\n verVelKB = 0;\r\n extendedDisplay++;\r\n }\r\n\r\n if (doubleJump && !hasDoubleJumped){\r\n if (characters[character][\"djSetY\"]){\r\n verVelChar = characters[character][\"djInitY\"][e];\r\n if (characters[character][\"djSetX\"]){\r\n if (hPos > 0){\r\n horVelChar += -characters[character][\"djXValues\"][e];\r\n }\r\n else if (hPos < 0){\r\n horVelChar += characters[character][\"djXValues\"][e];\r\n }\r\n }\r\n e++;\r\n }\r\n else {\r\n verVelChar = characters[character][\"djInitY\"];\r\n if (fadeIn){\r\n if (hPos > 0){\r\n horVelChar = -characters[character][\"djInitX\"];\r\n }\r\n else if (hPos < 0){\r\n horVelChar = characters[character][\"djInitX\"];\r\n }\r\n }\r\n hasDoubleJumped = true;\r\n }\r\n }\r\n\r\n if (hasDoubleJumped){\r\n verVelChar -= characters[character][\"gravity\"];\r\n if (verVelChar < -characters[character][\"terminalVelocity\"]){\r\n verVelChar = -characters[character][\"terminalVelocity\"];\r\n }\r\n }\r\n\r\n\r\n\r\n if (fadeIn){\r\n\r\n if (hPos > 0){\r\n if (horVelChar < -characters[character][\"driftMax\"]){\r\n horVelChar += characters[character][\"airFriction\"];\r\n if (horVelChar > -characters[character][\"driftMax\"]){\r\n horVelChar = -characters[character][\"driftMax\"];\r\n }\r\n }\r\n else {\r\n horVelChar -= characters[character][\"driftAcc\"];\r\n if (horVelChar < -characters[character][\"driftMax\"]){\r\n horVelChar = -characters[character][\"driftMax\"];\r\n }\r\n }\r\n }\r\n else if (hPos < 0){\r\n if (horVelChar > characters[character][\"driftMax\"]){\r\n horVelChar -= characters[character][\"airFriction\"];\r\n if (horVelChar < characters[character][\"driftMax\"]){\r\n horVelChar = characters[character][\"driftMax\"];\r\n }\r\n }\r\n else {\r\n horVelChar += characters[character][\"driftAcc\"];\r\n if (horVelChar > characters[character][\"driftMax\"]){\r\n horVelChar = characters[character][\"driftMax\"];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n i++;\r\n\r\n hPos = hPos + horVelChar + horVelKB;\r\n vPos = vPos + verVelChar + verVelKB;\r\n positions.push([hPos, vPos, horVelKB, verVelKB, horVelChar, verVelChar]);\r\n }\r\n\r\n return positions;\r\n }", "title": "" }, { "docid": "465216c14bdfefaef3e2f4d4efeeb7bf", "score": "0.5251432", "text": "stepOver() {\n this.setStepOverNextCall(true);\n }", "title": "" }, { "docid": "1ca471b0a546ea6fde2e2f4a91d87af8", "score": "0.52433616", "text": "speedBoost(player) {\n if (player == 'p1') {\n this.boost = true;\n } else {\n this.boost2 = true;\n }\n this.time.addEvent({\n delay: 1700,\n callback: () => {\n //console.log(\"stopped boosting\");\n if (player == 'p1') {\n this.boost = false;\n } else {\n this.boost2 = false;\n }\n },\n loop: false\n })\n }", "title": "" }, { "docid": "fe7260fa27d54d9acaa98d7b189ac637", "score": "0.52376956", "text": "actionDisengageAttack(targetCreature) {\n if(this.aliveBool) {\n addToCombatLog(`${this.name} moved away from ${targetCreature.name}.`)\n this.clearSingleThreat(targetCreature);\n this.attack();\n } else {\n addToCombatLog(`${this.name} was slain before it could act.`)\n }\n this.currentBattlefield.combatPhaseController();\n }", "title": "" }, { "docid": "f2c68bdb21a0de5428c86ca224bd7b65", "score": "0.52354085", "text": "async function advanceBlockTo (target) {\n if (!BN.isBN(target)) {\n target = new BN(target);\n }\n\n const currentBlock = (await latestBlock());\n const start = Date.now();\n let notified;\n if (target.lt(currentBlock)) throw Error(`Target block #(${target}) is lower than current block #(${currentBlock})`);\n while ((await latestBlock()).lt(target)) {\n if (!notified && Date.now() - start >= 5000) {\n notified = true;\n console.log(`\\\n${colors.white.bgBlack('@openzeppelin/test-helpers')} ${colors.black.bgYellow('WARN')} advanceBlockTo: Advancing too ` +\n 'many blocks is causing this test to be slow.');\n }\n await advanceBlock();\n }\n}", "title": "" }, { "docid": "2f35c6b19ba8db4c569b4bf59970ba8d", "score": "0.5231699", "text": "function stalk (gameData, helpers) {\n var direction;\n var myHero = gameData.activeHero;\n\n var damagedEnemy = nearestTile(gameData, {\n type: \"Hero\",\n team: {\n op: \"NEQ\",\n val: myHero.team\n }\n });\n\n\n if (damagedEnemy) {\n if (myHero.health >= (damagedEnemy.health - 20)) {\n if(damagedEnemy.distance <= 2) {\n direction = damagedEnemy.direction;\n return direction;\n }\n }\n }\n}", "title": "" }, { "docid": "4d674e83e2c2cace11997b4808162ee0", "score": "0.52254725", "text": "function gameIsStarting () {\r\n // Draw How Many Targets that were chosen\r\n for (let i = 0; i < targetNumber; i++) {\r\n drawTargetLocation();\r\n }\r\n}", "title": "" }, { "docid": "16f09a0a48880f942fbe89d35f8f6498", "score": "0.5212795", "text": "objectHit(target) {\r\n // attempt to trigger a take damage function on the target if it exists\r\n \r\n }", "title": "" }, { "docid": "da3d5badbf8ad5373cdf82b4a304c81f", "score": "0.52113706", "text": "function CheckTarget(target) {\n if (!target) {\n\n target = GetTargetOff(attack_target_off)\n\n if (!target) {\n // Get New Monster Target\n target = GetNearestMonster();\n }\n\n if (target) {\n game_log(\"Set Target to \" + target.mtype)\n change_target(target)\n return;\n }\n }\n\n return;\n}", "title": "" }, { "docid": "d428a4bee7ac2acaff5295eca0e09899", "score": "0.5209213", "text": "static clickAttack() {\n var _a;\n // click attacks disabled and we already beat the starter\n if (App.game.challenges.list.disableClickAttack.active() && player.starter() != GameConstants.Starter.None) {\n return;\n }\n // TODO: figure out a better way of handling this\n // Limit click attack speed, Only allow 1 attack per 50ms (20 per second)\n const now = Date.now();\n if (this.lastClickAttack > now - 50) {\n return;\n }\n this.lastClickAttack = now;\n if (!((_a = this.enemyPokemon()) === null || _a === void 0 ? void 0 : _a.isAlive())) {\n return;\n }\n GameHelper.incrementObservable(App.game.statistics.clickAttacks);\n this.enemyPokemon().damage(App.game.party.calculateClickAttack(true));\n if (!this.enemyPokemon().isAlive()) {\n this.defeatPokemon();\n }\n }", "title": "" }, { "docid": "a3690fc9d667d7ea6d622d2cff73c8f2", "score": "0.5205734", "text": "function trialLoop(targets){\n /////////////////////////////// Accel, head, and eye tracking\n // Accel gesture detection\n condensed_arrays = accelArrayHandler(orient_short_history);\n leftrightgesture = classify_leftright(condensed_arrays[0]);\n bfgesture = classify_backfront(condensed_arrays[1]);\n gyro_steady = (leftrightgesture == 0) && (bfgesture == 0);\n // head pose gesture detection\n let pushpullgesture = 0;\n if (gyro_steady && prediction.faceInViewConfidence > .85){\n let cur_head_size = faceGeom.getGeom()[3];\n\n head_size_history.push(Math.sqrt(cur_head_size))\n if (head_size_history.length > lastsecHistoryLen){\n head_size_history.shift();\n }\n\n pushpullgesture = headsizeToGesture(head_size_history, 1.15);\n }\n head_steady = (pushpullgesture == 0);\n // Update eye tracking only when stable -- there's a little steady delay though\n if (gyro_steady && head_steady){\n localPreds.push([...curPred]);\n if (localPreds.length > lastsecHistoryLen){\n localPreds.shift();\n setGridTextColorWhite(targets[1]);\n }\n }\n\n /////////////////////////////// Gesture detection\n all_gestures = [leftrightgesture, bfgesture, pushpullgesture];\n // If all gestures is not all 0 and has no 99s (unsteady), a gesture is detected. Log it\n if (!all_gestures.every(elem => elem == 0) && all_gestures.every(elem => elem != 99)){\n segmentPrediction = getMeanEyeSegment(localPreds.slice(3)) // Averaging predicted gaze XYs\n hist = [localPreds, orient_short_history, head_size_history];\n\n console.log(\"Gaze Prediction: \", segmentPrediction);\n\n trialEndHandler([all_gestures, segmentPrediction], targets, hist);\n } else{\n if ((Date.now() - trialStartTime) > trial_time*1000){ // Timeout\n // Failed to detect gesture, but save eye position anyway\n segmentPrediction = getMeanEyeSegment(localPreds.slice(3))\n\n hist = [localPreds, orient_short_history, head_size_history];\n trialEndHandler([-1, segmentPrediction], targets, hist);\n return;\n } else{ // Otherwise, run the loop again\n setTimeout(() => trialLoop(targets), trial_delay);\n }\n }\n}", "title": "" }, { "docid": "dc953a9615591068bbdc2e1e84ee0941", "score": "0.5203616", "text": "win(player, goal) {\r\n if (this.player.body.touching.down) {\r\n this.winState = true;\r\n }\r\n }", "title": "" }, { "docid": "dc953a9615591068bbdc2e1e84ee0941", "score": "0.5203616", "text": "win(player, goal) {\r\n if (this.player.body.touching.down) {\r\n this.winState = true;\r\n }\r\n }", "title": "" }, { "docid": "06cff044b0e04bf05f054e4a9e9da680", "score": "0.5200603", "text": "function Hunt_State()\n\t{\n\t\tsearch_timer += Time.deltaTime;\n\t\tif (target == null)\n\t\t{\n\t\t\ttarget = Functions.Closest_Tag(\"End\", gameObject.transform.position, 100.0f);\n\t\t}\n\t\telse if (Detect_Collision())\n\t\t{\n\t\t\tChange_State(NPC_state.avoiding);\n\t\t}\n\t\telse if (Vector3.Distance(transform.position, target.transform.position) < 1)\n\t\t{\n\t\t\ttarget = target.GetComponent(\"Waypoint\").getPrevious();\n\t\t\tif (target == null)\n\t\t\t{\n\t\t\t\tChange_State(NPC_state.idle);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tGetComponent.<Animation>().Play(\"run\");\n\t\t\ttarget_rotation = Quaternion.LookRotation(target.transform.position - Vector3(gameObject.transform.position.x, 0, gameObject.transform.position.z));\n\t\t\t//gameObject.transform.LookAt(Vector3(target.transform.position.x, gameObject.transform.position.y, target.transform.position.z));\n\t\t\t//var rb : Rigidbody = gameObject.GetComponent.<Rigidbody>();\n\t\t\t//if(rb.velocity.magnitude < 20.0f)\n\t\t\t//{\n\t\t\t\t//rb.AddForce(gameObject.transform.forward * 15.0);\n\t\t\t//}\n\t\t\ttransform.position = Vector3.MoveTowards(transform.position, Vector3(target.transform.position.x, transform.position.y, target.transform.position.z), speed * Time.deltaTime);\n\t\t}\n\t}", "title": "" }, { "docid": "ac3ff6b005c961dacc6cdf276bf598f6", "score": "0.51987517", "text": "jump()\n {}", "title": "" }, { "docid": "c9fdf540f68de0cc442fec19b1cf40f1", "score": "0.519571", "text": "flap() {\n this.speed = -5\n click = false\n }", "title": "" }, { "docid": "117c0239f62c91014612961d48220501", "score": "0.51953226", "text": "function metaBookJumpTo(target){\n if (metaBook.hudup) metaBook.setMode(false);\n metaBook.GoTo(target,\"JumpTo\");}", "title": "" }, { "docid": "a25dd827f8d96943411c6ac148610d3d", "score": "0.51952624", "text": "function keydownCollectedBottles() {\r\n isThrowing = true;\r\n let timePassed = new Date().getTime() - bottleThrowTime;\r\n\r\n if (timePassed > 1000) {\r\n AUDIO_THROW.play();\r\n\r\n collectedBottles--;\r\n bottleThrowTime = new Date().getTime();\r\n }\r\n}", "title": "" }, { "docid": "3c3f827253cbe8523e5a79328ccc005e", "score": "0.5188889", "text": "mediumPlay() {\n if (this.checkIfLost()) return;\n let strategy = this.autorand(1, 10);\n if (strategy > 6) {\n this.dumbPlay();\n } else {\n this.hardcorePlay(); \n }\n if(this.checkIfLost()) return;\n if (this.state.numOfBubbles === 2) _('mayHide').style.display = 'none'; \n }", "title": "" }, { "docid": "4c6a1f55d71a177972ef0d683dda6fa6", "score": "0.51881677", "text": "flap(){\r\n this.bird.jump();\r\n }", "title": "" }, { "docid": "e78fd03136a47c1b523abf3492aa0078", "score": "0.5185474", "text": "function CheckMovement()\n{\n\t//use random variables for movement\n\tvar movement = Random.Range(0,1000);\n\tvar idle = Random.Range(0,1000);\n\tvar jump = Random.Range(0,1000);\n\t\n\tif(facingLeft)\n\t\tfacingDirection = transform.right;\n\telse\n\t\tfacingDirection = -transform.right;\n\tif (Physics.Raycast (transform.position, facingDirection, 1)) \n\t{\n\t\tChangeDirection();\n }\n\t\n\tif(movement > 995)\n\t{\n\t\tChangeDirection();\n\t}\n\t\n\tif(idle > 990)\n\t{\n\t\tmoving = false;\n\t\tyield WaitForSeconds(3);\n\t\tmoving = true;\n\t}\n\t\n\tif(jump > 993)\n\t{\n\t\tjumping = true;\n\t}\n\n}", "title": "" }, { "docid": "a6d3aef30577088b213c7d2f9584c690", "score": "0.51854503", "text": "pause () {\n this.isLooping = false\n }", "title": "" }, { "docid": "66c6a9977ec564198f1e4721ad1a5d6f", "score": "0.5183057", "text": "atTarget() {\n return this.distanceToTarget() < this.game.width/72;\n }", "title": "" }, { "docid": "dc72e69d75a1ad6cadd102d0a7cd3c6d", "score": "0.5182293", "text": "gotoTemp(mode, delay) {\n // Clear current timeout so that we set the timeout to the new delay\n if (this.tempTimeout) clearTimeout(this.tempTimeout);\n if (!this.tempStartMode) this.tempStartMode = this.current;\n\n // setup the delay\n this.tempTimeout = setTimeout(() => {\n this.tempTimeout = null;\n this.goto(this.tempStartMode);\n this.tempStartMode = null;\n }, delay);\n\n // goto the temp mode, without cancelling the delay we just set up\n this._goto(mode, { cancelTemp: false });\n }", "title": "" }, { "docid": "eeffa0579488051c91b11ec08de79b0c", "score": "0.5175689", "text": "function clickToTalk(npc){\r\n\tconsole.log(\"Ok? I am clicking\");\r\n\t\r\n\tif(canPlayerMove==false) return;\r\n\tcharacter.yell(character,npc);\r\n}", "title": "" }, { "docid": "d386009a5ac2dcc322bf6c82d0858eab", "score": "0.51646537", "text": "function runAndAttack(health) {\n while (health > 80) {\n \n var runAttack = [\"run\", \"attack\"]\n var defense = ask.keyInSelect(runAttack, \"Choose how to resist,\")\n if (defense === 0) {\n console.log(\"RUN, never a bad option.\")\n var power = [\"lowest\", \"highest\"]\n var runPower = ask.keyInSelect(power, \"Choose RUN power\")\n if (runPower === 0) {\n console.log(\"You are running with the weakest power\")\n return enemyAttack()\n } else {\n console.log(\"You ran, with the HIGHEST power wahooo\")\n return enemyAttack()\n }\n } else if (defense === 1) {\n console.log(\"the resistance!!!! Woop em.\")\n var attackPower = [\"minimum\", \"maximum\"]\n var power = ask.keyInSelect(attackPower, \"Choose your attack.\")\n if (power === 0) {\n console.log(\"You're attacking with a plastic spoon.\")\n return enemyAttack()\n } else {\n console.log(\"Somehow you've turned into the most powerful living thing in the universe, cheers.\")\n return enemyAttack()\n }\n } else {\n console.log(\"You can not, not do something. Not today.\")\n }\n }\n}", "title": "" }, { "docid": "a2eb86a39a82ebcda5e39cc8ed4fb192", "score": "0.51639444", "text": "think() {\n //get the output of the neural network\n this.decision = this.brain.feedForward(this.vision);\n // console.log(\"We're thinking this: \", this.decision)\n if (this.decision[0] > 0.6) {\n this.jump();\n }\n\n if (this.decision[1] > 0.6) {\n this.moveLeft()\n }\n\n if (this.decision[2] > 0.6) {\n this.moveRight()\n }\n\n }", "title": "" }, { "docid": "a83935501cc8cc92b844f1f16ca7cee0", "score": "0.5161373", "text": "loop() {\n super.loop();\n super.generateTrajectoryParamsDiscreteSpatial(trajectoryParameters[super.currentRounds][gameRandomization.VELOCITY]);\n this.discreteLauncher(images[gameImage.LAUNCHER]);\n\n let index = pressed.findIndex(item => item !== false);\n\n if( super.gameState.initialTime === 0 && super.currentRounds === 0 && super.getElapsedTime(super.gameState.startTime) >= INITIAL_DELAY) {\n sounds[gameSound.START].play();\n\n }\n\n if (super.ball.state === 'start') {\n super.moveBallToStart(images[gameImage.BALL]);\n if (super.gameState.initialTime > 0 && super.getElapsedTime() > jitterT) {\n sounds[gameSound.START].pause();\n sounds[gameSound.START].currentTime = 0;\n sounds[gameSound.LAUNCH].play();\n soundTimeStamp = super.getElapsedTime();\n super.gameState.initialTime = new Date().getTime();\n super.ball.state = 'fall';\n\n }\n\n\n }\n\n\n if (super.ball.state === 'fall') {\n\n super.trajectory();\n super.drawBall(images[gameImage.BALL]);\n if (super.getElapsedTime() >= 0.5) {\n\n super.ball.state = 'hit house';\n }\n\n\n }\n\n if ((super.ball.state === 'fall' || super.ball.state === 'hit house') && index >= 0) {\n\n super.ball.state = 'hit';\n\n }\n\n\n if (super.ball.state === 'hit house') {\n if (super.getElapsedTime() >= 2.5) {\n super.gameState.initialTime = new Date().getTime();\n super.ball.state = 'hit';\n }\n\n }\n\n\n if (super.ball.state === 'hit') {\n super.exportData.finalStateTimestamp = super.getElapsedTime();\n if(buttonPressDelay === 0){\n buttonPressDelay = new Date().getTime();\n }\n\n if(buttonPressDelay >0 && super.getElapsedTime(buttonPressDelay) >= 0.5) {\n this.checkHitState(index);\n }\n\n }\n\n this.createShuttle();\n\n if (super.ball.state === 'hit target') {\n\n if (index >= 0) {\n let target = targets[index];\n this.createWindow(target);\n\n }\n this.showWindow(index);\n if (super.getElapsedTime() >= 3) {\n super.finishGame(false);\n }\n\n\n }\n\n\n }", "title": "" }, { "docid": "9bfc7a0474e706eab7877b370e92c068", "score": "0.5158724", "text": "function NormalTarget(game, $elem) {\n var that = this;\n this.game = game;\n this.$elem = $elem;\n this.stepper = null;\n this.lastTouched = new Date().getTime();\n this.generated = new Date().getTime();\n this.lastPosition = null;\n this.disposable = false;\n this.mass = 1; //mass of normal targets is 1\n this.reaction = null;\n setTimeout(function () { that.disposable = true; }, 500);\n //Explode on click\n this.$elem.one(\"mousedown\", function () {\n that.explode.call(that);\n that.game.registerHit(that);\n that.displayChain();\n });\n}", "title": "" }, { "docid": "4d623f3b6a38c35306701a913d1d83b0", "score": "0.5152931", "text": "function SinglePlayerAI(previousTimingAI, randTimingAI, choosePlayerAI) {\n this.previousTimingAI = previousTimingAI;\n this.randTimingAI = randTimingAI;\n this.choosePlayerAI = choosePlayerAI;\n\n this.tickAI = function (playerDef, playerAtk) {\n if (frameCount - this.previousTimingAI >= this.randTimingAI) {\n if (this.choosePlayerAI <= 0.1) {\n if (playerDef.isOnGround(ground)) {\n playerDef.cstrLegs.stiffness = 0.00001;\n playerDef.kick(kickForceCoeff);\n playerDef.jump();\n playerDef.cstrLegs.stiffness = 0.06;\n //console.log(\"playerDef jumped\");\n //console.log(playerDef.isOnGround(ground));\n }\n }\n if (this.choosePlayerAI > 0.1 && this.choosePlayerAI <= 0.8) {\n if (playerAtk.isOnGround(ground)) {\n playerAtk.cstrLegs.stiffness = 0.00001;\n playerAtk.kick(kickForceCoeff);\n playerAtk.jump();\n playerAtk.cstrLegs.stiffness = 0.06;\n }\n }\n else {\n if (playerAtk.isOnGround(ground) && playerDef.isOnGround(ground)) {\n playerDef.cstrLegs.stiffness = 0.00001;\n playerDef.kick(kickForceCoeff);\n playerDef.jump();\n playerDef.cstrLegs.stiffness = 0.06;\n playerAtk.cstrLegs.stiffness = 0.00001;\n playerAtk.kick(kickForceCoeff);\n playerAtk.jump();\n playerAtk.cstrLegs.stiffness = 0.06;\n }\n }\n this.randTimingAI = random(lowerBoundTimingAI, upperBoundTimingAI);\n this.choosePlayerAI = random(0.0, 1.0);\n this.previousTimingAI = frameCount;\n }\n }\n\n // LITTLE FUNNY TEST FOR AI (aimed for player 2)\n /*this.AItest = function(playerDef, playerAtk) {\n if (playerAtk.isOnGround(ground)) {\n if (mouseY >= CANVAS_HEIGHT - playerAtk.mainBody.position.x) {\n if (mouseX <= playerAtk.mainBody.position.x - 10) {\n playerAtk.kick();\n playerAtk.jump();\n }\n }\n }\n if (playerDef.isOnGround(ground)) {\n if (mouseY >= CANVAS_HEIGHT - playerDef.mainBody.position.x) {\n if (mouseX <= playerDef.mainBody.position.x - 10) {\n playerDef.kick();\n playerDef.jump();\n }\n }\n }\n }*/\n}", "title": "" }, { "docid": "fc7ee9c465b67541b5555d0e940c9c66", "score": "0.5152489", "text": "attackOrMoveTroops() {\n this.placeBonus();\n let attackP = Math.floor(Math.random() * 100);\n if (attackP >= 75) {\n this.attack();\n } else {\n let num = Math.floor(Math.random() * 10) + 1;\n while(num>0) {\n this.moveTroops();\n num--;\n }\n this.gestorDeTurnos.changePlayer();\n }\n }", "title": "" }, { "docid": "22634f19c72b0dd658e041ba8d8ea7d2", "score": "0.5150564", "text": "update()\n {\n if(this.waitSteps > 0)\n {\n this.waitSteps--;\n return;\n }\n let targetDistSqr = Infinity;\n if(this.target != null)\n {\n let diffX = this.target.x - this.x;\n let diffY = this.target.y - this.y;\n targetDistSqr = diffX ** 2 + diffY ** 2;\n }\n if(this.state === Entity.States.ATTACKING)\n {\n let tradius = 0;\n if(typeof this.target !== \"undefined\" && this.target != null && typeof this.target.radius === \"number\")\n {\n tradius = this.target.radius;\n }\n if(targetDistSqr > (this.stopMoveAttackRadius + this.radius + tradius) ** 2)\n {\n this.move();\n }\n else\n {\n if(this.target != null)\n {\n if(this.target.health < 0)\n {\n this.target = null;\n }\n else\n {\n if(this.damageCooldown <= 0)\n {\n this.target.damageThis(this.damage);\n this.damageCooldown = this.damageCooldownMax;\n }\n else\n {\n this.damageCooldown--;\n }\n }\n }\n }\n }\n else if(this.state === Entity.States.MOVING)\n {\n let tradius = 0;\n if(typeof this.target !== \"undefined\" && this.target != null && typeof this.target.radius === \"number\")\n {\n tradius = this.target.radius;\n }\n if(targetDistSqr > (this.stopMoveRadius + this.radius + tradius) ** 2)\n {\n this.move();\n }\n }\n else if(this.state === Entity.States.HARVESTING)\n {\n if(this.type === \"worker\")\n {\n if(!this.carrying)\n {\n this.targetHouse = null;\n if(targetDistSqr > this.stopMoveHarvestRadius ** 2)\n {\n this.move();\n }\n else\n {\n this.carrying = true;\n if(this.target.type == \"cave\")\n {\n this.target.changeResources(-1); //todo: make variable\n }\n this.waitSteps = 60; //todo: make variable\n }\n }\n else\n {\n if(this.targetHouse == null){\n let minDistance = Infinity;\n for(let i = 0; i < this.owner.ownedEntities.length; i++)\n {\n let ent = this.owner.ownedEntities[i];\n if((ent.type === \"house\" && ent.owner === this.owner) && (ent.x-this.x)**2 + (ent.y-this.y)**2 < minDistance)\n {\n this.targetHouse = ent;\n minDistance = (ent.x-this.x)**2 + (ent.y-this.y)**2;\n }\n }\n }\n if(this.targetHouse != null)\n {\n let targetCave = this.target;\n this.target = this.targetHouse;\n let diffX = this.target.x - this.x;\n let diffY = this.target.y - this.y;\n targetDistSqr = diffX ** 2 + diffY ** 2;\n if(targetDistSqr > this.stopMoveHarvestRadius ** 2)\n {\n this.move();\n }\n else\n {\n this.owner.resources += 1; //todo: make variable\n this.carrying = false;\n this.emitter.emit(\"resource\");\n this.waitSteps = 60; //todo: make variable\n }\n this.target = targetCave;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "471e84f23cefe4b130e1a54c937a5d68", "score": "0.51495624", "text": "static chooseTarget (mook_, targets_)\n\t{\n\t\tswitch (mook_.mookModel.settings.mookType)\n\t\t{\n\t\tcase (MookTypes.EAGER_BEAVER):\n\t\t\treturn Behaviors.attackByDistance (mook_, targets_, false);\n\t\tcase (MookTypes.NELSON):\n\t\t\treturn Behaviors.attackByCurrentHealth (mook_, targets_, false);\n\t\tcase (MookTypes.SHIA):\n\t\t\treturn Behaviors.surprise (mook_, targets_);\n\t\tcase (MookTypes.VEGETA):\n\t\t\treturn Behaviors.attackByCurrentHealth (mook_, targets_, true);\n\t\tdefault:\n\t\t\tconsole.log (\"mookAI | Unsupported mook type!\");\n\t\t\tmook_.settings.mookType = MookTypes.SHIA;\n\t\t\treturn Behaviors.surprise (mook_, targets_);\n\t\t}\n\n\t\tthrow \"Failed to select a target\";\n\t}", "title": "" }, { "docid": "547334b859c372176e86ead1a698dd31", "score": "0.5146778", "text": "tickTarget() {\n if (this.target && this.target.exists) {\n let angle = aim.angle(this, this.target)\n if (angle === \"fail\") {\n angle = this.getTarget()\n }\n this.targetrot = angle || this.targetrot + 0.01\n } else {\n this.targetrot += 0.01\n this.getTarget()\n } \n }", "title": "" }, { "docid": "f4b4ab94b88839ccb5b4cf0e0ae95a64", "score": "0.5141912", "text": "stepAside({ targetTile, sideTile, nextBehavior = this.explore }) {\n if (this.tile.equals(sideTile)) {\n // this should encourage the ant to do whatever it was doing\n this.turnTowards(targetTile)\n this._currentBehavior = nextBehavior\n return\n }\n return this._moveOrTurnTowards(sideTile)\n }", "title": "" }, { "docid": "ded55915a97c4c347f42404dba841a68", "score": "0.5141123", "text": "function jump() {\n clearInterval(downTimerId);\n isJumping = true;\n upTimerId = setInterval(function() {\n doodlerSpaceBottom += 20;\n doodler.style.bottom = doodlerSpaceBottom + 'px';\n if (doodlerSpaceBottom > startPoint + 200) {\n fall();\n }\n },30);\n}", "title": "" }, { "docid": "34b4db70d1afb5ec853a4f59f74d0a00", "score": "0.51396966", "text": "function seekTarget(letter) {\r\n\t\t\t// seek for first letter\r\n\t\t\tvar tArr = [];\r\n\t\t\tfor (var i = 0; i < _enemies.length; i++) {\r\n\t\t\t\tif (!_enemies[i].dead\r\n\t\t\t\t\t&& _enemies[i].shot == 0\r\n\t\t\t\t\t&& _enemies[i].damage == 0\r\n\t\t\t\t\t&& _enemies[i].word[0] == letter\r\n\t\t\t\t\t&& _enemies[i].y > -50) {\r\n\t\t\t\t\ttArr.push(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// seek for target closest to player\r\n\t\t\tvar maxY = -999;\r\n\t\t\tvar mdx = -1;\r\n\t\t\tfor (var i = 0; i < tArr.length; i++) {\r\n\t\t\t\tif (_enemies[tArr[i]].y > maxY) {\r\n\t\t\t\t\tmdx = i;\r\n\t\t\t\t\tmaxY = _enemies[tArr[i]].y;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (mdx != -1) {\r\n\t\t\t\t_player.target = tArr[mdx];\r\n\t\t\t} else {\r\n\t\t\t\t_player.target = -1;\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "2155c0259296bc5149c136e585ed8ab4", "score": "0.51392585", "text": "function posit () {\n switch (spawn) {\n case -5: \n \n var finalBattle = Math.floor(Math.random() * 25)\n if (finalBattle === 0) {\n soundtrack.pause();\n var bossfight = new Audio(\"assets/audio/draculabattle.mp3\")\n bossfight.loop = true;\n bossfight.play();\n setTimeout(function () {\n setEnemy(enemies[13]);\n spawn += Math.floor(Math.random() * 5 + 5);\n }, playerChar.walkDelay)\n break;\n }\n\n setTimeout(function() {\n setEnemy(enemies[Math.floor(Math.random()*13)]);\n spawn += Math.floor(Math.random() * 5 + 5);\n }, playerChar.walkDelay)\n break; \n\n }\n}", "title": "" }, { "docid": "cf97a2500864b89387ddd4d758d6b316", "score": "0.5135497", "text": "function fctnPlayerAbilityJump(){\n playerObject.setTempYMomentum(playerObject.getTempYMomentum()-intJumpHeight*intGravityDirection);\n}", "title": "" }, { "docid": "46bb4fe41800c09bea93cf1b292e060f", "score": "0.51347995", "text": "function guideMe(trafficLight, isNoVehicleInFront) {\n if (trafficLight == \"GREEN\" && isNoVehicleInFront) {\n console.log(\"GO\");\n return;\n } \n console.log(\"STOP\");\n}", "title": "" }, { "docid": "5577ac65119694a01b7c2d27f48a82a7", "score": "0.51288587", "text": "function giveFeedback(){\n\t\tif (targetNumber == userGuess){\n\t\t\twinner();\n\t\t} else if(Math.abs(targetNumber - userGuess) < 10){\n\t\t\tuserFeedback = 'Fiery!'; \n\t\t\t//userFeedback.addClass(fiery);\n\t\t} else if(Math.abs(targetNumber - userGuess) < 20 && Math.abs(targetNumber - userGuess) > 9){\n\t\t\tuserFeedback = 'Hot';\n\t\t} else if(Math.abs(targetNumber - userGuess) < 30 && Math.abs(targetNumber - userGuess) > 19){\n\t\t\tuserFeedback = 'Lukewarm'; //userFeedback.addClass(lukewarm);\n\t\t} else {\n\t\t\tuserFeedback = 'Cold';\n\t\t\tfeedback.addClass('cold');\n\t\t}\n\n\t}", "title": "" }, { "docid": "ad09e0241472d07f5fbce2a961ef6896", "score": "0.51261157", "text": "hit()\n {\n while(this.hand.getHandTotal()<17)\n {\n super.hit();\n }\n }", "title": "" }, { "docid": "477a653453867b165d31fc3cde2192f7", "score": "0.5123337", "text": "function jump() {\n\t}", "title": "" } ]
35b66c2cbc777cc9760aaec6c5e6128c
Javascript function to get a new access token via refresh_token
[ { "docid": "9b7e34de9894e5674bb7253676102bfe", "score": "0.6591233", "text": "function referesh_token(wxuserinfo) {\n var that = this\n return new Promise(function (resolve, reject) {\n var userinfo =\n {\n refresh_token: wxuserinfo.referesh_token,\n access_token: wxuserinfo.access_token,\n openid: wxuserinfo.openid,\n }\n var that = this\n wx.request(\n {\n url: token_refresh_url\n data:\n {\n refresh: userinfo.refresh_token\n },\n headers:\n {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n success: function (res) {\n if (res.statusCode == 200) //new access_token successfully returned \n {\n userinfo.access_token = res.data.access\n resolve(userinfo)\n }\n else {\n reject(new Error('Failed to refresh Access Token.'))\n }\n }, \n fail: function (res) {\n reject(new Error('Network failed.'))\n }\n }) \n }) \n }", "title": "" } ]
[ { "docid": "8adc379ebe7e63ac6c48476f4f51f0a4", "score": "0.7812397", "text": "function refreshToken() {\n fetchAccessToken(tc.userId, setNewToken);\n }", "title": "" }, { "docid": "214dafd3d7b6a1e4aebe4d97596af32a", "score": "0.7618226", "text": "function refresh_access() {\n console.log(\"refreshing access with refresh token: \", refresh_token);\n request.post(\n {\n headers: { \"content-type\": \"application/x-www-form-urlencoded\" },\n url: \"https://accounts.spotify.com/api/token\",\n body:\n \"grant_type=refresh_token\" +\n \"&refresh_token=\" +\n refresh_token +\n \"&client_id=\" +\n clientId +\n \"&client_secret=\" +\n clientSecret\n },\n (err, httpResponse, body) => {\n if (err) {\n console.error(err);\n }\n parsed = JSON.parse(body);\n access_token = parsed.access_token;\n console.log(\"access refreshed. New access token: \", access_token);\n }\n );\n}", "title": "" }, { "docid": "0b0fa268f4cda440d9d7d10bea5244c8", "score": "0.74750775", "text": "function set_access_token_from_refresh_token_14_minutes(refresh_token){\n if (refresh_token === \"no cookie\") {\n location.reload();\n } else {\n let ajax = $.ajax(url_center[\"access_token\"], {\n method: \"post\",\n dataType: \"json\",\n data: {\n refresh: `${refresh_token}`,\n },\n });\n ajax.done(function (msg) {\n set_access_token_from_refresh_token(msg[\"access\"]);\n // location.reload();\n });\n ajax.fail(function (msg) {\n console.clear();\n // modal_alert[\"modal_alert_header_title\"].html(\"Account Required :)\");\n // modal_alert[\"modal_alert_body_content_1\"].html(\n // \"Create an account or login :)\"\n // );\n location.reload()\n // modal_alert[\"modal_alert_header\"].css(\"background-color\", \"#CAFFBF\");\n // modal_alert[\"modal_alert\"].modal();\n });\n }\n }", "title": "" }, { "docid": "da81a6828f5968a971993d6e49566648", "score": "0.740229", "text": "function refreshAccessToken() {\n refresh_token = localStorage.getItem('refresh_token');\n let body = 'grant_type=refresh_token';\n body += '&refresh_token=' + refresh_token;\n body += '&client_id' + spotifyClientID;\n callAuthorizationAPI(body);\n}", "title": "" }, { "docid": "b9f3cd91b5ae461e6b1af56a0c3bbe7e", "score": "0.73694074", "text": "function refreshAccessToken(refreshToken, callback) {\n var tokenObj = oauth2.accessToken.create({refresh_token: refreshToken});\n tokenObj.refresh(callback);\n}", "title": "" }, { "docid": "63200d0fc2f2d7e482bc49253409be4b", "score": "0.735655", "text": "function getAuthFromRefreshToken(app_id, app_secret, refreshToken, callback) {\r\n // Build request options for authentication.\r\n const authenticationOptions = {\r\n \"method\": \"POST\",\r\n \"url\": `${WWS_URL}${AUTHORIZATION_API}`,\r\n \"auth\": {\r\n \"user\": app_id,\r\n \"pass\": app_secret\r\n },\r\n \"form\": {\r\n \"grant_type\": \"refresh_token\",\r\n \"refresh_token\": refreshToken\r\n }\r\n };\r\n\r\n console.log(\"Issuing Authentication request with grant type 'refresh_token'\");\r\n\r\n // Get the JWT Token\r\n request(authenticationOptions, function(err, response, authenticationBody) {\r\n if (err) {\r\n console.log(\"ERROR: Authentication request returned an error.\");\r\n console.log(err);\r\n callback(err);\r\n return;\r\n }\r\n\r\n if (response.statusCode !== 200) {\r\n // App can't authenticate with refreshToken.\r\n // Just return an error\r\n var errormsg = \"Error authenticating, statuscode=\" + response.statusCode.toString();\r\n console.log(\"ERROR: App can't authenticate, statuscode =\", response.statusCode.toString());\r\n callback(new Error(errormsg));\r\n return;\r\n }\r\n\r\n var reqbody = JSON.parse(authenticationBody);\r\n const accessToken = reqbody.access_token;\r\n const refreshToken = reqbody.refresh_token;\r\n const userName = reqbody.displayName;\r\n const userid = reqbody.id;\r\n\r\n callback(null, accessToken, refreshToken, userName, userid);\r\n });\r\n}", "title": "" }, { "docid": "0e9384868f105f46c17834f670751fff", "score": "0.73228264", "text": "function _txRefreshToken() {\r\n var _url = 'https://open.t.qq.com/cgi_bin/oauth2/access_token?client_id=' +\r\n MixOne.Auth.TX.appkey + '&grant_type=refresh_token&refresh_token=' +\r\n MixOne.Auth.TX.refreshToken,\r\n ajax = new XMLHttpRequest(),\r\n t = MixOne.Auth.TX;\r\n\r\n ajax.onreadystatechange = function () {\r\n if (ajax.readyState === 4) {\r\n if (ajax.status === 200) {\r\n var res = ajax.responseText.split('&');\r\n t.login = true;\r\n t.access_token = res[0].split('=')[1];\r\n t.refresh_token = res[2].split('=')[1];\r\n t.username = res[3].split('=')[1];\r\n }\r\n else {\r\n t.login = false;\r\n }\r\n }\r\n\r\n }\r\n\r\n ajax.open('GET', _url, false);\r\n ajax.send(null);\r\n }", "title": "" }, { "docid": "d6f6510e68035e4a7982dba535558fde", "score": "0.7300712", "text": "function getAuthFromRefreshToken(app_id, app_secret, refreshToken, callback) {\n // Build request options for authentication.\n const authenticationOptions = {\n \"method\": \"POST\",\n \"url\": `${WWS_URL}${AUTHORIZATION_API}`,\n \"auth\": {\n \"user\": app_id,\n \"pass\": app_secret\n },\n \"form\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": refreshToken\n }\n };\n\n console.log(\"Issuing Authentication request with grant type 'refresh_token'\");\n\n // Get the JWT Token\n request(authenticationOptions, function(err, response, authenticationBody) {\n if (err) {\n console.log(\"ERROR: Authentication request returned an error.\");\n console.log(err);\n callback(err);\n return;\n }\n\n if (response.statusCode !== 200) {\n // App can't authenticate with refreshToken.\n // Just return an error\n var errormsg = \"Error authenticating, statuscode=\" + response.statusCode.toString();\n console.log(\"ERROR: App can't authenticate, statuscode =\", response.statusCode.toString());\n console.log(response);\n callback(new Error(errormsg));\n return;\n }\n\n var reqbody = JSON.parse(authenticationBody);\n const accessToken = reqbody.access_token;\n const refreshToken = reqbody.refresh_token;\n const userName = reqbody.displayName;\n const userid = reqbody.id;\n\n callback(null, accessToken, refreshToken, userName, userid);\n });\n}", "title": "" }, { "docid": "206254fbe05be2c861766d77efb6feb6", "score": "0.728469", "text": "function refreshAccessToken() {\n $log.debug('Requesting new access token...');\n var requestPromise = OAuth.meppit.refreshAccessToken(\n info.accessTokenInfo.refresh_token)\n requestPromise.then(function(tokenInfo) { saveAccessToken(tokenInfo); });\n return requestPromise;\n }", "title": "" }, { "docid": "37652bb5fb97236386ebe5073aa7ad22", "score": "0.72300905", "text": "function getAuthFromRefreshTokenHack(refreshToken, callback) {\n // Build request options for authentication.\n const authenticationOptions = {\n \"method\": \"POST\",\n \"accept\": \"application/json\",\n \"url\": `${WWS_URL}${AUTHORIZATION_API}`,\n \"auth\": {\n \"user\": \"toscana-web-client-id\",\n \"pass\": \"989b82d0-46ed-457c-ab5f-ccce3ca44dc9\"\n },\n \"form\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": refreshToken\n },\n \"x-graphql-view\": \"PUBLIC\"\n };\n\n console.log(\"Issuing Authentication request with grant type 'refresh_token'\");\n\n // Get the JWT Token\n request(authenticationOptions, function(err, response, authenticationBody) {\n if (err) {\n console.log(\"ERROR: Authentication request returned an error.\");\n console.log(err);\n callback(err);\n return;\n }\n\n if (response.statusCode !== 200) {\n // App can't authenticate with refreshToken.\n // Just return an error\n var errormsg = \"Error authenticating, statuscode=\" + response.statusCode.toString();\n console.log(\"ERROR: Couldn't get access token, statuscode =\", response.statusCode.toString());\n console.log(response.body);\n callback(new Error(errormsg));\n return;\n }\n\n var resbody = JSON.parse(authenticationBody);\n //console.log(resbody);\n const accessToken = resbody.access_token;\n const refreshToken = resbody.refresh_token;\n const userName = resbody.displayName;\n const userid = resbody.id;\n\n callback(null, accessToken, refreshToken, userName, userid);\n });\n}", "title": "" }, { "docid": "5a0d741c3a11c20ec1cb504a3837cadb", "score": "0.7197632", "text": "generateNewAccessToken(req, res) {\n const refreshToken = req.cookies.jwt;\n jsonwebtoken_1.default.verify(refreshToken, process.env.REFRESH_TOKEN_SECRET, (err, user) => {\n if (err) {\n return res.sendStatus(403);\n }\n const accessToken = jsonwebtoken_1.default.sign({ username: user.username, role: user.role }, process.env.ACCESS_TOKEN_SECRET, { expiresIn: this.AccessTokenExpiryTime });\n res.send({ accessToken });\n });\n }", "title": "" }, { "docid": "d2ea12d72410dc5eb4ac3caf9dfffad3", "score": "0.7195125", "text": "function set_access_token_from_refresh_token(access_token) {\n document.cookie = `access=${access_token};samesite=strict;max-age=${\n 60 * 15\n };path=/;`;\n }", "title": "" }, { "docid": "b273863a32677157430fc2b465414c98", "score": "0.7192436", "text": "function getRefreshToken() {\n var account = getAuthenticatedAccount();\n var currentTokens = getCookieOauth2Tokens();\n\n return $http.post('/api/oauth2-ng/token', {\n grant_type: 'refresh_token',\n client_id: account.client_id,\n client_secret: account.client_secret,\n refresh_token: currentTokens.refresh_token\n });\n }", "title": "" }, { "docid": "76f4f54fb94c5a183d497b0401fe5b0c", "score": "0.7109376", "text": "function refreshFrescoToken() {\n if (config.fresco.accessToken == null || !config.fresco.refreshToken) {\n return generateFrescoToken();\n }\n\n return superagent\n .post(config.fresco.apiRoot + '/auth/token')\n .set('Authorization', makeAuthHeader(config.fresco.client))\n .set('Accept', 'application/json')\n .send({\n grant_type: 'refresh_token',\n refresh_token: config.fresco.accessToken.refreshToken\n })\n .endAsync()\n .then(res => {\n config.fresco.accessToken = {\n token: res.body.access_token.token,\n refreshToken: res.body.access_token.refresh_token,\n expiresAt: new Date(res.body.access_token.expires_in + Date.now()).toISOString()\n };\n })\n .catch(err => {\n if (err.status == 401 && err.response.param === 'refresh_token') {\n return generateFrescoToken();\n } else {\n throw err;\n }\n });\n}", "title": "" }, { "docid": "4fa55085b349eee54e9fc2345849d7a1", "score": "0.7092481", "text": "function refreshAccessToken() {\n var refeshToken = $cookies.get('spotifyRefreshToken');\n var methodURL = '/spotify/refreshToken?refresh_token=' + refeshToken;\n\n $interval.cancel(refreshTokenTimer);\n\n return call(methodURL, {}).then(function(res) {\n\n //reset the access token and expirey time\n console.info(\"Got new spotify access token\");\n $cookies.put('spotifyAccessToken', res.accessToken);\n $cookies.put('spotifyTokenExpireAt', res.expire_at);\n\n // set auth code refresh timeout from cookie\n setrefreshTokenTimer();\n });\n }", "title": "" }, { "docid": "925292b61bd86e430d5cb9f3b3ab0745", "score": "0.7079581", "text": "async function requestRefreshedAccessToken(refreshToken) {\n\n\treturn await axios.post('api/token/refresh/', {\n\t\trefresh: refreshToken\n\t}).then(response => {\n\t\treturn Promise.resolve(response.data.access)\n\t}).catch(error => {\n\t\treturn Promise.reject(error)\n\t});\n}", "title": "" }, { "docid": "527aad86e4bce53d396691049342f326", "score": "0.7070299", "text": "function refreshToken(options, callback) {\n token = options.token;\n\n var req = request.post(options.token_url, function(e, r, body) {\n callback(JSON.parse(body));\n });\n\n var form = req.form();\n\n form.append('grant_type', 'refresh_token');\n form.append('refresh_token', token.refresh_token);\n form.append('client_id', options.client_id);\n form.append('client_secret', options.client_secret);\n}", "title": "" }, { "docid": "dbef617da74316bef97e334cf07ae312", "score": "0.70676345", "text": "function getTokens() {\n HTTP.query({\n url: 'https://securetoken.googleapis.com/v1/token?key=' + apiKey,\n data: {\n 'grant_type':\t'refresh_token',\n 'refresh_token': refresh_token\n },\n success: function(resp) {\n resp = JSON.parse(resp);\n token = resp.id_token;\n refresh_token = resp.refresh_token;\n print(\"tokens refreshed\");\n print(resp.expires_in);\n print(\"expires in seconds\");\n GPIO.write(ledPin, 1); // Turn on LED on successful post.\n happyLED();\n },\n error: function(err) {\n print(\"error refreshing tokens\");\n print(JSON.stringify(err));\n warningLED();\n GPIO.blink(ledPin, 1000, 1000); // Blink warning LED.\n }\n });\n}", "title": "" }, { "docid": "2f1caa5de7fc809dca65e8710570532d", "score": "0.70433354", "text": "function updateTokens(access_token, refresh_token) {\n let auth = getAuth();\n auth.access_token = access_token;\n auth.refresh_token = refresh_token;\n auth.expires = moment().add(1, 'h');\n config.update(auth);\n}", "title": "" }, { "docid": "104196390f6dd1fabe7898de09914d53", "score": "0.7008956", "text": "function use_access_token(code) {\n console.log(\"Use access token ...\");\n var db = window.localStorage;\n var refresh_token = db.getItem(\"refresh_token\");\n var access_token = db.getItem(\"access_token\");\n\n console.log(\"refresh_token=\" + refresh_token +\n \", access_token=\" + access_token);\n\n //if (!refresh_token) return;\n\n valid_token(access_token, code, function() {\n refresh_access_token(refresh_token, code);\n });\n}", "title": "" }, { "docid": "5bdbf610d274870ba6f4c9c71226b1a0", "score": "0.7007799", "text": "refreshAuthToken(token){}", "title": "" }, { "docid": "20f18af3903ef7e69abd7d6f91f7afe4", "score": "0.7001779", "text": "function refreshAccessToken () {\n let token = generateToken()\n\n const tokenUrlHostname = 'sandbox-b2b.revolut.com' \n const tokenUrlPath = '/api/1.0/auth/token'\n\n const data = qs.stringify({\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": config_data.refresh_token,\n \"client_id\": client_id,\n \"client_assertion_type\": \"urn:ietf:params:oauth:client-assertion-type:jwt-bearer\",\n \"client_assertion\": token,\n })\n\n const options = {\n hostname: tokenUrlHostname,\n path: tokenUrlPath,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n }\n }\n\n sendRequest(data, options)\n}", "title": "" }, { "docid": "3adb975106f37e0c96bb5720786ac55f", "score": "0.6982407", "text": "refreshAuthToken(token) { }", "title": "" }, { "docid": "8007b9b7d35c81b2db52a0579783b51b", "score": "0.69817936", "text": "async getNewAccessToken() {\n let refreshToken = this.getRefreshTokenFromStorage();\n let accessToken = null;\n if (refreshToken) {\n try {\n ({ accessToken, refreshToken } = await this.getAccessTokenFromRefreshToken(refreshToken));\n } catch (e) {\n // This refresh token is probably invalid, so clear it.\n this.deleteRefreshTokenFromStorage();\n }\n }\n if (!accessToken) {\n if (this.account.authMethod == kOAuth2Password) {\n try {\n ({ accessToken, refreshToken } = await this.getAccessTokenFromPassword());\n } catch (ex) {\n if (ex instanceof OAuth2ConsentRequired) {\n // End user needs to interactively approve again\n let authCode = await this.openLoginWindow();\n ({ accessToken, refreshToken } = await this.getAccessTokenFromPassword());\n } else {\n throw ex;\n }\n }\n } else {\n let authCode = await this.openLoginWindow();\n ({ accessToken, refreshToken } = await this.getAccessTokenFromAuthCode(authCode));\n }\n // if (!accessToken), then the above already threw\n }\n if (refreshToken) {\n this.storeRefreshToken(refreshToken);\n }\n return accessToken;\n }", "title": "" }, { "docid": "a0cd7e9389e46594a9f5d73012e05583", "score": "0.69761217", "text": "function refreshToken() {\n return new Promise((resolve, reject) => {\n // invoke check session to get a new token\n webAuth.checkSession({},\n function(err, result) {\n if (err) { // there was an error\n reject(err);\n } else { // we got a token\n resolve(result);\n }\n }\n );\n });\n}", "title": "" }, { "docid": "47687f141e8fbe14ace96b6205735868", "score": "0.6971394", "text": "function tryRefresh(auth, callback) {\n var options = {\n uri: 'https://accounts.google.com/o/oauth2/token',\n method: 'POST',\n form: {\n client_id:auth.appKey || auth.clientID,\n client_secret:auth.appSecret || auth.clientSecret,\n refresh_token:auth.token.refresh_token,\n grant_type:'refresh_token'\n }\n };\n requestClient(options, function(err, res, body){\n var js;\n try {\n if(err) throw err;\n js = JSON.parse(body);\n } catch(E) {\n return callback(E);\n }\n auth.token.access_token = js.access_token;\n return callback(null, auth);\n });\n}", "title": "" }, { "docid": "7c08c7ab0a08ff8a165c4d0be7059216", "score": "0.69553983", "text": "async refreshAccessToken() {\n const response = await this.fetcher.fetchJSON({\n method: \"POST\",\n path: routes.api().auth().session().path,\n tokenType: \"refresh\",\n });\n const { access_token: accessToken } = response;\n if (typeof accessToken === \"string\") {\n this.accessToken = accessToken;\n }\n else {\n throw new Error(\"Expected an 'access_token' in the response\");\n }\n }", "title": "" }, { "docid": "7c08c7ab0a08ff8a165c4d0be7059216", "score": "0.69553983", "text": "async refreshAccessToken() {\n const response = await this.fetcher.fetchJSON({\n method: \"POST\",\n path: routes.api().auth().session().path,\n tokenType: \"refresh\",\n });\n const { access_token: accessToken } = response;\n if (typeof accessToken === \"string\") {\n this.accessToken = accessToken;\n }\n else {\n throw new Error(\"Expected an 'access_token' in the response\");\n }\n }", "title": "" }, { "docid": "f93e1bfd27a6b2ec5fffc90c5e064481", "score": "0.6937661", "text": "function getRefreshToken()\n{\n\treturn localStorage.getItem(FieldNames.REFRESH_TOKEN);\n}", "title": "" }, { "docid": "a0e70a288dfbc36dbb7a61045358674a", "score": "0.69369006", "text": "getCurrentRefreshToken() {\n return this.authProvider.getRefreshToken();\n }", "title": "" }, { "docid": "5f81f790c5211c9089d08cd0e2b7c964", "score": "0.6928009", "text": "function tokenRefreshRequest() {\n return {type: TOKEN_REFRESH_REQUEST};\n}", "title": "" }, { "docid": "b4df91c89de0d9c8cf47421c50122238", "score": "0.690526", "text": "getAccessToken(environment, refreshToken, scopes) {\n const token = refreshToken || this.getRefreshToken();\n validateParams(environment, scopes, this.credentials);\n this.scope = Array.isArray(scopes) ? scopes.join('%20') : scopes;\n if (!token) {\n throw new Error('Refresh token is required, to generate refresh token use exchangeCodeForAccessToken method'); // eslint-disable-line max-len\n }\n const data = `refresh_token=${token}&grant_type=${consts.PAYLOAD_REFRESH_TOKEN}&scope=${this.scope}`;\n return postRequest(data, this.credentials[environment]);\n }", "title": "" }, { "docid": "6fcf88a2524d1ff2d3644e2447b598e2", "score": "0.6889188", "text": "async refreshToken () {\n\t\tthis.refreshResult = await NRAccessTokenRefresher({\n\t\t\trequest: this,\n\t\t\ttokenInfo: this.request.body,\n\t\t\tforce: true\n\t\t});\n\t\tthis.responseData = this.refreshResult.newTokenInfo;\n\t}", "title": "" }, { "docid": "10cbd5bbab17e043cc2820b4cfb34c87", "score": "0.6888183", "text": "async _Refresh_Access_Token(token) {\n //Regenerate an access token.\n var self = this;\n self.log(\"Regenerating Access Token\");\n try {\n await self._authenticate({'grant_type': 'refresh_token', 'username': this.#email, 'refresh_token': token,});\n } catch (err) {\n throw(err);\n }\n self.#actively_refreshing = false;\n }", "title": "" }, { "docid": "273848984946264c9bac0f406818ab4f", "score": "0.6876217", "text": "refreshAccessToken(refreshToken) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const data = yield fetch_1.post(`${this.url}/token?grant_type=refresh_token`, { refresh_token: refreshToken }, { headers: this.headers });\n let session = Object.assign({}, data);\n if (session.expires_in)\n session.expires_at = helpers_1.expiresAt(data.expires_in);\n return { data: session, error: null };\n }\n catch (error) {\n return { data: null, error };\n }\n });\n }", "title": "" }, { "docid": "d9cfed6e52d0478734c314c5c52ac9c2", "score": "0.6860794", "text": "async refreshTokenNoCache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n refreshToken) {\n const tokenPath = `service-accounts/${this.serviceAccountEmail}/token`;\n let data;\n try {\n const instanceOptions = {\n property: tokenPath,\n };\n if (this.scopes.length > 0) {\n instanceOptions.params = {\n scopes: this.scopes.join(','),\n };\n }\n data = await gcpMetadata.instance(instanceOptions);\n }\n catch (e) {\n e.message = `Could not refresh access token: ${e.message}`;\n this.wrapError(e);\n throw e;\n }\n const tokens = data;\n if (data && data.expires_in) {\n tokens.expiry_date = new Date().getTime() + data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res: null };\n }", "title": "" }, { "docid": "334fe55c89329afd543ce35b1d623c9c", "score": "0.68534184", "text": "function get_aceess_token_server(refresh_token) {\n if (refresh_token === \"no cookie\") {\n return \"no cookie\";\n } else {\n let ajax = $.ajax(url_center[\"access_token\"], {\n method: \"post\",\n dataType: \"json\",\n data: {\n refresh: `${refresh_token}`,\n },\n });\n ajax.done(function (msg) {\n set_access_token_from_refresh_token(msg[\"access\"]);\n location.reload();\n });\n ajax.fail(function (msg) {\n console.clear();\n modal_alert[\"modal_alert_header_title\"].html(\"Account Required :)\");\n modal_alert[\"modal_alert_body_content_1\"].html(\n \"Create an account or login :)\"\n );\n modal_alert[\"modal_alert_header\"].css(\"background-color\", \"#CAFFBF\");\n modal_alert[\"modal_alert\"].modal();\n });\n }\n }", "title": "" }, { "docid": "152b879da645711f5ae9920577f30c9a", "score": "0.68289113", "text": "async refreshAccessData(oldcode) {\n var res = {}\n const data = {\n client_id: this.clientId,\n grant_type: \"refresh_token\",\n refresh_token: oldcode,\n client_secret: this.clientSecret\n }\n await axios.post(this.basePath + '/app/oauth/token/', qs.stringify(data))\n .then(result => {\n res = result.data;\n res.error = 0;\n }).catch(error => {\n res.error = 1;\n console.log(error.response.data);\n });\n console.log(\"Dati di accesso aggiornati.\");\n return res;\n }", "title": "" }, { "docid": "9780faead4784ae360f65c9ed8186e98", "score": "0.6793866", "text": "async getToken () {\n if (!this.isTokenExpired()) {\n return this.token.access_token;\n }\n\n if (!this.token || !this.token.refresh_token) {\n throw new Error('No token to refresh')\n }\n\n let response = await this.post('oauth/token', {\n client_id: this.client.clientId,\n client_secret: this.client.clientSecret,\n grant_type: 'refresh_token',\n refresh_token: this.token.refresh_token,\n });\n\n this.token = response.data;\n\n // A callback to trigger when we get a refreshed token\n // Allows us to externally persist somewhere\n if (this.refreshTokenHandler) {\n await this.refreshTokenHandler(this.token);\n }\n\n return response.data.access_token;\n }", "title": "" }, { "docid": "ee36444f708c8c15b32a8ba08f395cc3", "score": "0.6751994", "text": "function getAccessToken(request, response, callback) {\n var expiration = new Date(parseFloat(getValueFromCookie('node-tutorial-token-expires', request.headers.cookie)));\n\n if (expiration <= new Date()) {\n // refresh token\n console.log('TOKEN EXPIRED, REFRESHING');\n var refresh_token = getValueFromCookie('node-tutorial-refresh-token', request.headers.cookie);\n authHelper.refreshAccessToken(refresh_token, function(error, newToken){\n if (error) {\n callback(error, null);\n } else if (newToken) {\n var cookies = ['node-tutorial-token=' + newToken.token.access_token + ';Max-Age=4000',\n 'node-tutorial-refresh-token=' + newToken.token.refresh_token + ';Max-Age=4000',\n 'node-tutorial-token-expires=' + newToken.token.expires_at.getTime() + ';Max-Age=4000'];\n response.setHeader('Set-Cookie', cookies);\n callback(null, newToken.token.access_token);\n }\n });\n } else {\n // Return cached token\n var access_token = getValueFromCookie('node-tutorial-token', request.headers.cookie);\n callback(null, access_token);\n }\n}", "title": "" }, { "docid": "30f4a5c146205e05d69f69cbb32a9c39", "score": "0.67449194", "text": "function generateFrescoToken() {\n return superagent\n .post(config.fresco.apiRoot + '/auth/token')\n .set('Authorization', makeAuthHeader(config.fresco.client))\n .set('Accept', 'application/json')\n .send({ grant_type: 'client_credentials' })\n .endAsync()\n .then(res => {\n config.fresco.accessToken = {\n token: res.body.access_token.token,\n refreshToken: res.body.access_token.refresh_token,\n expiresAt: new Date(res.body.access_token.expires_in + Date.now()).toISOString()\n };\n });\n}", "title": "" }, { "docid": "1cee47e166b7deaab5d8d5102a9ec57a", "score": "0.6738702", "text": "function refreshAccessToken(refreshToken) {\n var data = {grant_type: 'refresh_token', refresh_token: refreshToken};\n postToTokenUrl(data).then(function (response) {\n var tokenInfo = tokenInfoFrom(response);\n refreshAccessTokenBeforeItExpires(tokenInfo);\n accessTokenPromise = Promise.resolve(tokenInfo.accessToken);\n });\n }", "title": "" }, { "docid": "65f96332822ae6198f6e1e5e3447adbe", "score": "0.67374593", "text": "function getAccessToken(request, response, callback) {\n var expiration = new Date(parseFloat(getValueFromCookie('conference-room-app-token-expires', request.headers.cookie)));\n\n if (Date.compare(expiration, new Date()) === -1) {\n // refresh token\n console.log('TOKEN EXPIRED, REFRESHING');\n var refresh_token = getValueFromCookie('conference-room-app-refresh-token', request.headers.cookie);\n authHelper.refreshAccessToken(refresh_token, function(error, newToken){\n if (error) {\n callback(error, null);\n } else if (newToken) {\n var cookies = ['conference-room-app-token=' + newToken.token.access_token + ';Max-Age=4000',\n 'conference-room-app-refresh-token=' + newToken.token.refresh_token + ';Max-Age=4000',\n 'conference-room-app-token-expires=' + newToken.token.expires_at.getTime() + ';Max-Age=4000'];\n response.setHeader('Set-Cookie', cookies);\n callback(null, newToken.token.access_token);\n }\n });\n } \n else {\n // Return cached token\n var access_token = getValueFromCookie('conference-room-app-token', request.headers.cookie);\n callback(null, access_token);\n }\n}", "title": "" }, { "docid": "6cbc7543722c664d0e5480fa884bdd9b", "score": "0.67275304", "text": "function refreshToken(){\n\tif(getToken())\n\t$.ajax({\n\t\t url: '/user/refresh',\n type: 'post',\n success: function (data) {\n localStorage.setItem('jwtToken',data.accessToken);\n }\n\t});\n}", "title": "" }, { "docid": "13ab96cd7c849d4b0b93781b828fd5d0", "score": "0.6724189", "text": "async refreshTokenNoCache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n refreshToken) {\n const gtoken = this.createGToken();\n const token = await gtoken.getToken({\n forceRefresh: this.isTokenExpiring(),\n });\n const tokens = {\n access_token: token.access_token,\n token_type: 'Bearer',\n expiry_date: gtoken.expiresAt,\n id_token: gtoken.idToken,\n };\n this.emit('tokens', tokens);\n return { res: null, tokens };\n }", "title": "" }, { "docid": "cf2b022df6df1fdbdba954b5d04ffc45", "score": "0.6707454", "text": "function _getNewToken(oauth2Client, callback) {\n var authUrl = oauth2Client.generateAuthUrl({\n access_type: 'offline',\n scope: SCOPES\n })\n console.log('Authorize this app by visiting this url: ', authUrl)\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n rl.question('Enter the code from that page here: ', function (code) {\n rl.close()\n oauth2Client.getToken(code, function (err, token) {\n if (err) {\n console.log('Error while trying to retrieve access token', err)\n return\n }\n oauth2Client.credentials = token\n _storeToken(token)\n callback(oauth2Client)\n })\n })\n }", "title": "" }, { "docid": "2c26fd2203dab64b5fc6441193ac679b", "score": "0.66983956", "text": "function refreshToken() {\r\n if (this.tokenRefreshTimer) {\r\n clearTimeout(this.tokenRefreshTimer);\r\n }\r\n this.trigger(this.EVENT_TOKEN_REFRESH);\r\n if (this.tokenRefreshUrl) {\r\n getToken.call(this, this.tokenRefreshUrl);\r\n }\r\n}", "title": "" }, { "docid": "e3fe9f4d8503642a8d1d6dcacb63a4ae", "score": "0.66924864", "text": "async refreshToken() {\n setInterval(await this.fetchAndParseToken(), 3500000)\n }", "title": "" }, { "docid": "d9b159a6089d0a7f11bb609d5a260836", "score": "0.66903293", "text": "getBearerToken (callback) {\n\n $.get('/api/forge/token/3legged', (res) => {\n\n callback(null, res.access_token)\n })\n }", "title": "" }, { "docid": "e287f6aef0feaf35acae169a5eb30078", "score": "0.6685906", "text": "function tokenGetter() {\n return localStorage.getItem('access_token');\n}", "title": "" }, { "docid": "219a8d6800c5cacee937f88a46026a59", "score": "0.6677866", "text": "function attemptRefreshToken () {\n window.$.ajax({\n type: 'POST',\n url: store.state.metaverseConfig.server + '/oauth/token',\n contentType: 'application/x-www-form-urlencoded;charset=UTF-8',\n data: {\n grant_type: 'refresh_token',\n scope: store.state.account.scope,\n refresh_token: store.state.account.refreshToken\n }\n })\n .done(function (result) {\n store.commit('mutate', {\n update: true,\n property: 'account',\n with: {\n isLoggedIn: true,\n accessToken: result.access_token,\n tokenType: result.token_type,\n createdAt: result.created_at,\n expiresIn: result.expires_in,\n refreshToken: result.refresh_token,\n scope: result.scope\n }\n });\n console.info('Token refresh successful.');\n return true;\n })\n .fail(function (result) {\n // If this fails for any reason, the user must log back in.\n console.info('Refresh failed.');\n logout();\n return false;\n })\n}", "title": "" }, { "docid": "8e2d6995722d571834d4658c582646ed", "score": "0.6650416", "text": "async function refreshGoogleToken(refresh_token) {\n const body = {\n client_id: GOOGLE_CLIENT_ID,\n client_secret: GOOGLE_CLIENT_SECRET,\n refresh_token: refresh_token,\n grant_type: \"refresh_token\",\n };\n const config = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n };\n const response = await fetch(`https://oauth2.googleapis.com/token`, config);\n const resp = await response.json();\n console.log(resp);\n if (response.status !== 200) throw new Error(\"Fail refreshing token\");\n return resp;\n}", "title": "" }, { "docid": "235a8c835faf97e4cab224d579170a90", "score": "0.66503", "text": "refreshToken() {\n this.authenticate();\n }", "title": "" }, { "docid": "b39e59eda28939ed5ca70b4b82d5b8a2", "score": "0.6639209", "text": "function refreshAccessToken(callback) {\n oauth2Client.refreshAccessToken(function (err, tokens) {\n if (err)\n callback(err, tokens);\n else {\n // your access_token is now refreshed and stored in oauth2Client; store these new tokens in a safe place (e.g. database)\n var profile = initialResults.get_profile;\n profile.token = tokens.access_token;\n var updated = new Date();\n Profile.update({\n 'email': profile.email,\n 'channelId': profile.channelId\n }, {$set: {\"accessToken\": tokens.access_token, updated: updated}}, function (err, updateResult) {\n if (err)\n return res.status(500).json({error: 'Internal server error'})\n else if (updateResult == 0)\n return res.status(501).json({error: 'Not implemented'})\n else callback(null, 'success');\n })\n }\n });\n }", "title": "" }, { "docid": "a40246777fa3c4895463acf71efd04ce", "score": "0.6635325", "text": "async getToken() {\n\t\t\tlet access_token = localStorage.getItem('access_token');\n\t\t\tlet expiration = localStorage.getItem('expiration');\n\n\t\t\tif (!access_token || !expiration) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (Date.now() < parseInt(expiration)) {\n\t\t\t\treturn access_token;\n\t\t\t}\n\n\t\t\tawait this.refreshToken()\n\t\t\t\t.then(response => {\n\t\t\t\t\tconsole.info('Token refreshed');\n\t\t\t\t\taccess_token = response.data.access_token;\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\tthis.destroy();\n\t\t\t\t\taccess_token = null;\n\t\t\t\t});\n\n\t\t\treturn access_token;\n\t\t}", "title": "" }, { "docid": "ff0a30702ed48e28812d630dbbabbc40", "score": "0.6627291", "text": "function refresh() {\n click();\n return(\n\t\tAuthenticationService.refreshToken()\n .catch(error => console.log(error))\n\t\t);\n\t\t \n\t}", "title": "" }, { "docid": "267db975e415242c952340b8e5ea0034", "score": "0.66215175", "text": "function checkToken() {\n var now = new Date();\n if (oauth.expire - now < 1) { // request a new token\n $.ajax({\n type: 'POST',\n url: baseURL+oauth.url,\n dataType: 'json',\n async: false,\n success: function(data) {\n oauth.accToken = data.access_token;\n oauth.expire = data.expires_in;\n }\n });\n }\n}", "title": "" }, { "docid": "1c96c6c752f43ac8a74dfab82844aec1", "score": "0.65989023", "text": "parseToken() { \n accessToken = window.location.href.match(/access_token=([^&]*)/)[0].slice(13);\n expiresIn = window.location.href.match(/expires_in=([^&]*)/)[0].slice(11);\n localStorage.setItem('accessToken', accessToken);\n localStorage.setItem('tokenExpiration', Date.now() + (expiresIn * 1000));\n window.history.pushState('Access Token', null, '/');\n }", "title": "" }, { "docid": "f060afea521134ea773e57efb4882855", "score": "0.65962297", "text": "function getAuthFromRefreshTokenAsync(item, callback) {\n // Build request options for authentication.\n const authenticationOptions = {\n \"method\": \"POST\",\n \"url\": `${WWS_URL}${AUTHORIZATION_API}`,\n \"auth\": {\n \"user\": APP_ID,\n \"pass\": APP_SECRET\n },\n \"form\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": item.refreshToken\n }\n };\n\n console.log(\"Issuing Authentication request with grant type 'refresh_token'\");\n\n // Get the JWT Token\n request(authenticationOptions, function(err, response, authenticationBody) {\n if (err) {\n console.log(\"ERROR: Authentication request returned an error.\");\n console.log(err);\n callback(err);\n return;\n }\n\n if (response.statusCode !== 200) {\n // App can't authenticate with refreshToken.\n // Just return an error\n var errormsg = \"Error authenticating, statuscode=\" + response.statusCode.toString();\n console.log(\"ERROR: App can't authenticate, statuscode =\", response.statusCode.toString());\n //console.log(response);\n callback(new Error(errormsg));\n return;\n }\n\n var reqbody = JSON.parse(authenticationBody);\n const accessToken = reqbody.access_token;\n const refreshToken = reqbody.refresh_token;\n const userName = reqbody.displayName;\n const userid = reqbody.id;\n\n callback(null, accessToken, refreshToken, userName, userid);\n });\n}", "title": "" }, { "docid": "3f15ffff592f48ca316887139996f414", "score": "0.65931445", "text": "async refreshToken() {\n let forgeOAuthInternal = this.OAuthClient(config.scopes.internal);\n let forgeOAuthPublic = this.OAuthClient(config.scopes.public);\n let credentialsInternal = await forgeOAuthInternal.refreshToken({ refresh_token: this._session.refreshToken });\n let credentialsPublic = await forgeOAuthPublic.refreshToken(credentialsInternal);\n\n this.setSession(credentialsInternal, credentialsPublic);\n }", "title": "" }, { "docid": "bcaf7b676d9f7d53c712ade156995b99", "score": "0.65866125", "text": "getTokenFromUrl() {\n return new Promise((resolve, reject) => {\n let hash = window.location.hash.substr(1);\n \n const query = qs.parse(hash);\n const token = query.access_token;\n const refreshToken = query.refresh_token;\n const tokenType = query.token_type;\n const expiresIn = query.expiresIn;\n \n if (token) {\n this.setToken(token).then( (token) => {\n return resolve(token);\n });\n //this.emit(AVS.EventTypes.LOGIN);\n this.appLog.log('Logged in.');\n //I don't think we can get refreshToken here.But anyway.\n //Sample Implicit grant \n //https://developer.amazon.com/docs/alexa-voice-service/authorize-companion-site.html#implicit-grant\n //https://localhost:3000/authresponse#access_token=Atza|IwEBIP1l6K6yU9NySgMm&token_type=bearer&expires_in=3600&scope=alexa%3Aall&state=6042d10f-6bcd-49\n if (refreshToken) {\n this.setRefreshToken(refreshToken);\n }\n }else{\n return reject();\n }\n });\n }", "title": "" }, { "docid": "12cf19b46cd5e8e24297b92e5e53476a", "score": "0.658332", "text": "get refreshToken() {\n return this.get(REFRESH_TOKEN_STORAGE_KEY);\n }", "title": "" }, { "docid": "12cf19b46cd5e8e24297b92e5e53476a", "score": "0.658332", "text": "get refreshToken() {\n return this.get(REFRESH_TOKEN_STORAGE_KEY);\n }", "title": "" }, { "docid": "5af5d2055ce754ef23d46c2d72cec62c", "score": "0.65815526", "text": "function L(e,t){return Promise.resolve().then((function(){var n,o;if(t&&(n=t.accessToken,o=t.refreshToken),!n&&!o)throw new c.a(\"A valid access or refresh token object is required\");var i=e.options.clientId;if(!i)throw new c.a(\"A clientId must be specified in the OktaAuth constructor to revoke a token\");var a=T(e).revokeUrl,u=Object(r.D)({token_type_hint:o?\"refresh_token\":\"access_token\",token:o||n}).slice(1),f=btoa(i);return s.a.post(e,a,u,{headers:{\"Content-Type\":\"application/x-www-form-urlencoded\",Authorization:\"Basic \"+f}})}))}", "title": "" }, { "docid": "2b6d20cc6ec621d1f734eda3005d5fa7", "score": "0.6551161", "text": "function completeTokenRefreshFlow() {\n var ret = Adapter.get().defer();\n var tokenResponse = getPreviousToken();\n var state = JSON.parse(sessionStorage[tokenResponse.state]);\n var refresh_token = tokenResponse.refresh_token;\n\n Adapter.get().http({\n method: 'POST',\n url: state.provider.oauth2.token_uri,\n data: {\n grant_type: 'refresh_token',\n refresh_token: refresh_token\n },\n }).then(function(authz) {\n authz = $.extend(tokenResponse, authz);\n ret.resolve(authz);\n }, function() {\n console.warn('Failed to exchange refresh_token for access_token', arguments);\n ret.reject('Failed to exchange refresh token for access token. ' +\n 'Please close and re-launch the application again.');\n });\n\n return ret.promise;\n}", "title": "" }, { "docid": "5eb564b360eefac6836932cbc6e8691f", "score": "0.6544522", "text": "refreshTokens(refreshToken) {\n const data = {\n grant_type: CLIENT_GRANT_REFRESH,\n refresh_token: refreshToken,\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET\n // scope: CLIENT_SCOPE // this must be disabled to get valid access tokens !!!\n };\n\n const formBody = Object.keys(data)\n .map(key => encodeURIComponent(key) + \"=\" + encodeURIComponent(data[key]))\n .join(\"&\");\n\n let promise = fetch(BASE_URL + \"oauth/token\", {\n method: \"POST\",\n body: formBody,\n headers: new Headers({\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n })\n })\n .then(res => {\n if (!res.ok) {\n console.log(res.statusText);\n return false;\n } else {\n return res.json();\n }\n })\n .then(data => {\n if (data !== false) {\n store.dispatch(\"storeAccessToken\", data.access_token);\n store.dispatch(\"storeRefreshToken\", data.refresh_token);\n } else {\n console.log(\"Refreshing tokens failed. Logging out user.\");\n store.dispatch(\"userLogOut\");\n }\n });\n return promise;\n }", "title": "" }, { "docid": "ea70aad8a8fabd7f9b71d8e7d96d9399", "score": "0.65374905", "text": "function tokenGetter() {\n return localStorage.getItem(\"access_token\");\n }", "title": "" }, { "docid": "6521e348af24a53536c48e8dffd1d8bc", "score": "0.65279895", "text": "getAccessToken(){\n const clientId='d4fa1d8991464b03bd43ee51eb645265';\n const redirectUri='https://CASPER.surge.sh';\n if (accessToken){\n //console.log('Already got one');\n return accessToken;\n }\n if (window.location.href.match(/access_token=([^&]*)/)) {\n let tokenString=window.location.href.match(/access_token=([^&]*)/);\n accessToken=tokenString[1];\n let expireString=window.location.href.match(/expires_in=([^&]*)/);\n let expiration=expireString[1];\n //erase token from history so it doesn't try to use an expired on to authenticate\n window.setTimeout(() => accessToken = '', expiration*1000);\n window.history.pushState('Access Token', null, '/');\n return accessToken;\n } else {\n //console.log('redirecting');\n window.location.href=`https://accounts.spotify.com/authorize?client_id=${clientId}&response_type=token&scope=playlist-modify-public&redirect_uri=${redirectUri}`;\n }\n }", "title": "" }, { "docid": "8030c80d9283e95b0ad9f8ba4d308fcb", "score": "0.65213585", "text": "getGrantTypeRefreshToken(){\n if(!this.api){\n return null\n }\n return this.api.securityDefinitions.oauth2_password.flow\n }", "title": "" }, { "docid": "a84f643d00f964279ba5e30ef0743035", "score": "0.65158826", "text": "function atteptRefresh(refreshTokenString) {\n return axios.post(process.env.REACT_APP_API_HOST+'/api/profile-with-token-refresh', {\n 'refresh_token': refreshTokenString,\n })\n}", "title": "" }, { "docid": "9cb6242c5974723f93a8cc6a4b8b2a14", "score": "0.65129477", "text": "onChanged() {\n // TODO: update this._access_token\n }", "title": "" }, { "docid": "0d1b1e102fd4c0945d43fffbd5ac711d", "score": "0.6509292", "text": "function getTokens() {\n var redirect_uri = location.protocol + '//' + location.host + location.pathname;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n console.log(xhttp.responseText);\n var json = JSON.parse(xhttp.responseText);\n accToken = json.access_token;\n refToken = json.refresh_token;\n //Store tokens\n sessionStorage.setItem('accessToken', accToken);\n sessionStorage.setItem('refreshToken', refToken);\n }\n };\n xhttp.open(\"GET\", \"php/getTokens.php?authToken=\" + sessionStorage.getItem('authToken') + \"&redirect_uri=\" + redirect_uri, true);\n xhttp.send();\n}", "title": "" }, { "docid": "a4f969b73c1a593ac5012608ac5b6f64", "score": "0.65038955", "text": "get accessToken() {\n return new Promise(async (resolve) => {\n if(this.accessTokenData === null) {\n this.accessTokenData = this.getCookieValue(\"access\");\n }\n if(this.isTokenExpired(this.accessTokenData)){\n console.log(\"access expired, refreshing\");\n await this.refresh();\n }\n resolve(this.accessTokenData);\n });\n }", "title": "" }, { "docid": "6da3119596c06f9563d72b9977e02386", "score": "0.6498553", "text": "function getNewToken(oAuth2Client) {\n\tconst authUrl = oAuth2Client.generateAuthUrl({\n\t\taccess_type: 'offline',\n\t\tscope: SCOPES,\n\t});\n\tconsole.log('Authorize this app by visiting this url:', authUrl);\n\tconst rl = readline.createInterface({\n\t\tinput: process.stdin,\n\t\toutput: process.stdout,\n\t});\n\trl.question('Enter the code from that page here: ', (code) => {\n\t\trl.close();\n\t\toAuth2Client.getToken(code, (err, token) => {\n\t\t\tif (err) reject('Error while trying to retrieve access token' + err);\n\t\t\toAuth2Client.setCredentials(token);\n\t\t\t// Store the token to disk for later program executions\n\t\t\tfs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => {\n\t\t\t\tif (err) reject(err);\n\t\t\t\tconsole.log('Token stored to', TOKEN_PATH);\n\t\t\t});\n\t\t\tresolve(oAuth2Client);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "934a8f9109c04a1aae07ffeebdce9e26", "score": "0.64954764", "text": "async function useRefreshToken(auth_code) {\n try{\n let newToken=await oauth2.accessToken.create({refresh_token: auth_code}).refresh();\n\n const user = jwt.decode(newToken.token.id_token);\n const databaseValue={};\n newToken.token.userData=user;\n databaseValue.microsoft_username=newToken.token.userData.preferred_username;\n databaseValue.microsoft_access_token_expires=newToken.token.expires_in;\n databaseValue.microsoft_access_token=newToken.token.access_token;\n databaseValue.microsoft_refresh_token=newToken.token.refresh_token;\n databaseValue.login_timestamp=new Date().getTime();\n\n var queryText='UPDATE public.\"Credentials\" SET microsoft_refresh_token=$2, microsoft_access_token_expires=$3, microsoft_access_token=$4, login_timestamp=$5 WHERE microsoft_username=$1 RETURNING *';\n var valueForInsert=[databaseValue.microsoft_username, databaseValue.microsoft_refresh_token, databaseValue.microsoft_access_token_expires, databaseValue.microsoft_access_token, databaseValue.login_timestamp];\n\n client.query(queryText, valueForInsert, (err, res) => {\n if (err) {\n console.log(err.stack)\n } else {\n // console.log(\"SUKSES\", res.rows)\n }\n });\n return newToken.token.access_token;\n }\n catch(err){\n console.log(err);\n }\n}", "title": "" }, { "docid": "df7953bbb2ff79c82b0206ebd2691efe", "score": "0.64892596", "text": "function refreshAuthorizationToken(parsedTokens) {\n console.log(\"Refreshing token.\");\n return axios({\n url: `https://api.login.yahoo.com/oauth2/get_token`,\n method: \"post\",\n headers: {\n Authorization: `Basic ${AUTH_HEADER}`,\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n data: qs.stringify({\n redirect_uri: \"oob\",\n grant_type: \"refresh_token\",\n refresh_token: parsedTokens.refresh_token,\n }),\n }).catch((err) => {\n console.error(`Error in refreshAuthorizationToken(): ${err}`);\n });\n}", "title": "" }, { "docid": "567f0187e6f45109e4a477e11030ca03", "score": "0.64828044", "text": "function refreshToken(req, callback){\n\tvar logger = log.logger_omsAdminPanel;\n\tvar currentToken = getToken(req);\n\tinsertTokenDB(currentToken, function(err){\n\t\tif (err) {\n\t\t\tcallback(err);\n\t\t\tlogger.error(\"Error refreshing token. Error : \\n\" + err.stack);\n\t\t} else {\n\t\t\treq.user.iat = Date.now();\n\t\t\tvar newToken = jwt.sign(req.user, secretToken, { expiresIn: 60 * expMins });\n\t\t\tcallback(false, newToken);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "cfbcec293a25bff6a32bf69a3b616dc0", "score": "0.64787376", "text": "get refreshToken() {\n return this.refreshToken;\n }", "title": "" }, { "docid": "5816d03858e16d152e5b80d426ad207a", "score": "0.6475966", "text": "getAccessToken() {\n //If we already have a token use that\n if(userAccessToken) {\n return userAccessToken;\n }\n\n //Try to get an access token and expire time from the url\n const accessTokenMatch = window.location.href.match(/access_token=([^&]*)/);\n const expiresInMatch = window.location.href.match(/expires_in=([^&]*)/);\n\n //If we got the access token and expire time then set their vakues\n if(accessTokenMatch && expiresInMatch) {\n userAccessToken = accessTokenMatch[1];\n const expiresIn = Number(expiresInMatch[1]);\n\n //Wipes the access token and URL parameters\n window.setTimeout(() => userAccessToken = '', expiresIn * 1000);\n window.history.pushState('Access Token', null, '/');\n return userAccessToken;\n } else {\n //If we did not get an access token and expire time, then redirect to a url that has them\n const accessUrl = `https://accounts.spotify.com/authorize?client_id=${clientID}&response_type=token&scope=playlist-modify-public&redirect_uri=${redirectUri}`;\n window.location = accessUrl;\n }\n }", "title": "" }, { "docid": "dce834773c2bd3ef6d9034056acf5a3c", "score": "0.64553875", "text": "function getToken() {\n var url = document.URL;\n var accessToken = url.substring(url.indexOf(\"access_token=\") + 13, url.length);\n return accessToken;\n }", "title": "" }, { "docid": "354692ef13605e174d06fca790ab965d", "score": "0.64320064", "text": "function refreshToken(timeToWait) {\n\tsetTimeout(function() {\n\t\tconsole.log(new Date() + ' Refreshing access token');\n\t\trest.post('https://api.att.com/oauth/token', {\n\t\t\tdata: {\n\t\t\t\t\"client_id\": \"3c851c56952d91171c634e63c64d22ea\",\n\t\t\t\t\"client_secret\": \"21a5e116495c396d\",\n\t\t\t\t\"grant_type\": \"refresh_token\",\n\t\t\t\t\"refresh_token\": RT\n\t\t\t}\n\t\t}).on('complete', function(data, response) {\n\t\t\tif (response.statusCode == 200) {\n\t\t\t\tAT = data.access_token;\n\t\t\t\tRT = data.refresh_token;\n\t\t\t\tconsole.log(new Date() + ' Refreshed and got access token ' + AT);\n\t\t\t\trefreshToken(6000);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(new Date() + '' + data);\n\t\t\t\trefreshToken(600);\n\t\t\t}\n\t\t});\n\t}, timeToWait * 1000);\n}", "title": "" }, { "docid": "ab6a8c6719c50b893e25818a43b69b44", "score": "0.64188933", "text": "async function refreshAccessToken(ACCESS_TOKEN_REFRESH) {\n let authorization = Buffer.from(my_client_id + \":\" + my_client_secret).toString('base64');\n let data = {\n grant_type: \"refresh_token\",\n refresh_token: ACCESS_TOKEN_REFRESH,\n\n };\n\n await fetch(\"https://accounts.spotify.com/api/token\", {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': 'Basic ' + authorization,\n 'Accept': 'application/json'\n },\n body: queryString.stringify(data)\n\n })\n .then(res => {\n return res.json()\n })\n .then(data => {\n console.log(data);\n req.session.ACCESS_TOKEN = data.access_token;\n res.redirect(\"/\");\n })\n .catch(err => {\n console.log(err);\n })\n\n}", "title": "" }, { "docid": "a5358e4be6ee792b0f496c216b2dcdbb", "score": "0.6417991", "text": "async function refreshAccessToken() {\n const file = await fetch(\"config.json\");\n const text = await file.text();\n const config = JSON.parse(text);\n let token = { access_token: \"\" };\n if (config.authEnabled) {\n const data = await fetch(config.oauthUri, {\n method: \"POST\",\n headers: getHeaders(),\n body: JSON.stringify({\n client_id: config.client_id,\n client_secret: config.client_secret,\n audience: config.audience,\n grant_type: config.grant_type,\n }),\n });\n token = await data.json();\n // add json web token to authentication header\n authHeader = { Authorization: `bearer ${token.access_token}` };\n }\n }", "title": "" }, { "docid": "82bd11d021740bdd50f21127fc271c88", "score": "0.6415455", "text": "async function controlRefreshedAccessToken() {\n\ttry {\n\t\tawait model.requestRefreshedAccessToken();\n\t\tspotifyData.val = model.state;\n\t\texpires_in.val = model.state.expiresIn;\n\t} catch (err) {\n\t\tconsole.error(err);\n\t}\n}", "title": "" }, { "docid": "ec73701492044ca2f4dda498d0b0a1e1", "score": "0.6406663", "text": "async refreshToken(refreshToken) {\n try {\n if (!refreshToken) {\n throw new rest_1.HttpErrors.Unauthorized(`Error verifying token : 'refresh token' is null`);\n }\n const userRefreshData = await this.verifyToken(refreshToken);\n const user = await this.userService.findUserById(userRefreshData.userId.toString());\n const userProfile = this.userService.convertToUserProfile(user);\n // create a JSON Web Token based on the user profile\n const token = await this.jwtService.generateToken(userProfile);\n return {\n accessToken: token,\n };\n }\n catch (error) {\n throw new rest_1.HttpErrors.Unauthorized(`Error verifying token : ${error.message}`);\n }\n }", "title": "" }, { "docid": "6acf34b3367715ee387319ddf3e3ca85", "score": "0.64020115", "text": "function getToken() {\n\t$.ajax({\n\t\turl: \"ajax/ajax.php\",\n\t\ttype: \"POST\",\n\t\tdata: {\n\t\t\tcall: \"getToken\",\n\t\t\tcode: getCode()\n\t\t}\n\t})\n\t\t.done(function (data) {\n\t\t\ttry {\n\t\t\t\tvar response = jQuery.parseJSON(data);\n\t\t\t\tif (!response.error || response.error.length === 0) {\n\t\t\t\t\taccessToken = response.access_token;\n\t\t\t\t\trefreshToken = response.refresh_token;\n\t\t\t\t\tlog(\"Toshl Access Token: \" + accessToken);\n\t\t\t\t\tif (userName.length === 0) {\n\t\t\t\t\t\tgetMe();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tredirect();\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tlogError(\"Toshl API error, please try again later\", e);\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "3a13eb559583830fa3478819039c6ba7", "score": "0.6397445", "text": "async refreshIdToken(forceRefresh) {\n var _a, _b, _c;\n // If the idToken didn't expire, return.\n if (!forceRefresh && Date.now() < ((_b = (_a = this.user) === null || _a === void 0 ? void 0 : _a.tokenManager.expiresAt) !== null && _b !== void 0 ? _b : 0))\n return;\n // If a request for a new token was already made, then wait for it and then return.\n if (this.refreshTokenRequest) {\n return await this.refreshTokenRequest;\n }\n try {\n // Calculated expiration time for the new token.\n const expiresAt = getExpiresAt();\n // Save the promise so that if this function is called\n // anywhere else we don't make more than one request.\n this.refreshTokenRequest = this.api('token', {\n grant_type: 'refresh_token',\n refresh_token: (_c = this.user) === null || _c === void 0 ? void 0 : _c.tokenManager.refreshToken,\n }).then(({ id_token: idToken, refresh_token: refreshToken }) => {\n // Merge the new data with the old data and save it locally.\n return this.persistSession({\n ...this.user,\n // Rename the data names to match the ones used in the app.\n tokenManager: { idToken, refreshToken, expiresAt },\n });\n });\n await this.refreshTokenRequest;\n }\n finally {\n this.refreshTokenRequest = null;\n }\n }", "title": "" }, { "docid": "7f35da1784acb4223e20134ca8685aef", "score": "0.63866574", "text": "getAccessToken(refresh_token) {\n\t\tlet url = (process.env.NODE_ENV !== 'production') ? 'http://localhost:3200/refresh' : 'https://spotitubes.com/server/refresh';\n\t\taxios({\n\t\t method: 'POST',\n\t\t url: url,\n\t\t data: {\n\t\t \t'refresh_token': refresh_token\n\t\t }\n\t\t})\n\t\t.then((response) => {\n\t\t\tconsole.log(response.data);\n\t\t\tif(response.data.access_token){\n\t\t\t\tdocument.cookie = 'access_token=' + response.data.access_token;\n\n\t\t\t\tthis.setState({\n\t\t\t\t\tauthorized: true,\n\t\t\t\t\taccess_token: response.data.access_token\n\t\t\t\t});\n\n\t\t\t\tvar ref = firebase.database().ref('videos/' + this.state.user_id);\n\t\t\t\tref.on('value', (snapshot) => {\n\t\t \t\tthis.setState({\n\t\t \t\t\tsaved: snapshot.val()\n\t\t \t\t});\n\t\t \t\tthis.getUserTracks();\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\t\t.catch((error) => {\n\t\t\tconsole.log(error);\n\t\t\tthis.setState({\n\t\t\t\tauthorized: false,\n\t\t\t\taccess_token: '',\n\t\t\t});\n\t\t\tconsole.log(error);\n\t\t});\n\t}", "title": "" }, { "docid": "abd919a233ffe3bf6beb55956d44c51a", "score": "0.63544637", "text": "function getNewToken() {\n $.getJSON('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D%22https%3A%2F%2Fopentdb.com%2Fapi_token.php%3Fcommand%3Drequest%22&format=json&diagnostics=true&callback=', tokenCallback);\n\n function tokenCallback(data) { token = data.query.results.json.token; }\n}", "title": "" }, { "docid": "4769ad70c11cd3f03de6545524784b19", "score": "0.634264", "text": "refreshAccessToken(req, res, next) {\n\t\tco(function* () {\n\t\t\tconst refreshToken = yield RefreshToken.findOne({ _id: req.body.clientId }).exec();\n\t\t\tif (!refreshToken) {\n\t\t\t\treturn res.status(400).end();\n\t\t\t}\n\t\t\tconst salt = refreshToken.salt;\n\t\t\tconst unhashedToken = req.body.refreshToken;\n\t\t\tconst hashedToken = crypto.pbkdf2Sync(unhashedToken, new Buffer(salt, 'base64'), 10000, 64).toString('base64');\n\t\t\tif (hashedToken !== refreshToken.token) {\n\t\t\t\treturn res.status(400).end();\n\t\t\t}\n\n\t\t\tconst user = yield User.findOne({ _id: refreshToken.user_id }).exec();\n\t\t\tif (!user) {\n\t\t\t\treturn res.status(400).end();\n\t\t\t}\n\t\t\trefreshToken.ip = req.ip;\n\t\t\trefreshToken.geo = geoip.lookup(req.ip);\n\t\t\trefreshToken.lastActiveTime = new Date();\n\t\t\tyield refreshToken.save();\n\n\t\t\tconst payload = user.toJSON();\n\t\t\tconst currentTime = moment.utc();\n\t\t\tpayload.iat = currentTime.unix();\n\t\t\tpayload.ext = currentTime.add(1, 'days').unix();\n\t\t\tlet escaped = JSON.stringify(payload);\n\t\t\tescaped = encodeURI(escaped);\n\t\t\tconst token = jwt.sign(escaped, config.secret);\n\t\t\treturn res.json({ accessToken: token });\n\t\t}).catch((err) => {\n\t\t\tnext(err);\n\t\t});\n\t}", "title": "" }, { "docid": "cc22896c870c9e2c02c913fc6b135c0b", "score": "0.6333546", "text": "__refresh3LeggedToken (session, scope) {\n\n return new Promise((resolve, reject) => {\n\n var url = this._config.oauth.baseUri +\n this._config.oauth.refreshTokenUri\n\n request({\n url: url,\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n json: true,\n form: {\n client_secret: this._config.oauth.clientSecret,\n client_id: this._config.oauth.clientId,\n refresh_token: session.forge.refreshToken,\n grant_type: 'refresh_token',\n scope: scope\n }\n\n }, (err, response, body) => {\n\n try {\n\n if (err) {\n\n return reject(err)\n }\n\n if (body && body.errors) {\n\n return reject(body.errors)\n }\n\n if([200, 201, 202].indexOf(\n response.statusCode) < 0){\n\n return reject(response)\n }\n\n session.forge.refreshToken =\n body.refresh_token\n\n body.scope = scope\n\n return resolve (body)\n\n } catch (ex) {\n\n return reject(ex)\n }\n })\n })\n }", "title": "" }, { "docid": "33c599096af1939769de7716667e160f", "score": "0.6331498", "text": "function z(e,t){return Object(D.isToken)(t)?q(e,{responseType:e.options.pkce?\"code\":Object(D.isAccessToken)(t)?\"token\":\"id_token\",scopes:t.scopes,authorizeUrl:t.authorizeUrl,userinfoUrl:t.userinfoUrl,issuer:t.issuer}).then((function(e){var n=e.tokens;return Object(D.isIDToken)(t)?n.idToken:n.accessToken})):Promise.reject(new o.c(\"Renew must be passed a token with an array of scopes and an accessToken or idToken\"))}", "title": "" }, { "docid": "b75cb178658def7453a3550b3b491f6f", "score": "0.6324387", "text": "refreshAppCheckToken(token){}", "title": "" }, { "docid": "17b1ebe4a0a283803f44cdd88e37f9f5", "score": "0.63181657", "text": "function refresh(appid, secret, store, key, cb) {\n var url =\n 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' +\n appid +\n '&secret=' +\n secret\n return request(url, function(error, response, body) {\n if (error) {\n return cb(error)\n }\n body = JSON.parse(body)\n if (body && body.errcode) {\n var err = new Error(body.errmsg)\n err.name = 'WechatAPIError'\n err.code = body.errcode\n return cb(err)\n }\n\n const token = {\n access_token: body.access_token,\n expires_in: new Date().getTime() + (body.expires_in - 10) * 1000,\n }\n\n store.save(key, token).then(function(t) {\n cb(null, token)\n })\n })\n}", "title": "" }, { "docid": "cb9d06f7b08fe838d3382562bad9202b", "score": "0.63154507", "text": "get access_token() {\n return this._access_token;\n }", "title": "" }, { "docid": "90bfe5407a3cc01d22c4e8041a478da6", "score": "0.6306995", "text": "function getAccessToken(callback) {\n $.ajax(ajaxTokenObj(SPOTIFY_TOKEN_URL)).done(function(data) {\n callback(data.access_token);\n });\n }", "title": "" }, { "docid": "f49f52748809247cea05e689d8231e28", "score": "0.6302837", "text": "function get_access_token(oauth_token) {\n\t var url = o.url + '/oauth/access_token',\n\t params = timenonce(getAuth(o)),\n\t request_token_secret = token('oauth_request_token_secret');\n\t params.oauth_token = oauth_token;\n\t params.oauth_signature = ohauth_1.signature(\n\t o.oauth_secret,\n\t request_token_secret,\n\t ohauth_1.baseString('POST', url, params));\n\n\t // ## Getting an access token\n\t // The final token required for authentication. At this point\n\t // we have a `request token secret`\n\t ohauth_1.xhr('POST', url, params, null, {}, accessTokenDone);\n\t o.loading();\n\t }", "title": "" }, { "docid": "8003d01c2e3171e28b69028633ed71ef", "score": "0.6298814", "text": "async refreshLogin(refreshToken) {\n // pass refresh token and receive a new access token\n const result = await AuthSession.refreshAsync({\n clientId: this.config['clientId'],\n clientSecret: this.config['clientSecret'],\n redirectUri: this.config['redirect_uri'],\n refreshToken: refreshToken,\n extraParams: {\n grant_type: this.config['grant_type'],\n },\n }, { tokenEndpoint: this.config['endpoints']['token'] });\n\n // refresh again in ~6 minutes\n setTimeout(() => {\n this.refreshLogin(refreshToken);\n }, 350000);\n\n // notify whole room of new access token\n socket.emit('set-access-token', result['accessToken']);\n }", "title": "" }, { "docid": "260254518b4c595820ccf3004d2ecf18", "score": "0.62968326", "text": "function createRefreshToken(payload){\n return jwt.sign(payload, SECRET_KEY, {expiresIn: expiresInRefreshToken})\n}", "title": "" }, { "docid": "b103895e13cfdd6b6eea78c2f0311bd9", "score": "0.6283383", "text": "function refreshAccessTokenBeforeItExpires(tokenInfo) {\n var delay = tokenInfo.expiresIn * 1000;\n\n // We actually have to refresh the access token _before_ it expires.\n // If the access token expires in one hour, this should refresh it in\n // about 55 mins.\n delay = Math.floor(delay * 0.91);\n\n window.setTimeout(refreshAccessToken, delay, tokenInfo.refreshToken);\n }", "title": "" } ]
c229109c936e070e3eac537b1d584bf5
Make sure we have the indexes we need
[ { "docid": "4f01cadf74700af96226fd23a45fb1f2", "score": "0.5681511", "text": "function initialize (cb) {\n collection.ensureIndex([{ \"__idx\": -1 }], { unique: true }, function (err) {\n if (err) return cb(err);\n counter.ensureIndex([{ \"_id\": 1, \"seq\": -1 }], { unique: true }, cb);\n });\n }", "title": "" } ]
[ { "docid": "28285c7823d43cde0af98d48aa24fec8", "score": "0.7253839", "text": "setupIndexes() {\n return this.es.indices.exists({index: this.getIndex(TWEET)})\n .then((exists) => {\n if (! exists) {\n log.info('adding indexes')\n this.addIndexes()\n } else {\n log.warn('indexes already present, not adding')\n }\n })\n .catch((e) => {\n log.error(e)\n })\n }", "title": "" }, { "docid": "aea0dddc9d3e91df387289c166683095", "score": "0.7245534", "text": "function rebuildOfferingIndexes() {\n Offering.ensureIndexes(function(err) {\n if (err) { \n console.log('Offering: error rebuilding indexes: ' + err); \n } else {\n console.log('Offering: indexes re-built succesfully.');\n } \n });\n}", "title": "" }, { "docid": "8fcfd1ede6e255c0482fba4c9d9ea944", "score": "0.7224091", "text": "setupIndexes() {\n this.es.indices.exists({index: this.esTweetIndex})\n .then((exists) => {\n if (! exists) {\n log.info('adding indexes')\n this.addIndexes()\n } else {\n log.info('indexes already present, not adding')\n }\n })\n }", "title": "" }, { "docid": "d995fec0ef96faaaa52829df0851d61b", "score": "0.6619053", "text": "get hasIndex() {\n return this.globalSecondaryIndexes.length + this.localSecondaryIndexes.length > 0;\n }", "title": "" }, { "docid": "65cab51b7955ee8bd0a64fe1790c1059", "score": "0.6599062", "text": "async verifyIndexExists() {\n const indexName = this.getIndexName();\n try {\n return await head({\n hostname: this.host,\n path: `/${indexName}`,\n port: this.port,\n })\n } catch (err) {\n return await this.createIndex();\n }\n\n }", "title": "" }, { "docid": "8636b67ca06160bede6938ab270fb638", "score": "0.65830433", "text": "empty () {\n this.indexes = {\n primary: Index.create({ name: 'primary', fields: ['_id'] })\n }\n }", "title": "" }, { "docid": "d2cee4d5a759a3d964c7e5550471a29e", "score": "0.6441837", "text": "async afterConnected() {\n\t\t/**\n\t\t * Create necessary indexes\n\t\t */\n\t\tawait this.adapter.collection.createIndex(\n\t\t\t{ code: 1 },\n\t\t\t{ unique: true }\n\t\t);\n\t\tawait this.adapter.collection.createIndex(\n\t\t\t{ code: 1, name: 1 },\n\t\t\t{ unique: true }\n\t\t);\n\t\tawait this.adapter.collection.createIndex(\n\t\t\t{ site: 1, code: 1 },\n\t\t\t{ unique: true }\n\t\t);\n\t}", "title": "" }, { "docid": "ec10a1349dda637d2cda95f9f323c50d", "score": "0.63876003", "text": "constructor() {\n this.indices = {};\n this.indexedFiles = {};\n }", "title": "" }, { "docid": "ae896db64c069afb52d13dbd4d5a079e", "score": "0.6342007", "text": "function _clearIndexes() {\n $.each(_indexList, function (indexName, index) {\n index.fileInfos = [];\n });\n }", "title": "" }, { "docid": "d60f2d54509d34521b052a5bba05bac6", "score": "0.63281536", "text": "validateIndex() {\n // if (this.filter && !isEmpty(this.filter)) {\n // throw new Error('cannot validate index when filter is active');\n // }\n const leftData = this.leftIndexRef.val;\n const rightData = this.rightIndexRef.val;\n \n const inconsistencies = [];\n\n // for every right id R added to the left id L,\n // L must also be added to R\n for (let leftId in leftData) {\n const rightIds = leftData[leftId];\n for (let rightId in rightIds) {\n const rightEntry = rightData[rightId];\n if (!rightEntry[leftId]) {\n inconsistencies.push([leftId, rightId]);\n }\n }\n }\n\n // for every L added to R,\n // R must also be added to L\n for (let rightId in rightData) {\n const leftIds = rightData[rightId];\n for (let leftId in leftIds) {\n const leftEntry = leftData[leftId];\n if (!leftEntry[rightId]) {\n inconsistencies.push([leftId, rightId]);\n }\n }\n }\n\n\n // TODO: check if all indexed objects actually exist in leftEntryRef + rightEntryRef\n\n return inconsistencies;\n }", "title": "" }, { "docid": "140976a827577820888adec4564177cb", "score": "0.63168263", "text": "createIndex() {\n errors.throwNotImplemented(\"creating an index on a SODA collection\");\n }", "title": "" }, { "docid": "f440e122c06ec8ad917fce586229bedc", "score": "0.6045656", "text": "GetIndices() {}", "title": "" }, { "docid": "bb32875a9c63ccac12790f053a38161d", "score": "0.60206246", "text": "function checkIsIndexing() {\n // Check if indexing\n return $http.get('info?_content_type=json&type=index').\n success(function(data, status) {\n $scope.isIndexing = data.index == 'true';\n if ($scope.isIndexing) {\n $timeout(checkIsIndexing, indexCheckInterval);\n }\n // Get the number of records (template, records, subtemplates)\n $http.get('qi?_content_type=json&' +\n 'template=y or n or s&summaryOnly=true').\n success(function(data, status) {\n $scope.numberOfIndexedRecords = data[0]['@count'];\n });\n });\n }", "title": "" }, { "docid": "b11c8425a3116e16acff6001ef5d1497", "score": "0.59424686", "text": "function checkIndexers () {\n console.log(\"check...\");\n indexers.forEach(function (aIndexer, aIndex) {\n try {\n aIndexer.postMessage({type: \"checkLocation\", index: aIndex});\n } catch (ex) { console.exception(ex); }\n });\n}", "title": "" }, { "docid": "2e75df4324a8ad51a192ee06ed027ab1", "score": "0.5937393", "text": "function initIndex(){\n\t\tlet state = new State({\n items: null,\n itemsSim: null,\n isIndex: true,\n filters: {\n categories: null,\n\t\t\tkeywords: null,\n\t\t\tlat: null,\n\t\t\tlng: null,\n\t\t\tumkreis: null,\n\t\t\tstartDate: null,\n\t\t\tendDate: null\n\t\t\t}\n\t\t});\n\t\tinitMap(state);\n\t\tinitFilterForm(state);\n\t\tsubmitFilterForm(state);\n\t\tinitDatePicker(state, false);\n }", "title": "" }, { "docid": "d856ff7b4921e589cf0b1a98311eeaa7", "score": "0.5894996", "text": "async function updateSearchIndex( ctx ) {\n if( indexingDisabled ) {\n return;\n }\n Log.debug('Indexing %s', ctx.key );\n try {\n let { account, repo, branch } = ctx;\n // Create a scoped connection to the search DB.\n let scope = await db.makeScope( account, repo, branch );\n // Load filesets for the target branch. ** NOTE **: The original longterm\n // design goal was to allow fileset configs to be defined in the repo,\n // which meant the possibility of them changing between commits. This\n // could have a considerable impact on the following code, and for now\n // only the fileset config for the branch is considered.\n let _filesets = await filesets.getFilesets( ctx, branch );\n // Filter out non-searchable filesets.\n _filesets = _filesets.filter( fs => fs.searchable );\n // Perform the index.\n await currentStateIndex( scope, _filesets, ctx );\n }\n catch( e ) {\n Log.error('Error indexing [A] %s', ctx.key, e );\n }\n }", "title": "" }, { "docid": "b38d768d847c87a325c66275abf26aa1", "score": "0.58888507", "text": "function clearIndexes() {\n for (var s in States) {\n if (States.hasOwnProperty(s)) {\n indexes[States[s]] = [];\n }\n }\n}", "title": "" }, { "docid": "b3336057eaa7222f2fe6d75a92a3e071", "score": "0.5774858", "text": "function setupIndex(index){\n\t//Create index of all keywords that can be searched for\n\t// var index = createLunrIndex();\n\tindex = addToIndex(featuredRef, index);\n\tindex = addToIndex(pastRef, index);\n\tindex = addToIndex(presentRef, index);\n\tindex = addToIndex(futureRef, index);\n\tindex = addToIndex(spacesRef, index);\n\n\tvar savedIndex = index.toJSON();\n\n\t// Put the index into storage to be used in different function\n\tlocalStorage.setItem('savedIndex', JSON.stringify(savedIndex));\n}", "title": "" }, { "docid": "e2f3ff545d165555236e550a86c37647", "score": "0.57658756", "text": "enterCreate_index(ctx) {\n\t}", "title": "" }, { "docid": "02a410a3326c3fb07605e562c27228e6", "score": "0.5760692", "text": "function initializeElasticSearch() {\n return new Promise((resolve, reject) => {\n indexExists()\n .then((exists) => {\n if (exists) {\n console.log('\\nElasticSearch index and mapping has been initialized.\\n');\n return deleteIndex();\n }\n })\n .then(() => {\n return initIndex()\n .then(initMapping)\n .then(() => resolve());\n })\n .catch(err => reject(err));\n });\n}", "title": "" }, { "docid": "6ece8c21f465319465d9aa317bf80a40", "score": "0.5755535", "text": "SetIndices() {}", "title": "" }, { "docid": "8af50faa6e78bf7ef3053e14d5fef21d", "score": "0.57381785", "text": "constructor() {\n this.indexes = {};\n this.book = [];\n this.vbook = [];\n }", "title": "" }, { "docid": "89e7c90009931637025df2f5710b1b69", "score": "0.5736418", "text": "ensureIndex({ collection = 'Default', options = {} }) {\n return new Promise((resolve, reject) => {\n // Ensure Indexing from the collection and return promise\n return this.dataStore\n .ensureIndex(options, (err, result) => err? reject(err) : resolve(result))\n })\n }", "title": "" }, { "docid": "2ce79d65286fcfa09705fdd713b001ec", "score": "0.57002246", "text": "loadData() {\n if (this.dataLoaded) return;\n\n if (!this.storage) {\n this.log(\"No local storage available, switch to degraded mode\");\n this.fetch();\n return;\n }\n\n let storedIndex = this.storage.getItem(\"SearchinGhost_index\");\n if (storedIndex) {\n this.log(\"Found an index stored locally, loads it\");\n this.config.onIndexBuildStart();\n this.index.import(storedIndex);\n this.dataLoaded = true;\n this.config.onIndexBuildEnd(this.index);\n this.validateCache();\n } else {\n this.log(\"No already stored index found\");\n this.fetch();\n }\n }", "title": "" }, { "docid": "5e423e36e70f04557aea9d98e82638d3", "score": "0.56976473", "text": "GetIndexCount() {}", "title": "" }, { "docid": "f5f7907bb296cc44fc9875c548fa8ba9", "score": "0.56613916", "text": "async afterConnected() {\n\t\t// await this.adapter.collection.createIndex({ name: 1 });\n\t}", "title": "" }, { "docid": "8a214eeac62846b6b3b12e014f60ea5e", "score": "0.56550246", "text": "function test_index_creation () {\n\tdescribe ('Contact Address Book API Tests Suite #1 : Load Resources', function () {\n\t\tit('Test to check index creation on load', function (success) {\n\t\t\tapi.get('/')\n\t\t\t.set('Accept', 'application/json')\n\t\t\t.expect(200, success);\n\t\t});\n\t});\n\n}", "title": "" }, { "docid": "601ace819bbba3cdda8abe2bc14e5ba8", "score": "0.5640543", "text": "async index() {\n await this.get(\"index\", null).catch(e => {\n throw(e);\n });\n }", "title": "" }, { "docid": "3cb8c165b3a9e2a96b3bd91a301c704e", "score": "0.56170076", "text": "async begin() {\n this.logger.debug(\"ElasticBestbetsLoader:begin - Begin Begin\");\n\n try {\n this.indexName = await this.estools.createTimestampedIndex(this.aliasName, this.mappings, this.settings);\n } catch (err) {\n this.logger.error(`Failed to create index ${this.indexName}`)\n throw err;\n }\n this.logger.debug(\"ElasticResourceLoader:begin - End Begin\");\n }", "title": "" }, { "docid": "79e1f83f01da2e8fb13ce9b76ebeaed7", "score": "0.5593164", "text": "async fetchIndexes()\n {\n const seenIndexes = await axios.get('/api/values/all'); // get all user-submitted indices from API\n this.setState({seenIndexes: seenIndexes.data}); // set this value in state (for HTML pushstate?)\n }", "title": "" }, { "docid": "8eac6d90568220cddf4247a0adc11e0f", "score": "0.55809355", "text": "IsNecessary(index) {\n return true;\n }", "title": "" }, { "docid": "a8cd46c9149ad8eae790ec3a53747fe1", "score": "0.5579321", "text": "async end() {\n\n try {\n //optimize the index\n await this.estools.optimizeIndex(this.indexName);\n\n //swap the alias\n await this.estools.setAliasToSingleIndex(this.aliasName, this.indexName);\n\n //Clean up old indices\n try {\n await this.estools.cleanupOldIndices(this.aliasName, this.daysToKeep, this.minIndexesToKeep);\n } catch (err) {\n this.logger.error(\"Could not cleanup old indices\");\n throw err;\n }\n\n } catch (err) {\n this.logger.error(\"Errors occurred during end process\");\n throw err;\n }\n\n }", "title": "" }, { "docid": "908d764b4bcad58f6b4139eb78cde8d3", "score": "0.5570286", "text": "index () {\n\t\tconsole.log('building spatial index for edges')\n\t\tthis.spatialIndex = rbush(RTREE_LEAF_SIZE)\n\n\t\t// nodes of the rtree\n\t\tlet treeNodes = []\n\n\t\tlet e = new Edge(this)\n\n\t\tfor (let i = 0; i < this.fromVertices.length; i++) {\n\t\t\te.seek(i)\n\t\t\tlet bbox = e.getBbox()\n\n\t\t\tif (i === 0) console.log(`bbox: ${bbox}`)\n\n\t\t\tbbox.push(i)\n\t\t\ttreeNodes.push(bbox)\n\t\t}\n\n\t\tconsole.log(`sp idx nodes: ${treeNodes.length}, node length: ${treeNodes[0].length}`)\n\n\t\tthis.spatialIndex.load(treeNodes)\n\n\t\tconsole.log('done building spatial index')\n\t}", "title": "" }, { "docid": "a71abbcd1b2c251402eb1ab838b058e0", "score": "0.5569506", "text": "addIndexQueries(queryArr, leftQueryArgs, rightQueryArgs) {\n queryArr.push(IndexRef.left.makeQuery(leftQueryArgs));\n queryArr.push(IndexRef.right.makeQuery(rightQueryArgs));\n // const newFilter = { leftId, rightId };\n // //if (this.filter) {\n // // if (!isEqual(this.filter, newFilter)) {\n // // throw new Error('tried to initialize same index with different configurations');\n // // }\n // this.filter = newFilter;\n // //}\n\n // const leftPath = ;\n // const rightPath = ;\n\n // if (!isEmpty(leftId)) {\n // this._addQuery(queryArr, leftPath, leftId);\n // }\n // else {\n // this._addQuery(queryArr, leftPath);\n // }\n\n // if (!isEmpty(rightId)) {\n // this._addQuery(queryArr, rightPath, rightId);\n // }\n // else {\n // this._addQuery(queryArr, rightPath);\n // }\n }", "title": "" }, { "docid": "e6c6eab2f5434a234cde6eeb1f282556", "score": "0.551575", "text": "async function resetIndex() {\n\n const settings = {\n \"settings\": {\n \"analysis\": {\n \"analyzer\": {\n \"my_analyzer\": {\n \"tokenizer\": \"my_tokenizer\"\n }\n },\n \"tokenizer\": {\n \"my_tokenizer\": {\n \"type\": \"path_hierarchy\",\n \"delimiter\": \"|\",\n \"replacement\": \"/\",\n \"reverse\": true\n }\n }\n }\n }\n };\n if (await client.indices.exists({ index })) {\n await client.indices.delete({ index })\n }\n\n /*\n \n await client.indices.create({ index }).then(\n function(){\n await client.indices.putSettings({ index, ignoreUnavailable:true, body: settings })\n }\n );\n */\n\n\n\n\n\n await client.indices.create({ index })\n\n\n await client.indices.close({ index })\n await client.indices.putSettings({ index, body: settings })\n await client.indices.open({ index })\n await putMappingForSmartTV()\n}", "title": "" }, { "docid": "b5296bec4ab2fe47abd91e957f5fce84", "score": "0.55067325", "text": "function loadIndex(data) {\n index = lunr.Index.load(data);\n }", "title": "" }, { "docid": "261384bc3ae9c8aee4c0228c2e019f03", "score": "0.5503007", "text": "enterIndex_properties(ctx) {\n\t}", "title": "" }, { "docid": "26ed1817beaed628fff4e7f80fa8562b", "score": "0.54946345", "text": "createIndexes$() {\n return Observable.create(async (observer) => {\n //observer.next('Creating index for DB_NAME.COLLECTION_NAME => ({ xxxx: 1 }) ');\n //await this.db.collection('COLLECTION_NAME').createIndex( { xxxx: 1}); \n\n observer.next('All indexes created');\n observer.complete();\n });\n }", "title": "" }, { "docid": "b37b51c14b0b8776f4f0979e9352c821", "score": "0.5483242", "text": "enterUsing_index_clause(ctx) {\n\t}", "title": "" }, { "docid": "1e173f2a7ffe26b2f0f6e44c3d0afa1f", "score": "0.54787654", "text": "createIndexes$() {\n return Rx.Observable.create(async (observer) => {\n\n observer.next('Creating index for Device.Devices => ({ deviceNetwork.hostname: 1 }) ');\n await this.db.collection('Devices').createIndex({ \"deviceStatus.hostname\": 1 });\n\n observer.next('Creating index for Device.Devices => ({ deviceStatus.type: 1 }) ');\n await this.db.collection('Devices').createIndex({ \"deviceStatus.type\": 1 });\n\n observer.next('Creating index for Device.Devices => ({ deviceStatus.groupName: 1 }) ');\n await this.db.collection('Devices').createIndex({ \"deviceStatus.groupName\": 1 });\n\n observer.next('Creating index for Device.Devices => ({ id: 1 }) ');\n await this.db.collection('Devices').createIndex({ \"id\": 1 });\n\n\n observer.next('Creating index for Device.DeviceHistory => ({ id: 1 }) ');\n await this.db.collection('DeviceHistory').createIndex({ \"id\": 1, \"dateTime\": 1 }); \n\n observer.next('Creating index for Device.DeviceAlarm => ({ timestamp: 1, type: 1, deviceId: 1 }) ');\n await this.db.collection('DeviceAlarm').createIndex({ \"timestamp\": 1, \"type\": 1, \"deviceId\": 1 });\n\n observer.next('Creating index for Device.DeviceAlarm => ({ deviceId: 1 }) ');\n await this.db.collection('DeviceAlarm').createIndex({ \"deviceId\": 1 });\n\n\n observer.next('All indexes created');\n observer.complete();\n });\n }", "title": "" }, { "docid": "947821aed4f4beb4a39d3a67600b8a13", "score": "0.5476571", "text": "function setupVersions(callback) {\n self.db.collection('aposVersions', function(err, collection) {\n function index(callback) {\n self.versions.ensureIndex({ pageId: 1, createdAt: -1 }, { safe: true }, callback);\n }\n self.versions = collection;\n async.series([index], callback);\n // ... more index functions\n });\n }", "title": "" }, { "docid": "35bf48d4458e4a3d608196f0353edcbe", "score": "0.54554164", "text": "function init() {\n\t\tbuildLocationIndex();\n\t}", "title": "" }, { "docid": "f9a6350faef8d8ae976f8fd9a636c0a1", "score": "0.5437421", "text": "function generateIndexes(databaseName){\n const database = db.getCollection(databaseName);\n\n // _id_\n // Simple - numeric\n // salary_1\n database.createIndex({salary : 1})\n\n // Compound\n // salary_1_birthday_-1\n database.createIndex({salary : 1, birthday : -1})\n\n // Do we want a sparse index???? \n // Would need to add a field that is only present some of the time if we do.\n\n // GeoJSON - single field\n // home_2dsphere\n database.createIndex({home : \"2dsphere\"})\n\n // Hashed\n // name_hashed\n database.createIndex({name : \"hashed\"})\n\n // Text - all text\n // $**_text\n database.createIndex({\"$**\" : \"text\"})\n\n // Multikey - text (not sure if this will error)\n // friends_-1\n database.createIndex({friends : -1})\n\n // Multikey - doc (GeoJSON - not sure if this will error)\n // favoriteLocals_1\n database.createIndex({favoriteLocals : 1})\n\n print(database + \" stats\");\n // Print storage overhead of indexes\n printjson(database.stats())\n \n}", "title": "" }, { "docid": "21dfd79414f1a93eb3391604788b990e", "score": "0.54200923", "text": "addLocalSecondaryIndex(props) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_dynamodb_LocalSecondaryIndexProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.addLocalSecondaryIndex);\n }\n throw error;\n }\n // https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html#limits-secondary-indexes\n if (this.localSecondaryIndexes.length >= MAX_LOCAL_SECONDARY_INDEX_COUNT) {\n throw new RangeError(`a maximum number of local secondary index per table is ${MAX_LOCAL_SECONDARY_INDEX_COUNT}`);\n }\n this.validateIndexName(props.indexName);\n // build key schema and projection for index\n const lsiKeySchema = this.buildIndexKeySchema(this.tablePartitionKey, props.sortKey);\n const lsiProjection = this.buildIndexProjection(props);\n this.localSecondaryIndexes.push({\n indexName: props.indexName,\n keySchema: lsiKeySchema,\n projection: lsiProjection,\n });\n this.secondaryIndexSchemas.set(props.indexName, {\n partitionKey: this.tablePartitionKey,\n sortKey: props.sortKey,\n });\n }", "title": "" }, { "docid": "30bf329edb292dd76384d92f3519538c", "score": "0.5415158", "text": "function _isIndexedDBAvailable() {\n return 'indexedDB' in self && indexedDB != null;\n }", "title": "" }, { "docid": "8d9467e1634eb8f3d2db0f97114eebbc", "score": "0.54147834", "text": "enterIndex_attributes(ctx) {\n\t}", "title": "" }, { "docid": "0ac51b29719f000cd5ea28cac3761b8c", "score": "0.54038197", "text": "function createCredentialsIndexes() {\n\t var model = new MongoModel_ts_1.MongoModel('credential');\n\t model.createIndex({ email: 1 }, { unique: true });\n\t}", "title": "" }, { "docid": "5a27e53b2c6c6dae9b4e3286061be268", "score": "0.5398727", "text": "function initLunrSearchIndex(){\n lunrIndex = lunr(function () {\n this.ref('sku')\n this.field('name')\n this.field('description')\n this.field('model')\n allProducts.forEach(function (doc) {\n this.add(doc)\n }, this)\n });\n}", "title": "" }, { "docid": "ed636954abe58fe67f9cb3ec0d727556", "score": "0.53904986", "text": "function createPersonIndexes() {\n\t var model = new MongoModel_ts_1.MongoModel('person');\n\t model.createIndex({ email: 1 }, { unique: true });\n\t}", "title": "" }, { "docid": "6c389839a287cbf069d59511b42253ae", "score": "0.53812474", "text": "_findDocs(terms) {\n const docs = new Map();\n terms.forEach((term) => {\n const termIndex = this.indexes.get(term);\n if (termIndex) {\n\tfor (const [name, idx] of termIndex.entries()) {\n\t let docIndex = docs.get(name);\n\t if (!docIndex) docs.set(name, docIndex = []);\n\t docIndex.push(idx);\n\t}\n }\n });\n return docs;\n }", "title": "" }, { "docid": "123baa1a26652fa54187472693c25fd5", "score": "0.5378996", "text": "enterAlter_index(ctx) {\n\t}", "title": "" }, { "docid": "b923418e41e15fcb1ec4c0f691d017db", "score": "0.5373462", "text": "function getIndex() {\r\n if (index)\r\n return index;\r\n\r\n if (from && by && searchedfields && conditions && is && success) {\r\n index = \"ndx_for(\" + by + \"_is_\" + is + \")_on_\" + searchedfields.join();\r\n } else if (from && searchedfields && conditions && success) {\r\n index = \"ndx_all_on_\" + where;\r\n }\r\n\r\n if (index) {\r\n if (!database.HasIndex(index)) {\r\n // use dynamic index, and prepend static index constraint as query condition\r\n errormsg = \"No such index: \" + index;\r\n index = \"dynamic\";\r\n if (by && is)\r\n conditions.unshift(by + \":\\\"\" + is + \"\\\" AND \");\r\n }\r\n }\r\n\r\n return index;\r\n }", "title": "" }, { "docid": "73159c8b60d13b099787ef232df97545", "score": "0.53721035", "text": "constructor() {\n this.index = {};\n }", "title": "" }, { "docid": "df3c9939d7c0f87bf4df051824857d2b", "score": "0.5364876", "text": "'constructor'(spec) {\n //console.log('\\nIndex constructor');\n var a = arguments;\n var l = arguments.length,\n t;\n\n var arr_def, table, id;\n\n // We could give it fields from the table def.\n\n // This seems like a nicer way to have the Index working with OOP.\n // Would have references to the actual Field instances.\n\n\n // Further down, will get the field names, then refer to record_flat_data[field_name]\n // 18/08/2017 - Need to get this basic db system up and running.\n // It needs to store data soon in production.\n\n this.__type_name = 'index';\n\n var key_fields = this.key_fields = [];\n var value_fields = this.value_fields = [];\n this.kv_fields = [this.key_fields, this.value_fields];\n\n\n // is unique?\n\n // unique\n\n // if it's true, then a uniqueness constraint gets applied when adding data.\n\n\n\n\n if (l === 1) {\n spec = a[0];\n }\n\n if (l === 2) {\n\n spec = a[0];\n table = this.table = a[1];\n\n // get the id from the table's index incrementor.\n\n }\n if (l === 3) {\n spec = a[0];\n table = this.table = a[1];\n id = this.id = a[2];\n // get the id from the table's index incrementor.\n // already got it, id provided in constructor. Easier to follow this way.\n\n }\n // [index_key_def, index_value_field]\n\n var t_spec = tof(spec);\n //console.log('index spec', spec);\n //console.log('t_spec', t_spec);\n if (t_spec === 'array') {\n arr_def = spec;\n }\n //\n\n if (arr_def) {\n\n var map_fields = this.table.record_def.map_fields,\n i_field;\n\n //console.log('map_fields', map_fields);\n //console.log('arr_def', arr_def);\n\n each(arr_def[0], (key_field_item) => {\n t = tof(key_field_item);\n //console.log('key_field_item', key_field_item);\n //console.log('* tof(key_field_item)', t);\n if (t === 'string') {\n i_field = map_fields[key_field_item];\n //console.log('i_field', i_field);\n //key_fields.push(\n //console.trace();\n //throw 'stop';\n key_fields.push(i_field);\n\n } else if (t === 'field' || key_field_item.__type_name === 'field') {\n // unfortunate hack with tof not working right.\n //console.log('t', t);\n\n\n key_fields.push(key_field_item);\n\n //throw 'stop';\n } else if (t === 'number') {\n //console.log('key_field_item', key_field_item);\n\n var field = table.fields[key_field_item];\n //console.log('field', field);\n key_fields.push(field);\n //throw 'stop';\n }\n //console.log('key_field_item', key_field_item);\n });\n each(arr_def[1], (value_field_item) => {\n t = tof(value_field_item);\n //console.log('value_field_item', value_field_item);\n if (t === 'string') {\n i_field = map_fields[value_field_item];\n //console.log('i_field', i_field);\n value_fields.push(i_field);\n } else if (t === 'field' || value_field_item.__type_name === 'field') {\n value_fields.push(value_field_item);\n //console.log('tof(arr_def[0])', tof(arr_def[0]));\n //throw 'stop';\n } else if (t === 'number') {\n //console.log('value_field_item', value_field_item);\n\n var field = table.fields[value_field_item];\n value_fields.push(field);\n //throw 'stop';\n }\n //console.log('value_field_item', value_field_item);\n });\n }\n // Process the arr_def into fields?\n\n // Index may work better when not just using arr_def.\n // If it has both key and value fields.\n // An index would be a bit like a normal record def, but it would be a different values in the keys, and the value would always be the primary key.\n\n //console.log('Index constructor complete, this', this);\n\n // Have the \n\n }", "title": "" }, { "docid": "14658e25fed9bac1d9bccd016c6baa67", "score": "0.5338033", "text": "function init_data() {\n\n // Open indexDB database\n silesnet.indexedDB.open();\n}", "title": "" }, { "docid": "5aead1bf5768216fb75514dcd12d266b", "score": "0.5308084", "text": "addGlobalSecondaryIndex(props) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_dynamodb_GlobalSecondaryIndexProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.addGlobalSecondaryIndex);\n }\n throw error;\n }\n this.validateProvisioning(props);\n this.validateIndexName(props.indexName);\n // build key schema and projection for index\n const gsiKeySchema = this.buildIndexKeySchema(props.partitionKey, props.sortKey);\n const gsiProjection = this.buildIndexProjection(props);\n this.globalSecondaryIndexes.push({\n indexName: props.indexName,\n keySchema: gsiKeySchema,\n projection: gsiProjection,\n provisionedThroughput: this.billingMode === BillingMode.PAY_PER_REQUEST ? undefined : {\n readCapacityUnits: props.readCapacity || 5,\n writeCapacityUnits: props.writeCapacity || 5,\n },\n });\n this.secondaryIndexSchemas.set(props.indexName, {\n partitionKey: props.partitionKey,\n sortKey: props.sortKey,\n });\n this.indexScaling.set(props.indexName, {});\n }", "title": "" }, { "docid": "521e1120edfbaa8846a477f7d02bcd9f", "score": "0.5296247", "text": "function hasRecommendedIndex(queryResult) {\n if (!queryResult || !queryResult.advice || !_.isArray(queryResult.advice))\n return false;\n\n return(queryResult.advice.some(function (element) {\n return element.recommended_indexes &&\n (element.recommended_indexes.covering_indexes || element.recommended_indexes.indexes);\n }));\n }", "title": "" }, { "docid": "303ac54061bb497ec58506d7e43557bf", "score": "0.52929866", "text": "function _searchIndexingStarted() {\n if (_findBar && _findBar._options.multifile && FindUtils.isIndexingInProgress()) {\n _findBar.showIndexingSpinner();\n }\n }", "title": "" }, { "docid": "8866faacb38888dffdfdee45addaf974", "score": "0.5267775", "text": "function gotStartIndex(err, index){\n var count = opts.count;\n var multi = c.multi();\n if(count > 0){\n for(var i = 0; i < count - 1 || i < 0; i++){\n indexes.push(+ index + i);\n multi.hgetall('c:r:' + (+index + i));\n }\n } else {\n for(var i = 0; i < (- count - 1) && (index - i) > 0; i++){\n indexes.push(+ index - i);\n multi.hgetall('c:r:' + (+index - i));\n }\n }\n multi.exec(function(err, results){\n if (err) return cb(err);\n results.forEach(function(val, i){\n results[i].id = indexes[i];\n });\n cb(null, results);\n })\n }", "title": "" }, { "docid": "8866faacb38888dffdfdee45addaf974", "score": "0.5267775", "text": "function gotStartIndex(err, index){\n var count = opts.count;\n var multi = c.multi();\n if(count > 0){\n for(var i = 0; i < count - 1 || i < 0; i++){\n indexes.push(+ index + i);\n multi.hgetall('c:r:' + (+index + i));\n }\n } else {\n for(var i = 0; i < (- count - 1) && (index - i) > 0; i++){\n indexes.push(+ index - i);\n multi.hgetall('c:r:' + (+index - i));\n }\n }\n multi.exec(function(err, results){\n if (err) return cb(err);\n results.forEach(function(val, i){\n results[i].id = indexes[i];\n });\n cb(null, results);\n })\n }", "title": "" }, { "docid": "a90c07c08cb92e9afd35d698f3c4a05b", "score": "0.5263847", "text": "static get indexed () {\n return _.keys(this.schema).filter(field => {\n return this.schema[field].index\n })\n }", "title": "" }, { "docid": "2d710cb020e158676fb8b1217e44f454", "score": "0.5261436", "text": "function createIndexes(index, ...feeds) {\n // for filter\n return async conn => {\n const noIndex = ({ indexList }) => !indexList.includes(index);\n const toTableIndex = tableIndexes(conn);\n try {\n const tablesAndIndexes = await Promise.all(\n feeds.map(toTableName).map(toTableIndex),\n );\n const tablesWithNoIndex = await Promise.all(tablesAndIndexes.filter(noIndex));\n await Promise.all(tablesWithNoIndex.map(\n ({ name }) => r.table(name).indexCreate(index).run(conn),\n ));\n return conn;\n } catch (e) {\n throw new Error(\"Can't update table with new indexes\");\n }\n };\n}", "title": "" }, { "docid": "f7918a733dfa00f157fae0accc4d57fe", "score": "0.5254919", "text": "exitCreate_index(ctx) {\n\t}", "title": "" }, { "docid": "576c2cbfbcf6bad36cc8222fc71aaa81", "score": "0.52500105", "text": "function initIndex() {\n return elasticClient.indices.create({\n index: indexName\n });\n}", "title": "" }, { "docid": "c18b6b0f1c2d29212407412903b9c67f", "score": "0.5246716", "text": "enterIndextype(ctx) {\n\t}", "title": "" }, { "docid": "067c4934fbafa730e6af01ff349a72a3", "score": "0.52417505", "text": "async beforeIndex(req) {\n }", "title": "" }, { "docid": "d0ac5938234158ef2c997fe1cffcf164", "score": "0.5218776", "text": "enterXmlindex_clause(ctx) {\n\t}", "title": "" }, { "docid": "5d5e9308344069534ee0e0ca1a858a2d", "score": "0.5211743", "text": "function initDatabase() {\n // console.log(\"Open database \" + DbConst.DB_NAME + \"...\");\n let req;\n try {\n req = indexedDB.open(DbConst.DB_NAME, DbConst.DB_VERSION);\n } catch (ex){\n console.error(\"Error opening database: \" + ex.name + \": \" + ex.message + \"\\nEnabling cookies might resolve this.\");\n }\n req.onsuccess = function (event) {\n // Better use \"this\" than \"req\" to get the result to avoid problems with garbage collection.\n db = event.target.result;\n // db = this.result;\n // console.log(\"Database opened successfully.\");\n };\n req.onerror = function (event) {\n console.error(\"Database open error: \" + event.target.errorCode);\n };\n req.onupgradeneeded = function (event) {\n console.log(\"Database upgrade start...\");\n db = event.target.result;\n\n // Create an objectStore for this database\n let objStore;\n if (event.oldVersion < 1) {\n objStore = db.createObjectStore(DbConst.DB_STORE_TEXT, {autoIncrement: true});\n objStore.createIndex(DbConst.DB_TEXT_IDX_FIELD, \"fieldkey\", {unique: true});\n objStore.createIndex(DbConst.DB_TEXT_IDX_NAME, \"name\", {unique: false});\n objStore.createIndex(DbConst.DB_TEXT_IDX_LAST, \"last\", {unique: false});\n objStore.createIndex(DbConst.DB_TEXT_IDX_HOST, \"host\", {unique: false});\n objStore.createIndex(DbConst.DB_TEXT_IDX_HOST_NAME, \"host_name\", {unique: false});\n //objStore.createIndex(\"by_uri\", \"uri\", {unique: false});\n\n objStore = db.createObjectStore(DbConst.DB_STORE_ELEM, {autoIncrement: true});\n objStore.createIndex(DbConst.DB_ELEM_IDX_FIELD, \"fieldkey\", {unique: true});\n objStore.createIndex(\"by_saved\", \"saved\", {unique: false});\n //objStore.createIndex(\"by_name\", \"name\", {unique: false});\n }\n\n // if (event.oldVersion < 2) {\n // // Version 2 introduces new index\n // objStore = req.transaction.objectStore(DbConst.DB_STORE_TEXT);\n // objStore.createIndex(\"by_type\", \"type\", {unique: false});\n // }\n // if (event.oldVersion < 3) {\n // // Version 3 rename indexes\n // objStore = req.transaction.objectStore(DbConst.DB_STORE_TEXT);\n // objStore.deleteIndex(\"name\");\n // objStore.createIndex(\"by_name\", \"name\", {unique: false});\n // }\n\n // Use transaction oncomplete to make sure the objStore creation is finished before adding data into it.\n objStore.transaction.oncomplete = function (/*event*/) {\n console.log(\"Database upgrade success.\");\n //doDatabaseTests();\n };\n console.log(\"Database upgrade finished.\");\n };\n}", "title": "" }, { "docid": "edebb1b0bc17385e501a89a794b6a40d", "score": "0.5211487", "text": "async function backupJobs() {\n var db = await MongoClient.connect(process.env.PROD_MONGODB);\n //var jobs = db.collection('jobs');\n await db.createIndex('jobs', {geolocation : \"2dsphere\"});\n \n //jobs.createIndex({ geolocation: \"2dsphere\"});\n \n db.close();\n}", "title": "" }, { "docid": "32ad9c1cf8e64ea57f0dd316148c777f", "score": "0.52065986", "text": "function buildIndex() {\r\n\tif (options['milestonesort'] == true) {\r\n\t\tglobIssues.sort(function(a, b) {\r\n\t\t\tif (a.milestone == null && b.milestone == null)\r\n\t\t\t\treturn (a.number - b.number); \r\n\t\t\tif (a.milestone == null)\r\n\t\t\t\treturn -1;\r\n\t\t\tif (b.milestone == null)\r\n\t\t\t\treturn 1;\r\n\t\t\tif (a.milestone.title == b.milestone.title)\r\n\t\t\t\treturn (a.number - b.number);\r\n\t\t\tif (a.milestone.title < b.milestone.title)\r\n\t\t\t\treturn -1;\r\n\t\t\telse\r\n\t\t\t\treturn 1;\r\n\t\t});\r\n\t}\r\n\t\r\n\tvar repoList = [options['repo']];\r\n\tconsole.log(\"List of repositories: \" + repoList);\r\n\tfor (var repInd = 0; repInd < repoList.length; repInd++) {\r\n\t\tconsole.log(\"Building index file for: \" + repoList[repInd]);\r\n\t\tvar title = \"Issue index for \" + options['owner'] + '/' + repoList[repInd];\r\n\t\tvar indexHTML = '<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>' + title + '</title>';\r\n\t\tindexHTML += '<link rel=\"stylesheet\" type=\"text/css\" href=\"css/issues.css\"></head>';\r\n\t\tindexHTML += '<body class=\"indexlayout\">';\r\n\t\tindexHTML += '<div class=\"indextitle\">' + title + '</div>';\r\n\t\tindexHTML += '<table class=\"indextable\">';\r\n\t\tindexHTML += '<tr class=\"indexheader\"><th align=\"left\">Issue Id</th><th align=\"left\">State</th><th width=\"18%\" align=\"left\">Labels</th><th width=\"17%\" align=\"left\">Milestone</th><th width=\"50%\" align=\"left\">Title</th></tr>';\r\n\t\tfor (var i = 0; i < globIssues.length; i++) {\r\n\t\t\tissue = globIssues[i];\r\n\t\t\tvar issueRepo = getUrlRepo(issue.repository_url);\r\n\t\t\tif (issueRepo != repoList[repInd])\r\n\t\t\t\tcontinue; // Issue belongs to different repo;\r\n\t\t\tindexHTML += '<tr class=\"indexrow\">';\r\n\t\t\tindexHTML += '<td align=\"left\">' + '<a href=\"' + options['owner'] + '/' + issueRepo + '/' + issue.number + '.html\" target=\"_blank\">' + issue.number + '</td>';\r\n\t\t\tindexHTML += '<td align=\"left\">' + issue.state + '</td>';\r\n\t\t\tvar labels = \"\";\r\n\t\t\tfor (var l = 0; l < issue.labels.length; l++) {\r\n\t\t\t\tlabels += formatLabel(issueRepo, issue.labels[l].name);\r\n\t\t\t}\r\n\t\t\tindexHTML += '<td align=\"left\">' + labels + '</td>';\r\n\t\t\tif (issue.milestone != null) {\r\n\t\t\t\tindexHTML += '<td align=\"left\">' + issue.milestone.title + '</td>';\r\n\t\t\t} else {\r\n\t\t\t\tindexHTML += '<td align=\"left\"></td>';\r\n\t\t\t}\r\n\t\t\tindexHTML += '<td align=\"left\">' + issue.title + '</td>';\r\n\t\t\tindexHTML += '</tr>';\r\n\t\t}\r\n\t\tindexHTML += '</table></body>';\r\n\r\n\t\tfileName = repoList[repInd] + \".html\";\r\n\t\twriteFile(fileName, indexHTML);\r\n\t}\r\n\r\n\t// Call on.\r\n\tissueProcessLoop();\r\n}", "title": "" }, { "docid": "308bbee4c39aa1efa4f4f8bb6874e777", "score": "0.5203194", "text": "function _indexOptions() {\n vm._indexes = [];\n angular.forEach(vm.options, function (field, index) {\n var chainedFields = '';\n angular.forEach(field, function (value, key) {\n (key.indexOf('$') < 0) && (key !== '_hidden') && (chainedFields += value.toString().toLowerCase() + '***');\n });\n vm._indexes.push(chainedFields);\n });\n }", "title": "" }, { "docid": "9f9e368747d03f99ecb033fa51b65494", "score": "0.5178111", "text": "function setupTestIndex(domainName, indexName, typeNames, cb) {\n // delete index\n exec('node mgmt/mgmt.js -deleteindex ' + indexName + '.1', function (err, stdout, stderr) {\n if(err) cb(err);\n var fullIndexName = indexName + '.1';\n log(`deleted index ${fullIndexName}`);\n // create index\n exec('node mgmt/mgmt.js -createindex ' + indexName, function (err, stdout, stderr) {\n if(err) cb(err);\n log(`created index ${indexName}`); \n // set mapping\n typeNames.forEach(function(typeName, i) {\n log(`set mapping for ${domainName} ${fullIndexName} ${typeName}`);\n exec(`node mgmt/mgmt.js -setmapping ${domainName} ${fullIndexName} ${typeName}`, function (err, stdout, stderr) {\n if(i == typeNames.length-1) {\n cb(err);\n }\n });\n });\n });\n });\n}", "title": "" }, { "docid": "622059e6445ff3d55948dd7d50bba31b", "score": "0.5172607", "text": "static async setupCollection(db) {\n // Local variables\n let logger = Logger.create(\"setupCollection\");\n\n logger.info(\"enter\");\n\n // Try to create the collection\n try {\n await db.createCollection(\"wallets\", {\n readPreference: \"secondaryPreferred\"\n });\n\n logger.info(\"collection create success\");\n }\n catch(error) {\n logger.error(\"collection create error\", error);\n }\n\n // Try to create index on nameId\n /*try {\n await collection.createIndex(\"nameId\", {\n unique: true,\n background: true,\n w:1,\n //partialFilterExpression: { deletedAt: {$type: \"null\"} }\n });\n\n logger.info(\"collection createIndex on nameId success\");\n }\n catch(error) {\n logger.error(\"collection createIndex on nameId error\", error);\n }*/\n }", "title": "" }, { "docid": "a4357ca387a41e3521e5503c5b896d58", "score": "0.51708186", "text": "function fetchIndex() {\n $.getJSON(gitbook.state.basePath+\"/search_index.json\")\n .then(loadIndex);\n }", "title": "" }, { "docid": "66bdc4b03db39f86251f7c0546c9f890", "score": "0.51457804", "text": "async index() {}", "title": "" }, { "docid": "8f8c958ca0990749ac63190bb2791b6b", "score": "0.5141699", "text": "function addIndexes(db, cb) {\n db.collection('feedItems').createIndex({ \"contents.contents\": \"text\" }, null, cb);\n }", "title": "" }, { "docid": "0a3babf556266b4fddb91c768e0ce100", "score": "0.51412815", "text": "function isIndexedDBAvailable() {\n return 'indexedDB' in self && indexedDB != null;\n}", "title": "" }, { "docid": "0a3babf556266b4fddb91c768e0ce100", "score": "0.51412815", "text": "function isIndexedDBAvailable() {\n return 'indexedDB' in self && indexedDB != null;\n}", "title": "" }, { "docid": "0a3babf556266b4fddb91c768e0ce100", "score": "0.51412815", "text": "function isIndexedDBAvailable() {\n return 'indexedDB' in self && indexedDB != null;\n}", "title": "" }, { "docid": "0a3babf556266b4fddb91c768e0ce100", "score": "0.51412815", "text": "function isIndexedDBAvailable() {\n return 'indexedDB' in self && indexedDB != null;\n}", "title": "" }, { "docid": "0a3babf556266b4fddb91c768e0ce100", "score": "0.51412815", "text": "function isIndexedDBAvailable() {\n return 'indexedDB' in self && indexedDB != null;\n}", "title": "" }, { "docid": "ffc39af2ad27d6c77478eb170cdb3aad", "score": "0.5139404", "text": "enterDomain_index_clause(ctx) {\n\t}", "title": "" }, { "docid": "0096a1544c79d9de9813689a2bf3c725", "score": "0.5120811", "text": "createIndex(path, key, options) { throw new NotImplementedError('createIndex'); }", "title": "" }, { "docid": "780803f5fe78ba6fba911a03bc17bfbd", "score": "0.51158535", "text": "function checkIndex(o,index){\n\t\t\t\treturn count - index >= config.showCount && index >= 0 && index !== self.index;\n\t\t\t}", "title": "" }, { "docid": "4cec569c299c4f216dc508452ff3b2af", "score": "0.5113903", "text": "function markDirty() {\n _indexListDirty = true;\n }", "title": "" }, { "docid": "2d9e55d9d462d93f17cba27d1b5b64e5", "score": "0.5113469", "text": "async function initMongo() {\n await mongo_db.collection('Users').insert({\n username: 'admin',\n password: '$2a$10$fiJu.K2Aa/ivBg/hL2BrSeRhSiuUnoFXowBHahOnPdxvz3eD04sFm' // 'pass'\n });\n await mongo_db.createCollection('Students');\n await mongo_db.createCollection('Teachers');\n await mongo_db.createCollection('Courses');\n await mongo_db.collection('Students').createIndex({\n givenName: \"text\",\n familyName: \"text\",\n personalId: \"text\",\n gender: \"text\"\n }, {\n weights: {\n givenName: 10,\n familyName: 10,\n personalId: 20,\n gender: 3\n },\n name: \"TextIndex\"\n });\n await mongo_db.collection('Teachers').createIndex({\n givenName: \"text\",\n familyName: \"text\",\n personalId: \"text\",\n gender: \"text\"\n }, {\n weights: {\n givenName: 10,\n familyName: 10,\n personalId: 20,\n gender: 3\n },\n name: \"TextIndex\"\n });\n await mongo_db.collection('Courses').createIndex({\n name: \"text\",\n courseId: \"text\",\n observations: \"text\",\n }, {\n weights: {\n name: 20,\n courseid: 30,\n observations: 5,\n },\n name: \"TextIndex\"\n });\n}", "title": "" }, { "docid": "0b86c38c2f5e6347d1580fe803ab8c80", "score": "0.5112976", "text": "function all_indices() {\n var something = $http({\n url: config.elasticsearch + \"/_aliases\",\n method: \"GET\"\n }).error(function(data, status, headers, config) {\n // Handle error condition somehow?\n });\n\n return something.then(function(p) {\n var indices = [];\n _.each(p.data, function(v,k) {\n indices.push(k)\n });\n return indices;\n });\n }", "title": "" }, { "docid": "f84cf3228b100356214ce5452a86d9f5", "score": "0.5107044", "text": "function dataStructure_loadData(){\n//loads the data from objects generated in a List; Demo-Data\n//adds JSON-Data into pouchDB, using ajax load\n\nDBpubs.bulkDocs(data_pubs).then(function (result) {\n return DBdishes.bulkDocs(data_dishes);\n}).then(function(result) {\n return DBmenu.bulkDocs(data_menu);\n}).then(function(result){\n return DBhist_persons.bulkDocs(data_hist_persons);\n}).then(function(result){\n return DBgeo.bulkDocs(data_map_points);\n}).then(function(result){\n return DBcategory.bulkDocs(data_category);\n}).then(function(result){\n return DBmenu_info.bulkDocs(data_menu_infos);\n }).then(function(result){\n//Create Indexes for Searching\n return DBmenu.createIndex({\n index: {\n fields: ['menupages']\n }});\n}).then(function(result){\n return DBmenu.createIndex({\n index: {\n fields: ['pub']\n }});\n }).then(function(result){\n\n return DBdishes.createIndex({\n index: {\n fields: ['pubid', 'playerid']\n }});\n }).then(function(result){\n return DBrating.createIndex({\n index: {\n fields: ['pubid', 'dishes', 'playerid', 'target.anno_id', 'target.pubid']\n }});\n }).then(function(result){\n return DBgeo.createIndex({\n index: {\n fields: ['target.pubid']\n }});\n }).then(function(result){\n console.log(\"Datastructure filled from sample data\")\n return true;\n }).catch(function (err) {\n console.log(\"Error occured:\");\n console.log(err);\n});\n\n\n\n}", "title": "" }, { "docid": "add3fb0a438e8170af981c78fb7f289e", "score": "0.50925726", "text": "function isIndexedDBAvailable() {\n return 'indexedDB' in self && indexedDB != null;\n}", "title": "" }, { "docid": "add3fb0a438e8170af981c78fb7f289e", "score": "0.50925726", "text": "function isIndexedDBAvailable() {\n return 'indexedDB' in self && indexedDB != null;\n}", "title": "" }, { "docid": "b46279c07ab6aa012cee59ca422077af", "score": "0.5091751", "text": "getAllESIndices() {\n const indicesArray = this.config.indices.map((e) => e.index);\n if (this.config.configIndex) {\n indicesArray.push(this.config.configIndex);\n }\n return this.client.indices.getAlias({\n index: indicesArray,\n }).then((resp) => {\n try {\n const indicesMetadata = resp.body;\n const indicesWithArrayFields = Object.keys(this.arrayFields);\n for (let i = 0; i < indicesWithArrayFields.length; i += 1) {\n const indexName = indicesWithArrayFields[i];\n if (!indicesMetadata[indexName]) {\n indicesMetadata[indexName] = {};\n }\n indicesMetadata[indexName].arrayFields = this.arrayFields[indexName];\n }\n return {\n statusCode: resp.statusCode,\n warnings: resp.warnings,\n indices: {\n ...indicesMetadata,\n },\n };\n } catch (err) {\n throw new Error(err);\n }\n }, (err) => {\n throw new Error(err);\n });\n }", "title": "" }, { "docid": "85810421afc91b6a6f474efacb641ed1", "score": "0.5086833", "text": "function IndexContext(){}", "title": "" }, { "docid": "1d9be6b11fad8b15ae921861912e9cb8", "score": "0.5082223", "text": "function _validateIndexedDBOpenable() {\n return new Promise(function (resolve, reject) {\n try {\n var preExist_1 = true;\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\n var request_1 = window.indexedDB.open(DB_CHECK_NAME_1);\n\n request_1.onsuccess = function () {\n request_1.result.close(); // delete database only when it doesn't pre-exist\n\n if (!preExist_1) {\n window.indexedDB.deleteDatabase(DB_CHECK_NAME_1);\n }\n\n resolve(true);\n };\n\n request_1.onupgradeneeded = function () {\n preExist_1 = false;\n };\n\n request_1.onerror = function () {\n var _a;\n\n reject(((_a = request_1.error) === null || _a === void 0 ? void 0 : _a.message) || '');\n };\n } catch (error) {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "83b7dfeab7ae22c5d5564abc48602a54", "score": "0.50706065", "text": "async function example()\r\n{\r\n // Use `dropDatabase()` to drop this database first to clear the remains.\r\n console.log(\"The result of dropping database: \" + await ula.dropDatabase());\r\n console.log();\r\n\r\n // Use `connectToDB()` to log the name of the database.\r\n console.log(\"DB Name: \" + (await ula.connectToDB()).databaseName);\r\n console.log();\r\n\r\n // Use `connectToColle()` to log the name of the database.\r\n console.log(\"Colle Alpha Name: \" + (await ula.connectToColle(dbIndex.db.colles.alpha)).collectionName);\r\n console.log(\"Colle Bata Name: \" + (await ula.connectToColle(dbIndex.db.colles.beta )).collectionName);\r\n console.log();\r\n\r\n // Use `pushOne()` to push something into the collection one by one.\r\n console.log(\"The result of pushing item into colle Alpha: \");\r\n console.log((await ula.pushOne(dbIndex.db.colles.alpha, data.alpha[0])).result);\r\n console.log(\"The result of pushing item into colle Alpha: \");\r\n console.log((await ula.pushOne(dbIndex.db.colles.alpha, data.alpha[1])).result);\r\n console.log();\r\n\r\n // Use `pushMany()` to push all in same time.\r\n console.log(\"The result of pushing item into colle Beta: \");\r\n console.log((await ula.pushMany(dbIndex.db.colles.beta, data.beta)).result);\r\n console.log();\r\n\r\n // Use `countColleDocs()` to see how many objects in collection Alpha.\r\n console.log(\"Amount of objects in colleciton Alpha: \" + await ula.countColleDocs(dbIndex.db.colles.alpha, {}, {}));\r\n console.log();\r\n\r\n // Use `searchMany()` to search what objects in collection Alpha.\r\n console.log(\"The result of searching colle Alpha: \");\r\n console.log(await ula.searchMany(dbIndex.db.colles.alpha, {}, {}));\r\n console.log();\r\n\r\n // Use `searchMany()` to search what objects in collection Alpha (excluding the property `_id`).\r\n // Set the parameter `options` as `{projection: {_id: 0}}` to hide the property `_id`.\r\n console.log(\"The result of searching colle Alpha (exclude `_id`): \");\r\n console.log(await ula.searchMany(dbIndex.db.colles.alpha, {}, {projection: {_id: 0}}));\r\n console.log();\r\n\r\n // Use `searchMany()` to search what objects in collection Alpha (ONLY including the property `name`).\r\n // Set the parameter `options` as `{projection: {name: 1}}` to just returning the property `name`.\r\n console.log(\"The result of searching colle Alpha (ONLY include `name`): \");\r\n console.log(await ula.searchMany(dbIndex.db.colles.alpha, {}, {projection: {name: 1}}));\r\n console.log();\r\n\r\n // Use `searchMany()` to search what objects in collection Alpha (excluding the property `_id` and limiting the returned amount to 1).\r\n // Set the parameter `options` as `{limit: 1}` to hide the property `_id` and to limit the returned amount to 1.\r\n console.log(\"The result of searching colle Alpha (exclude `_id`, return 1): \");\r\n console.log(await ula.searchMany(dbIndex.db.colles.alpha, {}, {projection: {_id: 0}, limit: 1}));\r\n console.log();\r\n\r\n // Use `searchOne()` to search the object(s) within {id: 1} in collection Beta.\r\n console.log(\"The result of searching colle Beta (id: 1): \");\r\n console.log(await ula.searchOne(dbIndex.db.colles.beta, {id: 1}, {projection: {_id: 0}}));\r\n console.log();\r\n\r\n // Use `searchOne()` to search the object(s) within {id: 2} in collection Beta.\r\n console.log(\"The result of searching colle Beta (id: 2): \");\r\n console.log(await ula.searchOne(dbIndex.db.colles.beta, {id: 2}, {projection: {_id: 0}}));\r\n console.log();\r\n\r\n // Use `searchOne()` to search the object(s) within {id: 3} in collection Beta.\r\n console.log(\"The result of searching colle Beta (id: 3): \");\r\n console.log(await ula.searchOne(dbIndex.db.colles.beta, {id: 3}, {projection: {_id: 0}}));\r\n console.log();\r\n\r\n // Use `searchMany()` to search the object(s) within {id: 3} in collection Beta.\r\n console.log(\"The result of searching colle Beta (id: 3): \");\r\n console.log(await ula.searchMany(dbIndex.db.colles.beta, {id: 3}, {projection: {_id: 0}}));\r\n console.log();\r\n\r\n // Use `searchMany()` to search the object(s) within {info: {status: \"meditating\"}} in collection Beta.\r\n console.log(\"The result of searching colle Beta (info.status: \\\"meditating\\\"): \");\r\n console.log(await ula.searchMany(dbIndex.db.colles.beta, {\"info.status\": \"meditating\"}, {projection: {_id: 0}}));\r\n console.log();\r\n\r\n // Use `searchOne()` to search the object(s) within {name: \"beta_test_2\"} in collection Beta.\r\n console.log(\"The result of searching colle Beta (name: \\\"beta_test_2\\\"): \");\r\n console.log(await ula.searchOne(dbIndex.db.colles.beta, {name: \"beta_test_2\"}, {projection: {_id: 0}}));\r\n console.log();\r\n\r\n // Use `deleteMany()` to delete the object(s) within {realName: \"ἑωσφόρος\"} in collection Beta.\r\n console.log(\"The result of deleting object(s) colle Beta (realName: \\\"ἑωσφόρος\\\"): \");\r\n console.log((await ula.deleteMany(dbIndex.db.colles.beta, {realName: \"ἑωσφόρος\"})).result);\r\n console.log();\r\n\r\n // Use `updateOne()` to update the object(s) within {name: \"beta_test_2\"} in collection Beta.\r\n console.log(\"The result of updating colle Beta (name: \\\"beta_test_2\\\"): \");\r\n console.log((await ula.updateOne(dbIndex.db.colles.beta, {name: \"beta_test_2\"}, {$set: {id: 2, realName: \"Satoshi Nakamoto\"}})).result);\r\n console.log();\r\n\r\n // Use `searchMany()` to search what objects in collection Alpha.\r\n console.log(\"The result of searching colle Alpha (exclude `_id`): \");\r\n console.log(await ula.searchMany(dbIndex.db.colles.beta, {}, {projection: {_id: 0}}));\r\n console.log();\r\n\r\n // Use `closeClient()` to close the current MongoDB Client.\r\n await ula.closeClient();\r\n console.log(\"The MongoDB Client is closed.\");\r\n console.log();\r\n}", "title": "" }, { "docid": "7185c39589cf2c2bebc1be3030ec7ce5", "score": "0.5070175", "text": "isIndexFulfilledBy(index1, index2) {\n // allow the other index to be equally large only. It being larger is an option but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)\n if (index1.columnNames.length !== index2.columnNames.length) {\n return false;\n }\n function spansColumns() {\n for (let i = 0; i < index1.columnNames.length; i++) {\n if (index1.columnNames[i] === index2.columnNames[i]) {\n continue;\n }\n return false;\n }\n return true;\n }\n // Check if columns are the same, and even in the same order\n if (!spansColumns()) {\n return false;\n }\n if (!index1.unique && !index1.primary) {\n // this is a special case: If the current key is neither primary or unique, any unique or\n // primary key will always have the same effect for the index and there cannot be any constraint\n // overlaps. This means a primary or unique index can always fulfill the requirements of just an\n // index that has no constraints.\n return true;\n }\n return index1.primary === index2.primary && index1.unique === index2.unique;\n }", "title": "" }, { "docid": "3451b98618afa76b00c1b3d9437ca322", "score": "0.50696546", "text": "async function init() {\n return del('')\n .then(res => put('', undefined))\n .then(res => {\n if (res.acknowledged != true)\n throw 'error: index -> put index'\n else\n put('/_mapping/group', group_mapping)\n\n })\n }", "title": "" }, { "docid": "6d0c6476d7614863c4c8a9a39401cef0", "score": "0.50695866", "text": "function isIndexedDBAvailable() {\n return ('indexedDB' in self) && indexedDB != null;\n}", "title": "" }, { "docid": "a590da0f72d4b60079e6fb6a3dedf52b", "score": "0.5061073", "text": "enterTable_index_clause(ctx) {\n\t}", "title": "" }, { "docid": "36da721cfd19808887d40f45afe70247", "score": "0.505997", "text": "function createIndex(data) {\n index = lunr(function() {\n this.field('name', {boost: 10});\n this.field('definition');\n this.field('tags', {boost: 3});\n this.ref('id');\n });\n\n $.each(data, function(i, term) {\n index.add({\n id: i,\n name: term.name,\n definition: term.definition,\n tags: term.tags.toString()\n });\n });\n }", "title": "" }, { "docid": "728fbbc180df2ebed4d6dfa04fcb7c8a", "score": "0.5049502", "text": "get indexName() {\n return undefined;\n }", "title": "" } ]
da7f67712b32af6e20ff4690d57d43eb
=> 4 closure criterias 1) Closures are property of JS functions 2) To observe the closure you must execute the function in a different scope than where that function was originally defined. Closures matter because they allow us to remember or keep track of values ///////////////////////////////////////////////////////////////////////////// //////// ARROW FUNCTIONS ////////// ///////////////////////////////////////////////////////////////////////////// => 1) Concise way for creating functions 2) Easier working with this keyword in objects / classes Their properties 1) Arrow functions are all function expressions and therefore they're assign to a variable 2) All arrow functions are anonymous functions
[ { "docid": "d3d316527d8f57e5094a5d7797795eeb", "score": "0.0", "text": "function functionName() {\n return 'value';\n}", "title": "" } ]
[ { "docid": "50aba4bbbcedce092bd98e098c4106ca", "score": "0.66064477", "text": "function closure() {\n\tconst a = 1.8;\n\tconst b = 32;\n\treturn c => c * a + b;\t\t\t// return anon func which MAINTAINS access to A and B\n}", "title": "" }, { "docid": "c9035fb92e89c13cfb5811a13e513cbd", "score": "0.6531512", "text": "function closure() {\n // emulate private variables\n var x = 1;\n return function() {\n return x++;\n }\n}", "title": "" }, { "docid": "ddc7b83f80a1a72c71b203dda378dba2", "score": "0.63525426", "text": "function visitArrowFunction(node){if(node.transformFlags&16384/* ContainsLexicalThis */){enableSubstitutionsForCapturedThis();}var savedConvertedLoopState=convertedLoopState;convertedLoopState=undefined;var ancestorFacts=enterSubtree(16256/* ArrowFunctionExcludes */,66/* ArrowFunctionIncludes */);var func=ts.createFunctionExpression(/*modifiers*/undefined,/*asteriskToken*/undefined,/*name*/undefined,/*typeParameters*/undefined,ts.visitParameterList(node.parameters,visitor,context),/*type*/undefined,transformFunctionBody(node));ts.setTextRange(func,node);ts.setOriginalNode(func,node);ts.setEmitFlags(func,8/* CapturesThis */);exitSubtree(ancestorFacts,0/* None */,0/* None */);convertedLoopState=savedConvertedLoopState;return func;}", "title": "" }, { "docid": "bba81e0aeaa5899c9111c10bbcaaac02", "score": "0.6298221", "text": "function aa() {\n return function(a) {\n return a\n }\n }", "title": "" }, { "docid": "65d9a174a251007a5b5638392c60ff1a", "score": "0.62925273", "text": "function aa(){return function(){}}", "title": "" }, { "docid": "b8fe7c8b7519153b7a41e2f0cf17d4de", "score": "0.62896293", "text": "function createFunction() {\r\n return function () {\r\n console.log(\"hello\");\r\n };\r\n}", "title": "" }, { "docid": "70d56cbc6555d9f6f1eebc9009b1bde4", "score": "0.6249926", "text": "createWrappedFunction(fn) {\n\n\t\t\treturn fn;\n\n\t\t\t// // console.log(\"createWrappedFunction\", fn);\n\t\t\t// let code = fn.toString();\n\t\t\t// //\tI know, it's a bit dirty but it works on maaaany cases\n\t\t\t// //\tI just want to same developer experience as Moleculer\n\t\t\t// const extract = code.slice(code.indexOf(\"{\") + 1, code.lastIndexOf(\"}\"));\n\t\t\t// //\n\t\t\t// const asynchronous = code.indexOf(\"async\") > -1;\n\t\t\t// var AsyncFunction = Object.getPrototypeOf(async function(){}).constructor\n\t\t\t// //\n\t\t\t// if (asynchronous) {\n\t\t\t// \treturn AsyncFunction(\"ctx\", extract).bind(this);\n\t\t\t// }\n\t\t\t// return Function(\"ctx\", extract);\n\t\t}", "title": "" }, { "docid": "42c0600463ad5013353cec9e679a8291", "score": "0.6194205", "text": "function visitArrowFunction(node) {\n if (node.transformFlags & 16384 /* ContainsLexicalThis */) {\n enableSubstitutionsForCapturedThis();\n }\n var savedConvertedLoopState = convertedLoopState;\n convertedLoopState = undefined;\n var ancestorFacts = enterSubtree(16256 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */);\n var func = ts.createFunctionExpression(\n /*modifiers*/ undefined,\n /*asteriskToken*/ undefined,\n /*name*/ undefined,\n /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),\n /*type*/ undefined, transformFunctionBody(node));\n ts.setTextRange(func, node);\n ts.setOriginalNode(func, node);\n ts.setEmitFlags(func, 8 /* CapturesThis */);\n exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n convertedLoopState = savedConvertedLoopState;\n return func;\n }", "title": "" }, { "docid": "b3f6a128aeaae41905a5a6cbc72bd764", "score": "0.61713785", "text": "function foo() {\n console.log(this);\n\n return function () {\n console.log(this);\n };\n}", "title": "" }, { "docid": "2ef11e3865131caafa53636fafe0907f", "score": "0.6158812", "text": "function Closure (fn) {\n if (typeof fn !== 'function')\n throw Error(\"Closures are function wrappers\");\n\n this.fn = fn;\n this.type = 'closure';\n}", "title": "" }, { "docid": "9b69fb926d86ab0f8ed5e5ded737fe93", "score": "0.6148845", "text": "function foo(){\n\treturn (a) => {\n\t\tconsole.log(this.a);\n\t};\n}", "title": "" }, { "docid": "1da4f22559d54061b9200e3a8b0f74d5", "score": "0.614544", "text": "function f(){return function(){}}", "title": "" }, { "docid": "1da4f22559d54061b9200e3a8b0f74d5", "score": "0.614544", "text": "function f(){return function(){}}", "title": "" }, { "docid": "140ecc663881e60441e6b79477b8b577", "score": "0.61131495", "text": "function closureExample() {\n\tvar arr = [];\n\n\tfor (var i = 0; i < 3; i++) {\n\t\tarr.push(function() {\n\t\t\tconsole.log(i);\n\t\t});\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "7e887da0eaba31df00c38e867c4b5f34", "score": "0.6112961", "text": "function myHigherOrderFun() {\n return function() {\n return \"Do something\";\n }\n }", "title": "" }, { "docid": "30f74c803dec46b9143f62e79af309ec", "score": "0.6111568", "text": "function foo() {\r\n // return an arrow function\r\n return (a) => {\r\n // `this` here is lexically adopted from `foo()`\r\n console.log(this.a);\r\n };\r\n}", "title": "" }, { "docid": "34ef3acc9e1654947c24b44a952ce1e5", "score": "0.6056949", "text": "function Counter() {\n let count = 0;\n\n return function() {\n return count++;\n };\n}", "title": "" }, { "docid": "d5ccc82db1fc4134c502cfbddd5f454e", "score": "0.6047865", "text": "function cs(f) {\n return {closure: f};\n}", "title": "" }, { "docid": "64875a0136f912ff2cd7a805890132ea", "score": "0.6046262", "text": "function aa(){return function(a){return a}}", "title": "" }, { "docid": "7000fd7b3e1393c03b6d30ce758a4131", "score": "0.6040918", "text": "function f(z){\n let x = z;\n return function(){ return x; }\n }", "title": "" }, { "docid": "7000fd7b3e1393c03b6d30ce758a4131", "score": "0.6040918", "text": "function f(z){\n let x = z;\n return function(){ return x; }\n }", "title": "" }, { "docid": "2e3ff116e2bc07858b4868ad934b5a57", "score": "0.60262245", "text": "function visitArrowFunction(node) {\n if (node.transformFlags & 8192 /* ContainsLexicalThis */ && !(hierarchyFacts & 16384 /* StaticInitializer */)) {\n hierarchyFacts |= 65536 /* CapturedLexicalThis */;\n }\n var savedConvertedLoopState = convertedLoopState;\n convertedLoopState = undefined;\n var ancestorFacts = enterSubtree(15232 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */);\n var func = factory.createFunctionExpression(\n /*modifiers*/ undefined, \n /*asteriskToken*/ undefined, \n /*name*/ undefined, \n /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n /*type*/ undefined, transformFunctionBody(node));\n ts.setTextRange(func, node);\n ts.setOriginalNode(func, node);\n ts.setEmitFlags(func, 8 /* CapturesThis */);\n // If an arrow function contains\n exitSubtree(ancestorFacts, 0 /* ArrowFunctionSubtreeExcludes */, 0 /* None */);\n convertedLoopState = savedConvertedLoopState;\n return func;\n }", "title": "" }, { "docid": "4c55dba29b5fde3aa70594bd137b5de5", "score": "0.6024029", "text": "function Fn($1) { return function($2) { return Function_ ([$1, $2]); }; }", "title": "" }, { "docid": "3bd6571ee2edcb35b2227fea7c7593e4", "score": "0.6019309", "text": "function g(){return function(){}}", "title": "" }, { "docid": "3bd6571ee2edcb35b2227fea7c7593e4", "score": "0.6019309", "text": "function g(){return function(){}}", "title": "" }, { "docid": "9694966d70834bc5cb604fb2b87f4de7", "score": "0.6018409", "text": "function Fnexp() {\n\n const that = this;\n this.fnexpTestName = \"I am global context\";\n let value = (function ex() {\n let closureletiable = \" IN CLOSURE\";\n return function() {\n console.log(\"function expression assignment is ok\");\n return \"function expression \" + closureletiable;\n };\n })() /*ex()*/ (); /*the return anonymous function*/\n console.log(value);\n //in fnexp, this = its container(function, object).this\n //new fnexp is ok\n (function checkContext() {\n this.fnexpTestName = \"I am closure context\";\n console.log(that.fnexpTestName);\n console.log(this.fnexpTestName);\n })();\n}", "title": "" }, { "docid": "7a41db7934a33d8198ad220190bab8a7", "score": "0.5996168", "text": "constructor(a, b) {\n // public\n this._a = a\n // \"private\" -> closure variable, can't be access from outside\n let _b = b\n // true private from the t39/stage3 \n // this.#b = b\n // or simply\n // #b = b\n\n this.sumFunction = () => { // start of another closure\n // has access to this, a, b, _b\n this._a = this._a + _b\n }\n\n this.sumFunction2 = (integer) => { // since this has access to the same parameter\n // & variables as the closure above, js just \"merge\"\n // them & don't start another closure\n this._a = this._a + _b + integer\n }\n }", "title": "" }, { "docid": "78b7c120a95bdb012b963fece93a599e", "score": "0.59865016", "text": "function outerFn () {\n return function() {\n return 'jared hensley';\n }\n}", "title": "" }, { "docid": "c2ddffa6ca06aa8144e021bbaae97f1b", "score": "0.59804785", "text": "function makeCounter() {\n let count = 0;\n return function () {\n return count++;\n }\n}", "title": "" }, { "docid": "4ddf5b9c8e43f5bcfdb6ede3eb081b60", "score": "0.597427", "text": "function makeCounter() {\n let i = 0;\n return function () {\n return ++i;\n }\n}", "title": "" }, { "docid": "b84a0d5026ed1f9f7db985fb641499f8", "score": "0.59528595", "text": "function test1() {\n var a = () => {\n return 123;\n };\n\n a();\n\n var b = arg => {\n return arg;\n };\n\n b(123);\n\n var c = (arg1, arg2) => {\n return arg1 + arg2;\n };\n\n c(1, 1);\n\n var d = () => 123;\n\n d();\n\n var e = arg => arg;\n\n e(123);\n\n var f = arg => {\n return arg;\n };\n\n f(123);\n\n var g = (arg1, arg2) => arg1 + arg2;\n\n g(1, 1);\n}", "title": "" }, { "docid": "9e23658d443b4bc5840c784f81a8db24", "score": "0.59439516", "text": "function closure2() {\n var localNum = 42\n addOne = () => localNum++ //addOne and getNum are GLOBAL since var was not used\n getNum = () => localNum\n}", "title": "" }, { "docid": "cd1998169fd301e713bc78dccbc26397", "score": "0.5938542", "text": "function Fnexp() {\n\n const that = this;\n this.fnexpTestName = \"I am global context\";\n var value = (function ex() {\n var closureVariable = \" IN CLOSURE\";\n return function() {\n console.log(\"function expression assignment is ok\");\n return \"function expression \" + closureVariable;\n };\n })() /*ex()*/ (); /*the return anonymous function*/\n console.log(value);\n //in fnexp, this = its container(function, object).this\n //new fnexp is ok\n (function checkContext() {\n this.fnexpTestName = \"I am closure context\";\n console.log(that.fnexpTestName);\n console.log(this.fnexpTestName);\n })();\n}", "title": "" }, { "docid": "c96649862cf363811e1ae3684aafc4ce", "score": "0.59320277", "text": "function c(a){return function(){return a}}", "title": "" }, { "docid": "c96649862cf363811e1ae3684aafc4ce", "score": "0.59320277", "text": "function c(a){return function(){return a}}", "title": "" }, { "docid": "c96649862cf363811e1ae3684aafc4ce", "score": "0.59320277", "text": "function c(a){return function(){return a}}", "title": "" }, { "docid": "c96649862cf363811e1ae3684aafc4ce", "score": "0.59320277", "text": "function c(a){return function(){return a}}", "title": "" }, { "docid": "359211a959d83bcbcaac6314161d3471", "score": "0.591103", "text": "function buildFunctions2() {\n var arr = [];\n\n for (var i = 0; i < 3; i++) {\n const j = i; // any time a new value is assigned to j\n arr.push(function () {\n console.log(j);\n });\n }\n\n return arr;\n}", "title": "" }, { "docid": "2946865d0d360abca05eb18e197dad01", "score": "0.58972734", "text": "function sayYay() {\n return function() {\n console.log('Yay!');\n }\n}", "title": "" }, { "docid": "c5471c0793b1a48d133a40533756f215", "score": "0.58894664", "text": "function getClosure() {\n let counter=0;\n return function () {\n console.log(++counter);\n }\n}", "title": "" }, { "docid": "3de875613e3b5d46635645df3afe3532", "score": "0.58741987", "text": "function constfunc(v) { return function () { return v;}}", "title": "" }, { "docid": "2e412f1efd953aa4df25f90a3626da96", "score": "0.58714575", "text": "function creaClosure(name) {\n\treturn function(){\n\t\tconsole.log(name);\n\t}\n}", "title": "" }, { "docid": "a49f3844e9e38bd30a4d313803919706", "score": "0.587122", "text": "function example (){\n let a = 'Hello'\n return function foo (){\n console.log(` ${a} and ${this}`) \n }\n }", "title": "" }, { "docid": "79ca9bb2927e59e3f8a2d19478efa1c6", "score": "0.5871147", "text": "function creaSumador(x) {\n return function (y) {\n return x + y;\n };\n}", "title": "" }, { "docid": "67378fb9d4bcfa4427cd48a81a8fa937", "score": "0.58619314", "text": "function m(){return function(){}}", "title": "" }, { "docid": "09563fa4c298033bb48e7154453937c0", "score": "0.5860852", "text": "function makeFunctionArray() {\n\n\tconst arr = [];\n\n\tfor (var i = 0; i < 5; i++) {\n\n\t\tarr.push(function() { console.log(i) } )\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "826538659214852ee6ecb4584b774669", "score": "0.58579403", "text": "function b() {\n return ()=>{\n console.log(this);\n }\n}", "title": "" }, { "docid": "cfff1b921e2d4a6e3a749fb3cc1e75b5", "score": "0.5842373", "text": "function makeFunctionArray() {\n const arr = []\n\n // Scope of var is the function in which its called\n // Scope of let is the code block in which its called\n // (in this case, scope of let is the for-loop)\n for (var i = 0; i < 5; i++) {\n arr.push(function () { console.log(i) })\n }\n return arr\n}", "title": "" }, { "docid": "f8cbc1f67ec2ae62269efa69a1c10563", "score": "0.58290064", "text": "function three() {\n return function four() {\n console.log('four');\n }\n}", "title": "" }, { "docid": "676ed7790065e885734c674e29291ced", "score": "0.5827722", "text": "function b() {\n return function c() { console.log('buuuuja ') }\n}", "title": "" }, { "docid": "4dcb650239831d64900f0db650a6fbcc", "score": "0.5818543", "text": "function closureExample2() {\n\tvar arr = [];\n\n\tfor (var i = 0; i < 3; i++) {\n\t\t// the 'let' keyword will allow us to assign j to the for code block\n\t\tlet j = i;\n\t\tarr.push(function() {\n\t\t\tconsole.log(j);\n\t\t});\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "47a923f3fced8e0eb3f99511c05f7c9b", "score": "0.5814103", "text": "function createFunction() {\n function multiplyBy2 (num) {\n return num * 2;\n }\n return multiplyBy2;\n}", "title": "" }, { "docid": "6a4c7debb823a37d3fc0de8d4d9a1b28", "score": "0.58045536", "text": "function closureExample3() {\n\tvar arr = [];\n\n\tfor (var i = 0; i < 3; i++) {\n\t\t// we create a function with param 'j' and pass 'i' when we invoke the function\n\t\t// each time we invoke the function, the JS engine will store 'j' in memory as different variables\n\t\tarr.push(\n\t\t\t(function(j) {\n\t\t\t\treturn function() {\n\t\t\t\t\tconsole.log(j);\n\t\t\t\t}\n\t\t\t}(i))\n\t\t)\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "bd30bcc1fc43bca76fcc7106971ad2cf", "score": "0.5803205", "text": "function cAdd(a) {\n return function(b) {\n return a + b;\n }\n}", "title": "" }, { "docid": "b3782e188e290abdd216e31a2ae7b7ec", "score": "0.57995045", "text": "function returnMyFunction() {\n\treturn function(){console.log('Bye?')};\n}", "title": "" }, { "docid": "250d8134c5fb7fd514ba251f9792c427", "score": "0.5796691", "text": "function foo(x,y) {\n return function() {\n return x + y;\n }\n}", "title": "" }, { "docid": "31a805086e9276dbac415b207e092a98", "score": "0.5794947", "text": "function createFunction() {\n function innerFunction() {\n console.log(\"hello\");\n }\n return innerFunction;\n}", "title": "" }, { "docid": "960324022edec9002094cdc17cb85538", "score": "0.57935834", "text": "function createFunction() {\n function printHello(){\n console.log(\"hello\")\n }return printHello;\n }", "title": "" }, { "docid": "558a6ec71fe831e0f610152be436cd6e", "score": "0.5791834", "text": "function thirdOne(){\n return function(){\n return 'Three';\n }\n}", "title": "" }, { "docid": "26e0581229c5686a0529ac82025c37d0", "score": "0.5780082", "text": "function fn() {\n a = 0;\n return function(b) {\n return b + a++;\n }\n}", "title": "" }, { "docid": "b38c337fcc9196251acceab7f7db3a3d", "score": "0.5766969", "text": "function complicated() {\r\n console.log(\"Inside the function\");\r\n return function () {\r\n console.log(\"Iam inside the (function inside the function)\");\r\n return \"something\";\r\n };\r\n}", "title": "" }, { "docid": "7315aa12960afaab424b0c3012e1f8b4", "score": "0.57643116", "text": "function amIClosure () {\n let x = 'I am not used by the inner function'\n return function amIClosure(){\n console.log('Am I a closure if I do not reference my surrounding state?')\n }\n }", "title": "" }, { "docid": "52a07e90bf0b3e2de169d8dfdc250502", "score": "0.57543063", "text": "[4 + 2]() { //E' LO STESSO DI obj[\"6\"] = function(){\n \t\treturn \"hello from 6!\"; \t \t\n \t}", "title": "" }, { "docid": "aac3a99188a3df67d570fb12a61346d4", "score": "0.57517606", "text": "function count() {\n let counter = 0;\n return function () {\n counter++;\n };\n}", "title": "" }, { "docid": "f47cf3cd6ab778860e7dfab9871f8377", "score": "0.57504636", "text": "function buildFunctions2() {\n var arr = [];\n\n for (var i = 0; i < 3; i++) {\n // the 'let' is new to ES6\n let j = i\n arr.push(\n function() {\n console.log(j)\n }\n )\n }\n return arr;\n}", "title": "" }, { "docid": "a04af365f8671eaac3a44d6c78997b1b", "score": "0.57472354", "text": "function getCounter() {\n let counter = 0;\n return function() {\n return counter++;\n }\n}", "title": "" }, { "docid": "56bd2b30e27231100e6f212c7fbbab41", "score": "0.5743029", "text": "function returnNewNinjaFunction(){\n return function(){}; //returns a new function\n}", "title": "" }, { "docid": "1d11451132c33a9689e940aa26b92b53", "score": "0.57400733", "text": "function buildFunctions2() {\n var arr = [];\n\n for (var i = 0; i < 3; i++) {\n let j = i;\n arr.push(function () {\n console.log(j);\n });\n }\n\n return arr;\n}", "title": "" }, { "docid": "293ce3b7ca043ecd141bf261d901bdee", "score": "0.5728299", "text": "function a() {\n console.log('A!');\n return function () {\n console.log('B!');\n };\n}", "title": "" }, { "docid": "293ce3b7ca043ecd141bf261d901bdee", "score": "0.5728299", "text": "function a() {\n console.log('A!');\n return function () {\n console.log('B!');\n };\n}", "title": "" }, { "docid": "d512bfcb948bdd784e9bc011807cc551", "score": "0.57230085", "text": "function b(){\n return function c() {console.log('Okay Bye')}\n}", "title": "" }, { "docid": "9882520b6f677ee072db9d503e5bc00b", "score": "0.5720079", "text": "function newfunc() {\n return function() {};\n}", "title": "" }, { "docid": "6592ba45184ddfc1763cd9d51a1bfe7b", "score": "0.571978", "text": "function exercise5(value) {\n if (!value) {\n value = 0;\n }\n return function () {\n return value + 10;\n }\n}", "title": "" }, { "docid": "71820311a779ff3ee10f3b3054839d9f", "score": "0.57150567", "text": "function foo() {\n console.log( 'foo() call context is ', this );\n\n function bar_old_syntax() {\n console.log( 'bar_old_syntax() call context is ', this );\n }\n \n const bar_arrow_syntax = () => {\n console.log( 'bar_arrow_syntax() call context is ', this );\n };\n}", "title": "" }, { "docid": "a0e19ceb9fda7da81b71c9ddbdad815a", "score": "0.57039255", "text": "function add(a){\n\n return function(b){\n \n return a + b\n }\n}", "title": "" }, { "docid": "c207ad7a2e39d696a97b03e1a58c405f", "score": "0.57011575", "text": "function test(a) {\n a = a * 10;\n return function () {\n return a;\n };\n}", "title": "" }, { "docid": "ef173e0f2272a594b261c7ff0fae2dd8", "score": "0.57006866", "text": "function buildFunctions2(){\n var arr = [];\n\n for(var i = 0; i < 3; i++){\n let j = i;\n arr.push(function(){\n console.log(j);\n });\n }\n\n return arr;\n}", "title": "" }, { "docid": "6d444f49b800258435315d9d314fa0b4", "score": "0.56982315", "text": "function test() {\n let msg = \" I am learning clouser\";\n\n return function() {\n console.log(msg);\n };\n}", "title": "" }, { "docid": "01bfac06e060b01e37be8056adad1c8d", "score": "0.56965345", "text": "function creaFuncion(){\n /* puede retornar una funcion anonima o funcion explicita */\n return function( nombre ){ /* retorna una funcion anonima */\n console.log(\"Me creo \" + nombre)\n return function(){\n console.log( \"Segunda funcion\");\n }\n }\n}", "title": "" }, { "docid": "2fe8f8ff769e0042c7773dc9b041c33a", "score": "0.56917936", "text": "function generateFunctionArray() {\n var arr = [];\n for (var i = 0; i < 5; i++) {\n arr.push(\n ((value)=>() => console.log(value))(i)\n );\n }\n return arr;\n}", "title": "" }, { "docid": "9943f0523e58e628354aa601be3c3944", "score": "0.56876093", "text": "function sum(a){\n return function(b){\n return a+b\n }\n}", "title": "" }, { "docid": "dece8fe68b0fd9e200ecd3df2c412cec", "score": "0.56855804", "text": "function outerFunction() {\n var outerVar = 10;\n return function(){\n return outerVar * 2;\n }\n}", "title": "" }, { "docid": "914b8b77acbcf2529ae8415b402cd421", "score": "0.5676385", "text": "function sumar1(x){\r\n return function(y){\r\n return x+y\r\n }\r\n}", "title": "" }, { "docid": "62bd4a7fcd39f9af946deee9bbd0a573", "score": "0.5673924", "text": "function b() {\r\n return function c() {console.log('bye')}\r\n}", "title": "" }, { "docid": "fc84c876f95f091600ad12a74b4e720c", "score": "0.5672722", "text": "function whatWasTheLocal() {\n var captured = \"Oh Hai\";\n\n return function() {\n return \"The local was: \" + captured;\n };\n}", "title": "" }, { "docid": "f8c9d7726bfd67cfd25bff3ab8a85124", "score": "0.5670453", "text": "function foo() {\n return function() {\n console.log('function bar called!\\n');\n };\n}", "title": "" }, { "docid": "fcea99a27a8095db681d2545972b523a", "score": "0.5663986", "text": "function buildFunctions(){\n\n var arr = [];\n\n for(var i = 0; i<3; i++){\n arr.push(function(){\n console.log(i);\n }(i));\n }\n\n return arr;\n}", "title": "" }, { "docid": "b39af2e1b89a8624a9c3e8adc9b67dcf", "score": "0.56637436", "text": "function closure() {\n\t\tlet counter = 0;\n\t\tlet arr = [];\n\n\t\treturn [\n\t\t\t// If counter is less than 3 then add the sum to the array, always return arr\n\t\t\t(arg1, arg2) => counter < 3 ? (arr.push(arg1 + arg2), arr) : arr, // NOTE: `expr, expr` returns the value of the last expression\n\t\t\t// Increment counter\n\t\t\t() => { counter++; }\n\t\t];\n\t}", "title": "" }, { "docid": "76490a0787fa6eb31ed7ae62ff0787c2", "score": "0.56636477", "text": "function b() {\n return function c() {console.log('bye')}\n}", "title": "" }, { "docid": "76490a0787fa6eb31ed7ae62ff0787c2", "score": "0.56636477", "text": "function b() {\n return function c() {console.log('bye')}\n}", "title": "" }, { "docid": "76490a0787fa6eb31ed7ae62ff0787c2", "score": "0.56636477", "text": "function b() {\n return function c() {console.log('bye')}\n}", "title": "" }, { "docid": "2d19c7e9651efab66244ef347040a864", "score": "0.565143", "text": "function addf(first) {\n //return (second) => first + second;\n return function (second) {\n return first + second;\n };\n}", "title": "" }, { "docid": "60cd1c5c8661f0eb231a82a823607626", "score": "0.5642836", "text": "function insideF () { // start another closure\n return x + 5;\n }", "title": "" }, { "docid": "ee754984d12d3d5d38750baadd97c075", "score": "0.56403184", "text": "function cars(){\n let fav = 'jeep';\n return function price(){ \n return console.log(fav);\n };\n }", "title": "" }, { "docid": "7b421939c4d3abe65d6ea4430fc8242b", "score": "0.56364554", "text": "function foo() {\n var count = 0\n\n return function () {\n return count++;\n };\n}", "title": "" }, { "docid": "e3d82f7c951eb03bcd433c089023c51e", "score": "0.5625066", "text": "function e() {\n return function () {\n console.log(\"E\");\n };\n }", "title": "" }, { "docid": "2e49f665a01fc7f3e70f3524fe80b0e2", "score": "0.56219393", "text": "function makeAccessorsFromFunction(callback) {\n return objectMap(ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "title": "" }, { "docid": "c0512c72768d8329eadf52603ada3e54", "score": "0.5621691", "text": "function makeAccessorsFromFunction(callback) {\n\t return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n\t return function() {\n\t return callback()[key];\n\t };\n\t });\n\t }", "title": "" }, { "docid": "c0512c72768d8329eadf52603ada3e54", "score": "0.5621691", "text": "function makeAccessorsFromFunction(callback) {\n\t return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n\t return function() {\n\t return callback()[key];\n\t };\n\t });\n\t }", "title": "" }, { "docid": "1e50546ed48787d66102bfb271fd0413", "score": "0.5615801", "text": "function Student() {\n var name='';\n var age='';\n return{ //?return multi closure\n set:(in_name,in_age)=>{\n name = in_name;\n age = in_age;\n },\n getName:()=>{\n return name;\n },\n getAge:()=>{\n return age;\n }\n }\n}", "title": "" }, { "docid": "38662fdfb71dbde49081b7c85b0dda7b", "score": "0.558365", "text": "function outerFn() {\n \treturn function() {\n \t\treturn 'Luke Jensen';\n \t}\n }", "title": "" } ]
108fef6c3415d3c0b1b365ab7cbe0113
Resolve collisions between nodes.
[ { "docid": "0668d8aed35c69149a5fc8ca2ae93b0c", "score": "0.0", "text": "function collide(alpha) {\n var q = d3.geom.quadtree(data.topics);\n return function(d) {\n var r = d.cr + maxRadius + collisionPadding,\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n q.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d) && d.other !== quad.point && d !== quad.point.other) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.cr + quad.point.r + collisionPadding;\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n}", "title": "" } ]
[ { "docid": "dc4ff72707d13b4aac9d7a28729fb1aa", "score": "0.7453836", "text": "function resolveCollisions() {\n columns.forEach(function (nodes) {\n var node,\n dy,\n y = y0,\n n = nodes.length,\n i;\n\n // Push any overlapping nodes down.\n nodes.sort(ascendingBreadth);\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dy = y - node.y0;\n\n if (dy > 0) {\n node.y0 += dy;\n node.y1 += dy;\n }\n y = node.y1 + py;\n }\n\n // If the bottommost node goes outside the bounds, push it back up.\n dy = y - py - y1;\n if (dy > 0) {\ny = node.y0 -= dy, node.y1 -= dy;\n\n // Push any overlapping nodes back up.\n for (i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.y1 + py - y;\n if (dy > 0) node.y0 -= dy, node.y1 -= dy;\n y = node.y0;\n }\n }\n });\n }", "title": "" }, { "docid": "1b412cd1874aea93fa143d563167078a", "score": "0.68858033", "text": "function collide() {\n\t\tfor (var k = 0, iterations = 4, strength = 0.5; k < iterations; ++k) {\n\t\t\tfor (var i = 0, n = nodes.length; i < n; ++i) {\n\t\t\t\tfor (var a = nodes[i], j = i + 1; j < n; ++j) {\n\t\t\t\t\tvar b = nodes[j],\n\t\t\t\t\tx = a.x + a.vx - b.x - b.vx,\n\t\t\t\t\ty = a.y + a.vy - b.y - b.vy,\n\t\t\t\t\tlx = Math.abs(x),\n\t\t\t\t\tly = Math.abs(y),\n\t\t\t\t\tr = a.r + b.r;\n\t\t\t\t\tif (lx < r && ly < r) {\n\t\t\t\t\t\tif (lx > ly) {\n\t\t\t\t\t\t\tlx = (lx - r) * (x < 0 ? -strength : strength);\n\t\t\t\t\t\t\ta.vx -= lx, b.vx += lx;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tly = (ly - r) * (y < 0 ? -strength : strength);\n\t\t\t\t\t\t\ta.vy -= ly, b.vy += ly;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "08098c44529234c2e417da01e07a6ea3", "score": "0.66825205", "text": "function resolveCollisions(collisions) {\n collisions.forEach(collision => {\n console.log(`${now()} | index | collision | ${collision.a.id} > ${collision.b.id} - x:${collision.mtv.x.toFixed(3)}, y:${collision.mtv.y.toFixed(3)}`);\n\n // we can assume collision.a is always a GameObject\n // let aPosition = collision.a.getComponent('Transform').position;\n let aBoundingBox = collision.a.getComponent('BoundingBox');\n let aPoints = aBoundingBox.getPointsInWorldSpace();\n // let aNormals = aBoundingBox.getEdgeNormals();\n\n // NetworkService.get().broadcast(`debug-points|${aPoints.map(p => `${p.x},${p.y}`).join('|')}`);\n // NetworkService.get().broadcast(`debug-normals|${aPosition.x},${aPosition.y}|${aNormals.map(n => `${n.x}, ${n.y}`).join('|')}`);\n\n // let bPosition = collision.b.getComponent('Transform').position;\n let bBoundingBox = collision.b.getComponent('BoundingBox');\n let bPoints = bBoundingBox.getPointsInWorldSpace();\n // let bNormals = bBoundingBox.getEdgeNormals();\n\n // NetworkService.get().broadcast(`debug-points|${bPoints.map(p => `${p.x},${p.y}`).join('|')}`);\n // NetworkService.get().broadcast(`debug-normals|${bPosition.x},${bPosition.y}|${bNormals.map(n => `${n.x}, ${n.y}`).join('|')}`);\n\n let aVelocityBeforeCollision = collision.a.getComponent('RigidBody').velocity;\n\n // we can assume collision.a is always dynamic\n translateOutOfCollision(collision.a, collision.mtv);\n let bEdge = contactPoints.findBestEdge(bPoints, collision.mtv.clone().invert());\n applyBounce(collision.a, bEdge);\n\n if (isDynamic(collision.b)) {\n if (collision.a.type === 'Bullet' && collision.b.type === 'Ship') {\n collision.a.destroy();\n let replacementEntity = spawnPlayer(collision.b.sessionId);\n EntityService.get().add(replacementEntity);\n NetworkService.get().broadcast(`add|${replacementEntity.serialize()}`);\n NetworkService.get().send(replacementEntity.sessionId, `identity|${replacementEntity.id}`);\n collision.b.destroy();\n } else if (collision.a.type === 'Ship' && collision.b.type === 'Bullet') {\n collision.b.destroy();\n let replacementEntity = spawnPlayer(collision.a.sessionId);\n EntityService.get().add(replacementEntity);\n NetworkService.get().broadcast(`add|${replacementEntity.serialize()}`);\n NetworkService.get().send(replacementEntity.sessionId, `identity|${replacementEntity.id}`);\n collision.a.destroy();\n } else {\n translateOutOfCollision(collision.b, collision.mtv.clone().invert());\n let aEdge = contactPoints.findBestEdge(aPoints, collision.mtv);\n applyBounce(collision.b, aEdge);\n\n let bVelocityBeforeCollision = collision.b.getComponent('RigidBody').velocity;\n collision.a.getComponent('RigidBody').velocity.add(bVelocityBeforeCollision.multiplyScalar(0.5));\n collision.b.getComponent('RigidBody').velocity.add(aVelocityBeforeCollision.multiplyScalar(0.5));\n }\n }\n });\n}", "title": "" }, { "docid": "0ff688dee1cab82e843f84c470596c7f", "score": "0.65587705", "text": "function collide(alpha, nodes) {\n var q = d3.geom.quadtree(nodes),\n i = 0,\n n = nodes.length;\n while (++i < n) {\n q.visit(resolveCollision(nodes[i]));\n }\n}", "title": "" }, { "docid": "c29f38b71c89d42449022886046ea034", "score": "0.6336861", "text": "function resolveCollision(one, two) {\n var totRadius = one.radius + two.radius + COLLISION_EPSILON;\n var centersVec = one.pos.clone();\n centersVec.subSelf(two.pos);\n var totDistance = centersVec.length();\n var totVel = one.vel.clone();\n totVel.addSelf(two.vel);\n var totVelMag = totVel.length();\n // this is the normal pointing from one to two\n var normal = centersVec.clone()\n normal.normalize();\n var rewindTime = Math.abs( (totRadius-totDistance) / totVelMag );\n\n // recompute for one\n var newVelOne = one.vel.clone();\n var scaledNormalOne = normal.clone();\n scaledNormalOne.setLength(-2.0 * newVelOne.dot(normal));\n newVelOne.addSelf(scaledNormalOne)\n var newPosOne = new THREE.Vector2(one.pos.x + rewindTime * (newVelOne.x - one.vel.x), one.pos.y + rewindTime * (newVelOne.y - one.vel.y));\n\n // recompute for two\n var newVelTwo = two.vel.clone();\n var scaledNormalTwo = normal.clone();\n scaledNormalTwo.setLength(-2.0 * newVelTwo.dot(normal));\n newVelTwo.addSelf(scaledNormalTwo)\n var newPosTwo = new THREE.Vector2(two.pos.x + rewindTime * (newVelTwo.x - two.vel.x), two.pos.y + rewindTime * (newVelTwo.y - two.vel.y));\n\n // set the new states\n one.pos = newPosOne;\n one.vel = newVelOne;\n two.pos = newPosTwo;\n two.vel = newVelTwo;\n\n // let the caller know the two objects collided\n return true;\n}", "title": "" }, { "docid": "19966e376a4bb220c79492fd962736a7", "score": "0.6208647", "text": "resolveAsteroidCollision(asteroid1, asteroid2) {\r\n // resolve position\r\n const positionDiff = asteroid1.position.minus(asteroid2.position);\r\n const positionDiffMag = positionDiff.magnitude();\r\n const positionDiffUnit = positionDiff.unit();\r\n const overlap = asteroid1.size + asteroid2.size - positionDiffMag;\r\n if (positionDiffMag === 0) return;\r\n asteroid2.position = asteroid2.position.minus(\r\n positionDiffUnit.scale(overlap)\r\n );\r\n\r\n // resolve velocities\r\n const velocityDiff = asteroid1.velocity.minus(asteroid2.velocity);\r\n const inertiaFactor1 =\r\n (2 * asteroid2.size) / (asteroid1.size + asteroid2.size);\r\n const inertiaFactor2 =\r\n (2 * asteroid1.size) / (asteroid1.size + asteroid2.size);\r\n const inertiaFactor3 =\r\n velocityDiff.dot(positionDiff) / positionDiffMag ** 2;\r\n\r\n const vf1 = asteroid1.velocity.minus(\r\n positionDiff.scale(inertiaFactor1 * inertiaFactor3)\r\n );\r\n const vf2 = asteroid2.velocity.minus(\r\n positionDiff.scale(-inertiaFactor2 * inertiaFactor3)\r\n );\r\n\r\n asteroid1.velocity = vf1;\r\n asteroid2.velocity = vf2;\r\n }", "title": "" }, { "docid": "259251301035aad73b5f5e93b99bb3e6", "score": "0.62077713", "text": "updateCollisions() {\n this.model.scene.forEach(\n /** @arg a {Celestial} */\n (a) =>\n this.model.scene.forEach(\n /** @arg b {Celestial} */\n (b) =>\n a !== b &&\n this.checkIntersection(a, b) &&\n a.collisions.push({\n time: +new Date(),\n who: b,\n })\n )\n );\n }", "title": "" }, { "docid": "8690d2da417a26ae66b1f716978c4d4f", "score": "0.6154249", "text": "function solveNodeCollisions(nodesView, nodesData)\n {\n var nodes = nodesData;\n\n var view = nodesView.closest('body');\n\n for (var i = 0; i < nodes.length; i++)\n {\n for (var j = 0; j < nodes.length; j++)\n {\n if (i != j && hasNodeCollision(nodes[i], nodes[j]))\n {\n nodes[i].position.top += nodeHeight;\n j = 0;\n }\n }\n }\n }", "title": "" }, { "docid": "1d388e5bcc9b24499fc3773fb1c8eca5", "score": "0.61008173", "text": "function resolveNodeLinkOverlaps(graph, y0, y1, id) {\n graph.links.forEach(function (link) {\n if (link.circular) {\n return;\n }\n\n if (link.target.column - link.source.column > 1) {\n var columnToTest = link.source.column + 1;\n var maxColumnToTest = link.target.column - 1;\n\n var i = 1;\n var numberOfColumnsToTest = maxColumnToTest - columnToTest + 1;\n\n for (i = 1; columnToTest <= maxColumnToTest; columnToTest++, i++) {\n graph.nodes.forEach(function (node) {\n if (node.column == columnToTest) {\n var t = i / (numberOfColumnsToTest + 1);\n\n // Find all the points of a cubic bezier curve in javascript\n // https://stackoverflow.com/questions/15397596/find-all-the-points-of-a-cubic-bezier-curve-in-javascript\n\n var B0_t = Math.pow(1 - t, 3);\n var B1_t = 3 * t * Math.pow(1 - t, 2);\n var B2_t = 3 * Math.pow(t, 2) * (1 - t);\n var B3_t = Math.pow(t, 3);\n\n var py_t = B0_t * link.y0 + B1_t * link.y0 + B2_t * link.y1 + B3_t * link.y1;\n\n var linkY0AtColumn = py_t - link.width / 2;\n var linkY1AtColumn = py_t + link.width / 2;\n var dy;\n\n // If top of link overlaps node, push node up\n if (linkY0AtColumn > node.y0 && linkY0AtColumn < node.y1) {\n dy = node.y1 - linkY0AtColumn + 10;\n dy = node.circularLinkType == 'bottom' ? dy : -dy;\n\n node = adjustNodeHeight(node, dy, y0, y1);\n\n // check if other nodes need to move up too\n graph.nodes.forEach(function (otherNode) {\n // don't need to check itself or nodes at different columns\n if (getNodeID(otherNode, id) == getNodeID(node, id) || otherNode.column != node.column) {\n return;\n }\n if (nodesOverlap(node, otherNode)) {\n adjustNodeHeight(otherNode, dy, y0, y1);\n }\n });\n } else if (linkY1AtColumn > node.y0 && linkY1AtColumn < node.y1) {\n // If bottom of link overlaps node, push node down\n dy = linkY1AtColumn - node.y0 + 10;\n\n node = adjustNodeHeight(node, dy, y0, y1);\n\n // check if other nodes need to move down too\n graph.nodes.forEach(function (otherNode) {\n // don't need to check itself or nodes at different columns\n if (getNodeID(otherNode, id) == getNodeID(node, id) || otherNode.column != node.column) {\n return;\n }\n if (otherNode.y0 < node.y1 && otherNode.y1 > node.y1) {\n adjustNodeHeight(otherNode, dy, y0, y1);\n }\n });\n } else if (linkY0AtColumn < node.y0 && linkY1AtColumn > node.y1) {\n // if link completely overlaps node\n dy = linkY1AtColumn - node.y0 + 10;\n\n node = adjustNodeHeight(node, dy, y0, y1);\n\n graph.nodes.forEach(function (otherNode) {\n // don't need to check itself or nodes at different columns\n if (getNodeID(otherNode, id) == getNodeID(node, id) || otherNode.column != node.column) {\n return;\n }\n if (otherNode.y0 < node.y1 && otherNode.y1 > node.y1) {\n adjustNodeHeight(otherNode, dy, y0, y1);\n }\n });\n }\n }\n });\n }\n }\n });\n}", "title": "" }, { "docid": "af0e884264104c081fe437816c2e10f1", "score": "0.5933471", "text": "function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n var node = nodes[i];\n var dy_3 = (y - node.y0) * alpha;\n if (dy_3 > 1e-6)\n (node.y0 += dy_3), (node.y1 += dy_3);\n y = node.y1 + py;\n }\n }", "title": "" }, { "docid": "8fbfdf533a255426130896d0aa46c02b", "score": "0.5889337", "text": "function hasNodeCollision(node1, node2)\n {\n if (node1.position.side != node2.position.side) return false;\n\n return Math.abs(node1.position.top - node2.position.top) < (nodeHeight);\n }", "title": "" }, { "docid": "889cd5585b7d633dd7cba20a0a0c5fc8", "score": "0.5883325", "text": "function resolveCollision(particle, otherParticle) {\n const xVelocityDiff = particle.velocity.x - otherParticle.velocity.x;\n const yVelocityDiff = particle.velocity.y - otherParticle.velocity.y;\n\n const xDist = otherParticle.x - particle.x;\n const yDist = otherParticle.y - particle.y;\n\n // Prevent accidental overlap of particles\n if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {\n\n // Grab angle between the two colliding particles\n const angle = -Math.atan2(otherParticle.y - particle.y, otherParticle.x - particle.x);\n\n // Store mass in var for better readability in collision equation\n const m1 = particle.mass;\n const m2 = otherParticle.mass;\n\n // Velocity before equation\n const u1 = rotate(particle.velocity, angle);\n const u2 = rotate(otherParticle.velocity, angle);\n\n // Velocity after 1d collision equation\n const v1 = { x: u1.x * (m1 - m2) / (m1 + m2) + u2.x * 2 * m2 / (m1 + m2), y: u1.y };\n const v2 = { x: u2.x * (m2 - m1) / (m1 + m2) + u1.x * 2 * m1 / (m1 + m2), y: u2.y };\n\n // Final velocity after rotating axis back to original location\n const vFinal1 = rotate(v1, -angle);\n const vFinal2 = rotate(v2, -angle);\n\n // Swap particle velocities for realistic bounce effect\n particle.velocity.x = vFinal1.x;\n particle.velocity.y = vFinal1.y;\n\n otherParticle.velocity.x = vFinal2.x;\n otherParticle.velocity.y = vFinal2.y;\n }\n}", "title": "" }, { "docid": "693c539511fac79879be21fec093b0ba", "score": "0.588176", "text": "function resolveCollision(particle, otherParticle) {\n const xVelocityDiff = particle.velocity.x - otherParticle.velocity.x;\n const yVelocityDiff = particle.velocity.y - otherParticle.velocity.y;\n\n const xDist = otherParticle.x - particle.x;\n const yDist = otherParticle.y - particle.y;\n\n // Prevent accidental overlap of particles\n if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {\n\n // Grab angle between the two colliding particles\n const angle = -Math.atan2(otherParticle.y - particle.y, otherParticle.x - particle.x);\n\n // Store mass in var for better readability in collision equation\n const m1 = particle.mass;\n const m2 = otherParticle.mass;\n\n // Velocity before equation\n const u1 = rotate(particle.velocity, angle);\n const u2 = rotate(otherParticle.velocity, angle);\n\n // Velocity after 1d collision equation\n const v1 = { x: u1.x * (m1 - m2) / (m1 + m2) + u2.x * 2 * m2 / (m1 + m2), y: u1.y };\n const v2 = { x: u2.x * (m1 - m2) / (m1 + m2) + u1.x * 2 * m2 / (m1 + m2), y: u2.y };\n\n // Final velocity after rotating axis back to original location\n const vFinal1 = rotate(v1, -angle);\n const vFinal2 = rotate(v2, -angle);\n\n // Swap particle velocities for realistic bounce effect\n particle.velocity.x = vFinal1.x;\n particle.velocity.y = vFinal1.y;\n\n otherParticle.velocity.x = vFinal2.x;\n otherParticle.velocity.y = vFinal2.y;\n }\n}", "title": "" }, { "docid": "7f8b871b5ddea64e4f4bc8bf11cdf7ca", "score": "0.5857041", "text": "resolveCollision(unit1, unit2)\n {\n //console.log(\"Collision between \" + unit1.type + \" and \" + unit2.type);\n\n //Both units are stopped on top of eachother so move one of them\n if(unit1.moving == false && unit2.moving == false)\n {\n let newSquare = this.findEmpty(unit1.x, unit1.y);\n let newCoords = this.getCoords(newSquare.x, newSquare.y);\n unit1.move(newCoords.x, newCoords.y);\n return;\n }\n\n //Unit1 is moving and unit 2 isn't, so if unit1 is finishing in unit2's square, stop it, otherwise, let it keep going.\n if(unit1.moving == true && unit2.moving == false)\n {\n if(unit1.nextSquare.x == unit1.dest.x && unit1.nextSquare.y == unit1.dest.y)\n {\n unit1.stop();\n return\n }\n return;\n }\n\n //Unit2 is moving and unit1 isn't, so if unit2 is finishing in unit1's square, stop it, otherwise, let it keep going.\n if(unit2.moving == true && unit1.moving == false)\n {\n if(unit2.nextSquare.x == unit2.dest.x && unit2.nextSquare.y == unit2.dest.y)\n {\n unit2.stop();\n return;\n }\n return;\n }\n\n\n //Both units are moving. If they are headed for the same square reroute one of them to an adjacent square\n if(unit2.moving == true && unit1.moving == true)\n {\n if(unit1.dest.x == unit2.dest.x && unit1.dest.y == unit2.dest.y)\n {\n let newDest = this.findEmpty(unit1.dest.x, unit1.dest.y);\n let newCoords = this.getCoords(newDest.x, newDest.y);\n unit1.move(newCoords.x, newCoords.y);\n }\n }\n\n }", "title": "" }, { "docid": "e4578ed8b5cf931846afc8f822ce6114", "score": "0.58552104", "text": "function collide(node) {\n const r = actorNodeR + actorPadding, nx1 = node.x - r, nx2 = node.x + r, ny1 = node.y - r, ny2 = node.y + r;\n return function (quad, x1, y1, x2, y2) {\n if (quad.data && (quad.data !== node)) {\n let x = node.x - quad.data.x;\n let y = node.y - quad.data.y;\n let l = Math.sqrt(x * x + y * y);\n const r = actorNodeR + actorNodeR + actorPadding;\n\n if (l < r) {\n l = (l - r) / l * .5;\n node.x -= x *= l;\n node.y -= y *= l;\n quad.data.x += x;\n quad.data.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n };\n}", "title": "" }, { "docid": "f589c41ddc16da7f13ad115b080c1d4d", "score": "0.58466643", "text": "function resolveCollision(particle, otherParticle) {\n const xVelocityDiff = particle.velocity.x - otherParticle.velocity.x;\n const yVelocityDiff = particle.velocity.y - otherParticle.velocity.y;\n\n const xDist = otherParticle.x - particle.x;\n const yDist = otherParticle.y - particle.y;\n\n // Prevent accidental overlap of particles\n if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {\n // Grab angle between the two colliding particles\n const angle = -Math.atan2(otherParticle.y - particle.y, otherParticle.x - particle.x);\n\n // Store mass in var for better readability in collision equation\n const m1 = particle.r;\n const m2 = otherParticle.r;\n\n // Velocity before equation\n const u1 = rotate(particle.velocity, angle);\n const u2 = rotate(otherParticle.velocity, angle);\n\n // Velocity after 1d collision equation\n const v1 = { x: u1.x * (m1 - m2) / (m1 + m2) + u2.x * 2 * m2 / (m1 + m2), y: u1.y };\n const v2 = { x: u2.x * (m1 - m2) / (m1 + m2) + u1.x * 2 * m2 / (m1 + m2), y: u2.y };\n\n // Final velocity after rotating axis back to original location\n const vFinal1 = rotate(v1, -angle);\n const vFinal2 = rotate(v2, -angle);\n\n // Swap particle velocities for realistic bounce effect\n particle.velocity.x = vFinal1.x;\n particle.velocity.y = vFinal1.y;\n\n otherParticle.velocity.x = vFinal2.x;\n otherParticle.velocity.y = vFinal2.y;\n }\n}", "title": "" }, { "docid": "68513a87b620dc2c904fffca9b8a883f", "score": "0.582469", "text": "function resolveCollision(particle, otherParticle) {\n\tconst xVelocityDiff = particle.velocity.x - otherParticle.velocity.x;\n\tconst yVelocityDiff = particle.velocity.y - otherParticle.velocity.y;\n\n\tconst xDist = otherParticle.x - particle.x;\n\tconst yDist = otherParticle.y - particle.y;\n\n\t// Prevent accidental overlap of particles\n\tif (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {\n\n\t\t// Grab angle between the two colliding particles\n\t\tconst angle = -Math.atan2(otherParticle.y - particle.y, otherParticle.x - particle.x);\n\n\t\t// Store mass in var for better readability in collision equation\n\t\tconst m1 = particle.mass;\n\t\tconst m2 = otherParticle.mass;\n\n\t\t// Velocity before equation\n\t\tconst u1 = rotate(particle.velocity, angle);\n\t\tconst u2 = rotate(otherParticle.velocity, angle);\n\n\t\t// Velocity after 1d collision equation\n\t\tconst v1 = { x: u1.x * (m1 - m2) / (m1 + m2) + u2.x * 2 * m2 / (m1 + m2), y: u1.y };\n\t\tconst v2 = { x: u2.x * (m1 - m2) / (m1 + m2) + u1.x * 2 * m2 / (m1 + m2), y: u2.y };\n\n\t\t// Final velocity after rotating axis back to original location\n\t\tconst vFinal1 = rotate(v1, -angle);\n\t\tconst vFinal2 = rotate(v2, -angle);\n\n\t\t// Swap particle velocities for realistic bounce effect\n\t\tparticle.velocity.x = vFinal1.x;\n\t\tparticle.velocity.y = vFinal1.y;\n\n\t\totherParticle.velocity.x = vFinal2.x;\n\t\totherParticle.velocity.y = vFinal2.y;\n\t}\n}", "title": "" }, { "docid": "fc75a6445989ffb706976a7a86987144", "score": "0.5816703", "text": "static collide(collider, collidee) {\n var nodes = [\n State.collisionDict.get(AgentController.EVERYONE.id).get(AgentController.EVERYONE.id),\n State.collisionDict.get(AgentController.EVERYONE.id).get(collidee.breed.id),\n State.collisionDict.get(collider.breed.id).get(AgentController.EVERYONE.id),\n State.collisionDict.get(collider.breed.id).get(collidee.breed.id),\n ];\n for (var i = 0; i < 4; i++) {\n var node = nodes[i];\n if (node !== undefined) {\n if (node.yields) {\n var collisionThread = Compiler.make_collision_thread(node, collider, collidee);\n var done = collisionThread.step();\n if (!done) {\n collider.jsthreads.push(collisionThread);\n }\n }\n else {\n collider.collidee = collidee;\n State.jsFunctions.get(node)(collider, new SingleFunctionThread());\n collider.collidee = undefined;\n }\n }\n }\n }", "title": "" }, { "docid": "cb5acf96a31f49e5a73a74e047f79311", "score": "0.5813916", "text": "resolve() {\r\n if (! this.detect()) {\r\n return\r\n }\r\n\r\n // compute collision impusle\r\n const e = Math.min(this.a.material.restitution, this.b.material.restitution);\r\n const j = ((1+e) * this.collisionSpeed) / (this.a.inv_mass + this.b.inv_mass);\r\n \r\n const impulse = this.manifold.unit.scale(j);\r\n\r\n // positional drift correction using Baumgarte Stabilization\r\n const b = 0.4; // positional correction percent\r\n const slop = 0.1; // maximum penetration\r\n let correction = this.manifold.scale(b / (this.a.inv_mass + this.b.inv_mass))\r\n correction = correction.scale(Math.max(this.manifold.magnitude - slop, 0))\r\n\r\n // only add impulses to dynamic bodies\r\n if (this.a instanceof DynamicBody) {\r\n this.a.addImpulse(impulse);\r\n // this.a.addCorrection(correction.scale(this.a.inv_mass));\r\n }\r\n if (this.b instanceof DynamicBody) {\r\n this.b.addImpulse(impulse.scale(-1));\r\n // this.b.addCorrection(correction.scale(-this.b.inv_mass));\r\n }\r\n\r\n // call collision handlers of both bodies\r\n this.a.collisionHandlers.forEach(f => f(this.b));\r\n this.b.collisionHandlers.forEach(f => f(this.a));\r\n }", "title": "" }, { "docid": "27571c26e347dc8f15ca118857349406", "score": "0.58086526", "text": "function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n var node = nodes[i];\n var dy_4 = (node.y1 - y) * alpha;\n if (dy_4 > 1e-6)\n (node.y0 -= dy_4), (node.y1 -= dy_4);\n y = node.y0 - py;\n }\n }", "title": "" }, { "docid": "adccdbf9ee4aa818832c749597a886f9", "score": "0.57790583", "text": "function resolveCollision(particle, otherParticle) {\r\n const xVelocityDiff = particle.velocity.x - otherParticle.velocity.x;\r\n const yVelocityDiff = particle.velocity.y - otherParticle.velocity.y;\r\n\r\n const xDist = otherParticle.x - particle.x;\r\n const yDist = otherParticle.y - particle.y;\r\n\r\n // Prevent accidental overlap of particles\r\n if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {\r\n // Grab angle between the two colliding particles\r\n const angle = -Math.atan2(\r\n otherParticle.y - particle.y,\r\n otherParticle.x - particle.x\r\n );\r\n\r\n // Store mass in var for better readability in collision equation\r\n const m1 = particle.mass;\r\n const m2 = otherParticle.mass;\r\n\r\n // Velocity before equation\r\n const u1 = rotate(particle.velocity, angle);\r\n const u2 = rotate(otherParticle.velocity, angle);\r\n\r\n // Velocity after 1d collision equation\r\n const v1 = {\r\n x: (u1.x * (m1 - m2)) / (m1 + m2) + (u2.x * 2 * m2) / (m1 + m2),\r\n y: u1.y\r\n };\r\n const v2 = {\r\n x: (u2.x * (m1 - m2)) / (m1 + m2) + (u1.x * 2 * m2) / (m1 + m2),\r\n y: u2.y\r\n };\r\n\r\n // Final velocity after rotating axis back to original location\r\n const vFinal1 = rotate(v1, -angle);\r\n const vFinal2 = rotate(v2, -angle);\r\n\r\n // Swap particle velocities for realistic bounce effect\r\n particle.velocity.x = vFinal1.x * particle.slower;\r\n particle.velocity.y = vFinal1.y * particle.slower;\r\n\r\n otherParticle.velocity.x = vFinal2.x * particle.slower;\r\n otherParticle.velocity.y = vFinal2.y * particle.slower;\r\n }\r\n}", "title": "" }, { "docid": "dc356b0de9bf4b0fa8646cddc9519508", "score": "0.5765746", "text": "detectCollision() {\n for (let i = 1; i < this.track.nodes.length; i++) {\n let node0 = this.track.nodes[i-1];\n let node1 = this.track.nodes[i];\n \n // Check for intersection of car rect with two track edges.\n if (lineRectIntersect(\n node0.leftX, node0.leftY, node1.leftX, node1.leftY,\n this.width, this.length, this.x, this.y, this.angle) ||\n lineRectIntersect(\n node0.rightX, node0.rightY, node1.rightX, node1.rightY,\n this.width, this.length, this.x, this.y, this.angle)) {\n this.collided = true;\n return;\n }\n }\n\n this.collided = false;\n }", "title": "" }, { "docid": "e483b4e52317f9746af6b7f4c8cd81fe", "score": "0.57149863", "text": "function resolveCollision(tile_value, row, column) {\n switch (tile_value) {//distributing collision according to tile - type\n case 1://right - wall tiles\n resolveLeftCollision(row, column);\n break;\n case 2://bricks\n if (resolveTopCollision(row, column)) return;\n if (resolveBottomCollision(row, column)) return;\n if (resolveLeftCollision(row, column)) return;\n if (resolveRightCollision(row, column))\n break;\n }\n\n}", "title": "" }, { "docid": "5fc4f2433a000326c4ceb1c0d62d31de", "score": "0.56985074", "text": "addOneWayObjectCollision ( id1, id2 ){\n let target_collision_span = this.object_tracker[id1]['spans']\n \n // See if key exists, if not, 1 collision\n if (! (id2 in target_collision_span) )\n target_collision_span[ id2 ] = 1\n\n // Key allready exists? add another collision\n else\n target_collision_span[ id2 ] += 1\n }", "title": "" }, { "docid": "82557f9c345b60e9dd1a52595ca68d36", "score": "0.5683942", "text": "function collide(r1, r2, s1, s2) {\r\n if (r1 > s1 && r1 < s2) {\r\n return(s2 - r1);\r\n } else if (r2 > s1 && r2 < s2) {\r\n return(s1 - r2);\r\n }\r\n return(0);\r\n}", "title": "" }, { "docid": "4daa707167ed646e7301a7d8d61d7fb9", "score": "0.5639954", "text": "detect_Collision(distances) {\n var obj = null;\n var counter = 0;\n\n const collide = distances.some((dist) => {\n if (dist[0] < dist[2] && dist[1] < dist[3]) {\n obj = counter;\n }\n counter += 1;\n return dist[0] < dist[2] && dist[1] < dist[3]\n });\n\n if (collide) {\n\n // Find object we collided with and set to true\n if (obj in this.object_index) {\n if (!this.object_found[this.object_index[obj]]) {\n const objectName = this.object_index[obj];\n console.log(objectName);\n this.object_found[objectName] = true;\n }\n }\n\n if (defs.left) {\n defs.thrust[0] = -0.3;\n } else if (defs.right) {\n defs.thrust[0] = 0.3;\n }\n\n if (defs.forward) {\n defs.thrust[2] = -0.3;\n } else if (defs.backward) {\n defs.thrust[2] = 0.3;\n }\n this.short_bounce = true;\n }\n\n else if (this.short_bounce) {\n defs.thrust[0] = 0;\n defs.thrust[2] = 0;\n this.short_bounce = false;\n }\n }", "title": "" }, { "docid": "6baebce8837dd39458ac950463f50b80", "score": "0.56371653", "text": "function checkCollision() {\n for(var i=0; i<nParticles; i++) {\n for(var j=0; j<nParticles; i++) {\n if(i!=j) {\n var distance = p5.Vector.dist(\n particles[i].position,\n particles[j].position\n );\n if(distance < particleSize) {\n if(particles[i].counter == 0) {\n particles[i].direction.rotate(Math.random());\n particles[i].counter = maxCounter;\n }\n \n if(particles[j].counter == 0) {\n particles[j].direction.rotate(Math.random());\n particles[j].counter = maxCounter;\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "687085344a9580fbeab907fa6f53e3b2", "score": "0.56344706", "text": "function checkCollision(){\n\n return;\n\n mapObjects.forEach(function(i){\n\n if (recCollide(hero, i) && (i.type != 'bucket')){\n self.y = i.y;\n // } else if (recCollide(hero, i) && ( (i.y + y.height) >= ( hero.y-hero.height) )){\n // // trying to detect ceiling\n\n // console.log('tagged');\n\n } else if (recCollide(hero, i) && (i.type == 'bucket')){\n winGame();\n }\n });\n }", "title": "" }, { "docid": "9b7727bd645b66f374783bdc15d22fe6", "score": "0.56326264", "text": "function doCollisions()\n{\n\tfor (var i = 0; i < Entities.length; i++)\n\t{\n\t\t//Mildly ugly fix due to collision issues. Bug #2\n\t\t//I'll fix this one day, I swear. -11/20/16\n\t\tif (Entities[i].EntityTag == \"EnemyGrunt\")\n\t\t\tEntities[i].YVel = GravityForce;\n\t\telse if (Entities[i].EntityTag == \"EnemyBrute\")\n\t\t\tEntities[i].YVel = GravityForce;\n\t\tfor (var i2 = 0; i2 < Entities.length; i2++)\n\t\t{\n\t\t\t\n\t\t\tif (Entities[i].XLoc < Entities[i2].XLoc + Entities[i2].EntityWidth && Entities[i].XLoc + Entities[i].EntityWidth > Entities[i2].XLoc && Entities[i].YLoc < Entities[i2].YLoc + Entities[i2].EntityHeight && Entities[i].YLoc + Entities[i].EntityHeight > Entities[i2].YLoc)\n\t\t\t{\n\t\t\t\tif (Entities[i].EntityTag == \"Player\")\n\t\t\t\t{\n\t\t\t\t\tif (Entities[i2].EntityTag == \"BlockBar\")\n\t\t\t\t\t{\n\t\t\t\t\t\tclearInterval(Entities[findPlayer()].jumpTimer);\n\t\t\t\t\t\t\tEntities[i].jumpFrame = 0;\n\t\t\t\t\t\tif (Entities[i].YLoc > Entities[i2].YLoc)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tEntities[i].YLoc = Entities[i2].YLoc - Entities[i].EntityHeight;\n\t\t\t\t\t\t\tEntities[i].YVel = Entities[i2].YVel;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (Entities[i].jumpFrame == 0 && SubGameMode != 4){\n\t\t\t\t\t\tEntities[i].YVel = GravityForce; //Quick fix. TODO: Find permanent solution later.\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (Entities[i2].EntityTag == \"EnemyGrunt\") {\n\t\t\t\t\t\tEntities[i].EntityHealth -= Entities[i2].EntityDamage;\n\t\t\t\t\t\tEntities.splice(i2, 1);\n\t\t\t\t\t}\n\t\t\t\t} else if (Entities[i].EntityTag == \"EnemyGrunt\") {\n\t\t\t\t\tif (Entities[i2].EntityTag == \"BlockBar\")\n\t\t\t\t\t{\n\t\t\t\t\t\tEntities[i].YLoc = Entities[i2].getYLoc() - Entities[i].EntityHeight;\n\t\t\t\t\t\tEntities[i].YVel = Entities[i2].YVel;\n\t\t\t\t\t}\n\t\t\t\t} else if (Entities[i].EntityTag == \"PlayerBullet\") {\n\t\t\t\t\tif (Entities[i2].EntityTag == \"EnemyGrunt\")\n\t\t\t\t\t{\n\t\t\t\t\t\tEntities[i2].EntityHealth -= 1;\n\t\t\t\t\t\tEntities[i].XLoc = 1000;\n\t\t\t\t\t} else if (Entities[i2].EntityTag == \"EnemyBrute\") {\n\t\t\t\t\t\tEntities[i2].EntityHealth -= 1;\n\t\t\t\t\t\tEntities[i].XLoc = 1000;\n\t\t\t\t\t}\n\t\t\t\t} else if (Entities[i].EntityTag == \"EnemyBrute\") {\n\t\t\t\t\tif (Entities[i2].EntityTag == \"BlockBar\")\n\t\t\t\t\t{\n\t\t\t\t\t\tEntities[i].YVel = Entities[i2].YVel;\n\t\t\t\t\t\tEntities[i].YLoc = Entities[i2].YLoc - Entities[i].EntityHeight;\n\t\t\t\t\t} else if (Entities[i2].EntityTag == \"Player\") {\n\t\t\t\t\t\tEntities[i2].XVel = Entities[i].XVel * 1.2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "64d07d6f28ae72af2d71a4ef5d70e795", "score": "0.5605187", "text": "detectCollision() {}", "title": "" }, { "docid": "6c8fe1dfbca56d1b5b61e9593c66a36c", "score": "0.5603036", "text": "function collide(alpha) {\nvar quadtree = d3.geom.quadtree(nodes);\nreturn function (d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function (quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n};\n}", "title": "" }, { "docid": "605b8cb9e9b9aadaded8e316dd65e528", "score": "0.56021065", "text": "function resolveClusters() {\n // Check for clusters\n findClusters();\n\n // While there are clusters left\n while (clusters.length > 0) {\n\n // Remove clusters\n removeClusters();\n\n // Shift tiles\n shiftTiles();\n\n // Check if there are clusters left\n findClusters();\n }\n }", "title": "" }, { "docid": "9c83f95fa62f9cef8047e23d6080b97c", "score": "0.5582105", "text": "update(){\n for (let i=0; i<this.colliders.length-1; i++){\n let colliderA = this.colliders[i];\n \n for (let j=i+1; j<this.colliders.length; j++)\n {\n let colliderB = this.colliders[j];\n if (colliderA.collidingWith(colliderB)){\n\n if (!this.collMap.has(colliderA) || !this.collMap.get(colliderA).includes(colliderB))\n {\n colliderA.gameObject.onCollisionBegin(colliderB);\n colliderB.gameObject.onCollisionBegin(colliderA);\n if (this.collMap.has(colliderA))\n this.collMap.get(colliderA).push(colliderB);\n else\n this.collMap.set(colliderA, [colliderB]); \n }\n colliderA.gameObject.onCollision(colliderB);\n colliderB.gameObject.onCollision(colliderA);\n }\n \n else{\n if (this.collMap.has(colliderA) && this.collMap.get(colliderA).includes(colliderB))\n {\n colliderA.gameObject.onCollisionEnd(colliderB);\n colliderB.gameObject.onCollisionEnd(colliderA);\n let collisions = this.collMap.get(colliderA);\n collisions.splice(collisions.indexOf(colliderB), 1); \n }\n }\n }\n }\n }", "title": "" }, { "docid": "2ff4e7108f5cbca4be0d63693f92b5eb", "score": "0.5578032", "text": "function checkCollisions() {\n allEnemies.forEach(function (enemy) {\n if (Math.abs(player.x - enemy.x) <= 40 && Math.abs(player.y - enemy.y) <= 40) {\n player.life -= 1;\n player.reset();\n }\n });\n gem.gemCollision();\n}", "title": "" }, { "docid": "104e3fde93800836fc175261aece5e9e", "score": "0.5576552", "text": "function checkCollisions() {\n // Check collision between player and enemy\n allEnemies.forEach(function(enemy) {\n // Condition checks whether player's most left of right pixel is\n // between enemy's most left and right pixel and\n // it checks the vertical position, on which if player and enemy\n // object are at the same row they would differ 12px vertically\n if ((player.x + 17 > enemy.x && player.x + 17 < enemy.x + 100 || player.x + 84 > enemy.x && player.x + 84 < enemy.x + 100) && player.y === enemy.y - 12) {\n data.lives -= 1;\n player.x = 202;\n player.y = 382;\n }\n });\n\n // Check collision between player and gem\n allGems.forEach(function(gem) {\n if (player.x === gem.x && player.y === gem.y - 3) {\n // Dissapear gem and add points to score\n gem.x = undefined;\n gem.y = undefined;\n data.score += gem.points;\n // Show gem after certain amount of random time and depends on gem's points\n setTimeout(function() {\n gem.update();\n }, Math.round(Math.random() * gem.points) * 1000 + 1000);\n }\n });\n\n // Check collision between player and life\n if (player.x === life.x && player.y === life.y - 26) {\n // Dissapear life and add lives by 1\n life.x = undefined;\n life.y = undefined;\n data.lives += 1;\n // Show life after certain amount of random time\n setTimeout(function() {\n life.update();\n }, Math.round(Math.random() * 50) * 1000);\n }\n}", "title": "" }, { "docid": "7d8c371f653eaf652867806f3d5c59af", "score": "0.5573148", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n\t var r = d.radius + node_radius + Math.max(padding, cluster_padding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.choice === quad.point.choice ? padding : cluster_padding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n}", "title": "" }, { "docid": "a05c87631e3bcff1a268275c481588c1", "score": "0.5570279", "text": "calRepulsive(displacements, vecMap) {\n const self = this;\n const nodes = self.nodes;\n const max = self.width * self.optimizeRangeFactor;\n const nodeStrength = self.nodeStrength;\n const alpha = self.alpha;\n const nodeCollideStrength = self.nodeCollideStrength;\n const preventNodeOverlap = self.preventNodeOverlap;\n const nodeSizeFunc = self.nodeSize;\n const nodeSpacingFunc = self.nodeSpacing;\n const scale = self.depthRepulsiveForceScale;\n const center = self.center;\n nodes.forEach((v, i) => {\n if (!v.x || !v.y)\n return;\n // center gravity\n if (center) {\n const gravity = self.gravity;\n const vecX = v.x - center[0] || 0.005;\n const vecY = v.y - center[1] || 0.005;\n const l = Math.sqrt(vecX * vecX + vecY * vecY);\n displacements[i].x -= (vecX * gravity * alpha) / l;\n displacements[i].y -= (vecY * gravity * alpha) / l;\n }\n nodes.forEach((u, j) => {\n if (i === j) {\n return;\n }\n if (!u.x || !u.y)\n return;\n const { vl2, vl } = vecMap[`${v.id}-${u.id}`];\n if (vl > max)\n return;\n const { vx, vy } = vecMap[`${v.id}-${u.id}`];\n let depthDiff = (Math.log(Math.abs(u.depth - v.depth) / 10) + 1 || 1);\n depthDiff = depthDiff < 1 ? 1 : depthDiff;\n if (u.comboId !== v.comboId)\n depthDiff += 1;\n const depthParam = depthDiff ? Math.pow(scale, depthDiff) : 1;\n const params = ((nodeStrength(u) * alpha) / vl2) * depthParam;\n displacements[i].x += vx * params;\n displacements[i].y += vy * params;\n // prevent node overlappings\n if (i < j && preventNodeOverlap) {\n const ri = nodeSizeFunc(v) + nodeSpacingFunc(v);\n const rj = nodeSizeFunc(u) + nodeSpacingFunc(u);\n const r = ri + rj;\n if (vl2 < r * r) {\n const ll = ((r - vl) / vl) * nodeCollideStrength;\n const rj2 = rj * rj;\n let rratio = rj2 / (ri * ri + rj2);\n const xl = vx * ll;\n const yl = vy * ll;\n displacements[i].x += xl * rratio;\n displacements[i].y += yl * rratio;\n rratio = 1 - rratio;\n displacements[j].x -= xl * rratio;\n displacements[j].y -= yl * rratio;\n }\n }\n });\n });\n }", "title": "" }, { "docid": "62419e120b75e7beb0b727edacb2f7b9", "score": "0.5544993", "text": "function _detectCollision () {\n // if(!collisionDetectionOn || _collisionPairs.length <= 0) {\n // return;\n // }\n\n var pair;\n for (var i in _collisionPairs) {\n pair = _collisionPairs[i];\n \n for(var j in pair.group1) {\n for (var k in pair.group2) {\n if(isColliding(pair.group1[j], pair.group2[k])) {\n if(pair.group1[j].onCollision !== undefined) {\n pair.group1[j].onCollision(pair.group2[k]);\n }\n\n if(pair.group2[k].onCollision !== undefined) {\n pair.group2[k].onCollision(pair.group1[j]);\n }\n }\n }\n }\n }\n\n //setTimeout(_detectCollision, 1000/60);\n }", "title": "" }, { "docid": "358194ce1cc97f6189c2f3976f4172c6", "score": "0.5544698", "text": "function ObjectsCollided(object1, object2)\n{\n // Currently unused\n if(object1.HitboxType == \"Rect\" && object2.HitboxType == \"Rect\")\n {\n object1_moved = GetMovedHitbox(object1, object1.TransX, object1.TransY, object1.Rotation);\n object2_moved = GetMovedHitbox(object2, object2.TransX, object2.TransY, object2.Rotation);\n\n upperleft1 = object1_moved[0];\n bottomright1 = object1_moved[1];\n upperleft2 =object2_moved[0];\n bottomright2 = object2_moved[1];\n\n return (upperleft1[0] < bottomright2[0] &&\n bottomright1[0] > upperleft2[0] &&\n bottomright1[1] < upperleft2[1] &&\n upperleft1[1] > bottomright2[1]);\n }\n // Detecting collision between player and spike\n else if(object1.HitboxType == \"Rect\", object2.HitboxType == \"Triangle\")\n {\n // Rotating to a up-down orientation for simplicity\n object1_moved = GetMovedHitbox(object1, object1.TransX, object1.TransY, object1.Rotation);\n object2_moved = GetMovedHitbox(object2, object2.TransX, object2.TransY, object2.Rotation);\n\n upperleft = object1_moved[0];\n bottomright = object1_moved[1];\n upperright = vec2(bottomright[0], upperleft[1]);\n bottomleft = vec2(upperleft[0], bottomright[1]);\n\n for(var i=0; i < object2_moved.length; ++i)\n {\n var obj_start = object2_moved[i];\n var j;\n if((i+1) >= object2_moved.length)\n j = 0;\n else\n j = i+1;\n\n var obj_end = object2_moved[j];\n\n var intersection = (\n Intersects(obj_start, obj_end, bottomleft, bottomright) ||\n Intersects(obj_start, obj_end, bottomright, upperright) ||\n Intersects(obj_start, obj_end, upperleft, upperright) ||\n Intersects(obj_start, obj_end, upperleft, bottomleft)\n );\n\n if(intersection)\n {\n return true;\n }\n }\n return false;\n }\n}", "title": "" }, { "docid": "e915919bf1d3f1daeea25864e719f962", "score": "0.5529843", "text": "checkCollisions() {\n this._colliders.forEach(function (collider) {\n //check against each collider in the scene\n this._colliders.forEach(function (otherCollider) {\n //however, no need to check again if the collider has been checked already in an outer loop iteration\n if (otherCollider.checkedThisFrame) {\n return;\n }\n collider.checkOverLap(otherCollider);\n }.bind(this));\n collider.checkedThisFrame = true;\n }.bind(this));\n //reset flags\n this._colliders.forEach(collider => { collider.checkedThisFrame = false; });\n this._colliders = this._colliders.filter(function (value) { return value._owner.collided == false && value._owner.outOfBounds == false; });\n }", "title": "" }, { "docid": "5e7b8773ffefa27c38a9c66be22af743", "score": "0.5529754", "text": "function detectCollision(bodyA, bodyB) {\n\n // if (bodyA.shape == \"Circle\") {\n // debugger;\n // }\n\n // note: KEEP CIRCLES PROPORTIONALLY SCALED, ovals don't work for collisions\n if (bodyA.shape == \"Circle\" && bodyB.shape == \"Circle\") {\n var circleA = bodyA,\n circleB = bodyB;\n var direction = vectorSubtract(circleB.center, circleA.center);\n\n // if no overlap, return false\n if (magnitude(direction) > circleA.radius + circleB.radius) {\n return false;\n }\n\n var axis = normalize(direction);\n var overlap = circleA.radius + circleB.radius - magnitude(direction);\n\n return multiplyVectorByScalar(axis, overlap);\n\n }\n\n else {\n\n // axes are unit-length normals of the rectangle's sides (2 unique axes)\n // debugger;\n var axes = [];\n axes = axes.concat(bodyA.getAxes());\n axes = axes.concat(bodyB.getAxes());\n // var axes = [axesA[0], axesA[1], axesB[0], axesB[1]];\n\n // the magnitide and direction (axis) of smallest overlap\n var overlapMagnitude = 99999999;\n var overlapAxis;\n var overlapSign;\n\n for (var i = 0; i < axes.length; i++) {\n\n // min/max values of each shape projected onto axes[i]\n var aMaxProj,\n aMinProj,\n bMaxProj,\n bMinProj;\n\n var aProjections = bodyA.getMinMaxProjectionsOntoAxis(axes[i]);\n aMinProj = aProjections[0];\n aMaxProj = aProjections[1];\n\n var bProjections = bodyB.getMinMaxProjectionsOntoAxis(axes[i]);\n bMinProj = bProjections[0];\n bMaxProj = bProjections[1];\n\n // check for no collision\n if (aMaxProj < bMinProj || bMaxProj < aMinProj) {\n return false;\n }\n else {\n // console.log(\"axes[\" + i + \"]: (\" + axes[i].x + \", \" + axes[i].y + \")\");\n // if (i == 3) debugger; \n var currentOverlapMagnitude;\n var currentOverlapSign;\n\n if (aMaxProj >= bMinProj && bMaxProj >= aMinProj) {\n var aMaxBMin = Math.abs(bMinProj - aMaxProj);\n var bMaxAMin = Math.abs(aMinProj - bMaxProj);\n if (aMaxBMin < bMaxAMin) {\n currentOverlapMagnitude = aMaxBMin;\n currentOverlapSign = (bMinProj - aMaxProj < 0) ? -1 : 1;\n }\n else {\n currentOverlapMagnitude = bMaxAMin;\n currentOverlapSign = (aMinProj - bMaxProj < 0) ? -1 : 1;\n }\n }\n else if (aMaxProj >= bMinProj) {\n currentOverlapMagnitude = Math.abs(bMinProj - aMaxProj);\n currentOverlapSign = (bMinProj - aMaxProj < 0) ? -1 : 1;\n }\n else {\n currentOverlapMagnitude = Math.abs(aMinProj - bMaxProj);\n currentOverlapSign = (aMinProj - bMaxProj < 0) ? -1 : 1;\n }\n\n // debugger;\n if (currentOverlapMagnitude < overlapMagnitude) {\n overlapAxis = i;\n overlapMagnitude = currentOverlapMagnitude;\n // overlapSign = currentOverlapSign;\n }\n // console.log(\"Current overlap Magnitude: \" + currentOverlapMagnitude);\n }\n\n }\n // debugger;\n var overlapVector = multiplyVectorByScalar(axes[overlapAxis], overlapMagnitude);\n overlapSign = (dotProduct(overlapVector, axes[overlapAxis]) < 0) ? -1 : 1;\n\n var resolution = multiplyVectorByScalar(overlapVector, overlapSign);\n return resolution;\n }\n}", "title": "" }, { "docid": "a324710b699b81f62e69726d6f4dc1e5", "score": "0.55246687", "text": "function collisions() {\n collisonBords(ballon);\n\n equipes.forEach((eq) => {\n eq.joueurs.forEach((e) => {\n // Touche le cote droit\n collisonBords(e);\n });\n });\n\n let collision = false;\n\n // Pour toutes les equipes\n equipes.forEach((e) => {\n // Pour chaque joueur de chaque équipe\n e.joueurs.forEach((j) => {\n if (__WEBPACK_IMPORTED_MODULE_5__managers_GestionnaireCollision__[\"a\" /* default */].cercleCercle(j, ballon, j.rayon(), ballon.rayon())) {\n gererCollision(j, ballon);\n collision = true;\n }\n\n // Pour chaque équipe\n equipes.forEach((e2) => {\n // Chaque joueur de chaque équipe\n e2.joueurs.forEach((j2) => {\n if (j.x === j2.x && j.y === j2.y) {\n return;\n }\n\n if (__WEBPACK_IMPORTED_MODULE_5__managers_GestionnaireCollision__[\"a\" /* default */].cercleCercle(j, j2, j.rayon(), j2.rayon())) {\n collision = true;\n gererCollision(j, j2);\n }\n });\n });\n });\n });\n\n if (collision) {\n soundsManager.collisionJoueurs();\n }\n\n if (__WEBPACK_IMPORTED_MODULE_5__managers_GestionnaireCollision__[\"a\" /* default */].pointDansRectangle(map.cageGauche, ballon.centre())) {\n score.DROITE += 1;\n reset();\n soundsManager.but();\n } else if (__WEBPACK_IMPORTED_MODULE_5__managers_GestionnaireCollision__[\"a\" /* default */].pointDansRectangle(map.cageDroite, ballon.centre())) {\n score.GAUCHE += 1;\n reset();\n soundsManager.but();\n }\n }", "title": "" }, { "docid": "ea01cf7f14630e35970ccd8e98f24341", "score": "0.5506932", "text": "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "title": "" }, { "docid": "046d47ae596c8ea9ca0849d7304aef7d", "score": "0.5503656", "text": "function checkCollision ( particleA, particleB ) \n\t\t{\n\t var dx = particleB.x - particleA.x,\n\t dy = particleB.y - particleA.y,\n\t dist = Math.sqrt(dx * dx + dy * dy);\n\t //collision handling code here\n\t if (dist < particleA.radius + particleB.radius) {\n\t //calculate angle, sine, and cosine\n\t var angle = Math.atan2(dy, dx),\n\t sin = Math.sin(angle),\n\t cos = Math.cos(angle),\n\t //rotate particleA's position\n\t pos0 = {x: 0, y: 0}, //point\n\t //rotate particleB's position\n\t pos1 = rotate(dx, dy, sin, cos, true),\n\t //rotate particleA's velocity\n\t vel0 = rotate(particleA.vx, particleA.vy, sin, cos, true),\n\t //rotate particleB's velocity\n\t vel1 = rotate(particleB.vx, particleB.vy, sin, cos, true),\n\t //collision reaction\n\t vxTotal = vel0.x - vel1.x;\n\t vel0.x = ((particleA.mass - particleB.mass) * vel0.x + 2 * particleB.mass * vel1.x) /\n\t (particleA.mass + particleB.mass);\n\t vel1.x = vxTotal + vel0.x;\n\t //update position - to avoid objects becoming stuck together\n\t var absV = Math.abs(vel0.x) + Math.abs(vel1.x),\n\t overlap = (particleA.radius + particleB.radius) - Math.abs(pos0.x - pos1.x);\n\t pos0.x += vel0.x / absV * overlap;\n\t pos1.x += vel1.x / absV * overlap;\n\t //rotate positions back\n\t var pos0F = rotate(pos0.x, pos0.y, sin, cos, false),\n\t pos1F = rotate(pos1.x, pos1.y, sin, cos, false);\n\t //adjust positions to actual screen positions\n\t particleB.x = particleA.x + pos1F.x;\n\t particleB.y = particleA.y + pos1F.y;\n\t particleA.x = particleA.x + pos0F.x;\n\t particleA.y = particleA.y + pos0F.y;\n\t //rotate velocities back\n\t var vel0F = rotate(vel0.x, vel0.y, sin, cos, false),\n\t vel1F = rotate(vel1.x, vel1.y, sin, cos, false);\n\t particleA.vx = vel0F.x;\n\t particleA.vy = vel0F.y;\n\t particleB.vx = vel1F.x;\n\t particleB.vy = vel1F.y;\n\t }\n }", "title": "" }, { "docid": "7dd4c1f4becd3d0dc8dbd4bf9da4c860", "score": "0.5493938", "text": "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "title": "" }, { "docid": "1ae2bd05f092fb04d298b33fa193c677", "score": "0.5488022", "text": "function detectParticleCollision(particle1, particle2) {\r\n\tvar col = {};\r\n\tcol.collided = false;\r\n\tcol.plane = {x: false, y: false};\r\n\t// x collision\r\n\tif (particle1.position.x - particle1.size/2 <= particle2.position.x + particle2.size/2 && particle1.position.x + particle1.size/2 >= particle2.position.x - particle2.size/2 && particle1.position.y - particle1.size/2 <= particle2.position.y + particle2.size/2 && particle1.position.y + particle1.size/2 >= particle2.position.y - particle2.size/2) {\r\n\t\t// collision\r\n\t\tcol.collided = true;\r\n\t}\r\n\t//if (particle1.position.y - particle1.size/2 <= particle2.position.y + particle2.size/2 && particle1.position.y + particle1.size/2 >= particle2.position.y - particle2.size/2) {\r\n\t\t// y collision\r\n\t\t//col.y = true;\r\n\t// }\r\n\t// compare center positions to get the plane of colision\r\n\tif (Math.abs(particle1.position.x - particle2.position.x) > Math.abs(particle1.position.y - particle2.position.y)) {\r\n\t\tcol.plane.x = true;\r\n\t}\r\n\telse {\r\n\t\tcol.plane.y = true;\r\n\t}\r\n\treturn col;\r\n}", "title": "" }, { "docid": "d88c85f99955628de65103d5d190a3ae", "score": "0.5485499", "text": "handleCollision(otherEntity) { }", "title": "" }, { "docid": "73e2ed32f62cefba9af927983b6c1e0f", "score": "0.5484623", "text": "handleCollision() {\n }", "title": "" }, { "docid": "ffc41f0bfcd90590016258b76b489a3f", "score": "0.5483464", "text": "detectCollision() {\n this.hit = collideRectCircle(box.posX, box.posY, box.width, box.width, this.x, this.y, 64, 64);\n }", "title": "" }, { "docid": "b9be0e231ea73ab2230ee3020e65036b", "score": "0.5482022", "text": "checkForCollision(gameObjectOneKey, gameObjectTwoKey, velocity) {\n let gameObjectOne = this.objects[gameObjectOneKey];\n let gameObjectTwo = this.objects[gameObjectTwoKey];\n\n if (!(gameObjectOne && gameObjectTwo)) {\n console.log(`[checkForCollision] Warning: Game object with key of either '${gameObjectOneKey}' or '${gameObjectTwoKey} does not exist.'`);\n return;\n }\n\n let bbOne = gameObjectOne.boundingBox(); // must be a scalar\n\n if (bbOne.constructor !== BoundingBox) {\n console.log(\"[checkForCollision] Warning: bbOne must be an instance of BoundingBox.\");\n return;\n }\n\n // Take current velocity into account when checking for collisions.\n bbOne.offsetBy(velocity);\n\n let bbTwo = gameObjectTwo.boundingBox(); // can be an array of BoundingBox\n\n let bbTwoArr;\n if (bbTwo.constructor === Array) {\n bbTwoArr = bbTwo;\n } else {\n bbTwoArr = [bbTwo];\n }\n\n for (let bbTwoIndex = 0; bbTwoIndex < bbTwoArr.length; bbTwoIndex++) {\n let bbTwo = bbTwoArr[bbTwoIndex];\n\n // Check if BoundingBox is invalid so we don't get a false positive.\n if (isNaN(bbTwo.x) || isNaN(bbTwo.y) || isNaN(bbTwo.width) || isNaN(bbTwo.height)) {\n continue;\n }\n\n if (this.checkBoundingBoxCollision(bbOne, bbTwo)) {\n //ctx.fillStyle = 'green';\n //ctx.fillRect(bbTwo.x, bbTwo.y, bbTwo.width, bbTwo.height);\n\n //ctx.fillStyle = 'purple';\n //ctx.fillRect(bbOne.x, bbOne.y, bbOne.width, bbOne.height);\n\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "a3426787dc12b22c9d1e7001f0dc3305", "score": "0.5479352", "text": "function collide(alpha) { // don't apply to the target\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + padding + maxRadius, // some had maxRadius in there also\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + padding;\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "dcf08ad4688a68fa81ab2b10f24d13b9", "score": "0.5465335", "text": "checkCollisions(){\n\t\t/* var ths \n\t\t\trequired for reference within the scope of\n\t\t\tplanets.forEach, since 'this' keyword is not valid in\n\t\t\tthe local scope\n\t\t*/\n\t\tvar ths = this;\n\t\tplanets.forEach(function(pl){\n\t\t\tif(ths.isCollidingWithPlanet(pl))\n\t\t\t\tths.planetCollide(pl);\n\t\t})\n\t}", "title": "" }, { "docid": "9b051f0c4f2a3373271e0d75fefc8c82", "score": "0.5452727", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(graph.nodes);\n return function(d) {\n var r = d.size/180 + 30 + Math.max(padding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.size/180 + quad.point.size/180 + padding;\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "dcc099cc58bfaaea169a4da549cee7c8", "score": "0.545051", "text": "collisionAtoms() {\n for (let j = 0; j < this.game.atoms.length; j++) {\n const dx = this.pos[0] - this.game.atoms[j].pos[0];\n const dy = this.pos[1] - this.game.atoms[j].pos[1];\n const distance = Math.sqrt(dx * dx + dy * dy);\n\n if (distance < this.radius + this.game.atoms[j].radius) {\n if (this.game.atoms[j] instanceof Lithium && this.element === \"Fluorine\") {\n this.game.updateCompound(this.game.atoms[j]);\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n break;\n } else if (this.game.atoms[j] instanceof Beryllium && this.element === \"Oxygen\"){\n this.game.updateCompound(this.game.atoms[j]);\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n break;\n } else if (this.game.atoms[j] instanceof Boron && this.element === \"Nitrogen\") {\n this.game.updateCompound(this.game.atoms[j]);\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n break;\n } else if (this.game.atoms[j] instanceof Nitrogen && this.element === \"Boron\") {\n this.game.updateCompound(this.game.atoms[j]);\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n break;\n } else if (this.game.atoms[j] instanceof Oxygen && this.element === \"Beryllium\") {\n this.game.updateCompound(this.game.atoms[j]);\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n break;\n } else if (this.game.atoms[j] instanceof Fluorine && this.element === \"Lithium\") {\n this.game.updateCompound(this.game.atoms[j]);\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n break;\n } else if (this.game.atoms[j] instanceof Fluorine && this.element === \"Fluorine\") {\n this.game.updateCompound(\"FF\");\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n this.game.substractTimeMsg();\n this.game.timer -= 3;\n break;\n } else if ((this.game.atoms[j] instanceof Carbon && this.element === \"Oxygen\") || (this.game.atoms[j] instanceof Oxygen && this.element === \"Carbon\")) {\n this.game.updateCompound(\"CO\");\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n this.game.substractTimeMsg();\n this.game.timer -= 3;\n break;\n } else if (this.game.atoms[j] instanceof Oxygen && this.element === \"Oxygen\") {\n this.game.updateCompound(\"OO\");\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n this.game.addTimeMsg();\n this.game.timer += 5;\n break;\n } else if (this.game.atoms[j] instanceof Nitrogen && this.element === \"Nitrogen\") {\n this.game.updateCompound(\"NN\");\n this.game.remove(this.game.atoms[j]);\n this.game.scoreOne();\n break;\n }\n // this.vel[0] = -(this.vel[0]);\n this.game.atoms[j].vel[1] = -(this.vel[1]);\n // this.pos[0] += this.vel[0];\n this.game.atoms[j].vel[0] = -(this.vel[0]);;\n }\n }\n }", "title": "" }, { "docid": "416ef21ed0db689b95d45883c8ab21a7", "score": "0.5446639", "text": "function detectCollisions(sceneGraph) {\n let collisions = [];\n\n sceneGraph.get().forEach(entities => {\n let dynamics = entities.filter(e => isDynamic(e));\n let statics = entities.filter(e => !isDynamic(e));\n let pairs = buildUniquePairs(dynamics);\n pairs = pairs.filter(shouldInteract);\n\n dynamics.forEach(d => {\n statics.forEach(s => {\n pairs.push([d, s]);\n });\n });\n\n let collidingPairs = pairs\n .map(pair => {\n let result = SAT.checkForSeparation(pair[0], pair[1]);\n if (result.isColliding) {\n return result;\n } else {\n return undefined;\n }\n })\n .filter(collidingPair => collidingPair !== undefined);\n\n collisions.push(...collidingPairs);\n });\n\n return collisions.filter(removeDuplicates);\n}", "title": "" }, { "docid": "948535f829f018328b27a2fa87bc8722", "score": "0.54432213", "text": "function collide(alpha, nodes) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + radius.domain()[1] + padding,\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.color !== quad.point.color) * padding;\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "d8b71cd5abf74ade29a7dbf527ff9f79", "score": "0.5436617", "text": "function update() {\n\n game.physics.arcade.collide( player, collisionLayer );\n game.physics.arcade.collide( player, zombiesTopLeftBuilding, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesRoadBlock, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesLowerLeftBuilding, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesCenterOfMap, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesByTheFirstJeep, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesBottomRightBuilding, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesTweeningFromTopRight, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesByDirtTopRight, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesUnderTopRightRoad, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesRightSideMiddle, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesBottomLeftQuadrant, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesLeftSideMiddle, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesBottomLeftQuadrantSecondGroup, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombiesTriggeredTopRight, interactWithZombie, null, this );\n game.physics.arcade.collide( player, zombieKillerLeftQuadrant, interactWithZombie, null, this );\n game.physics.arcade.overlap( player, healthPacks, collectHealthPack, null, this );\n game.physics.arcade.collide( zombiesTopLeftBuilding, collisionLayer );\n game.physics.arcade.collide( zombiesRoadBlock, collisionLayer );\n game.physics.arcade.collide( zombiesLowerLeftBuilding, collisionLayer );\n game.physics.arcade.collide( zombiesCenterOfMap, collisionLayer );\n game.physics.arcade.collide( zombiesByTheFirstJeep, collisionLayer );\n game.physics.arcade.collide( zombiesBottomRightBuilding, collisionLayer );\n game.physics.arcade.collide( zombiesTweeningFromTopRight, collisionLayer );\n game.physics.arcade.collide( zombiesByDirtTopRight, collisionLayer );\n game.physics.arcade.collide( zombiesUnderTopRightRoad, collisionLayer );\n game.physics.arcade.collide( zombiesRightSideMiddle, collisionLayer );\n game.physics.arcade.collide( zombiesBottomLeftQuadrant, collisionLayer );\n game.physics.arcade.collide( zombiesLeftSideMiddle, collisionLayer );\n game.physics.arcade.collide( zombiesBottomLeftQuadrantSecondGroup, collisionLayer );\n game.physics.arcade.collide( zombiesTriggeredTopRight, collisionLayer );\n game.physics.arcade.collide( zombieKillerLeftQuadrant, collisionLayer );\n game.physics.arcade.collide( healthPacks, collisionLayer );\n\n // player stats\n playerHPDisplay.setText( \"HP: \" + player.hp );\n playerAPDisplay.setText( \"AP: \" + player.ap );\n playerKillsDisplay.setText( \"KILLS: \" + player.zombieKills );\n\n // triggered when player \"enters\" a building door\n if ( foodDoorTopLeftRectangle.contains( player.x + player.width / 2, player.y + player.height / 2 ) ) {\n console.log('before interactWithDoor()');\n if ( !foodDoorTopLeftRectangle.wasEntered ) {\n foodDoorTopLeftRectangle.wasEntered = true;\n interactWithDoor();\n } \n }\n\n if ( foodDoorBottomRightRectangle.contains( player.x + player.width / 2, player.y + player.height / 2 ) ) {\n console.log('before interactWithDoor()');\n if ( !foodDoorBottomRightRectangle.wasEntered ) {\n foodDoorBottomRightRectangle.wasEntered = true;\n console.log('calling interactWithDoor()');\n interactWithDoor(); \n }\n }\n\n if ( medicalDoorRectangle.contains( player.x + player.width / 2, player.y + player.height / 2 ) ) {\n if ( !medicalDoorRectangle.wasEntered ) {\n medicalDoorRectangle.wasEntered = true;\n interactWithMedicalDoor();\n }\n }\n\n // triggered when player reaches top right corner of map\n if ( zombiesEnterFromTopRightRectangleTrigger.contains( player.x, player.y ) ) {\n releaseZombiesFromTopRight();\n }\n\n // triggered when player reaches top right corner of map\n if ( barnDoorZombieSpawnRectangle.contains( player.x, player.y ) ) {\n releaseZombiesFromMiddleLeft();\n }\n\n // triggered when player falls down hole\n if ( bottomlessHoleRectangleTrigger.contains( player.x, player.y ) ) {\n interactWithHole();\n }\n\n\n\n // ======================================================\n // CHASING ZOMBIES\n // ======================================================\n zombieInteractionRadius = 400;\n zombieChaseSpeed = 200;\n\n // group zombiesTopLeftBuilding\n if ( game.physics.arcade.distanceBetween( zombiesTopLeftBuilding.children[ 0 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesTopLeftBuilding.children[ 0 ], player, zombieChaseSpeed, this );\n }\n // if ( game.physics.arcade.distanceBetween( zombiesTopLeftBuilding.children[ 2 ], player ) < zombieInteractionRadius ) {\n // game.physics.arcade.moveToObject( zombiesTopLeftBuilding.children[ 2 ], player, zombieChaseSpeed, this );\n // }\n\n // group zombiesLowerLeftBuilding\n for ( var i = 0; i < zombiesLowerLeftBuilding.children.length; i++ ) {\n if ( game.physics.arcade.distanceBetween( zombiesLowerLeftBuilding.children[ i ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesLowerLeftBuilding.children[ i ], player, zombieChaseSpeed, this );\n }\n }\n\n // group zombiesCenterOfMap\n if ( game.physics.arcade.distanceBetween( zombiesCenterOfMap.children[ 0 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesCenterOfMap.children[ 0 ], player, zombieChaseSpeed, this );\n }\n if ( game.physics.arcade.distanceBetween( zombiesCenterOfMap.children[ 1 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesCenterOfMap.children[ 1 ], player, zombieChaseSpeed, this );\n }\n\n // group zombiesCenterOfMap\n if ( game.physics.arcade.distanceBetween( zombiesCenterOfMap.children[ 5 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesCenterOfMap.children[ 5 ], player, zombieChaseSpeed, this );\n }\n if ( game.physics.arcade.distanceBetween( zombiesCenterOfMap.children[ 6 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesCenterOfMap.children[ 6 ], player, zombieChaseSpeed, this );\n }\n\n // group zombiesByTheFirstJeep\n if ( game.physics.arcade.distanceBetween( zombiesByTheFirstJeep.children[ 0 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesByTheFirstJeep.children[ 0 ], player, zombieChaseSpeed, this );\n }\n if ( game.physics.arcade.distanceBetween( zombiesByTheFirstJeep.children[ 2 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesByTheFirstJeep.children[ 2 ], player, zombieChaseSpeed, this );\n }\n\n // group zombiesBottomRightBuilding\n if ( game.physics.arcade.distanceBetween( zombiesBottomRightBuilding.children[ 0 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesBottomRightBuilding.children[ 0 ], player, zombieChaseSpeed, this );\n }\n if ( game.physics.arcade.distanceBetween( zombiesBottomRightBuilding.children[ 3 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesBottomRightBuilding.children[ 3 ], player, zombieChaseSpeed, this );\n }\n\n // group zombiesTweeningFromTopRight\n // if ( game.physics.arcade.distanceBetween( zombiesTweeningFromTopRight.children[ 0 ], player ) < zombieInteractionRadius ) {\n // game.physics.arcade.moveToObject( zombiesTweeningFromTopRight.children[ 0 ], player, zombieChaseSpeed, this );\n // }\n // if ( game.physics.arcade.distanceBetween( zombiesTweeningFromTopRight.children[ 3 ], player ) < zombieInteractionRadius ) {\n // game.physics.arcade.moveToObject( zombiesTweeningFromTopRight.children[ 3 ], player, zombieChaseSpeed, this );\n // }\n\n // group zombiesRightSideMiddle\n for ( var i = 0; i < zombiesRightSideMiddle.children.length; i++ ) {\n if ( game.physics.arcade.distanceBetween( zombiesRightSideMiddle.children[ i ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesRightSideMiddle.children[ i ], player, zombieChaseSpeed, this );\n }\n }\n\n // group zombiesBottomLeftQuadrantSecondGroup\n for ( var i = 0; i < zombiesBottomLeftQuadrantSecondGroup.children.length; i++ ) {\n if ( game.physics.arcade.distanceBetween( zombiesBottomLeftQuadrantSecondGroup.children[ i ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesBottomLeftQuadrantSecondGroup.children[ i ], player, zombieChaseSpeed, this );\n }\n }\n\n // group zombieKillerLeftQuadrant\n if ( game.physics.arcade.distanceBetween( zombieKillerLeftQuadrant.children[ 0 ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombieKillerLeftQuadrant.children[ 0 ], player, zombieChaseSpeed, this );\n }\n\n if ( zombiesTweeningFromTopRight ) {\n for ( var i = 0; i < zombiesTweeningFromTopRight.children.length; i++ ) {\n if ( game.physics.arcade.distanceBetween( zombiesTweeningFromTopRight.children[ i ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesTweeningFromTopRight.children[ i ], player, zombieChaseSpeed, this );\n }\n }\n }\n\n if ( zombiesLeftSideMiddle ) {\n for ( var i = 0; i < zombiesLeftSideMiddle.children.length; i++ ) {\n if ( game.physics.arcade.distanceBetween( zombiesLeftSideMiddle.children[ i ], player ) < zombieInteractionRadius ) {\n game.physics.arcade.moveToObject( zombiesLeftSideMiddle.children[ i ], player, zombieChaseSpeed, this );\n }\n }\n }\n\n\n // ======================================================\n // KEYBOARD INPUTS\n // ======================================================\n\n // reset the player's velocity with each frame update\n player.body.velocity.setTo( 0, 0 );\n\n // check for an arrow key press\n // TODO: the current code doesn't allow for diagonal movement, but can be added in if we want by uncommenting the commented out lines\n var playerSpeed = 400;\n\n if ( cursors.up.isDown ) {\n player.body.velocity.y -= playerSpeed;\n player.animations.play( 'up' );\n } else if ( cursors.down.isDown ) {\n player.body.velocity.y += playerSpeed;\n player.animations.play( 'down' );\n } else if ( cursors.left.isDown ) {\n player.body.velocity.x -= playerSpeed;\n player.animations.play( 'left' );\n } else if ( cursors.right.isDown ) {\n player.body.velocity.x += playerSpeed;\n player.animations.play( 'right' );\n } else {\n // when player stops moving maintains last direction and frame\n player.animations.stop();\n }\n}", "title": "" }, { "docid": "6ea603b374e4c51e901dff0e8bc752fb", "score": "0.5435324", "text": "wallCollision() {\n var p2change = new Vector(this.p1.x, this.p1.y);\n var p3change = new Vector(this.p1.x, this.p1.y);\n p2change.subtract(this.p2);\n p3change.subtract(this.p3);\n if (this.p1.x > game.width && this.p2.x > game.width && this.p3.x > game.width) {\n this.p1.x = 0;\n this.p2 = new Vector(this.p1.x, this.p1.y);\n this.p2.add(p2change);\n this.p3 = new Vector(this.p1.x, this.p1.y);\n this.p3.add(p3change);\n } else if (this.p1.x < 0 && this.p2.x < 0 && this.p3.x < 0) {\n this.p1.x = game.width;\n\n this.p2 = new Vector(this.p1.x, this.p1.y);\n this.p2.add(p2change);\n this.p3 = new Vector(this.p1.x, this.p1.y);\n this.p3.add(p3change);\n }\n if (this.p1.y > game.height && this.p2.y > game.height && this.p3.y > game.height) {\n this.p1.y = 0;\n\n this.p2 = new Vector(this.p1.x, this.p1.y);\n this.p2.add(p2change);\n this.p3 = new Vector(this.p1.x, this.p1.y);\n this.p3.add(p3change);\n } else if (this.p1.y < 0 && this.p2.y < 0 && this.p3.y < 0) {\n this.p1.y = game.height;\n\n this.p2 = new Vector(this.p1.x, this.p1.y);\n this.p2.add(p2change);\n this.p3 = new Vector(this.p1.x, this.p1.y);\n this.p3.add(p3change);\n }\n }", "title": "" }, { "docid": "f7c1587f14a9e784d03c7640cffd36a7", "score": "0.5433192", "text": "checkItemsInPlayCollisions(ctx) {\n // NOTE: llama status will be normal only in the day\n if (this.llama.status === \"normal\") {\n return;\n }\n\n let sphericalObjects = this.itemsInPlay;\n\n for (let i = 0; i < sphericalObjects.length; i++) {\n for (let j = 0; j < sphericalObjects.length; j++) {\n if (sphericalObjects[i] != sphericalObjects[j]) {\n\n if (sphericalObjects[i] instanceof Bacon || sphericalObjects[j] instanceof Bacon) {\n // NOTE: Bacon is not spherical\n continue;\n }\n\n if (sphericalObjects[i].status === \"available\" && sphericalObjects[j].status === \"available\") {\n if (this.areSpheresColliding(sphericalObjects[i], sphericalObjects[j])) {\n\n // NOTE: 1st line- no elastic response. 2nd line - elastic response\n // sphericalObjects[i].y_velocity = -sphericalObjects[i].y_velocity;\n this.resolveSphereSphereCollision(sphericalObjects[i], sphericalObjects[j]);\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "9028611768cb213fb098933df4715d90", "score": "0.543115", "text": "function checkCollisions() {\n\t\tvar neighbors, validDirections;\n\t\t\n\t\tif (getNextSlot(mHead, false, true) === null) {\n\t\t\t// Wall collision, turn random perpendicular direction\n\t\t\tneighbors = mHeadSlot.getNeighbors();\n\t\t\tvalidDirections = [];\n\t\t\t\n\t\t\tif (mHeadDirection.axis === \"x\") {\n\t\t\t\tif (neighbors.top !== null) {\n\t\t\t\t\tvalidDirections.push(\"up\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (neighbors.bottom !== null) {\n\t\t\t\t\tvalidDirections.push(\"down\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (neighbors.left !== null) {\n\t\t\t\t\tvalidDirections.push(\"left\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (neighbors.right !== null) {\n\t\t\t\t\tvalidDirections.push(\"right\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmSelf.setDirection(validDirections[\n\t\t\t\tMath.floor(Math.random() * validDirections.length)\n\t\t\t]);\n\t\t}\n\t}", "title": "" }, { "docid": "e486f7b375b7b326d061bebd6a03e429", "score": "0.54295504", "text": "checkCollision(actorA, actorB) {\n return (actorA.px < actorB.px + actorB.width &&\n actorA.px + actorA.width > actorB.px &&\n actorA.py < actorB.py + actorB.height &&\n actorA.py + actorA.height > actorB.py)\n }", "title": "" }, { "docid": "434a1d348f15c2daac7aea0f1219a8a2", "score": "0.54246795", "text": "function checkForCollisions() {\n // Check for player based collisions\n enemyShipObjectPool.checkForCollision(ship);\n\n // Check for enemy ship based collisions\n for (let i = 0; i < enemyShipObjectPool.ships.length; i++) {\n bulletObjectPool.checkForCollision(enemyShipObjectPool.ships[i]);\n }\n}", "title": "" }, { "docid": "4d6dbf46c43ee22c6701c06da555f196", "score": "0.5419812", "text": "function collisions(){\n player.jumping = true;\n for(var i = 0; i < world.length; i++){\n var block = world[i];\n \n // y collisions\n if(box_boxColl(\n player.x, player.y + 100, player.z, 100, 2 * abs(player.yVel), 100,\n block.x, block.y - block.h / 2 - player.yVel / 2, block.z, block.w - abs(player.xVel) * 2 - 1, abs(player.yVel), block.l - abs(player.zVel) * 2 - 1\n )){\n player.y = block.y - block.h / 2 - 105;\n player.py = player.y;\n player.yVel = 0;\n \n }else if(box_boxColl(\n player.x, player.y - 100 + 40 / 2, player.z, 100, 40, 100,\n block.x, block.y + block.h / 2 - player.yVel / 2, block.z, block.w + 1, abs(player.yVel), block.l + 1\n )){\n player.y = block.y + block.h / 2 + 100;\n player.py = player.y;\n player.yVel = 0;\n player.jumping = false;\n \n }\n\n //x collisions\n if(box_boxColl(\n player.x + 50, player.y, player.z, 2 * abs(player.xVel), 200, 100,\n block.x - block.w / 2 - player.xVel / 2, block.y, block.z, abs(player.xVel), block.h - abs(player.yVel) * 2 - 1, block.l - abs(player.zVel) * 2 - 1\n )){\n player.x = block.x - block.w / 2 - 50 - abs(player.xVel);\n player.xVel = 0;\n player.px = player.x;\n \n }else if(box_boxColl(\n player.x - 50, player.y, player.z, 2 * abs(player.xVel), 200, 100,\n block.x + block.w / 2 - player.xVel / 2, block.y, block.z, abs(player.xVel), block.h - abs(player.yVel) * 2 - 1, block.l - abs(player.zVel) * 2 - 1\n )){\n player.x = block.x + block.w / 2 + 50 + abs(player.xVel);\n player.xVel = 0;\n player.px = player.x;\n \n }\n\n //z collisions\n if(box_boxColl(\n player.x, player.y, player.z + 50, 100, 200, 2 * abs(player.zVel),\n block.x, block.y, block.z - block.l / 2 - player.zVel / 2, block.w - abs(player.xVel) * 2 - 1, block.h - abs(player.yVel) * 2 - 1, abs(player.zVel)\n )){\n player.z = block.z - block.l / 2 - 50 - abs(player.zVel);\n player.zVel = 0;\n player.pz = player.z;\n \n }else if(box_boxColl(\n player.x, player.y, player.z - 50, 100, 200, 2 * abs(player.zVel),\n block.x, block.y, block.z + block.l / 2 - player.zVel / 2, block.w - abs(player.xVel) * 2 - 1, block.h - abs(player.yVel) * 2 - 1, abs(player.zVel)\n )){\n player.z = block.z + block.l / 2 + 50 + abs(player.zVel);\n player.zVel = 0;\n player.pz = player.z;\n \n }\n\n }\n\n}", "title": "" }, { "docid": "b45e29ec1f485b010bdd2842e1851c49", "score": "0.54063994", "text": "function handleCollisions() {\n // Check food collision\n if (dist(snake.head().x, snake.head().y, food.position.x, food.position.y) === 0) {\n snake.grow();\n food.newLocation();\n }\n\n // Check boundary collision\n if (snake.head().x < 0 || snake.head().x >= gridSize || snake.head().y < 0 || snake.head().y >= gridSize) {\n gameOver();\n }\n\n // Check snake collision with self\n if (snake.isCollidingWithSelf()) {\n gameOver();\n }\n}", "title": "" }, { "docid": "5816ad85640e1987d33111dc70436874", "score": "0.5399346", "text": "function collide(s1, s2, breakOnFirstHit = false) {\n const [w, h] = s2.dims;\n const [x, y] = s2.pos;\n\n // assumes map to be s1 at 0, 0 origin\n const hits = [];\n const iData1 = s1.ctx.getImageData(x, y, w, h);\n const d1 = iData1.data;\n const iData2 = s2.ctx.getImageData(0, 0, w, h);\n const d2 = iData2.data;\n\n for (let yi = 0; yi < h; ++yi) {\n for (let xi = 0; xi < w; ++xi) {\n const i0 = (yi * w + xi) * 4 + 3;\n const a = d1[i0];\n const b = d2[i0];\n if (a & b) {\n //console.log(`pos: [${xi}, ${yi}] | a: ${a} | b: ${b}`);\n hits.push([xi + x, yi + y]);\n if (breakOnFirstHit) {\n return hits;\n }\n }\n }\n }\n\n return hits;\n}", "title": "" }, { "docid": "1649fb492d6e2091336eb5d975f19043", "score": "0.5398111", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius * 3 + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "d9f84051ca6c5f1838a3264cb624cfe2", "score": "0.5383319", "text": "function checkCollisions(){\n if (collider === null){\n collider = getCollidingObject(ballX + BALL_SIZE, ballY);\n }\n if (collider === null){\n collider = getCollidingObject(ballX + BALL_SIZE, ballY + BALL_SIZE);\n }\n if (collider === null){\n collider = getCollidingObject(ballX, ballY + BALL_SIZE);\n }\n }", "title": "" }, { "docid": "67b811c9b9117f7ac6e9396e1373b6ef", "score": "0.53824806", "text": "static tryCollide(agent1, agent2) {\n var agent1Copy = undefined;\n var agent2Copy = undefined;\n if (Execution.Engine.canCollide(agent1, agent2)) {\n // before colliding, snapshot each agent so that each\n // agent gets an unaltered copy of the other one rather than having\n // the first collision potentially mess up state before the second one.\n agent2Copy = Agent.snapShot(agent2);\n // Collide the two agents, using the copy of Agent 2 so it can't be messed up\n Execution.Engine.collide(agent1, agent2Copy);\n }\n if (Execution.Engine.canCollide(agent2, agent1)) {\n // if we didn't collide in the other direction, we still need to\n // copy Agent 1's data so Agent 1 can't be messed with via Agent 2's code\n agent1Copy = Agent.snapShot(agent1);\n Execution.Engine.collide(agent2, agent1Copy);\n }\n }", "title": "" }, { "docid": "9e451e12bf7f88e11349b84305dacd73", "score": "0.53755635", "text": "function checkEdgesCollision() {\n\tif (x + dx > WIDTH || x + dx < 0)\n dx = -dx;\n if (y + dy > HEIGHT || y + dy < 0)\n dy = -dy;\n}", "title": "" }, { "docid": "32b643467eaf08eec47a83413f9c4b99", "score": "0.5363406", "text": "function checkCollisions(spaceship, asteroids){\n //spaceship-2-asteroid collisions\n //YOUR CODE HERE (2-3 lines approx)\n for(let asteroid of asteroids.asteroids){\n if (isInside(spaceship.location, spaceship.size.x, asteroid.location, asteroid.size.y)) {\n asteroids.destroy(asteroid);\n spaceship.isVisible = false;\n explosionSystem.spawn(spaceship.location);\n isGameOver = true;\n return;\n }\n }\n\n //asteroid-2-earth collisions\n //YOUR CODE HERE (2-3 lines approx)\n for(let asteroid of asteroids.asteroids){\n if(isInside(earthLoc, earthSize.y, asteroid.location, asteroid.size.y)) {\n spaceship.isVisible = false;\n explosionSystem.spawn(asteroid.location);\n isGameOver = true;\n return;\n }\n }\n\n //spaceship-2-earth\n //YOUR CODE HERE (1-2 lines approx)\n if(isInside(earthLoc, earthSize.y, spaceship.location, spaceship.size.x)) {\n spaceship.isVisible = false;\n explosionSystem.spawn(spaceship.location);\n isGameOver = true;\n return;\n }\n\n //spaceship-2-atmosphere\n //YOUR CODE HERE (1-2 lines approx)\n if(isInside(atmosphereLoc, atmosphereSize.y, spaceship.location, spaceship.size.x))\n spaceship.setNearEarth();\n\n //bullet collisions\n //YOUR CODE HERE (3-4 lines approx)\n for(let bullet of spaceship.bulletSys.bullets){\n for(let asteroid of asteroids.asteroids){\n if(isInside(bullet.location, bullet.size.x, asteroid.location, asteroid.size.y)){\n increaseScore();\n asteroids.destroy(asteroid);\n spaceship.bulletSys.destroy(bullet);\n explosionSystem.spawn(asteroid.location);\n }\n }\n }\n}", "title": "" }, { "docid": "055e58c1aed66acd00922426df73b657", "score": "0.5363305", "text": "function detectCollisions() {\r\n // Get the user's current collision area.\r\n var bounds = {\r\n xMin: rotationPoint.position.x - box.geometry.parameters.width / 2,\r\n xMax: rotationPoint.position.x + box.geometry.parameters.width / 2,\r\n yMin: rotationPoint.position.y - box.geometry.parameters.height / 2,\r\n yMax: rotationPoint.position.y + box.geometry.parameters.height / 2,\r\n zMin: rotationPoint.position.z - box.geometry.parameters.width / 2,\r\n zMax: rotationPoint.position.z + box.geometry.parameters.width / 2,\r\n };\r\n\r\n // Run through each object and detect if there is a collision.\r\n for ( var index = 0; index < collisions.length; index ++ ) {\r\n\r\n if (collisions[ index ].type == 'collision' ) {\r\n if ( ( bounds.xMin <= collisions[ index ].xMax && bounds.xMax >= collisions[ index ].xMin ) &&\r\n ( bounds.yMin <= collisions[ index ].yMax && bounds.yMax >= collisions[ index ].yMin) &&\r\n ( bounds.zMin <= collisions[ index ].zMax && bounds.zMax >= collisions[ index ].zMin) ) {\r\n // We hit a solid object! Stop all movements.\r\n stopMovement();\r\n\r\n // Move the object in the clear. Detect the best direction to move.\r\n if ( bounds.xMin <= collisions[ index ].xMax && bounds.xMax >= collisions[ index ].xMin ) {\r\n // Determine center then push out accordingly.\r\n var objectCenterX = ((collisions[ index ].xMax - collisions[ index ].xMin) / 2) + collisions[ index ].xMin;\r\n var playerCenterX = ((bounds.xMax - bounds.xMin) / 2) + bounds.xMin;\r\n var objectCenterZ = ((collisions[ index ].zMax - collisions[ index ].zMin) / 2) + collisions[ index ].zMin;\r\n var playerCenterZ = ((bounds.zMax - bounds.zMin) / 2) + bounds.zMin;\r\n\r\n // Determine the X axis push.\r\n if (objectCenterX > playerCenterX) {\r\n rotationPoint.position.x -= 0.01;\r\n } else {\r\n rotationPoint.position.x += 0.01;\r\n }\r\n }\r\n if ( bounds.zMin <= collisions[ index ].zMax && bounds.zMax >= collisions[ index ].zMin ) {\r\n // Determine the Z axis push.\r\n if (objectCenterZ > playerCenterZ) {\r\n rotationPoint.position.z -= 0.01;\r\n } else {\r\n rotationPoint.position.z += 0.01;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "5218545f32c2f064d1118ca77f2f6ffe", "score": "0.53567827", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n}", "title": "" }, { "docid": "4d9523fb44b4c3b7446b288de82a2ee5", "score": "0.5356405", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "4d9523fb44b4c3b7446b288de82a2ee5", "score": "0.5356405", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "ee20d386f9760d338df8a3641d4e50ca", "score": "0.535598", "text": "function do_sprite_collisions() {\n\t\tvar nr_sprites = curr_drawinfo[next_lineno].nr_sprites;\n\t\tvar first = curr_drawinfo[next_lineno].first_sprite_entry;\n\t\tvar collision_mask = clxmask[clxcon >> 12];\n\t\tvar bplres = bplcon0_res;\n\t\tvar ddf_left = thisline_decision.plfleft * 2 << bplres;\n\t\tvar hw_diwlast = coord_window_to_diw_x(thisline_decision.diwlastword);\n\t\tvar hw_diwfirst = coord_window_to_diw_x(thisline_decision.diwfirstword);\n\n\t\tif (clxcon_bpl_enable == 0) {\n\t\t\tclxdat |= 0x1FE;\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var i = 0; i < nr_sprites; i++) {\n\t\t\t//struct sprite_entry *e = curr_sprite_entries + first + i;\n\t\t\tvar e = curr_sprite_entries[first + i];\n\t\t\tvar minpos = e.pos;\n\t\t\tvar maxpos = e.max;\n\t\t\tvar minp1 = minpos >> sprite_buffer_res;\n\t\t\tvar maxp1 = maxpos >> sprite_buffer_res;\n\n\t\t\tif (maxp1 > hw_diwlast)\n\t\t\t\tmaxpos = hw_diwlast << sprite_buffer_res;\n\t\t\tif (maxp1 > thisline_decision.plfright * 2)\n\t\t\t\tmaxpos = thisline_decision.plfright * 2 << sprite_buffer_res;\n\t\t\tif (minp1 < hw_diwfirst)\n\t\t\t\tminpos = hw_diwfirst << sprite_buffer_res;\n\t\t\tif (minp1 < thisline_decision.plfleft * 2)\n\t\t\t\tminpos = thisline_decision.plfleft * 2 << sprite_buffer_res;\n\n\t\t\tfor (var j = minpos; j < maxpos; j++) {\n\t\t\t\tvar sprpix = spixels[e.first_pixel + j - e.pos] & collision_mask;\n\t\t\t\tvar match = true;\n\n\t\t\t\tif (sprpix == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar offs = ((j << bplres) >> sprite_buffer_res) - ddf_left;\n\t\t\t\tsprpix = sprite_ab_merge[sprpix & 255] | (sprite_ab_merge[sprpix >> 8] << 2);\n\t\t\t\tsprpix <<= 1;\n\n\t\t\t\tvar ldata = line_data[next_lineno];\n\n\t\t\t\t/* Loop over number of playfields. */\n\t\t\t\tfor (var k = 1; k >= 0; k--) {\n\t\t\t\t\t//#ifdef AGA\n\t\t\t\t\tvar planes = (SAEV_config.chipset.mask & SAEC_Config_Chipset_Mask_AGA) ? 8 : 6;\n\t\t\t\t\t/*#else\n\t\t\t\t\tvar planes = 6;\n\t\t\t\t\t#endif*/\n\t\t\t\t\tif (bplcon0 & 0x400)\n\t\t\t\t\t\tmatch = true;\n\t\t\t\t\tfor (var l = k; match && l < planes; l += 2) {\n\t\t\t\t\t\tvar t = 0;\n\t\t\t\t\t\tif (l < thisline_decision.nr_planes) {\n\t\t\t\t\t\t\t//uae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + 2 * l * MAX_WORDS_PER_LINE);\n\t\t\t\t\t\t\t//uae_u32 word = ldata[offs >> 5];\n\t\t\t\t\t\t\tvar word = ldata[MAX_WORDS_PER_LINE_FULL * l + (offs >> 5)];\n\n\t\t\t\t\t\t\tt = (word >>> (31 - (offs & 31))) & 1;\n\t\t\t\t\t\t\t/*#if 0 //debug: draw collision mask\n\t\t\t\t\t\t\tif (1) {\n\t\t\t\t\t\t\t\tfor (var m = 0; m < 5; m++) {\n\t\t\t\t\t\t\t\t\tldata = (uae_u32 *)(line_data[next_lineno] + 2 * m * MAX_WORDS_PER_LINE);\n\t\t\t\t\t\t\t\t\tldata[(offs >> 5) + 1] |= 15 << (31 - (offs & 31));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#endif*/\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (clxcon_bpl_enable & (1 << l)) {\n\t\t\t\t\t\t\tif (t != ((clxcon_bpl_match >> l) & 1))\n\t\t\t\t\t\t\t\tmatch = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\t/*#if 0 // debug: mark lines where collisions are detected\n\t\t\t\t\t\tif (0) {\n\t\t\t\t\t\t\tfor (var l = 0; l < 5; l++) {\n\t\t\t\t\t\t\t\tuae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + 2 * l * MAX_WORDS_PER_LINE);\n\t\t\t\t\t\t\t\tldata[(offs >> 5) + 1] |= 15 << (31 - (offs & 31));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#endif*/\n\t\t\t\t\t\tclxdat |= sprpix << (k * 4);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "28f320dceb9e10e32ff5084f2997b492", "score": "0.5355574", "text": "checkCollisions() {\n // TODO: define sprite widths and heights in constructor\n // TODO: improve collision detection\n if (this.x < player.x + 78 /*player.width*/ &&\n this.x + 78 /*this.width*/ > player.x &&\n this.y < player.y + 30 /*player.width*/ &&\n this.y + 30 /*this.width*/ > player.y) {\n player.reset();\n }\n }", "title": "" }, { "docid": "18df96fd43eafa8e9ae220f5b4973277", "score": "0.5352798", "text": "checkCollision() {\n for (let i = 0; i < pipes.length; i++) {\n if (pipes[i].collided(this)) this.dead = true;\n }\n }", "title": "" }, { "docid": "6de1a5b43dad11ba6118c48a22ff863a", "score": "0.5348176", "text": "function blockCollision () {\r\n\tfor (i= 0; i < lifeBlockX.length; i++) {\r\n\t\tdeadBlocks.forEach((deadBlocks) => {\r\n\t\tif (lifeBlockX[i] + tileSize*velocityX == deadBlocks.x && lifeBlockY[i] == deadBlocks.y) {\r\n\t\t\tvelocityX = 0;\t\t\t\t\t\t\t\r\n\t\t\t}\t\t\t\t\t\t\r\n\t\t})\t\r\n\t}\r\n}", "title": "" }, { "docid": "65ea1efb2374e2419d5dc1c818df32ab", "score": "0.53440577", "text": "function collideswith(d, b) {\n\treturn d.x <= (b.x + 32)\n\t&& b.x <= (d.x + 32)\n\t&& d.y <= (b.y + 32)\n\t&& b.y <= (d.y + 32)\n }", "title": "" }, { "docid": "a259bdc070b12025141536c78ab1bcad", "score": "0.5341319", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function (d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function (quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n}", "title": "" }, { "docid": "e424b88ad885df0ae9a76bd5d0689ad8", "score": "0.5340738", "text": "function createCollision() {\n this.physics.add.overlap(player, jewels, collectJewels, null, this);\n}", "title": "" }, { "docid": "9fb37d17901bfb86c183b600c3c5e8e4", "score": "0.5338967", "text": "function handleCollisions() {\n game.physics.arcade.overlap(maggySprite, smileySprite, win);\n game.physics.arcade.overlap(maggySprite, knivesGroup, death);\n game.physics.arcade.collide(bricksGroup, knivesGroup);\n }", "title": "" }, { "docid": "96cc22aad8894ce971ed71b812f5645b", "score": "0.53380674", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "96cc22aad8894ce971ed71b812f5645b", "score": "0.53380674", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "7d5057c23776123bf800ca8d3b30ada3", "score": "0.5336543", "text": "PreSolve(contact, oldManifold) {\n // get the bodies, make sure both are actors\n // let a = contact.GetFixtureA().GetBody().GetUserData();\n // let b = contact.GetFixtureB().GetBody().GetUserData();\n // if (!(a instanceof WorldActor) || !(b instanceof WorldActor))\n // return;\n // let gfoA = a as WorldActor;\n // let gfoB = b as WorldActor;\n //TODO: This stuff here\n // // go sticky obstacles... only do something if at least one actor is a sticky actor\n // if (gfoA.mIsSticky[0] || gfoA.mIsSticky[1] || gfoA.mIsSticky[2] || gfoA.mIsSticky[3]) {\n // handleSticky(gfoA, gfoB, contact);\n // return;\n // } else if (gfoB.mIsSticky[0] || gfoB.mIsSticky[1] || gfoB.mIsSticky[2] || gfoB.mIsSticky[3]) {\n // handleSticky(gfoB, gfoA, contact);\n // return;\n // }\n //\n // // if the actors have the same passthrough ID, and it's not zero, then disable the\n // // contact\n // if (gfoA.mPassThroughId != 0 && gfoA.mPassThroughId == gfoB.mPassThroughId) {\n // contact.SetEnabled(false);\n // return;\n // }\n //\n // // is either one-sided? If not, we're done\n // let oneSided: WorldActor;\n // let other: WorldActor;\n // if (gfoA.mIsOneSided > -1) {\n // oneSided = gfoA;\n // other = gfoB;\n // } else if (gfoB.mIsOneSided > -1) {\n // oneSided = gfoB;\n // other = gfoA;\n // } else {\n // return;\n // }\n // if we're here, see if we should be disabling a one-sided obstacle collision\n //let worldManiFold = contact.GetWorldManifold();\n // let numPoints = worldManiFold.points.length;\n // for (let i = 0; i < numPoints; i++) {\n // let vector2 = other.mBody.GetLinearVelocityFromWorldPoint(worldManiFold.points[i]);\n // // disable based on the value of isOneSided and the vector between the actors\n // if (oneSided.mIsOneSided == 0 && vector2.y < 0)\n // contact.SetEnabled(false);\n // else if (oneSided.mIsOneSided == 2 && vector2.y > 0)\n // contact.SetEnabled(false);\n // else if (oneSided.mIsOneSided == 1 && vector2.x > 0)\n // contact.SetEnabled(false);\n // else if (oneSided.mIsOneSided == 3 && vector2.x < 0)\n // contact.SetEnabled(false);\n // }\n }", "title": "" }, { "docid": "f22ccfd7e36683c72013bb148446b4eb", "score": "0.5334586", "text": "resolveConflicts() {\n return __awaiter(this, void 0, void 0, function* () {\n let neighbours = this.nodes;\n let newChain;\n // We're only looking for chains longer than ours\n let maxLength = this.chain.length;\n // Grab and verify the chains from all the nodes in our network\n for (let node of neighbours) {\n let url = \"http://\" + node + \"/chain\";\n yield this.getRequest(url).then((val) => {\n let length = val.length;\n let chain = val.chain;\n // Check if the length is longer and the chain is valid\n if (length > maxLength && this.validChain(chain)) {\n maxLength = length;\n newChain = chain;\n }\n });\n }\n ;\n if (!_.isNil(newChain)) {\n this.chain = newChain;\n return true;\n }\n return false;\n });\n }", "title": "" }, { "docid": "9fc67fea663d1fc76e1acf789ea04b29", "score": "0.5326823", "text": "function processCollisions(data, opt, item) {\n var oldX = item.position.x;\n var oldY = item.position.y;\n data.forEach(function (item2) {\n if (item.id == item2.id) return;\n var neededDist = item.scaledSize*opt.maxRadius + item2.scaledSize*opt.maxRadius + opt.padding;\n var deltaX = item2.position.x - item.position.x;\n var deltaY = item2.position.y - item.position.y;\n if (Math.sqrt(deltaX*deltaX + deltaY*deltaY) <= neededDist) {\n var angle = Math.atan2(item2.position.y - item.position.y, item2.position.x - item.position.x);\n var dist = Math.sqrt(deltaX*deltaX + deltaY*deltaY) - neededDist;\n\n item.position.x += Math.cos(angle)*dist;\n item.position.y += Math.sin(angle)*dist;\n }\n });\n item.position.x = Math.min(opt.width-item.scaledSize*opt.maxRadius-opt.padding, Math.max(item.scaledSize*opt.maxRadius+opt.padding, item.position.x));\n item.position.y = Math.min(opt.height-item.scaledSize*opt.maxRadius-opt.padding, Math.max(item.scaledSize*opt.maxRadius+opt.padding, item.position.y));\n if (oldX != item.position.x || oldY != item.position.y) return true;\n else return false\n}", "title": "" }, { "docid": "3b4884eae33956693a8b1ff21078ebb1", "score": "0.53254354", "text": "collisionFunc() {\n gm.player.numBombs++;\n }", "title": "" }, { "docid": "cc57fca41541b0a872ae3b89569deee8", "score": "0.5324483", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.group === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "ec19e69fdae1a4dec525e292f74a2467", "score": "0.5320231", "text": "function checkCollision(a, b)\n{\n if (!(a instanceof Entity))\n return false;\n if (!(b instanceof Entity))\n return false;\n \n var rect1 = {x: a.pos.x, y: a.pos.y, width: a.width, height: a.height}\n var rect2 = {x: b.pos.x, y: b.pos.y, width: b.width, height: b.height}\n \n if (rect1.x < rect2.x + rect2.width &&\n rect1.x + rect1.width > rect2.x &&\n rect1.y < rect2.y + rect2.height &&\n rect1.y + rect1.height > rect2.y)\n {\n return true;\n }\n return false; \n}", "title": "" }, { "docid": "f21ee0b9f9036f5b2c9fde9d2fa67a87", "score": "0.5319271", "text": "function collision(r1, r2) {\n return !(r2.left > r1.right\n || r2.right < r1.left\n || r2.top > r1.bottom\n || r2.bottom < r1.top);\n}", "title": "" }, { "docid": "4529511fbefbb4e9e7a17081a661041d", "score": "0.53073084", "text": "conflictExists () {\n if (! this.nodes || this.nodes.length <= 1) {\n return false;\n }\n\n const alignments = {};\n\n for (let i = 0; i < this.nodes.length; i++) {\n const ti = this.nodes[i];\n\n if (! ti.active) {\n continue;\n }\n\n // If another faction exists, then conflict exists.\n if (! alignments[ti.alignment] && Object.keys(alignments).length >= 1) {\n return true;\n }\n\n alignments[ti.alignment] = true;\n }\n\n return false;\n }", "title": "" }, { "docid": "296508cd5ed0e909ca0786415f6c6ae3", "score": "0.53063", "text": "resolveLlamaItemsWithDepositSpacesCollision(object) {\n\n if (!(object instanceof WeaponItem)) {\n object.status = \"inactive\";\n }\n // else if (object instanceof WeaponItem) {\n // object.status = \"unequipped\";\n // }\n\n let destination = {};\n\n if (object instanceof Coin) {\n destination.x = COINDEPOSITCOORD.x;\n destination.y = COINDEPOSITCOORD.y;\n } else if (object instanceof Heart) {\n destination.x = HEARTDEPOSITCOORD.x;\n destination.y = HEARTDEPOSITCOORD.y;\n } else if (object instanceof Bacon) {\n destination.x = BACONDEPOSITCOORD.x;\n destination.y = BACONDEPOSITCOORD.y;\n }\n // else if (object instanceof WeaponItem) {\n // let emptyWeaponSlot = this.returnEmptyWeaponSlot();\n // object.assignedWeaponContainerCoord = {x: emptyWeaponSlot.x, y: emptyWeaponSlot.y};\n // object.x = emptyWeaponSlot.x;\n // object.y = emptyWeaponSlot.y;\n // object.x_velocity = 0;\n // object.y_velocity = 0;\n // return;\n // }\n\n let collisionCoord = {x: object.x, y: object.y};\n\n let xDistance = destination.x - collisionCoord.x;\n let yDistance = destination.y - collisionCoord.y;\n\n let distance = Math.sqrt(xDistance * xDistance + yDistance * yDistance);\n let desiredVelocity = 7; //4 px per frame = 180px per second (4x60)\n let offset = desiredVelocity/distance;\n let newXVelocity = xDistance * offset;\n let newYVelocity = yDistance * offset;\n\n object.x_velocity = newXVelocity;\n object.y_velocity = newYVelocity;\n }", "title": "" }, { "docid": "2febae7f09c908f41c7e095f72ae6bd1", "score": "0.53009814", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "479fc70c60e9faa4363d39bf2c7c69d3", "score": "0.52996206", "text": "function collide(alpha) {\n \t\t\tvar quadtree = d3.geom.quadtree(nodes);\n \t\t\treturn function(d) {\n \t\t\tvar r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n \t\t\tnx1 = d.x - r,\n \t\t\tnx2 = d.x + r,\n \t\t\tny1 = d.y - r,\n \t\t\tny2 = d.y + r;\n \t\t\tquadtree.visit(function(quad, x1, y1, x2, y2) {\n \t\t\t\tif (quad.point && (quad.point !== d)) {\n \t\t\t\tvar x = d.x - quad.point.x,\n \t\t\t\ty = d.y - quad.point.y,\n \t\t\t\tl = Math.sqrt(x * x + y * y),\n \t\t\t\tr = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n \t\t\t\tif (l < r) {\n \t\t\t\t\tl = (l - r) / l * alpha;\n \t\t\t\t\td.x -= x *= l;\n \t\t\t\t\td.y -= y *= l;\n \t\t\t\t\tquad.point.x += x;\n \t\t\t\t\tquad.point.y += y;\n \t\t\t\t}\n \t\t\t\t}\n \t\t\treturn x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n \t\t\t});\n \t\t\t};\n\t}", "title": "" }, { "docid": "678c1b11b88c25e083e7ba8b78be71d3", "score": "0.52917475", "text": "detectCollision(ast) {\n ast.forEach(function(a) {\n // need to clean up the boundaries for cleaner collisions but works\n if (this.xPos >= a.xPos && this.xPos <= a.xPos + a.width * .8 && this.yPos <= a.yPos + a.height * .9) {\n // console.log(\"hit\");\n\n // explosion animation...\n // new Explosion(canvas, context).explode(this.xPos, this.yPos, this.width, this.height);\n\n //increment asteroid counter (since we do this at the end of their life)\n spawn_counter += 1;\n\n // delete the asteroid when hit\n delete asteroids[ast.indexOf(a)];\n\n // delete laser when hits asteroid\n delete lasers[lasers.indexOf(this)];\n\n score += 100;\n // updates displayed score when asteroid is destroyed\n updateScoreDisplay();\n\n\n }\n }.bind(this));\n }", "title": "" }, { "docid": "7f1911bbf8d504db8bcead806e53ae6d", "score": "0.5285848", "text": "function collide(alpha) {\n\t\t\t var quadtree = d3.geom.quadtree(nodes);\n\t\t\t return function(d) {\n\t\t\t var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n\t\t\t nx1 = d.x - r,\n\t\t\t nx2 = d.x + r,\n\t\t\t ny1 = d.y - r,\n\t\t\t ny2 = d.y + r;\n\t\t\t quadtree.visit(function(quad, x1, y1, x2, y2) {\n\t\t\t if (quad.point && (quad.point !== d)) {\n\t\t\t var x = d.x - quad.point.x,\n\t\t\t y = d.y - quad.point.y,\n\t\t\t l = Math.sqrt(x * x + y * y),\n\t\t\t r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n\t\t\t if (l < r) {\n\t\t\t l = (l - r) / l * alpha;\n\t\t\t d.x -= x *= l;\n\t\t\t d.y -= y *= l;\n\t\t\t quad.point.x += x;\n\t\t\t quad.point.y += y;\n\t\t\t }\n\t\t\t }\n\t\t\t return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n\t\t\t });\n\t\t\t };\n\t\t\t}", "title": "" }, { "docid": "1f5b6bf27458b7332e5e1ec0999e3c87", "score": "0.5269352", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function (d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function (quad, x1, y1, x2, y2) {\n if (quad.point && quad.point !== d) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "1f5b6bf27458b7332e5e1ec0999e3c87", "score": "0.5269352", "text": "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function (d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function (quad, x1, y1, x2, y2) {\n if (quad.point && quad.point !== d) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "title": "" }, { "docid": "f3f087956419c980a18321a2365eb8ad", "score": "0.52680033", "text": "computeCollisions(player){\n player.state.collided = false\n for(let j = 0; j < this.players.length && !player.state.collided; j++){\n let other = this.players[j]\n if(other.uid != player.uid){\n let touch = player.isTouchingHorizontal(other)\n if((touch > 0 && player.state.vel.x > 0) ||\n (touch < 0 && player.state.vel.x < 0)){\n player.state.vel.x = 0\n }\n }\n }\n }", "title": "" }, { "docid": "d73ba97690c750532c0d2569403589c8", "score": "0.5260031", "text": "checkCollision(s1,s2){\n\t\tif(s1.hasOverlapWith(s2)){\n\t\t\tthis.processCollision(s1,s2);\n\t\t}\n\t}", "title": "" } ]
5563a689f1567427da354158e5df671e
returns [6] Remember that Pure functions are important as they simplify unit testing without any side effects and no need for dependency injection. They also avoid tight coupling and make it harder to break your application by not having any side effects. These principles are coming together with Immutability concept of ES6 by giving preference to const over let usage. ======================================================================================== What is the difference between let and var var let It is been available from the beginning of JavaScriptIntroduced as part of ES6 It has function scope It has block scope Variables will be hoisted Hoisted but not initialized
[ { "docid": "0be03bc6bbfd90012ad792f80131e252", "score": "0.0", "text": "function userDetails(username) {\n if (username) {\n console.log(salary); // undefined due to hoisting\n console.log(age); // ReferenceError: Cannot access 'age' before initialization\n let age = 30;\n var salary = 10000;\n }\n console.log(salary); //10000 (accessible to due function scope)\n console.log(age); //error: age is not defined(due to block scope)\n}", "title": "" } ]
[ { "docid": "698dc55ea43b95f4c677f96d84b8ac64", "score": "0.6622508", "text": "function letExample() {\r\n\tconsole.log(fruit);\t\r\n\tvar fruit = \"apple\";//let replaced with var will give compile error. let is scoped based.\r\n\tconsole.log(fruit);\t\r\n}", "title": "" }, { "docid": "92b0e6a72e768042f6c777e3ce92c34e", "score": "0.63084084", "text": "function letExample1() {\n\tif(true) {\n\t\tlet x = 100;\n\t\tconsole.log(x);//100\n\t}\n\t//console.log(x); //Uncaught ReferenceError: x is not defined\n}", "title": "" }, { "docid": "a3c59d9dd7743e3eb9d0ac43a465d556", "score": "0.62444764", "text": "function f1() {\n let a = 1;\n var b = 2;\n}", "title": "" }, { "docid": "9c846f1d0fe06f33b6322ac9c10055d3", "score": "0.6244445", "text": "function varVsLet() {\n if (true) {\n var x = 'wow'\n let y = 'wow'\n }\n // console.log(x)\n // console.log(y)\n}", "title": "" }, { "docid": "cd4c50857bdb05f531a45df64e80b173", "score": "0.6210701", "text": "function dummyFunc() {\n let dummyVar = 1;\n}", "title": "" }, { "docid": "37c939de9c56ab0be02c2824cb818bfa", "score": "0.6194888", "text": "function letMethod(){\n var a = 2;\n var b = 3;\n if(a === 2){\n var a = 10;\n let b = 20;\n console.log(a);\n console.log(b);\n }\n console.log(a)\n console.log(b);\n}", "title": "" }, { "docid": "54f36ae2cc95a1706ff88e70a716a938", "score": "0.6191524", "text": "function mutationBasics() {\n var name5 = 'Jane Smith';\n var age5 = 23;\n name5 = 'Jane Miller';\n // vars can be mutated\n\n const name6 = 'Jane Smith';\n let age6 = 23;\n name6 = 'Jane Miller'; // error\n // consts cannot be reassigned\n // let can be reassigned\n}", "title": "" }, { "docid": "18c0f62f137e02a6fd3bffcb86966eee", "score": "0.61646056", "text": "function letVariable(){\n \n// Let is a block scope in Javascript. But let cannot be initialized again with same variable name. \nif (true) {\n let letVariable = \"this is let variable\";\n console.log(letVariable); // output: this is let variable\n}\nconsole.log(letVariable); // output: undefined\n\n// Let cannot be initialized again with same variable name. \nif (true) {\n let letVariable = \"this is let variable\";\n let letVariable = \"this is let variable again\";\n console.log(letVariable); // output: SyntexError: letVariable variable already been declared\n}\n\n// Let cannot be re-initialized with the same variable name, but the value of the variable can be reassign if I would like.. \nif (true) {\n let letVariable = \"this is let variable\";\n letVariable = \"this is let variable again\";\n console.log(letVariable); // output: this is let variable again\n}\n}", "title": "" }, { "docid": "bf925393f10ef1b44a81b6b1d009c2d1", "score": "0.6069777", "text": "function simpleFunction() {\n let varInFunction = 1;\n }", "title": "" }, { "docid": "3752ecd72b7bdf4ee25fe59b0a66919f", "score": "0.60044456", "text": "function foo() {\n /* let */ {\n let a = 1;\n }\n //console.log(a); // ReferenceError\n}", "title": "" }, { "docid": "eba8c8c874b43587db1e4b6ed23cb17d", "score": "0.5989578", "text": "function myFunction() {\n let myLocalVariable = 'Hey, I am a local variable'; \n}", "title": "" }, { "docid": "0a93f08c6410c77fbc8d7533602e8c36", "score": "0.5964224", "text": "function VarLet() {\r\n var a = 10;\r\n if (true) {\r\n let b = 10 // works only in this {} block\r\n }\r\n console.log(a); //? 10. as long function not completed it will be found\r\n // console.log(b); //? get error of not defined\r\n}", "title": "" }, { "docid": "f77de575acf60d526cbe86d5a94afb29", "score": "0.5952886", "text": "function sum(first, second) {\n let result = first + second + bonus;\n console.log(result); // when variable inside function and also access to inside function\n if(result > 9){ // if block and let const isn't find out of if block\n const mood = \"happy\";\n let moood = 'sad';\n var mod = 'sadnees';\n mod = 'sad';\n console.log(mood);\n }\n console.log(mod);\n console.log(mod);\n return result;\n}", "title": "" }, { "docid": "1f12803fae305d650764e5c8d7b9bac6", "score": "0.5924399", "text": "function f25() {\n let x;\n let y = x;\n}", "title": "" }, { "docid": "1a88d5ff38e80bef857c1bd3b58718dd", "score": "0.5916477", "text": "function fun1 () { // Declare and name a function\n let l = 3; // Assign a local variable\n return l; // State a return value\n} // End function", "title": "" }, { "docid": "aa4394248efe74a88c08fa8dacb7cc04", "score": "0.59023726", "text": "function func() {\n let b = 1;\n}", "title": "" }, { "docid": "934b1f7ec4d224057c7ef72dea379cbc", "score": "0.5886594", "text": "function noRedeclartion() {\n try {\n var helloworld = 'hello';\n let helloworld = 'hello'\n console.log(helloworld)\n } catch (err) {\n console.log(err)\n }\n}", "title": "" }, { "docid": "5ea25ef642bb0b406a132306e900c708", "score": "0.58840317", "text": "function f23(x) {\n let y = x; // Error\n}", "title": "" }, { "docid": "0c0d6392e6b713435c18896007b1bdbf", "score": "0.5857046", "text": "function checkScope(){\n \"use strict\"; // this check unassigned variable using let and const\n // let i = \"function scope\"\n if(true){\n var i = \"block scope\"; // changing var to let this does not work\n console.log(\"Block scope i is: \",i);\n }\n console.log(\"Function scope i is: \", i);\n return i\n\n}", "title": "" }, { "docid": "148c9f3d055049f4153fd1798b274401", "score": "0.5852385", "text": "function test() {\n var num_var = 2;\n let num_let = 2;\n\n console.log(\"in the same block\");\n console.log(\"var =\" + num_var);\n console.log(\"let =\" + num_let);\n}", "title": "" }, { "docid": "d66d81e23c41168f6e3c6629edbef315", "score": "0.58357406", "text": "function hello() {\n let a = 'hello'; // declares a locally scoped variable with the initializer 'hello'\n}", "title": "" }, { "docid": "ff1db11888f6c891af12f2ddc8538382", "score": "0.58041215", "text": "function smallFun(){\n let a = 10;\n console.log(\"Hello i am a small function\");\n return a;\n}", "title": "" }, { "docid": "78477da70cf6f64a7e692dd4a75c0ac7", "score": "0.5767059", "text": "function discussion_about_let_three(){\n\t//console.log(alpha);\t\t\t\t// Ref Error\n\tlet alpha;\n\tconsole.log(alpha);\n\talpha = 2;\n\tconsole.log(alpha);\n}", "title": "" }, { "docid": "994b9c7fb9f8e132fb136c1a1ad1bccb", "score": "0.57587504", "text": "function sayHi() {\n console.log(name); // undefined because var initialize at first of function call and assign at run time \n console.log(age); // ReferenceError: Cannot access 'age' before initialization because let initialize and assign at run time \n var name = 'Lydia';\n let age = 21;\n}", "title": "" }, { "docid": "c0df3248189b15a3097ffa3e75acc551", "score": "0.57494086", "text": "function demo(){\n let f1 = 100;\n var f2 = 200;\n f3 = 300; //created as global variable\n}", "title": "" }, { "docid": "2109218049d76dc21a1248f265ebadd0", "score": "0.5743545", "text": "function something() {\n var special = \"JavaScript\";\n {\n let special = 42; // totally fine shadowing\n // ..\n }\n}", "title": "" }, { "docid": "146e2f152317add2b88a7a2bd2a1410b", "score": "0.5703812", "text": "function b() {\r\n let a = 4;\r\n}", "title": "" }, { "docid": "840d47ceed3bca8851f4a7ad13e5a0f9", "score": "0.57013184", "text": "function letConstScope () {\n // variables declared with let & const are scoped\n // to the block they were created in\n // This is called block scoping\n\n // A block is code delimited by curly braces (i.e {...})\n // with the exception of object declarations\n // (e.g. if (...) { /* block */ }, for (...) { /* block */ },\n // while (...) {/* block */}, etc)\n const u = 123;\n if (true) {\n let i = 456;\n\n { // this is a block by itself\n let nestedI = 890;\n }\n console.log(nestedI)\n }\n\n // u & i will not be defined here, because they were created inside\n // the block of the if above instead of the block of the function letConstScope\n console.log(u)\n console.log(i)\n}", "title": "" }, { "docid": "c9dbbef8bc57ec5a6ee62f6c1cc35886", "score": "0.5679782", "text": "function hoisting() { // hoisting moves the variable decoloration to the top of the function scope once the code is ran\n x = 10; \n console.log(x)\n var x; // once JS runs, this variable will be hoised to the top of the function scope (above x =10)\n\n // let & const variables are not hoisted\n}", "title": "" }, { "docid": "b2ebf86d04490ba412be9e4634e9c156", "score": "0.56745166", "text": "function scope(){\n //const let x = 10 //Error\n //let const x =10 //Error\n //const var x = 10 //Error\n {\n const newx = 10 //No Error\n console.log(newx)\n }\n //console.log(newx) //Error\n //console.log(x)\n}", "title": "" }, { "docid": "37d8758813c2d70c4226caef1c6c9882", "score": "0.5670747", "text": "function foo() {\n let a = 2;\n\n function bar() {\n console.log(a);\n }\n\n return bar;\n}", "title": "" }, { "docid": "902f00f32108900c171eb8f72fff70d1", "score": "0.5654051", "text": "function variables() {\n // TODO: Declares a variable where the value cannot be changed\n const myUnchangingThing = 'Matt';\n // Not Allowed: myUnchangingThing = 'Batman';\n\n // TODO: Declares a variable whose value can be changed\n let myVariable = 42;\n myVariable = 200;\n MyVariable = 500; // Spelling / casing error here creates a new variable\n\n console.log(myVariable);\n console.log(MyVariable);\n // console.writeLine(\"Hi there\");\n\n // TODO: Declares a variable that will always be an array\n let programmingLanguages = [\"C#\", \"Java\", \"JavaScript\", 42];\n console.log(programmingLanguages);\n\n // Declare things with var\n var daysOfWorkWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'];\n console.log(daysOfWorkWeek);\n\n // TODO: Demonstrate console logging\n\n return 4;\n}", "title": "" }, { "docid": "6372fddbba6098db9a6e48f4c360e150", "score": "0.5642004", "text": "function check1() {\n return x + y;\n let x = 10;\n const y = 1;\n}", "title": "" }, { "docid": "8de48434d60a709fef557fcc193d3add", "score": "0.56337893", "text": "function foo(x=5){\n let x = 1;//报错\n const x = 2;//报错\n var x = 3;//正常\n}", "title": "" }, { "docid": "4f7bfbe9111e5b6823d7c67d0b815298", "score": "0.56290257", "text": "function foo(bar) {\n let(baz = bar) {\n console.log(baz);\n }; // let block\n console.log(baz);\n}", "title": "" }, { "docid": "a07a8e186ea09fd9e081a8d54b55a562", "score": "0.5613571", "text": "function doSomethingWithlet() {\n for (var i = 0; i < 5; i++) {\n console.log(i);\n }\n // its shows error on compile time but on run time when var changes to let it automatically resolve it \n console.log('Finally value of i using let : ' + i);\n}", "title": "" }, { "docid": "ed0cf461c0667229973a83dae16686db", "score": "0.5606846", "text": "function e() {\n let myVar;\n console.log(myVar); //returns undefined (third)\n}", "title": "" }, { "docid": "49a8ef192591f1c0311aa402e3a8d9ed", "score": "0.5605443", "text": "function example_functionDeclaration() {\n\n // declaring a function makes it exist in memory\n // but does not execute the code inside\n\n function declaredAndUnused() {\n const variable = 'this is never executed';\n }\n\n}", "title": "" }, { "docid": "46d309d653dd96639bfd1a378a3c068c", "score": "0.55649114", "text": "function exampleWithLet() {\n let myLet =\n 'i am a \"let\" and i can only be used in the block i was declared in';\n console.log(myLet);\n}", "title": "" }, { "docid": "cc0700505c6d3b894f3194393d74b90b", "score": "0.55605024", "text": "function testLet() {\n let a = 20;\n if (true) {\n let a = 10;\n console.log(a);\n }\n console.log(a);\n}", "title": "" }, { "docid": "a4639e5686b62b8f58f31dbe8e5b4166", "score": "0.5550922", "text": "function constTesting() {\n const n = 5; // -> nece baciti error jer je const block scoped, isto kao i let\n\n if(true) {\n const m = 1;\n }\n console.log(m); //-> ReferenceError: not defined\n}", "title": "" }, { "docid": "f9350f6c26abab9ba2b5c0ab91bcf20b", "score": "0.55431336", "text": "function testFunc() {\r\n var x = 11;\r\n if (true) {\r\n let x = 10;\r\n console.log(\"In Block:\", x);\r\n }\r\n console.log(\"outside block:\", x);\r\n}", "title": "" }, { "docid": "5c8a38738b4aac6a722dd039d1e931df", "score": "0.5541951", "text": "function foo() {\n let a = 2;\n\n function bar() {\n console.log(a); // 2\n }\n\n bar();\n}", "title": "" }, { "docid": "b85a23d1efd14f06a4993fdba7a8fd3a", "score": "0.5538832", "text": "function func(arg) {\n let arg; \n}", "title": "" }, { "docid": "e06f0d4d7784ced9e94efc743acade00", "score": "0.5531924", "text": "function sayHi() {\n phrase = 'Hello'; // is an implicit declaration, which is an error in strict mode, but works fine otherwise. It's functionally equivalent to `var phrase = \"Hello\";`\n\n if (false) {\n let phrase; // `let phrase` declares a new variable _in it's own scope_ (the if block)\n }\n\n console.log(phrase);\n}", "title": "" }, { "docid": "cbec6bf7c16c54faebb909432130cf49", "score": "0.55317646", "text": "function let_mutable() {\n let l = 'initial';\n console.log(l); //print `initial`\n l = 'updated';\n console.log(l) //print `updated`\n}", "title": "" }, { "docid": "552e25d878520828cc25ad9aac2288bf", "score": "0.5496205", "text": "function checkScope(){\r\n \"use strict\";\r\n let i = \"function scope\"; // using let\r\n if (true){\r\n let i = \"block scope\";\r\n console.log(\"Block Scope i is: \", i);\r\n }\r\n console.log(\"Function Scope i is: \", i);\r\n return i;\r\n}", "title": "" }, { "docid": "fce601bb452f8f90145422425fd39a56", "score": "0.54876626", "text": "function foo() {\n let bar;\n if ( condition ) {\n let baz = '';\n }\n}", "title": "" }, { "docid": "aa6e3099f73a4824f87f6bd2b5a30dab", "score": "0.5480262", "text": "function first() {\r\n let a = 3;\r\n let b = 5;\r\n return (a + b);\r\n}", "title": "" }, { "docid": "d36e499eaaa7d55462400b05c03e76bb", "score": "0.5474952", "text": "function bar() {\n\tlet foo = \"baz\";\n}", "title": "" }, { "docid": "e7257d001ed83ee837bc863443c06d39", "score": "0.54638255", "text": "function example() {\n let declaredButNotAssigned;\n console.log(declaredButNotAssigned); // => undefined\n declaredButNotAssigned = true;\n}", "title": "" }, { "docid": "1a54bc5587ba079f719ff3304ef805fd", "score": "0.54583466", "text": "function btn_1_output() {\n // Globally var and let work the same way\n // Declaring variables\n\n var a = 'Test1';\n let b = 'Test2';\n\n // Outputing variables to console\n\n console.log(a);\n console.log(b);\n\n function testVar() {\n var a = 30;\n if (true) {\n var a = 50;\n console.log(a);\n }\n console.log(a);\n // all a values will be set to 50\n }\n testVar();\n\n function testlet() {\n // let depends on scope\n let a = 30;\n if (true) {\n let a = 50;\n console.log(a);\n }\n console.log(a);\n }\n testlet();\n\n for (let i = 0; i < 3; i++) {\n console.log(i);\n }\n console.log(i); // i will be undefined as its outside the scope\n \n for (var i = 0; i < 3; i++) {\n console.log(i);\n }\n console.log(i); // will have the loop exiting i value\n \n const colors = [];\n colors.push('red');\n colors.push('blue');\n\n\n // colors = 'Green'; // cannot change type of constant variable\n\n console.log(colors);\n\n\n const green = 'green';\n\n // green = 1; // cannot change datatype of constant variables\n\n console.log(green);\n}", "title": "" }, { "docid": "7e3fa335557d9dc50e07293042bbf812", "score": "0.5451926", "text": "function lol() {\n let person = \"tom\"; //these are scoped to this function, cant be accessed outside func\n const age = 45;\n var color = \"teal\";\n}", "title": "" }, { "docid": "6aebb91379590f2d3f37125dc2570208", "score": "0.54252356", "text": "function miFuncion(){\n 'use strict'\n let y=4;\n console.log(y);\n}", "title": "" }, { "docid": "999f499544ae148010df3042028d9c39", "score": "0.54054946", "text": "function square(num) {\n // these are parameters, scope within function\n\n let flag = \"STR\"; // with no let or var flag becomes global\n console.log(flag); // local var takes precedence over global\n flag = \"MODIFIED FLAG\";\n return num * num;\n}", "title": "" }, { "docid": "54db23a2ab9031779e478f53c2dd185c", "score": "0.5401455", "text": "function checkMyScope() {\n var first = \"apple\";\n let second = \"banana\";\n var third = \"cherry\";\n fourth = \"dragonfruit\";\n\n if (true) {\n first = \"elderberry\";\n second = \"fig\";\n third = \"grape\";\n const fourth = \"honeydew melon\";\n };\n\n console.log('first is', first, '-- Using a Var is only local - the value of the previously defined fruit is changed');\n console.log('second is', second, '-- Using a Let is local and the value of the previous fruit is changed');\n console.log('third is', third, '-- Using a Var is only local - the value of the previously defined fruit is changed');\n console.log('fourth is', fourth, '-- Use Const when you dont want variable to change values. Meanwhile LET/VAR can change.');\n}", "title": "" }, { "docid": "74cfc08160718ed3eaf3fbf711e33350", "score": "0.538276", "text": "function test() {\n let c = 'other stuff';\n}", "title": "" }, { "docid": "a08143778428687137929c4034a4dfc2", "score": "0.53575593", "text": "function varOrConst() {\n console.log(varone);\n console.log(vartwo);\n\n var varone = 1;\n const vartwo = 2;\n}", "title": "" }, { "docid": "33bd19142676502f767aaa16a5ea8f02", "score": "0.535689", "text": "function constExercise() {\n const x = 10\n x = 4\n}", "title": "" }, { "docid": "bb300bf63b8a90539115d0006022162a", "score": "0.53492486", "text": "function Func(){\n var value1 = 40;\n let value2 = 50;\n const value3 = 60;\n\n console.log(value1,value2,value3);\n }", "title": "" }, { "docid": "62477d461fc86362603c86b4955f2baf", "score": "0.53265756", "text": "function closurePractice() {\n let secret = 'dont tell!'\n\n let a = function() {\n return secret;\n }\n return a;\n}", "title": "" }, { "docid": "acd3ea91d8aea6998bf3c13ad4205f64", "score": "0.53246844", "text": "function fun() {\n let a = 5;\n if(a==5){\n f = 100; //let has a bolck scope, var has a function scope\n console.log(\"Inside\",f)\n }\n console.log(\"Outside\", f);\n}", "title": "" }, { "docid": "a060a05a6f242ae7c7b2f8f7cd606089", "score": "0.5304699", "text": "function b() {\n\tlet a = 4;\n}", "title": "" }, { "docid": "68c3c81ac2b7bd2911d76b8a69fb99af", "score": "0.53044873", "text": "function f1 (){\n const item = 1;\n return item;\n}", "title": "" }, { "docid": "64a5482252125c22f5a5d282f88be92f", "score": "0.52992475", "text": "function isLet(node) {\n return t.isVariableDeclaration(node) && (node.kind !== \"var\" || node._let);\n}", "title": "" }, { "docid": "281e978c35ed0d9f89cbb45636be88f1", "score": "0.52894044", "text": "function fun(){\n //invisible var a;\n //above is what hoisting looks like\n\n //we generally talk of two other scopes in JS, function scope and block scope -> both of these are local\n let x = 'function'//both are function scoped\n //var a = 'function'//they are in the function and no other blocks of code\n console.log(a)//we would expect a is 'global' here\n \n if(true){\n let x = 'block';//in js we always use the most local declartion of a variable\n var a = 'block';//var does something called variable hoisting\n //var does not have block scope, it only has function and global\n //if you declare a var in a block, it will hoist that declartion to the very top line of the function\n console.log(x)\n }\n\n console.log(x)\n\n}", "title": "" }, { "docid": "03fd695fd6c1f2ccb48c35360ae886da", "score": "0.52767116", "text": "function myFunction() {\n const foo = 'hello';\n function myFn() {\n console.log(foo);\n };\n const foo = 'world';\n return myFn;\n}", "title": "" }, { "docid": "eb9b11b6ea99ee5c38ae31d4492d0f8d", "score": "0.5262691", "text": "function disminuir() {\n if (true){\n var local = 2\n let tambienLocal = 2\n const LOCAL = 4\n\n console.log(local)//2\n console.log(tambienLocal)//2\n console.log(LOCAL)//4\n }\n\n console.log(local)//2\n console.log(tambienLocal)//undefined\n console.log(LOCAL)//undefined\n\n}", "title": "" }, { "docid": "cb7f0cf696f87d173126a7ca07abf2f2", "score": "0.5255794", "text": "function testLet(){\n\tlet a = 30;\n\tif(true){\n\t\tlet a = 50;\n\t\tconsole.log(a);\n\t}\n\tconsole.log(a);\n}", "title": "" }, { "docid": "cbe88db04571952c4a31e3aec23b7edf", "score": "0.5249136", "text": "function someFunc() {\n return 1;\n}", "title": "" }, { "docid": "2b65832dcaeac079a426b4136646efdc", "score": "0.5240699", "text": "function example2() {\n let i = 0;\n console.log(i);\n}", "title": "" }, { "docid": "e91476aa69678ea9b8707dd8fc3f7ff2", "score": "0.52336293", "text": "function welcome4() {\n //notice the absence of the 'let' keyword; automatically global scopes the variable and its value;\n //console.log below actually returns 'Hello Stuart' as a result\n oneMoreName = 'Stuart';\n if(true) {\n let oneLastName = 'Stewart';\n }\n}", "title": "" }, { "docid": "fcd8137e0da8801e2009ab48afd83cc2", "score": "0.5221832", "text": "function constVariable(){\n // Const same as Let but the value of the variable cannot be reassign\n if (true) {\n const constVariable = \"this is const variable\";\n constVariable = \"this is const variable again\";\n console.log(constVariable); // output: Assignment to constant variable.\n }\n // Const let you update the object data but cannot be reassign/redeclare with same variable name\n if (true) {\n const constVariable = {\n name: \"javascript\",\n version:\"2015\"\n } \n constVariable.name = js;\n console.log(constVariable) // output: {\"name\":\"js\", \"version\":\"2015\"}\n }\n}", "title": "" }, { "docid": "30d96eaa63d90c77bfd83e0450f0c170", "score": "0.5204569", "text": "function myFunction3(){\n let x = 10;\n let y = 3;\n return soma(); // Chamei a variável antes msm dela existir\n let soma = function(){\n return x + y; \n };\n}", "title": "" }, { "docid": "ef8778f94de13246ff20b1d13206782e", "score": "0.52024645", "text": "function discussion_about_let_two(){\n\t//console.log(beta); \t\t// Ref Error\n\tlet beta=1;\n}", "title": "" }, { "docid": "ad1ccf599828b4c39dc1b7b2ea830b36", "score": "0.5199774", "text": "function laugh(funny) {\n let funny = \"hahahahahahahahahaha\";\n return funny\n}", "title": "" }, { "docid": "bdec690e1485b270c6078af97d13bfb4", "score": "0.5175802", "text": "function asdf() {\n if (true) {\n var x = 10;\n let y = 20;\n }\n var z = 30;\n console.log(\"x\", x);\n setTimeout(() => console.log(\"y\", y), 10);\n console.log(\"z\", z);\n return () => {\n console.log(\"y\", y);\n };\n}", "title": "" }, { "docid": "a9183df14a741169a1a8e83febd20dad", "score": "0.5161631", "text": "function x(y) {\n var greet = 'hello';\n console.log(greet);\n if(y > 0){\n let a = 'let accesible';\n console.log(a);\n }\n \n // this will cause an error because we access variable a outside the block\n // console.log(a);\n}", "title": "" }, { "docid": "775b67af8e705116afeb075910cfc9e7", "score": "0.51310474", "text": "function before(you){\n const puppy = 'pupy'\n const a = 'b'\n return 'some more logic...'\n}", "title": "" }, { "docid": "e4702dac2ee081dbba80ef815c3fdf5d", "score": "0.5126353", "text": "function sayHi() {\n console.log(name);\n console.log(age);\n var name = \"Lydia\";\n let age = 21;\n}", "title": "" }, { "docid": "0176b5df2767fc63d1c05906bcc3e8fa", "score": "0.5112619", "text": "function everyOneName() {\n let bar,\n foo;\n bar = \"coso\";\n}", "title": "" }, { "docid": "5437afebf99d7102636e88379e408a61", "score": "0.51039636", "text": "function foo() {\n const a = 10;\n return function() {\n return a;\n }\n}", "title": "" }, { "docid": "8270ced7d661278fa3f9343e64de8a58", "score": "0.51029694", "text": "function myfunction141() {\n var x = 10;\n // Here x is 10\n {\n let x = 2;\n // Here x is 2\n document.getElementById(\"demo\").innerHTML = x;\n }\n // Here x is 10\n // document.getElementById(\"demo\").innerHTML = x;\n}", "title": "" }, { "docid": "18f4b376da4b50c470095bcd17e14b3d", "score": "0.50933236", "text": "function hi() {\n let name = \"Rusty\";\n console.log(name);\n}", "title": "" }, { "docid": "2305b12edb120fa8bb3cbda25da17a92", "score": "0.5092407", "text": "function outerFunction() {\n console.log(a); // 3, 9\n let b = 5;\n a = 9;\n console.log(b); // 5, 5\n // console.log(c); (n/A)\n return function innerFunction() {\n const b = 10\n let c = 7;\n console.log(a); // 9\n console.log(b); // 10\n console.log(c); // 7\n }\n}", "title": "" }, { "docid": "1531c28b1413d8ab461b930180dc5fee", "score": "0.507794", "text": "function f22(x) {\n let v1 = x;\n let v2 = x;\n let v3 = x; // Error\n let v4 = x; // Error\n let v5 = x; // Error\n let v6 = x; // Error\n let v7 = x; // Error\n}", "title": "" }, { "docid": "daccdfa8ba1b0180a98eb5fd6a6df5ff", "score": "0.50743747", "text": "function scopeTest() {\n var outerVar = 'outer var';\n let outerLet = 'outer let';\n if (true) {\n var innerVar = 'inner var';\n let innerLet = 'inner let';\n }\n}", "title": "" }, { "docid": "21cd61ed66b6f611339954130ff0a35b", "score": "0.5062568", "text": "function foo() {\n let bam = 'This is a not a global variable';\n //\n // [... Some code...]\n //\n ban = 'Typo and now you have a global variable';\n}", "title": "" }, { "docid": "d52816ffdc678a1e905e7b08b0597d87", "score": "0.5046633", "text": "function func() {\n return a;\n var a = 1;\n }", "title": "" }, { "docid": "d52816ffdc678a1e905e7b08b0597d87", "score": "0.5046633", "text": "function func() {\n return a;\n var a = 1;\n }", "title": "" }, { "docid": "d5ef5c04af8b18ee1b7633c3bc3479f0", "score": "0.5046453", "text": "function myFunc2() {\n let name5 = 'LET - Function Scope';\n console.log(name5);\n}", "title": "" }, { "docid": "d11847fd1ff8ccbdd25abdfee3f65a94", "score": "0.5038472", "text": "function greet() {\n // function scope\n let age = 30;\n let name = \"John\"; // shadowed variable - possible cause different scope\n console.log(name, age);\n}", "title": "" }, { "docid": "acc12f6a765e9f3d866c7d713bd276da", "score": "0.50241876", "text": "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "acc12f6a765e9f3d866c7d713bd276da", "score": "0.50241876", "text": "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "acc12f6a765e9f3d866c7d713bd276da", "score": "0.50241876", "text": "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "22875fee56e2b79ce4fbb81b28da35f6", "score": "0.50213724", "text": "function setEggs2() {\n let eggs = 10;\n console.log(eggs)\n}", "title": "" }, { "docid": "6824284e334828d853f54405d9211e49", "score": "0.50197345", "text": "function first() {\n let d = 50;\n\n}", "title": "" }, { "docid": "f6c581440c7ae622fa5d385f8d8352b7", "score": "0.5019162", "text": "function myFunc(){\n let z = 100;\n console.log(z);\n}", "title": "" }, { "docid": "1be4d8610480a9301e6b30e782514fa7", "score": "0.49899924", "text": "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "title": "" }, { "docid": "4fce98c939d1e8c3bfac304b7ec20663", "score": "0.49850854", "text": "function functionA() {\r\n const fruit = \"apple\";\r\n}", "title": "" }, { "docid": "58098159c454759ae48cc54fdb5bfa39", "score": "0.49810705", "text": "function let_scope_later_block(){\n {\n let l = 20;\n console.log(l); // print `20`\n }\n\n {\n let l = 30;\n console.log(l); //print `30`\n }\n}", "title": "" } ]
ed574d3436c712f0f4ef993bafc0adc2
Get Single Order Details
[ { "docid": "02a635ce0abe5a13216456d3d3b806c9", "score": "0.78329474", "text": "static async getOrderDetails(orderId) {\n const res = await this.request(`orders/${orderId}`);\n return res;\n }", "title": "" } ]
[ { "docid": "65c9f4bcee0e9b1f50a09943a0bb6662", "score": "0.7812398", "text": "getOrderDetails(id) {\n var url = `/order?id=${id}`;\n return Method.dataGet(url, token);\n }", "title": "" }, { "docid": "e2ccdc9e1106c01df3361667647bc9f0", "score": "0.71306086", "text": "getOrder (orderId) {\n return Api().get('orders/getOrder', {\n params: {\n orderId: orderId\n }\n })\n }", "title": "" }, { "docid": "b1444d873798a5aced3c163d812cb033", "score": "0.7105865", "text": "function getOrder(req, res) {\n Order.findById(req.params.orderId, (err, order) => {\n if(err) res.send(err);\n //If no errors, send it back to the order\n res.json(order);\n });\n}", "title": "" }, { "docid": "9f91fd8d0c0a1c598e1f1dcc593825f3", "score": "0.7071788", "text": "function _getOrderDetails() {\n return $http.get(constants.apiHost + 'getAllOrderDetails')\n .then(getOrderDetailsComplete)\n .catch(getOrderDetailsFailed);\n\n function getOrderDetailsComplete(response) {\n return response.data;\n\n }\n\n function getOrderDetailsFailed(error) {\n //ignore... handlled in implemetation...\n return $q.reject(error);\n }\n }", "title": "" }, { "docid": "dd0de299284fdbc619537b3ea7a42629", "score": "0.7022287", "text": "async function getOneOrder(req, res) {\n let id = req.params.orderId;\n let order = await Order.findOne(\n { _id: id },\n \"_id orderDate totalSale discount\"\n ).populate(\"products\", \"name _id sellPrice\");\n if (order === null) {\n res.status(404).json({ message: `Could Not Find Order with id: ${id}` });\n } else {\n res.status(200).json(order);\n }\n}", "title": "" }, { "docid": "ed6938ccfdfed117465314dddf420e41", "score": "0.67864454", "text": "getSingleOrder(id) {\n const orders = dummyData.meals.find(order => order.id == id);\n return orders || {};\n }", "title": "" }, { "docid": "1b95853660ab723b0f59ca2d113ddb21", "score": "0.67739624", "text": "static getOrder(orderID) {\n const orders = this.getAllOrders();\n let order;\n orders.forEach((ord) => {\n if (order.id === orderID) {\n order = ord;\n }\n });\n return order;\n }", "title": "" }, { "docid": "d3da150f20608b2c4e8f4e6cd6a93fec", "score": "0.6596112", "text": "function getDetails(){\n\t\t// Query the store for the product details\n\t\tinappbilling.getProductDetails(successHandler, errorHandler, [\"gas\",\"infinite_gas\"]);\n\t}", "title": "" }, { "docid": "049dca2be2943dcd24eaed9ce25159fd", "score": "0.6505085", "text": "getOrder(orderId) {\n /* {\n settled: true/false,\n status: 'F', // Same set as order list\n price: ...,\n quantity: ...,\n product: ...,\n // Meta:\n id: ... (appended by this)\n } */\n return this._impl.getOrder(orderId)\n .then(ret => _.assign({ exchange: this, id: orderId }, ret));\n }", "title": "" }, { "docid": "3087e2f89cb2080bd1743f9b48196a42", "score": "0.6453701", "text": "async function getOrder(req, res, next) {\n let order;\n try {\n order = await Order.findById(req.params.id);\n if (order == null) {\n return res\n .status(404)\n .json({ message: \"Sorry, the order is not available\" });\n }\n } catch (err) {\n return res.status(500).json({ message: err.message });\n }\n res.order = order;\n next();\n}", "title": "" }, { "docid": "942c6891b57baf86ca1199366084bf33", "score": "0.64499897", "text": "function getOrderById(req, res, next){\n Order.findOne({\"user\": req.params.user, \"_id\": req.params.order}).exec((err, order) => {\n\n if(err){\n res.status(500).json(err);\n }\n\n res.status(200).json(order);\n\n });\n\n}", "title": "" }, { "docid": "13af06c056f39790e8f5bbf4626173a7", "score": "0.64276254", "text": "async get(orderId) {\n try { \n const res = await this.Order.get(orderId) \n return new order(res.id,...res)\n } catch (error) {\n throw error\n }\n }", "title": "" }, { "docid": "a1eed6387196df8fcf27dbfeabe1c8df", "score": "0.64272386", "text": "function printOrder(order) {\n\tvar result = \"Order Detail:<br>\";\n\tvar o = order;\n\tvar totalMeal = parseInt(o.vegetarian) + parseInt(o.glutenFree) + parseInt(o.nutFree) + parseInt(o.fishFree) + parseInt(o.wo_Restrict);\n\tresult += \"Total Meal(s) Ordered: \" + totalMeal +\",<br>\";\n\tresult += \"Total Vegetarian Meal(s) Ordered: \" + o.vegetarian +\",<br>\";\n\tresult += \"Total Gluten-Free Meal(s) Ordered: \" + o.glutenFree +\",<br>\";\n\tresult += \"Total Nut-Free Meal(s) Ordered: \" + o.nutFree +\",<br>\";\n\tresult += \"Total Fish-Free Meal(s) Ordered: \" + o.fishFree +\",<br>\";\n\tresult += \"Total Others Meal(s) Ordered: \" + o.wo_Restrict +\".<br><br>\";\n\treceiptStr += result;\n}", "title": "" }, { "docid": "da523eb323d437d9a5cccf1d09a3bfa7", "score": "0.6419217", "text": "function _getOrderResponse (order, clientRequestId) {\n return {\n order_id: order.id,\n created_at: order.created_at,\n };\n}", "title": "" }, { "docid": "3fe001da9e2499c0af66c8d43d718279", "score": "0.6364442", "text": "function getOrder(orderID, callback) {\n db.get(`SELECT * FROM Orders WHERE id = '${orderID}'`, callback);\n}", "title": "" }, { "docid": "b9dc1ea445d59d11c37d7b0d4fc150a7", "score": "0.63467836", "text": "function getOrderFromSAPDB(orderid){\r\n\t//Call common get order from DB method\r\n\tvar returnorder = getOrderFromDB(orderid, KEY_SAPORDERMAP);\r\n\treturn returnorder;\r\n}", "title": "" }, { "docid": "797c560229edc238302842fc689a2152", "score": "0.6301337", "text": "function getOrderLineDetails()\n{\n\tvar itemIntID = 0;\n\n\ttry\n\t{\n\t\t//========================================\n\t\t// items\n\t\t//========================================\n\t\tif(orderElement.indexOf('<quantity>')!=-1)\n\t\t{\n\t\t\titemObj=new Object();\n\t\t\titemObj.quantity= splitOutValue(orderElement,'quantity');\n\t\t\titemObj.startQuantity = itemObj.quantity;\t\n\t\t\titemObj.getQuantity = 0;\t\n\t\t\titemObj.buyQualify = false;\n\t\t\titemObj.getQualify = false;\n\t\t\titemObj.getPrice = 0;\n\t\t\titemObj.offerImage = '';\n\t\t\titemObj.offerDescription = '';\n\t\t\titemObj.isShipping = false;\n\t\t\titemObj.location=\"\";\n\t\t}\n\t\tif(orderElement.indexOf('<itemcode>')!=-1)\n\t\t{\n\t\t\titemObj.itemCode = splitOutValue(orderElement,'itemcode');\n\t\t\titemIntID = lookupItems(itemObj.itemCode);\n\t\t\titemObj.itemIntID = itemIntID;\n\t\t\titemObj.itemImage = itemImage;\n\t\t\titemObj.VATCode = VATCode;\t\n\t\t\titemObj.VATRate = VATRate;\t\t\t\t\t\t\n\t\t\titemObj.pricesIncludeTax = pricesIncludeTax;\n\t\t\titemObj.overalldisc = 0;\n\t\t\titemObj.overalldiscImage = '';\n\t\t\titemObj.overalldiscDesc = '';\n\t\t\titemObj.overalldiscPercent = 0;\n\n\t\t\titemObj.overalldisc1 = 0;\n\t\t\titemObj.overalldiscImage1 = '';\n\t\t\titemObj.overalldiscDesc1 = '';\n\t\t\titemObj.overalldiscPercent1 = 0;\n\n\t\t\titemObj.overalldisc2 = 0;\n\t\t\titemObj.overalldiscImage2 = '';\n\t\t\titemObj.overalldiscDesc2 = '';\n\t\t\titemObj.overalldiscPercent2 = 0;\n\n\t\t\titemObj.shippingbandgb = shipBandItemID;\n\t\t\titemObj.shippingbandeu = shipBandItemEUID;\n\n\n\t\t}\n\n\t\tif(orderElement.indexOf('<description>')!=-1)\n\t\t{\n\t\t\titemObj.description = splitOutValue(orderElement,'description');\n\t\t}\n\n\t\tif(orderElement.indexOf('<location>')!=-1)\n\t\t{\n\t\t\titemObj.location = splitOutValue(orderElement,'location');\n\t\t}\n\n\n\t\tif(orderElement.indexOf('<price>')!=-1)\n\t\t{\n\t\t\titemObj.price = splitOutValue(orderElement,'price');\n\t\t\titemsArray[itemsCount] = itemObj;\n\t\t\titemsCount = itemsCount + 1;\n\t\t}\n\t}\n\tcatch(e)\n\t{\n\t\terrorHandler(\"getOrderLineDetails\", e);\n\t}\n}", "title": "" }, { "docid": "95b16afc95f40fd10f94095a681c8681", "score": "0.62209356", "text": "function getOrderHeaderDetails()\n{\n\ttry\n\t{\n\t\tif(orderElement.indexOf('<date>')!=-1)\n\t\t{\n\t\t\torderDate = splitOutValue(orderElement,'date');\n\t\t}\n\t\tif(orderElement.indexOf('<customer>')!=-1)\n\t\t{\n\t\t\tcustomer = splitOutValue(orderElement,'customer');\n\t\t}\n\n\t\tif(orderElement.indexOf('<reference>')!=-1)\n\t\t{\n\t\t\treference = splitOutValue(orderElement,'reference');\n\t\t}\n\t\tif(orderElement.indexOf('<campaign>')!=-1)\n\t\t{\n\t\t\tcampaign = splitOutValue(orderElement,'campaign');\n\t\t}\n\t\tif(orderElement.indexOf('<brand>')!=-1)\n\t\t{\n\t\t\tbrandIntID = splitOutValue(orderElement,'brand');\n\t\t\tbrandIntID = parseInt(brandIntID);\n\t\t}\n\n\t}\n\tcatch(e)\n\t{\n\t\terrorHandler(\"getOrderHeaderDetails\", e);\n\t}\n}", "title": "" }, { "docid": "f38e737733ddc51384fc0bb826b1c8df", "score": "0.61955076", "text": "getOrderId(){\n window._axios.get('https://admin.hhmworld.com/demo1.php?test=hhpure&amount='+parseInt(this.cart.ship + (this.cart.price * this.cart._qty) * 100))\n .then((result) => {\n if(result.data !== ''){\n this.order_info = result.data;\n }else{\n this.logOut();\n }\n })\n .catch(function(error){\n console.log(error.response);\n });\n }", "title": "" }, { "docid": "4430e91f74c9ee7913863652dad8351e", "score": "0.61550385", "text": "function getOneTaco(req, res) { \n const id = parseInt(req.params.id);\n const orderOneTaco = tacos.get(id);\n res.status(200).json(orderOneTaco);\n}", "title": "" }, { "docid": "c0ad4ba09023c5c3efe1fe03d8a16973", "score": "0.6133766", "text": "function getDataOrder(id, modify){\n\n makePost(URL_GET_ORDER, {\n id\n })\n .then(data => {\n console.log(data);\n showFullModal('get-order', data, modify)\n })\n .catch(err => console.error)\n}", "title": "" }, { "docid": "559a587dec83c1236f681b89cc8ec0c3", "score": "0.61038196", "text": "function OrderDetails(quantity, priceperunit) {\n this.quantity = quantity;\n this.priceperunit = priceperunit;\n}", "title": "" }, { "docid": "5a147d3db3696342fff98fd747adf797", "score": "0.60927016", "text": "async function getOrder(req, res, _next) {\n const { uuid } = req.params;\n console.log(\"UUID: \", uuid);\n const order = await Order.findOne(\n {\n where: {\n uuid,\n },\n include: [\n {\n model: Product,\n attributes: [\n \"uuid\",\n \"name\",\n \"description\",\n \"price\",\n \"image\",\n \"thumbnail\",\n \"stock\",\n ],\n },\n {\n model: User,\n attributes: [\"uuid\", \"email\", \"userName\"],\n },\n ],\n },\n { timestamps: false }\n );\n console.log(order);\n res.json(order);\n}", "title": "" }, { "docid": "1fd77317ce267372c5618da23f0c7791", "score": "0.6079112", "text": "async function getOrderById(orderId) {\n try {\n const { rows: order } = await client.query(`\n SELECT *\n FROM orders_products\n WHERE \"orderId\"=$1;\n `, [orderId]);\n return order\n } catch (error) {\n throw error\n }\n}", "title": "" }, { "docid": "00c6ae3d147ea8b6dc8ad8eb8c4e1848", "score": "0.6071167", "text": "function createPrintfulOrder(){\n return JSON.stringify({\n recipient: {\n name: $scope.buyer,\n address1: $scope.data.address.components.streetNumber + ' ' + $scope.data.address.components.street,\n city: $scope.data.address.components.city,\n state_code: $scope.data.address.components.state,\n country_code: $scope.data.address.components.countryCode,\n zip: $scope.data.address.components.postCode\n },\n\n //TODO - Cart Service - Get Items\n items: cart.getCartItems()\n });\n }", "title": "" }, { "docid": "39e96a1921f0cd7b5a4cb7dbe3f657cd", "score": "0.599271", "text": "function getOrders()\n{\n // TODO, DELETE IT AS I THINK IS NOT NEEDED FOR US, EXCEPT FOR THE TASK WITH THE TOP PRODUCTS,\n // KEEP IT AS IS UNTIL WE AGREE.\n}", "title": "" }, { "docid": "f94c48499d430fd8b7531a97655b8e56", "score": "0.5958009", "text": "getItemDetails(productID){\n fetch(`https://cors-anywhere.herokuapp.com/https://testapi.pfl.com/products?id=${productID}&apikey=136085`, {\n method: 'GET',\n headers: {\n 'Authorization': `Basic ${this.credentials}`,\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n })\n .then(result => result.json())\n .then(result => this.currentOrder = result.results.data)\n .then(result => browserHistory.replace(\"/orderdetails\"));\n }", "title": "" }, { "docid": "d2b802e044856ba7c819bcda0e8f8805", "score": "0.5955533", "text": "async function orderInfo(req, res, next) {\n try {\n const email = req.body.email;\n const orderInfo = await Order.find({ email: email }).sort({\n createdAt: -1,\n });\n res.status(200).json(orderInfo);\n } catch (err) {\n res.status(500).json({\n error: \"Internal Server Error!\",\n });\n }\n}", "title": "" }, { "docid": "79f6beae00ff1641f769adf749f35764", "score": "0.59483665", "text": "getCustomerOrder(id, callback) {\n console.log('*** OrderRepository.getCustomerOrder');\n Order.findById(id, (err, order) => {\n if (err) {\n console.log(`*** OrderRepository.getCustomerOrder error: ${err}`);\n return callback(err);\n }\n callback(null, order);\n });\n }", "title": "" }, { "docid": "23fb62f2f38ea1f1ee67d7181de521b2", "score": "0.594451", "text": "loadOrderFromLocalStorage() {\n if (window.localStorage.getItem('order_receipt')) {\n return JSON.parse(window.localStorage.getItem('order_receipt'));\n }\n }", "title": "" }, { "docid": "30fefe28214eac8eafd2f996d3491157", "score": "0.593525", "text": "GetOrder(orderID) {\n\n return new Promise((resolve, reject) => {\n if (db !== null) {\n\n const o_id = new mongo.ObjectID(orderID);\n\n db.get().collection(DBCollection.ORDER).find({ '_id': o_id }).toArray()\n .then((res) => {\n\n resolve(res);\n })\n .catch((error) => {\n\n return reject(error);\n });\n\n } else {\n reject('Connection Error');\n }\n });\n }", "title": "" }, { "docid": "fd58c93394158fa896814cfeba3a660d", "score": "0.59128577", "text": "@api\n get orderItem() {\n return this._orderItem;\n }", "title": "" }, { "docid": "36400092205e9bea9371ad490c58123f", "score": "0.58961064", "text": "function getOrderData()\n{\n\tvar url = urlOrderHistory;\n\tvar x = getData(url);\n\treturn x;\n}", "title": "" }, { "docid": "066b7904bbdd4d02363b838f089611bf", "score": "0.5844347", "text": "function getWorkOrderDetailByWorkUnit(workorderid) {\r\n\treturn WL.Server.invokeSQLStatement({\r\n\t\tpreparedStatement : getWorkDetailStatement,\r\n\t\tparameters : [workorderid]\r\n\t});\r\n}", "title": "" }, { "docid": "502edea3da34576eb77bc9ad36ca7470", "score": "0.5841038", "text": "function getOrderById(orderItemId) {\n var orders = productService.getOrdersFromLocalStorage('orders');\n for (var i = 0; i < orders.length; i++) {\n if (orders[i].orderItemId == orderItemId) {\n return orders[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "eebf419f5c1bd1f29b2ee2a953889440", "score": "0.58351713", "text": "static async getUserOrders() {\n const res = await this.request(`orders/history`);\n return res;\n }", "title": "" }, { "docid": "8243fb5885a468c430f967845e4947bc", "score": "0.5796857", "text": "function gotoOrderDetail(id)\n {\n $state.go('app.e-commerce.orders.detail', {id: id});\n }", "title": "" }, { "docid": "511510adb5b7e8114ba5a19a8c3019bf", "score": "0.57718146", "text": "async function captureOrder(orderId, debug=false) {\n console.log(\"captureOrder orderId: \", orderId);\n try {\n const request = new checkoutNodeJssdk.orders.OrdersCaptureRequest(orderId);\n request.requestBody({});\n const response = await payPalClient.client().execute(request);\n if (debug){\n console.log(\"Status Code: \" + response.statusCode);\n console.log(\"Status: \" + response.result.status);\n console.log(\"Order ID: \" + response.result.id);\n console.log(\"Links: \");\n response.result.links.forEach((item, index) => {\n let rel = item.rel;\n let href = item.href;\n let method = item.method;\n let message = `\\t${rel}: ${href}\\tCall Type: ${method}`;\n console.log(message);\n });\n console.log(\"Capture Ids:\");\n response.result.purchase_units.forEach((item,index)=>{\n \titem.payments.captures.forEach((item, index)=>{\n \t\tconsole.log(\"\\t\"+item.id);\n });\n });\n // To toggle print the whole body comment/uncomment the below line\n console.log(JSON.stringify(response.result, null, 4));\n }\n return response;\n }\n catch (e) {\n console.log(e)\n }\n}", "title": "" }, { "docid": "53de1925eeddcc81b491265e2a56f247", "score": "0.57686913", "text": "getOrder(req, res) {\n const { id } = req.params;\n const order = OrderService.getOrder(id);\n // return status of 400 and message if order is false\n if (!order) {\n return res.status(400).json({\n message: 'The order with the ID is not found',\n error: true,\n });\n }\n // return status of 200 and data if order is true\n return res.status(200).json({\n data: order,\n message: 'success',\n error: false,\n });\n }", "title": "" }, { "docid": "08216827d49588ca43e4dbe4c231d09c", "score": "0.5768591", "text": "orderDetail(e) {\n e.preventDefault();\n if (this.state.contactNumber.length !== 10) {\n this.setState({ phErrorMessage: \"Enter 10 a digit number\" })\n }\n else {\n \n this.setState({ phErrorMessage: \"\" })\n const orderDetails = {\n \"order\": {\n \"customerId\": encryptByAES(this.state.custId),\n \"customerEmail\": encryptByAES(this.state.email),\n \"customerPhone\": encryptByAES(this.state.contactNumber),\n \"agentId\": encryptByAES(JSON.parse(decryptByAES(Cookies.get('agentData')))[0].id),\n \"orderDispatchDate\": \"123211\",\n \"orderDeliveryDate\": \"123211\",\n \"orderAmount\": this.state.total,\n \"paymentMethod\": \"COD\",\n \"address\": this.state.addressLine1,\n \"city\": this.state.city,\n \"state\": this.state.myState2,\n \"pinCode\": this.state.pincode,\n \"orderStatus\": \"PLACED\"\n },\n \"orderDetails\": this.state.itemss\n }\n\n let finalAdd = \"\", add = \"\";\n var url = Config.serverUrl + '/orders/order/orderCreate';\n\n axios.post(url, orderDetails)\n .then(\n response => {\n finalAdd = add.concat(response.data.order.address, \", \", response.data.order.city, \", \", response.data.order.state);\n this.setState({ showDetails: true, details: false, itemsss: response.data.orderDetails, orderId: decryptByAES(response.data.orderId), address: finalAdd });\n }\n )\n this.setState({ percentForProgress: 100, pageTitle: \"Order Details\" });\n }\n }", "title": "" }, { "docid": "0159b1e70f7502b26d66fcaeff0b1343", "score": "0.5764545", "text": "model(params) {\n return this.get('store').findRecord('order', params.id);\n }", "title": "" }, { "docid": "cba3e6b3f2fad607fad34b0eba6563fa", "score": "0.57577467", "text": "function getDetails(obj){\n \t\t\t\tvar deferred \t\t= $q.defer();\n \t\t\t\tvar serviceCall = commonService.Create(url+'invoices/get?patientId='+obj);\n \t\t\t\treturn serviceCall\n \t\t\t\t.success(function(response){\n \t\t\t\t\tconsole.log(response);\n \t\t\t\t\tdeferred.resolve(response);\n \t\t\t\t})\n \t\t\t\t.error(function(response){\n \t\t\t\t\tconsole.log(response);\n \t\t\t\t\tdeferred.reject(response);\n \t\t\t\t})\n \t\t\t}", "title": "" }, { "docid": "6deee15935c05b9f4cf09f1135c659aa", "score": "0.5753765", "text": "function getDetail (id) {\n return $http.get(API_INVOICE_URL + id + '/');\n }", "title": "" }, { "docid": "ab5ea706c964f506b57270e3b32839b4", "score": "0.57525724", "text": "function getCustomerDetailsTransaction(Id) {\n const requestOptions = {\n method: \"GET\",\n headers: authHeader()\n };\n return fetch(\n \"https://jddev.herokuapp.com/transaction/\" + Id,\n requestOptions\n ).then(handleResponse);\n}", "title": "" }, { "docid": "4ee1bfde892d0dc77eee7bb5016ddac6", "score": "0.57515156", "text": "function getDetails(key){\n\tvar details = store.get(key);\n\t\n\tif (typeof details === 'undefined') {\n\t\treturn undefined;\n\t} else {\n\t\treturn JSON.parse(JSON.stringify(details));\n\t}\n}", "title": "" }, { "docid": "650f4749ea8a9a4d4d8447396ce8ebd0", "score": "0.5744142", "text": "function refreshDetail(orderDetail) {\n var id = orderDetail.Product.Id;\n\n var $orderDetail = $('#item-' + id);\n var $name = $orderDetail.find('.item-name');\n var $unitPrice = $orderDetail.find('.item-unit-price');\n var $quantity = $orderDetail.find('.item-qty-ct');\n var $extendedPrice = $orderDetail.find('.item-extended-price');\n var $shipping = $orderDetail.find('.item-shipping');\n var $totalPrice = $orderDetail.find('.item-total-price');\n\n $name.text(orderDetail.Product.Name);\n $unitPrice.text('$' + orderDetail.UnitPrice.toFixed(2));\n $quantity.text(orderDetail.Quantity);\n $extendedPrice.text('$' + orderDetail.ExtendedPrice.toFixed(2));\n $shipping.text('$' + orderDetail.Shipping.toFixed(2));\n $totalPrice.text('$' + orderDetail.TotalPrice.toFixed(2));\n }", "title": "" }, { "docid": "c53b7aa5b0c54e28324bab8e20f04b6b", "score": "0.5743221", "text": "processOrder(order){\n console.log('OrderProcessor Not Implemented ProcessOrder', order.serialize());\n }", "title": "" }, { "docid": "3d8afd8fa2894b732862ebc79ab035e5", "score": "0.5710924", "text": "function getOrderStatusByOrderID(req, res) {\n orderStatusModel.find({ orderId: req.params.orderId }).exec()\n .then(function(orderStatusList) {\n res.json(orderStatusList);\n })\n .catch(function() {\n console.log(\"Error on retrieving\");\n });\n}", "title": "" }, { "docid": "a9ea451f683a8c330edb4e8a62392a75", "score": "0.56878656", "text": "function getOrderFromUI5DB(orderid){\r\n\t//Call common get order from DB method\r\n\tvar returnorder = getOrderFromDB(orderid, KEY_UI5ORDERMAP);\r\n\treturn returnorder;\r\n}", "title": "" }, { "docid": "85e0763f32c936fac9fceecc82fdfc84", "score": "0.56787914", "text": "function fetchOrders() {\n return new Promise((resolve, reject) => {\n https.get('https://services.odata.org/V4/Northwind/Northwind.svc/Orders',\n (result) => {\n var str = '';\n result.on('data', (b) => str += b);\n result.on('error', reject);\n result.on('end', () => resolve(JSON.parse(str).value));\n });\n })\n}", "title": "" }, { "docid": "b082119674c4dab7b1ef979d53339780", "score": "0.5671662", "text": "function getOrders() {\n let currentOrders = JSON.parse(localStorage.getItem('orders'));\n return currentOrders;\n}", "title": "" }, { "docid": "aa027cdc1f8594f179ad0561fccd9fe0", "score": "0.5661046", "text": "function adminCustomOrderFetchCall() {\n return request('get', urls.CUSTOM_ORDER_URL);\n}", "title": "" }, { "docid": "8ea44158929490f2b4659de4a728aafd", "score": "0.56386673", "text": "function get_updated_order(order){\n openerp.jsonRpc(\"/crm/\" + order + \"/updated_order\", 'call', {\n }).done(function(data){\n $(\"#updated_order_info_\" + order).html('<p class=\"text-center\"><b>' + data['order'].name + '</b></p><div class=\"col-md-6\"><p><b>Kund: </b>' + data['order'].partner + '</p><p><b>Datum:</b> ' + data['order'].date_order + '</p></div><div class=\"col-md-6\"><p><b>Typ:</b> ' + data['order'].order_type + '</p><p><b>3:e part:</b> ' + (data['order'].third_party_supplier != '' ? data['order'].third_party_supplier : '') +'</p></div>');\n var line_content = \"\";\n $.each(data['order_line'], function(key, info) {\n var content = '<tr><td><span class=\"text-muted\">[' + data['order_line'][key]['default_code'] + ']</span> ' + data['order_line'][key]['product'] + '</td><td>' + data['order_line'][key]['product_uom_qty'] + '</td><td>' + data['order_line'][key]['product_uom'] + '</td><td>' + data['order_line'][key]['discount'] + '</td></tr>';\n line_content += content;\n });\n $(\"#updated_order_line_\" + order).html(line_content);\n });\n}", "title": "" }, { "docid": "14c25624ecdd486fef3979f4704b103f", "score": "0.5633502", "text": "getSelectedOrder(event) {\n try{\n const action = event.detail.action;\n const row = event.detail.row;\n\n if(action.hasOwnProperty('ref')){\n if(row.hasOwnProperty('Id') && row.hasOwnProperty(action.ref)) {\n saveOrderLineItem({objId: row.Id, value: parseInt(row[action.ref]) })\n .then((result) => {\n refreshApex(this.orders);\n })\n .catch((error) => {\n console.log('In the create order Function Error: '+error); \n });\n }\n }\n } catch(error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "ff4b7e1962042033413a229520b964ab", "score": "0.56180173", "text": "async orders({ params, response }) {\n return await Order.findBy(\"maker\", params.id);\n }", "title": "" }, { "docid": "ec2d39e8cd342f4301b2eeb173741cbd", "score": "0.56095666", "text": "async orderInformation() {\r\n var getappOrderNumber = await prefConstant.getAsyncStorageValue(\r\n prefConstant.KEY_APP_ORDER_NUMBER,\r\n );\r\n\r\n // console.log('appOrderNumber', getappOrderNumber);\r\n }", "title": "" }, { "docid": "8eb324038a7d6e79211d1d09ab8f3379", "score": "0.55889153", "text": "get orderLineItem() { return this.get('orderLineItem'); }", "title": "" }, { "docid": "88437712cc17a745abe0713c9f85ac7c", "score": "0.5576555", "text": "function loadQuoteDetail(){\n\t\t\tquoteDetailFactory.loadQuoteDetailData($stateParams.RequestRevisionSK)\n\t\t\t.then(function(data){\n\t\t\t\tloadLocalQuote(data);\n\t\t\t},function(message){\n\t\t\t\tif(message == \"Service unavailable\"){\n\t\t\t\t\t//loadLocalQuote(); //disabling cache\n\t\t\t\t\t//$rootScope.logout();\n\t\t\t\t\tWL.SimpleDialog.show(\"Service Unavailable\", \"Could not fetch details. Please try again later.\", [{ text : \"OK\", handler : function() {}}]);\n\t\t\t\t}else if(message == \"no network\"){\n\t\t\t\t\tWL.SimpleDialog.show(\"Check Network Connection\", \"Could not fetch details. Please try again later.\", [{ text : \"OK\", handler : function() {}}]);\n\t\t\t\t}else{\n\t\t\t\t\tWL.SimpleDialog.show(\"Permission Denied\", message, [{ text : \"OK\", handler : function() { $state.go('quotes');}}]);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "86f954aaf4bcad34800b6ca4c8e3cda2", "score": "0.5568216", "text": "async function getOrderBook() {\n try { let orderBook = await api.getOrderBook({symbol: 'LTCBTC'})\n console.log(orderBook.data) } catch (err) {\n console.log(err)\n }\n}", "title": "" }, { "docid": "2a2d65b5fb290499b048c41b5f837d90", "score": "0.556014", "text": "orderList() {\n return this.http.get(src_environments_environment__WEBPACK_IMPORTED_MODULE_4__[\"environment\"].base_url + 'order/list');\n }", "title": "" }, { "docid": "894bb00e6bfa6a5eee34f8cfc6936565", "score": "0.5553315", "text": "async function getOrder() {\n return new Promise((resolve, reject) => {\n inquirer\n .prompt(config.orderQuestions) // which item id? how many?\n .then(function(response) {\n resolve({ id: response.id, quantity: response.quantity });\n });\n });\n}", "title": "" }, { "docid": "5d439feb9958e4bf308aaaac5dd98473", "score": "0.55472064", "text": "function ShowOrderDetails(e) {\n//\t\n//\tvar evt = window.event || e;\n// var oSrc = evt.srcElement || e.target;\n// var sType = evt.type || e.type;\n// \n //var oid = oSrc.getAttribute(\"OrderID\");\n \n var oid = ($(\"OrderID\")) ? $(\"OrderID\").value : \"0\";\n \n var url = \"order-details.aspx?oid=\" + oid;\n \n //NewWindow = window.open(url,\"_parent\",\"toolbar=yes,menubar=1,status=0,copyhistory=0,scrollbars=yes,resizable=1,location=0,Width=1100,Height=760\"); \n //NewWindow.location = url;\n \n window.location = url;\n\n}", "title": "" }, { "docid": "d08e36e28260595d743fa0d91e83fe03", "score": "0.5533862", "text": "function getUserOrder(isUser, requestStatus, service_type) {\n const requestURL = '/order/showMyOrderForUserOrWorker';\n\n const urlParams = new URLSearchParams();\n\n urlParams.append('isUser', isUser);\n urlParams.append('order_status', requestStatus);\n urlParams.append('serviceType', service_type);\n\n let getURL = requestURL + '?' + urlParams.toString();\n return fetch(getURL, {\n method: 'GET',\n credentials: 'same-origin'\n }).then(res => res.json()).catch(console.log);\n }", "title": "" }, { "docid": "e43bd9a4d00562e5dfe4d2772d669ee5", "score": "0.55338407", "text": "function getOrderInfo()\n{\n cart.thanks(\n {\n //send order url to cart module to retrieve order information\n order : $(\"#info-url\").html()\n },\n {\n success : function(res) {\n\n //display order information\n $(\"#transaction-id\").text(res[\"data\"][\"transaction_id\"]);\n $(\"#order-status\").text(res[\"data\"][\"status\"]);\n $(\"#customer-name\").text(res[\"data\"][\"customer\"][\"first_name\"] + ' ' + res[\"data\"][\"customer\"][\"last_name\"]);\n $(\"#customer-name-2\").text(res[\"data\"][\"customer\"][\"first_name\"] + ' ' + res[\"data\"][\"customer\"][\"last_name\"]);\n $(\"#ship-street\").text(res[\"data\"][\"shipping\"][\"address_street\"]);\n $(\"#ship-city\").text(res[\"data\"][\"shipping\"][\"address_city\"] + ', ' + res[\"data\"][\"shipping\"][\"address_state\"] + ', ' + res[\"data\"][\"shipping\"][\"address_zip\"]);\n $(\"#ship-country\").text(res[\"data\"][\"shipping\"][\"address_country_code\"]);\n\n addItemsToPage(res[\"data\"][\"items\"]);\n },\n error : function(err) {\n\n }\n }\n );\n}//get order info", "title": "" }, { "docid": "6e94b5f5294eb81835826a92d889b6c4", "score": "0.55284667", "text": "getOrderByOrderID(orderID){\n return http.get(`/retrieveOrderByOrderID/${orderID}`);\n}", "title": "" }, { "docid": "a31fa68243030ec02ca8b5a0f35e872c", "score": "0.550732", "text": "static async readAllOrder(req, res, next) {\n try {\n const order = await Order.findAll({\n where: {\n Status: false\n }\n })\n res.status(200).json({ order })\n } catch(err) {\n next(err)\n }\n }", "title": "" }, { "docid": "5a05e24fc6afa99edca02d15625bc80b", "score": "0.5490333", "text": "function showDetails(){\n \n let detailCont = document.querySelector('.ov-order-details-cont');\n detailCont.style.display = 'block';\n\n \n }", "title": "" }, { "docid": "48ea94c8d5da383255f3c387106edc36", "score": "0.54691976", "text": "function orderItem() {\n var item = $(this).closest(\".item\");\n var id = item.find(\".id\").val();\n console.log(\"Item ID:\", id);\n \n var order = {\n id: id\n };\n URLUtil.post(\"/api/order/add/70\", order).then(function() {\n var name = item.find(\".title\").html();\n var modal = $(\"#added-order-modal\");\n modal.find(\".name\").html(name);\n modal.modal(\"toggle\");\n }, function() {\n alert(\"Something went wrong\");\n });\n }", "title": "" }, { "docid": "ec3dbd845f36295538eed4e79133dca9", "score": "0.54630363", "text": "function getOrders(res, mysql, context, complete){\n mysql.pool.query(\"SELECT OrderHistory.orderID, orders.trackerID, OrderHistory.sender_email as sender_email, orders.recipient_email as recipient_email, GiftCards.name, orders.price as amount FROM orders LEFT JOIN OrderHistory ON orders.orderID = OrderHistory.orderID LEFT JOIN GiftCards ON GiftCards.giftCardID = orders.giftCardID\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.orders = results;\n complete();\n });\n }", "title": "" }, { "docid": "0466544810657fa9d6c6f1a9dd694ab9", "score": "0.5461687", "text": "function display_orders(req, res){\n\n}", "title": "" }, { "docid": "b23f2f21d08fb5eeabf61d089b1715dd", "score": "0.5458547", "text": "function GetItemDetails() {\n\n\n\n var promiseGet = Cart_Service.GetItemDetails();\n\n promiseGet.then(function (pl) {\n\n $scope.getItemDetailsDisp = pl.data\n\n },\n\n function (errorPl) {\n\n });\n\n }", "title": "" }, { "docid": "cd59f2eadec189b233c187ed14a0e0be", "score": "0.54499114", "text": "addDetailOrder(order) {\n return db.add(order, table_ChiTietPhieuDatHang);\n }", "title": "" }, { "docid": "4c4e5c10c4c4b8bfd7eef4b3cf4b365c", "score": "0.5441817", "text": "showOrderDetail(selected) {\n navManager.openScreen(\"OrderDetail\", selected);\n }", "title": "" }, { "docid": "6ce81270aa0e4cdf36c90a51079a0df4", "score": "0.54409343", "text": "function formatOrder(order) {\n const formatOrder = {\n method: \"POST\",\n body: JSON.stringify(order),\n headers: { \"Content-Type\": \"application/json\" },\n };\n return formatOrder;\n}", "title": "" }, { "docid": "d6d9b0cbb07e08685af8edb50fa0b223", "score": "0.54315454", "text": "async function getAllOrders(req, res) {\n let name = req.params.shopName;\n try {\n let orders = await Shop.findOne({ name: name }).populate(\"orders\");\n if (orders === null) {\n res.status(404).json({ message: `No Orders To Show` });\n } else {\n res.status(200).json(orders);\n }\n } catch (error) {\n res.status(404).json({ message: `No Orders To Show`, error: error });\n }\n}", "title": "" }, { "docid": "1049227da72a9f6713cc184157185fd8", "score": "0.54294795", "text": "static getAllOrders() {\n let orders;\n const orderData = fs.readFileSync(\n './assets/data/orders.json',\n 'utf-8',\n function (err, data) {\n if (err) {\n throw err;\n }\n return data;\n }\n );\n if (!orderData) {\n orders = [];\n } else {\n orders = JSON.parse(orderData);\n }\n return orders;\n }", "title": "" }, { "docid": "7e4e94aa373f35de3d15fb657f55dadb", "score": "0.5423346", "text": "function orderList_viewDetailedOrder(i, itemCode) {\n // hide the current wrapper which is orderList\n document.getElementById('wrapper-orderList').style.display = 'none';\n // show orderDetail wrapper\n document.getElementById('wrapper-orderDetail').style.display = 'block';\n\n // debugging\n // alert(itemCode);\n\n // determine whether the order is product or coupon\n // if item is product\n if (itemCode.indexOf('product') == 0) {\n // request the server to load product detailed data\n orderList_loadProductDetail(itemCode);\n\n // if item is coupon\n } else {\n // request the server to load product detailed data\n orderList_loadCouponDetail();\n }\n}", "title": "" }, { "docid": "ac74cfb79e1074fd2f4b943ff89c3034", "score": "0.54211825", "text": "order() {\n this.CucOrderHelperService.openExpressOrderUrl(\n this.LogsOptionsService.getOrderConfiguration(this.options.data, this.serviceName),\n );\n }", "title": "" }, { "docid": "a58c5cde1fa5c79328bc000f75ceae27", "score": "0.54211104", "text": "get order() {\n return this._order;\n }", "title": "" }, { "docid": "a58c5cde1fa5c79328bc000f75ceae27", "score": "0.54211104", "text": "get order() {\n return this._order;\n }", "title": "" }, { "docid": "f1ba450b8efaf688c46dfb319736226e", "score": "0.54201746", "text": "showDeleteOrderDetails(_od) {\n this.deleteOrderItem = _od;\n // this.deleteOrderItem.orderDetailID = _od.orderDetailID\n $(\"#confirmDeleteOrderDetailsModal\").modal('show');\n }", "title": "" }, { "docid": "6b79561970c734616e5bb6457c236f13", "score": "0.54141885", "text": "function viewOrder() {\n\tvar view = $(\".underline\");\n editItem(view, OrderList, \"listSingleOrder.html\");\n}", "title": "" }, { "docid": "a44c902f01e5ff15ee5222663beb238a", "score": "0.5413486", "text": "function getProductsByOrder(req, res, next){\n\n Order.findOne({\"_id\": req.params.order, \"user\": req.params.user}).populate({path:\"entries\", populate:{path:\"product\", model:\"Product\"}}).exec((err, order) => {\n\n if(err){\n res.status(500).json(err);\n }\n\n res.status(200).json(order.entries);\n\n });\n}", "title": "" }, { "docid": "cd18a4f7c625ff50dd66a10abacc2b72", "score": "0.53985065", "text": "async order(parent, args, ctx, info) {\n // 1. make sure they are signed in\n if (!ctx.request.userId) {\n throw new Error('You Must be signed in to view an order');\n }\n\n // 2. Create the query\n const where = {\n id: args.id,\n user: {\n id: ctx.request.userId,\n },\n };\n // 3. Fire off the query\n const [order] = await ctx.db.query.orders({ where }, info);\n\n // 4. Check that they are allowed to view the order\n if (order.user.id !== ctx.request.userId || hasPermission(ctx.request.user, ['ADMIN'])) {\n throw new Error(\"You don't have permission\");\n }\n // 5. If everything checks out, return the order\n return order;\n }", "title": "" }, { "docid": "6fc3aa05d9ba4355240dfe9007ad10f3", "score": "0.5391951", "text": "function getCompanyDetails() {\n return {\n name: 'Novi Hogeschool',\n adress: 'Zonnebaan 9, Utrecht',\n }\n}", "title": "" }, { "docid": "a60d216a843f284f102a544e1cbe430e", "score": "0.53764915", "text": "async function get_order_cust_id(cust_id)\n{\n let [err, ORDER] = await to(mysql.Orders.findAll({\n where:{\n customer_id:cust_id\n }\n }));\n\n return ORDER;\n}", "title": "" }, { "docid": "c4df9759dbbaf5bc2375f359bc3d08db", "score": "0.5375895", "text": "createInvoiceAfterPlaceOrder(order) {\n let items = {};\n order.items.forEach(item => {\n items[item.item_id] = item.qty_ordered;\n });\n let invoice = {\n order: order,\n params: {\n items: items\n }\n };\n\n invoice = this.createInvoice(invoice);\n invoice = this.register(invoice);\n /** reward point */\n if (\n RewardPointHelper.isEnabledRewardPoint()\n && order.customer_id\n && !RewardPointHelper.holdPointDay()\n ) {\n CustomerService.rewardCustomerWithPoint(\n order.customer_id,\n order.rewardpoints_earn - order.rewardpoints_spent\n );\n }\n\n return invoice.order;\n }", "title": "" }, { "docid": "7a08191652488a5764a2df4a6bf90eac", "score": "0.53622437", "text": "static async _getCustomerType(order) {\n let customer;\n\n if (order.customer_id) {\n customer = await Customer.findOne({ _id: order.customer_id });\n } else if (order.user_id) {\n customer = await Customer.findOne({ user: order.user_id });\n }\n\n return customer ? customer.type : null;\n }", "title": "" }, { "docid": "c6d67e590e1df31687c7a526c3b6b4a1", "score": "0.5347356", "text": "async getCustomerDetails() {\n if (this.model.userId) {\n let user = await User.get(this.model.userId);\n return {\n userId: user.id,\n name: user.name,\n email: user.email\n }\n } else {\n return this.model.customer;\n }\n }", "title": "" }, { "docid": "a48285165bebb10e5b791b3fd14d9cd9", "score": "0.5329692", "text": "function getOrders()\n{\n\tif(!localStorage.getItem('orders'))\n\t{\n\t\treturn;\n\t}\n\tvar recordsStr = localStorage.getItem('orders');\n\tvar records = JSON.parse(recordsStr);\n\tif(records.length < 1)\n\t{\n\t\treturn;\n\t}\n\t\n\tvar out = '';\n\tvar metaKey = '';\n\tvar trackKey = '';\n\tvar val;\n\t\n\t\t\t\n\tfor(key in records)\n\t{\n\t\tval = records[key];\n\t\tmetaKey = val.toString() + 'meta';\n\t\tout += '<br>' + key + ': ' + val + ': ' + localStorage.getItem(metaKey);\n\t}\n\t\t\n\treturn out;\n\n}", "title": "" }, { "docid": "7b6816c31462bb365a9017be088371f4", "score": "0.5328613", "text": "async DashBoardDetails(ctx, Invoice_number) {\r\n const empJSON = await ctx.stub.getState(Invoice_number); // get the asset from chaincode state\r\n if (!empJSON || empJSON.length === 0) {\r\n throw new Error(`The DashBoard ${Invoice_number} does not exist`);\r\n }\r\n return empJSON.toString();\r\n }", "title": "" }, { "docid": "2d3ab94f652e14d15cf0982eda1ff737", "score": "0.5328412", "text": "function OrderDetailsCard({\n children,\n className,\n cardTitle,\n name,\n address,\n details,\n notes,\n}: Props) {\n const cardClassName = cn(className);\n return (\n <Card className={cardClassName} title={cardTitle}>\n <Card.Body>\n <Media className=\"mb-5\">\n <Media.Body>\n {name && <Header.H5>{name}</Header.H5>}\n {address && (\n <address class=\"text-muted small\">\n {address.line1}\n {address.line2 && <br />}\n {address.line2}\n </address>\n )}\n </Media.Body>\n </Media>\n {details && (\n <Grid.Row>\n {details.map((d, i) => (\n <Grid.Col width={6} key={i}>\n <Header.H6>{d.title}</Header.H6>\n <p>{d.content}</p>\n </Grid.Col>\n ))}\n </Grid.Row>\n )}\n {notes}\n {children}\n </Card.Body>\n </Card>\n );\n}", "title": "" }, { "docid": "967ce89eb20c6372ce7d619b06989786", "score": "0.5325551", "text": "function orders() {\n return fetch(url).then(r => r.json());\n}", "title": "" }, { "docid": "92b82ff1183e0f013bec759784cd7839", "score": "0.53239185", "text": "function fnFormatDetails(order_id){\r\n var sOut = '<table class=\"table table-striped table-bordered dTableR\" id=\"order_detail\">';\r\n sOut += '<thead><tr><th class=\"center\">ORIGEN</th><th class=\"center\">DESTINO</th><th class=\"center\">VOLUMEN</th><th class=\"center\">PESO</th><th class=\"center\">DISTANCIA</th><th class=\"center\">ACCI&Oacute;N</th></tr></thead><tbody>';\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"module/shipment/crud/shipment.php\",\r\n async: false,\r\n data: \"action=detail&order=\"+ order_id,\r\n success: function (response) {\r\n sOut += response; \r\n } \r\n });\r\n sOut += '</tbody></table>';\r\n return sOut;\r\n }", "title": "" }, { "docid": "7bf2876980b40ecee5cb637180c5847b", "score": "0.53182596", "text": "get order() {\n\t\treturn this._order;\n\t}", "title": "" }, { "docid": "a42630b90f4cee2a224c4ab0667979d5", "score": "0.5317074", "text": "function getTodoItem(req, res, next) {\n var todoItemID = req.params.id;\n\n r.table('orders').get(todoItemID).run(req.app._rdbConn, function(err, result) {\n if(err) {\n return next(err);\n }\n\n res.json(result);\n });\n}", "title": "" }, { "docid": "b7a7d43ac808a430ca30025224359bc1", "score": "0.5312342", "text": "function getAccountDetails() {\n return client.account().then(data => data.body.account);\n}", "title": "" }, { "docid": "43c94122cd6caebc2a2f36fa89fbeb5c", "score": "0.531153", "text": "function Order(address, payment, orderdetails) {\n if (address instanceof Address) {\n this.address = address;\n }\n if (payment instanceof Payment) {\n this.payment = payment;\n }\n if (orderdetails instanceof OrderDetails) {\n this.orderdetails = orderdetails;\n }\n}", "title": "" }, { "docid": "61320d69841c9b7dbb50281907c6cb15", "score": "0.5304977", "text": "async info() {\n const result = await this.doRequest({\n path: \"/info\",\n method: \"GET\",\n params: {\n details: this.params.details,\n },\n });\n return result;\n }", "title": "" }, { "docid": "3ad72cf23dbc709029f6770b107a26fd", "score": "0.5301037", "text": "createOrder(data){\r\n return getApiClient().post('/orders',data)\r\n }", "title": "" } ]
bb881b5c29b60721043f7f6362c58037
uses geolocation to get the coords of the user's location
[ { "docid": "0d992c3e287bb34449437d4c08922582", "score": "0.73515385", "text": "getLocation() {\n if (navigator.geolocation) {\n window.navigator.geolocation.getCurrentPosition(\n (position) => this.getLocationSuccess(position),\n (error) => this.getLocationError(error)\n );\n }\n }", "title": "" } ]
[ { "docid": "f57d7947dc634ca173cd482fd85946bc", "score": "0.78578836", "text": "function getCoords() {\n function success(position) {\n var clientLat = position.coords.latitude;\n var clientLon = position.coords.longitude;\n passCoords(clientLat, clientLon);\n };\n\n function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n };\n\n navigator.geolocation.getCurrentPosition(success, error);\n }", "title": "" }, { "docid": "c5db00c2da30a268bc2798e4f759f51e", "score": "0.7807988", "text": "function getLocation() {\n\t\tvar options = {\n\t\t\tenableHighAccuracy : true,\n\t\t\ttimeout : 5000,\n\t\t\tmaximumAge : 0\n\t\t};\n\t\tnavigator.geolocation.getCurrentPosition(displayLocation, handleError, options) //get the coordinates and display them\n\n\t}", "title": "" }, { "docid": "1cd75df15b67cfc857662574c9a539c6", "score": "0.7781348", "text": "function getLocation() {\n\n if (navigator.geolocation) {\n\n // Calls show position to get coordinates which are set in locationStats variable to be saved as last location\n navigator.geolocation.getCurrentPosition(showPosition);\n\n }\n }", "title": "" }, { "docid": "10d123ac0e43bc7ce27a1e129196b870", "score": "0.7735647", "text": "function getGeolocationCoords (event) {\n navigator.geolocation.getCurrentPosition(getLocationWeather);\n}", "title": "" }, { "docid": "b549a00865fcb2ded7cedd86fe2b7b20", "score": "0.77029693", "text": "function getCoordinates() {\n navigator.geolocation.getCurrentPosition(function(position) {\n var coordinates = [position.coords.latitude, position.coords.longitude];\n\n getTemp(coordinates);\n reverseGeocode(coordinates);\n $('#geolocation').show();\n $('#coords').html(coordinates.join(', '));\n },\n function(error) {\n $('#geolocation').html(error.message + ' :(');\n $('#geolocation').show();\n });\n}", "title": "" }, { "docid": "2ca31ccc7b6747fa5b2122434087ce30", "score": "0.76772225", "text": "function getLocation() {\n\tif(navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(geoPosition, geoError, {enableHighAccuracy:true, timeout:30000, maximumAge:60000 }\n);\n\t} else {\n\t\tgeoError();\n\t}\n}", "title": "" }, { "docid": "f203beed7296b080844facd1f15931e7", "score": "0.7676432", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(function(position) {\n return position.coords.latitude + \";\" + position.coords.longitude;\n })\n}", "title": "" }, { "docid": "b384e996b7c96091c396d5952cc63e9f", "score": "0.7655027", "text": "function getUserLocation() {\n if (navigator.geolocation) {\n // run the getCurrentPosition function, which takes a callback and receives the position object as an argument\n navigator.geolocation.getCurrentPosition(geolocationAllowed, geolocationDenied);\n }\n }", "title": "" }, { "docid": "035a85b34185e121eebad3a9f164ef43", "score": "0.76534003", "text": "function getLocation() {\n if (navigator.geolocation)\n\tnavigator.geolocation.getCurrentPosition(formatLocation);\n}", "title": "" }, { "docid": "ae2a899d29cdbcfafcd1250486cd6a3b", "score": "0.7639912", "text": "function getLocation() {\r\n if (typeof navigator !== \"undefined\" && typeof navigator.geolocation !== \"undefined\") {\r\n //log(\"Asking user to get their location\");\r\n navigator.geolocation.getCurrentPosition(function (loc) {\r\n \tlat = loc.coords.latitude\r\n \tlon = loc.coords.longitude\r\n \tquery()\r\n \tlastLocUpdateEl.innerText = \"Location updated: \" + new Date().toLocaleTimeString()\r\n }, errorHandler);\r\n } else {\r\n //log(\"Your browser does not support the HTML5 Geolocation API, so this demo will not work.\")\r\n }\r\n}", "title": "" }, { "docid": "a6eca7d135919a728d7f7c5562a1adb2", "score": "0.7627784", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(\n (data) => {\n latAndLong = `${data.coords.latitude},${data.coords.longitude}`\n }, \n (error) => {\n console.log('An error happened...', error);\n }\n )\n }", "title": "" }, { "docid": "2dd8b3d35855222badc0c1399a896bf5", "score": "0.7627383", "text": "getLocation () {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(this.getCoordinates);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "f984f2e397677cd96d1118cd07957466", "score": "0.7587332", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n latitude = 31.426577;\n longitude = 34.381131;\n }\n}", "title": "" }, { "docid": "a9ca759b48253f8fbb78f4588af5b1db", "score": "0.7585452", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showPosition, showError);\n\t} else {\n\t\tconsole.log(\"Seu browser não suporta Geolocalização.\")\n\t}\n\n\tinitMap(userPosition);\n}", "title": "" }, { "docid": "73215dbc30b3442ec767348765a4cb95", "score": "0.75504476", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showPosition, showError);\n\t} else {\n\t}\n}", "title": "" }, { "docid": "e3cff54c02fd90afbe9833bbfb73e15f", "score": "0.7545716", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setLocation);\n }\n}", "title": "" }, { "docid": "ece919c78ccaba07f7ef4b1eb17151ee", "score": "0.7543061", "text": "function getLocation() {\n\t \tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(setPosition);\n\t \t} \n\t}", "title": "" }, { "docid": "c06725930b6e7265aa1791137ce1ad79", "score": "0.7514357", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "title": "" }, { "docid": "8efcc76a2738266d0ba6bd69125ec7bd", "score": "0.751131", "text": "function getLocation(location) {\n lat = location.coords.latitude;\n lng = location.coords.longitude;\n pos = new google.maps.LatLng(location.coords.latitude, location.coords.longitude);\n getVenuesByGeo();\n }", "title": "" }, { "docid": "2092cd577276616747b172a5225b6674", "score": "0.7510334", "text": "getCurrentLoc() {\n if (!navigator.geolocation) alert(\"Geolocation is not supported by this browser.\"); return;\n\n navigator.geolocation.getCurrentPosition((position) => {\n return [position.coords.longitude, position.coords.latitude]\n })\n }", "title": "" }, { "docid": "8459d17840642215da0c102db4fdcaba", "score": "0.7500754", "text": "function getLocation() {navigator.geolocation.getCurrentPosition(success, error);\n\t\t}", "title": "" }, { "docid": "7585077dd5fbcfb21c13e0e28192f96d", "score": "0.7494826", "text": "async getCoords(){\n await window.navigator.geolocation.getCurrentPosition(\n position => this.setState({ lat: position.coords.latitude, \n lng: position.coords.longitude}),\n error => this.setState({ errorMessage:error.message }).then(()=> {\n })\n );\n console.log('Coordinates examined!')\n }", "title": "" }, { "docid": "948ab82dd99c306059755ae1ec2e50d4", "score": "0.7488181", "text": "getUserLocation() {\n navigator.geolocation.getCurrentPosition(position => {\n const userPosition = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n this.onUserLocationSuccess(userPosition);\n }, () => {\n console.error('There was an error retrieving the geolocation…');\n this.onUserLocationError();\n });\n }", "title": "" }, { "docid": "71887cce06127554987cf53d8c45fd36", "score": "0.74865896", "text": "function getCoords() {\n // check if browser has geolocation\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition( function(position) {\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n getWeather(lat, lon);\n },\n // display error if geolocation disabled\n function (error) { \n if (error.code == error.PERMISSION_DENIED)\n $('#error').html('Geolocation is not supported by this browser.');\n });\n } else {\n // display error if geolocation disabled on website and console\n console.log('error');\n $('#error').html('Geolocation is not supported by this browser.');\n }\n }", "title": "" }, { "docid": "829f4a21374c11cb030f9bf9781741d1", "score": "0.7485161", "text": "function getLocation() {\n return new Promise((resovle, reject) => {\n let coord = {};\n window.navigator.geolocation.getCurrentPosition(\n e => {\n coord.x = e.coords.longitude;\n coord.y = e.coords.latitude;\n resovle(coord);\n },\n err => reject(err)\n );\n });\n}", "title": "" }, { "docid": "d75394e97c3cfd697980ee8aa9abf5ce", "score": "0.7484203", "text": "function getLocation(){\n navigator.geolocation.getCurrentPosition(findLocation, showError, {enableHighAccuracy:true,maximumAge:600000})\n}", "title": "" }, { "docid": "6350b36fc7765f3d84faef8fd58f161f", "score": "0.7484182", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(success, error, options);\n}", "title": "" }, { "docid": "0ad3b65c7bbfdd6f2aeec3929ffe4e56", "score": "0.74404246", "text": "function getGEOLocation(){\n if(Modernizr.geolocation)\n navigator.geolocation.getCurrentPosition(geoSuccess, geoError, {timeout:10000,enableHighAccuracy:true});\n else\n geoFallback();\n}", "title": "" }, { "docid": "e6853a9c07764d9157579c6e8a943f5e", "score": "0.74380106", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n }", "title": "" }, { "docid": "5eaec7b5a1e437a5c285d69f66854727", "score": "0.7432396", "text": "function getUserLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getCityName);\n } else {\n //console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "c625d9f2efd4a05bc16a97d2dcc25d73", "score": "0.74280876", "text": "function getCurrentLocation(){\n\t\tnavigator.geolocation.getCurrentPosition(geoSuccess, geoFailure);\n\n\t function geoSuccess(e) {\n\t console.log(e)\n\t my_location = e.coords;\n\t var location = new Google.maps.LatLng(my_location.latitude, my_location.longitude);\n\t return location;\n\t // loadItems(); <-- loadItems now called after login\n\t }\n\n\t function geoFailure() {\n\t \talert(\"Unable to access your geolocation\");\n\t }\n \t}", "title": "" }, { "docid": "490f13a638970b5114c7a688f68e2ffb", "score": "0.7418027", "text": "function getGeoLocation() {\n Buildfire.geo.getCurrentPosition(\n null,\n function (err, position) {\n if (err) {\n console.error(err);\n }\n else if (position && position.coords) {\n $scope.$apply(function () {\n WidgetFilter.locationData.currentCoordinates = [position.coords.longitude, position.coords.latitude];\n localStorage.setItem('user_location', JSON.stringify(WidgetFilter.locationData.currentCoordinates));\n WidgetFilter.refreshData += 1;\n });\n }\n else {\n getGeoLocation();\n }\n }\n );\n }", "title": "" }, { "docid": "f2b6db4fd66924bd82b7d80fb3d44fea", "score": "0.7415182", "text": "function getUserLocation() {\n if (navigator.geolocation) {\n geoMode = true\n navigator.geolocation.getCurrentPosition(locationSuccess)\n } else {\n alert('ERROR: Unable to use geolocation API')\n }\n}", "title": "" }, { "docid": "14a1e9b76819fc074717f942f6888af6", "score": "0.74065644", "text": "function getGeolocation(){\r\n // Try HTML5 geolocation\r\n if(navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var pos = new google.maps.LatLng(position.coords.latitude,\r\n position.coords.longitude);\r\n // console.log('lat : '+position.coords.latitude + ' ; lng : '+position.coords.longitude);\r\n setGeoLocation(position.coords.latitude,position.coords.longitude);\r\n }, function() {\r\n handleNoGeolocation(true);\r\n });\r\n } else {\r\n // Browser doesn't support Geolocation\r\n handleNoGeolocation(false);\r\n }\r\n}", "title": "" }, { "docid": "2cd8f5330e7b1c637e3d32f067c99a0b", "score": "0.7396282", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n //Function to save localisation data\n function(position){\n \t\tu_lat = position.coords.latitude;\n \t\tu_lon = position.coords.longitude; \n \t\taccepted = true;\t\n }, \n //Function to print error in case it doesn't work\n function(error) {\n\t\t\t switch(error.code) {\n\t\t\t case error.PERMISSION_DENIED:\n\t\t\t alert(\"User denied the request for Geolocation.\");\n\t\t\t break;\n\t\t\t case error.POSITION_UNAVAILABLE:\n\t\t\t alert(\"Location information is unavailable.\");\n\t\t\t break;\n\t\t\t case error.TIMEOUT:\n\t\t\t alert(\"The request to get user location timed out.\");\n\t\t\t break;\n\t\t\t case error.UNKNOWN_ERROR:\n\t\t\t alert(\"An unknown error occurred.\");\n\t\t\t break;\n\t\t\t }\n\t\t\t}\n\t\t);\n } else { \n alert(\"Geolocation is not supported by this browser.\");\n }\n\n}", "title": "" }, { "docid": "f4b4a059e0f4dc54115aeeb3a5a33d27", "score": "0.7383773", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setPosition, handleError);\n }\n console.log('getLocation ran');\n }", "title": "" }, { "docid": "eb2d3c4e913b47152242a167cef851c0", "score": "0.7383436", "text": "function getLocation(){\n function success(position){\n lon = position.coords.longitude;\n lat = position.coords.latitude;\n //Update HTML with current user city using Google geocode map API\n displayLocation(lat, lon);\n //With updated long/lat values, grab weather API data using FCC Weather API\n getDateTime();\n //getWeather();\n }\n\n function failure(position){\n return;\n }\n\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(success, failure);\n }\n}", "title": "" }, { "docid": "37cc8517e153eb8b518801d02c0e9474", "score": "0.73820436", "text": "getUserLocation() {\n const self = this;\n const success = (pos) => {\n self.setState({ userCoords: { lat: pos.coords.latitude, lng: pos.coords.longitude} });\n };\n\n function error(err) { console.warn(`ERROR(${err.code}): ${err.message}`); };\n navigator.geolocation.getCurrentPosition(success, error);\n }", "title": "" }, { "docid": "9852ac44876cb7867ec22ce854e23d58", "score": "0.737519", "text": "function getMyLocation()\n{\n\tif (navigator.geolocation) { // the navigator.geolocation object is supported on your browser\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\tlatLoc = position.coords.latitude;\n\t\tlongLoc = position.coords.longitude;\n\t\trenderMap();\n\t\t});\n\t}\n\telse {\n\t\talert(\"Geolocation not supported, sorry!\");\n\t}\n}", "title": "" }, { "docid": "8a08c71f9b6b87f663429ccfa5a77946", "score": "0.73723626", "text": "function userLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getPosition, showError);\n\n }\n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "bd5e19c3575c418bd3233edfab2a8f4a", "score": "0.73549235", "text": "function getUserGeoLoc(cb) {\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(function(pos) {\n\t\t\t\tvar userLat = pos.coords.latitude;\n\t\t\t\tvar userLng = pos.coords.longitude;\n\t\t\t\tvar usersLocationObject = {\n\t\t\t\t\tuserLatLng: {\n\t\t\t\t\t\tuserLatitude: userLat,\n\t\t\t\t\t\tuserLongitude: userLng \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcb(usersLocationObject) ;\n\t\t\t}) ;\n\t\t} else {\n\t\t\t//Pass in a null object to the callback => no user marker will be added\n\t\t\tcb(null) ;\n\t\t}\t\n\t}//getUserGeoLoc()", "title": "" }, { "docid": "45a6485ae759f0e2d3f47feda4c8b680", "score": "0.7353174", "text": "function getCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function(position) {\n state.userLocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n geocodeSuccess();\n },\n function() {\n handleLocationError(true, infoWindow, map.getCenter());\n }\n );\n } else {\n alert(\n `Geolocation wasn't successful, try searching for your location instead.`\n );\n }\n}", "title": "" }, { "docid": "e9df5964284c55355e043317c5fb4ef8", "score": "0.73386526", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition1);\n } else {\n return;\n }\n}", "title": "" }, { "docid": "682d7b698a40f7cd6d707d797e023898", "score": "0.73334527", "text": "function getMyLocation() {\n if (navigator.geolocation) { \n navigator.geolocation.getCurrentPosition(function(position) {\n myLat = position.coords.latitude;\n myLng = position.coords.longitude;\n renderMap();\n getData();\n });\n }\n else {\n alert(\"Geolocation is not supported by your web browser.\");\n }\n}", "title": "" }, { "docid": "57aea4fe595d379c24baee43c4fb95f2", "score": "0.7320098", "text": "function getLocation() {\r\n navigator.geolocation.getCurrentPosition(showPosition);\r\n function showPosition(position) {\r\n console.log(\"latitude: \" + position.coords.latitude); //To check if the location is get by the server\r\n console.log(\"longitude: \" + position.coords.longitude);\r\n sendLocation(position.coords.latitude, position.coords.longitude);\r\n }\r\n}", "title": "" }, { "docid": "576020934f236385a3b0dc07b7ba24f7", "score": "0.7303888", "text": "function getLocation() {\n\t// Get browser Geolocation\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition( function(position) {\n\t\t\t// Set position to the browser's location\n\t\t\tpos = {\n\t\t\t\tlat: position.coords.latitude,\n\t\t\t\tlng: position.coords.longitude\n\t\t\t};\n\n\t\t\tlocationLogged = true;\n\t\t\t// return pos;\n\t\t}, function() {\n\t\t\thandleLocationError(true, infoWindow, map.getCenter());\n\t\t});\n\t}\n\telse {\n\t\t// Browser doesn't support Geolocation\n\t\thandleLocationError(false, infoWindow, map.getCenter());\n\t}\n}", "title": "" }, { "docid": "c8df69a5487517af765ea9a5be93294a", "score": "0.7303161", "text": "function getLocation() {\n if (navigator.geolocation) {\n //Return the user's longitude and latitude on page load using HTML5 geolocation API\n navigator.geolocation.getCurrentPosition(getCurrentLocation);\n } else {\n //If Geolocation is not supported by the browser, alert the user\n alert(\"Masz wyłączoną geolokalizację. Wpisz nazwę miejscowości lub włącz geolokalizację!\");\n }\n }", "title": "" }, { "docid": "78f441aada6f507d6b28da087889e8ba", "score": "0.73011166", "text": "function getCurrentCoords(){\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n usersPosition = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n placeMarker(usersPosition,'This is me!',map);\r\n try{\r\n localStorage.removeItem('myCoords');\r\n }\r\n catch{}\r\n localStorage.setItem('myCoords',JSON.stringify(usersPosition));\r\n }, function() {\r\n console.log('');\r\n });\r\n } else {\r\n // Browser doesn't support Geolocation\r\n console.log('Browser doesnt support Geolocation.');\r\n }\r\n}", "title": "" }, { "docid": "c43c011268905fe156a8f0c3046a6cab", "score": "0.72972035", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(loadMap);\n } else {\n console.error(\"Geo location not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "f46a7918d64114011d4345c2b969edb3", "score": "0.729379", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getUserPosition, handleLocationAccessError);\n } else {\n response = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "f46a7918d64114011d4345c2b969edb3", "score": "0.729379", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getUserPosition, handleLocationAccessError);\n } else {\n response = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "8e3d0d93715c13f66f09238742526426", "score": "0.7290006", "text": "function getLocation()\n {\n if (geoPosition.init()) {\n\t\tgeoPosition.getCurrentPosition(success, error);\n\t}\n}", "title": "" }, { "docid": "cdb1c887b5a0715d11dbc3238305cc91", "score": "0.72856843", "text": "function findByCoords(){\n\tsearchBar.classList.remove('focused')\n\tif(navigator.geolocation){\n\t\tnavigator.geolocation.getCurrentPosition((data)=>{\n\t\t\tconst {coords: {latitude: lat,longitude: lon}} = data;\n\t\t\tconst url = `https://eu1.locationiq.com/v1/reverse.php?key=pk.f129abed2b7d229581d6dc9f0e9e3dbe&lat=${lat}&lon=${lon}&format=json`\n\t\t\tgetGeoData(url)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "8e718fd328f9ff10842bd4e3b8008bb3", "score": "0.7282051", "text": "function getMyLocation() {\n\tif (navigator.geolocation) { //checks if there is geolocation in the browser\n\t\tnavigator.geolocation.getCurrentPosition( //runs the 2 functions below and error\n\t\t\tdisplayLocation,\n\t\t\tdisplayError,\n\t\t\toptions);\n\t}\n\telse {\n\t\talert(\"Oops, no geolocation support\");\n\t}\n}", "title": "" }, { "docid": "99f62447dddc656ea36e1aebdf873e11", "score": "0.7276866", "text": "function getCurrentLocation(){\n navigator.geolocation.getCurrentPosition(updateLocation,handleLocationError);\n}", "title": "" }, { "docid": "285a7d25993cf2691cd0b4a9baa5fe19", "score": "0.72673357", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(displayLocation, displayError);\n }\n else {\n alert(\"Sorry, this browser doesn't support geolocation!\");\n }\n }", "title": "" }, { "docid": "b8a2a2795915a20a98591e3496736d46", "score": "0.7264397", "text": "geoLocate() {\n\t\tconst qs = getQueryParams();\n\t\tconst options = {\n\t\t\tenableHighAccuracy: true,\n\t\t\ttimeout: 5000,\n\t\t\tmaximumAge: 0,\n\t\t};\n\t\tconst onSuccess = position => {\n\t\t\tconst { coords } = position;\n\t\t\tthis.lat.value = coords.latitude;\n\t\t\tthis.lng.value = coords.longitude;\n\t\t\tthis.form.submit();\n\t\t};\n\t\tconst onError = error => {\n\t\t\tconsole.warn( `Error ${ error.code }: ${ error.message }` );\n\t\t};\n\t\tif ( navigator.geolocation && ! ( qs.lat && qs.lng ) ) {\n\t\t\tnavigator.geolocation.getCurrentPosition( onSuccess, onError, options );\n\t\t}\n\t}", "title": "" }, { "docid": "69d0d82f912a9f300ea2626498c4eeeb", "score": "0.7249012", "text": "function getLocation(){\n {\n if (navigator.geolocation)\n\n {\n var options = {\n enableHighAccuracy: true,\n timeout: 5000,\n maximumAge: 0\n };\n navigator.geolocation.getCurrentPosition( initMap, error, options);\n }\n else\n { x.innerHTML= \"Geolocation is not supported by this browser.\"; }\n }\n}", "title": "" }, { "docid": "a3ebe46a0fc514e3183552a02d1caeac", "score": "0.7237567", "text": "function getLocation() {\n if (navigator.geolocation) {\n // console.log(navigator)\n // depende de la respuesta del usuario\n navigator.geolocation.getCurrentPosition(showPosition, showError);\n\n } else {\n console.log('Geolocation is not suported by this browser')\n }\n}", "title": "" }, { "docid": "128a27edf2dc36bc4ec9d95a682f97e1", "score": "0.7228749", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n\n }", "title": "" }, { "docid": "d2168bf0a57c91c3d1db3495741a90a2", "score": "0.7216537", "text": "function getLocation() {\n if (navigator.geolocation) {\n console.log(\"got location\");\n navigator.geolocation.getCurrentPosition(setPosition);\n } else { \n console.log(\"didn't got location\");\n setLocations(false);\n }\n}", "title": "" }, { "docid": "b62147a59f90204107f0e2bf50fbfd8d", "score": "0.7216521", "text": "function getMyLocation() {\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(displayLocation);\n } else {\n alert('Oops, no geolocation support');\n }\n }", "title": "" }, { "docid": "86a049d137ce684b3656795b3d44c5bf", "score": "0.7216444", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(usePosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "title": "" }, { "docid": "a7061e3591201785ec4463d5762c60a5", "score": "0.72092307", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, areError);\n } else {\n window.alert(\"Location information is not availiable\");\n return;\n }\n}", "title": "" }, { "docid": "3790d84de560b6d9b0e23d10322bfc80", "score": "0.72085834", "text": "function getLocation() {\n if (navigator.geolocation) {\n // showPosition is a reference to a JS function (below)\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "title": "" }, { "docid": "370367e0a211e6cf0258e80e0b75d48e", "score": "0.71946454", "text": "function getLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "39be389311d6f78c7e722d2a9ad319bc", "score": "0.7185421", "text": "function getLocation(){\n\t$.locationError.visible = false;\n\t\n\t//Check if Location Services is Enabled/Disabled\n\tif (Titanium.Geolocation.locationServicesEnabled == false) {\n\t\t//notify user that location services is disabled\n\t\tgpsDialog.show(); \n\t\t//return;\n\t}else{\n\t\n\t//get the location - UTM\n\tvar utm = require('utm');\n\t\t\tutm.LatLngToUTMRef(current_latitude, current_longitude, function(UTMEasting, UTMNorthing, longitudeZone) {\n\t\t\t\n\t\t\tutmEasting = UTMEasting;\n\t\t\tutmNorthing = UTMNorthing;\n\t\t\tutmZone = longitudeZone;\n\t\t\t\n\t\t\tif(utmZone.toString() == \"NaN\"){\n\t\t\t\tltemaAccessDialog.show();\n\t\t\t}else{\n\t\t\t\t$.location.visible = true;\n\t\t\t\t$.location.text = \"UTM Zone: \" + utmZone + \"\\nUTM Easting: \" + UTMEasting + \"\\nUTM Northing: \" + UTMNorthing + \"\\nAccuracy: \" + Math.round(current_accuracy);\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "4e1a6fc35917d731993a1c5ac36a244e", "score": "0.7172702", "text": "function getUserLocation() {\n //TODO: update url once implemented at backend\n if (!isLocationRequested && userLocationDeferred.state() !== 'resolved') {\n isLocationRequested = true;\n $.post(locationAPIUrl).done(function(response) {\n if (response) {\n location = {\n latitude: response.location.lat,\n longitude: response.location.lng\n };\n }\n userLocationDeferred.resolve(location);\n }).fail(function(fail) {\n userLocationDeferred.reject(fail);\n });\n }\n return userLocationDeferred.promise();\n }", "title": "" }, { "docid": "82198d3472487a2580574dcbc80012a4", "score": "0.7164164", "text": "function getLocation() {\n // Make sure browser supports this feature\n if (navigator.geolocation) {\n\n // Provide our showPosition() function to getCurrentPosition\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "b242db4d8ac25d35992f103da94ac98a", "score": "0.71628016", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(showPosition);\r\n } else {\r\n console.log(\"Geolocation is not supported by this browser.\");\r\n }\r\n}", "title": "" }, { "docid": "201e006e3f3d4bdf2f1ab00d57c22e0b", "score": "0.71618223", "text": "function getLocation() {\n if (navigator.geolocation) {\n //get location through browser (asks user with a prompt)\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n //if browser doesn't support location services\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "826fae206bb2bb2e8f1c30df86e595fe", "score": "0.71608007", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n // console.log(showPosition);\n } else {\n alert(\"This site requires geolocation to be shared.\");\n }\n }", "title": "" }, { "docid": "4f6ba667248c321524e6aaf0c75ee787", "score": "0.7157934", "text": "function getLocation() {\n\tif(navigator.geolocation)\n\t{\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\tvar lat = position.coords.latitude;\n\t\t\tvar long = position.coords.longitude;\n\t\t\tgetLocationForecastData(lat, long);\n\t\t\tgetLocationWeatherData(lat, long);\n\t\t});\n\t}\n\telse\n\t{\n\t\t$(\"#errormessage\").html = \"<p>GeoLocation not supported.</p>\";\n\t}\n}", "title": "" }, { "docid": "184d20b568c406f23a6f16b5ddbc0ccf", "score": "0.7152547", "text": "function getMyLocation() {\n\tif (navigator.geolocation) { // the navigator.geolocation object is supported on your browser\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\tmyLat = position.coords.latitude;\n\t\t\tmyLng = position.coords.longitude;\n\t\t\tchangeMap()\n\t\t});\n\t}\n\telse {\n\t\talert(\"Geolocation is not supported by your web browser. What a shame!\");\n\t}\n}", "title": "" }, { "docid": "e9f7ba0bb245e7150130dcd29ca31543", "score": "0.71488166", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(initMap);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "dd6daeb5953de6294f9f91802b50b3d6", "score": "0.7147668", "text": "function getLocation() {\n // Coniditional statement to make sure browser supports geolocating feature\n if (navigator.geolocation) {\n // Provide our showPosition() function to getCurrentPosition\n navigator.geolocation.getCurrentPosition(showPosition);\n } \n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "d227ff7a4be5960eea3c7df24bb6f1f7", "score": "0.7142161", "text": "function getLocation() {\n if (navigator.geolocation) {\n // if the browser and user allow it, get their location data, and try to call createMap(). If they allow it but it doesn't work, call showError(). If they don't allow it, show the \"not supported\" message. \n navigator.geolocation.getCurrentPosition(createMap, showError);\n } else {\n mapDiv.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "title": "" }, { "docid": "4022404f16c545979dcecf3adcd6b726", "score": "0.7141528", "text": "function getCoords() {\n\t// Call to an IP service geolocation\n\t// Pass the response to getDataByCoords function\n\t$.getJSON(\"https://freegeoip.net/json/\", getDataByCoords);\n}", "title": "" }, { "docid": "e07019871c0ea84848fff502acfbf532", "score": "0.71377563", "text": "function getCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n alert(position.coords.latitude + \",\"+ position.coords.longitude);\n })\n }\n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "6413182d6543c35bf9114e5d9a0daf4b", "score": "0.71356136", "text": "function getLocation() {\r\n\t\t\tif (navigator.geolocation) {\r\n\r\n\t\t\t\tnavigator.geolocation.getCurrentPosition(showPosition,\r\n\t\t\t\t\t\tfunction(error) {\r\n\t\t\t\t\t\t\tif (error.code == 1) {\r\n\t\t\t\t\t\t\t\talert('Y U NO GIVE LOCATION?');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tx.innerHTML = \"Geolocation is not supported by this browser.\";\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "8fb7acc2e8272156032ace1c0db6e0c4", "score": "0.71349", "text": "function get_loc(){\n navigator.geolocation.getCurrentPosition(onSuccess, onError);\n // closest_stop();\n}", "title": "" }, { "docid": "a91d98070b195bbad07bf809c709fcc4", "score": "0.71269995", "text": "function getLocation() {\n\tvar success = function (position) {\n\t\tlocations.push(position.coords);\n\t\t//if we are running, calculate the distance\n\t\tif(running){\n\t\t\tvar distance = calculateDistance(locations).toFixed(3) + \"km\";\n\t\t\t$(\"#distance .value\").text(distance);\n\t\t}\n\t};\n\tvar error = function (error) {\n\t\talert('Error getting geolocation: ' + error.message);\n\t};\n\tvar options = {\n\t\tenableHighAccuracy: true,\n\t\ttimeout: 5000,\n\t\tmaximumAge: 0\n\t};\n\n\tif (navigator.geolocation) {\n\t\treturn navigator.geolocation.watchPosition(success, error, options);\n\t} else {\n\t\talert(\"Geolocation is not supported by this browser\");\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "575da4eb9a0453e6c006da692582b293", "score": "0.712201", "text": "function getCurrentLocation() {\n var success = function (pos) {\n CURRENT_LATITUDE = pos.coords.latitude; //52.2318259011373;\n CURRENT_LONGITUDE = pos.coords.longitude; //0.90169273743436;\n //console.log(\"CURRENT_LATITUDE :\" + CURRENT_LATITUDE + \":>>>>CURRENT_LONGITUDE: \" + CURRENT_LONGITUDE);\n // findWithinRadious(curr_lat,curr_long);\n\n };\n var fail = function (error) {\n //console.log(\"Error getting geolocation: code=\" + error.code + \" message=\" + error.message);\n };\n navigator.geolocation.getCurrentPosition(success, fail);\n}", "title": "" }, { "docid": "4e1c81d09f58fb8b106672b464ef676b", "score": "0.71159893", "text": "function get_location() {\n\t\tif (Modernizr.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(identify_state);\n\t\t\tconsole.log('It ran modernizr');\n\t\t} else {\n\t\t\t// no native support; maybe try a fallback?\n\t\t\tconsole.log('It didnt run modernizr');\n\t\t}\n\t}", "title": "" }, { "docid": "f03c5ea9e85363424fe56219d475964a", "score": "0.7109932", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(setLocation)\r\n\r\n } else {\r\n let error = \"Unable to locate you.\"\r\n alert(error)\r\n }\r\n}", "title": "" }, { "docid": "6fe10031a9331ea834527d663ef21df1", "score": "0.71088326", "text": "async function getLocation() {\n if (\"geolocation\" in navigator) {\n navigator.geolocation.getCurrentPosition(async function (position) {\n const latitude = position.coords.latitude;\n\n const longitude = position.coords.longitude;\n\n const coords = await fetch(`/api/location`, {\n method: \"POST\",\n body: JSON.stringify({\n latitude,\n longitude,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n });\n } else {\n }\n}", "title": "" }, { "docid": "2e8b8d6040bb372e402a6411db34db31", "score": "0.7098847", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(logLocation);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "7bf945a6331c33b8e5e4e8ae5ba1de95", "score": "0.709395", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.watchPosition(showPosition);\r\n map.flyTo({\r\n center: [lng, lat]\r\n });\r\n }\r\n}", "title": "" }, { "docid": "72882b45f0f5458e6f306ac2a8fb2cfb", "score": "0.7090965", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "514d8716b66ccac75a8708eecc8cdde7", "score": "0.7090805", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, showError);\n } else {\n x.innerHTML = \"Geolocation is not supported by your browser.\";\n }\n}", "title": "" }, { "docid": "92c01ceac4b9551b066ae1b6b0f1a358", "score": "0.70844346", "text": "function showCoord() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(success, failure)\r\n } else {\r\n console.log(\"Sorry no geolocation device on your machine\");\r\n }\r\n}", "title": "" }, { "docid": "bef2e5841d8cfec819b3a0bc62892e4c", "score": "0.7066089", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n else {\n console.log(\"Geolocation is not supported by this browser\");\n }\n}", "title": "" }, { "docid": "e18c7065aaca680db1987c06c17928d1", "score": "0.70624936", "text": "function getGeoLoc(){\n navigator.geolocation.getCurrentPosition(function(position){\n viewModel.updateLoad();//set loading screen\n var myLoc = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n console.log(position);\n geoRun = true; //turn on georun.\n //update geoloc with geolocation data to prepare for service search. \n locations.geoLoc.location = myLoc;\n //run a latLng based search on the new location. \n service.nearbySearch(locations.geoLoc, genData);\n });\n viewModel.updateLoad();//remove loading screen\n }", "title": "" }, { "docid": "0f9d01f7c20e609de021faa969f44c5d", "score": "0.7062218", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n city = \"Your Location\";\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n getWeather();\n }, function (error) {\n if (error.code == error.PERMISSION_DENIED) {\n city = \"Seattle\"\n createCityBtn();\n getLatandLon();\n }\n });\n }\n}", "title": "" }, { "docid": "80df55d7de6a098c96849683cd0e0712", "score": "0.70601815", "text": "function getLocation() {\n // Make sure browser supports this feature\n if (navigator.geolocation) {\n // Provide our showPosition() function to getCurrentPosition\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "200720ffed15cb7d604b4e5c857cb260", "score": "0.7054767", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "1af6d1c600dd4ff46309fdd731918ee2", "score": "0.70537025", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(sendLocation);\n } else {\n console.error('Unable to read current location');\n }\n }", "title": "" }, { "docid": "4f5e7d474398f681a987d19ea63794ec", "score": "0.705277", "text": "function geoLocation (success){\r\n\tnavigator.geolocation.getCurrentPosition(function(data){\r\n\t\tvar lat = data.coords.latitude;\r\n\t\tvar long = data.coords.longitude;\r\n\t\tsuccess(lat, long);\r\n\t}, \r\n\tfunction(){\r\n\t\tchangeStatus(\"You either denied access to your location or something went wrong. Please try to use the search feature instead.\");\r\n\t});\r\n}", "title": "" }, { "docid": "4deaa1da2ea08b3ce9a78ede6905ff83", "score": "0.7050322", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n else { \n x.innerHTML = \"Geolocation is not supported by this browser.\";\n $('#edit-field-user-location-0-value-wrapper').after(\"<em><span id='user_loc'><b>User Location:</b> Geolocation is not supported by this browser </span></em>\");\n }\n}", "title": "" }, { "docid": "237dc0ca7b8c16f9e122abb63c41720d", "score": "0.70425767", "text": "function getLocation() { \n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(sendPosition);\n console.log(\"Getting Location\");\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" } ]
bf3e9a4de6cf77471f264d91aebd6101
Cleaning the input form after user entered wrong
[ { "docid": "ff983a0545af7d1bd713d6162fab79bc", "score": "0.0", "text": "function cleanSplit() { \n\n var delay1 = 1300; //2second\n var delay2 = 3000; //2second\n\n setTimeout(function () {\n document.getElementById(\"res_split\").innerHTML = \"Try again\";\n }, delay1);\n\n setTimeout(function () {\n document.getElementById(\"res_split\").innerHTML = \"\";\n }, delay2);\n\n}", "title": "" } ]
[ { "docid": "4a523c3b172b582bb682cf916f4dcf6e", "score": "0.7224092", "text": "function handleCleanInputs(event) {\n setFormObject({\n courseName: \"\",\n courseHours: \"\",\n burnHours: \"\",\n synopsis: \"\",\n subId: sub,\n checked:false\n });\n }", "title": "" }, { "docid": "bebb3bb9c610ff602f5e3deb1a4b9d2e", "score": "0.7103491", "text": "function cleanform() {\n\n $('input').val(null);\n $('textarea').val(null);\n }", "title": "" }, { "docid": "af6009e89b05a400d85cf47381e6f55e", "score": "0.6893198", "text": "function cleanFields() {\n inputUSD.value = \"\";\n inputLemon.value = \"\";\n}", "title": "" }, { "docid": "4d0fb56dce0e42e834927607b5d35f58", "score": "0.6775285", "text": "function cleanInputs () {\n temporaryBooks.innerHTML = \"\";\n inputTitle.value = \"\";\n inputAuthor.value = \"\";\n inputYear.value = \"\";\n inputPages.value = \"\";\n inputRate.value = \"\";\n inputImage.value = \"\";\n inputRead.checked = true;\n}", "title": "" }, { "docid": "a2eb0299238abffdcc72e52b881caa6a", "score": "0.6589379", "text": "function cleanInput() {\r\n if (vm.event.partnerType === 'None') {\r\n delete vm.event.partnerName;\r\n }\r\n if (vm.event.frequency == 'once') {\r\n delete vm.event.startDate;\r\n delete vm.event.endDate;\r\n delete vm.event.dates; \r\n delete vm.event.weeklyDates; \r\n \r\n } else if (vm.event.frequency == 'dates') {\r\n delete vm.event.weeklyDates; \r\n delete vm.event.startDateTime;\r\n delete vm.event.endDateTime;\r\n if (typeof vm.event.dates == 'undefined' || vm.event.dates.length === 0) {\r\n addOccurrenceDateRow();\r\n }\r\n } else if (vm.event.frequency == 'weekly') {\r\n delete vm.event.dates; \r\n delete vm.event.startDateTime;\r\n delete vm.event.endDateTime;\r\n if (typeof vm.event.weeklyDates == 'undefined' || vm.event.weeklyDates.length === 0) {\r\n addWeeklyOccurrenceRow();\r\n }\r\n }\r\n \r\n if (vm.event.freeEvent === 'Yes') {\r\n delete vm.event.cost;\r\n }\r\n if (!vm.isSportsSelected) {\r\n delete vm.event.sportsSubcategory;\r\n } \r\n if (vm.event.orgType !== 'Other') {\r\n delete vm.event.orgTypeOther;\r\n }\r\n \r\n /* make sure there is at least one location, this will then get caught in validations */\r\n if (vm.event.locations.length === 0) {\r\n addLocation();\r\n }\r\n \r\n if (vm.event.admin.newsletterCategory && vm.event.admin.newsletterCategory.length > 0 ) {\r\n if (vm.event.admin.newsletterCategory[0].value !== \"Attractions/Happenings\" && vm.event.admin.newsletterCategory[0].value !== \"Sports\" ) {\r\n vm.event.admin.newsletterSubcategory = [];\r\n } \r\n\r\n }\r\n if (vm.uploader.queue.length > 0) { \r\n if (!vm.event.image || _.isEmpty(vm.event.image.binId)) {\r\n sweetAlert(\"Image Problem\",\"The event image was not properly uploaded. Either upload the image or remove it.\");\r\n $scope.ecForm.$setValidity(\"badImage\", false);\r\n } else {\r\n $scope.ecForm.$setValidity(\"badImage\", true);\r\n }\r\n } else if (vm.event.image && _.isEmpty(vm.event.image.binId)) {\r\n delete vm.event.image;\r\n } \r\n\r\n \r\n }", "title": "" }, { "docid": "1202de0dc8e8b30b31359e63b461802a", "score": "0.65548474", "text": "function cleanForm2(){\n \t$('#alicTypeName').val(\"\");\n $('#alicTypeUse').val(\"\");\n $('#alicTypeTemp').val(\"\");\n $('#aliObs').val(\"\");\n $('#aliVol').val(\"\");\n \t}", "title": "" }, { "docid": "03e93f1067187a0c9cd94d0f0de8f9e1", "score": "0.64754575", "text": "function cleanForms() {\n setEmail(\"\");\n setPassword(\"\");\n setNewPassword(\"\");\n setConfirmNewPassword(\"\");\n }", "title": "" }, { "docid": "0b02e8db0a288e4a28af9629d54fc082", "score": "0.6387677", "text": "function clean(){\n document.form.textveiw.value=\"\";\n}", "title": "" }, { "docid": "1ae1da5a53c7c98c50e143181cfe5766", "score": "0.63168615", "text": "function cleanup() {\n // Clear the innerHTML for error_message and hide the error div.\n document.getElementById(\"error_message\").innerHTML = \"\";\n \n // Clear error formatting that might be left over from a bad submit\n var listofelements = document.getElementsByClassName(\"isVisible\");\n \n // Set all error \"*\" to notVisible. i is not incremented because as the \n // elements' classes are changed the are automatically removed from the \n // listofelements.\n for(var i = 0; i < listofelements.length; ) {\n // Ignore the security answer when hiding all the error spans\n if(listofelements[i].classList.contains(\"noCleanup\")) {\n // If we skip an element we must increment i to move to the next\n // element. This also prevents us from getting stuck in the loop.\n ++i;\n continue;\n }\n listofelements[i].className = \"notVisible\";\n }\n listofelements = document.getElementsByTagName(\"input\");\n for(var i = 0; i < listofelements.length; ++i) {\n // ignore the buttons when clearing <input> formatting\n if(listofelements[i].classList.contains(\"button\")) {\n continue;\n }\n listofelements[i].style.backgroundColor = \"white\";\n }\n}", "title": "" }, { "docid": "97ee44dbc37e6213a3639464ac9c23dd", "score": "0.62270606", "text": "function clearForm() {\n\t\thide('fuelOilInput');\n\t\thide('rdxFuelOil');\n\t\thide('propaneInput');\n\t\thide('rdxPropane');\n\t\thide('natGasThermsInput');\n\t\thide('rdxNgt');\n\t\thide('natGasft3Input');\n\t\thide('rdxNgf');\n\t\thide('electricityInput');\n\t\thide('rdxElectric');\n\t\thide('step4');\n\t\thide('rdxResults');\n\t\thide('compareResults');\n\t\treturn true;\n\t}", "title": "" }, { "docid": "8b3e8e84c18cea804d41dec80c173086", "score": "0.61756265", "text": "function cleanApplicationFields(){\n\tvar errKeys = [\"err_email\",\"err_pw\", \"err_retrieve\", \"err_secret1\", \"err_secret\", \"err_newemail\"];\n\tfor (var i = 0; i < errKeys.length; i++) {\n\t\tvar element = document.getElementById(errKeys[i]);\n\t\tif(element!=null){\n\t\t\telement.innerHTML = \"\";\t\t\n\t\t\tif(element.parentNode.className == \"error\") {\n\t\t\t\telement.parentNode.className = \"\";\n\t\t\t}\n\t\t} \n\t}\t\n\t\n\t$r(\"span#secretQuestionSection\").hide();\n\t$r(\"div.retrieveblock\").hide();\n\t$r(\"input[name=retrieve]\").removeAttr(\"readonly\"); \n\t\n\tvar appFields = [\"email\", \"pw\", \"retrieve\", \"secretAnswer1\", \"secretAnswer2\", \"newemail\"];\n\tfor (var i = 0; i < appFields.length; i++) {\n\n\t\tvar element = document.getElementById(appFields[i]);\n\t\tif(element!=null){\n\t\t\telement.value = \"\";\t\t\t\t\n\t\t}\n\t}\n\t\n\tvar labelFields = [\"label_secretQuestion1\", \"label_secretQuestion2\"];\n\tfor (var i = 0; i < labelFields.length; i++) {\n\n\t\tvar element = document.getElementById(labelFields[i]);\n\t\tif(element!=null){\n\t\t\telement.innerHTML = \"\";\t\t\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "aa990eb244e42fe2c3a70c444d4f2dfd", "score": "0.61626214", "text": "function clean() {\n $scope.form = null;\n }", "title": "" }, { "docid": "cf9c590de24b54a5cd6633eceb1bb809", "score": "0.61553013", "text": "function clean() {\r\n\r\n document.getElementById(\"output2\").value = '' ;\r\n \r\n}", "title": "" }, { "docid": "7ac1715afc70272c1c95f3085839e410", "score": "0.6117162", "text": "function cleanEditCard(){\n var entryName = document.getElementById('card-cred-name');\n var user = document.getElementById('card-cred-username');\n var pass = document.getElementById('card-cred-password');\n var conf = document.getElementById('card-cred-conf-password');\n if(pass){\n if(pass.classList.contains('is-invalid')){\n pass.classList.remove('is-invalid');\n }\n pass.value = '';\n }\n if(conf){\n if(conf.classList.contains('is-invalid')){\n conf.classList.remove('is-invalid');\n }\n conf.value = '';\n }\n if(entryName){\n entryName.value = '';\n }\n if(user){\n user.value = '';\n }\n document.getElementById('pass-gen-out').value = '';\n}", "title": "" }, { "docid": "4fcea188162c5e568d74af7f74413c11", "score": "0.6112522", "text": "function clearForm() {\n initBackgroundColor();\n let inputBoxes = getInputBoxes();\n (inputBoxes.mission).value = \"\";\n (inputBoxes.date).value = \"\";\n (inputBoxes.time).value = \"\";\n return;\n}", "title": "" }, { "docid": "88f4accd1a41de316c58e0823e5b982d", "score": "0.6100971", "text": "function cleanForm() {\n $(\"#txtOT\").val('');\n $(\"#txtTextoFiltro\").val('');\n $('#MainContent_cmbReportero').val(0);\n $('#MainContent_cmbPrograma').val(0);\n $('#MainContent_cmbSeccion').val(0);\n $('#MainContent_cmbPais').val(0);\n $('#cmbEstado').val(0);\n $('#cmbCiudad').val(0);\n $(\"#txtFechaIni\").datepicker(\"setDate\", new Date());\n $(\"#txtFechaFin\").datepicker(\"setDate\", new Date());\n \n $(\"#MainContent_ChkNotaTerminada\").val(false);\n $(\"#MainContent_ChkMaterialenBruto\").val(\"false\");\n $(\"#txtNumeroCinta\").val('');\n $('#MainContent_cmbAgencia').val(0);\n $(\"#txtOT\").val('');\n \n Palabraclave = $(\"#txtPalabraClave\").val('');\n\n\n $('input[type=checkbox]').each(function () { this.checked = false; });\n $('input[type=Text]').each(function () { this.checked = false; });\n }", "title": "" }, { "docid": "804507baad9b320a777217609b60908e", "score": "0.60694045", "text": "function clean(){\n\tvar inputBox = document.getElementById(\"inputBox\");\n\tinputBox.value = \"\";\n\tinputBox.focus();\n}", "title": "" }, { "docid": "944795077098bd844c384bfd3ca7f872", "score": "0.60510814", "text": "function onInput(event) {\n\t\t\t\tutils.setHTML('#form-error', \"\");\n\t\t\t\tif(event.target.name === 'name') {\n\t\t\t\t\tutils.setHTML('#name .error', \"\");\n\t\t\t\t} else if(event.target.name === 'nameAlpha') {\n\t\t\t\t\tutils.setHTML('#nameAlpha .error', \"\");\n\t\t\t\t} else if(event.target.name === 'birth') {\n\t\t\t\t\tutils.setHTML('#birth .error', \"\");\n\t\t\t\t} else if(event.target.name === 'death') {\n\t\t\t\t\tutils.setHTML('#death .error', \"\");\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "2ed81d5a085d1c58065397a21c3496e1", "score": "0.6037139", "text": "function clearInputAndDisplayHelp() {\r\n disableInputFields();\r\n _data.Route.element.value = \"\";\r\n _data.Direction.element.value = \"\";\r\n _data.Stop.element.value = \"\";\r\n validateAndSetCode(\"Route\", \"\");\r\n validateAndSetCode(\"Direction\", \"\");\r\n validateAndSetCode(\"Stop\", \"\");\r\n enableInputFields();\r\n return;\r\n}", "title": "" }, { "docid": "63cd83e5b8b4864e6c714e71a7ffbdd5", "score": "0.603565", "text": "function resetUserInput() {\n // Return all variables to original values for a new search\n breweryCity = \"\";\n breweryState = \"\";\n breweryPostal = \"\";\n breweryName = \"\";\n breweryType = \"\";\n breweryTags = \"\";\n queryURL = \"https://api.openbrewerydb.org/breweries?\";\n\n // Clear user form values\n $(\"#by_city\").val();\n $(\"#by_state\").val();\n $(\"#by_postal\").val();\n $(\"#by_name\").val();\n $(\"#by_type\").val();\n $(\"#by_tags\").val();\n\n // Clear dynamically created results\n $(\"#brewery_results\").empty();\n}", "title": "" }, { "docid": "12c7344bf3f5ec4fc90310b02bd8e37f", "score": "0.6026978", "text": "function clickToClean() {\n setFirstName(\"\");\n setLastName(\"\");\n setMail(\"\");\n setPassword(\"\");\n setAddress(\"\");\n setPostalCode(\"\");\n setCity(\"\");\n }", "title": "" }, { "docid": "84022e2079ffc5b1230d65d050b2afdd", "score": "0.60234433", "text": "function cleanAddressFields() {\n $('#yearsInput').val('');\n $('#monthsInput').val('');\n $('#addressInput').val('');\n $('#postcodeInput').val('');\n $('#postcodeInput').attr('disabled', false);\n $('#postcodeInput').removeClass('form-fieldset__input--disabled');\n $('#addressFieldset').remove();\n }", "title": "" }, { "docid": "a902a63542a91182ba74f3188234ee3d", "score": "0.59827846", "text": "function cleanQuestion(){\n $(\"#question\").html('');\n $(\"#list-choices\").html('');\n }", "title": "" }, { "docid": "a2f1e943ac1f637748c541cc6300294d", "score": "0.597951", "text": "function cleanData (){\n document.getElementById(\"num\").value = \"\" ;\n }", "title": "" }, { "docid": "f81f220d222f4bbfc963a5a9d8373661", "score": "0.59762776", "text": "function cleanModalInputs(){\n var clean = \"\";\n $('#dni').val(clean);\n $('#name').val(clean);\n $('#surname').val(clean);\n $('#address').val(clean);\n $('#city').val(clean);\n $('#country').val(clean);\n $('#phone').val(clean);\n $('#mail').val(clean);\n}", "title": "" }, { "docid": "876f5a6984b68b4ca71361d291039642", "score": "0.59592724", "text": "function cleanInput (input) {\n doLog('cleanInput',input);\n return $('<div/>').text(input).text();\n }", "title": "" }, { "docid": "c1b707157cafb5b0301ba74484b6e93f", "score": "0.5930718", "text": "cleanInputs() {\n this.setState(this.getDefaultState());\n }", "title": "" }, { "docid": "a3a4954914cf033e1a225ebbe1ba5fd5", "score": "0.59234625", "text": "clearForm() {\n this.nameInput.current.value = '';\n this.hoodList.current.value = this.hoodList.current.firstChild.value;\n this.descInput.current.value = '';\n this.emailInput.current.value = '';\n this.urlInput.current.value = '';\n this.phoneInput.current.value = '';\n this.streetInput.current.value = '';\n this.cityInput.current.value = 'Seattle';\n this.stateInput.current.value = 'Washington';\n this.zipInput.current.value = '';\n }", "title": "" }, { "docid": "d7035d7501126d6de03c99e16ea383c8", "score": "0.59001094", "text": "_clearForm() {\n \n this._inputDate.value = '';\n this._inputDescription.value = '';\n this._inputCost.value = null;\n this._inputDate.focus();\n\n }", "title": "" }, { "docid": "c5fb847d7556724b4a6e644c3aa3e213", "score": "0.58779067", "text": "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "title": "" }, { "docid": "7e455325ac7ca5a8a8ac21339bba51af", "score": "0.5875886", "text": "function input() {\n const question = document.getElementById('question')\n const answer = document.getElementById('answer')\n const questionInput = question.value\n const answerInput = answer.value\n if(doesNotPassAllValidations(questionInput, answerInput)){\n return null\n }\n data.questions.push([questionInput, answerInput])\n question.value = null\n answer.value = null\n storeLocal()\n}", "title": "" }, { "docid": "243295e1ec6a147267108f3a96660a65", "score": "0.5867012", "text": "function clearForm(){\n document.getElementById(\"inputCommand\").value = '';\n document.getElementById(\"inputDescription\").value = '';\n document.getElementById(\"commandError\").style.display = 'none';\n document.getElementById(\"descriptionError\").style.display = 'none';\n }", "title": "" }, { "docid": "a6176ba54ca9a7fc9695ae4ff5de7af7", "score": "0.5865772", "text": "function processForm() {\n const formData = {\n nickname: $('#nickname').val(),\n zipcode: $('#zipcode').val(),\n units: $('input[name=units]:checked').val(),\n coldMax: Number($('#coldmax').val()),\n hotMax: Number($('#hotmax').val()),\n };\n\n // Validating the fields before submission again JUST IN CASE\n if (formData.hotMax > formData.coldMax && NICKNAME_REGEX.test(formData.nickname) && ZIP_REGEX.test(formData.zipcode)) {\n return formData;\n }\n Materialize.toast('Input error!', 3000, 'deep-orange darken-4');\n } // END processForm", "title": "" }, { "docid": "2bbedf013f31717db27b4c9e03021316", "score": "0.5857857", "text": "function cleartext() {\n if (textField.value = \"\") {\n textField.value = \"\"\n }\n }", "title": "" }, { "docid": "f567dceeb60bbd3c92118bacbc63963c", "score": "0.58530086", "text": "function clean(){\n document.getElementById('inputNumberDisplay').value = '';\n}", "title": "" }, { "docid": "8ced478709b05fbb4959b741bd65aa89", "score": "0.5852331", "text": "function _cleanUpForm() {\n $('.conditional-fields').each(function(index, field) {\n field.removeAttribute(\"disabled\");\n })\n $(\"#book-form\").trigger('reset');\n form.reset();\n }", "title": "" }, { "docid": "574814bd7d988c24125254b95a778427", "score": "0.5846246", "text": "function cleanTextBoxes(){\n document.getElementById(\"playerName\").value = \"\";\n document.getElementById(\"playerID\").value = \"\";\n document.getElementById(\"playerPair\").value = \"\";\n\n document.getElementById(\"rPlayerName\").value = \"\";\n document.getElementById(\"rPlayerID\").value = \"\";\n\n document.getElementById(\"nameSug\").innerHTML = \"\";\n document.getElementById(\"nameSug\").style.height = \"0px\";\n document.getElementById(\"nameSug\").style.visibility = \"hidden\";\n}", "title": "" }, { "docid": "5a465cc0681a7b1a9d5e29b6d12fd8da", "score": "0.5839788", "text": "function cleanInput () {\n document.getElementById(\"field-numbers\").value = \"\";\n}", "title": "" }, { "docid": "4113ab58fc3a8c6aa1f6e8f5293364ae", "score": "0.5836509", "text": "handleCancel() {\n\t\t$(\"#studentName\").val('');\n\t\t$(\"#studentCourse\").val('');\n\t\t$(\"#studentGrade\").val('');\n\t\treturn;\n\t}", "title": "" }, { "docid": "65ae95a6b6efb44ff527fab94cf63761", "score": "0.58215564", "text": "function clearForm() {\n self.newStudent.FirstName('');\n self.newStudent.LastName('');\n self.newStudent.YearEnrolled('');\n self.newStudent.DateOfBirth('');\n self.newStudent.Email('');\n }", "title": "" }, { "docid": "b5fa18d1071c9720dfaf4ea6b439ae83", "score": "0.5821149", "text": "function cleanAllFields(){\n emailField.val('');\n usernameField.val('');\n cleanPasswordFields();\n }", "title": "" }, { "docid": "cfc3575ade05475425bf72f636c2e1cb", "score": "0.58179104", "text": "vaildInput(){\n document.querySelector('button').addEventListener('click',()=>{\n \n if(bill.value === \"\" || people.value === \"\"){\n window.alert('Fill is empty')\n }\n else if(bill.value <= 0 ||people.value <= 0){\n window.alert(\"Invaild value\");\n this.resetForm();\n }\n else{\n this.billResult()\n this.resetForm();\n }\n })\n }", "title": "" }, { "docid": "5d0e8e94eb58b07d6ac8d04f3749c89a", "score": "0.5816006", "text": "function validation () {\n nomPrenom(inputFirst, resultFirst)\n nomPrenom(inputLast, resultLast)\n mail(inputEmail, resultEmail)\n nomPrenom(inputMessage, resultMessage)\n}", "title": "" }, { "docid": "a42533c3a9aee1d771c49e59ebace2be", "score": "0.58144265", "text": "function hideErrors() {\n\t\t\t\t/*\n\t\t\t\t * Declare the inputs and the content\n\t\t\t\t */\n\t\t\t\tvar inputUser = $('#username');\n\t\t\t\tvar inputPass = $('#password');\n\t\t\t\tvar inputContent;\n\n\t\t\t\t/*\n\t\t\t\t * If username input is clear\n\t\t\t\t */\n\t\t\t\tinputUser.on('input', function(event) {\n\t\t\t\t\tinputContent = event.currentTarget.value;\n\t\t\t\t\tif (inputContent.length > 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$scope.errorMessage = '';\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "796ff3ced57524ef7a5a9769393f693e", "score": "0.58070475", "text": "function clearForm() {\n $('#search-event, #search-city, #search-state, #search-zipcode').val('');\n $('.validation').remove();\n }", "title": "" }, { "docid": "bcd262960069ef924a2b15d9ef792ecd", "score": "0.58058727", "text": "function removeQueryValidations() {\n \n $('#myform').removeClass('has-error');\n $('span#form-help').remove();\n\n $('#author-group').removeClass('has-error');\n $('span#author-help').remove();\n\n $('#players-group').removeClass('has-error');\n $('span#players-help').remove();\n\n $('#hashtags-group').removeClass('has-error');\n $('span#hashtags-help').remove();\n\n $('#keywords-group').removeClass('has-error');\n $('span#keywords-help').remove();\n}", "title": "" }, { "docid": "57eb69049904b8e1f6f0623ac3df5b71", "score": "0.5803428", "text": "function cleanup (target, val) {\n\t \tif ($(target).find('input').length > 0) { $(target).find('input').remove(); }\n\t\t$(target).html(val);\n\t }", "title": "" }, { "docid": "4a809bc78e9ef6ed5ac739fcc69abbb4", "score": "0.5796025", "text": "function clickToClean() {\n setTitleInput(\"\");\n setDesc(\"\");\n setBrand(\"\");\n setPrice(\"\");\n setShippingFees(\"\");\n setAge(\"\");\n setAge(\"\");\n setCatName(\"\");\n setSubCatName(\"\");\n setSelectedValueState(false);\n setDisplaySubCat([]);\n }", "title": "" }, { "docid": "05f8c944df8e9d2f2075c71dc68def4a", "score": "0.57943094", "text": "function cleanForm1(){\n \t$(\"#rackCode\").select2('data',null);\n $(\"#rackCode\").empty();\n\t\t\t\t$(\"#boxName\").select2('data',null);\n\t\t\t\t$(\"#boxName\").empty();\n\t\t\t\t$('#boxStudy').val(\"\");\n\t\t\t\t$(\".grid\").empty();\n \t}", "title": "" }, { "docid": "b5399856e14478be1f64c804ca1f94ac", "score": "0.5794077", "text": "function prepForm() {\n //console.log(\"Calling prepForm()\");\n $(\".entry-form input[type=text]\").removeClass(\"error\");\n $('.terms-conditions').removeClass('terms-error');\n $('.form-errors').hide();\n $('#firstname').val(fbUser.first_name);\n $('#surname').val(fbUser.last_name);\n $('#email').val(fbUser.email);\n $('.terms-conditions input[type=checkbox]').prop('checked', false);\n}", "title": "" }, { "docid": "ebd53c017d50cba3bb9a3b15dcd9db40", "score": "0.57919383", "text": "function removeAllErrors(form){\n\t\t//required onlyLetters required email input_img password required validmobile \n\t\tvar parent = null;\n\t\t$(\".error\").each(function(){\n\t\t\t$(this).removeClass(\"error\");\n\t\t\tparent = $(this).parent();\n\t\t\tparent.find(\".error\").text(\"\");\n\t\t});\n\n\t}", "title": "" }, { "docid": "e47e876fa811070baee703dbdcd6721d", "score": "0.57884437", "text": "static clearFormFields() {\n document.documentElement.style.overflow = \"visible\"; // allow scrollability again\n formTitle.value = \"\";\n formAuthor.value = \"\";\n formReadPages.value = \"\";\n formTotalPages.value = \"\";\n formError.innerHTML = \"\";\n formContainer.style.display = \"none\";\n }", "title": "" }, { "docid": "714dc63280c09eaea9874ecaf6d016f7", "score": "0.57882327", "text": "function clean_adress_form() {\n $(\"#street\").val(\"\");\n $(\"#district\").val(\"\");\n $(\"#states\").html('<option value=\"\"></option>');\n $(\"#cityID\").html('<option value=\"\"></option>');\n }", "title": "" }, { "docid": "994dd8f1fca67727de23f5dacfd9f504", "score": "0.5787773", "text": "function clearInputBoxes(){\n assignedByInput.value = null\n descriptionInput.value = null\n assignedToInput.value = null\n dueDateInput.value = null\n}", "title": "" }, { "docid": "c6183e5a32b32183dc8dcebc2a1bcd19", "score": "0.57852286", "text": "function resetFormInputs() {\n // Remove any server validation responses\n $(\".error\").empty();\n\n // Clear form inputs\n $(\"#score-form\")[0].reset();\n }", "title": "" }, { "docid": "26b5855d9cb462072150e526e74d2a59", "score": "0.57804805", "text": "function reset() {\n document.getElementsByClassName('error-message')[0].innerHTML = \"\";\n document.getElementById('userInput').value = \"\";\n document.getElementById('tacocatResults').innerHTML = \"\";\n}", "title": "" }, { "docid": "80101a0b981443ffec5c978dc52c1ef3", "score": "0.5780146", "text": "function scrubForm(form){\n Object.keys(form).forEach(k => (!form[k] && form[k] !== undefined) && delete form[k]);\n console.log('Clean: ',form);\n return form;\n }", "title": "" }, { "docid": "10fa5852695a921efc99837b0917aa7a", "score": "0.5779549", "text": "function verifyWhat(){\n var whatinfo = [];\n var valid =true;\n\n var inputs = document.body.querySelector('article.what').querySelectorAll('input');\n\n for(var i=0;i<inputs.length;i++){\n whatinfo.push(inputs[i].value);\n }\n\n if(valid){\n for(var i=0;i<inputs.length;i++){\n inputs[i].value=null;\n }\n return whatinfo;\n }\n else{\n return false;\n }\n\n\n}", "title": "" }, { "docid": "1eec972c6280236a007aed6290cf70b9", "score": "0.5774777", "text": "clearInputFields() {\n\n\t\tthis.titleInput.value = '';\n\t\tthis.bodyInput.value = '';\n\n\t}", "title": "" }, { "docid": "5cf09221545284deabdf4631570735db", "score": "0.57681775", "text": "function cleanAdicionalData() {\n $(\"#cedula\").val(\"\");\n $(\"#primerNombre\").val(\"\");\n $(\"#segundoNombre\").val(\"\");\n $(\"#primerApellido\").val(\"\");\n $(\"#segundoApellido\").val(\"\");\n $(\"#radioPrimerNombre\").prop('checked', true);\n $(\"#radioSegundoNombre\").prop('disabled', true);\n $(\"#cupoOtorgado\").val(\"\");\n $(\"#sexo\").val($(\"#sexo option:first\").val());\n $(\"#parentesco\").val($(\"#parentesco option:first\").val());\n $(\"#fechaNacimiento\").val(\"\");\n $(\"#observaciones\").val(\"\");\n $(\"#estadoCivilAdicional\").val($(\"#estadoCivilAdicional option:first\").val());\n $(\"#nacionalidadAdicional\").val(\"\");\n}", "title": "" }, { "docid": "d2f3b0f1d44b6dc8653fa789b5a0781f", "score": "0.5763889", "text": "function limpiar(input) {\r\n input.each(function() {\r\n //Limpiamos los campos\r\n input.val('');\r\n //Removemos las clases utilizadas en el validar\r\n input.removeClass(\"is-valid\", \"is-invalid\")\r\n })\r\n }", "title": "" }, { "docid": "3acaac6a4e6ec913a6fb005578ee19ad", "score": "0.5763151", "text": "function processGuess() {\n let userGuess = document.getElementById(\"userGuessBox\").value; // Get value from text box\n document.getElementById(\"userGuessBox\").value = null; // Clear text box\n try { // Try to process user input and update game state and display,\n userGuess = cleanGuess(userGuess); // functions that do not throw exceptions are here to\n updateLettersGuessed(userGuess); // not be triggered if user input is incorrect\n updateWordStatus(userGuess);\n updateGameDisplay();\n } catch (e) { // Catch execptions, display error\n userGuess = 'error';\n console.log(e.message, e.name);\n }\n}", "title": "" }, { "docid": "7574c3e33a0ab475d4cf30faecf5ecb7", "score": "0.575433", "text": "function resetMainUi(event) {\n if (event.target.value === \"random\" || event.target.value === \"categories\") {\n inputField.value = \"\";\n if (emptyTextError) {\n emptyTextError.remove();\n emptyTextError = null;\n }\n }\n if (event.target.value === \"random\" || event.target.value === \"search\") {\n let activeCategory = categoriesWrapper.querySelector(\".is-active\");\n if (activeCategory) {\n activeCategory.classList.remove(\"is-active\");\n categoryJokeUrl = \"\";\n }\n if (emptyCategoryError) {\n emptyCategoryError.remove();\n emptyCategoryError = null;\n }\n }\n}", "title": "" }, { "docid": "a9f62e4506561807d79c1fd6106bb14c", "score": "0.57448757", "text": "function checkFields() \r\n{\r\n\t//Variables to check to see if user inputted valid information.\r\n\tvar Name = document.myInfoForm.name.value;\r\n\tvar state = document.myInfoForm.state.value;\r\n\tvar carMake = document.getElementById(\"company\").value;\r\n\tvar errorList = document.getElementById(\"errorText\");\r\n\t//I added this regular expression to make sure user inputs only letters in field boxes. \r\n\tvar regExp = /^[a-zA-Z]#/;\r\n\t\r\n\t//Used try-catch to make sure user inputted valid information in text boxes.\r\n\ttry {\r\n\t\t\tif(Name == \"\" || specialChar.test(Name) || regExp.test(Name)) \r\n\t\t\t{\r\n\t\t\t\tthrow \"Please fill in the name entry with correct characters.\";\r\n\t\t\t\tformValidity = false;\r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tdocument.getElementById(\"name2\").innerHTML += Name;\r\n\t\t\t}\r\n\t\t\tif(state == \"\" || specialChar.test(state) || regExp.test(Name)) \r\n\t\t\t{\r\n\t\t\t\tthrow \"Please fill in the state entry with correct characters.\";\r\n\t\t\t\tformValidity = false;\r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tdocument.getElementById(\"state2\").innerHTML += state;\r\n\t\t\t}\r\n\t\t\tif(carMake == \"\") \r\n\t\t\t{\r\n\t\t\t\tthrow \"Please choose a car make.\";\r\n\t\t\t\tformValidity = false;\r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tdocument.getElementById(\"company2\").innerHTML += carMake;\r\n\t\t\t}\r\n\t\t}\r\n\tcatch(msg) {\r\n\t\t\terrorList.innerHTML = msg;\r\n\t} \r\n}", "title": "" }, { "docid": "c6039dc07b41393ce3848cf17cf57b60", "score": "0.5741747", "text": "function clickToClean() {\n setMail(\"\");\n setPassword(\"\");\n }", "title": "" }, { "docid": "4e0aad8acf4739d5c99fa86607582584", "score": "0.5730079", "text": "function reSet() {\n\t\t$(\"#adultDog\").val(\"\");\n\t\t$(\"#reasonAdult\").val(\"\");\n\t\t$(\"#pupDog\").val(\"\");\n\t\t$(\"#reasonPuppy\").val(\"\");\n\t}", "title": "" }, { "docid": "39c8aafea99b533cc0b9e5bf0600d2c3", "score": "0.57261264", "text": "_clean () {\n let $ = document.querySelector.bind(document)\n\n $('.form').reset()\n this._date.focus()\n }", "title": "" }, { "docid": "b5c2d7be9c0dd8c6edbcf63cf43271e0", "score": "0.57254046", "text": "function clearform() {\n $( 'input#attorney-first-name' ).val( '' );\n $( 'input#title' ).val( '' );\n $( 'input#attorney-last-name' ).val( '' );\n $( '#suffix' ).val( '');\n $( 'input#attorney-lawfirm-name' ).val( '' );\n $( '#attorney-country' ).val( '' );\n $( '#attorney-country' ).val( );\n $( 'input#attorney-address1' ).val( '' );\n $( 'input#attorney-city' ).val( '' );\n $( '#attorney-state' ).val('' );\n $( 'input#attorney-zipcode' ).val( '' );\n $( 'input#attorney-email' ).val( '' );\n $( 'input#attorney-phonenumbertype' ).val( '');\n $( 'input#attorney-phone' ).val( '' );\n $( '#mydata2' ).find('span.glyphicon-ok-sign').removeClass( 'glyphicon-ok-sign' ).parent().parent().css('background-color','#9BB8D3').siblings().css('background-color','#9BB8D3');\n }", "title": "" }, { "docid": "f63dd1c4da99de026f8d3b2c87aca8ee", "score": "0.5720629", "text": "function clean(){\n document.getElementById('inputPin').value = '';\n}", "title": "" }, { "docid": "94b5e49d1f927a901664eed4e06367bb", "score": "0.57137775", "text": "reset() {\n $(\"[name=narration]\", this.form).value = \"\";\n $(\"[name=payee]\", this.form).value = \"\";\n $$(\".metadata-row\", this.form).forEach(el => {\n el.remove();\n });\n $$(\".posting\", this.form).forEach(el => {\n el.remove();\n });\n this.addPosting();\n this.addPosting();\n this.form.focus();\n }", "title": "" }, { "docid": "1ad9e2240c07b8bb2a21d0a59828a4d3", "score": "0.57128906", "text": "function cleanFormAddProduct(){\r\n\t\t\t\t// display button\r\n\t\t\t\t$('input[name=\"submit_addproduct\"]').css('display','inline');\r\n\t\t\t\t$('input[name=\"submit_updateproduct\"]').css('display','none');\r\n\r\n\t\t\t\t$('img.image-link').css(\"display\",'none');\r\n\t\t\t\t$('tr.list-image').css('display','table-row');\r\n\t\t\t\t$('input[name=\"name\"]').val('');\r\n \t\t$('input[name=\"price\"]').val('');\r\n \t\t$('select[name=\"category\"]').val('');\r\n \t\t$('input[name=\"new\"]').prop('checked', false);\r\n \t\t$('input[name=\"best\"]').prop('checked', false);\r\n \t\t$( '#ui-id-1' ).html('Add new product');\r\n \t\t$('div.error_product').html('');\r\n\r\n\t\t\t}", "title": "" }, { "docid": "42b52040eea3b90d4195712f2b24c56b", "score": "0.5702034", "text": "function val_input_heard(obj) {\n if (val_isheardrequired($('#input-promo')) && $(obj).val() === 'unknown')\n val_seterror(obj, '#err-heard-blank', true);\n else val_clearerror(obj, '#err-heard-blank', true);\n val_setformok();\n }", "title": "" }, { "docid": "115b8babb576ef81140f58d212b97f3e", "score": "0.5701706", "text": "function clearInputFields() {\n $titleInput.val('');\n $bodyInput.val('');\n}", "title": "" }, { "docid": "cf08e7a854ba1642bad57f28ec65bc28", "score": "0.5700957", "text": "#cleanData() {\n let oldImages = this.photosDiv.querySelectorAll('.image-edit');\n if (oldImages && oldImages.length !== 0) {\n oldImages.forEach(oldImage => oldImage.remove());\n this.photoHelperDiv.style.display = 'flex';\n }\n this.titleTextArea.value = '';\n this.aboutTextArea.value = '';\n this.addTags(null);\n this.timeInput.value = '';\n this.sliderDiv.querySelector('select').value = '2';\n this.publicCheckbox.classList.add('event-edit__public_hidden');\n }", "title": "" }, { "docid": "c0c673ee1ceb57efe53b661b16c289d2", "score": "0.56988555", "text": "function handleUserInput() {\n let content = $(\".send-textbox\").val();\n\n if (content === null || content !== null && content.length === 0) {\n\t\terror(\"Error: Input cannot be blank\");\n\t} else {\n sendElizaNewMessage(content);\n }\n}", "title": "" }, { "docid": "f878b677f559420622c07139eed8c87c", "score": "0.56980556", "text": "function actualiseKeywordCleanerForm() {\n var radio = atLeastOneRadioKeyword();\n var ids = allIdsFilledKeywords();\n if (radio && ids) {\n $(document).find('#keywordCleaningErrors').prop('hidden', true);\n $(document).find('#btn-change-keyword').prop(\"disabled\", false);\n } else {\n $(document).find('#keywordCleaningErrors').prop('hidden', false);\n $(document).find('#btn-change-keyword').prop(\"disabled\", true);\n }\n }", "title": "" }, { "docid": "5939785129adddf7ae1e853c70583bfa", "score": "0.5697834", "text": "function limpiar(){\n\t\tnombre.value = \"\";\t\n\t\tapellidos.value = \"\";\n\t\tdni.value = \"\";\t\n\t\talias.value = \"\";\n\t\tcontrasenia.value = \"\";\n\t\tfecha.value = \"\";\n\t\tsexos[0].checked = false;\n\t\tsexos[1].checked = false;\n\t\tpais.value = \"\";\n\t\tcorreo.value = \"\";\n\t\tcuenta.value = \"\";\n\t\ttelefono.value = \"\";\n\t\turl.value = \"\";\n\t\taceptar.checked = false;\n\t\terrorNombre.innerHTML = \"\"; \n\t\terrorApellidos.innerHTML = \"\"; \n\t\terrorDni.innerHTML = \"\"; \n\t\terrorAlias.innerHTML = \"\"; \n\t\terrorContrasenia.innerHTML = \"\"; \n\t\terrorFecha.innerHTML = \"\"; \n\t\terrorSexo.innerHTML = \"\"; \n\t\terrorPais.innerHTML = \"\"; \n\t\terrorCorreo.innerHTML = \"\"; \n\t\terrorCuenta.innerHTML = \"\"; \n\t\terrorTelefono.innerHTML = \"\"; \n\t\terrorUrl.innerHTML = \"\"; \n\t\terrorAceptar.innerHTML = \"\"; \n\t}", "title": "" }, { "docid": "2649c4cda4748fe1e323a0d941b24f09", "score": "0.5682831", "text": "function clearInputFields() {\n if (!$scope.checkHumanDigits) {\n document.getElementById(\"inputDigits\").style.borderColor = \"green\";\n document.getElementById(\"inputDigits\").value = null;\n document.getElementById(\"inputDigits\").focus();\n $scope.wrongHumanInput = true;\n }\n else if ($scope.checkHumanDigits) {\n document.getElementById(\"inputDigits\").style.borderColor = \"pink\";\n document.getElementById(\"inputDigits\").value = null;\n document.getElementById(\"inputDigits\").focus();\n }\n else if (($scope.checkEmailValidation == false) && ($scope.checkHumanDigits == false)) {\n document.getElementById(\"mail\").value = null;\n document.getElementById(\"mail\").focus();\n document.getElementById(\"mail\").style.borderWidth = \"2px\";\n document.getElementById(\"mail\").style.borderColor = \"red\";\n document.getElementById(\"inputDigits\").value = null;\n }\n else if (($scope.checkEmailValidation == false) && ($scope.checkHumanDigits == true)) {\n document.getElementById(\"mail\").value = null;\n document.getElementById(\"mail\").focus();\n document.getElementById(\"mail\").style.borderWidth = \"2px\";\n document.getElementById(\"mail\").style.borderColor = \"orange\";\n //document.getElementById(\"inputDigits\").value=null;\n }\n else if ($scope.checkHumanDigits == false) {\n document.getElementById(\"inputDigits\").value = null;\n document.getElementById(\"inputDigits\").focus();\n document.getElementById(\"inputDigits\").style.borderWidth = \"2px\";\n document.getElementById(\"inputDigits\").style.borderColor = \"green\";\n //document.getElementById(\"inputDigits\").value=null;\n alert(\"Well!!!\");\n }\n else {\n alert(\"default clear!!!\");\n }\n }", "title": "" }, { "docid": "39d88207a3c5f2e5b72d05067d13f856", "score": "0.56794906", "text": "function sanitizeString(){\n\tvar str = document.forms[0].elements[0].value;\n str = str.replace(/[^a-z0-9áéíóúñü \\.,_-]/gim,\"\");\n saveInputs(str);\n}", "title": "" }, { "docid": "be72029d46e6947e2ecf16623799cdcb", "score": "0.56774014", "text": "function validateInput()\n\t{\n\t\tvar locationFromForm = $locationInput.val();\n\n\t\t// Is the location undefined or empty?\n\t\tif(locationFromForm === undefined || locationFromForm.trim() === \"\")\n\t\t{\n\t\t\t// Use Cincinnati as default \n\t\t\tlocation = 'Cincinnati, US';\n\t\t\t$locationInput.val(location);\n\t\t}\n\t}", "title": "" }, { "docid": "1406884058967e02c29c26b70b723c4b", "score": "0.56751364", "text": "_clearInputs() {\n this._container.querySelectorAll(\"input\").forEach((input) => {\n !!input.value && (input.value = \"\");\n });\n\n [...this._ingContainer.children].forEach((child) => {\n child.remove();\n });\n\n this.appendIngMarkup(1);\n }", "title": "" }, { "docid": "ddecf8a25c7bae04eb4b8aee7e92d166", "score": "0.56708175", "text": "function cleanInput(data) {\n\treturn data.toString().replace(/(\\r\\n|\\n|\\r)/gm,\"\");\n}", "title": "" }, { "docid": "c84c8da8ddbad08ea7a4d3633e1232b6", "score": "0.56703764", "text": "function cleanInput (input) {\n return $p('<div/>').text(input).text();\n }", "title": "" }, { "docid": "141bffb3eb53d6436257e50a653b8652", "score": "0.56691414", "text": "function verification() {\n if (!newTitle.trim()) {\n setNewInputWarning(\"You forgot to write the title!\");\n return false;\n } else if (!newAuthor.trim()) {\n setNewInputWarning(\"You forgot to write the author!\");\n return false;\n } else if (!newPDate.trim()) {\n setNewInputWarning(\"You forgot to write the published date!\");\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "6f5a9d94132d6880d37edaa4cafa5ca4", "score": "0.5666742", "text": "function clearUserInput() {\n $(\"#userInput\").empty();\n input = \"\";\n }", "title": "" }, { "docid": "ed2ff8ed57c55ee1a509ca5cb716ff89", "score": "0.5661232", "text": "function missingB() {\n if ($firstInput.val() !== \"\" && $lastInput.val() !== \"\" &&\n $titleInput.val() !== \"\" && $cityInput.val() !== \"\" && \n $stateInput.val() !== \"\" && $publisherInput.val() !== \"\" &&\n $yearInput.val() !== \"\") { \n $('[required]').removeClass(\"red\");\n $(\"#msg\").css(\"visibility\", \"hidden\");\n } else {\n $('[required]').addClass(\"red\");\n $(\"#msg\").css(\"visibility\", \"visible\");\n e.preventDefault(); \n } \n }", "title": "" }, { "docid": "8fe6b2108d9a7fd3eddb021753164ec9", "score": "0.566076", "text": "function cleanInput (input) {\n return $('<div/>').text(input).text();\n }", "title": "" }, { "docid": "fe7c6ded24de5e8817e0c043c4b6e554", "score": "0.5655615", "text": "function resetProcessInputFill(){\n\t$('input#processName').val('');\n\t$('input#processDesc').val('');\n\t$('input#processDescThai').val('');\n\t\n\t$('input#processName').removeClass('bg-error');\n\t$('input#processDesc').removeClass('bg-error');\n\t$('input#processDescThai').removeClass('bg-error');\n}", "title": "" }, { "docid": "6a4720cedd698b341fc498806e0960fa", "score": "0.5655136", "text": "function userAnswerIncorrect() {\n $('form').empty().html(alertIncorrect());\n}", "title": "" }, { "docid": "d1780dc21285c98b60245fd4e28d87c9", "score": "0.5653274", "text": "gatherUserInput() {\n const enteredTitle = this.titleInputElement.value;\n const enteredDescription = this.descriptionInputElement.value;\n const enteredPeople = this.peopleInputElement.value;\n //FORMA DE VALIDAR 1\n // if(enteredDescription.trim().length ==0 || \n // enteredPeople.trim().length==0 ||\n // enteredTitle.trim().length==0){\n // alert('invalid inputs')\n // return;\n // }\n const titleValidator = {\n value: enteredTitle,\n required: true\n };\n const descriptionValidator = {\n value: enteredDescription,\n required: true,\n minLength: 5,\n maxLength: 10\n };\n const peopleValidator = {\n value: +enteredPeople,\n required: true,\n min: 2\n };\n if (!validate(titleValidator) ||\n !validate(descriptionValidator) ||\n !validate(peopleValidator)) {\n alert('Datos incorrectos');\n }\n else {\n return [enteredTitle, enteredDescription, +enteredPeople];\n }\n }", "title": "" }, { "docid": "72972388b6ec79854daf9b4555783d4c", "score": "0.56483996", "text": "clearInput() {\n this.inputData = [];\n this.trim();\n }", "title": "" }, { "docid": "8196599901c242bb6c27419585c76ff0", "score": "0.56420183", "text": "function cleanInput(data) {\n return data.toString().replace(/(\\r\\n|\\n|\\r)/gm,\"\");\n}", "title": "" }, { "docid": "a473609c3b6be9c958065df2f7629d09", "score": "0.5639922", "text": "function cleanInput(input) {\n return $('<div/>').text(input).html();\n }", "title": "" }, { "docid": "5b718675403d1481285710c3c2bdecf9", "score": "0.56380564", "text": "function cleanInput(input) {\n\t\treturn $('<div/>').text(input).text();\n\t}", "title": "" }, { "docid": "8c40a333c60329322f87739e8a8bbedf", "score": "0.5637883", "text": "function val_input_heard_other(obj) {\n val_checkblank(obj, '#err-other-blank');\n val_setformok();\n }", "title": "" }, { "docid": "53f8beb98cb96cd9825401d2ba799037", "score": "0.5637041", "text": "function clearErrors() {\n \n firstname = document.getElementById(\"firstname\");\n lastname = document.getElementById(\"lastname\");\n clientemail = document.getElementById(\"clientemail\");\n message = document.getElementById(\"messagearea\");\n if (firstname.value.length >= 3) {\n \n document.getElementsByClassName(\"error\")[0].innerHTML = \"\";\n document.getElementsByClassName(\"fas\")[0].style.display = \"none\";\n }\n if (lastname.value.length >= 3) {\n \n document.getElementsByClassName(\"error\")[1].innerHTML = \"\";\n document.getElementsByClassName(\"fas\")[1].style.display = \"none\";\n }\n if (clientemail.value.length >= 3) {\n \n document.getElementsByClassName(\"error\")[2].innerHTML = \"\";\n document.getElementsByClassName(\"fas\")[2].style.display = \"none\";\n }\n if (message.value.length >= 10) {\n \n document.getElementsByClassName(\"error\")[3].innerHTML = \"\";\n document.getElementsByClassName(\"fas\")[3].style.display = \"none\";\n }\n}", "title": "" }, { "docid": "22f0445d54803f3e3cca612639acc898", "score": "0.563635", "text": "function cleanPasswordFields(){\n passwordField.val('');\n repeatPasswordField.val('');\n }", "title": "" }, { "docid": "4b497b5646349c03052a168a1ab5a176", "score": "0.5633339", "text": "function resetFormErrors() {\n\t\t// Delete all form error messages\n\t\t$('.form_error_container p').remove();\n\t}", "title": "" }, { "docid": "15069c57e8af5724d92cf535bf0526a9", "score": "0.56294566", "text": "function missingN () {\n if ($firstInputN.val() !== \"\" && $lastInputN.val() !== \"\" &&\n $titleInputN.val() !== \"\" && $articleInputN.val() !== \"\" && \n $pagesInputN.val() !== \"\" && $yearInputN.val() !== \"\" && \n $dateInputN.val() !== \"\" && $monthInputN.val() !== \"\") { \n $('[required]').removeClass(\"red\");\n $(\"#msgN\").css(\"visibility\", \"hidden\");\n } else {\n $('[required]').addClass(\"red\");\n $(\"#msgN\").css(\"visibility\", \"visible\");\n e.preventDefault(); \n } \n }", "title": "" }, { "docid": "ff6479eb71353b0a1b2978c8fdebb3a9", "score": "0.56250197", "text": "function validate() {\n\n // set the value of the field into the array\n questions[position].value = inputField.value\n\n // check if the pattern matches\n if (!inputField.value.match(questions[position].pattern || /.+/)) wrong()\n else ok(function () {\n\n // set the progress of the background\n progress.style.width = ++position * 100 / questions.length + 'vw'\n\n // if there is a new question, hide current and load next\n if (questions[position]) hideCurrent(putQuestion)\n else hideCurrent(done)\n\n })\n\n }", "title": "" }, { "docid": "06058256f9a81c44a6b5e5bdec599453", "score": "0.562454", "text": "function cleanError() {\n\tvar error = document.getElementById('error');\n\terror.innerHTML = \"\";\n}", "title": "" } ]
266ba272ad1e45c573d4bc464efe3321
Temporarily expose input value. Use with caution.
[ { "docid": "0cfcb08cb3c3b5dd26d496a114cc5447", "score": "0.0", "text": "get excludedAccountsInput() {\n return this._excludedAccounts;\n }", "title": "" } ]
[ { "docid": "4f59f13f0067d9513a872ac32b3adf4b", "score": "0.7330719", "text": "get value() { return this._inputValueAccessor.value; }", "title": "" }, { "docid": "4f59f13f0067d9513a872ac32b3adf4b", "score": "0.7330719", "text": "get value() { return this._inputValueAccessor.value; }", "title": "" }, { "docid": "d3e22c6c6914f4a2f98c39f859d73d5a", "score": "0.7132976", "text": "get valueInput() {\n return this._value;\n }", "title": "" }, { "docid": "7443a8e54cfb2dde7f4869350b3d405c", "score": "0.7042526", "text": "get value() {\n return this._inputValueAccessor.value;\n }", "title": "" }, { "docid": "84c27828426ccda2358fe4e2738578b9", "score": "0.6996957", "text": "get internalValue() {\n // cover the case when value getter is called before first render or in interim state\n return this.interimValueState || !this.inputEl ? super.value : this.inputValue;\n }", "title": "" }, { "docid": "a2d9a5327d256d9050ecd712b08b9a12", "score": "0.6917474", "text": "get inputValue() {\n return this.inputEl.value;\n }", "title": "" }, { "docid": "4777b7c8644a682e1f8b41e46fa3b042", "score": "0.6860412", "text": "get inputvalue() {\n return this.getInputValue();\n }", "title": "" }, { "docid": "0c3618d58a6ad341e958054a6ce9d8c6", "score": "0.6794994", "text": "get value() {\n return this.input.value;\n }", "title": "" }, { "docid": "0ad8adfa53b20234863bebda08e1c1bf", "score": "0.6749148", "text": "get value() { return this._value; }", "title": "" }, { "docid": "0ad8adfa53b20234863bebda08e1c1bf", "score": "0.6749148", "text": "get value() { return this._value; }", "title": "" }, { "docid": "0ad8adfa53b20234863bebda08e1c1bf", "score": "0.6749148", "text": "get value() { return this._value; }", "title": "" }, { "docid": "0ad8adfa53b20234863bebda08e1c1bf", "score": "0.6749148", "text": "get value() { return this._value; }", "title": "" }, { "docid": "0ad8adfa53b20234863bebda08e1c1bf", "score": "0.6749148", "text": "get value() { return this._value; }", "title": "" }, { "docid": "0ad8adfa53b20234863bebda08e1c1bf", "score": "0.6749148", "text": "get value() { return this._value; }", "title": "" }, { "docid": "c2a5de4974590f6c37450154eae00774", "score": "0.67267996", "text": "set value(v) {\n if (v !== this.inputValue) {\n this.inputValue = v;\n }\n }", "title": "" }, { "docid": "6d644283f99b83df64f6aba0f9d5d08c", "score": "0.6695338", "text": "function getValue( input ) {\n return input.value;\n }", "title": "" }, { "docid": "ecfe3fc94da55872411e208ac23c8ddb", "score": "0.65867096", "text": "set CustomProvidedInput(value) {}", "title": "" }, { "docid": "022be1b85569d5726acc74689d2b66fe", "score": "0.6561095", "text": "get value() {\n return this._inputNode?.value || this.__value || '';\n }", "title": "" }, { "docid": "69a1410367c04ff48fb9f5bfc5c6ba11", "score": "0.6508378", "text": "set inputValue(value) {\n this.inputEl.value = value;\n }", "title": "" }, { "docid": "54e43ef85a5d7da70e64cb544bcb54c9", "score": "0.6501185", "text": "getInitialInputValue(value: any) {\n return value;\n }", "title": "" }, { "docid": "4aa5c66c4daeaec810bbda582b223ea7", "score": "0.6481477", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "74a467ea44ae47e7ac08746b75c9c60b", "score": "0.64703023", "text": "get value() {\n return this.internalValue;\n }", "title": "" }, { "docid": "74a467ea44ae47e7ac08746b75c9c60b", "score": "0.64703023", "text": "get value() {\n return this.internalValue;\n }", "title": "" }, { "docid": "48f4436cd0ac5b1e4c2bc1d7fbfbfed7", "score": "0.64352304", "text": "value(value) {\n return this.process(value, false);\n }", "title": "" }, { "docid": "da688c849f48b0daa0a1f2faec838d2a", "score": "0.6426419", "text": "set inputvalue(value: string) {\n this._inputvalue = value;\n this.value = value;\n\n this.validate(value);\n }", "title": "" }, { "docid": "d7885e1ed983df042c1346608f803ca8", "score": "0.64209783", "text": "get value() {}", "title": "" }, { "docid": "976002c09681d5afb929addc0ec7f39e", "score": "0.6418206", "text": "function inputvalue(){\n return input.value\n}", "title": "" }, { "docid": "ccab0ec6d9b5449cde8a9da3ce8a09be", "score": "0.64108765", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "c38bbf9c9a1db0d7c66063dda78b4b56", "score": "0.64073086", "text": "constructor(\n /// @internal\n value) {\n this.value = value;\n }", "title": "" }, { "docid": "3a231d0ec2c1965087a57ae8ec3b2654", "score": "0.6401235", "text": "_reflectBackFormattedValueToUser() {\n if (this._reflectBackOn()) {\n // Text 'undefined' should not end up in <input>\n this.value = typeof this.formattedValue !== 'undefined' ? this.formattedValue : '';\n }\n }", "title": "" }, { "docid": "2291deeed6d3f398689f84a370b9bfdd", "score": "0.6398789", "text": "get value() {\r\n return this._value;\r\n }", "title": "" }, { "docid": "2291deeed6d3f398689f84a370b9bfdd", "score": "0.6398789", "text": "get value() {\r\n return this._value;\r\n }", "title": "" }, { "docid": "6eca64956cd0284c94e196c3b05a37b9", "score": "0.6380657", "text": "value () {\n return this._value\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.6349243", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "1f5a5341ff453fec434024031a017ee4", "score": "0.6348955", "text": "get value() {\r\n return this.__value;\r\n }", "title": "" }, { "docid": "aa2a40bdbc89255af6206ec24a08b102", "score": "0.6341558", "text": "exportVal() { return this.val(); }", "title": "" }, { "docid": "7edb6902e095bc579ebde3c13d2ebfe3", "score": "0.62836856", "text": "get value () {\n\t\treturn this._value;\n\t}", "title": "" }, { "docid": "5dac164aba09e5e464229bd3f5361822", "score": "0.62795466", "text": "get value(){\n return this._value ;\n }", "title": "" }, { "docid": "68f299d258b5257dd927f67c25b89f20", "score": "0.6271861", "text": "value (val) {\n this.val = val\n }", "title": "" }, { "docid": "3d2eeddc63f2a8251e5e112a7fde05e8", "score": "0.6268741", "text": "get value() {\n\t\treturn this.__value;\n\t}", "title": "" }, { "docid": "a00bd781f0d9ee4f408208e8f29554ce", "score": "0.6266366", "text": "getValue() {}", "title": "" }, { "docid": "98ed008ed9d4f32954eb0f6e3284cf48", "score": "0.6251215", "text": "get value(){\n return this.rawValue // returns raw value when you access value\n }", "title": "" }, { "docid": "394040fbcbc34c71d27590f1e7917bd3", "score": "0.62425256", "text": "value() { return undefined; }", "title": "" }, { "docid": "a67f84fa487ab06fc4f4181f7b39cb5d", "score": "0.62385243", "text": "updateValue() {\n [...this.template.querySelectorAll('lightning-input')].forEach(\n (element) => {\n element.value = this._value;\n }\n );\n\n this._updateProxyInputAttributes('value');\n\n /**\n * @event\n * @name change\n * @description The event fired when the value changes.\n * @param {number} value\n */\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: {\n value: this._value\n }\n })\n );\n this.showHelpMessageIfInvalid();\n }", "title": "" }, { "docid": "a14184d6e0fbd52cf794b75d4a21cd19", "score": "0.6234623", "text": "get rawInputValue() {\n return this.extractInput(0, this.value.length, {\n raw: true\n });\n }", "title": "" }, { "docid": "f3bf084d6736b63f09ac2cc1ebbb9f65", "score": "0.62043655", "text": "passInput(){\n if(this.inputClass.value){\n return this.inputClass.value;\n }\n }", "title": "" }, { "docid": "290e92c5972fe7cd0274b706108e6e46", "score": "0.62040573", "text": "getValue() { return this._value; }", "title": "" }, { "docid": "aa75a3bee76fca080c7050339a5b0dc7", "score": "0.6203306", "text": "readValue() {\n const value = super.readValue()\n if (value === null) return null\n this.absoluteValue += value\n return this.absoluteValue\n }", "title": "" }, { "docid": "1c914125d8af24e1ab4ad180d8169144", "score": "0.6192706", "text": "function captureInputValue (){\nuserEntry=inputElement.value; \nreturn userEntry;\n}", "title": "" }, { "docid": "0ddaf7fa4a3dbab45d32eb5ec4a54e99", "score": "0.6171346", "text": "function setInputValue(newValue, userTyping) {\n setInternalInputValue(mergedFormatter(\n // Invalidate number is sometime passed by external control, we should let it go\n // Otherwise is controlled by internal interactive logic which check by userTyping\n // You can ref 'show limited value when input is not focused' test for more info.\n newValue.isInvalidate() ? newValue.toString(false) : newValue.toString(!userTyping), userTyping));\n }", "title": "" }, { "docid": "f3c8cae4233ace8e2e0161d39fc68430", "score": "0.6158172", "text": "getValue() {\r\n return (this.isControlled() ? this.props : this.state).value;\r\n }", "title": "" }, { "docid": "06af10144d5493ff4580aaf7a93996db", "score": "0.6149145", "text": "function getInputValue() {\n // Selecting the input element and get its value \n let inputVal = document.getElementById(\"inputId\").value;\n // Displaying the value\n output();\n }", "title": "" }, { "docid": "2f4ef1620a343504454a1a29ec171850", "score": "0.6143935", "text": "fieldValue(val) {\n this.$emit('input', val);\n }", "title": "" }, { "docid": "5e1a60ff00f34ab7143bd7081805d863", "score": "0.61390305", "text": "get value() {\n return this.__value__ || '';\n }", "title": "" }, { "docid": "271d416ffd942123ec235b611f9f2dd2", "score": "0.6129839", "text": "writeValue(value) {\n this.value = value;\n }", "title": "" }, { "docid": "271d416ffd942123ec235b611f9f2dd2", "score": "0.6129839", "text": "writeValue(value) {\n this.value = value;\n }", "title": "" }, { "docid": "271d416ffd942123ec235b611f9f2dd2", "score": "0.6129839", "text": "writeValue(value) {\n this.value = value;\n }", "title": "" }, { "docid": "271d416ffd942123ec235b611f9f2dd2", "score": "0.6129839", "text": "writeValue(value) {\n this.value = value;\n }", "title": "" }, { "docid": "077d2b9bfa5281003ffc0aa68f3c51cc", "score": "0.61235535", "text": "get value() {\n return this.value;\n }", "title": "" }, { "docid": "9dcdf66e278d21f57a4e616805d71310", "score": "0.6109267", "text": "set customValue (value) { \n this.textInput.value = value || '';\n }", "title": "" }, { "docid": "c951641a1fc0abf82c7c805a3ed26ffc", "score": "0.60993636", "text": "set value(val){\n this._value = val;\n }", "title": "" }, { "docid": "e511903c2e4aab61040536dde54dc030", "score": "0.60880256", "text": "getValue() {\n // this simple editor doubles any value entered into the input\n return value * 2;\n }", "title": "" }, { "docid": "4a891e0a6c22a418dc53c1e04295c472", "score": "0.6070838", "text": "getValue() {\n }", "title": "" }, { "docid": "e22dbd8848395de5a1cc4efd2f5d2a3b", "score": "0.60396934", "text": "getValue() {\n return this.value;\n }", "title": "" }, { "docid": "a202f3a7d3c6b1d458edf8bd893c407f", "score": "0.6036386", "text": "_get_value(){\r\n\t\tthrow new Error(\"get_value must be overridden\");\r\n\t}", "title": "" }, { "docid": "01443e9fe782700ea33fc2c0c50ea5e8", "score": "0.60236305", "text": "getValue() {\n return this.eInput.value;\n }", "title": "" }, { "docid": "03e377d501bc8a39a9e4284c1c65582c", "score": "0.6018576", "text": "getValue(){\n return this.value;\n }", "title": "" }, { "docid": "7edd5696958d2ba58e80e078a8b503c9", "score": "0.6012447", "text": "get() {\n return this._value;\n }", "title": "" }, { "docid": "cc025a7080239bb3678e669078dc7eb3", "score": "0.60116154", "text": "set value(value) {\n this._value = value;\n }", "title": "" }, { "docid": "8636fbeb2874836b1ab1ee69c6431640", "score": "0.60038865", "text": "handleInputValue(val) {\n this.setState({ inputVal: val });\n }", "title": "" }, { "docid": "2d318dce1f12af9c7164622cb870a6aa", "score": "0.6002264", "text": "GetValue()\n\t{\n\t\treturn this.value;\n\t}", "title": "" }, { "docid": "abb2975a5d7df888e7ee3b0c2c037d6d", "score": "0.59804964", "text": "get() {\n return this.value.get();\n }", "title": "" }, { "docid": "df14a1c90a60af2fc4bd950880c55c69", "score": "0.5971069", "text": "writeValue(value) {\r\n this._value = value;\r\n }", "title": "" }, { "docid": "df14a1c90a60af2fc4bd950880c55c69", "score": "0.5971069", "text": "writeValue(value) {\r\n this._value = value;\r\n }", "title": "" }, { "docid": "69c8d47f8f1e922c06076ddf30cf6924", "score": "0.5970834", "text": "function myData(value) {\n return value;\n}", "title": "" }, { "docid": "5834d69d8910d120f5956bb5bc7a7229", "score": "0.59677804", "text": "_getValue() {\n return this._value;\n }", "title": "" }, { "docid": "7e50831f747d5dbfa887cf99665f245a", "score": "0.5963359", "text": "get value() {\n this._logger.debug(\"get value\");\n\n return this._value;\n }", "title": "" }, { "docid": "032437758748ddd1ad7b6a4c8c3ab6b0", "score": "0.5954426", "text": "function inptVal() {\n var _this = this;\n var val = _this.value;\n var getPrice = this.parentNode.parentNode.lastChild;\n var getPriceVal = Number(getPrice.getAttribute('value'));\n getPriceVal = getPriceVal * val;\n val = val;\n getPrice.innerHTML = getPriceVal;\n result();\n }", "title": "" }, { "docid": "0da2e9597566c0246d4142c6bc4ef4e5", "score": "0.5950106", "text": "get() {\n return value;\n }", "title": "" }, { "docid": "398c747d3f6fc6cbf1543673813c58af", "score": "0.59433097", "text": "set value(_value) {\n this.setValue(_value);\n }", "title": "" }, { "docid": "b55a43a068bee450c8d83b8e25449517", "score": "0.59427077", "text": "get inputValueEmitter() {\n return this._inputValueEmitter;\n }", "title": "" }, { "docid": "b55a43a068bee450c8d83b8e25449517", "score": "0.59427077", "text": "get inputValueEmitter() {\n return this._inputValueEmitter;\n }", "title": "" } ]
3065f363e5434427524888d23d4cf1bb
Getter and setter for player selection > Setter includes display updates
[ { "docid": "7c5a0e572ef036fe522df63249c07008", "score": "0.74874914", "text": "function getPlayerSelection () {\n return playerSelection;\n }", "title": "" } ]
[ { "docid": "8ef9a3fe4448a523032956b862e6d964", "score": "0.71659875", "text": "function selectPlayer() {\n $(\"#playerSelectDrop\").text($(this).text());\n selectedPlayerID = $(this).attr(\"id\").substring(6);\n\n updateHand()\n updateItems();\n }", "title": "" }, { "docid": "d02fc87de7960623fdebf5a74d534136", "score": "0.7107798", "text": "function setPlayerPicked(choice) {\n this.playerPicked = choice.srcElement.textContent\n this.playerPickedDiv.innerHTML = this.playerPicked\n }", "title": "" }, { "docid": "7e0f71567eca8a482a497b80952e730c", "score": "0.6737393", "text": "update() {\n this.selected(this.player().playbackRate() === this.rate);\n }", "title": "" }, { "docid": "462217d93dd9c650a606e0556f1f2ef2", "score": "0.66607934", "text": "function getInput (choise) {\n playerSelection = choise;\n}", "title": "" }, { "docid": "2be3f0823beecbdb522d4c776fa0ad46", "score": "0.66043156", "text": "function setPlayerOption() {\n if (isSingle) {\n playerA2.setTransparent();\n playerB2.setTransparent();\n }\n if (initServe == \"a1\") {\n if (isSingle) {\n serveOrder = [1, 2, 1, 2];\n } else {\n serveOrder[0] = 1;\n serveOrder[2] = 2;\n }\n playerA1.setServe(\"S\");\n initServeEnd = \"0\";\n rotateServeIcon(0, \"0\");\n $leftScoreBox.addClass(\"serve-score\");\n $rightScoreBox.removeClass(\"serve-score\");\n $leftPlayerContainer.html(\n playerA2.outputHtml() + playerA1.outputHtml()\n );\n } else if (initServe == \"a2\") {\n serveOrder[0] = 2;\n serveOrder[2] = 1;\n playerA2.setServe(\"S\");\n initServeEnd = \"0\";\n rotateServeIcon(0, \"0\");\n $leftScoreBox.addClass(\"serve-score\");\n $rightScoreBox.removeClass(\"serve-score\");\n $leftPlayerContainer.html(\n playerA1.outputHtml() + playerA2.outputHtml()\n );\n } else if (initServe == \"b1\") {\n if (isSingle) {\n serveOrder = [2, 1, 2, 1];\n } else {\n serveOrder[0] = 3;\n serveOrder[2] = 4;\n }\n playerB1.setServe(\"S\");\n initServeEnd = \"1\";\n rotateServeIcon(0, \"1\");\n $rightScoreBox.addClass(\"serve-score\");\n $leftScoreBox.removeClass(\"serve-score\");\n $rightPlayerContainer.html(\n playerB1.outputHtml() + playerB2.outputHtml()\n );\n } else if (initServe == \"b2\") {\n serveOrder[0] = 4;\n serveOrder[2] = 3;\n playerB2.setServe(\"S\");\n initServeEnd = \"1\";\n rotateServeIcon(0, \"1\");\n $rightScoreBox.addClass(\"serve-score\");\n $leftScoreBox.removeClass(\"serve-score\");\n $rightPlayerContainer.html(\n playerB2.outputHtml() + playerB1.outputHtml()\n );\n }\n\n if (initReceive == \"a1\") {\n if (!isSingle) {\n serveOrder[3] = 1;\n serveOrder[1] = 2;\n }\n playerA1.setServe(\"R\");\n $leftPlayerContainer.html(\n playerA2.outputHtml() + playerA1.outputHtml()\n );\n } else if (initReceive == \"a2\") {\n serveOrder[3] = 2;\n serveOrder[1] = 1;\n playerA2.setServe(\"R\");\n $leftPlayerContainer.html(\n playerA1.outputHtml() + playerA2.outputHtml()\n );\n } else if (initReceive == \"b1\") {\n if (!isSingle) {\n serveOrder[3] = 3;\n serveOrder[1] = 4;\n }\n playerB1.setServe(\"R\");\n $rightPlayerContainer.html(\n playerB1.outputHtml() + playerB2.outputHtml()\n );\n } else if (initReceive == \"b2\") {\n serveOrder[3] = 4;\n serveOrder[1] = 3;\n playerB2.setServe(\"R\");\n $rightPlayerContainer.html(\n playerB2.outputHtml() + playerB1.outputHtml()\n );\n }\n\n let scores = [];\n let scrollInnerHtml = \"\";\n if (isSingle) {\n $(\"#event-name-a1\").text(playerA1.name);\n $(\"#event-name-b1\").text(playerB1.name);\n $(\".dlg .event-operation\").eq(3).remove();\n $(\".dlg .event-operation\").eq(1).remove();\n $(\"#names-col\").html(\n generateScoreTableColumn([playerA1.name, playerB1.name])\n );\n $(\"#serves-col\").html(\n generateScoreTableColumn([playerA1.serve, playerB1.serve])\n );\n scores = [\"\", \"\"];\n } else {\n $(\"#event-name-a1\").text(playerA1.name);\n $(\"#event-name-a2\").text(playerA2.name);\n $(\"#event-name-b1\").text(playerB1.name);\n $(\"#event-name-b2\").text(playerB2.name);\n\n $(\"#names-col\").html(\n generateScoreTableColumn([\n playerA1.name,\n playerA2.name,\n playerB1.name,\n playerB2.name,\n ])\n );\n $(\"#serves-col\").html(\n generateScoreTableColumn([\n playerA1.serve,\n playerA2.serve,\n playerB1.serve,\n playerB2.serve,\n ])\n );\n scores = [\"\", \"\", \"\", \"\"];\n }\n for (let i = 1; i <= 2 * maxScore; i++) {\n scrollInnerHtml +=\n \"<div class='single-score' id='score-\" +\n i +\n \"'>\" +\n generateScoreTableColumn(scores) +\n \"</div>\";\n }\n scrollToLeft(\"score-panel\");\n $scoreScrollPanel.html(scrollInnerHtml);\n}", "title": "" }, { "docid": "019333dbe53876c8ff072d65fb0eefde", "score": "0.65389025", "text": "function selectPlayer(player) {\n\n // Remove highlight from previously highlighted circle\n d3.select(selectedCircle).classed(\"highlight\", false); \n\n // Keep track of this player\n selectedPlayer = player;\n selectedCircle = d3.selectAll(\".scatterdot\").filter(function(d) { return (d[\"Gamertag\"] == player[\"Gamertag\"])})[0][0];\n \n // Highlight this player\n d3.select(selectedCircle).classed(\"highlight\", true);\n \n // Display information about the selected player\n showPlayerInfo(player);\n \n // Show the player's relative stats on the bar chart\n showPlayerOnBarChart(player);\n}", "title": "" }, { "docid": "4c26bb60f7d454cc52632d5417ceb3b2", "score": "0.65216845", "text": "function setPlayer() {\n var activePl = activePlayer();\n document.getElementById(\"playerTitle\").innerHTML = \"GIOCATORE \" + activePl;\n}", "title": "" }, { "docid": "3bda4048f8a70d0c45278a1fc3cc57fb", "score": "0.6513727", "text": "function setCurrentPlayer(player) {\r\n currentPlayer = player;\r\n}", "title": "" }, { "docid": "e8d6cfa11ec12cea6a8b9804536a448d", "score": "0.649537", "text": "_setToCharacterSelect() {\n this._player1 = null;\n this._player2 = null;\n this._player1Select = true;\n this._chosenStage = null;\n this._currentlySelectingPlayer = this._player1SpritePosition;\n\n this._mainMenu.setVisible( false );\n this._characterMenu.setVisible( true );\n this._stageMenu.setVisible( false );\n this._backButton.setVisible( true );\n }", "title": "" }, { "docid": "96881614d2abe3039b7b5e4c0f97f803", "score": "0.6465737", "text": "setPlayerChoice() {\n var pChoice = $(this).attr(\"data-name\"),\n pNum = parseInt($(this).attr(\"player-num\"), 10);\n\n currPlayerObj.setChoice(pChoice);\n\n // set current rpsGame turn\n if (pNum === 1) {\n rpsGame.setTurn(2);\n } else if (pNum === 2) {\n rpsGame.setTurn(3);\n }\n }", "title": "" }, { "docid": "ea7a689c4a0e521e81660e8231883f69", "score": "0.64310396", "text": "function updateSelection(type) {\n if (type == \"Random\") {\n selection = \"Random\";\n }\n else if (type == \"Simple\") {\n selection = \"Simple\";\n }\n else {\n selection = \"Custom\";\n }\n\n if (isPlay) {\n playSong();\n }\n}", "title": "" }, { "docid": "1e2c6a7ff40cdca39915f4aeba0cde51", "score": "0.6377563", "text": "function displayCurrentChoice()\n\t{\n\t\t$( '#player' + getLocalPlayerId() + \"-choice\" ).text( currentPlayerChoice );\n\t\t$( '#player' + getLocalPlayerId() + \"-choice\" ).removeClass( 'hidden' );\n\t\t$( '.player' + getLocalPlayerId() + \" > div\" ).addClass( 'hidden' );\t\t\n\t}", "title": "" }, { "docid": "4b55db883007d771323cddba2582b896", "score": "0.62572175", "text": "function pickPlayer(playNum) {\n\tself.playNum = playNum;\n\n}", "title": "" }, { "docid": "aa397671e11d3be7b697f47c40505de4", "score": "0.62519675", "text": "function selectPlayer() {\n let value = event.target.value;\n player.sprite = value;\n player.charSelected = true;\n interval = setInterval(countDown, 1000);\n scoreCaculate();\n canvas.style.display = \"initial\";\n scoreAndTime.style.display = \"block\";\n let selectOption = document.querySelector(\"form\");\n select.style.display = \"none\";\n selectOption.removeEventListener(\"change\", selectPlayer);\n}", "title": "" }, { "docid": "f2b53c2bbff6a040dfd6021eaf25e565", "score": "0.6244347", "text": "_setCurrentPlayer(player) {\n this._currentPlayer = player;\n }", "title": "" }, { "docid": "84cb76187967778f265befc30cbd0cdf", "score": "0.6238689", "text": "function setMatchOption() {\n $(\"#s-game-num\").text(gameNum);\n $(\"#s-score\").text(gameScore);\n if (changeEnd) {\n $(\"#s-change-end\").show();\n } else {\n $(\"#s-change-end\").hide();\n }\n\n if (twoScoreWin) {\n $(\"#s-2high-win\").show();\n $(\"#s-max-score\").text(\"封顶\" + maxScore + \"分\");\n } else {\n $(\"#s-2high-win\").hide();\n $(\"#s-max-score\").text(\"封顶\" + gameScore + \"分\");\n }\n if (!isNaN(courtIndex)) {\n $(\"#s-court-index\").show();\n $(\"#s-court-index\").text(courtIndex + \"号场地\");\n } else {\n $(\"#s-court-index\").hide();\n }\n\n $(\"#s-competition-name\").html(competitionName);\n $(\"#s-game-type\").text(getGameTypeName(gameType));\n $(\"#s-match-id\").text(matchId);\n}", "title": "" }, { "docid": "a31d15cfe9a1e6c3c51e815848cd3af8", "score": "0.62259793", "text": "function updateSelections(playerSelection, computerSelection) {\n const playerSelectionElement = document.querySelector(\".player-name\").parentElement.lastElementChild;\n const computerSelectionElement = document.querySelector(\".computer-name\").parentElement.lastElementChild;\n playerSelectionElement.textContent = toSentenceCase(playerSelection);\n computerSelectionElement.textContent = toSentenceCase(computerSelection);\n}", "title": "" }, { "docid": "4cf3b4c5873fd105f3cba9a3891095a7", "score": "0.62257594", "text": "function playerPick() {\n\t\t$('#playAction').on('click', 'img', function(e) {\n\t\t\tplayer = e.target.dataset.name;\n\t\t\t$('#displayPlayerPick').html(player);\n\t\t\tcomputer = computerPick();\n\t\t\tcomparePicks(player, computer);\n\t\t})\n\t}", "title": "" }, { "docid": "8b0dbcf578a0a874e39e6ae27c31b961", "score": "0.6215083", "text": "function showPlayerOption() {\n canvas = document.querySelector(\"canvas\");\n canvas.style.display = \"none\";\n scoreAndTime = document.querySelector(\".player-score\");\n scoreAndTime.style.display = \"none\";\n select = document.querySelector(\".custom-select\");\n let selectOption = document.querySelectorAll(\"input\");\n select.style.display = \"block\";\n if (gameTime !== 16) {\n gameTime = 16;\n }\n let showtime = document.querySelector(\"#time\");\n showtime.innerHTML = gameTime + \"s\";\n selectOption.forEach(s => s.checked = false);\n selectOption.forEach(s => s.addEventListener(\"click\", selectPlayer));\n}", "title": "" }, { "docid": "a9e4f03daffc8bc931d93d4dad1d5f51", "score": "0.61905646", "text": "function play () {\n var result;\n\n if (getPlayerMode() === 'Human') {\n if(checkSelectionValue()) {\n return;\n }\n playerOne = personSelectFigure();\n } else {\n playerOne = computerSelectFigure();\n }\n\n playerTwo = computerSelectFigure();\n\n result = playerOne.determineRoundResult(playerTwo);\n\n resultModel.updatePlayerResults(result);\n\n view.actualGameResultDisplay(getActualGameResultElement(), result);\n view.resultDisplay(getResultElement(), resultModel.getPlayerResults());\n view.showSelectedDisplay(getSelectionDisplayElement(), playerOne.getName(), playerTwo.getName());\n }", "title": "" }, { "docid": "19c095258988a2ac39378784da34dba0", "score": "0.61298996", "text": "function teamSelect(selectTeam){\n team.name = selectTeam.name;\n team.kickStrength = selectTeam.kickStrength\n}", "title": "" }, { "docid": "2f8b80468017379bb79f16813c85906f", "score": "0.61209744", "text": "function selectX(eventObj) {\n \n playerMark = 1;\n computerMark = 0;\n $(\"#selection\").hide();\n $(\"#board\").show();\n}", "title": "" }, { "docid": "18c357f4f56c2335808ab79e724c66b9", "score": "0.61115336", "text": "function handleSelectChange(e) {\n switch (e.target.id) {\n case \"player\":\n const newPlayer = playersData.find((val) => {\n return val.player_name === e.target.value;\n });\n setSelectedPlayer(newPlayer);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "ac95f620998958bc8f660932c811273b", "score": "0.61083615", "text": "function renderPlayerName() {\n let name = character.player\n $('#player').attr('value', name)\n}", "title": "" }, { "docid": "dfcb63cc1ac19764a9ff9350ffc96065", "score": "0.60819626", "text": "set _selection(v) {}", "title": "" }, { "docid": "ba4ca0dde31d4dfd56a978c5fa68c652", "score": "0.6080116", "text": "updatePlayer() {\n this.currentPlayer = this.currentPlayer === 'O' ? 'X' : 'O';\n }", "title": "" }, { "docid": "2950370f50ab6f063e6685ed45875375", "score": "0.6079485", "text": "function playerSelection(player, guess, draw){\n\t\tif ((currentPlayer === playerData[player].userid) && (!playerData[player].choiceMade)){\n\t\t\tselectOption(player, guess);\n\t\t}\n\t}", "title": "" }, { "docid": "38389f3c4ace5f5a394cb7e659f03a9a", "score": "0.6076974", "text": "function Player(choose) {\n \tthis.mark = choose;\n }", "title": "" }, { "docid": "a77f3a7388b314e16f818d93f36b9458", "score": "0.60753465", "text": "function setPlayer() {\n if (currentPlayer === 1) {\n if (playMode === 1) {\n currentPlayer = 3;\n titleStyle();\n ePlayer();\n } else {\n currentPlayer = 2;\n titleStyle();\n for (const cell of freeCells) {\n document.getElementById(cell).addEventListener('click', playMe, false);\n document.getElementById(cell).style.cursor = 'pointer';\n }\n }\n } else if (currentPlayer > 1) {\n currentPlayer = 1;\n titleStyle();\n for (const cell of freeCells) {\n document.getElementById(cell).addEventListener('click', playMe, false);\n document.getElementById(cell).style.cursor = 'pointer';\n }\n }\n}", "title": "" }, { "docid": "91365e7f4d87299eed91290502a07b4d", "score": "0.6072523", "text": "function select(playerChoice){\r\n checkResult(playerChoice);\r\n switch(playerChoice){\r\n case 'rock':\r\n playerRock.classList.add('selectedChoice');\r\n playerChoiceEl.textContent = ' --- Rock';\r\n break;\r\n case 'paper':\r\n playerPaper.classList.add('selectedChoice');\r\n playerChoiceEl.textContent = ' --- Paper';\r\n break;\r\n case 'scissors':\r\n playerScissors.classList.add('selectedChoice');\r\n playerChoiceEl.textContent = ' --- Scissors';\r\n break;\r\n case 'lizard':\r\n playerLizard.classList.add('selectedChoice');\r\n playerChoiceEl.textContent = ' --- Lizard';\r\n break;\r\n case 'spock':\r\n playerSpock.classList.add('selectedChoice');\r\n playerChoiceEl.textContent = '--- Spock';\r\n break;\r\n default:\r\n break; \r\n }\r\n}", "title": "" }, { "docid": "606980f830ab7c8e188337ea120b06eb", "score": "0.60500246", "text": "selectedChoiceChanged() {\n this.setValue(this.selectedChoice);\n }", "title": "" }, { "docid": "ba197776f003f7239def32e0c6c4b0d3", "score": "0.604863", "text": "setPlayerSelector(field){\n log(\"Setting player selector\");\n var innerHtml = \"\";\n\n for(var i = 0; i < field.length; i++){\n var player = field[i];\n innerHtml += '<option id=\"' + player.player_id + '\">' + player.name + \"</option>\\n\"\n }\n\n log(\"Custom Inner Html\");\n log(innerHtml);\n document.getElementById('playerSelect').innerHTML = innerHtml;\n }", "title": "" }, { "docid": "8bd77bd8894e447ff8017135efbb6103", "score": "0.60425735", "text": "'change select[name=\"west_player\"]'(event) {\n\t\tSession.set(\"current_west\", event.target.value);\n\t}", "title": "" }, { "docid": "3867055b96b2de808c127b8bc396fc46", "score": "0.6034842", "text": "function onPlayerChoice(choice) {\n const btn = document.getElementById(choice);\n // If there is other button selected change its class\n const btnSelected = document.getElementsByClassName('selected')[0];\n if (btnSelected) {\n btnSelected.setAttribute('class', 'icon visible');\n }\n // give selected class to the button\n btn.setAttribute('class', 'icon visible selected');\n playerChoice = choice;\n displayChoice(choice, 'player');\n}", "title": "" }, { "docid": "e2cddd3bb0f7d3914e87547ab394be6f", "score": "0.60335785", "text": "function player(gamePiece){ \r\n\t\tthis.gamePiece = gamePiece,\r\n\t\tthis.selection = [] \r\n\t}", "title": "" }, { "docid": "f756eb42454c8610ce8c04174dcb3c11", "score": "0.60151434", "text": "selectOption () {\n\n // Define an action for each option index\n let indexActions = [\n\n window.vrscribble.optionUndo,\n window.vrscribble.optionRedo,\n window.vrscribble.optionColourSphere,\n\n () => {\n if (!this.selectingOpacity) {\n\n this.opacityOpen = true\n this.selectingOpacity = true\n\n } else this.selectingOpacity = false\n },\n\n () => {\n if (!this.selectingThickness) {\n\n this.thicknessOpen = true\n this.selectingThickness = true\n\n } else this.selectingThickness = false\n },\n\n window.vrscribble.optionScreenshot,\n window.vrscribble.optionClear\n ]\n\n indexActions[this.selectedIndex]()\n\n // Update options bar, slider and cursor textures\n this.renderBar()\n this.Graphics.renderSlider(this.opacityOpen, this.thicknessOpen, this.User.brush.opacity, this.User.brush.thickness)\n this.User.renderCursor()\n }", "title": "" }, { "docid": "e9e4dc1f71bb8800afff9543ffcb97f4", "score": "0.6015107", "text": "function selectPlayer() {\n $(\".player-choice\").click(function () {\n console.log(\"inside select player\");\n if(this.id == 'xInp') {\n $($oInp).prop(\"disabled\", true);\n console.log(\"Player X selected\");\n\n isXSelected = true;\n isPlayerSelected = true;\n playerChoice = 'X';\n setMessage(`Turn ${playerChoice}`);\n }\n else if(this.id == 'oInp') {\n $($xInp).prop(\"disabled\", true);\n console.log(\"Player O selected\");\n isXSelected = false;\n isPlayerSelected = true;\n playerChoice = 'O';\n setMessage(`Turn ${playerChoice}`);\n }\n\n currentTurn = playerChoice;\n\n });\n\n }", "title": "" }, { "docid": "1eac0281aa106ed4ded3c6242390d05c", "score": "0.6007406", "text": "function randomSelectPlayer() {\n let idx = getRandomIndex(playerOption.length)\n\n if (idx === 0) {\n player1 = playerOption[0] \n player2 = playerOption[1]\n } else {\n player1 = playerOption[1]\n player2 = playerOption[0]\n }\n \n console.log(`${player1GameName}: ${player1} <==> ${player2GameName}: ${player2}`)\n // console.log(`player1: ${player1} <==> player2: ${player2} `)\n \n // player1 is current player when game starts/restarted\n currentPlayer = player1\n highlightActivePlayer()\n\n // assign X and O to player1 and player2\n player1Display.innerHTML = `${player1GameName}: ${player1}`\n player2Display.innerHTML = `${player2GameName}: ${player2}`\n}", "title": "" }, { "docid": "8e4fe1d1c5d87801331eb3cc8bff5378", "score": "0.59922284", "text": "getCurrentPlayer() {\n return this.playerX ? 'X' : 'O';\n }", "title": "" }, { "docid": "e0e6d687da67fa7c9be389eddc49d69d", "score": "0.5980172", "text": "function playerPlay(e) {\n if (e.target === rockButton) {\n playerSelection = 'rock';\n } else if (e.target === paperButton) {\n playerSelection = 'paper';\n } else if (e.target === scissorsButton) {\n playerSelection = 'scissors';\n }\n}", "title": "" }, { "docid": "1d5d6ab993358f328715e6ca3d293dc1", "score": "0.59670496", "text": "function userSelection(name, id) {\n\n //We iterate over all the available options that the player can choose from.\n for (let i = 0; i < SELECT_OPTIONS[0].length; i++) {\n //We check whether the user has previously selected an option by checking if it has a class called Selection.\n if ($(SELECT_OPTIONS[0][i]).hasClass('selected')) {\n //If the if statement returns true, we'll remove the selected class\n //so that there isn't multiple selections displayed.\n $(SELECT_OPTIONS[0][i]).removeClass('selected');\n //using DATA, we can store whether the user has clicked the option or not.\n // Then we can determine what option the user has selected.\n $(SELECT_OPTIONS[0][i]).data('selected', false);\n //Finally, we'll change the image to another image, so it adds more emphasis to what the user has selected.\n $(SELECT_OPTIONS[0][i]).attr('src', 'assets/resources/' + SELECT_OPTIONS[1][i] + '.png');\n }\n }\n\n //We check if the element has previously been selected.\n if ($(id).data('selected')) {\n //If it returns true, we'll remove the selected class.\n $(id).removeClass('selected');\n //We then change the DATA function back to false, which means that the user hasn't selected anything.\n $(id).data('selected', false);\n //We change our image back to the default state.\n $(id).attr('src', 'assets/resources/' + name + '.png');\n //Returns a null value, which means we haven't got a value.\n return null;\n } else {\n //Otherwise, we'll add the selected class.\n $(id).addClass('selected');\n //Return that the specific element has been selected.\n $(id).data('selected', true);\n //Change the image to the selected image.\n $(id).attr('src', 'assets/resources/' + name + '-selected.png');\n //Stores the users name into our userChoice variable.\n return userChoice = name;\n }\n}", "title": "" }, { "docid": "dbf3f5130d4aa54b04e02cfbad2e2e61", "score": "0.5964987", "text": "get selection() {\n return this._selection;\n }", "title": "" }, { "docid": "749a4f2d1c0ee70b2e2f3462ba7eded5", "score": "0.5954547", "text": "get playerID(){\n var e = document.getElementById('playerSelect');\n return e.options[e.selectedIndex].id;\n }", "title": "" }, { "docid": "6fc643077b207a415d6a803b5395ffe9", "score": "0.59532833", "text": "'change select[name=\"north_player\"]'(event) {\n\t\tSession.set(\"current_north\", event.target.value);\n\t}", "title": "" }, { "docid": "9860a55a6312122e0cb9712e9a1084e6", "score": "0.5951781", "text": "function updateSelected() {\n selected = Number.parseInt(elements.laptopSelect.value, 10);\n updateUI();\n }", "title": "" }, { "docid": "6d272c8377dad9f36f4009bb3053bee8", "score": "0.59425265", "text": "function Selected()\r\n{\r\n\tGetComponent.<SpriteRenderer>().sprite = ap_on_sprite;\r\n\tselected = true;\r\n}", "title": "" }, { "docid": "a22947d848ee08ebba4add64aa64596c", "score": "0.5932139", "text": "function playerChoice(choice) {\n\n}", "title": "" }, { "docid": "34cbbd185fcb232826ac7060aa4e5ded", "score": "0.5922531", "text": "updateSelection() {\n let selectedIndex = this.$('select')[0].selectedIndex;\n\n if (this.get('activeOption')) {\n this.set('selection', this.get('content').objectAt(this.get('activeOption')))\n } else {\n if (this.get('prompt')) {\n selectedIndex -= 1;\n }\n\n this.set('selection', this.get('content').objectAt(selectedIndex));\n\n }\n }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5908924", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "273c2782e798255de0bd1c76617e0b6c", "score": "0.58993775", "text": "function setPlayerChar(choice) {\n removeHoverAnimations();\n if(choice == \"Rock\") {\n playerRock.classList.add(\"charVisible\");\n setTimeout(resetCharVisible, 3550, playerRock);\n } else if(choice == \"Paper\") {\n playerPaper.classList.add(\"charVisible\");\n setTimeout(resetCharVisible, 3550, playerPaper);\n } else {\n playerScissors.classList.add(\"charVisible\");\n setTimeout(resetCharVisible, 3550, playerScissors);\n };\n setTimeout(addHoverAnimations, 3000);\n}", "title": "" }, { "docid": "167afdced3b82c77d91ece8a844d6c42", "score": "0.5866457", "text": "function ai_select(){\r\n\t\r\n\t\r\n\tif (selected == 0){\r\n\t\t\r\n\t\tai.taking = 0;\r\n\t\t\r\n\t} else if (selected == 1){\r\n\t\t\r\n\t\tai.taking = 3;\r\n\t\t\r\n\t\t\r\n\t} else if (selected == 2){\r\n\t\t\r\n\t\tai.taking = 2;\r\n\t\t\r\n\t} else if (selected == 3){\r\n\t\t\r\n\t\tai.taking = 1;\r\n\t}\r\n}", "title": "" }, { "docid": "f2c132ddc90b22b068066e4698bac723", "score": "0.5862192", "text": "make_chooser() {\n this.player_type = c.PlayerType.CHOOSER_TYPE;\n }", "title": "" }, { "docid": "ae0b2169d0bc44a5c96646d1464dc170", "score": "0.5859611", "text": "onChangePlayer(a) {\n this.setState({\n Player: a.target.value\n });\n }", "title": "" }, { "docid": "aef0dc505e360fe04997d6fd79ebf02b", "score": "0.58363444", "text": "function changePlayer() {\n // remove active display\n playerPanelDOM(activePlayer).classList.toggle('active');\n\n // reset roundscores\n currentScore = 0;\n playerRoundScoreDOM(activePlayer).textContent = 0;\n\n // change active player \n activePlayer === 0 ? activePlayer = 1 : activePlayer = 0;\n\n // add active display\n playerPanelDOM(activePlayer).classList.toggle('active');\n\n}", "title": "" }, { "docid": "f86c4f30d0b75b3e6be716443f4c3687", "score": "0.58318186", "text": "updatePlayerClass() {\n return this.currentPlayer === 'O' ? 'player1' : 'player2';\n }", "title": "" }, { "docid": "2d066b6502b679ac157f5b1ec2391a66", "score": "0.5814842", "text": "function playerInput(value) {\n\tplayer.input = value * 1; //if you remove the *1 everything breaks\n\n\tswitch (player.input) {\n\t\tcase 1:\n\t\t\tplayer.selection = \"Rock!\";\n\t\t\tplayer.img = \"assets/images/rock.svg\";\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\tplayer.selection = \"Paper!\";\n\t\t\tplayer.img = \"assets/images/paper.svg\";\n\t\t\tbreak;\n\t\tcase -1:\n\t\t\tplayer.selection = \"Scissors!\";\n\t\t\tplayer.img = \"assets/images/scissors.svg\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\talert(\"Something Broke. Unexpected value: \" + player.value);\n\t}\n}", "title": "" }, { "docid": "ddb917f233bec3190d9d171c84799028", "score": "0.5798887", "text": "function setComputerPicked() {\n this.computerPicked = this.availableTypes[(Math.random() * this.availableTypes.length) | 0]\n this.computerPickedDiv.innerHTML = this.computerPicked;\n }", "title": "" }, { "docid": "073f69fa6fd0938eaecb7ddaf54123da", "score": "0.579576", "text": "onTeamSelect() {\n Datas.Systems.soundConfirmation.playSound();\n const winTeam = this.windowChoicesTeam;\n const currentSelectedHero = winTeam.currentSelectedIndex;\n // If selecting the first hero to interchange\n if (this.selectedOrder === -1) {\n this.selectedOrder = currentSelectedHero;\n }\n else {\n this.swapHeroOrder(this.selectedOrder, currentSelectedHero);\n let graphic1 = winTeam.getContent(this.selectedOrder);\n let graphic2 = winTeam.getContent(currentSelectedHero);\n winTeam.setContent(this.selectedOrder, graphic2);\n winTeam.setContent(currentSelectedHero, graphic1);\n // Change background color\n winTeam.listWindows[this.selectedOrder]\n .selected = false;\n this.selectedOrder = -1;\n winTeam.select(currentSelectedHero);\n }\n }", "title": "" }, { "docid": "7be4f76338365c3534304fbceee0eedb", "score": "0.57884175", "text": "function presetSelected() {\n\t var name=this.getAttribute('value');\n\t document.getElementById('presetsPanel').style.display='none';\n\t\t//console.log('ev.target', ev.target);\n\t\t//console.log('val', ev.target.value);\n\t\tvar selected = presets.getSelected();\n\t\tvar updateEq = function () {\n\t\t\tfor (var i = 0; i < 10; i++) {\n\t\t\t\teq[i + 1].gain = selected.gains[i];\n\t\t\t}\n\t\t\tsetAllEqSliders();\n\t\t\tchart.prepareChart(eq);\n\t\t\tpropagateData();\n\t\t};\n\t\tswitch (name) {\n\t\t\tcase 'action::save':\n\t\t\t\tmodal.confirm('Do you want to save \"' + selected.name + '\" preset?', function () {\n\t\t\t\t\tfor (var i = 0; i < selected.gains.length; i++) {\n\t\t\t\t\t\tselected.gains[i] = getValue('ch-eq-slider-' + (i + 1));\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log('action::save', selected);\n\t\t\t\t\tpresets.setPreset(selected);\n\t\t\t\t});\n\n\t\t\t\tbreak;\n\t\t\tcase 'action::save_as':\n\t\t\t\tmodal.prompt('New preset name', function (name) {\n\t\t\t\t\tif (name && name.length > 0) {\n\t\t\t\t\t\tvar preset = JSON.parse(JSON.stringify(selected));\n\t\t\t\t\t\tfor (var i = 0; i < preset.gains.length; i++) {\n\t\t\t\t\t\t\tpreset.gains[i] = getValue('ch-eq-slider-' + (i + 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpreset.name = name;\n\t\t\t\t\t\tpresets.setNewPreset(preset);\n\t\t\t\t\t\tpresets.setSelected(name);\n\n\t\t\t\t\t}\n\t\t\t\t}, function () {\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'action::delete':\n\t\t\t\tmodal.confirm('Do you want to delete \"' + selected.name + '\" preset?', function () {\n\t\t\t\t\tpresets.removeByName(selected.name);\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'action::reset':\n\t\t\t\tmodal.confirm('Do you want to reset \"' + selected.name + '\" preset?', function () {\n\t\t\t\t\tpresets.reset(selected.name);\n\t\t\t\t\tpresets.setSelected();\n\t\t\t\t\t// setSelected calls getSelected internally, so no need calling again\n\t\t\t\t\tupdateEq();\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'action::reset_all':\n\t\t\t\tmodal.confirm('Do you want to reset all presets to default state?', function () {\n\t\t\t\t\tpresets.resetAll();\n\t\t\t\t\tpresets.setSelected();\n\t\t\t\t\tupdateEq();\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tvar val = (name).split('::');\n\t\t\t\tpresets.setSelected(val[2]);\n\t\t\t\tselected = presets.getSelected();\n\t\t\t\t// chrome.storage.local.set({\n\t\t\t\t// \tselected: selected.name\n\t\t\t\t// });\n\t\t\t\tupdateEq();\n\t\t}\n\t\t// chrome.storage.sync.set({\n\t\t// \tpresets: presets.getAll()\n\t\t// });\n\t}", "title": "" }, { "docid": "bc5e563e22849ea0755c46752820676e", "score": "0.57811916", "text": "function playerChange () {\n currentPlayer = currentPlayer === \"X\" ? \"O\" : \"X\";\n playerDisplay.innerHTML = currentPlayerTurn();\n}", "title": "" }, { "docid": "4c0ca26df5901823eeba5955a8bac79b", "score": "0.5773772", "text": "update(e) {\n\t\tthis.setState({ player: e.target.value });\n\t}", "title": "" }, { "docid": "e4f01c8d36b216758cc06bad4ea74e53", "score": "0.5769917", "text": "function playerSelection() {\n rock.addEventListener(\"click\", () => {\n let computersHand = computerSelection();\n let usersHand = \"rock\";\n play(computersHand, usersHand);\n scoreboard();\n });\n paper.addEventListener(\"click\", () => {\n let computersHand = computerSelection();\n let usersHand = \"paper\";\n play(computersHand, usersHand);\n scoreboard();\n });\n scissors.addEventListener(\"click\", () => {\n let computersHand = computerSelection();\n let usersHand = \"scissors\";\n play(computersHand, usersHand);\n scoreboard();\n });\n}", "title": "" }, { "docid": "638615a0d73984d07063c57865cac9cf", "score": "0.5767715", "text": "function update(selectedGroup) {\n\n var selectedteam = selectedGroup\n\n }", "title": "" }, { "docid": "638615a0d73984d07063c57865cac9cf", "score": "0.5767715", "text": "function update(selectedGroup) {\n\n var selectedteam = selectedGroup\n\n }", "title": "" }, { "docid": "0d67f131e6e601f93558e67405379465", "score": "0.5755988", "text": "function playGame(playerSelection) {\n\n let selection = getSelection(playerSelection);\n let computerSelection = selection[1];\n let score = getScore(playerSelection, computerSelection, playerScore, computerScore);\n playerScore = score[0];\n computerScore = score[1];\n displayScore(playerScore, computerScore);\n checkScore();\n}", "title": "" }, { "docid": "68817c15b8a04391bb0638cd093981b2", "score": "0.57532245", "text": "function selectSym(sym) {\n\thuPlayer = sym;\n\taiPlayer = (huPlayer == 'X') ? 'O' : 'X' ;\n\tdocument.querySelector('.selectSym').style.display = 'none';\n\tdocument.querySelector('.level').style.display = 'block'; // and moving to next selecting the difficulty level.\n}", "title": "" }, { "docid": "380bb5061f90fe213a52ff7aa185d3e0", "score": "0.5747896", "text": "function change_player() {\n // zeroing parameters for current player\n lastRoll = 0;\n currentScore = 0;\n document.getElementById('current-' + activePlayer).textContent = 0;\n // change player\n activePlayer === 0 ? activePlayer = 1 : activePlayer = 0;\n document.querySelector('.player-0-panel').classList.toggle('active');\n document.querySelector('.player-1-panel').classList.toggle('active');\n}", "title": "" }, { "docid": "39080ab493712dde627f6be5e0656646", "score": "0.5745856", "text": "function displayPlayerChoice(){\r\n switch(computerChoice){\r\n case 'rock':\r\n computerRock.classList.add('selectedChoice');\r\n computerChoiceEl.textContent = ' --- Rock';\r\n break;\r\n case 'paper':\r\n computerPaper.classList.add('selectedChoice');\r\n computerChoiceEl.textContent = ' --- Paper';\r\n break;\r\n case 'scissors':\r\n computerScissors.classList.add('selectedChoice');\r\n computerChoiceEl.textContent = ' --- Scissors';\r\n break;\r\n case 'lizard':\r\n computerLizard.classList.add('selectedChoice');\r\n computerChoiceEl.textContent = ' --- Lizard';\r\n break;\r\n case 'spock':\r\n computerSpock.classList.add('selectedChoice');\r\n computerChoiceEl.textContent = ' --- spock';\r\n break;\r\n default:\r\n break; \r\n }\r\n}", "title": "" }, { "docid": "022e3352f601cbdd229b3aa17a38b622", "score": "0.5738498", "text": "function choosePlayer(choice){\nif(!inPlay && asked){\n if(String(choice) == \"X\"){\n human.side = \"X\";ai.side = \"0\";\n selectorX.style.textShadow = \"4px 4px 4px black\";\n selectorO.style.textShadow = \"0px 0px 0px white\";\n selectorO.style.fontSize = \"1em\";}\n else{\n human.side = \"O\"; ai.side = \"X\";\n selectorX.style.textShadow = \"0px 0px 0px white\";\n selectorO.style.textShadow = \"4px 4px 4px black\";\n selectorX.style.fontSize = \"1em\";}\n }\n startButton.style.textShadow = \"2px 2px 2px #8F8F8F\";\n startButton.style.fontSize = \"1em\";\n inPlay = true;\n}", "title": "" }, { "docid": "6c30abccd075a04c3112c62d35778fab", "score": "0.5735284", "text": "function select(choice) {\r\n resetGestures();\r\n computerGesture();\r\n\r\n // Add selected styling and update player choice\r\n switch (choice) {\r\n case \"rock\":\r\n findoutWinner(playerRock, gestures.rock);\r\n break;\r\n case \"paper\":\r\n findoutWinner(playerPaper, gestures.paper);\r\n break;\r\n case \"scissors\":\r\n findoutWinner(playerScissors, gestures.scissors);\r\n break;\r\n case \"lizard\":\r\n findoutWinner(playerLizard, gestures.lizard);\r\n break;\r\n case \"spock\":\r\n findoutWinner(playerSpock, gestures.spock);\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n checkResult();\r\n}", "title": "" } ]
2aeb70dd6b5c54e9d680f29e2d8ea07b
Converts specified arguments object to array
[ { "docid": "144dd4fa81aa2bdc285a3544aaefdf8c", "score": "0.71061957", "text": "function arrgs(args) {\n if (!args || !(arguments.length <= 1 && _.isObject(args)) || _.isEmpty(args))\n return [];\n \n if (args.length > 1) return _.toArray(args);\n\n if (_.isArray(args[0])) return args[0];\n \n if (_.isString(args[0]) || _.isObject(args[0]))\n return [args[0]];\n}", "title": "" } ]
[ { "docid": "a993ac1a63848cba8570c57ec7f3f9e0", "score": "0.77022517", "text": "function args(o) { var a = []; for(var i=0, l=o.length; i<l; i++) a.push(o[i]); return a}", "title": "" }, { "docid": "8fa4d47ef9f15265ccfbf6f531293a11", "score": "0.7309774", "text": "function arr (args) {\n\tvar result = [];\n\tfor (var i=0; i<args.length; i++) {\n\t result.push(args[i]);\n\t}\n\treturn result;\n }", "title": "" }, { "docid": "af766b76ff6a9270c0393c62bbc3642c", "score": "0.7161387", "text": "function args() {\n return Array.prototype.slice.call(arguments[0]);\n }", "title": "" }, { "docid": "82c98d9d1f436ab931db2c07dfc06605", "score": "0.7158529", "text": "function collectArguments() {\n var args = arguments, i = args.length, arr = new Array(i);\n while (i--) {\n arr[i] = args[i];\n }\n return arr;\n }", "title": "" }, { "docid": "4962b14fe906bc3496d7ae464180dabe", "score": "0.7080764", "text": "function arr() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "80c6e1d567c27351f7b2eed28cd5f3f5", "score": "0.6870404", "text": "function castAsArray(arg) {\n if (!Array.isArray(arg)) {\n arg = [arg];\n }\n\n return arg;\n}", "title": "" }, { "docid": "c568a6663e702cf3b2c4c0c98fc50d83", "score": "0.6834788", "text": "function objectArray(){\n return arguments[0]\n}", "title": "" }, { "docid": "dee137eb9d0dd7cf35a4b8086ff57349", "score": "0.680078", "text": "function arrayMake(args) {\n return Array.prototype.slice.call(args);\n }", "title": "" }, { "docid": "cb68824dd165ac94250b537bd9824c10", "score": "0.6796274", "text": "_parseArguments() {\n\t\tcheckTrue(arguments.length === 1, \"Accumulator._parseArguments: Expected arguments to have length 1\");\n\t\n\t\tvar functionArguments = arguments[0];\n\t\n\t\t// If one argument and array, return it\n\t\tif((functionArguments.length === 1) && (functionArguments[0].constructor === Array)) {\n\t\t\t// Retrive the array in the previous arguments\n\t\t\treturn functionArguments[0];\n\t\t}\n\t\t\n\t\t// Transform arguments into array\n\t\treturn toArray(functionArguments);\n\t}", "title": "" }, { "docid": "47ed95340d651ca269bcf3ba59b0e353", "score": "0.6710088", "text": "function makeArray() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "47ed95340d651ca269bcf3ba59b0e353", "score": "0.6710088", "text": "function makeArray() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "47ed95340d651ca269bcf3ba59b0e353", "score": "0.6710088", "text": "function makeArray() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "47ed95340d651ca269bcf3ba59b0e353", "score": "0.6710088", "text": "function makeArray() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "47ed95340d651ca269bcf3ba59b0e353", "score": "0.6710088", "text": "function makeArray() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "638cb402086d0662a681e917d0330a7d", "score": "0.6634998", "text": "function args() {\n\t\tvar params = slice.call(arguments);\n\t\tparams.isArgs = true;\n\t\treturn params;\n\t}", "title": "" }, { "docid": "d84351f53b5c7421ba6c6ad83620c79f", "score": "0.6580264", "text": "function $a() {\n var args = $A(arguments).compact()\n if (args.length == 0) return []\n if (args.length == 1) {\n var first = args[0]\n if (!Object.isArray(first)) first = [first]\n return first\n }\n return args\n}", "title": "" }, { "docid": "6fbd12f99fa649b519203a1ff81ddfdc", "score": "0.65446854", "text": "function getArgs() {\n var result = [];\n var i;\n for (i = 0; i < args.length; i++) result.push(args[i]);\n return result;\n }", "title": "" }, { "docid": "de5f7a0fa76ccdce3cef411b6b29b17a", "score": "0.6544021", "text": "function dataCleaner() {\n return Array.from(arguments);\n }", "title": "" }, { "docid": "583ac855bbdce59c61de8fb8fca191be", "score": "0.6524103", "text": "function makeArrayOfItems () {\n return Array.from(arguments)\n}", "title": "" }, { "docid": "fe5e9f41277e4e3b69540748e22dcc33", "score": "0.64678663", "text": "getARGs() {\n let args = [];\n for (let instruction of this.instructions) {\n if (instruction instanceof arg_1.Arg) {\n args.push(instruction);\n }\n }\n return args;\n }", "title": "" }, { "docid": "8c8a252abd30ffb1f6271fecd52238e5", "score": "0.64581954", "text": "function ArrayArgument() {\n this.args = [];\n}", "title": "" }, { "docid": "8c8a252abd30ffb1f6271fecd52238e5", "score": "0.64581954", "text": "function ArrayArgument() {\n this.args = [];\n}", "title": "" }, { "docid": "9900a7576c2f004427fa584119614bca", "score": "0.64478594", "text": "function f(){\n\n\treturn Array.from(arguments);\n}", "title": "" }, { "docid": "24645b56a64024e5f223d01c7fca7f9f", "score": "0.63887674", "text": "function makeArray(name, ...args) {\n //unknown number of params.\n return args;\n}", "title": "" }, { "docid": "a6f7b690f270f7844380a7e7b56c5971", "score": "0.63796824", "text": "function getArguments(args) {\n if (args.length <= 2) return null;\n\n // splice on arguments prevents js optimisation, so we do it a bit longer way\n var arg = [];\n for (var i = 2; i < args.length; i++)\n arg.push(args[i]);\n\n return arg;\n }", "title": "" }, { "docid": "b6ac7a2891a9e23e29475b416139c1ab", "score": "0.63715345", "text": "function getArguments(...args) {\n return args;\n}", "title": "" }, { "docid": "65153f16d3cdcf5972e10866e934da7d", "score": "0.63124037", "text": "function normalizeArr() {\n\t var args = new Array(arguments.length);\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i];\n\t }\n\t if (Array.isArray(args[0])) {\n\t return args[0];\n\t }\n\t return args;\n\t}", "title": "" }, { "docid": "d7d029d2e0dd29d12deb5c586192c1d4", "score": "0.6307094", "text": "function get_args(args) {\n return args.map(function (arg) {\n return [arg.TYPE, arg.name];\n });\n }", "title": "" }, { "docid": "fde2202bb741d2c17b3560d6f83fe28d", "score": "0.6294661", "text": "function copyArgs(args) {\n return Array.prototype.slice(args);\n }", "title": "" }, { "docid": "1682a7b43e4e368a82a373facca11626", "score": "0.62670803", "text": "function makeArray(arg) {\n if (Array.isArray(arg)) {\n return arg;\n }\n\n return [arg];\n}", "title": "" }, { "docid": "59df406d7a3ded6f9fe8f0778bbefc2e", "score": "0.6257578", "text": "function makeArray(name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "fda1d5ae7aef7dd0d0eb50a2259be1c7", "score": "0.624132", "text": "function convertArgs(args, fromKey, toKey) {\n return args.map(arg => convert(arg, fromKey, toKey));\n}", "title": "" }, { "docid": "3ab0426c519a6fe9738fdbdbe7791854", "score": "0.6210244", "text": "function normalizeArr() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n if (Array.isArray(args[0])) {\n return args[0];\n }\n return args;\n}", "title": "" }, { "docid": "23472956024e4962a14cea6491828c57", "score": "0.6199876", "text": "function list() {\n var a = arrayfromargs(arguments);\n myval.push(a);\n\n\n}", "title": "" }, { "docid": "73731bf27f326a94936102cd34af0874", "score": "0.6193143", "text": "function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) {\n // support array\n params = params[0];\n }\n return params\n }", "title": "" }, { "docid": "616671fe20bbd40564b46e42eb6d0b2d", "score": "0.61740357", "text": "function a(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,r++)o[r]=i[s];return o}", "title": "" }, { "docid": "d7b9994f8f47ffd1535362d8a71c3c79", "score": "0.6171922", "text": "function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) { // support array\n params = params[0];\n }\n return params;\n }", "title": "" }, { "docid": "d7b9994f8f47ffd1535362d8a71c3c79", "score": "0.6171922", "text": "function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) { // support array\n params = params[0];\n }\n return params;\n }", "title": "" }, { "docid": "d7b9994f8f47ffd1535362d8a71c3c79", "score": "0.6171922", "text": "function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) { // support array\n params = params[0];\n }\n return params;\n }", "title": "" }, { "docid": "3531c3ab7ca0ea6cdc8106b7235befe2", "score": "0.6151841", "text": "function marshal(params, method) {\n var result = [];\n\n if (isArray(params)) {\n result = params;\n } else if (params) {\n for (var k in params) {\n if (isNumber(method.args[k])) {\n result[method.args[k]] = params[k];\n }\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "ce15b55d737c161740c3e1c6cb13d934", "score": "0.61453456", "text": "function parseArgs(args /*: Array<any>*/) /*: Array<string>*/ {\n\t return args.map(function (val) {\n\t if (val != null && val.inspect) {\n\t return val.inspect();\n\t } else {\n\t try {\n\t return JSON.stringify(val) || val + \"\";\n\t } catch (e) {\n\t return util.inspect(val);\n\t }\n\t }\n\t });\n\t}", "title": "" }, { "docid": "78657b70c4b9ed3eb068173932df09f1", "score": "0.6143582", "text": "function test(){\n console.log(arguments); // Arguments(5) [3, 4, 5, 6, 7, callee: ƒ, Symbol(Symbol.iterator): ƒ] - argumets will be as an object here \n console.log([...arguments]); // [3, 4, 5, 6, 7] - after spread argumets will be as an array\n}", "title": "" }, { "docid": "e7dbffbc025d66752572ac8dee0ddb9b", "score": "0.61366034", "text": "function getArguments() {\n return arguments;\n}", "title": "" }, { "docid": "844b0c7cad0c01c50e95336d72fdef81", "score": "0.61362803", "text": "function f() {\n return Array.from(arguments)\n}", "title": "" }, { "docid": "c7774e923cfe62b960ee6c9b3c2a9769", "score": "0.61334294", "text": "function f() {\n return Array.from(arguments);\n}", "title": "" }, { "docid": "faa16cb966c8b8cdc6c00bb0c9ef9ed5", "score": "0.6119158", "text": "function f() {\r\n return Array.from(arguments);\r\n}", "title": "" }, { "docid": "403daf3f327832493786ffdec590887c", "score": "0.6112796", "text": "function s(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var a=Array(e),l=0;for(t=0;t<n;t++)for(var o=arguments[t],i=0,r=o.length;i<r;i++,l++)a[l]=o[i];return a}", "title": "" }, { "docid": "c189ce7ea9065a592c56f2c83984d0e9", "score": "0.61104846", "text": "function initArray() {\n\tthis.length = initArray.arguments.length;\n\tfor (var i = 0; i < this.length; i++ {\n\t\tthis[i] = initArray.arguments[i];\n\t}\n}", "title": "" }, { "docid": "c277d23ce3a9a8697eee082c32fb8ed3", "score": "0.61070746", "text": "static cast(...args) {\r\n return args.map(x => Vec.from(x));\r\n }", "title": "" }, { "docid": "600cc7cff1ad5b0047181091f6ed35c6", "score": "0.6057473", "text": "function generatorToArray(generator, ...args) {\n const result = [];\n generator(...args, x => result.push(x));\n return result;\n}", "title": "" }, { "docid": "4a626064cb214e18dc611b3eb44a74d9", "score": "0.6057013", "text": "function rewriteArgs(args) {\n\tvar newArgs = new Array(args.length)\t\n\n\tfor (var i=0;i<args.length;i++) {\n\t\tif ((args[i] instanceof Object)&&(args[i].__raw!=undefined)) {\n\t\t\tnewArgs[i]=args[i].__raw;\n\t\t} else newArgs[i]=args[i];\n\t}\n\treturn newArgs;\n}", "title": "" }, { "docid": "3383a037eac12f858d453856cdd94ae3", "score": "0.60365593", "text": "function h(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,l=a.length;o<l;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "c9eb8f4fdf7631aac2ff6ab501b0dbe8", "score": "0.59984636", "text": "function foo(){\n var arr = Array.prototype.slice.call( arguments );\n arr.push( 'bam' );\n console.log( arr );\n}", "title": "" }, { "docid": "c59df304a354a680d6e4502c2b91e6e2", "score": "0.5998033", "text": "function cleanArgsAndSerialize(args) {\n const cleaned = cleanArgs(args);\n\n return cleaned.map((arg) => (typeof arg === 'object' ? serialize(arg) : arg));\n}", "title": "" }, { "docid": "6049bdcbdbb8ccd5c5976fd242cdd914", "score": "0.5986233", "text": "function packageArgs(args) {\n\t\tvar params = slice.call(args);\n\t\tparams.isArgs = true;\n\t\treturn params;\n\t}", "title": "" }, { "docid": "9a2bf69a978ed03455ac0015207b29f2", "score": "0.5983632", "text": "toArray() {}", "title": "" }, { "docid": "9a2bf69a978ed03455ac0015207b29f2", "score": "0.5983632", "text": "toArray() {}", "title": "" }, { "docid": "9a2bf69a978ed03455ac0015207b29f2", "score": "0.5983632", "text": "toArray() {}", "title": "" }, { "docid": "92980e68538158565182b2a270d245fe", "score": "0.59822154", "text": "function xa(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}", "title": "" }, { "docid": "ca7e0fa16eb59b1671d6ee8e31cc1d75", "score": "0.59813905", "text": "function l(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var a=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],i=0,l=o.length;i<l;i++,r++)a[r]=o[i];return a}", "title": "" }, { "docid": "bad0f92d444558ec1d53227993dfd064", "score": "0.5960064", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "bad0f92d444558ec1d53227993dfd064", "score": "0.5960064", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "bad0f92d444558ec1d53227993dfd064", "score": "0.5960064", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "6b7661ec7c9e68500414f5c770f0e991", "score": "0.59496516", "text": "function l(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var a=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,r++)a[r]=i[o];return a}", "title": "" }, { "docid": "9b40fca3b0b81769819d648f89be0a06", "score": "0.59447914", "text": "function toArray(obj) {\n\t return isArray(obj) ? obj : [obj];\n\t }", "title": "" }, { "docid": "7b90a1b6ca900d4e88629d1c0dd4d11a", "score": "0.5941517", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "7b90a1b6ca900d4e88629d1c0dd4d11a", "score": "0.5941517", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "7b90a1b6ca900d4e88629d1c0dd4d11a", "score": "0.5941517", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "18d62b02161c3d6983732e24a3c2422d", "score": "0.59346956", "text": "function argsFor() {\n\n}", "title": "" }, { "docid": "a05cacfc2a312b96d2a5a300cb3c09eb", "score": "0.59288794", "text": "function listToArray(arg) {\n\n let array = [];\n \n while (true) { \n if (arg.ref === null) {\n array.push(arg.value);\n break;\n }\n \n array.push(arg.value);\n arg = arg.ref;\n \n }\n \n return array;\n \n}", "title": "" }, { "docid": "6af147419e4377da572325f5c837f958", "score": "0.5925752", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}", "title": "" }, { "docid": "50c701842c33168764442c889cd58c91", "score": "0.59141153", "text": "function _tackOnArguments(args, from, to){\n var newArgs = [], i;\n\n for (i = from; i < to; i+=1){\n newArgs.push(args[i]);\n }\n\n return newArgs;\n }", "title": "" }, { "docid": "53512724f17152a69e04907f99dc59fa", "score": "0.59102803", "text": "function sortArguments() {\n let args = Array.from(arguments); // converting in to an array.\n let sortedArgs = args.sort();\n return sortedArgs;\n}", "title": "" }, { "docid": "1de55732cf501596e9d25a4cdde67f4f", "score": "0.58950645", "text": "function makeArray(arg1, arg2) {\n return [arg1, arg2];\n}", "title": "" }, { "docid": "bfcfe76049314c4859b3883939458ccd", "score": "0.58908105", "text": "function ae(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)r[o]=a[i];return r}", "title": "" }, { "docid": "25ee46b37b29717038861f4d18f70588", "score": "0.5879113", "text": "function argumentsArray() {\n console.log(\"argumentsArray() called\");\n \n // IE11: Not Supported\n console.log(\"IE11: for of loop Not Supported\");\n //for (let value of arguments) console.log(value);\n\n return arguments.length + \" arguments passed in\";\n}", "title": "" }, { "docid": "298bc45ddef23a99786a5d3fe24429e5", "score": "0.58782923", "text": "function h() {\n for (var e = 0, t = 0, r = arguments.length; t < r; t++) e += arguments[t].length;\n var n = Array(e),\n i = 0;\n for (t = 0; t < r; t++)\n for (var a = arguments[t], o = 0, s = a.length; o < s; o++, i++) n[i] = a[o];\n return n\n }", "title": "" }, { "docid": "933e0151f602a6c3f707fd7908666a14", "score": "0.5870427", "text": "unspread(args) {\n return args;\n }", "title": "" }, { "docid": "f32b8ee24e2b773cbdd1eebeb23d5241", "score": "0.58542645", "text": "function e(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var a=Array(e),l=0;for(t=0;t<n;t++)for(var r=arguments[t],o=0,i=r.length;o<i;o++,l++)a[l]=r[o];return a}", "title": "" }, { "docid": "77ce2913b5e3e914211f3edfc3defbab", "score": "0.5853243", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "f8f1cfee1e534e8ffb2aac3ed4170a74", "score": "0.5848159", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "073d7beef423f2b32e62f492c26b6b5d", "score": "0.5843967", "text": "function xdtlArray() {\n\tvar a = new java.util.ArrayList(arguments.length);\n\tfor (var i = 0; i < arguments.length; i++) {\n\t\ta.add(arguments[i]);\n\t}\n\n\treturn a;\n}", "title": "" }, { "docid": "0daec54597f7efdef7180513bc9ac075", "score": "0.5839727", "text": "function h(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,c=a.length;i<c;i++,o++)n[o]=a[i];return n}", "title": "" }, { "docid": "bf5d6d6ee04d87583100598b462ee800", "score": "0.5833987", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "bf5d6d6ee04d87583100598b462ee800", "score": "0.5833987", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "accdccb430284d33c38690bb3146628f", "score": "0.58268106", "text": "function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length\nvar r=Array(e),o=0\nfor(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a]\nreturn r}", "title": "" } ]
7356f14012f44926deacddd693d13035
Delete variant in modalCart
[ { "docid": "044e3135991e78c90aff1996481d9add", "score": "0.7720134", "text": "function deleteCart(variant_id){\n\tvar params = {\n\t\ttype: 'POST',\n\t\turl: '/cart/change.js',\n\t\tdata: 'quantity=0&id=' + variant_id,\n\t\tdataType: 'json',\n\t\tsuccess: function(cart) {\n\t\t\tgetCartModal();\n\t\t},\n\t\terror: function(XMLHttpRequest, textStatus) {\n\t\t\tHaravan.onError(XMLHttpRequest, textStatus);\n\t\t}\n\t};\n\tjQuery.ajax(params);\n}", "title": "" } ]
[ { "docid": "2c9f296a3e0f80c5d24204d29b2aec0d", "score": "0.6944317", "text": "deleteProduct(product){\n this.props.selectStateProduct(product);\n this.props.showDeleteModal();\n }", "title": "" }, { "docid": "28c79ee374fb53e5cb5586a384844039", "score": "0.68588084", "text": "function deleteProd(pd){\n $('.productD').attr('keyD',pd);\n $('#deleteProduct').modal('show');\n}", "title": "" }, { "docid": "16bcbcb460366c51292e40f427de2038", "score": "0.6767844", "text": "deleteProduct(){\r\n let productDelete = document.querySelector(\"#delete\").value;\r\n this._table.quitFromInventory(productDelete);\r\n this.printInventory();\r\n }", "title": "" }, { "docid": "eb25ce4ecabf86d1cc1bad2f11003e2b", "score": "0.6701718", "text": "deleteClickFromShopping(target) {\n this.deleteButtonChange(target)\n Store.removeItem(target.id);\n\n let target_button = document.getElementById(target.id + \"X\");\n target_button.parentElement.parentElement.remove();\n\n this.updateCartTotal();\n }", "title": "" }, { "docid": "cd5269a94aec698624dec7bded12418d", "score": "0.67014205", "text": "onDelete() {\n\t\t$(\".aimeos.basket-bulk\").on(\"click\", \".buttons .delete\", ev => {\n\t\t\t$(ev.currentTarget).parents(\".details\").remove();\n\t\t});\n\t}", "title": "" }, { "docid": "07ede8cb796b6f22398a1e6a2e68106a", "score": "0.66732806", "text": "function updateDeleteButton() {\n let deleteSpans = document.querySelectorAll('.delete');\n if(deleteSpans.length > 0) {\n deleteSpans.forEach(span => {\n span.addEventListener(\"click\", (e)=> {\n if (confirm(\"Voulez-vous supprimer l'article ?\")) {\n let teddyId = e.target.dataset.id;\n let teddyPrice = parseInt(document.getElementById(\"teddy\"+teddyId).dataset.price);\n let quantity = parseInt(document.getElementById(\"quantity\"+teddyId).innerHTML);\n \n // Met à jour les products\n let index = products.findIndex(id => id == teddyId);\n if(index > -1) {\n products.splice(index, 1);\n \n updateTotal(\"minus\", teddyPrice * quantity);\n \n // Met à jour les productQuantities\n let productIndex = productQuantities.findIndex(produit => produit.id == teddyId);\n \n if(productIndex > -1) productQuantities.splice(productIndex, 1);\n \n updateArticleQuantityInBasket();\n localStorage.setItem(\"products\", JSON.stringify(products));\n localStorage.setItem(\"productQuantities\", JSON.stringify(productQuantities));\n \n document.querySelector(\"div[data-containerId='\" + teddyId + \"']\").remove();\n }\n }\n })\n })\n }\n}", "title": "" }, { "docid": "776056f2e3fbb5b444e005e39d841fb1", "score": "0.66062975", "text": "function deleteItem(target) {\n \n var parents = target.parents(\".wrap-item-cart\");\n parents.css(\"text-align\", 'center').html('<img src=\"'+ base_url +'public/img/load.gif\">');\n\n $.ajax({\n url: target.attr('href'),\n method: 'POST',\n data: {data: 'data'},\n success: function(data) {\n\n data = JSON.parse(data);\n if (data.status == 'ok') {\n\n if (typeof data['user_cart'] === 'object' && !Array.isArray(data['user_cart']) && data['user_cart'] !== null) {\n\n parents.find(\"img\").remove().empty();\n parents.remove().empty();\n assignTotal (data['user_cart']);\n\n } else {\n\n $(\"#wrap-item\").html(\"Giỏ hàng đang trống\");\n $(\"#wrap-item\").css(\"text-align\", 'center');\n $(\".money\").html(\"-\");\n }\n\n }else {\n\n window.location.href = base_url;\n }\n }\n });\n}", "title": "" }, { "docid": "22655b79a3c0d57e00e7ee343b13be70", "score": "0.6599624", "text": "function delspecproduct() {\n $(document).on('click', '.btn-danger', function () {\n let z = $(this).closest('tr').index();\n // console.log(z);\n\n if (onlyUser == null || onlyUser[0] == undefined) {\n var cartp = localStorage.getItem('carts');\n cartp = JSON.parse(cartp);\n\n cartp.splice(z, 1);\n cartp = localStorage.setItem('carts', JSON.stringify(cartp));\n\n $(this).closest('tr').remove();\n } else {\n profile[onlyUser[1]].userCart.splice(z, 1);\n localStorage.setItem('UserInfo', JSON.stringify(profile));\n\n $(this).closest('tr').remove();\n }\n\n showandhidenocart();\n chkcartnum();\n subtotalfn()\n })\n }", "title": "" }, { "docid": "6838b5e0739c7e5cc9a0891d8c76de3e", "score": "0.6583569", "text": "function deleteProduct(event) {\n //nouveau panier\n var cart = new Cart;\n var id = $(this).attr('name');\n //on récupère le panier déjà enregistré\n var curentCart = JSON.parse(localStorage.getItem('panier'));\n //si il existe, on le manipule pour l'afficher plus tard\n if (curentCart != null) {\n cart.cartListQte = curentCart.cartListQte;\n cart.products_names = curentCart.products_names;\n cart.products_prices = curentCart.products_prices;\n cart.img_url = curentCart.img_url;\n }\n cart.deleteProduct(id);\n //écrasement des données dans le local\n localStorage.setItem('panier', JSON.stringify(cart));\n //écriture du nouveau panier\n writeCart();\n}", "title": "" }, { "docid": "b26a7b9aaa5cff970a39546bc107231b", "score": "0.65653837", "text": "removeCart(context, key){\n context.commit('deleteCart', key);\n }", "title": "" }, { "docid": "018df4abc65fc35a33c98f6563619971", "score": "0.6554063", "text": "deleteClickFromCart(target) {\n if (target.classList.contains('delete')){ \n\n let id = target.classList[1];\n let target_button = document.getElementById(id);\n Store.removeItem(id);\n\n target.parentElement.parentElement.remove();\n //(pending) change addtocart button\n\n this.deleteButtonChange(target_button)\n }\n }", "title": "" }, { "docid": "367b0439421528504a7eb9931170a595", "score": "0.6542208", "text": "function reloadDelete(event) {\n var buttonClicked = event.target\n buttonClicked.parentElement.parentElement.parentElement.remove()\n updateCartTotal()\n // this is what deletes items from session storage\n let sessionItem = buttonClicked.parentElement.parentElement.parentElement.children[0].children[1].innerText\n let sessionItemCart = JSON.parse(sessionStorage.getItem('productInCart'))\n let product = {\n name: sessionItem,\n }\n let sessionKey = sessionItemCart[product.name].name\n if(sessionKey == sessionItem) {\n var sessionItemStorage = JSON.parse(sessionStorage.getItem('productInCart'))\n var key = sessionKey\n delete sessionItemStorage[key]\n //console.log(sessionItemStorage)\n }\n sessionStorage.setItem('productInCart', JSON.stringify(sessionItemStorage));\n // when you remove an item from the cart this takes it off the session storage\n let cartNumbers = sessionStorage.getItem('itemNumbers');\n sessionStorage.setItem('itemNumbers', cartNumbers - 1);\n document.querySelector('.badge').textContent = cartNumbers - 1;\n document.querySelector('.badge-sidenav').textContent = cartNumbers - 1;\n}", "title": "" }, { "docid": "d257bb2230fc95253cb9835f9fba42b9", "score": "0.65230966", "text": "deleteProduct(deleteButton){\r\n if (deleteButton.name == \"delete\") {\r\n deleteButton.parentElement.parentElement.parentElement.remove()\r\n this.showMessage(\"Produto deletado com sucesso\", \"success\")\r\n }\r\n }", "title": "" }, { "docid": "8127c56440dc4adf1c3630fa96401784", "score": "0.6517765", "text": "function deleteCartItem(event){\n var buttonClicked = event.target;\n buttonClicked.parentElement.remove();\n updateFinalSum();\n}", "title": "" }, { "docid": "ea962577e848de1a01e2ad12e89d7c87", "score": "0.6516615", "text": "function btnDel() {\n\n if(editSelectedId != null) {\n var res = confirm(\"Tem certeza que deseja remover este produto?\")\n if(res == true) {\n database.ref('products/' + editSelectedId).remove()\n\n $('#del').modal('toggle');\n }\n\n } else {\n alert(\"Selecione um produto para remover\")\n }\n}", "title": "" }, { "docid": "52d2f058f0fdb656a12e3f4d8b793e92", "score": "0.64987713", "text": "delete(item) {\n let arr = this.get('items')\n let elementIndex = arr.findIndex(obj => {\n return obj.id === item.id\n })\n\n let quantity = arr[elementIndex].ordered_quantity\n if (elementIndex !== -1) {\n arr.removeAt(elementIndex)\n }\n this.set('cart.count', this.get('count') - quantity)\n }", "title": "" }, { "docid": "fc0cdd0b681ce54a9458ec41c4e58f9f", "score": "0.64971423", "text": "removeProduct(indexid){\r\n const params={\r\n cancel:this.handleCancel,\r\n confirm:this.handleConfirm,\r\n indexid\r\n }\r\n const modal = (<DeleteMessage {...params}/>);\r\n this.setState({modal});\r\n }", "title": "" }, { "docid": "ae0e64809a0dab0ce47093e589be5e86", "score": "0.64703643", "text": "deleteProduct(index) {\n lodash__WEBPACK_IMPORTED_MODULE_4__[\"remove\"](this.productsOrder, (n) => {\n return n.id == index;\n });\n this.initTotal(this.productsOrder);\n this.cookie.addCookie('products', JSON.stringify(this.productsOrder));\n if (this.productsOrder.length == 0) {\n this.promoValue = 0;\n this.promoInit = \"\";\n this.total = 0;\n }\n }", "title": "" }, { "docid": "e7e921bbac8c7278acbac66c128f983b", "score": "0.6455842", "text": "static handleShoppingCartDelete(clickedItem) {\n const elementClicked = clickedItem.target;\n if (elementClicked.nodeName === 'I') {\n shoppingCart.deleteItem(elementClicked.parentElement.id);\n }\n }", "title": "" }, { "docid": "9eb7ba821a4f1ca091dc9d50dbfc6709", "score": "0.6444237", "text": "confirmDelete(product){\n this.props.removeArrayProduct(product);\n }", "title": "" }, { "docid": "21566fcb6891919e37396052ec3f82ba", "score": "0.6422365", "text": "function deleteProduct() {\n // search index of the product in cartStorage\n let idItem = this.getAttribute(\"id\").split(\"_\")[1] /* 'test' */;\n let indexItem = cartStorage.findIndex(item => item._id === idItem);\n\n // if product exist\n if (indexItem > -1) {\n // Delete product in cartStorage\n cartStorage.splice(indexItem, 1);\n // Send the new array to LocalStorage\n localStorage.setItem('myCart', JSON.stringify(cartStorage))\n // Delete html showing the product\n this.parentElement.parentElement.remove();\n // show new total price of cart\n totalDiv.textContent = euroFormat(calcTotal());\n // Show new number of products in cart\n showCountCart();\n }\n}", "title": "" }, { "docid": "34d1ee2834dfba77f07c3c3d29b8cfa6", "score": "0.63964754", "text": "function deleteproducts(id){\r\n let item = getProductByID(products, id);\r\n let index = cart.findIndex(function (product) {\r\n return product.id == id;\r\n });\r\n cart.splice(index, 1);\r\n count -= 1;\r\n document.getElementById(\"count\").innerText = count;\r\n let who = \"cartdisplay\";\r\n let where = \"cartitem\";\r\n displayProducts(cart, who, where);\r\n}", "title": "" }, { "docid": "bd3529f8bf2373992805539c732117d1", "score": "0.63916963", "text": "function DeleteProductMaster(this_obj) {\n debugger;\n productVM = _dataTable.productList.row($(this_obj).parents('tr')).data();\n notyConfirm('Are you sure to delete?', 'DeleteProduct(\"' + productVM.ID + '\")');\n}", "title": "" }, { "docid": "292b427aac5824e04517c4e68c269850", "score": "0.6390545", "text": "function wgsRemoveProductFromCart(obj){\n jQuery(obj).attr('disabled', true);\n var removeType = jQuery(\"#inputRemoveItemType\").val();\n jQuery.post(\"cart.php\", 'ajax=1&' + jQuery(\"#form-remove-product\").serialize(),\n function (data) {\n\t if (data != '') {\n\t\t cartsummary();\n\t } else {\n\t\t cartsummary();\n\t\t jQuery('#containerProductValidationErrors').addClass('hidden').html('');\n\t }\n\t\tif(removeType == 'd'){\n\t\t\tvar domainNamesd = jQuery(obj).attr('remove-data-d');\n\t\t\tjQuery(\".domain-result-box\").find(\"button.removeBtnCat\").each(function(){\n\t\t\t\tif(jQuery(this).attr(\"data-domain-name\") == domainNamesd){\n\t\t\t\t\tjQuery(this).addClass(\"hidden\");\n\t\t\t\t\tjQuery(this).prev(\"button\").removeClass(\"hidden\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif(removeType == 'p'){\n\t\t\tvar iValue = jQuery(\"#inputRemoveItemRef\").val();\n\t\t\tvar formClass = jQuery(\"#frmConfigureProduct\").attr(\"class\");\n\t\t\tvar classmatch = 'pidConf'+iValue;\n\t\t\tvar productIds = jQuery(obj).attr('remove-data-p');\t\n\t\t\tif(formClass == classmatch){\n\t\t\t\tjQuery(\"#prod\"+productIds).removeAttr('checked');\n\t\t\t}else{\n\t\t\t\tjQuery(\"input[name='productRadio']\").removeAttr('checked');\n\t\t\t}\n\t\t\tjQuery(\".wgs_product_configuration\").addClass(\"hidden\");\n\t\t\tjQuery(\".wgs_product_configuration\").html('');\n\t\t}\n\t\twgsDomainConfigureAddDomain();\n\t\twgsLoadCheckoutPage();\n\t\tjQuery(obj).attr('disabled', false);\n\t\tjQuery(\"#modalRemoveItem\").modal(\"hide\");\n });\n jQuery('body').removeClass(\"modal-open\");\n jQuery('body').removeAttr(\"style\");\n}", "title": "" }, { "docid": "06c00b9b228bf15ab9e662d0e4558ea1", "score": "0.638127", "text": "async removeFromCart(parent, args, ctx, info) {\n return ctx.db.mutation.deleteCartItem({\n where: { id: args.id },\n });\n }", "title": "" }, { "docid": "eabdde47c76b78c1489c177a4c9de355", "score": "0.63754904", "text": "deleteCart(state, key){\n state.carts.splice(key, 1);\n localStorage.setItem(btoa('carts'), btoa(JSON.stringify(state.carts)));\n }", "title": "" }, { "docid": "752d3c20b97265d5d20708ee53e203da", "score": "0.6371261", "text": "function removeItemFromCart(event) {\n event.preventDefault();\n if (event.target.id !== null) {\n parcedArray.splice(event.target.id, 1);\n localStorage.clear();\n let deletedArr = JSON.stringify(parcedArray);\n localStorage.setItem('allProducts', deletedArr);\n productsToArr();\n }\n}", "title": "" }, { "docid": "218d52b77dde3e33726577d731f8f378", "score": "0.6369795", "text": "function deleteStockItem(pk, options={}) {\n var url = `/api/stock/${pk}/`;\n\n var html = `\n <div class='alert alert-block alert-danger'>\n {% trans \"Are you sure you want to delete this stock item?\" %}\n </div>`;\n\n constructForm(url, {\n method: 'DELETE',\n title: '{% trans \"Delete Stock Item\" %}',\n preFormContent: html,\n onSuccess: function(response) {\n handleFormSuccess(response, options);\n }\n });\n}", "title": "" }, { "docid": "8255f034e2aa0169a2abc74e369eef57", "score": "0.63563794", "text": "function deleteStock(e) {\n var indexToDelete = $(e.target).closest('div').index();\n var storedStock = storage.get();\n storedStock.splice(indexToDelete, 1);\n storage.set(storedStock);\n renderStored();\n\n }", "title": "" }, { "docid": "881451c7f28f61a89de6bff62a11a635", "score": "0.6339764", "text": "deleteItem(target) {\n if (target.className === \"delete\") {\n target.parentElement.remove();\n this.showAlert(\"Grocery Item Removed!\", \"success\");\n Store.removeItem(target);\n }\n }", "title": "" }, { "docid": "3065d57ea61a468f3adfddee0ddbc2c4", "score": "0.63298386", "text": "function removeCartItem(event) {\n //on déclare une var buttonClicked dans laquelle on stocke la ref du btn qui a été cliqué\n //le \".target\" cible exactement le btn cliqué\n var buttonClicked = event.target\n //Supprime la div \"gd-parent du bouton\".\n buttonClicked.parentElement.parentElement.remove()\n //MAJ du prix total\n updateCartTotal()\n} //supprime le parent de l'article dans notre panier au clique du bouton \"remove\" (supprimer)", "title": "" }, { "docid": "beb236a511df534e1283bdfcbf977491", "score": "0.631884", "text": "function delItemCart(e){\n const basura = e.target;\n const cont = basura.parentNode;\n const cant = cont.querySelector(\".invisible\");\n\n let l = arrayCarrito.length;\n\n for(let i = 0; i<l ;)\n {\n if(arrayCarrito[i].id == basura.id)\n {\n console.log(arrayCarrito[i].nombre+\":\"+arrayProductos[arrayCarrito[i].id].cantidad)\n arrayCarrito.splice(i,1);\n i=0;\n l--;\n }\n else\n i++\n }\n\n arrayUsuarios[idUsuario].cart = arrayCarrito;\n\n localStorage.setItem(\"Usuarios\", JSON.stringify(arrayUsuarios))\n\n arrayProductos[basura.id].cantidad += parseInt(cant.textContent);\n\n actProductos();\n\n const a = document.createElement(\"a\")\n a.href=\"carrito.html\"\n a.click()\n}", "title": "" }, { "docid": "e76fdd3deb8aa229ad1b60819dfb6adb", "score": "0.6309389", "text": "function deleteCartInCheckoutPage(){ \n $jq('.checkout-cart-index a.btn-remove').removeAttr('onclick');\n $jq(\".checkout-cart-index a.btn-remove2,.checkout-cart-index a.btn-remove\").click(function(event) {\n event.preventDefault();\n var confirm_content = $jq('.confirm_delete_product').attr('value');\n if(!confirm(confirm_content)){\n return false;\n }\n var delUrl = $jq(this).attr(\"href\");\n delUrl = delUrl.replace(\"checkout/cart/delete\", \"ajaxcartsuper/index/cartdelete\");\n $jq.ajax({\n url: delUrl,\n type: 'POST',\n data: {},\n beforeSend:function(){\n showLoadingAnimation();\n },\n success: function(xhr) {\n $('ajaxcart-checkout-content').innerHTML = xhr;\n $('ajaxcart-checkout-content').insert(xhr);\n var cart_content = $('ajaxcart-checkout-content').down('.cart_content').innerHTML;\n $jq('.top-link-cart').html(cart_content);\n var mini_cart_ajax =$('ajaxcart-checkout-content').down('.top-cart-wrapper').innerHTML;\n $$('.top-cart-contain').each(function (el){\n el.replace(mini_cart_ajax);\n });\n var full_cart_content = $('ajaxcart-checkout-content').down('.ajaxcart_checkout_content').innerHTML;\n $$('.cart').each(function (el){\n el.replace(full_cart_content);\n });\n hideLoadingAnimation();\n $jq('#ajaxcart-checkout-content').html('');\n }\n });\n \n $jq(document).ajaxComplete(function(){\n getQuote();\n getDiscountCodes();\n slideEffectAjax();\n })\n });\n \n return false;\n}", "title": "" }, { "docid": "7ac429a3f2e9b56f7a8dc42507752ac9", "score": "0.62998915", "text": "function handleDelete(id) {\n console.log('from cart file', id, cart.productLines)\n cart.setProductLines(cart.productLines.filter((item) => item.id !== id))\n }", "title": "" }, { "docid": "872084e12937d3f17c5d1705f559fc1d", "score": "0.6283297", "text": "function deleteOnClick(id) {\n var box = $(\"#caja_\" + id);\n\n var request = db.transaction([\"propiedades\"], \"readwrite\").objectStore(\"propiedades\").delete(box.attr('data-id'));\n request.onsuccess = function (event) {\n box.remove();\n };\n}", "title": "" }, { "docid": "377d87210058ce27b77efbfa3bc5fcd8", "score": "0.627865", "text": "function eliminarArt() {\n modalConfirmacion('ELIMINAR ARTICULO',\n '<p>¿Está seguro que desea eliminar el artículo?</p>',\n '<button onclick=\"borrarArtServer();\">Aceptar</button>',\n 'borraCodigoModal();');\n}", "title": "" }, { "docid": "1572cc742b782b740fdb52ce45a359e9", "score": "0.6267074", "text": "function clickDeleteProprietario(id){\n $('#modal-excluir-proprietario').attr('id_proprietario', id);\n}", "title": "" }, { "docid": "9b91d62b82c8e46b0b5a7146a7b3d5c1", "score": "0.6257839", "text": "function removeFromCartClicked(event){\n let productRemovedFromCart = getProduct(event)\n //cart.removeFromCart(productRemovedFromCart[1],productRemovedFromCart[2])\n removeFromArray(productRemovedFromCart[1], productRemovedFromCart[2].replace('cart-row ',''))\n console.log(productRemovedFromCart[1])\n totalPrice()\n totalQuantity()\n}", "title": "" }, { "docid": "fc3c9754d4489ca960e1d65a776da611", "score": "0.6252936", "text": "deleteItemFromCart(state, item) {\n state.cart.forEach(element => {\n if(element.name === item.name){\n let index = state.cart.indexOf(element)\n state.cart.splice(index, 1)\n }\n })\n }", "title": "" }, { "docid": "e06ffb02547ad06e9b5b43ef8e5fa5a2", "score": "0.6244282", "text": "deleteAllCart(context){\n context.commit('removeAllCart');\n }", "title": "" }, { "docid": "a98c8dac024b5284583590163c4dfdb8", "score": "0.62440276", "text": "function deleteConfirmBin(index) {\n modalService.showModal({\n templateUrl: \"/js/angular-component/modalService-delete.html\",\n controller: \"YesNoController\"\n }).then(function(modal) {\n modal.element.modal();\n modal.close.then(function(result) {\n if( result === true ) { InventoryController.deleteBin(index); }\n });\n });\n }", "title": "" }, { "docid": "cdf05ff2c7883e4b01d970660f47c6a6", "score": "0.6240938", "text": "function remove() {\n if ($window.confirm('Are you sure you want to delete?')) {\n vm.cartitem.$remove(function() {\n $state.go('admin.cartitems.list');\n Notification.success({ message: '<i class=\"glyphicon glyphicon-ok\"></i> Cartitem deleted successfully!' });\n });\n }\n }", "title": "" }, { "docid": "a637b4e8ad14874bebeeafe7af2d703f", "score": "0.623238", "text": "function oneDeleteShoppingBag() {\n // on recup la ref comme sur la fonction au dessus\n let ref = $(this).parents('div').parents('div').attr('class');\n ref = ref.substr(0, 3);\n $(arrayBag).each(function(i) {\n if (arrayBag[i] == ref) {\n // on fait -1 à la quantié de la ref dans arrayBag\n arrayBag[i + 1] = --arrayBag[i + 1]\n // -1 sur inShoppingBag\n --inShoppingBag;\n if (inShoppingBag == 0) {\n $('#shopping-number').css('color', 'red');\n }\n $('#shopping-number').html(`${inShoppingBag}`);\n if (inShoppingBag == 0) {\n $('#modalBag .modal-body').append(`\n <p>Votre panier est vide !</p>\n `)\n }\n // la quantité d'une ref tombe à 0 alors on efface sa div de la modale panier\n if (arrayBag[i + 1] == 0) {\n $(`.${ref}`).remove();\n // et on supprime sa présence et sa quantité dans arrayBag\n arrayBag.splice(i, 2);\n }\n // affiche sa nouvelle quantité dans modal panier\n $(`.${ref}>div:nth-child(2)>span`).html(`${arrayBag[i+1]}`);\n }\n })\n console.log(arrayBag);\n calcTotalPrice();\n }", "title": "" }, { "docid": "8b929fb338eb4988d10838f96031574f", "score": "0.6227477", "text": "async deletecartitem(id) {\n try {\n const response = await Repository.delete(`${baseUrl}/cart/delete-item/${id}`)\n return response.data;\n } catch (error) {\n console.log(error)\n }\n }", "title": "" }, { "docid": "902bde5072d145493164cd00f9f33e1b", "score": "0.6218142", "text": "function removeFromCart(_id) {\n let productTeddy = JSON.parse(localStorage.getItem(\"product\"));\n const product = productTeddy.find(product => product.id_product == _id)\n const index = productTeddy.indexOf(product);\n productTeddy.splice(index, 1);\n localStorage.setItem(\"product\", JSON.stringify(productTeddy));\n alert(\"Ton Teddy est retourné à la boutique\");\n window.location.href = \"panier.html\";\n}", "title": "" }, { "docid": "a096c47cf241718d236fb5c9e1365623", "score": "0.62160724", "text": "function removeItemCart(id) {\n if (confirm(\"Удалить товар из корзины?\")) {\n let params = {\n 'product_id': id,\n 'action': 'delete'\n };\n let data = new FormData();\n data.append('data', JSON.stringify(params));\n\n fetch(\"/local/templates/semushka/ajax/addProduct.php\",\n {\n method: \"post\",\n body: data\n })\n .then(response => {\n if (response.status !== 200) {\n return Promise.reject();\n }\n return response.text();\n })\n .then(function (data) {\n let cart = document.querySelector(\"#desktop-cart-wrapper\");\n cart.innerHTML = data;\n })\n .catch(() => console.log('Ошибка'))\n return true;\n }\n}", "title": "" }, { "docid": "8a23b25ec00d441c7e129407744fe2d1", "score": "0.62018365", "text": "RemoveItem(ordProdId){\n ShoppingCart.removeCartItem(ordProdId)\n .then((res) => {\n // status code will be 204 if this executes successfully\n if(res.status === 204){\n // re-sets state to reflect current cart products\n this.CheckCart();\n }\n })\n .catch((err) => console.error(err));\n }", "title": "" }, { "docid": "086bd02ae3048142c6888b88257c62fc", "score": "0.6196568", "text": "function deleteItem(){\r\n document.querySelector(\"#show-msg-item-deleted\").style.display = \"flex\";\r\n document.querySelector(\"#add-to-cart-list-holder ul\").style.display = \"none\";\r\n document.querySelector(\"#cart-details p:first-child\").style.display = \"none\";\r\n\r\n let deleteItem = JSON.parse(sessionStorage.getItem(\"cartItems\"));\r\n deleteItem.pop();\r\n console.log(deleteItem);\r\n sessionStorage.setItem(\"cartItems\", JSON.stringify(deleteItem));\r\n document.querySelector(\"#cart-quantity-indicator\").innerHTML = JSON.parse(sessionStorage.getItem(\"cartItems\")).length;\r\n}", "title": "" }, { "docid": "d288828608e41500cf4d040d3a92802b", "score": "0.6189474", "text": "async removeItemFromCart(id)\n {\n const res =await axios.delete(this.cartJsonBoxUrl+\"/\"+id);\n console.log(\"ItemRemoved\"+res);\n }", "title": "" }, { "docid": "ed99ace472e9489afefdcf050acec481", "score": "0.6188005", "text": "function delete_cart_item(cart_id) {\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_id\").value;\r\n\tvar location_id = document.getElementById(\"txt_location_id\").value;\r\n\tvar cart_session_id = document.getElementById(\"txt_session_id\").value;\r\n\tshowHintFootable('../accounting/returns-details.jsp?cart_session_id='\r\n\t\t\t+ cart_session_id + '&cart_id=' + cart_id + '&cart_vouchertype_id='\r\n\t\t\t+ vouchertype_id + '&location_id=' + location_id \r\n\t\t\t+ '&delete_cartitem=yes', 'invoice_details');\r\n\r\n\tdocument.getElementById('mode_button').innerHTML = ' ';\r\n\tdocument.getElementById('txt_item_id').value = 0;\r\n\tdocument.getElementById('txt_item_qty').value = 0;\r\n\tdocument.getElementById('txt_item_price').value = 0;\r\n\tdocument.getElementById('txt_item_total').value = 0;\r\n\tdocument.getElementById('item_total').innerHTML = 0;\r\n\tdocument.getElementById('configure-details').innerHTML = ' ';\r\n\tdocument.getElementById(\"serial_details\").style.display = 'none';\r\n\tdocument.getElementById(\"batch_details\").style.display = 'none';\r\n\tdocument.getElementById(\"txt_search\").focus();\r\n}", "title": "" }, { "docid": "8ed06262f262e85192c0cf95f74226da", "score": "0.61872613", "text": "deleteProdotto() {\r\n if (this.currentProdotto.key) {\r\n this.prodottoService.delete(this.currentProdotto.key)\r\n .then(() => {\r\n window.alert('Prodotto eliminato!');\r\n window.location.reload();\r\n })\r\n .catch(err => console.log(err));\r\n }\r\n }", "title": "" }, { "docid": "9536ca7d0ce12272de6c412a307051f7", "score": "0.6182386", "text": "function deleteCartInCheckoutPageBackup(){ \n $jq(\"#shopping-cart-table a.btn-remove2\").each(function(){\n var delUrl = $jq(this).attr(\"href\");\n $jq( this ).attr(\"link\",delUrl);\n $jq(this).attr(\"href\",\"javascript:void(0)\");\n $jq(this).live(\"click\",function(){\n var confirm_content = $jq('.confirm_delete_product').attr('value');\n if(!confirm(confirm_content)){\n return false;\n }\n showLoadingAnimation();\n delUrl = delUrl.replace(\"checkout/cart/delete\", \"ajaxcartsuper/index/cartdelete\");\n new Ajax.Request(\n delUrl,\n {\n method: \"post\",\n postBody: \"\",\n onException: function (xhtml, e)\n {\n alert(\"Exception : \" + e);\n },\n onComplete: function (xhtml)\n {\n var htmlObject = $jq(xhtml.responseText);\n var topLink = htmlObject.find(\"#top_link_content\").html();\n $jq(\".top-link-cart\").html(topLink);\n $jq(\".main-container\").html(\"\");\n //var checkoutContent = htmlObject.find(\".ajaxcart_checkout_content\").html();\n $jq(\".main-container\").html(xhtml.responseText);\n hideLoadingAnimation();\n }\n\n });\n return false;\n }); \n });\n}", "title": "" }, { "docid": "da118f29197044c1b80188f81fa319f8", "score": "0.6170902", "text": "function removeQuantity(element) {\n\n console.log('removeQuantity',element);\n console.log(\"cart\",cart);\n\n var _cartItemId = element.getAttribute('data-cartItemId');\n selectedoptionidfordelete = _cartItemId;\n console.log(\"cartid\",_cartItemId);\n\n //check if giftoption already set\n var cookie_options = getCookie('options');\n options = cookie_options === \"none\" ? undefined: JSON.parse(cookie_options);\n console.log(\"options\", options);\n\n if (options !== undefined){\n for (var k = 0; k< options.length; k++){\n\n console.log(\"options cartItemId\", options[k].cartItemId);\n if(options[k].cartItemId === _cartItemId){\n\n //sum cards and packing\n var cardsum = 0;\n var packingsum = 0; \n \n options[k].options.forEach(function(element) {\n cardsum = element.card === true ? cardsum + 1: cardsum;\n packingsum = element.packing === true ? packingsum + 1: packingsum;\n });\n\n var optionssum = (cardsum +packingsum)> options[k].options.length? options[k].options.length: (cardsum +packingsum);\n console.log('cardsum',optionssum);\n\n // check if all giftoptions are set\n if(optionssum >= document.getElementById(_cartItemId+'quantity').value ){\n \n //var quantity = document.getElementById(_cartItemId +'quantity');\n console.log('show gift option delete');\n\n //clean content \n document.getElementById('selectgiftoptionfordelete-content').innerHTML = '';\n var headline = document.createElement('h2');\n headline.className = \"pb-20\";\n headline.innerHTML = 'Welche Geschenkoption soll mit dem Artikel entfernt werden?';\n \n document.getElementById('selectgiftoptionfordelete-content').appendChild(headline);\n\n // render items\n for(var z= 0; z< options[k].options.length; z++){\n\n if (options[k].options[z].card === true || options[k].options[z].packing === true){\n\n\n var style = options[k].options[z].cardoptions.style == 0? 'img/card-simple.png': 'img/card-foldable.png';\n var packing = options[k].options[z].packing == true? 'img/packing-yes.png': 'img/packing-no.png';\n var card = options[k].options[z].card == true? 'visible':'hidden';\n var text = options[k].options[z].card == true? (options[k].options[z].cardoptions.text === null || options[k].options[z].cardoptions.text === '' ? '- Kein Text hinterlegt -':options[k].options[z].cardoptions.text): '';\n \n var row = document.createElement('div');\n row.className = \"row mt-10 mb-10\";\n row.innerHTML = '<div class=\"mr-15 ml-15\" style=\"border-bottom: 1px solid black; display: flex;\">\\\n <div class=\" col-lg-1 col-md-1 col-sm-1 col-xs-1 ml-20 pb-10 mb-10\" style=\"height:50px; display: flex; align-items: center;\">\\\n <input data-index=\"'+z+'\" onChange=\"onRadioChangeOptionSelection(this);\" type=\"radio\" name=\"optradio\" checked=\"checked\">\\\n </div>\\\n <div class=\" col-lg-4 col-md-4 col-sm-4 col-xs-4 pb-10 mb-10\" style=\" height:50px; display: flex; align-items: center;\">\\\n <img src=\"'+packing+'\" style=\"height:50px; margin-right:10px;\">\\\n <img style=\"visibility:'+card+'; height:60px; margin-right:10px;\" src=\"'+style+'\">\\\n <img style=\"visibility:'+card+'; height:40px\" src=\"'+options[k].options[z].cardoptions.image+'\">\\\n </div>\\\n <div class=\" col-lg-6 col-md-6 col-sm-6 col-xs-6 pb-10 mb-10\" style=\" height:50px; display: flex; align-items: center; white-space: nowrap; overflow: hidden !important;text-overflow: ellipsis !important;\">\\\n <span style=\"visibility:'+card+'\">'+text+'</span>\\\n </div>\\\n <div>'\n \n document.getElementById('selectgiftoptionfordelete-content').appendChild(row);\n //set selectedoptionindexfordelete to current index\n selectedoptionindexfordelete = z;\n\n }\n\n }\n\n // open dialog\n toggleOptionSelectDialog();\n \n\n } else {\n // just lower quanity\n removeQuantityfromCart();\n }\n }\n }\n }else {\n // just lower quanity\n removeQuantityfromCart();\n }\n}", "title": "" }, { "docid": "a0b66639de070987281434025079b430", "score": "0.61689603", "text": "function deleteProduct(index_zone){\n\t$('#visual_zone_' + index_zone).fadeOut('fast', function(){\n\t\t$(this).remove();\n\t});\n\treturn false;\n}", "title": "" }, { "docid": "308fc60079d8d73f323f6be21fdfc1b6", "score": "0.61677146", "text": "async emptyCart(event) {\n const deleteBtnEle = `\n <input id=\"empty-cart\" data-wait-message=\"adding to cart...\" value=\"Empty Cart\" type=\"submit\" class=\"button button--secondary delete-btn\" />`;\n // get container where add all button element is located.\n const $categoryPage = $('#form-action');\n\n // message for the modal after clearing the cart.\n const message = 'Your cart was cleared successfully';\n\n // check if cart is empty.\n let isCartEmpty = await this.isCartEmpty();\n\n // if cart is not empty add the button.\n if (isCartEmpty) {\n $categoryPage.append(deleteBtnEle);\n }\n // grab the delete button\n const $deleteBtn = $('#empty-cart');\n\n // set event listerner for the delete button.\n $deleteBtn.on('click', async (event) => {\n event.preventDefault();\n // get the cart object\n let data = await this.getCart();\n\n // settings for the ajax request\n var settings = {\n url: `/api/storefront/carts/${data[0].id}`,\n async: true,\n method: 'DELETE',\n success: (response) => console.log(response),\n complete: () => {\n this.modal(message, 'delete').show();\n },\n };\n\n $.ajax(settings);\n });\n }", "title": "" }, { "docid": "e1c17e75418773ba7712cbda322c9885", "score": "0.61640733", "text": "handleDelete(idx) {\n this.props.orderFormActions('DELETE_PRODUCT', idx);\n }", "title": "" }, { "docid": "b216bb829c5ad7cd79b9cd87163e949f", "score": "0.61638284", "text": "function deletegallery() \n{\n var id = $(\"#selectImageGallery\").val();\n $(\"#DeleteGalleryModal\").modal('show');\n $(\"#DeleteGalleryModal .modal-title\").html(\"Delete Confirmation\");\n $(\"#DeleteGalleryModal .modal-body\").html(\"Do You Want To Delete \" + \"<strong class='text-danger'><span id='toDeleteGL'>\" + id + \"</span></strong>\" + \" Gallery ? \");\n\n}", "title": "" }, { "docid": "3cdadc42f4282c196e83b6342fac1421", "score": "0.61558205", "text": "function deleteCartItem(id) {\n var endpoint = 'https://cs341group4.tk/GuestCart/Delete';\n if($.cookie('token') != undefined) {\n endpoint = 'https://cs341group4.tk/Cart/Delete';\n }\n $.post(endpoint, {itemId : id})\n .done(function(data) {\n $('#message').html(\"Reloading items...\");\n $('#cart').html(\"\");\n loadCart();\n updatePrice();\n })\n .fail(function(data) {\n $('#message').html(data.responseJSON.message);\n });\n}", "title": "" }, { "docid": "e2a0f62c5a7bea1fbdddfe9341dde76e", "score": "0.61497265", "text": "function deleteProducto(xIndex){\n $.ajax({\n url: baseUrl + '/carrito/deleteproducto',\n type: 'POST',\n dataType: 'JSON',\n data: {\n xIndex: xIndex,\n \"_token\": $('meta[name=\"csrf-token\"]').attr('content'),\n },\n })\n .done(function(response) {\n if(response.estado){\n setcarro(response)\n }else{\n mensajeModal(response.mensaje);\n }\n })\n .fail(function(response) {\n consultasErroneas(response);\n })\n}", "title": "" }, { "docid": "95dad4e6ee63a094df2dabd039a043d7", "score": "0.61489236", "text": "function delete_cart_item(cart_id) {\r\n\tvar cart_session_id = CheckNumeric(document .getElementById(\"txt_session_id\").value);\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_id\").value;\r\n\tvar location_id = document.getElementById(\"txt_location_id\").value;\r\n\tshowHint('../accounting/purchase-details.jsp?cart_session_id=' + cart_session_id \r\n\t\t\t+ '&cart_id=' + cart_id \r\n\t\t\t+ '&cart_vouchertype_id=' + vouchertype_id \r\n\t\t\t+ '&location_id=' + location_id\r\n\t\t\t+ '&delete_cartitem=yes', 'po_details');\r\n\r\n\t/*\r\n\t * document.getElementById(\"mode_button\").innerHTML = '-';\r\n\t * document.getElementById('txt_item_id').value = 0;\r\n\t * document.getElementById('txt_item_qty').value = 0;\r\n\t * document.getElementById('txt_item_price').value = 0;\r\n\t * document.getElementById('txt_item_total').value = 0;\r\n\t * document.getElementById('item_total').innerHTML = 0;\r\n\t * document.getElementById('configure-details').innerHTML = '-';\r\n\t * document.getElementById(\"serial_details\").style.display = 'none';\r\n\t * document.getElementById(\"batch_details\").style.display = 'none';\r\n\t */\r\n\tdocument.getElementById(\"txt_search\").focus();\r\n}", "title": "" }, { "docid": "8e292f1a797a5f1d4e77c7a8bb512a7c", "score": "0.6147563", "text": "function removeFromCart(e) {\n\tvar type = e.getAttribute(\"data-type\");\n\tvar name = e.getAttribute(\"data-name\");\n\tvar artist = e.getAttribute(\"data-artist\");\n\tdoCartPost(type, name, artist, \"remove\");\n}", "title": "" }, { "docid": "1ab9bd509f68a71de8b67eb3af2add12", "score": "0.61446834", "text": "removeProduct(event, product) {\n console.log(\"Remove Product\");\n console.log(event);\n console.log(product);\n\n let uri = \"/api/cartOp/\" + encodeURIComponent(product.id);\n console.info(uri);\n\n axios.delete(uri).then((response) => {\n this.loadData().then((e) => {\n\n });\n }).catch((error) => {\n console.error(error);\n });\n }", "title": "" }, { "docid": "856d3766b2c9fc3b0f30acf229a0d490", "score": "0.6143519", "text": "function deleteProduct(e){\n let cartItem = e.target.parentElement.parentElement;\n console.log(\"deleteProduct -> cartItem\", cartItem)\n let productInLocal = Object.values(JSON.parse(localStorage.getItem('productInCart')));\n let updateProduct = productInLocal.filter(item =>{\n return item.id != cartItem.dataset.id\n })\n localStorage.setItem('productInCart',JSON.stringify(updateProduct));\n addToCartList();\n updateCartInfo();\n}", "title": "" }, { "docid": "7d5356a05249fcf40b542182ea9f5172", "score": "0.6141324", "text": "function DeleteFullCart() {\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_id\").value;\r\n\tvar location_id = document.getElementById(\"txt_location_id\").value;\r\n\tvar cart_session_id = document.getElementById(\"txt_session_id\").value;\r\n\tshowHintFootable('../accounting/returns-details.jsp?cart_session_id='\r\n\t\t\t+ cart_session_id + '&cart_vouchertype_id=' + vouchertype_id\r\n\t\t\t+ '&location_id=' + location_id + '&delete_full_cart=yes', \r\n\t\t\t'invoice_details');\r\n}", "title": "" }, { "docid": "7fa3c4c00d081b4887bd1d71adccabe9", "score": "0.6135203", "text": "function deleteCartData(index) {\n\n let arr = JSON.parse(localStorage.getItem(Message.CART_ELEMENTS));//store the value in localstorage changed into json obj and store it in arr\n if (arr[index].quantity > 1) {\n arr[index].quantity--;\n }\n else {\n arr.splice(index, 1);\n }\n console.log(arr[index]);\n toastr.success(\"\", Message.CART_ITEM_IS_DELETED,\n {\n timeOut: 1000\n });\n localStorage.setItem(Message.CART_ELEMENTS, JSON.stringify(arr));\n displayCartItems();\n}", "title": "" }, { "docid": "2ba1f1484ad2e2f0fb571a1be2078c75", "score": "0.6117095", "text": "function deleteButtons() {\n let deleteButtons = document.querySelectorAll('.product ion-icon');\n let productNumbers = localStorage.getItem('cartNumbers');\n cartCost = localStorage.getItem(\"totalCost\");\n let cartItems = localStorage.getItem('prodectInCart');\n cartItems = JSON.parse(cartItems);\n let productName;\n // console.log(cartItems);\n\n\n // // we added from web to solve our problem ---------------\n for (let i = 0; i < deleteButtons.length; i++) {\n deleteButtons[i].addEventListener('click', () => {\n productName = deleteButtons[i].parentElement.textContent.toLocaleLowerCase().replace(/ /g, '').trim();\n\n localStorage.setItem('cartNumbers', productNumbers - cartItems[productName].Vote);\n localStorage.setItem('totalCost', cartCost - (cartItems[productName].price * cartItems[productName].Vote));\n\n delete cartItems[productName];\n localStorage.setItem('prodectInCart', JSON.stringify(cartItems));\n\n oldNumberCart();\n render();\n location.reload();\n \n })\n }\n if(cartCost==0){\n localStorage.clear();\n }\n}", "title": "" }, { "docid": "a1d51b70afb8e8b8c3fca85e7a80e65b", "score": "0.61070126", "text": "function deleteItem(_id) {\n let supprItem = JSON.parse(localStorage.getItem(\"basket\"));\n const item = supprItem.find(item => item.idProd == _id)\n const index = supprItem.indexOf(item);\n supprItem.splice(index, 1);\n localStorage.setItem(\"basket\", JSON.stringify(supprItem));\n alert('Vous avez supprimé ' + item.name + ' de votre panier ! ')\n document.location.href = 'panier.html';\n}", "title": "" }, { "docid": "4dfa1d308008e1db6d8e1c6d0e522a74", "score": "0.610693", "text": "function removeCartItem(event){\n var buttonClicked= event.target;\n buttonClicked.parentElement.parentElement.remove();\n updateCartTotal()\n}", "title": "" }, { "docid": "f66edc9d9301d965e66b9fa69dd361ba", "score": "0.61041427", "text": "function quitarDelCarrito(producto) {\n let count = $(\"#contar\").html();\n let index = productos.findIndex(prod => prod.id === producto.toString());\n localStorage.removeItem(`${producto}`);\n productos[index].cant = 0;\n $(\"#contar\").html(parseInt(count) - 1);\n app.cart();\n\n}", "title": "" }, { "docid": "8dafb68826fba361916a9ae987b81f80", "score": "0.6101899", "text": "function promotionsDelete(element, from)\n{\n try\n {\n var promotion = getItem(element) || getItemFromParent(element);\n if(promotion != undefined)\n {\n bootbox.confirm(eval(msg(messages.delete)), function(result)\n {\n if(result)\n {\n doForm(`./admin/promotions/${promotion.id}`, 'delete', undefined, from === undefined ? true : from);\n }\n });\n }\n }\n catch (e)\n {\n log(e);\n }\n}", "title": "" }, { "docid": "e2e4a5ef020431d9f4a50e3f6107f62d", "score": "0.610143", "text": "async deleteProductCart({ productId }){\n const deletedProductCart = await this.mongoDB.delete(this.collection,productId);\n return deletedProductCart;\n }", "title": "" }, { "docid": "ec929eecb254800bfac4d23580fc0fb2", "score": "0.6091656", "text": "function removeCartItem(e,itemId){\n let price = parseInt();\n let qty = parseInt();\n let cartItems = localStorage.getItem(\"productsInCart\");\n cartItems = JSON.parse(cartItems);\n\n price = cartItems[itemId].price;\n qty = cartItems[itemId].qty;\n \n delete cartItems[itemId];\n\n let totalCost = localStorage.getItem(\"totalCost\");\n totalCost -= parseInt(price) * parseInt(qty);\n document.getElementById(\"sub-total\").innerHTML = \"&#8377; \"+ totalCost;\n document.getElementById(\"cart-total\").innerHTML = \"&#8377; \"+ totalCost;\n document.getElementById(\"cart-total-1\").innerHTML = \"&#8377; \"+ totalCost;\n\n let cartNumbers = localStorage.getItem(\"cartNumbers\");\n cartNumbers -= 1; \n \n $('.cart-badge').attr(\"data-count\", cartNumbers);\n localStorage.setItem(\"productsInCart\", JSON.stringify (cartItems));\n localStorage.setItem(\"totalCost\", JSON.stringify (totalCost));\n localStorage.setItem(\"cartNumbers\", JSON.stringify (cartNumbers));\n\n $(e).closest('.table_row').remove();\n\n \n }", "title": "" }, { "docid": "0ea453f3b07b7a24cdf673247ce171d8", "score": "0.6082899", "text": "function toolToDelete(that){\n\t//On stock l'id passé en parametre de la fonction\n\tvar id = that.id;\n\n\t//Puis on viens chercher les informations détaillées dans la liste\n\tlet getName = document.getElementById('getName' + id).innerHTML;\n\n\t//On donne à l'action du formulaire l'id du produit pour le passer en paramètre dans le controller: updateAction\n\tlet $form = $('#delete_form');\n\t$form.data().value = id;\n\tlet action = $form.data().path.replace(':slug:', '') + $form.data().value;\n\t$form[0].action = action;\n\n\t//On vide le contenu html des fenêtre modale pour éviter l'incrémentation des informations\n\t$('.deleteModalTitle').empty();\n\t$('#delete_modal_body').empty();\n\n\t//Puis on personnalise en JS les informations html des fenêtre modale\n\t$('.deleteModalTitle').prepend(\"Supprimer '\" + getName + \"'\");\n\t$('.delete_modal_body').prepend(\"Vous vous apprêtez à supprimer définitivement l'outil '\" + getName + \"'<br />Confirmer ?\");\n}", "title": "" }, { "docid": "0359aad64c51ca15b7717dcffde46c75", "score": "0.6081546", "text": "function deleteProduct(e){\r\n let cartItem;\r\n if(e.target.tagName === \"BUTTON\"){\r\n cartItem = e.target.parentElement;\r\n cartItem.remove(); // this removes from the DOM only\r\n } else if(e.target.tagName === \"I\"){\r\n cartItem = e.target.parentElement.parentElement;\r\n cartItem.remove(); // this removes from the DOM only\r\n }\r\n\r\n let products = getProductFromStorage();\r\n let updatedProducts = products.filter(product => {\r\n return product.id !== parseInt(cartItem.dataset.id);\r\n });\r\n localStorage.setItem('products', JSON.stringify(updatedProducts)); // updating the product list after the deletion\r\n updateCartInfo();\r\n}", "title": "" }, { "docid": "52ac066e4b3be9361b630da34dc51eda", "score": "0.60783374", "text": "function Delete(){\n\n var buttonId = $(this).attr(\"id\"); \n var buttonCls = $(\"#tr\"+ buttonId).attr(\"class\"); \n \n //Start this is for the outofstock item row \n if(buttonCls == 'outofstockrow' || buttonCls == 'outofstockrow ff' || buttonCls == 'outofstockrow f6'){ \n $( \"#dialog-confirm\" ).dialog({\n resizable: false,\n height:200,\n width:450,\n modal: true,\n buttons: {\n \"Delete this item?\": function() {\n $(\"#tr\"+ buttonId).remove();\n $( this ).dialog( \"close\" );\n },\n Cancel: function() {\n $( this ).dialog( \"close\" );\n }\n }\n }); \n }\n //END this is for the outofstock item row \n\n //Start this is for the Home Shopper Section -- Disable the functionality\n var buttonName = $(this).attr(\"name\"); \n if(buttonName == 'hss') { \n var buttonVal = $(this).attr(\"value\"); \n $( \"#dialog-confirm\" ).dialog({\n resizable: false,\n height:180,\n width:450,\n modal: true,\n buttons: {\n \"Delete this item?\": function() {\n $(\"#\"+buttonVal).remove(); //Deleting the Row (tr) Element\n $( this ).dialog( \"close\" );\n },\n Cancel: function() {\n $( this ).dialog( \"close\" );\n }\n }\n }); \n }\n //End this is for the Home Shopper Section -- Disable the functionality \n }", "title": "" }, { "docid": "e9941d2678114c6951d51541be1cb046", "score": "0.6076535", "text": "removeFromCart(state, item) {\n let index = state.cart.items.indexOf(item);\n\n if (index > -1) {\n state.cart.items.splice(index, 1);\n }\n\n window.ToastSuccess.fire(state.messages.cartRemove);\n this.commit('recalculate');\n }", "title": "" }, { "docid": "478a6b4ed207b0f0ff38d104fbfa8e9f", "score": "0.60724026", "text": "function removeFromCart(prod) {\n itemsSelec[prod] = false;\n}", "title": "" }, { "docid": "6246059c04b035b8cd7930054c4c9e8e", "score": "0.6059009", "text": "deleteCartItem(itemNumber) {\n this.$refs.spinner.showSpinner();\n const requestBody = {\n wishlistUid: this.wishlistUid,\n product: {\n code: itemNumber,\n },\n };\n const requestConfig = {};\n requestConfig.data = requestBody;\n this.manageProfileShoppingListService.deleteCartItem(\n requestConfig,\n this.handleDeleteCartItemResponse,\n this.handleDeleteCartItemError,\n );\n }", "title": "" }, { "docid": "d56d464b859f5ccc4ddb95ddec5013ae", "score": "0.6057496", "text": "async function delElement(itemId) {\n try {\n const res = await axios.delete(\"http://localhost:8281/cart/\" + itemId);\n // const res2 = await axios.delete(\"http://localhost:8281/inventory/\" + itemId);\n console.log(res.data);\n } catch (e) {\n console.error(e);\n }\n getCart();\n }", "title": "" }, { "docid": "aaddab9389df21fa93c9c79788d04f81", "score": "0.6053607", "text": "'click .delete'() {\n Mechanics.remove(this._id);\n swal('Eliminado','Mecanico Eliminado Del Registro','success');\n console.log(\"PI-5: Eliminar Mecánicos\");\n console.log(\"PI-5.1: Mecánico eliminado\");\n }", "title": "" }, { "docid": "9c73302373368dab7a201bc182a3c592", "score": "0.60498023", "text": "async deleteallcart(payload) {\n try {\n const response = await Repository.delete(`${baseUrl}/cart/delete-cart`)\n return response.data;\n } catch (error) {\n console.log(error)\n }\n }", "title": "" }, { "docid": "b607afeee2f15319f825ea061b807a74", "score": "0.6049734", "text": "get btnToDeleteOne () { return $('#remove-sauce-labs-backpack') }", "title": "" }, { "docid": "fc85088311eb61f5b403ef8eb27beeb0", "score": "0.60482085", "text": "function removeCartItem(e){\n let product = document.getElementById(\"productDetails\");\n let tempArr = [];\n for(let i = 0; i < cartPro.length; i++){\n if(cartPro[i].image != e.target.id){\n tempArr.push(cartPro[i]);\n }\n }\n cartPro = tempArr;\n localStorage.setItem(\"disertCartItem\", JSON.stringify(cartPro));\n product.innerHTML = null;\n showProduct();\n}", "title": "" }, { "docid": "1894d9a2a0edbd7a0d8489a43c69df0f", "score": "0.60472095", "text": "function deleteItem(e) {\n\n // cart item is the div that contains the button\n let cartItem = e.target.parentNode.parentNode.parentNode;\n if (!cartItem)\n return\n // id is the anchor tag id which is dynamically named based on nextCartID\n let id = e.target.parentNode.parentNode.id;\n\n // remove the prefix to only have the number so we can use it as index for list removal\n newID = id.replace(\"list-group-item-\", \"\");\n\n // remove the div container element from the dom\n cartItem.remove();\n\n // splice the cart item out of the list of cart items\n // stringify it and update local storage\n cartList.splice(newID, 1);\n stringData = JSON.stringify(cartList)\n localStorage.setItem('cart', stringData);\n // reload the page so that local storage matches the elements on the page\n // otherwise it doesn't sync and we'd remove the wrong elements out of local storage\n location.reload();\n\n}", "title": "" }, { "docid": "84736ec7a742c9fe7c5afbd610d70c2c", "score": "0.6045158", "text": "function deleteGalleryById(value) {\n var delId = $(value).data('delid'); \n\n $(\"#DeleteGalleryModal\").modal('show');\n $(\"#DeleteGalleryModal .modal-title\").html(\"Delete Confirmation\");\n $(\"#DeleteGalleryModal .modal-body\").html(\"Do You Want To Delete \" + \"<strong class='text-danger'><span id='toDeleteGL'>\" + delId + \"</span></strong>\" + \" Gallery ? \");\n \n}", "title": "" }, { "docid": "e3ad4e91668d3995bc27dd6e8c1404bd", "score": "0.60446453", "text": "function deleteProduct(){\n $('#submitDeleteBtn').click(function(){\n $.ajax({\n url :`${url}/deleteProduct/${pID}`,\n type :'DELETE',\n data:{\n _id : pID\n },\n success : function(data){\n console.log(data);\n // alert('your product has been deleted!');\n Swal.fire({\n icon: 'success',\n title: 'Your product has been deleted',\n showConfirmButton: false,\n timer: 1500\n });\n $('#deleteProductModal').modal('hide');\n $('#showListingModal').modal('hide');\n $('.modal-backdrop').hide();\n displayListing();\n showProfile();\n\n },\n error:function(err){\n console.log('error: cannot call api');\n } //error\n });//ajax\n });\n} //function for delete project end", "title": "" }, { "docid": "4a6603ce3fae8e2edfcfc7c305d3ff15", "score": "0.60444105", "text": "destroy(state) {\n window.localStorage.removeItem('cart', JSON.stringify(state.cart));\n }", "title": "" }, { "docid": "b0e8463836e66541c29b2dc2018be9b5", "score": "0.60428005", "text": "function deleteCart() {\n // 1 : Je récupére l'action du clic sur le bouton\n const btnSuppression = document.getElementById(\"btnSupprimer\");\n // J'écoute l'évènement\n btnSuppression.addEventListener(\"click\", function (event) {\n // 2 : Je stop l'event ( Bloquer le rechargement de la page )\n event.preventDefault();\n // 3: je supprime tous les produits du panier\n localStorage.removeItem(\"panier\");\n // chargement de la page panier.html\n window.location.href = \"panier.html\";\n });\n}", "title": "" }, { "docid": "4590be63667ed6c8bd6bbac43fd0d4d3", "score": "0.602678", "text": "deleteIngrediente(index){\n this.objIngredientes.splice(index,1)\n }", "title": "" }, { "docid": "1fd897cb43d2e72841db1f0068794a73", "score": "0.60259163", "text": "async function onDeleteClick(pid) {\n let api = `${baseApiUrl}products/deleteProduct/${pid}`;\n let options = {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n \"x-access-token\": localStorage.getItem(\"fv_token\")\n }\n }\n if (confirm(\"Are you sure, You want to delete this Product?\")) {\n spinnerOn();\n let response = await fetch(api, options);\n spinnerOff();\n if (response.status == 204) {\n showToaster(1,\"Product Deleted Successfully\");\n getAllProducts();\n }\n\n }\n return false;\n\n}", "title": "" }, { "docid": "93b36fa1a9d322eaf4b3fc8969d8791c", "score": "0.6025268", "text": "function deleteProduct(event) {\n event.stopPropogation();\n var id = $(this).data(\"id\");\n $.ajax({\n method: \"DELETE\",\n url: \"/api/todos\" + id\n }).then(getProducts);\n }", "title": "" }, { "docid": "8b28cf00e66ee20c482274b2d3176946", "score": "0.6024251", "text": "deleteCurrentdMit(e, item) {\n e.stopPropagation();\n this.setState({ showDeleteModal: true, deletedMit: item });\n }", "title": "" }, { "docid": "b5c8c6c8b9dac59a52321ac9e6bc3a9a", "score": "0.6022482", "text": "removeItem(o){\n Storage_removeFromCart(o, true);\n this.setState({updated: false})\n }", "title": "" }, { "docid": "dee2eb23c657d649d8aba8094c0c8ab2", "score": "0.60161453", "text": "removeFromCart(state, item) {\n let index = state.cart.indexOf(item);\n\n state.cart.splice(index,1);\n\n this.commit('saveData')\n }", "title": "" }, { "docid": "334e5965c5707894a9ca6d9258dca63e", "score": "0.60138416", "text": "function _setOnClickRemoveProductBtn() {\n $('.remove-item-button').click(function() {\n var confirmBox = confirm(\"Voulez-vous supprimer le produit du panier ?\");\n if (confirmBox == true) {\n var row = $(this).closest('tr');\n ShoppingCartServices.removeProduct(row.index());\n row.remove();\n self.onChanges();\n }\n }); \n }", "title": "" }, { "docid": "e5d445746b70eb0b382a433a17926e6c", "score": "0.6013181", "text": "deleteItem(itemID) {\n const shoppingCartContent = this.items;\n shoppingCartContent.splice(itemID, 1);\n this.calculatePriceTotal();\n ui.displayItemCount(shoppingCartContent);\n ui.displayCartContent(shoppingCartContent);\n }", "title": "" }, { "docid": "340061b77496f9096cc3d0e739ad461e", "score": "0.60064983", "text": "deletePortfolio() {\n this.props.holdingsstore.deletePortfolio(this.state.portfolioId);\n Navigation.dismissOverlay('Alert');\n this.closeModal();\n }", "title": "" }, { "docid": "2972fa9202afc17d6633716639385966", "score": "0.60035026", "text": "function deleteCartElem(button) {\n let cartElements = document.getElementsByClassName(\"cartElem\");\n for (let i = 0; i < cartElements.length; i++) {\n if (button.number == cartElements[i].number) {\n cart.removeChild(cartElements[i]);\n break;\n }\n }\n }", "title": "" }, { "docid": "3562d6e1ded8280d98a1f87c549262b5", "score": "0.60034585", "text": "_handleDeleteClick() {\n this.listOfMaterials.forEach((item, index) => {\n if (item?.id == this.currentlySelectedMaterial.id) {\n delete this.listOfMaterials[index]\n this.currentlySelectedMaterial = this.listOfMaterials[0];\n }\n });\n\n this.calculateTotalCost();\n this.requestUpdate();\n }", "title": "" }, { "docid": "4820cd77192404d050910248d4620ba7", "score": "0.5998026", "text": "confirmOrder(){\n let orderId = this.getFromLocalStorage()\n document.getElementById(\"totalPrice\").innerText = \"le prix total est : \" + this.cart.totalPrice + \" €\"\n document.getElementById(\"orderId\").innerText = \"l'identifiant de votre commande est : \" + orderId\n this.cart.clearCart()\n localStorage.clear()\n }", "title": "" } ]
704e55eb1d3125d9ce70ac304efd0362
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[ { "docid": "c35a0cd81b647576789125afb9467762", "score": "0.0", "text": "function EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}", "title": "" } ]
[ { "docid": "58e09517f17a03b41f9caa41f6573cbb", "score": "0.5859534", "text": "function test () {\r\n var __symbols__ = ['__py3.6__', '__esv5__'];\r\n var __all__ = {};\r\n var __world__ = __all__;\r\n var __nest__ = function (headObject, tailNames, value) {\r\n var current = headObject;\r\n if (tailNames != '') {\r\n var tailChain = tailNames.split ('.');\r\n var firstNewIndex = tailChain.length;\r\n for (var index = 0; index < tailChain.length; index++) {\r\n if (!current.hasOwnProperty (tailChain [index])) {\r\n firstNewIndex = index;\r\n break;\r\n }\r\n current = current [tailChain [index]];\r\n }\r\n for (var index = firstNewIndex; index < tailChain.length; index++) {\r\n current [tailChain [index]] = {};\r\n current = current [tailChain [index]];\r\n }\r\n }\r\n for (var attrib in value) {\r\n current [attrib] = value [attrib];\r\n }\r\n };\r\n __all__.__nest__ = __nest__;\r\n var __init__ = function (module) {\r\n if (!module.__inited__) {\r\n module.__all__.__init__ (module.__all__);\r\n module.__inited__ = true;\r\n }\r\n return module.__all__;\r\n };\r\n __all__.__init__ = __init__;\r\n var __get__ = function (self, func, quotedFuncName) {\r\n if (self) {\r\n if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {\r\n if (quotedFuncName) {\r\n Object.defineProperty (self, quotedFuncName, {\r\n value: function () {\r\n var args = [] .slice.apply (arguments);\r\n return func.apply (null, [self] .concat (args));\r\n },\r\n writable: true,\r\n enumerable: true,\r\n configurable: true\r\n });\r\n }\r\n return function () {\r\n var args = [] .slice.apply (arguments);\r\n return func.apply (null, [self] .concat (args));\r\n };\r\n }\r\n else {\r\n return func;\r\n }\r\n }\r\n else {\r\n return func;\r\n }\r\n }\r\n __all__.__get__ = __get__;\r\n var __getcm__ = function (self, func, quotedFuncName) {\r\n if (self.hasOwnProperty ('__class__')) {\r\n return function () {\r\n var args = [] .slice.apply (arguments);\r\n return func.apply (null, [self.__class__] .concat (args));\r\n };\r\n }\r\n else {\r\n return function () {\r\n var args = [] .slice.apply (arguments);\r\n return func.apply (null, [self] .concat (args));\r\n };\r\n }\r\n }\r\n __all__.__getcm__ = __getcm__;\r\n var __getsm__ = function (self, func, quotedFuncName) {\r\n return func;\r\n }\r\n __all__.__getsm__ = __getsm__;\r\n var py_metatype = {\r\n __name__: 'type',\r\n __bases__: [],\r\n __new__: function (meta, name, bases, attribs) {\r\n var cls = function () {\r\n var args = [] .slice.apply (arguments);\r\n return cls.__new__ (args);\r\n };\r\n for (var index = bases.length - 1; index >= 0; index--) {\r\n var base = bases [index];\r\n for (var attrib in base) {\r\n var descrip = Object.getOwnPropertyDescriptor (base, attrib);\r\n Object.defineProperty (cls, attrib, descrip);\r\n }\r\n }\r\n cls.__metaclass__ = meta;\r\n cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name;\r\n cls.__bases__ = bases;\r\n for (var attrib in attribs) {\r\n var descrip = Object.getOwnPropertyDescriptor (attribs, attrib);\r\n Object.defineProperty (cls, attrib, descrip);\r\n }\r\n return cls;\r\n }\r\n };\r\n py_metatype.__metaclass__ = py_metatype;\r\n __all__.py_metatype = py_metatype;\r\n var object = {\r\n __init__: function (self) {},\r\n __metaclass__: py_metatype,\r\n __name__: 'object',\r\n __bases__: [],\r\n __new__: function (args) {\r\n var instance = Object.create (this, {__class__: {value: this, enumerable: true}});\r\n this.__init__.apply (null, [instance] .concat (args));\r\n return instance;\r\n }\r\n };\r\n __all__.object = object;\r\n var __class__ = function (name, bases, attribs, meta) {\r\n if (meta == undefined) {\r\n meta = bases [0] .__metaclass__;\r\n }\r\n return meta.__new__ (meta, name, bases, attribs);\r\n }\r\n __all__.__class__ = __class__;\r\n var __pragma__ = function () {};\r\n __all__.__pragma__ = __pragma__;\t__nest__ (\r\n\t\t__all__,\r\n\t\t'org.transcrypt.__base__', {\r\n\t\t\t__all__: {\r\n\t\t\t\t__inited__: false,\r\n\t\t\t\t__init__: function (__all__) {\r\n\t\t\t\t\tvar __name__ = 'org.transcrypt.__base__';\r\n\t\t\t\t\tvar __Envir__ = __class__ ('__Envir__', [object], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tself.interpreter_name = 'python';\r\n\t\t\t\t\t\t\tself.transpiler_name = 'transcrypt';\r\n\t\t\t\t\t\t\tself.transpiler_version = '3.6.82';\r\n\t\t\t\t\t\t\tself.target_subdir = '__javascript__';\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar __envir__ = __Envir__ ();\r\n\t\t\t\t\t__pragma__ ('<all>')\r\n\t\t\t\t\t\t__all__.__Envir__ = __Envir__;\r\n\t\t\t\t\t\t__all__.__envir__ = __envir__;\r\n\t\t\t\t\t\t__all__.__name__ = __name__;\r\n\t\t\t\t\t__pragma__ ('</all>')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\t__nest__ (\r\n\t\t__all__,\r\n\t\t'org.transcrypt.__standard__', {\r\n\t\t\t__all__: {\r\n\t\t\t\t__inited__: false,\r\n\t\t\t\t__init__: function (__all__) {\r\n\t\t\t\t\tvar __name__ = 'org.transcrypt.__standard__';\r\n\t\t\t\t\tvar Exception = __class__ ('Exception', [object], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tvar kwargs = dict ();\r\n\t\t\t\t\t\t\tif (arguments.length) {\r\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\r\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\r\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\r\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\r\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\r\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\t\tdefault: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tdelete kwargs.__kwargtrans__;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1));\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\tvar args = tuple ();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tself.__args__ = args;\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tself.stack = kwargs.error.stack;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (__except0__) {\r\n\t\t\t\t\t\t\t\tself.stack = 'No stack trace available';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __repr__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tif (len (self.__args__)) {\r\n\t\t\t\t\t\t\t\treturn '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__)));\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\treturn '{}()'.format (self.__class__.__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\tget __str__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tif (len (self.__args__) > 1) {\r\n\t\t\t\t\t\t\t\treturn str (tuple (self.__args__));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (len (self.__args__)) {\r\n\t\t\t\t\t\t\t\treturn str (self.__args__ [0]);\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\treturn '';\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\tvar IterableError = __class__ ('IterableError', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, error) {\r\n\t\t\t\t\t\t\tException.__init__ (self, \"Can't iterate over non-iterable\", __kwargtrans__ ({error: error}));\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar StopIteration = __class__ ('StopIteration', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, error) {\r\n\t\t\t\t\t\t\tException.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error}));\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar ValueError = __class__ ('ValueError', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\r\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar KeyError = __class__ ('KeyError', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\r\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar AssertionError = __class__ ('AssertionError', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\r\n\t\t\t\t\t\t\tif (message) {\r\n\t\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\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\tException.__init__ (self, __kwargtrans__ ({error: error}));\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\tvar NotImplementedError = __class__ ('NotImplementedError', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\r\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar IndexError = __class__ ('IndexError', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\r\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar AttributeError = __class__ ('AttributeError', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\r\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar py_TypeError = __class__ ('py_TypeError', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, message, error) {\r\n\t\t\t\t\t\t\tException.__init__ (self, message, __kwargtrans__ ({error: error}));\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar Warning = __class__ ('Warning', [Exception], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar UserWarning = __class__ ('UserWarning', [Warning], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar DeprecationWarning = __class__ ('DeprecationWarning', [Warning], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar RuntimeWarning = __class__ ('RuntimeWarning', [Warning], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar __sort__ = function (iterable, key, reverse) {\r\n\t\t\t\t\t\tif (typeof key == 'undefined' || (key != null && key .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar key = null;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tif (typeof reverse == 'undefined' || (reverse != null && reverse .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar reverse = false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tif (arguments.length) {\r\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\r\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\r\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\r\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\r\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\r\n\t\t\t\t\t\t\t\t\t\tcase 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\tcase 'key': var key = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\tcase 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (key) {\r\n\t\t\t\t\t\t\titerable.sort ((function __lambda__ (a, b) {\r\n\t\t\t\t\t\t\t\tif (arguments.length) {\r\n\t\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\r\n\t\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\r\n\t\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\r\n\t\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\r\n\t\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'a': var a = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'b': var b = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn (key (a) > key (b) ? 1 : -(1));\r\n\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\titerable.sort ();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (reverse) {\r\n\t\t\t\t\t\t\titerable.reverse ();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar sorted = function (iterable, key, reverse) {\r\n\t\t\t\t\t\tif (typeof key == 'undefined' || (key != null && key .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar key = null;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tif (typeof reverse == 'undefined' || (reverse != null && reverse .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar reverse = false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tif (arguments.length) {\r\n\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\r\n\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\r\n\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\r\n\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\r\n\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\r\n\t\t\t\t\t\t\t\t\t\tcase 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\tcase 'key': var key = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\tcase 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (py_typeof (iterable) == dict) {\r\n\t\t\t\t\t\t\tvar result = copy (iterable.py_keys ());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar result = copy (iterable);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t__sort__ (result, key, reverse);\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar map = function (func, iterable) {\r\n\t\t\t\t\t\treturn (function () {\r\n\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\tvar __iterable0__ = iterable;\r\n\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\tvar item = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t__accu0__.append (func (item));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn __accu0__;\r\n\t\t\t\t\t\t}) ();\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar filter = function (func, iterable) {\r\n\t\t\t\t\t\tif (func == null) {\r\n\t\t\t\t\t\t\tvar func = bool;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn (function () {\r\n\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\tvar __iterable0__ = iterable;\r\n\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\tvar item = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\tif (func (item)) {\r\n\t\t\t\t\t\t\t\t\t__accu0__.append (item);\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\treturn __accu0__;\r\n\t\t\t\t\t\t}) ();\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar __Terminal__ = __class__ ('__Terminal__', [object], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tself.buffer = '';\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tself.element = document.getElementById ('__terminal__');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (__except0__) {\r\n\t\t\t\t\t\t\t\tself.element = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (self.element) {\r\n\t\t\t\t\t\t\t\tself.element.style.overflowX = 'auto';\r\n\t\t\t\t\t\t\t\tself.element.style.boxSizing = 'border-box';\r\n\t\t\t\t\t\t\t\tself.element.style.padding = '5px';\r\n\t\t\t\t\t\t\t\tself.element.innerHTML = '_';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget print () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tvar sep = ' ';\r\n\t\t\t\t\t\t\tvar end = '\\n';\r\n\t\t\t\t\t\t\tif (arguments.length) {\r\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\r\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\r\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\r\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\r\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\r\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\t\tcase 'sep': var sep = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\t\tcase 'end': var end = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1));\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\tvar args = tuple ();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tself.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () {\r\n\t\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\t\tvar __iterable0__ = args;\r\n\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\tvar arg = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t__accu0__.append (str (arg));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn __accu0__;\r\n\t\t\t\t\t\t\t}) ()), end).__getslice__ (-(4096), null, 1);\r\n\t\t\t\t\t\t\tif (self.element) {\r\n\t\t\t\t\t\t\t\tself.element.innerHTML = self.buffer.py_replace ('\\n', '<br>').py_replace (' ', '&nbsp');\r\n\t\t\t\t\t\t\t\tself.element.scrollTop = self.element.scrollHeight;\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\tconsole.log (sep.join ((function () {\r\n\t\t\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\t\t\tvar __iterable0__ = args;\r\n\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\tvar arg = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t__accu0__.append (str (arg));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn __accu0__;\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\tget input () {return __get__ (this, function (self, question) {\r\n\t\t\t\t\t\t\tif (arguments.length) {\r\n\t\t\t\t\t\t\t\tvar __ilastarg0__ = arguments.length - 1;\r\n\t\t\t\t\t\t\t\tif (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty (\"__kwargtrans__\")) {\r\n\t\t\t\t\t\t\t\t\tvar __allkwargs0__ = arguments [__ilastarg0__--];\r\n\t\t\t\t\t\t\t\t\tfor (var __attrib0__ in __allkwargs0__) {\r\n\t\t\t\t\t\t\t\t\t\tswitch (__attrib0__) {\r\n\t\t\t\t\t\t\t\t\t\t\tcase 'self': var self = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\t\tcase 'question': var question = __allkwargs0__ [__attrib0__]; break;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tself.print ('{}'.format (question), __kwargtrans__ ({end: ''}));\r\n\t\t\t\t\t\t\tvar answer = window.prompt ('\\n'.join (self.buffer.py_split ('\\n').__getslice__ (-(16), null, 1)));\r\n\t\t\t\t\t\t\tself.print (answer);\r\n\t\t\t\t\t\t\treturn answer;\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar __terminal__ = __Terminal__ ();\r\n\t\t\t\t\t__pragma__ ('<all>')\r\n\t\t\t\t\t\t__all__.AssertionError = AssertionError;\r\n\t\t\t\t\t\t__all__.AttributeError = AttributeError;\r\n\t\t\t\t\t\t__all__.DeprecationWarning = DeprecationWarning;\r\n\t\t\t\t\t\t__all__.Exception = Exception;\r\n\t\t\t\t\t\t__all__.IndexError = IndexError;\r\n\t\t\t\t\t\t__all__.IterableError = IterableError;\r\n\t\t\t\t\t\t__all__.KeyError = KeyError;\r\n\t\t\t\t\t\t__all__.NotImplementedError = NotImplementedError;\r\n\t\t\t\t\t\t__all__.RuntimeWarning = RuntimeWarning;\r\n\t\t\t\t\t\t__all__.StopIteration = StopIteration;\r\n\t\t\t\t\t\t__all__.py_TypeError = py_TypeError;\r\n\t\t\t\t\t\t__all__.UserWarning = UserWarning;\r\n\t\t\t\t\t\t__all__.ValueError = ValueError;\r\n\t\t\t\t\t\t__all__.Warning = Warning;\r\n\t\t\t\t\t\t__all__.__Terminal__ = __Terminal__;\r\n\t\t\t\t\t\t__all__.__name__ = __name__;\r\n\t\t\t\t\t\t__all__.__sort__ = __sort__;\r\n\t\t\t\t\t\t__all__.__terminal__ = __terminal__;\r\n\t\t\t\t\t\t__all__.filter = filter;\r\n\t\t\t\t\t\t__all__.map = map;\r\n\t\t\t\t\t\t__all__.sorted = sorted;\r\n\t\t\t\t\t__pragma__ ('</all>')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n var __call__ = function (/* <callee>, <this>, <params>* */) {\r\n var args = [] .slice.apply (arguments);\r\n if (typeof args [0] == 'object' && '__call__' in args [0]) {\r\n return args [0] .__call__ .apply (args [1], args.slice (2));\r\n }\r\n else {\r\n return args [0] .apply (args [1], args.slice (2));\r\n }\r\n };\r\n __all__.__call__ = __call__;\r\n __nest__ (__all__, '', __init__ (__all__.org.transcrypt.__base__));\r\n var __envir__ = __all__.__envir__;\r\n __nest__ (__all__, '', __init__ (__all__.org.transcrypt.__standard__));\r\n var Exception = __all__.Exception;\r\n var IterableError = __all__.IterableError;\r\n var StopIteration = __all__.StopIteration;\r\n var ValueError = __all__.ValueError;\r\n var KeyError = __all__.KeyError;\r\n var AssertionError = __all__.AssertionError;\r\n var NotImplementedError = __all__.NotImplementedError;\r\n var IndexError = __all__.IndexError;\r\n var AttributeError = __all__.AttributeError;\r\n var py_TypeError = __all__.py_TypeError;\r\n var Warning = __all__.Warning;\r\n var UserWarning = __all__.UserWarning;\r\n var DeprecationWarning = __all__.DeprecationWarning;\r\n var RuntimeWarning = __all__.RuntimeWarning;\r\n var __sort__ = __all__.__sort__;\r\n var sorted = __all__.sorted;\r\n var map = __all__.map;\r\n var filter = __all__.filter;\r\n __all__.print = __all__.__terminal__.print;\r\n __all__.input = __all__.__terminal__.input;\r\n var __terminal__ = __all__.__terminal__;\r\n var print = __all__.print;\r\n var input = __all__.input;\r\n __envir__.executor_name = __envir__.transpiler_name;\r\n var __main__ = {__file__: ''};\r\n __all__.main = __main__;\r\n var __except__ = null;\r\n __all__.__except__ = __except__;\r\n var __kwargtrans__ = function (anObject) {\r\n anObject.__kwargtrans__ = null;\r\n anObject.constructor = Object;\r\n return anObject;\r\n }\r\n __all__.__kwargtrans__ = __kwargtrans__;\r\n var __globals__ = function (anObject) {\r\n if (isinstance (anObject, dict)) {\r\n return anObject;\r\n }\r\n else {\r\n return dict (anObject)\r\n }\r\n }\r\n __all__.__globals__ = __globals__\r\n var __super__ = function (aClass, methodName) {\r\n for (var index = 0; index < aClass.__bases__.length; index++) {\r\n var base = aClass.__bases__ [index];\r\n if (methodName in base) {\r\n return base [methodName];\r\n }\r\n }\r\n throw new Exception ('Superclass method not found');\r\n }\r\n __all__.__super__ = __super__\r\n var property = function (getter, setter) {\r\n if (!setter) {\r\n setter = function () {};\r\n }\r\n return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true};\r\n }\r\n __all__.property = property;\r\n var __setProperty__ = function (anObject, name, descriptor) {\r\n if (!anObject.hasOwnProperty (name)) {\r\n Object.defineProperty (anObject, name, descriptor);\r\n }\r\n }\r\n __all__.__setProperty__ = __setProperty__\r\n function assert (condition, message) {\r\n if (!condition) {\r\n throw AssertionError (message, new Error ());\r\n }\r\n }\r\n __all__.assert = assert;\r\n var __merge__ = function (object0, object1) {\r\n var result = {};\r\n for (var attrib in object0) {\r\n result [attrib] = object0 [attrib];\r\n }\r\n for (var attrib in object1) {\r\n result [attrib] = object1 [attrib];\r\n }\r\n return result;\r\n };\r\n __all__.__merge__ = __merge__;\r\n var dir = function (obj) {\r\n var aList = [];\r\n for (var aKey in obj) {\r\n aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey);\r\n }\r\n aList.sort ();\r\n return aList;\r\n };\r\n __all__.dir = dir;\r\n var setattr = function (obj, name, value) {\r\n obj [name] = value;\r\n };\r\n __all__.setattr = setattr;\r\n var getattr = function (obj, name) {\r\n return name in obj ? obj [name] : obj ['py_' + name];\r\n };\r\n __all__.getattr= getattr;\r\n var hasattr = function (obj, name) {\r\n try {\r\n return name in obj || 'py_' + name in obj;\r\n }\r\n catch (exception) {\r\n return false;\r\n }\r\n };\r\n __all__.hasattr = hasattr;\r\n var delattr = function (obj, name) {\r\n if (name in obj) {\r\n delete obj [name];\r\n }\r\n else {\r\n delete obj ['py_' + name];\r\n }\r\n };\r\n __all__.delattr = (delattr);\r\n var __in__ = function (element, container) {\r\n if (py_typeof (container) == dict) {\r\n return container.hasOwnProperty (element);\r\n }\r\n else {\r\n return (\r\n container.indexOf ?\r\n container.indexOf (element) > -1 :\r\n container.hasOwnProperty (element)\r\n );\r\n }\r\n };\r\n __all__.__in__ = __in__;\r\n var __specialattrib__ = function (attrib) {\r\n return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_');\r\n };\r\n __all__.__specialattrib__ = __specialattrib__;\r\n var len = function (anObject) {\r\n if (anObject === undefined || anObject === null) {\r\n return 0;\r\n }\r\n if (anObject.__len__ instanceof Function) {\r\n return anObject.__len__ ();\r\n }\r\n if (anObject.length !== undefined) {\r\n return anObject.length;\r\n }\r\n var length = 0;\r\n for (var attr in anObject) {\r\n if (!__specialattrib__ (attr)) {\r\n length++;\r\n }\r\n }\r\n return length;\r\n };\r\n __all__.len = len;\r\n function __i__ (any) {\r\n return py_typeof (any) == dict ? any.py_keys () : any;\r\n }\r\n function __k__ (keyed, key) {\r\n var result = keyed [key];\r\n if (typeof result == 'undefined') {\r\n throw KeyError (key, new Error());\r\n }\r\n return result;\r\n }\r\n function __t__ (target) {\r\n return (\r\n target === undefined || target === null ? false :\r\n ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target :\r\n target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) :\r\n target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) :\r\n target instanceof Function ? target :\r\n len (target) !== 0 ? target :\r\n false\r\n );\r\n }\r\n __all__.__t__ = __t__;\r\n var bool = function (any) {\r\n return !!__t__ (any);\r\n };\r\n bool.__name__ = 'bool';\r\n __all__.bool = bool;\r\n var float = function (any) {\r\n if (any == 'inf') {\r\n return Infinity;\r\n }\r\n else if (any == '-inf') {\r\n return -Infinity;\r\n }\r\n else if (isNaN (parseFloat (any))) {\r\n if (any === false) {\r\n return 0;\r\n }\r\n else if (any === true) {\r\n return 1;\r\n }\r\n else {\r\n throw ValueError (\"could not convert string to float: '\" + str(any) + \"'\", new Error ());\r\n }\r\n }\r\n else {\r\n return +any;\r\n }\r\n };\r\n float.__name__ = 'float';\r\n __all__.float = float;\r\n var int = function (any) {\r\n return float (any) | 0\r\n };\r\n int.__name__ = 'int';\r\n __all__.int = int;\r\n var py_typeof = function (anObject) {\r\n var aType = typeof anObject;\r\n if (aType == 'object') {\r\n try {\r\n return anObject.__class__;\r\n }\r\n catch (exception) {\r\n return aType;\r\n }\r\n }\r\n else {\r\n return (\r\n aType == 'boolean' ? bool :\r\n aType == 'string' ? str :\r\n aType == 'number' ? (anObject % 1 == 0 ? int : float) :\r\n null\r\n );\r\n }\r\n };\r\n __all__.py_typeof = py_typeof;\r\n var isinstance = function (anObject, classinfo) {\r\n function isA (queryClass) {\r\n if (queryClass == classinfo) {\r\n return true;\r\n }\r\n for (var index = 0; index < queryClass.__bases__.length; index++) {\r\n if (isA (queryClass.__bases__ [index], classinfo)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n if (classinfo instanceof Array) {\r\n for (var index = 0; index < classinfo.length; index++) {\r\n var aClass = classinfo [index];\r\n if (isinstance (anObject, aClass)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n try {\r\n return '__class__' in anObject ? isA (anObject.__class__) : anObject instanceof classinfo;\r\n }\r\n catch (exception) {\r\n var aType = py_typeof (anObject);\r\n return aType == classinfo || (aType == bool && classinfo == int);\r\n }\r\n };\r\n __all__.isinstance = isinstance;\r\n var callable = function (anObject) {\r\n if ( typeof anObject == 'object' && '__call__' in anObject ) {\r\n return true;\r\n }\r\n else {\r\n return typeof anObject === 'function';\r\n }\r\n };\r\n __all__.callable = callable;\r\n var repr = function (anObject) {\r\n try {\r\n return anObject.__repr__ ();\r\n }\r\n catch (exception) {\r\n try {\r\n return anObject.__str__ ();\r\n }\r\n catch (exception) {\r\n try {\r\n if (anObject == null) {\r\n return 'None';\r\n }\r\n else if (anObject.constructor == Object) {\r\n var result = '{';\r\n var comma = false;\r\n for (var attrib in anObject) {\r\n if (!__specialattrib__ (attrib)) {\r\n if (attrib.isnumeric ()) {\r\n var attribRepr = attrib;\r\n }\r\n else {\r\n var attribRepr = '\\'' + attrib + '\\'';\r\n }\r\n if (comma) {\r\n result += ', ';\r\n }\r\n else {\r\n comma = true;\r\n }\r\n result += attribRepr + ': ' + repr (anObject [attrib]);\r\n }\r\n }\r\n result += '}';\r\n return result;\r\n }\r\n else {\r\n return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString ();\r\n }\r\n }\r\n catch (exception) {\r\n return '<object of type: ' + typeof anObject + '>';\r\n }\r\n }\r\n }\r\n };\r\n __all__.repr = repr;\r\n var chr = function (charCode) {\r\n return String.fromCharCode (charCode);\r\n };\r\n __all__.chr = chr;\r\n var ord = function (aChar) {\r\n return aChar.charCodeAt (0);\r\n };\r\n __all__.ord = ord;\r\n var max = function (nrOrSeq) {\r\n return arguments.length == 1 ? Math.max.apply (null, nrOrSeq) : Math.max.apply (null, arguments);\r\n };\r\n __all__.max = max;\r\n var min = function (nrOrSeq) {\r\n return arguments.length == 1 ? Math.min.apply (null, nrOrSeq) : Math.min.apply (null, arguments);\r\n };\r\n __all__.min = min;\r\n var abs = Math.abs;\r\n __all__.abs = abs;\r\n var round = function (number, ndigits) {\r\n if (ndigits) {\r\n var scale = Math.pow (10, ndigits);\r\n number *= scale;\r\n }\r\n var rounded = Math.round (number);\r\n if (rounded - number == 0.5 && rounded % 2) {\r\n rounded -= 1;\r\n }\r\n if (ndigits) {\r\n rounded /= scale;\r\n }\r\n return rounded;\r\n };\r\n __all__.round = round;\r\n function __jsUsePyNext__ () {\r\n try {\r\n var result = this.__next__ ();\r\n return {value: result, done: false};\r\n }\r\n catch (exception) {\r\n return {value: undefined, done: true};\r\n }\r\n }\r\n function __pyUseJsNext__ () {\r\n var result = this.next ();\r\n if (result.done) {\r\n throw StopIteration (new Error ());\r\n }\r\n else {\r\n return result.value;\r\n }\r\n }\r\n function py_iter (iterable) {\r\n if (typeof iterable == 'string' || '__iter__' in iterable) {\r\n var result = iterable.__iter__ ();\r\n result.next = __jsUsePyNext__;\r\n }\r\n else if ('selector' in iterable) {\r\n var result = list (iterable) .__iter__ ();\r\n result.next = __jsUsePyNext__;\r\n }\r\n else if ('next' in iterable) {\r\n var result = iterable\r\n if (! ('__next__' in result)) {\r\n result.__next__ = __pyUseJsNext__;\r\n }\r\n }\r\n else if (Symbol.iterator in iterable) {\r\n var result = iterable [Symbol.iterator] ();\r\n result.__next__ = __pyUseJsNext__;\r\n }\r\n else {\r\n throw IterableError (new Error ());\r\n }\r\n result [Symbol.iterator] = function () {return result;};\r\n return result;\r\n }\r\n function py_next (iterator) {\r\n try {\r\n var result = iterator.__next__ ();\r\n }\r\n catch (exception) {\r\n var result = iterator.next ();\r\n if (result.done) {\r\n throw StopIteration (new Error ());\r\n }\r\n else {\r\n return result.value;\r\n }\r\n }\r\n if (result == undefined) {\r\n throw StopIteration (new Error ());\r\n }\r\n else {\r\n return result;\r\n }\r\n }\r\n function __PyIterator__ (iterable) {\r\n this.iterable = iterable;\r\n this.index = 0;\r\n }\r\n __PyIterator__.prototype.__next__ = function () {\r\n if (this.index < this.iterable.length) {\r\n return this.iterable [this.index++];\r\n }\r\n else {\r\n throw StopIteration (new Error ());\r\n }\r\n };\r\n function __JsIterator__ (iterable) {\r\n this.iterable = iterable;\r\n this.index = 0;\r\n }\r\n __JsIterator__.prototype.next = function () {\r\n if (this.index < this.iterable.py_keys.length) {\r\n return {value: this.index++, done: false};\r\n }\r\n else {\r\n return {value: undefined, done: true};\r\n }\r\n };\r\n var py_reversed = function (iterable) {\r\n iterable = iterable.slice ();\r\n iterable.reverse ();\r\n return iterable;\r\n };\r\n __all__.py_reversed = py_reversed;\r\n var zip = function () {\r\n var args = [] .slice.call (arguments);\r\n for (var i = 0; i < args.length; i++) {\r\n if (typeof args [i] == 'string') {\r\n args [i] = args [i] .split ('');\r\n }\r\n else if (!Array.isArray (args [i])) {\r\n args [i] = Array.from (args [i]);\r\n }\r\n }\r\n var shortest = args.length == 0 ? [] : args.reduce (\r\n function (array0, array1) {\r\n return array0.length < array1.length ? array0 : array1;\r\n }\r\n );\r\n return shortest.map (\r\n function (current, index) {\r\n return args.map (\r\n function (current) {\r\n return current [index];\r\n }\r\n );\r\n }\r\n );\r\n };\r\n __all__.zip = zip;\r\n function range (start, stop, step) {\r\n if (stop == undefined) {\r\n stop = start;\r\n start = 0;\r\n }\r\n if (step == undefined) {\r\n step = 1;\r\n }\r\n if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) {\r\n return [];\r\n }\r\n var result = [];\r\n for (var i = start; step > 0 ? i < stop : i > stop; i += step) {\r\n result.push(i);\r\n }\r\n return result;\r\n };\r\n __all__.range = range;\r\n function any (iterable) {\r\n for (var index = 0; index < iterable.length; index++) {\r\n if (bool (iterable [index])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function all (iterable) {\r\n for (var index = 0; index < iterable.length; index++) {\r\n if (! bool (iterable [index])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function sum (iterable) {\r\n var result = 0;\r\n for (var index = 0; index < iterable.length; index++) {\r\n result += iterable [index];\r\n }\r\n return result;\r\n }\r\n __all__.any = any;\r\n __all__.all = all;\r\n __all__.sum = sum;\r\n function enumerate (iterable) {\r\n return zip (range (len (iterable)), iterable);\r\n }\r\n __all__.enumerate = enumerate;\r\n function copy (anObject) {\r\n if (anObject == null || typeof anObject == \"object\") {\r\n return anObject;\r\n }\r\n else {\r\n var result = {};\r\n for (var attrib in obj) {\r\n if (anObject.hasOwnProperty (attrib)) {\r\n result [attrib] = anObject [attrib];\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n __all__.copy = copy;\r\n function deepcopy (anObject) {\r\n if (anObject == null || typeof anObject == \"object\") {\r\n return anObject;\r\n }\r\n else {\r\n var result = {};\r\n for (var attrib in obj) {\r\n if (anObject.hasOwnProperty (attrib)) {\r\n result [attrib] = deepcopy (anObject [attrib]);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n __all__.deepcopy = deepcopy;\r\n function list (iterable) {\r\n var instance = iterable ? [] .slice.apply (iterable) : [];\r\n return instance;\r\n }\r\n __all__.list = list;\r\n Array.prototype.__class__ = list;\r\n list.__name__ = 'list';\r\n Array.prototype.__iter__ = function () {return new __PyIterator__ (this);};\r\n Array.prototype.__getslice__ = function (start, stop, step) {\r\n if (start < 0) {\r\n start = this.length + start;\r\n }\r\n if (stop == null) {\r\n stop = this.length;\r\n }\r\n else if (stop < 0) {\r\n stop = this.length + stop;\r\n }\r\n else if (stop > this.length) {\r\n stop = this.length;\r\n }\r\n var result = list ([]);\r\n for (var index = start; index < stop; index += step) {\r\n result.push (this [index]);\r\n }\r\n return result;\r\n };\r\n Array.prototype.__setslice__ = function (start, stop, step, source) {\r\n if (start < 0) {\r\n start = this.length + start;\r\n }\r\n if (stop == null) {\r\n stop = this.length;\r\n }\r\n else if (stop < 0) {\r\n stop = this.length + stop;\r\n }\r\n if (step == null) {\r\n Array.prototype.splice.apply (this, [start, stop - start] .concat (source));\r\n }\r\n else {\r\n var sourceIndex = 0;\r\n for (var targetIndex = start; targetIndex < stop; targetIndex += step) {\r\n this [targetIndex] = source [sourceIndex++];\r\n }\r\n }\r\n };\r\n Array.prototype.__repr__ = function () {\r\n if (this.__class__ == set && !this.length) {\r\n return 'set()';\r\n }\r\n var result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{';\r\n for (var index = 0; index < this.length; index++) {\r\n if (index) {\r\n result += ', ';\r\n }\r\n result += repr (this [index]);\r\n }\r\n if (this.__class__ == tuple && this.length == 1) {\r\n result += ',';\r\n }\r\n result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';;\r\n return result;\r\n };\r\n Array.prototype.__str__ = Array.prototype.__repr__;\r\n Array.prototype.append = function (element) {\r\n this.push (element);\r\n };\r\n Array.prototype.py_clear = function () {\r\n this.length = 0;\r\n };\r\n Array.prototype.extend = function (aList) {\r\n this.push.apply (this, aList);\r\n };\r\n Array.prototype.insert = function (index, element) {\r\n this.splice (index, 0, element);\r\n };\r\n Array.prototype.remove = function (element) {\r\n var index = this.indexOf (element);\r\n if (index == -1) {\r\n throw ValueError (\"list.remove(x): x not in list\", new Error ());\r\n }\r\n this.splice (index, 1);\r\n };\r\n Array.prototype.index = function (element) {\r\n return this.indexOf (element);\r\n };\r\n Array.prototype.py_pop = function (index) {\r\n if (index == undefined) {\r\n return this.pop ();\r\n }\r\n else {\r\n return this.splice (index, 1) [0];\r\n }\r\n };\r\n Array.prototype.py_sort = function () {\r\n __sort__.apply (null, [this].concat ([] .slice.apply (arguments)));\r\n };\r\n Array.prototype.__add__ = function (aList) {\r\n return list (this.concat (aList));\r\n };\r\n Array.prototype.__mul__ = function (scalar) {\r\n var result = this;\r\n for (var i = 1; i < scalar; i++) {\r\n result = result.concat (this);\r\n }\r\n return result;\r\n };\r\n Array.prototype.__rmul__ = Array.prototype.__mul__;\r\n function tuple (iterable) {\r\n var instance = iterable ? [] .slice.apply (iterable) : [];\r\n instance.__class__ = tuple;\r\n return instance;\r\n }\r\n __all__.tuple = tuple;\r\n tuple.__name__ = 'tuple';\r\n function set (iterable) {\r\n var instance = [];\r\n if (iterable) {\r\n for (var index = 0; index < iterable.length; index++) {\r\n instance.add (iterable [index]);\r\n }\r\n }\r\n instance.__class__ = set;\r\n return instance;\r\n }\r\n __all__.set = set;\r\n set.__name__ = 'set';\r\n Array.prototype.__bindexOf__ = function (element) {\r\n element += '';\r\n var mindex = 0;\r\n var maxdex = this.length - 1;\r\n while (mindex <= maxdex) {\r\n var index = (mindex + maxdex) / 2 | 0;\r\n var middle = this [index] + '';\r\n if (middle < element) {\r\n mindex = index + 1;\r\n }\r\n else if (middle > element) {\r\n maxdex = index - 1;\r\n }\r\n else {\r\n return index;\r\n }\r\n }\r\n return -1;\r\n };\r\n Array.prototype.add = function (element) {\r\n if (this.indexOf (element) == -1) {\r\n this.push (element);\r\n }\r\n };\r\n Array.prototype.discard = function (element) {\r\n var index = this.indexOf (element);\r\n if (index != -1) {\r\n this.splice (index, 1);\r\n }\r\n };\r\n Array.prototype.isdisjoint = function (other) {\r\n this.sort ();\r\n for (var i = 0; i < other.length; i++) {\r\n if (this.__bindexOf__ (other [i]) != -1) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Array.prototype.issuperset = function (other) {\r\n this.sort ();\r\n for (var i = 0; i < other.length; i++) {\r\n if (this.__bindexOf__ (other [i]) == -1) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Array.prototype.issubset = function (other) {\r\n return set (other.slice ()) .issuperset (this);\r\n };\r\n Array.prototype.union = function (other) {\r\n var result = set (this.slice () .sort ());\r\n for (var i = 0; i < other.length; i++) {\r\n if (result.__bindexOf__ (other [i]) == -1) {\r\n result.push (other [i]);\r\n }\r\n }\r\n return result;\r\n };\r\n Array.prototype.intersection = function (other) {\r\n this.sort ();\r\n var result = set ();\r\n for (var i = 0; i < other.length; i++) {\r\n if (this.__bindexOf__ (other [i]) != -1) {\r\n result.push (other [i]);\r\n }\r\n }\r\n return result;\r\n };\r\n Array.prototype.difference = function (other) {\r\n var sother = set (other.slice () .sort ());\r\n var result = set ();\r\n for (var i = 0; i < this.length; i++) {\r\n if (sother.__bindexOf__ (this [i]) == -1) {\r\n result.push (this [i]);\r\n }\r\n }\r\n return result;\r\n };\r\n Array.prototype.symmetric_difference = function (other) {\r\n return this.union (other) .difference (this.intersection (other));\r\n };\r\n Array.prototype.py_update = function () {\r\n var updated = [] .concat.apply (this.slice (), arguments) .sort ();\r\n this.py_clear ();\r\n for (var i = 0; i < updated.length; i++) {\r\n if (updated [i] != updated [i - 1]) {\r\n this.push (updated [i]);\r\n }\r\n }\r\n };\r\n Array.prototype.__eq__ = function (other) {\r\n if (this.length != other.length) {\r\n return false;\r\n }\r\n if (this.__class__ == set) {\r\n this.sort ();\r\n other.sort ();\r\n }\r\n for (var i = 0; i < this.length; i++) {\r\n if (this [i] != other [i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Array.prototype.__ne__ = function (other) {\r\n return !this.__eq__ (other);\r\n };\r\n Array.prototype.__le__ = function (other) {\r\n return this.issubset (other);\r\n };\r\n Array.prototype.__ge__ = function (other) {\r\n return this.issuperset (other);\r\n };\r\n Array.prototype.__lt__ = function (other) {\r\n return this.issubset (other) && !this.issuperset (other);\r\n };\r\n Array.prototype.__gt__ = function (other) {\r\n return this.issuperset (other) && !this.issubset (other);\r\n };\r\n function bytearray (bytable, encoding) {\r\n if (bytable == undefined) {\r\n return new Uint8Array (0);\r\n }\r\n else {\r\n var aType = py_typeof (bytable);\r\n if (aType == int) {\r\n return new Uint8Array (bytable);\r\n }\r\n else if (aType == str) {\r\n var aBytes = new Uint8Array (len (bytable));\r\n for (var i = 0; i < len (bytable); i++) {\r\n aBytes [i] = bytable.charCodeAt (i);\r\n }\r\n return aBytes;\r\n }\r\n else if (aType == list || aType == tuple) {\r\n return new Uint8Array (bytable);\r\n }\r\n else {\r\n throw py_TypeError;\r\n }\r\n }\r\n }\r\n var bytes = bytearray;\r\n __all__.bytearray = bytearray;\r\n __all__.bytes = bytearray;\r\n Uint8Array.prototype.__add__ = function (aBytes) {\r\n var result = new Uint8Array (this.length + aBytes.length);\r\n result.set (this);\r\n result.set (aBytes, this.length);\r\n return result;\r\n };\r\n Uint8Array.prototype.__mul__ = function (scalar) {\r\n var result = new Uint8Array (scalar * this.length);\r\n for (var i = 0; i < scalar; i++) {\r\n result.set (this, i * this.length);\r\n }\r\n return result;\r\n };\r\n Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__;\r\n function str (stringable) {\r\n try {\r\n return stringable.__str__ ();\r\n }\r\n catch (exception) {\r\n try {\r\n return repr (stringable);\r\n }\r\n catch (exception) {\r\n return String (stringable);\r\n }\r\n }\r\n };\r\n __all__.str = str;\r\n String.prototype.__class__ = str;\r\n str.__name__ = 'str';\r\n String.prototype.__iter__ = function () {new __PyIterator__ (this);};\r\n String.prototype.__repr__ = function () {\r\n return (this.indexOf ('\\'') == -1 ? '\\'' + this + '\\'' : '\"' + this + '\"') .py_replace ('\\t', '\\\\t') .py_replace ('\\n', '\\\\n');\r\n };\r\n String.prototype.__str__ = function () {\r\n return this;\r\n };\r\n String.prototype.capitalize = function () {\r\n return this.charAt (0).toUpperCase () + this.slice (1);\r\n };\r\n String.prototype.endswith = function (suffix) {\r\n return suffix == '' || this.slice (-suffix.length) == suffix;\r\n };\r\n String.prototype.find = function (sub, start) {\r\n return this.indexOf (sub, start);\r\n };\r\n String.prototype.__getslice__ = function (start, stop, step) {\r\n if (start < 0) {\r\n start = this.length + start;\r\n }\r\n if (stop == null) {\r\n stop = this.length;\r\n }\r\n else if (stop < 0) {\r\n stop = this.length + stop;\r\n }\r\n var result = '';\r\n if (step == 1) {\r\n result = this.substring (start, stop);\r\n }\r\n else {\r\n for (var index = start; index < stop; index += step) {\r\n result = result.concat (this.charAt(index));\r\n }\r\n }\r\n return result;\r\n }\r\n __setProperty__ (String.prototype, 'format', {\r\n get: function () {return __get__ (this, function (self) {\r\n var args = tuple ([] .slice.apply (arguments).slice (1));\r\n var autoIndex = 0;\r\n return self.replace (/\\{(\\w*)\\}/g, function (match, key) {\r\n if (key == '') {\r\n key = autoIndex++;\r\n }\r\n if (key == +key) {\r\n return args [key] == undefined ? match : str (args [key]);\r\n }\r\n else {\r\n for (var index = 0; index < args.length; index++) {\r\n if (typeof args [index] == 'object' && args [index][key] != undefined) {\r\n return str (args [index][key]);\r\n }\r\n }\r\n return match;\r\n }\r\n });\r\n });},\r\n enumerable: true\r\n });\r\n String.prototype.isalnum = function () {\r\n return /^[0-9a-zA-Z]{1,}$/.test(this)\r\n }\r\n String.prototype.isalpha = function () {\r\n return /^[a-zA-Z]{1,}$/.test(this)\r\n }\r\n String.prototype.isdecimal = function () {\r\n return /^[0-9]{1,}$/.test(this)\r\n }\r\n String.prototype.isdigit = function () {\r\n return this.isdecimal()\r\n }\r\n String.prototype.islower = function () {\r\n return /^[a-z]{1,}$/.test(this)\r\n }\r\n String.prototype.isupper = function () {\r\n return /^[A-Z]{1,}$/.test(this)\r\n }\r\n String.prototype.isspace = function () {\r\n return /^[\\s]{1,}$/.test(this)\r\n }\r\n String.prototype.isnumeric = function () {\r\n return !isNaN (parseFloat (this)) && isFinite (this);\r\n };\r\n String.prototype.join = function (strings) {\r\n return strings.join (this);\r\n };\r\n String.prototype.lower = function () {\r\n return this.toLowerCase ();\r\n };\r\n String.prototype.py_replace = function (old, aNew, maxreplace) {\r\n return this.split (old, maxreplace) .join (aNew);\r\n };\r\n String.prototype.lstrip = function () {\r\n return this.replace (/^\\s*/g, '');\r\n };\r\n String.prototype.rfind = function (sub, start) {\r\n return this.lastIndexOf (sub, start);\r\n };\r\n String.prototype.rsplit = function (sep, maxsplit) {\r\n if (sep == undefined || sep == null) {\r\n sep = /\\s+/;\r\n var stripped = this.strip ();\r\n }\r\n else {\r\n var stripped = this;\r\n }\r\n if (maxsplit == undefined || maxsplit == -1) {\r\n return stripped.split (sep);\r\n }\r\n else {\r\n var result = stripped.split (sep);\r\n if (maxsplit < result.length) {\r\n var maxrsplit = result.length - maxsplit;\r\n return [result.slice (0, maxrsplit) .join (sep)] .concat (result.slice (maxrsplit));\r\n }\r\n else {\r\n return result;\r\n }\r\n }\r\n };\r\n String.prototype.rstrip = function () {\r\n return this.replace (/\\s*$/g, '');\r\n };\r\n String.prototype.py_split = function (sep, maxsplit) {\r\n if (sep == undefined || sep == null) {\r\n sep = /\\s+/;\r\n var stripped = this.strip ();\r\n }\r\n else {\r\n var stripped = this;\r\n }\r\n if (maxsplit == undefined || maxsplit == -1) {\r\n return stripped.split (sep);\r\n }\r\n else {\r\n var result = stripped.split (sep);\r\n if (maxsplit < result.length) {\r\n return result.slice (0, maxsplit).concat ([result.slice (maxsplit).join (sep)]);\r\n }\r\n else {\r\n return result;\r\n }\r\n }\r\n };\r\n String.prototype.startswith = function (prefix) {\r\n return this.indexOf (prefix) == 0;\r\n };\r\n String.prototype.strip = function () {\r\n return this.trim ();\r\n };\r\n String.prototype.upper = function () {\r\n return this.toUpperCase ();\r\n };\r\n String.prototype.__mul__ = function (scalar) {\r\n var result = this;\r\n for (var i = 1; i < scalar; i++) {\r\n result = result + this;\r\n }\r\n return result;\r\n };\r\n String.prototype.__rmul__ = String.prototype.__mul__;\r\n function __keys__ () {\r\n var keys = [];\r\n for (var attrib in this) {\r\n if (!__specialattrib__ (attrib)) {\r\n keys.push (attrib);\r\n }\r\n }\r\n return keys;\r\n }\r\n function __items__ () {\r\n var items = [];\r\n for (var attrib in this) {\r\n if (!__specialattrib__ (attrib)) {\r\n items.push ([attrib, this [attrib]]);\r\n }\r\n }\r\n return items;\r\n }\r\n function __del__ (key) {\r\n delete this [key];\r\n }\r\n function __clear__ () {\r\n for (var attrib in this) {\r\n delete this [attrib];\r\n }\r\n }\r\n function __getdefault__ (aKey, aDefault) {\r\n var result = this [aKey];\r\n if (result == undefined) {\r\n result = this ['py_' + aKey]\r\n }\r\n return result == undefined ? (aDefault == undefined ? null : aDefault) : result;\r\n }\r\n function __setdefault__ (aKey, aDefault) {\r\n var result = this [aKey];\r\n if (result != undefined) {\r\n return result;\r\n }\r\n var val = aDefault == undefined ? null : aDefault;\r\n this [aKey] = val;\r\n return val;\r\n }\r\n function __pop__ (aKey, aDefault) {\r\n var result = this [aKey];\r\n if (result != undefined) {\r\n delete this [aKey];\r\n return result;\r\n } else {\r\n if ( aDefault === undefined ) {\r\n throw KeyError (aKey, new Error());\r\n }\r\n }\r\n return aDefault;\r\n }\r\n function __popitem__ () {\r\n var aKey = Object.keys (this) [0];\r\n if (aKey == null) {\r\n throw KeyError (\"popitem(): dictionary is empty\", new Error ());\r\n }\r\n var result = tuple ([aKey, this [aKey]]);\r\n delete this [aKey];\r\n return result;\r\n }\r\n function __update__ (aDict) {\r\n for (var aKey in aDict) {\r\n this [aKey] = aDict [aKey];\r\n }\r\n }\r\n function __values__ () {\r\n var values = [];\r\n for (var attrib in this) {\r\n if (!__specialattrib__ (attrib)) {\r\n values.push (this [attrib]);\r\n }\r\n }\r\n return values;\r\n }\r\n function __dgetitem__ (aKey) {\r\n return this [aKey];\r\n }\r\n function __dsetitem__ (aKey, aValue) {\r\n this [aKey] = aValue;\r\n }\r\n function dict (objectOrPairs) {\r\n var instance = {};\r\n if (!objectOrPairs || objectOrPairs instanceof Array) {\r\n if (objectOrPairs) {\r\n for (var index = 0; index < objectOrPairs.length; index++) {\r\n var pair = objectOrPairs [index];\r\n if ( !(pair instanceof Array) || pair.length != 2) {\r\n throw ValueError(\r\n \"dict update sequence element #\" + index +\r\n \" has length \" + pair.length +\r\n \"; 2 is required\", new Error());\r\n }\r\n var key = pair [0];\r\n var val = pair [1];\r\n if (!(objectOrPairs instanceof Array) && objectOrPairs instanceof Object) {\r\n if (!isinstance (objectOrPairs, dict)) {\r\n val = dict (val);\r\n }\r\n }\r\n instance [key] = val;\r\n }\r\n }\r\n }\r\n else {\r\n if (isinstance (objectOrPairs, dict)) {\r\n var aKeys = objectOrPairs.py_keys ();\r\n for (var index = 0; index < aKeys.length; index++ ) {\r\n var key = aKeys [index];\r\n instance [key] = objectOrPairs [key];\r\n }\r\n } else if (objectOrPairs instanceof Object) {\r\n instance = objectOrPairs;\r\n } else {\r\n throw ValueError (\"Invalid type of object for dict creation\", new Error ());\r\n }\r\n }\r\n __setProperty__ (instance, '__class__', {value: dict, enumerable: false, writable: true});\r\n __setProperty__ (instance, 'py_keys', {value: __keys__, enumerable: false});\r\n __setProperty__ (instance, '__iter__', {value: function () {new __PyIterator__ (this.py_keys ());}, enumerable: false});\r\n __setProperty__ (instance, Symbol.iterator, {value: function () {new __JsIterator__ (this.py_keys ());}, enumerable: false});\r\n __setProperty__ (instance, 'py_items', {value: __items__, enumerable: false});\r\n __setProperty__ (instance, 'py_del', {value: __del__, enumerable: false});\r\n __setProperty__ (instance, 'py_clear', {value: __clear__, enumerable: false});\r\n __setProperty__ (instance, 'py_get', {value: __getdefault__, enumerable: false});\r\n __setProperty__ (instance, 'py_setdefault', {value: __setdefault__, enumerable: false});\r\n __setProperty__ (instance, 'py_pop', {value: __pop__, enumerable: false});\r\n __setProperty__ (instance, 'py_popitem', {value: __popitem__, enumerable: false});\r\n __setProperty__ (instance, 'py_update', {value: __update__, enumerable: false});\r\n __setProperty__ (instance, 'py_values', {value: __values__, enumerable: false});\r\n __setProperty__ (instance, '__getitem__', {value: __dgetitem__, enumerable: false});\r\n __setProperty__ (instance, '__setitem__', {value: __dsetitem__, enumerable: false});\r\n return instance;\r\n }\r\n __all__.dict = dict;\r\n dict.__name__ = 'dict';\r\n function __setdoc__ (docString) {\r\n this.__doc__ = docString;\r\n return this;\r\n }\r\n __setProperty__ (Function.prototype, '__setdoc__', {value: __setdoc__, enumerable: false});\r\n var __jsmod__ = function (a, b) {\r\n if (typeof a == 'object' && '__mod__' in a) {\r\n return a.__mod__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rpow__' in b) {\r\n return b.__rmod__ (a);\r\n }\r\n else {\r\n return a % b;\r\n }\r\n };\r\n __all__.__jsmod__ = __jsmod__;\r\n var __mod__ = function (a, b) {\r\n if (typeof a == 'object' && '__mod__' in a) {\r\n return a.__mod__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rpow__' in b) {\r\n return b.__rmod__ (a);\r\n }\r\n else {\r\n return ((a % b) + b) % b;\r\n }\r\n };\r\n __all__.mod = __mod__;\r\n var __pow__ = function (a, b) {\r\n if (typeof a == 'object' && '__pow__' in a) {\r\n return a.__pow__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rpow__' in b) {\r\n return b.__rpow__ (a);\r\n }\r\n else {\r\n return Math.pow (a, b);\r\n }\r\n };\r\n __all__.pow = __pow__;\r\n var __neg__ = function (a) {\r\n if (typeof a == 'object' && '__neg__' in a) {\r\n return a.__neg__ ();\r\n }\r\n else {\r\n return -a;\r\n }\r\n };\r\n __all__.__neg__ = __neg__;\r\n var __matmul__ = function (a, b) {\r\n return a.__matmul__ (b);\r\n };\r\n __all__.__matmul__ = __matmul__;\r\n var __mul__ = function (a, b) {\r\n if (typeof a == 'object' && '__mul__' in a) {\r\n return a.__mul__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rmul__' in b) {\r\n return b.__rmul__ (a);\r\n }\r\n else if (typeof a == 'string') {\r\n return a.__mul__ (b);\r\n }\r\n else if (typeof b == 'string') {\r\n return b.__rmul__ (a);\r\n }\r\n else {\r\n return a * b;\r\n }\r\n };\r\n __all__.__mul__ = __mul__;\r\n var __truediv__ = function (a, b) {\r\n if (typeof a == 'object' && '__truediv__' in a) {\r\n return a.__truediv__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rtruediv__' in b) {\r\n return b.__rtruediv__ (a);\r\n }\r\n else if (typeof a == 'object' && '__div__' in a) {\r\n return a.__div__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rdiv__' in b) {\r\n return b.__rdiv__ (a);\r\n }\r\n else {\r\n return a / b;\r\n }\r\n };\r\n __all__.__truediv__ = __truediv__;\r\n var __floordiv__ = function (a, b) {\r\n if (typeof a == 'object' && '__floordiv__' in a) {\r\n return a.__floordiv__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rfloordiv__' in b) {\r\n return b.__rfloordiv__ (a);\r\n }\r\n else if (typeof a == 'object' && '__div__' in a) {\r\n return a.__div__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rdiv__' in b) {\r\n return b.__rdiv__ (a);\r\n }\r\n else {\r\n return Math.floor (a / b);\r\n }\r\n };\r\n __all__.__floordiv__ = __floordiv__;\r\n var __add__ = function (a, b) {\r\n if (typeof a == 'object' && '__add__' in a) {\r\n return a.__add__ (b);\r\n }\r\n else if (typeof b == 'object' && '__radd__' in b) {\r\n return b.__radd__ (a);\r\n }\r\n else {\r\n return a + b;\r\n }\r\n };\r\n __all__.__add__ = __add__;\r\n var __sub__ = function (a, b) {\r\n if (typeof a == 'object' && '__sub__' in a) {\r\n return a.__sub__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rsub__' in b) {\r\n return b.__rsub__ (a);\r\n }\r\n else {\r\n return a - b;\r\n }\r\n };\r\n __all__.__sub__ = __sub__;\r\n var __lshift__ = function (a, b) {\r\n if (typeof a == 'object' && '__lshift__' in a) {\r\n return a.__lshift__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rlshift__' in b) {\r\n return b.__rlshift__ (a);\r\n }\r\n else {\r\n return a << b;\r\n }\r\n };\r\n __all__.__lshift__ = __lshift__;\r\n var __rshift__ = function (a, b) {\r\n if (typeof a == 'object' && '__rshift__' in a) {\r\n return a.__rshift__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rrshift__' in b) {\r\n return b.__rrshift__ (a);\r\n }\r\n else {\r\n return a >> b;\r\n }\r\n };\r\n __all__.__rshift__ = __rshift__;\r\n var __or__ = function (a, b) {\r\n if (typeof a == 'object' && '__or__' in a) {\r\n return a.__or__ (b);\r\n }\r\n else if (typeof b == 'object' && '__ror__' in b) {\r\n return b.__ror__ (a);\r\n }\r\n else {\r\n return a | b;\r\n }\r\n };\r\n __all__.__or__ = __or__;\r\n var __xor__ = function (a, b) {\r\n if (typeof a == 'object' && '__xor__' in a) {\r\n return a.__xor__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rxor__' in b) {\r\n return b.__rxor__ (a);\r\n }\r\n else {\r\n return a ^ b;\r\n }\r\n };\r\n __all__.__xor__ = __xor__;\r\n var __and__ = function (a, b) {\r\n if (typeof a == 'object' && '__and__' in a) {\r\n return a.__and__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rand__' in b) {\r\n return b.__rand__ (a);\r\n }\r\n else {\r\n return a & b;\r\n }\r\n };\r\n __all__.__and__ = __and__;\r\n var __eq__ = function (a, b) {\r\n if (typeof a == 'object' && '__eq__' in a) {\r\n return a.__eq__ (b);\r\n }\r\n else {\r\n return a == b;\r\n }\r\n };\r\n __all__.__eq__ = __eq__;\r\n var __ne__ = function (a, b) {\r\n if (typeof a == 'object' && '__ne__' in a) {\r\n return a.__ne__ (b);\r\n }\r\n else {\r\n return a != b\r\n }\r\n };\r\n __all__.__ne__ = __ne__;\r\n var __lt__ = function (a, b) {\r\n if (typeof a == 'object' && '__lt__' in a) {\r\n return a.__lt__ (b);\r\n }\r\n else {\r\n return a < b;\r\n }\r\n };\r\n __all__.__lt__ = __lt__;\r\n var __le__ = function (a, b) {\r\n if (typeof a == 'object' && '__le__' in a) {\r\n return a.__le__ (b);\r\n }\r\n else {\r\n return a <= b;\r\n }\r\n };\r\n __all__.__le__ = __le__;\r\n var __gt__ = function (a, b) {\r\n if (typeof a == 'object' && '__gt__' in a) {\r\n return a.__gt__ (b);\r\n }\r\n else {\r\n return a > b;\r\n }\r\n };\r\n __all__.__gt__ = __gt__;\r\n var __ge__ = function (a, b) {\r\n if (typeof a == 'object' && '__ge__' in a) {\r\n return a.__ge__ (b);\r\n }\r\n else {\r\n return a >= b;\r\n }\r\n };\r\n __all__.__ge__ = __ge__;\r\n var __imatmul__ = function (a, b) {\r\n if ('__imatmul__' in a) {\r\n return a.__imatmul__ (b);\r\n }\r\n else {\r\n return a.__matmul__ (b);\r\n }\r\n };\r\n __all__.__imatmul__ = __imatmul__;\r\n var __ipow__ = function (a, b) {\r\n if (typeof a == 'object' && '__pow__' in a) {\r\n return a.__ipow__ (b);\r\n }\r\n else if (typeof a == 'object' && '__ipow__' in a) {\r\n return a.__pow__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rpow__' in b) {\r\n return b.__rpow__ (a);\r\n }\r\n else {\r\n return Math.pow (a, b);\r\n }\r\n };\r\n __all__.ipow = __ipow__;\r\n var __ijsmod__ = function (a, b) {\r\n if (typeof a == 'object' && '__imod__' in a) {\r\n return a.__ismod__ (b);\r\n }\r\n else if (typeof a == 'object' && '__mod__' in a) {\r\n return a.__mod__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rpow__' in b) {\r\n return b.__rmod__ (a);\r\n }\r\n else {\r\n return a % b;\r\n }\r\n };\r\n __all__.ijsmod__ = __ijsmod__;\r\n var __imod__ = function (a, b) {\r\n if (typeof a == 'object' && '__imod__' in a) {\r\n return a.__imod__ (b);\r\n }\r\n else if (typeof a == 'object' && '__mod__' in a) {\r\n return a.__mod__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rpow__' in b) {\r\n return b.__rmod__ (a);\r\n }\r\n else {\r\n return ((a % b) + b) % b;\r\n }\r\n };\r\n __all__.imod = __imod__;\r\n var __imul__ = function (a, b) {\r\n if (typeof a == 'object' && '__imul__' in a) {\r\n return a.__imul__ (b);\r\n }\r\n else if (typeof a == 'object' && '__mul__' in a) {\r\n return a = a.__mul__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rmul__' in b) {\r\n return a = b.__rmul__ (a);\r\n }\r\n else if (typeof a == 'string') {\r\n return a = a.__mul__ (b);\r\n }\r\n else if (typeof b == 'string') {\r\n return a = b.__rmul__ (a);\r\n }\r\n else {\r\n return a *= b;\r\n }\r\n };\r\n __all__.__imul__ = __imul__;\r\n var __idiv__ = function (a, b) {\r\n if (typeof a == 'object' && '__idiv__' in a) {\r\n return a.__idiv__ (b);\r\n }\r\n else if (typeof a == 'object' && '__div__' in a) {\r\n return a = a.__div__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rdiv__' in b) {\r\n return a = b.__rdiv__ (a);\r\n }\r\n else {\r\n return a /= b;\r\n }\r\n };\r\n __all__.__idiv__ = __idiv__;\r\n var __iadd__ = function (a, b) {\r\n if (typeof a == 'object' && '__iadd__' in a) {\r\n return a.__iadd__ (b);\r\n }\r\n else if (typeof a == 'object' && '__add__' in a) {\r\n return a = a.__add__ (b);\r\n }\r\n else if (typeof b == 'object' && '__radd__' in b) {\r\n return a = b.__radd__ (a);\r\n }\r\n else {\r\n return a += b;\r\n }\r\n };\r\n __all__.__iadd__ = __iadd__;\r\n var __isub__ = function (a, b) {\r\n if (typeof a == 'object' && '__isub__' in a) {\r\n return a.__isub__ (b);\r\n }\r\n else if (typeof a == 'object' && '__sub__' in a) {\r\n return a = a.__sub__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rsub__' in b) {\r\n return a = b.__rsub__ (a);\r\n }\r\n else {\r\n return a -= b;\r\n }\r\n };\r\n __all__.__isub__ = __isub__;\r\n var __ilshift__ = function (a, b) {\r\n if (typeof a == 'object' && '__ilshift__' in a) {\r\n return a.__ilshift__ (b);\r\n }\r\n else if (typeof a == 'object' && '__lshift__' in a) {\r\n return a = a.__lshift__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rlshift__' in b) {\r\n return a = b.__rlshift__ (a);\r\n }\r\n else {\r\n return a <<= b;\r\n }\r\n };\r\n __all__.__ilshift__ = __ilshift__;\r\n var __irshift__ = function (a, b) {\r\n if (typeof a == 'object' && '__irshift__' in a) {\r\n return a.__irshift__ (b);\r\n }\r\n else if (typeof a == 'object' && '__rshift__' in a) {\r\n return a = a.__rshift__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rrshift__' in b) {\r\n return a = b.__rrshift__ (a);\r\n }\r\n else {\r\n return a >>= b;\r\n }\r\n };\r\n __all__.__irshift__ = __irshift__;\r\n var __ior__ = function (a, b) {\r\n if (typeof a == 'object' && '__ior__' in a) {\r\n return a.__ior__ (b);\r\n }\r\n else if (typeof a == 'object' && '__or__' in a) {\r\n return a = a.__or__ (b);\r\n }\r\n else if (typeof b == 'object' && '__ror__' in b) {\r\n return a = b.__ror__ (a);\r\n }\r\n else {\r\n return a |= b;\r\n }\r\n };\r\n __all__.__ior__ = __ior__;\r\n var __ixor__ = function (a, b) {\r\n if (typeof a == 'object' && '__ixor__' in a) {\r\n return a.__ixor__ (b);\r\n }\r\n else if (typeof a == 'object' && '__xor__' in a) {\r\n return a = a.__xor__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rxor__' in b) {\r\n return a = b.__rxor__ (a);\r\n }\r\n else {\r\n return a ^= b;\r\n }\r\n };\r\n __all__.__ixor__ = __ixor__;\r\n var __iand__ = function (a, b) {\r\n if (typeof a == 'object' && '__iand__' in a) {\r\n return a.__iand__ (b);\r\n }\r\n else if (typeof a == 'object' && '__and__' in a) {\r\n return a = a.__and__ (b);\r\n }\r\n else if (typeof b == 'object' && '__rand__' in b) {\r\n return a = b.__rand__ (a);\r\n }\r\n else {\r\n return a &= b;\r\n }\r\n };\r\n __all__.__iand__ = __iand__;\r\n var __getitem__ = function (container, key) {\r\n if (typeof container == 'object' && '__getitem__' in container) {\r\n return container.__getitem__ (key);\r\n }\r\n else {\r\n return container [key];\r\n }\r\n };\r\n __all__.__getitem__ = __getitem__;\r\n var __setitem__ = function (container, key, value) {\r\n if (typeof container == 'object' && '__setitem__' in container) {\r\n container.__setitem__ (key, value);\r\n }\r\n else {\r\n container [key] = value;\r\n }\r\n };\r\n __all__.__setitem__ = __setitem__;\r\n var __getslice__ = function (container, lower, upper, step) {\r\n if (typeof container == 'object' && '__getitem__' in container) {\r\n return container.__getitem__ ([lower, upper, step]);\r\n }\r\n else {\r\n return container.__getslice__ (lower, upper, step);\r\n }\r\n };\r\n __all__.__getslice__ = __getslice__;\r\n var __setslice__ = function (container, lower, upper, step, value) {\r\n if (typeof container == 'object' && '__setitem__' in container) {\r\n container.__setitem__ ([lower, upper, step], value);\r\n }\r\n else {\r\n container.__setslice__ (lower, upper, step, value);\r\n }\r\n };\r\n __all__.__setslice__ = __setslice__;\t__nest__ (\r\n\t\t__all__,\r\n\t\t'cmath', {\r\n\t\t\t__all__: {\r\n\t\t\t\t__inited__: false,\r\n\t\t\t\t__init__: function (__all__) {\r\n\t\t\t\t\tvar __name__ = 'cmath';\r\n\t\t\t\t\tvar pi = Math.PI;\r\n\t\t\t\t\tvar e = Math.E;\r\n\t\t\t\t\tvar phase = function (x) {\r\n\t\t\t\t\t\treturn (typeof x === 'number' ? 0 : Math.atan2 (x.imag, x.real));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar polar = function (x) {\r\n\t\t\t\t\t\treturn (typeof x === 'number' ? tuple ([Math.abs (x), 0]) : tuple ([abs (x), phase (x)]));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar rect = function (r, phi) {\r\n\t\t\t\t\t\treturn __mul__ (r, __add__ (__call__ (Math.cos, Math, phi), __mul__ (complex (0, 1.0), __call__ (Math.sin, Math, phi))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar exp = function (x) {\r\n\t\t\t\t\t\treturn (typeof x === 'number' ? complex (x, 0).__exp__ () : x.__exp__ ());\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar log = function (x, base) {\r\n\t\t\t\t\t\treturn (base === undefined ? (typeof x === 'number' ? complex (x, 0).__log__ () : x.__log__ ()) : __truediv__ (log (x), log (base)));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar log10 = function (x) {\r\n\t\t\t\t\t\treturn log (x, 10);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar sqrt = function (x) {\r\n\t\t\t\t\t\treturn exp (__mul__ (log (x), 0.5));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar sin = function (x) {\r\n\t\t\t\t\t\treturn __mul__ (__neg__ (complex (0, 0.5)), __sub__ (__call__ (exp, null, __mul__ (complex (0, 1.0), x)), __call__ (exp, null, __mul__ (__neg__ (complex (0, 1.0)), x))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar cos = function (x) {\r\n\t\t\t\t\t\treturn __mul__ (0.5, __add__ (__call__ (exp, null, __mul__ (complex (0, 1.0), x)), __call__ (exp, null, __mul__ (__neg__ (complex (0, 1.0)), x))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar tan = function (x) {\r\n\t\t\t\t\t\treturn __truediv__ (__mul__ (__neg__ (complex (0, 1.0)), __sub__ (__call__ (exp, null, __mul__ (complex (0, 1.0), x)), __call__ (exp, null, __mul__ (__neg__ (complex (0, 1.0)), x)))), __add__ (__call__ (exp, null, __mul__ (complex (0, 1.0), x)), __call__ (exp, null, __mul__ (__neg__ (complex (0, 1.0)), x))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar asin = function (x) {\r\n\t\t\t\t\t\treturn __mul__ (__neg__ (complex (0, 1.0)), __call__ (log, null, __add__ (__mul__ (complex (0, 1.0), x), __call__ (sqrt, null, __sub__ (1, __mul__ (x, x))))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar acos = function (x) {\r\n\t\t\t\t\t\treturn __mul__ (__neg__ (complex (0, 1.0)), __call__ (log, null, __add__ (x, __mul__ (complex (0, 1.0), __call__ (sqrt, null, __sub__ (1, __mul__ (x, x)))))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar atan = function (x) {\r\n\t\t\t\t\t\treturn __mul__ (complex (0, 0.5), __call__ (log, null, __truediv__ (__add__ (complex (0, 1.0), x), __sub__ (complex (0, 1.0), x))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar sinh = function (x) {\r\n\t\t\t\t\t\treturn __mul__ (0.5, __sub__ (__call__ (exp, null, x), __call__ (exp, null, __neg__ (x))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar cosh = function (x) {\r\n\t\t\t\t\t\treturn __mul__ (0.5, __add__ (__call__ (exp, null, x), __call__ (exp, null, __neg__ (x))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar tanh = function (x) {\r\n\t\t\t\t\t\treturn __truediv__ (__sub__ (__call__ (exp, null, x), __call__ (exp, null, __neg__ (x))), __add__ (__call__ (exp, null, x), __call__ (exp, null, __neg__ (x))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar asinh = function (x) {\r\n\t\t\t\t\t\treturn __call__ (log, null, __add__ (x, __call__ (sqrt, null, __add__ (1, __mul__ (x, x)))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar acosh = function (x) {\r\n\t\t\t\t\t\treturn __call__ (log, null, __add__ (x, __call__ (sqrt, null, __add__ (__neg__ (1), __mul__ (x, x)))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar atanh = function (x) {\r\n\t\t\t\t\t\treturn __mul__ (0.5, __call__ (log, null, __truediv__ (__add__ (1, x), __sub__ (1, x))));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar isinf = function (x) {\r\n\t\t\t\t\t\treturn x.real == js_Infinite || x.imag == js.Infinite;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar isfinite = function (x) {\r\n\t\t\t\t\t\treturn !(isinf (x));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar isnan = function (x) {\r\n\t\t\t\t\t\treturn isNaN (x.real) || isNaN (x.imag);\r\n\t\t\t\t\t};\r\n\t\t\t\t\t__pragma__ ('<all>')\r\n\t\t\t\t\t\t__all__.__name__ = __name__;\r\n\t\t\t\t\t\t__all__.acos = acos;\r\n\t\t\t\t\t\t__all__.acosh = acosh;\r\n\t\t\t\t\t\t__all__.asin = asin;\r\n\t\t\t\t\t\t__all__.asinh = asinh;\r\n\t\t\t\t\t\t__all__.atan = atan;\r\n\t\t\t\t\t\t__all__.atanh = atanh;\r\n\t\t\t\t\t\t__all__.cos = cos;\r\n\t\t\t\t\t\t__all__.cosh = cosh;\r\n\t\t\t\t\t\t__all__.e = e;\r\n\t\t\t\t\t\t__all__.exp = exp;\r\n\t\t\t\t\t\t__all__.isfinite = isfinite;\r\n\t\t\t\t\t\t__all__.isinf = isinf;\r\n\t\t\t\t\t\t__all__.isnan = isnan;\r\n\t\t\t\t\t\t__all__.log = log;\r\n\t\t\t\t\t\t__all__.log10 = log10;\r\n\t\t\t\t\t\t__all__.phase = phase;\r\n\t\t\t\t\t\t__all__.pi = pi;\r\n\t\t\t\t\t\t__all__.polar = polar;\r\n\t\t\t\t\t\t__all__.rect = rect;\r\n\t\t\t\t\t\t__all__.sin = sin;\r\n\t\t\t\t\t\t__all__.sinh = sinh;\r\n\t\t\t\t\t\t__all__.sqrt = sqrt;\r\n\t\t\t\t\t\t__all__.tan = tan;\r\n\t\t\t\t\t\t__all__.tanh = tanh;\r\n\t\t\t\t\t__pragma__ ('</all>')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n __nest__ (\r\n __all__,\r\n 'itertools', {\r\n __all__: {\r\n __inited__: false,\r\n __init__: function (__all__) {\r\n var chain = function () {\r\n var args = [] .slice.apply (arguments);\r\n var result = [];\r\n for (var index = 0; index < args.length; index++) {\r\n result = result.concat (args [index]);\r\n }\r\n return list (result);\r\n }\r\n //<all>\r\n __all__.chain = chain;\r\n //</all>\r\n }\r\n }\r\n }\r\n );\r\n\t__nest__ (\r\n\t\t__all__,\r\n\t\t'math', {\r\n\t\t\t__all__: {\r\n\t\t\t\t__inited__: false,\r\n\t\t\t\t__init__: function (__all__) {\r\n\t\t\t\t\tvar __name__ = 'math';\r\n\t\t\t\t\tvar pi = Math.PI;\r\n\t\t\t\t\tvar e = Math.E;\r\n\t\t\t\t\tvar exp = Math.exp;\r\n\t\t\t\t\tvar expm1 = function (x) {\r\n\t\t\t\t\t\treturn Math.exp (x) - 1;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar log = function (x, base) {\r\n\t\t\t\t\t\treturn (base === undefined ? Math.log (x) : Math.log (x) / Math.log (base));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar log1p = function (x) {\r\n\t\t\t\t\t\treturn Math.log (x + 1);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar log2 = function (x) {\r\n\t\t\t\t\t\treturn Math.log (x) / Math.LN2;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar log10 = function (x) {\r\n\t\t\t\t\t\treturn Math.log (x) / Math.LN10;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar pow = Math.pow;\r\n\t\t\t\t\tvar sqrt = Math.sqrt;\r\n\t\t\t\t\tvar sin = Math.sin;\r\n\t\t\t\t\tvar cos = Math.cos;\r\n\t\t\t\t\tvar tan = Math.tan;\r\n\t\t\t\t\tvar asin = Math.asin;\r\n\t\t\t\t\tvar acos = Math.acos;\r\n\t\t\t\t\tvar atan = Math.atan;\r\n\t\t\t\t\tvar atan2 = Math.atan2;\r\n\t\t\t\t\tvar hypot = Math.hypot;\r\n\t\t\t\t\tvar degrees = function (x) {\r\n\t\t\t\t\t\treturn (x * 180) / Math.PI;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar radians = function (x) {\r\n\t\t\t\t\t\treturn (x * Math.PI) / 180;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar sinh = Math.sinh;\r\n\t\t\t\t\tvar cosh = Math.cosh;\r\n\t\t\t\t\tvar tanh = Math.tanh;\r\n\t\t\t\t\tvar asinh = Math.asinh;\r\n\t\t\t\t\tvar acosh = Math.acosh;\r\n\t\t\t\t\tvar atanh = Math.atanh;\r\n\t\t\t\t\tvar floor = Math.floor;\r\n\t\t\t\t\tvar ceil = Math.ceil;\r\n\t\t\t\t\tvar trunc = Math.trunc;\r\n\t\t\t\t\tvar isnan = isNaN;\r\n\t\t\t\t\tvar inf = Infinity;\r\n\t\t\t\t\tvar nan = NaN;\r\n\t\t\t\t\t__pragma__ ('<all>')\r\n\t\t\t\t\t\t__all__.__name__ = __name__;\r\n\t\t\t\t\t\t__all__.acos = acos;\r\n\t\t\t\t\t\t__all__.acosh = acosh;\r\n\t\t\t\t\t\t__all__.asin = asin;\r\n\t\t\t\t\t\t__all__.asinh = asinh;\r\n\t\t\t\t\t\t__all__.atan = atan;\r\n\t\t\t\t\t\t__all__.atan2 = atan2;\r\n\t\t\t\t\t\t__all__.atanh = atanh;\r\n\t\t\t\t\t\t__all__.ceil = ceil;\r\n\t\t\t\t\t\t__all__.cos = cos;\r\n\t\t\t\t\t\t__all__.cosh = cosh;\r\n\t\t\t\t\t\t__all__.degrees = degrees;\r\n\t\t\t\t\t\t__all__.e = e;\r\n\t\t\t\t\t\t__all__.exp = exp;\r\n\t\t\t\t\t\t__all__.expm1 = expm1;\r\n\t\t\t\t\t\t__all__.floor = floor;\r\n\t\t\t\t\t\t__all__.hypot = hypot;\r\n\t\t\t\t\t\t__all__.inf = inf;\r\n\t\t\t\t\t\t__all__.isnan = isnan;\r\n\t\t\t\t\t\t__all__.log = log;\r\n\t\t\t\t\t\t__all__.log10 = log10;\r\n\t\t\t\t\t\t__all__.log1p = log1p;\r\n\t\t\t\t\t\t__all__.log2 = log2;\r\n\t\t\t\t\t\t__all__.nan = nan;\r\n\t\t\t\t\t\t__all__.pi = pi;\r\n\t\t\t\t\t\t__all__.pow = pow;\r\n\t\t\t\t\t\t__all__.radians = radians;\r\n\t\t\t\t\t\t__all__.sin = sin;\r\n\t\t\t\t\t\t__all__.sinh = sinh;\r\n\t\t\t\t\t\t__all__.sqrt = sqrt;\r\n\t\t\t\t\t\t__all__.tan = tan;\r\n\t\t\t\t\t\t__all__.tanh = tanh;\r\n\t\t\t\t\t\t__all__.trunc = trunc;\r\n\t\t\t\t\t__pragma__ ('</all>')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\t__nest__ (\r\n\t\t__all__,\r\n\t\t'numscrypt', {\r\n\t\t\t__all__: {\r\n\t\t\t\t__inited__: false,\r\n\t\t\t\t__init__: function (__all__) {\r\n\t\t\t\t\tvar itertools = {};\r\n\t\t\t\t\tvar __name__ = 'numscrypt';\r\n\t\t\t\t\t__nest__ (itertools, '', __init__ (__world__.itertools));\r\n\t\t\t\t\tvar ns_ctors = dict ({'int32': Int32Array, 'float32': Float32Array, 'float64': Float64Array});\r\n\t\t\t\t\tvar ns_complex = function (dtype) {\r\n\t\t\t\t\t\treturn __in__ (dtype, tuple (['complex64', 'complex128']));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar ns_buffertype = function (dtype) {\r\n\t\t\t\t\t\treturn (dtype == 'complex64' ? 'float32' : (dtype == 'complex128' ? 'float64' : dtype));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar ns_complextype = function (dtype) {\r\n\t\t\t\t\t\treturn (dtype == 'float32' ? 'complex64' : (dtype == 'float64' ? 'complex128' : null));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar ns_createbuf = function (imag, dtype, size) {\r\n\t\t\t\t\t\treturn (!(imag) || ns_complex (dtype) ? new ns_ctors [ns_buffertype (dtype)] (size) : null);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar ndarray = __class__ ('ndarray', [object], {\r\n\t\t\t\t\t\t__module__: __name__,\r\n\t\t\t\t\t\tget __init__ () {return __get__ (this, function (self, shape, dtype, realbuf, imagbuf) {\r\n\t\t\t\t\t\t\tif (typeof realbuf == 'undefined' || (realbuf != null && realbuf .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\t\tvar realbuf = null;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\tif (typeof imagbuf == 'undefined' || (imagbuf != null && imagbuf .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\t\tvar imagbuf = null;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\tself.dtype = dtype;\r\n\t\t\t\t\t\t\tself.ns_complex = ns_complex (dtype);\r\n\t\t\t\t\t\t\tself.realbuf = realbuf;\r\n\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tself.imagbuf = imagbuf;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tself.setshape (shape);\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget setshape () {return __get__ (this, function (self, shape) {\r\n\t\t\t\t\t\t\tself.shape = shape;\r\n\t\t\t\t\t\t\tself.ndim = shape.length;\r\n\t\t\t\t\t\t\tself.ns_nrows = shape [0];\r\n\t\t\t\t\t\t\tif (self.ndim == 1) {\r\n\t\t\t\t\t\t\t\tself.size = self.ns_nrows;\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\tself.ns_ncols = shape [1];\r\n\t\t\t\t\t\t\t\tself.size = self.ns_nrows * self.ns_ncols;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget astype () {return __get__ (this, function (self, dtype) {\r\n\t\t\t\t\t\t\tvar result = empty (self.shape, dtype);\r\n\t\t\t\t\t\t\tresult.realbuf.set (self.realbuf);\r\n\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tresult.imagbuf.set (self.imagbuf);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget tolist () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tvar flat = (function () {\r\n\t\t\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\t\t\tvar __iterable0__ = zip (list (self.realbuf), list (self.imagbuf));\r\n\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\tvar __left0__ = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\tvar real = __left0__ [0];\r\n\t\t\t\t\t\t\t\t\t\tvar imag = __left0__ [1];\r\n\t\t\t\t\t\t\t\t\t\t__accu0__.append (complex (real, imag));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn __accu0__;\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\telse {\r\n\t\t\t\t\t\t\t\tvar flat = self.realbuf;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (self.ndim == 1) {\r\n\t\t\t\t\t\t\t\treturn list (flat);\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\treturn (function () {\r\n\t\t\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\t\t\tfor (var irow = 0; irow < self.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\t\t__accu0__.append ((function () {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __accu1__ = [];\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < self.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t__accu1__.append (flat [self.ns_ncols * irow + icol]);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\treturn __accu1__;\r\n\t\t\t\t\t\t\t\t\t\t}) ());\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn __accu0__;\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\tget __repr__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\treturn 'array({})'.format (repr (self.tolist ()));\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __str__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tif (self.ndim == 1) {\r\n\t\t\t\t\t\t\t\treturn str (self.tolist ());\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\treturn '[\\n\\t{}\\n]\\n'.format ('\\n\\t'.join ((function () {\r\n\t\t\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\t\t\tvar __iterable0__ = self.tolist ();\r\n\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\tvar row = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t__accu0__.append (str (row));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn __accu0__;\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\tget reshape () {return __get__ (this, function (self, shape) {\r\n\t\t\t\t\t\t\tif (self.ndim == 1) {\r\n\t\t\t\t\t\t\t\treturn tuple ([array (self, self.dtype)]);\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\tvar result = array (self, self.dtype);\r\n\t\t\t\t\t\t\t\tresult.setshape (self.ns_ncols, self.ns_nrows);\r\n\t\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget transpose () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tif (self.ndim == 1) {\r\n\t\t\t\t\t\t\t\tvar result = array (self, dtype);\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\tvar result = empty (tuple ([self.ns_ncols, self.ns_nrows]), self.dtype);\r\n\t\t\t\t\t\t\t\tvar itarget = 0;\r\n\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < self.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tvar isource = icol;\r\n\t\t\t\t\t\t\t\t\t\tfor (var irow = 0; irow < self.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar isource = self.ns_ncols * irow + icol;\r\n\t\t\t\t\t\t\t\t\t\t\tresult.imagbuf [itarget] = self.imagbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget++] = self.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\tisource += self.ns_ncols;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < self.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tvar isource = icol;\r\n\t\t\t\t\t\t\t\t\t\tfor (var irow = 0; irow < self.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget++] = self.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\tisource += self.ns_ncols;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __getitem__ () {return __get__ (this, function (self, key) {\r\n\t\t\t\t\t\t\tif (self.ndim == 1) {\r\n\t\t\t\t\t\t\t\tif (py_typeof (key) == tuple) {\r\n\t\t\t\t\t\t\t\t\tif (key [1] == null) {\r\n\t\t\t\t\t\t\t\t\t\tkey [1] = self.size;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (key [1] < 0) {\r\n\t\t\t\t\t\t\t\t\t\tkey [1] += self.size;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvar result = empty (list ([(key [1] - key [0]) / key [2]]), self.dtype);\r\n\t\t\t\t\t\t\t\t\tvar itarget = 0;\r\n\t\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, self.shape);\r\n\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar isource = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget] = self.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\tresult.imagbuf [itarget++] = self.imagbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, self.shape);\r\n\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar isource = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget++] = self.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\treturn complex (self.realbuf [key], self.imagbuf [key]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\treturn self.realbuf [key];\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\telse {\r\n\t\t\t\t\t\t\t\tvar rowkey = key [0];\r\n\t\t\t\t\t\t\t\tvar colkey = key [1];\r\n\t\t\t\t\t\t\t\tvar rowistup = py_typeof (rowkey) == tuple;\r\n\t\t\t\t\t\t\t\tvar colistup = py_typeof (colkey) == tuple;\r\n\t\t\t\t\t\t\t\tif (rowistup) {\r\n\t\t\t\t\t\t\t\t\tif (rowkey [1] == null) {\r\n\t\t\t\t\t\t\t\t\t\trowkey [1] = self.ns_nrows;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (rowkey [1] < 0) {\r\n\t\t\t\t\t\t\t\t\t\trowkey [1] += self.ns_nrows;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (colistup) {\r\n\t\t\t\t\t\t\t\t\tif (colkey [1] == null) {\r\n\t\t\t\t\t\t\t\t\t\tcolkey [1] = self.ns_ncols;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (colkey [1] < 0) {\r\n\t\t\t\t\t\t\t\t\t\tcolkey [1] += self.ns_ncols;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (rowistup || colistup) {\r\n\t\t\t\t\t\t\t\t\tif (!(rowistup)) {\r\n\t\t\t\t\t\t\t\t\t\tvar result = empty (tuple ([(colkey [1] - colkey [0]) / colkey [2]]), self.dtype);\r\n\t\t\t\t\t\t\t\t\t\tvar itarget = 0;\r\n\t\t\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, colkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isourcecol = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isource = self.ns_ncols * rowkey + isourcecol;\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget] = self.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.imagbuf [itarget++] = self.imagbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, colkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isourcecol = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget++] = self.realbuf [self.ns_ncols * rowkey + isourcecol];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (!(colistup)) {\r\n\t\t\t\t\t\t\t\t\t\tvar result = empty (tuple ([(rowkey [1] - rowkey [0]) / rowkey [2]]), self.dtype);\r\n\t\t\t\t\t\t\t\t\t\tvar itarget = 0;\r\n\t\t\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, rowkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isourcerow = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isource = self.ns_ncols * isourcerow + colkey;\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget] = self.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.imagbuf [itarget++] = self.imagbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, rowkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isourcerow = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget++] = self.realbuf [self.ns_ncols * isourcerow + colkey];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tvar result = empty (tuple ([(key [0] [1] - key [0] [0]) / key [0] [2], (key [1] [1] - key [1] [0]) / key [1] [2]]), self.dtype);\r\n\t\t\t\t\t\t\t\t\t\tvar itarget = 0;\r\n\t\t\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, rowkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isourcerow = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar __iterable1__ = range.apply (null, colkey);\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var __index1__ = 0; __index1__ < len (__iterable1__); __index1__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar isourcecol = __iterable1__ [__index1__];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar isource = self.ns_ncols * isourcerow + isourcecol;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget] = self.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tresult.imagbuf [itarget++] = self.imagbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, rowkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isourcerow = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar __iterable1__ = range.apply (null, colkey);\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var __index1__ = 0; __index1__ < len (__iterable1__); __index1__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar isourcecol = __iterable1__ [__index1__];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget++] = self.realbuf [self.ns_ncols * isourcerow + isourcecol];\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\tvar isource = self.ns_ncols * key [0] + key [1];\r\n\t\t\t\t\t\t\t\t\treturn complex (self.realbuf [isource], self.imagbuf [isource]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\treturn self.realbuf [self.ns_ncols * key [0] + key [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\tget __setitem__ () {return __get__ (this, function (self, key, value) {\r\n\t\t\t\t\t\t\tif (self.ndim == 1) {\r\n\t\t\t\t\t\t\t\tif (py_typeof (key) == tuple) {\r\n\t\t\t\t\t\t\t\t\tif (key [1] == null) {\r\n\t\t\t\t\t\t\t\t\t\tkey [1] = self.size;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (key [1] < 0) {\r\n\t\t\t\t\t\t\t\t\t\tkey [1] += self.size;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvar isource = 0;\r\n\t\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, self.shape);\r\n\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar itarget = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\tself.realbuf [itarget] = value.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\tself.imagbuf [itarget] = value.imagbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, self.shape);\r\n\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar itarget = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\tself.realbuf [itarget] = value.realbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\tif (typeof value == 'number') {\r\n\t\t\t\t\t\t\t\t\t\tself.realbuf [key] = value;\r\n\t\t\t\t\t\t\t\t\t\tself.imagbuf [key] = 0;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tself.realbuf [key] = value.real;\r\n\t\t\t\t\t\t\t\t\t\tself.imagbuf [key] = value.imag;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tself.realbuf [key] = value;\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\telse {\r\n\t\t\t\t\t\t\t\tvar rowkey = key [0];\r\n\t\t\t\t\t\t\t\tvar colkey = key [1];\r\n\t\t\t\t\t\t\t\tvar rowistup = py_typeof (rowkey) == tuple;\r\n\t\t\t\t\t\t\t\tvar colistup = py_typeof (colkey) == tuple;\r\n\t\t\t\t\t\t\t\tif (rowistup) {\r\n\t\t\t\t\t\t\t\t\tif (rowkey [1] == null) {\r\n\t\t\t\t\t\t\t\t\t\trowkey [1] = self.ns_nrows;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (rowkey [1] < 0) {\r\n\t\t\t\t\t\t\t\t\t\trowkey [1] += self.ns_nrows;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (colistup) {\r\n\t\t\t\t\t\t\t\t\tif (colkey [1] == null) {\r\n\t\t\t\t\t\t\t\t\t\tcolkey [1] = self.ns_ncols;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (colkey [1] < 0) {\r\n\t\t\t\t\t\t\t\t\t\tcolkey [1] += self.ns_ncols;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (rowistup || colistup) {\r\n\t\t\t\t\t\t\t\t\tif (!(rowistup)) {\r\n\t\t\t\t\t\t\t\t\t\tvar isource = 0;\r\n\t\t\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, colkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar itargetcol = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar itarget = self.ns_ncols * rowkey + itargetcol;\r\n\t\t\t\t\t\t\t\t\t\t\t\tself.realbuf [itarget] = value.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t\tself.imagbuf [itarget] = value.imagbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, colkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar itargetcol = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [self.ns_ncols * rowkey + itargetcol] = self.realbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (!(colistup)) {\r\n\t\t\t\t\t\t\t\t\t\tvar isource = 0;\r\n\t\t\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, rowkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar itargetrow = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar itarget = self.ns_ncols * itargetrow + colkey;\r\n\t\t\t\t\t\t\t\t\t\t\t\tself.realbuf [itarget] = value.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t\tself.imagbuf [itarget] = value.imagbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, rowkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isourcerow = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tself.realbuf [self.ns_ncols * isourcerow + colkey] = value [isource++];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tvar isource = 0;\r\n\t\t\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, rowkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar itargetrow = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar __iterable1__ = range.apply (null, colkey);\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var __index1__ = 0; __index1__ < len (__iterable1__); __index1__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar itargetcol = __iterable1__ [__index1__];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar itarget = self.ns_ncols * itargetrow + itargetcol;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tself.realbuf [itarget] = value.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tself.imagbuf [itarget] = value.imagbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\tvar __iterable0__ = range.apply (null, rowkey);\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isourcerow = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar __iterable1__ = range.apply (null, colkey);\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var __index1__ = 0; __index1__ < len (__iterable1__); __index1__++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar isourcecol = __iterable1__ [__index1__];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tself.realbuf [self.ns_ncols * itargetrow + itargetcol] = value.realbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\tvar itarget = self.ns_ncols * key [0] + key [1];\r\n\t\t\t\t\t\t\t\t\tif (typeof value == 'number') {\r\n\t\t\t\t\t\t\t\t\t\tself.realbuf [itarget] = value;\r\n\t\t\t\t\t\t\t\t\t\tself.imagbuf [itarget] = 0;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tself.realbuf [itarget] = value.real;\r\n\t\t\t\t\t\t\t\t\t\tself.imagbuf [itarget] = value.imag;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tself.realbuf [self.ns_ncols * key [0] + key [1]] = value;\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\tget real () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\treturn ndarray (self.shape, ns_buffertype (self.dtype), self.realbuf);\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget imag () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\treturn ndarray (self.shape, ns_buffertype (self.dtype), self.imagbuf);\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __conj__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tvar result = empty (self.shape, self.dtype);\r\n\t\t\t\t\t\t\t\tresult.realbuf.set (self.realbuf);\r\n\t\t\t\t\t\t\t\tresult.imagbuf = ns_createbuf (true, self.dtype, self.size);\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = -(self.imagbuf [i]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn result;\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\treturn copy (self);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget conjugate () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\treturn self.__conj__ ();\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __neg__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tvar result = empty (self.shape, self.dtype);\r\n\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = -(self.realbuf [i]);\r\n\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = -(self.imagbuf [i]);\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\telse {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = -(self.realbuf [i]);\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\treturn result;\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __ns_inv__ () {return __get__ (this, function (self) {\r\n\t\t\t\t\t\t\tvar result = empty (self.shape, self.dtype);\r\n\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tvar real = self.realbuf [i];\r\n\t\t\t\t\t\t\t\t\tvar imag = self.imagbuf [i];\r\n\t\t\t\t\t\t\t\t\tvar denom = real * real + imag * imag;\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = real / denom;\r\n\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = -(imag) / denom;\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\telse {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = 1 / self.realbuf [i];\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\treturn result;\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __add__ () {return __get__ (this, function (self, other) {\r\n\t\t\t\t\t\t\tvar result = empty (self.shape, self.dtype);\r\n\t\t\t\t\t\t\tif (py_typeof (other) == ndarray) {\r\n\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] + other.realbuf [i];\r\n\t\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = self.imagbuf [i] + other.imagbuf [i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] + other.realbuf [i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] + other.real;\r\n\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = self.imagbuf [i] + other.imag;\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\telse {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] + other;\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\treturn result;\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __radd__ () {return __get__ (this, function (self, scalar) {\r\n\t\t\t\t\t\t\treturn self.__add__ (scalar);\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __sub__ () {return __get__ (this, function (self, other) {\r\n\t\t\t\t\t\t\tvar result = empty (self.shape, self.dtype);\r\n\t\t\t\t\t\t\tif (py_typeof (other) == ndarray) {\r\n\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] - other.realbuf [i];\r\n\t\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = self.imagbuf [i] - other.imagbuf [i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] - other.realbuf [i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] - other.real;\r\n\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = self.imagbuf [i] - other.imag;\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\telse {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] - other;\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\treturn result;\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __rsub__ () {return __get__ (this, function (self, scalar) {\r\n\t\t\t\t\t\t\treturn self.__neg__ ().__add__ (scalar);\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __mul__ () {return __get__ (this, function (self, other) {\r\n\t\t\t\t\t\t\tvar result = empty (self.shape, self.dtype);\r\n\t\t\t\t\t\t\tif (py_typeof (other) == ndarray) {\r\n\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] * other.realbuf [i] - self.imagbuf [i] * other.imagbuf [i];\r\n\t\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = self.realbuf [i] * other.imagbuf [i] + self.imagbuf [i] * other.realbuf [i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] * other.realbuf [i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] * other.real - self.imagbuf [i] * other.imag;\r\n\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = self.realbuf [i] * other.imag + self.imagbuf [i] * other.real;\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\telse {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] * other;\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\treturn result;\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __rmul__ () {return __get__ (this, function (self, scalar) {\r\n\t\t\t\t\t\t\treturn self.__mul__ (scalar);\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __div__ () {return __get__ (this, function (self, other) {\r\n\t\t\t\t\t\t\tvar result = empty (self.shape, self.dtype);\r\n\t\t\t\t\t\t\tif (py_typeof (other) == ndarray) {\r\n\t\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\tvar real = other.realbuf [i];\r\n\t\t\t\t\t\t\t\t\t\tvar imag = other.imagbuf [i];\r\n\t\t\t\t\t\t\t\t\t\tvar denom = real * real + imag * imag;\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = (self.realbuf [i] * real + self.imagbuf [i] * imag) / denom;\r\n\t\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = (self.imagbuf [i] * real - self.realbuf [i] * imag) / denom;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] / other.realbuf [i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tvar real = other.real;\r\n\t\t\t\t\t\t\t\tvar imag = other.imag;\r\n\t\t\t\t\t\t\t\tvar denom = real * real + imag * imag;\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = (self.realbuf [i] * real + self.imagbuf [i] * imag) / denom;\r\n\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = (self.imagbuf [i] * real - self.realbuf [i] * imag) / denom;\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\telse {\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < self.size; i++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [i] = self.realbuf [i] / other;\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\treturn result;\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __rdiv__ () {return __get__ (this, function (self, scalar) {\r\n\t\t\t\t\t\t\treturn self.__ns_inv__ ().__mul__ (scalar);\r\n\t\t\t\t\t\t});},\r\n\t\t\t\t\t\tget __matmul__ () {return __get__ (this, function (self, other) {\r\n\t\t\t\t\t\t\tvar result = empty (tuple ([self.ns_nrows, other.ns_ncols]), self.dtype);\r\n\t\t\t\t\t\t\tif (self.ns_complex) {\r\n\t\t\t\t\t\t\t\tvar iresult = 0;\r\n\t\t\t\t\t\t\t\tfor (var irow = 0; irow < self.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < other.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [iresult] = 0;\r\n\t\t\t\t\t\t\t\t\t\tresult.imagbuf [iresult] = 0;\r\n\t\t\t\t\t\t\t\t\t\tvar iself = self.ns_ncols * irow;\r\n\t\t\t\t\t\t\t\t\t\tvar iother = icol;\r\n\t\t\t\t\t\t\t\t\t\tfor (var iterm = 0; iterm < self.ns_ncols; iterm++) {\r\n\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [iresult] += self.realbuf [iself] * other.realbuf [iother] - self.imagbuf [iself] * other.imagbuf [iother];\r\n\t\t\t\t\t\t\t\t\t\t\tresult.imagbuf [iresult] += self.realbuf [iself] * other.imagbuf [iother] + self.imagbuf [iself++] * other.realbuf [iother];\r\n\t\t\t\t\t\t\t\t\t\t\tiother += other.ns_ncols;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tiresult++;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tvar iresult = 0;\r\n\t\t\t\t\t\t\t\tfor (var irow = 0; irow < self.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < other.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [iresult] = 0;\r\n\t\t\t\t\t\t\t\t\t\tvar iself = self.ns_ncols * irow;\r\n\t\t\t\t\t\t\t\t\t\tvar iother = icol;\r\n\t\t\t\t\t\t\t\t\t\tfor (var iterm = 0; iterm < self.ns_ncols; iterm++) {\r\n\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [iresult] += self.realbuf [iself++] * other.realbuf [iother];\r\n\t\t\t\t\t\t\t\t\t\t\tiother += other.ns_ncols;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tiresult++;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\t});}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar empty = function (shape, dtype) {\r\n\t\t\t\t\t\tif (typeof dtype == 'undefined' || (dtype != null && dtype .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar dtype = 'float64';\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tvar result = ndarray (shape, dtype);\r\n\t\t\t\t\t\tresult.realbuf = ns_createbuf (false, dtype, result.size);\r\n\t\t\t\t\t\tresult.imagbuf = ns_createbuf (true, dtype, result.size);\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar array = function (obj, dtype) {\r\n\t\t\t\t\t\tif (typeof dtype == 'undefined' || (dtype != null && dtype .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar dtype = 'float64';\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tif (Array.isArray (obj)) {\r\n\t\t\t\t\t\t\tif (len (obj)) {\r\n\t\t\t\t\t\t\t\tif (Array.isArray (obj [0])) {\r\n\t\t\t\t\t\t\t\t\tvar result = empty (tuple ([obj.length, obj [0].length]), dtype);\r\n\t\t\t\t\t\t\t\t\tvar iresult = 0;\r\n\t\t\t\t\t\t\t\t\tif (result.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var irow = 0; irow < result.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < result.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar element = complex (obj [irow] [icol]);\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [iresult] = element.real;\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.imagbuf [iresult++] = element.imag;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tfor (var irow = 0; irow < result.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < result.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [iresult++] = obj [irow] [icol];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tvar result = empty (tuple ([obj.length]), dtype);\r\n\t\t\t\t\t\t\t\t\tif (result.ns_complex) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < result.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar element = complex (obj [i]);\r\n\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = element.real;\r\n\t\t\t\t\t\t\t\t\t\t\tresult.imagbuf [i] = element.imag;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < result.size; i++) {\r\n\t\t\t\t\t\t\t\t\t\t\tresult.realbuf [i] = obj [i];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tvar result = empty (tuple ([0]), dtype);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar result = empty (obj.shape, obj.dtype);\r\n\t\t\t\t\t\t\tresult.realbuf.set (obj.realbuf);\r\n\t\t\t\t\t\t\tif (obj.ns_complex) {\r\n\t\t\t\t\t\t\t\tresult.imagbuf.set (obj.imagbuf);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar copy = function (obj) {\r\n\t\t\t\t\t\treturn array (obj, obj.dtype);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar hsplit = function (ary, nparts) {\r\n\t\t\t\t\t\tvar result = (function () {\r\n\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\tfor (var ipart = 0; ipart < nparts; ipart++) {\r\n\t\t\t\t\t\t\t\t__accu0__.append (empty (tuple ([ary.ns_nrows, ary.ns_ncols / nparts]), ary.dtype));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn __accu0__;\r\n\t\t\t\t\t\t}) ();\r\n\t\t\t\t\t\tvar isource = 0;\r\n\t\t\t\t\t\tif (ary.ns_complex) {\r\n\t\t\t\t\t\t\tfor (var irow = 0; irow < ary.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\tvar __iterable0__ = result;\r\n\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\tvar itarget = part.ns_ncols * irow;\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < part.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tpart.realbuf [itarget] = ary.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\tpart.imagbuf [itarget++] = ary.imagbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var irow = 0; irow < ary.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\tvar __iterable0__ = result;\r\n\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\tvar itarget = part.ns_ncols * irow;\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < part.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tpart.realbuf [itarget++] = ary.realbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar vsplit = function (ary, nparts) {\r\n\t\t\t\t\t\tvar result = (function () {\r\n\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\tfor (var ipart = 0; ipart < nparts; ipart++) {\r\n\t\t\t\t\t\t\t\t__accu0__.append (empty (tuple ([ary.ns_nrows / nparts, ary.ns_ncols]), array.dtype));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn __accu0__;\r\n\t\t\t\t\t\t}) ();\r\n\t\t\t\t\t\tvar isource = 0;\r\n\t\t\t\t\t\tif (ary.ns_complex) {\r\n\t\t\t\t\t\t\tvar __iterable0__ = result;\r\n\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\tfor (var itarget = 0; itarget < part.size; itarget++) {\r\n\t\t\t\t\t\t\t\t\tpart.realbuf [itarget] = ary.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\tpart.imagbuf [itarget] = ary.imagbuf [isource++];\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\telse {\r\n\t\t\t\t\t\t\tvar __iterable0__ = result;\r\n\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\tfor (var itarget = 0; itarget < part.size; itarget++) {\r\n\t\t\t\t\t\t\t\t\tpart.realbuf [itarget] = ary.realbuf [isource++];\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\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar hstack = function (tup) {\r\n\t\t\t\t\t\tvar ncols = 0;\r\n\t\t\t\t\t\tvar __iterable0__ = tup;\r\n\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\tncols += part.ns_ncols;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar result = empty (tuple ([tup [0].ns_nrows, ncols]), tup [0].dtype);\r\n\t\t\t\t\t\tvar itarget = 0;\r\n\t\t\t\t\t\tif (result.ns_complex) {\r\n\t\t\t\t\t\t\tfor (var irow = 0; irow < result.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\tvar __iterable0__ = tup;\r\n\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\tvar isource = part.ns_ncols * irow;\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < part.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget] = part.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\t\tresult.imagbuf [itarget++] = part.imagbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var irow = 0; irow < result.ns_nrows; irow++) {\r\n\t\t\t\t\t\t\t\tvar __iterable0__ = tup;\r\n\t\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\t\tvar isource = part.ns_ncols * irow;\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < part.ns_ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tresult.realbuf [itarget++] = part.realbuf [isource++];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar vstack = function (tup) {\r\n\t\t\t\t\t\tvar nrows = 0;\r\n\t\t\t\t\t\tvar __iterable0__ = tup;\r\n\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\tnrows += part.ns_nrows;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar result = empty (tuple ([nrows, tup [0].ns_ncols]), tup [0].dtype);\r\n\t\t\t\t\t\tvar itarget = 0;\r\n\t\t\t\t\t\tif (result.ns_complex) {\r\n\t\t\t\t\t\t\tvar __iterable0__ = tup;\r\n\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\tfor (var isource = 0; isource < part.size; isource++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [itarget] = part.realbuf [isource];\r\n\t\t\t\t\t\t\t\t\tresult.imagbuf [itarget++] = part.imagbuf [isource];\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\telse {\r\n\t\t\t\t\t\t\tvar __iterable0__ = tup;\r\n\t\t\t\t\t\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\t\t\t\t\t\tvar part = __iterable0__ [__index0__];\r\n\t\t\t\t\t\t\t\tfor (var isource = 0; isource < part.size; isource++) {\r\n\t\t\t\t\t\t\t\t\tresult.realbuf [itarget++] = part.realbuf [isource];\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\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar round = function (a, decimals) {\r\n\t\t\t\t\t\tif (typeof decimals == 'undefined' || (decimals != null && decimals .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar decimals = 0;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tvar result = empty (a.shape, a.dtype);\r\n\t\t\t\t\t\tif (a.ns_complex) {\r\n\t\t\t\t\t\t\tfor (var i = 0; i < a.size; i++) {\r\n\t\t\t\t\t\t\t\tresult.realbuf [i] = a.realbuf [i].toFixed (decimals);\r\n\t\t\t\t\t\t\t\tresult.imagbuf [i] = a.imagbuf [i].toFixed (decimals);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i = 0; i < a.size; i++) {\r\n\t\t\t\t\t\t\t\tresult.realbuf [i] = a.realbuf [i].toFixed (decimals);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar zeros = function (shape, dtype) {\r\n\t\t\t\t\t\tif (typeof dtype == 'undefined' || (dtype != null && dtype .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar dtype = 'float64';\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tvar result = empty (shape, dtype);\r\n\t\t\t\t\t\tif (result.ns_complex) {\r\n\t\t\t\t\t\t\tfor (var i = 0; i < result.size; i++) {\r\n\t\t\t\t\t\t\t\tresult.realbuf [i] = 0;\r\n\t\t\t\t\t\t\t\tresult.imagbuf [i] = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i = 0; i < result.size; i++) {\r\n\t\t\t\t\t\t\t\tresult.realbuf [i] = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar ones = function (shape, dtype) {\r\n\t\t\t\t\t\tif (typeof dtype == 'undefined' || (dtype != null && dtype .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar dtype = 'float64';\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tvar result = empty (shape, dtype);\r\n\t\t\t\t\t\tif (result.ns_complex) {\r\n\t\t\t\t\t\t\tfor (var i = 0; i < result.size; i++) {\r\n\t\t\t\t\t\t\t\tresult.realbuf [i] = 1;\r\n\t\t\t\t\t\t\t\tresult.imagbuf [i] = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i = 0; i < result.size; i++) {\r\n\t\t\t\t\t\t\t\tresult.realbuf [i] = 1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar identity = function (n, dtype) {\r\n\t\t\t\t\t\tif (typeof dtype == 'undefined' || (dtype != null && dtype .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar dtype = 'float64';\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tvar result = zeros (tuple ([n, n]), dtype);\r\n\t\t\t\t\t\tvar i = 0;\r\n\t\t\t\t\t\tvar shift = n + 1;\r\n\t\t\t\t\t\tfor (var j = 0; j < n; j++) {\r\n\t\t\t\t\t\t\tresult.realbuf [i] = 1;\r\n\t\t\t\t\t\t\ti += shift;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar conjugate = function (x) {\r\n\t\t\t\t\t\treturn x.__conj__ ();\r\n\t\t\t\t\t};\r\n\t\t\t\t\t__pragma__ ('<use>' +\r\n\t\t\t\t\t\t'itertools' +\r\n\t\t\t\t\t'</use>')\r\n\t\t\t\t\t__pragma__ ('<all>')\r\n\t\t\t\t\t\t__all__.__name__ = __name__;\r\n\t\t\t\t\t\t__all__.array = array;\r\n\t\t\t\t\t\t__all__.conjugate = conjugate;\r\n\t\t\t\t\t\t__all__.copy = copy;\r\n\t\t\t\t\t\t__all__.empty = empty;\r\n\t\t\t\t\t\t__all__.hsplit = hsplit;\r\n\t\t\t\t\t\t__all__.hstack = hstack;\r\n\t\t\t\t\t\t__all__.identity = identity;\r\n\t\t\t\t\t\t__all__.ndarray = ndarray;\r\n\t\t\t\t\t\t__all__.ns_buffertype = ns_buffertype;\r\n\t\t\t\t\t\t__all__.ns_complex = ns_complex;\r\n\t\t\t\t\t\t__all__.ns_complextype = ns_complextype;\r\n\t\t\t\t\t\t__all__.ns_createbuf = ns_createbuf;\r\n\t\t\t\t\t\t__all__.ns_ctors = ns_ctors;\r\n\t\t\t\t\t\t__all__.ones = ones;\r\n\t\t\t\t\t\t__all__.round = round;\r\n\t\t\t\t\t\t__all__.vsplit = vsplit;\r\n\t\t\t\t\t\t__all__.vstack = vstack;\r\n\t\t\t\t\t\t__all__.zeros = zeros;\r\n\t\t\t\t\t__pragma__ ('</all>')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\t__nest__ (\r\n\t\t__all__,\r\n\t\t'numscrypt.linalg', {\r\n\t\t\t__all__: {\r\n\t\t\t\t__inited__: false,\r\n\t\t\t\t__init__: function (__all__) {\r\n\t\t\t\t\tvar __name__ = 'numscrypt.linalg';\r\n\t\t\t\t\tvar ns = __init__ (__world__.numscrypt);\r\n\t\t\t\t\tvar eigen = __init__ (__world__.numscrypt.linalg.eigen_mpmath);\r\n\t\t\t\t\tvar inv = function (a) {\r\n\t\t\t\t\t\tif (a.ns_complex) {\r\n\t\t\t\t\t\t\treturn cinv (a);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\treturn rinv (a);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar rinv = function (a) {\r\n\t\t\t\t\t\tvar b = ns.hstack (tuple ([a, ns.identity (a.shape [0], a.dtype)]));\r\n\t\t\t\t\t\tvar real = b.realbuf;\r\n\t\t\t\t\t\tvar __left0__ = b.shape;\r\n\t\t\t\t\t\tvar nrows = __left0__ [0];\r\n\t\t\t\t\t\tvar ncols = __left0__ [1];\r\n\t\t\t\t\t\tfor (var ipiv = 0; ipiv < nrows; ipiv++) {\r\n\t\t\t\t\t\t\tif (!(real [ipiv * ncols + ipiv])) {\r\n\t\t\t\t\t\t\t\tfor (var irow = ipiv + 1; irow < nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\tif (real [irow * ncols + ipiv]) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar temp = real [irow * ncols + icol];\r\n\t\t\t\t\t\t\t\t\t\t\treal [irow * ncols + icol] = b [ipiv * ncols + icol];\r\n\t\t\t\t\t\t\t\t\t\t\treal [ipiv * ncols + icol] = temp;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar piv = real [ipiv * ncols + ipiv];\r\n\t\t\t\t\t\t\tfor (var icol = ipiv; icol < ncols; icol++) {\r\n\t\t\t\t\t\t\t\treal [ipiv * ncols + icol] /= piv;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tfor (var irow = 0; irow < nrows; irow++) {\r\n\t\t\t\t\t\t\t\tif (irow != ipiv) {\r\n\t\t\t\t\t\t\t\t\tvar factor = real [irow * ncols + ipiv];\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\treal [irow * ncols + icol] -= factor * real [ipiv * ncols + icol];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn ns.hsplit (b, 2) [1];\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar cinv = function (a) {\r\n\t\t\t\t\t\tvar b = ns.hstack (tuple ([a, ns.identity (a.shape [0], a.dtype)]));\r\n\t\t\t\t\t\tvar real = b.realbuf;\r\n\t\t\t\t\t\tvar imag = b.imagbuf;\r\n\t\t\t\t\t\tvar __left0__ = b.shape;\r\n\t\t\t\t\t\tvar nrows = __left0__ [0];\r\n\t\t\t\t\t\tvar ncols = __left0__ [1];\r\n\t\t\t\t\t\tfor (var ipiv = 0; ipiv < nrows; ipiv++) {\r\n\t\t\t\t\t\t\tvar ipiv_flat = ipiv * ncols + ipiv;\r\n\t\t\t\t\t\t\tif (!(real [ipiv_flat] || imag [ipiv_flat])) {\r\n\t\t\t\t\t\t\t\tfor (var irow = ipiv + 1; irow < nrows; irow++) {\r\n\t\t\t\t\t\t\t\t\tvar iswap = irow * ncols + ipiv;\r\n\t\t\t\t\t\t\t\t\tif (real [iswap] || imag [iswap]) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar isource = irow * ncols + icol;\r\n\t\t\t\t\t\t\t\t\t\t\tvar itarget = ipiv * ncols + icol;\r\n\t\t\t\t\t\t\t\t\t\t\tvar temp = real [isource];\r\n\t\t\t\t\t\t\t\t\t\t\treal [isource] = real [itarget];\r\n\t\t\t\t\t\t\t\t\t\t\treal [itarget] = temp;\r\n\t\t\t\t\t\t\t\t\t\t\tvar temp = imag [isource_flat];\r\n\t\t\t\t\t\t\t\t\t\t\timag [isource] = imag [itarget];\r\n\t\t\t\t\t\t\t\t\t\t\timag [itarget] = temp;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar pivre = real [ipiv_flat];\r\n\t\t\t\t\t\t\tvar pivim = imag [ipiv_flat];\r\n\t\t\t\t\t\t\tvar denom = pivre * pivre + pivim * pivim;\r\n\t\t\t\t\t\t\tfor (var icol = ipiv; icol < ncols; icol++) {\r\n\t\t\t\t\t\t\t\tvar icur = ipiv * ncols + icol;\r\n\t\t\t\t\t\t\t\tvar oldre = real [icur];\r\n\t\t\t\t\t\t\t\tvar oldim = imag [icur];\r\n\t\t\t\t\t\t\t\treal [icur] = (oldre * pivre + oldim * pivim) / denom;\r\n\t\t\t\t\t\t\t\timag [icur] = (oldim * pivre - oldre * pivim) / denom;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tfor (var irow = 0; irow < nrows; irow++) {\r\n\t\t\t\t\t\t\t\tif (irow != ipiv) {\r\n\t\t\t\t\t\t\t\t\tvar ifac = irow * ncols + ipiv;\r\n\t\t\t\t\t\t\t\t\tvar facre = real [ifac];\r\n\t\t\t\t\t\t\t\t\tvar facim = imag [ifac];\r\n\t\t\t\t\t\t\t\t\tfor (var icol = 0; icol < ncols; icol++) {\r\n\t\t\t\t\t\t\t\t\t\tvar itarget = irow * ncols + icol;\r\n\t\t\t\t\t\t\t\t\t\tvar isource = ipiv * ncols + icol;\r\n\t\t\t\t\t\t\t\t\t\tvar oldre = real [isource];\r\n\t\t\t\t\t\t\t\t\t\tvar oldim = imag [isource];\r\n\t\t\t\t\t\t\t\t\t\treal [itarget] -= facre * oldre - facim * oldim;\r\n\t\t\t\t\t\t\t\t\t\timag [itarget] -= facre * oldim + facim * oldre;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn ns.hsplit (b, 2) [1];\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar norm = function (a) {\r\n\t\t\t\t\t\tvar result = 0;\r\n\t\t\t\t\t\tif (a.ns_complex) {\r\n\t\t\t\t\t\t\tfor (var i = 0; i < a.size; i++) {\r\n\t\t\t\t\t\t\t\tresult += a.realbuf [i] * a.realbuf [i] + a.imagbuf [i] * a.imagbuf [i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i = 0; i < a.size; i++) {\r\n\t\t\t\t\t\t\t\tresult += a.realbuf [i] * a.realbuf [i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn Math.sqrt (result);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar eig = function (a) {\r\n\t\t\t\t\t\tvar __left0__ = eigen.eig (a);\r\n\t\t\t\t\t\tvar evals = __left0__ [0];\r\n\t\t\t\t\t\tvar evecs = __left0__ [1];\r\n\t\t\t\t\t\tvar __left0__ = evecs.shape;\r\n\t\t\t\t\t\tvar nrows = __left0__ [0];\r\n\t\t\t\t\t\tvar ncols = __left0__ [1];\r\n\t\t\t\t\t\tvar real = evecs.realbuf;\r\n\t\t\t\t\t\tvar imag = evecs.imagbuf;\r\n\t\t\t\t\t\tfor (var icol = 0; icol < ncols; icol++) {\r\n\t\t\t\t\t\t\tvar sum = 0;\r\n\t\t\t\t\t\t\tfor (var irow = 0; irow < nrows; irow++) {\r\n\t\t\t\t\t\t\t\tvar iterm = irow * ncols + icol;\r\n\t\t\t\t\t\t\t\tsum += real [iterm] * real [iterm] + imag [iterm] * imag [iterm];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar norm = Math.sqrt (sum);\r\n\t\t\t\t\t\t\tfor (var irow = 0; irow < nrows; irow++) {\r\n\t\t\t\t\t\t\t\tvar iterm = irow * ncols + icol;\r\n\t\t\t\t\t\t\t\treal [iterm] /= norm;\r\n\t\t\t\t\t\t\t\timag [iterm] /= norm;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn tuple ([ns.array (evals, 'complex64'), evecs]);\r\n\t\t\t\t\t};\r\n\t\t\t\t\t__pragma__ ('<use>' +\r\n\t\t\t\t\t\t'numscrypt' +\r\n\t\t\t\t\t\t'numscrypt.linalg.eigen_mpmath' +\r\n\t\t\t\t\t'</use>')\r\n\t\t\t\t\t__pragma__ ('<all>')\r\n\t\t\t\t\t\t__all__.__name__ = __name__;\r\n\t\t\t\t\t\t__all__.cinv = cinv;\r\n\t\t\t\t\t\t__all__.eig = eig;\r\n\t\t\t\t\t\t__all__.inv = inv;\r\n\t\t\t\t\t\t__all__.norm = norm;\r\n\t\t\t\t\t\t__all__.rinv = rinv;\r\n\t\t\t\t\t__pragma__ ('</all>')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\t__nest__ (\r\n\t\t__all__,\r\n\t\t'numscrypt.linalg.eigen_mpmath', {\r\n\t\t\t__all__: {\r\n\t\t\t\t__inited__: false,\r\n\t\t\t\t__init__: function (__all__) {\r\n\t\t\t\t\tvar cmath = {};\r\n\t\t\t\t\tvar __name__ = 'numscrypt.linalg.eigen_mpmath';\r\n\t\t\t\t\tvar __name__ = __init__ (__world__.math).__name__;\r\n\t\t\t\t\tvar acos = __init__ (__world__.math).acos;\r\n\t\t\t\t\tvar acosh = __init__ (__world__.math).acosh;\r\n\t\t\t\t\tvar asin = __init__ (__world__.math).asin;\r\n\t\t\t\t\tvar asinh = __init__ (__world__.math).asinh;\r\n\t\t\t\t\tvar atan = __init__ (__world__.math).atan;\r\n\t\t\t\t\tvar atan2 = __init__ (__world__.math).atan2;\r\n\t\t\t\t\tvar atanh = __init__ (__world__.math).atanh;\r\n\t\t\t\t\tvar ceil = __init__ (__world__.math).ceil;\r\n\t\t\t\t\tvar cos = __init__ (__world__.math).cos;\r\n\t\t\t\t\tvar cosh = __init__ (__world__.math).cosh;\r\n\t\t\t\t\tvar degrees = __init__ (__world__.math).degrees;\r\n\t\t\t\t\tvar e = __init__ (__world__.math).e;\r\n\t\t\t\t\tvar exp = __init__ (__world__.math).exp;\r\n\t\t\t\t\tvar expm1 = __init__ (__world__.math).expm1;\r\n\t\t\t\t\tvar floor = __init__ (__world__.math).floor;\r\n\t\t\t\t\tvar hypot = __init__ (__world__.math).hypot;\r\n\t\t\t\t\tvar inf = __init__ (__world__.math).inf;\r\n\t\t\t\t\tvar isnan = __init__ (__world__.math).isnan;\r\n\t\t\t\t\tvar log = __init__ (__world__.math).log;\r\n\t\t\t\t\tvar log10 = __init__ (__world__.math).log10;\r\n\t\t\t\t\tvar log1p = __init__ (__world__.math).log1p;\r\n\t\t\t\t\tvar log2 = __init__ (__world__.math).log2;\r\n\t\t\t\t\tvar nan = __init__ (__world__.math).nan;\r\n\t\t\t\t\tvar pi = __init__ (__world__.math).pi;\r\n\t\t\t\t\tvar pow = __init__ (__world__.math).pow;\r\n\t\t\t\t\tvar radians = __init__ (__world__.math).radians;\r\n\t\t\t\t\tvar sin = __init__ (__world__.math).sin;\r\n\t\t\t\t\tvar sinh = __init__ (__world__.math).sinh;\r\n\t\t\t\t\tvar sqrt = __init__ (__world__.math).sqrt;\r\n\t\t\t\t\tvar tan = __init__ (__world__.math).tan;\r\n\t\t\t\t\tvar tanh = __init__ (__world__.math).tanh;\r\n\t\t\t\t\tvar trunc = __init__ (__world__.math).trunc;\r\n\t\t\t\t\t__nest__ (cmath, '', __init__ (__world__.cmath));\r\n\t\t\t\t\tvar __name__ = __init__ (__world__.numscrypt).__name__;\r\n\t\t\t\t\tvar array = __init__ (__world__.numscrypt).array;\r\n\t\t\t\t\tvar conjugate = __init__ (__world__.numscrypt).conjugate;\r\n\t\t\t\t\tvar copy = __init__ (__world__.numscrypt).copy;\r\n\t\t\t\t\tvar empty = __init__ (__world__.numscrypt).empty;\r\n\t\t\t\t\tvar hsplit = __init__ (__world__.numscrypt).hsplit;\r\n\t\t\t\t\tvar hstack = __init__ (__world__.numscrypt).hstack;\r\n\t\t\t\t\tvar identity = __init__ (__world__.numscrypt).identity;\r\n\t\t\t\t\tvar ndarray = __init__ (__world__.numscrypt).ndarray;\r\n\t\t\t\t\tvar ns_buffertype = __init__ (__world__.numscrypt).ns_buffertype;\r\n\t\t\t\t\tvar ns_complex = __init__ (__world__.numscrypt).ns_complex;\r\n\t\t\t\t\tvar ns_complextype = __init__ (__world__.numscrypt).ns_complextype;\r\n\t\t\t\t\tvar ns_createbuf = __init__ (__world__.numscrypt).ns_createbuf;\r\n\t\t\t\t\tvar ns_ctors = __init__ (__world__.numscrypt).ns_ctors;\r\n\t\t\t\t\tvar ones = __init__ (__world__.numscrypt).ones;\r\n\t\t\t\t\tvar round = __init__ (__world__.numscrypt).round;\r\n\t\t\t\t\tvar vsplit = __init__ (__world__.numscrypt).vsplit;\r\n\t\t\t\t\tvar vstack = __init__ (__world__.numscrypt).vstack;\r\n\t\t\t\t\tvar zeros = __init__ (__world__.numscrypt).zeros;\r\n\t\t\t\t\tvar isinf = function (x) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar hypot = function (x, y) {\r\n\t\t\t\t\t\treturn __call__ (sqrt, null, __add__ (__mul__ (x, x), __mul__ (y, y)));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar ctx_eps = 1e-15;\r\n\t\t\t\t\tvar ctx_dps = 15;\r\n\t\t\t\t\tvar ctx_one = 1;\r\n\t\t\t\t\tvar ctx_prec = 53;\r\n\t\t\t\t\tvar ctx_ldexp = function (x, n) {\r\n\t\t\t\t\t\treturn __mul__ (x, __pow__ (2, n));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar hessenberg_reduce_0 = function (A, T) {\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tif (__le__ (n, 2)) {\r\n\t\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (var i = __sub__ (n, 1); i > 1; i--) {\r\n\t\t\t\t\t\t\tvar scale = 0;\r\n\t\t\t\t\t\t\tfor (var k = 0; k < i; k++) {\r\n\t\t\t\t\t\t\t\tvar scale = __call__ (__iadd__, null, scale, __add__ (__call__ (abs, null, A.__getitem__ ([i, k]).real), __call__ (abs, null, A.__getitem__ ([i, k]).imag)));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar scale_inv = 0;\r\n\t\t\t\t\t\t\tif (__ne__ (scale, 0)) {\r\n\t\t\t\t\t\t\t\tvar scale_inv = __truediv__ (1, scale);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (__eq__ (scale, 0) || __call__ (isinf, null, scale_inv)) {\r\n\t\t\t\t\t\t\t\t__setitem__ (T, i, 0);\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([i, __sub__ (i, 1)], 0);\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar H = 0;\r\n\t\t\t\t\t\t\tfor (var k = 0; k < i; k++) {\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([i, k], __call__ (__imul__, null, A.__getitem__ ([i, k]), scale_inv));\r\n\t\t\t\t\t\t\t\tvar rr = A.__getitem__ ([i, k]).real;\r\n\t\t\t\t\t\t\t\tvar ii = A.__getitem__ ([i, k]).imag;\r\n\t\t\t\t\t\t\t\tvar H = __call__ (__iadd__, null, H, __add__ (__mul__ (rr, rr), __mul__ (ii, ii)));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar F = A.__getitem__ ([i, __sub__ (i, 1)]);\r\n\t\t\t\t\t\t\tvar f = __call__ (abs, null, F);\r\n\t\t\t\t\t\t\tvar G = __call__ (cmath.sqrt, cmath, H);\r\n\t\t\t\t\t\t\tA.__setitem__ ([i, __sub__ (i, 1)], __mul__ (__neg__ (G), scale));\r\n\t\t\t\t\t\t\tif (__eq__ (f, 0)) {\r\n\t\t\t\t\t\t\t\t__setitem__ (T, i, G);\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\tvar ff = __truediv__ (F, f);\r\n\t\t\t\t\t\t\t\t__setitem__ (T, i, __add__ (F, __mul__ (G, ff)));\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([i, __sub__ (i, 1)], __call__ (__imul__, null, A.__getitem__ ([i, __sub__ (i, 1)]), ff));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar H = __call__ (__iadd__, null, H, __mul__ (G, f));\r\n\t\t\t\t\t\t\tvar H = __truediv__ (1, __call__ (cmath.sqrt, cmath, H));\r\n\t\t\t\t\t\t\t__setitem__ (T, i, __call__ (__imul__, null, __getitem__ (T, i), H));\r\n\t\t\t\t\t\t\tfor (var k = 0; k < __sub__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([i, k], __call__ (__imul__, null, A.__getitem__ ([i, k]), H));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tfor (var j = 0; j < i; j++) {\r\n\t\t\t\t\t\t\t\tvar G = __mul__ (__call__ (__conj__, null, __getitem__ (T, i)), A.__getitem__ ([j, __sub__ (i, 1)]));\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < __sub__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\tvar G = __call__ (__iadd__, null, G, __mul__ (__call__ (__conj__, null, A.__getitem__ ([i, k])), A.__getitem__ ([j, k])));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([j, __sub__ (i, 1)], __call__ (__isub__, null, A.__getitem__ ([j, __sub__ (i, 1)]), __mul__ (G, __getitem__ (T, i))));\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < __sub__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\tA.__setitem__ ([j, k], __call__ (__isub__, null, A.__getitem__ ([j, k]), __mul__ (G, A.__getitem__ ([i, k]))));\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\tfor (var j = 0; j < n; j++) {\r\n\t\t\t\t\t\t\t\tvar G = __mul__ (__getitem__ (T, i), A.__getitem__ ([__sub__ (i, 1), j]));\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < __sub__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\tvar G = __call__ (__iadd__, null, G, __mul__ (A.__getitem__ ([i, k]), A.__getitem__ ([k, j])));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([__sub__ (i, 1), j], __call__ (__isub__, null, A.__getitem__ ([__sub__ (i, 1), j]), __mul__ (G, __call__ (__conj__, null, __getitem__ (T, i)))));\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < __sub__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\tA.__setitem__ ([k, j], __call__ (__isub__, null, A.__getitem__ ([k, j]), __mul__ (G, __call__ (__conj__, null, A.__getitem__ ([i, k])))));\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\tvar hessenberg_reduce_1 = function (A, T) {\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tif (__eq__ (n, 1)) {\r\n\t\t\t\t\t\t\tA.__setitem__ ([0, 0], 1);\r\n\t\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar __left0__ = 1;\r\n\t\t\t\t\t\tA.__setitem__ ([0, 0], __left0__);\r\n\t\t\t\t\t\tA.__setitem__ ([1, 1], __left0__);\r\n\t\t\t\t\t\tvar __left0__ = 0;\r\n\t\t\t\t\t\tA.__setitem__ ([0, 1], __left0__);\r\n\t\t\t\t\t\tA.__setitem__ ([1, 0], __left0__);\r\n\t\t\t\t\t\tfor (var i = 2; i < n; i++) {\r\n\t\t\t\t\t\t\tif (__ne__ (__getitem__ (T, i), 0)) {\r\n\t\t\t\t\t\t\t\tfor (var j = 0; j < i; j++) {\r\n\t\t\t\t\t\t\t\t\tvar G = __mul__ (__getitem__ (T, i), A.__getitem__ ([__sub__ (i, 1), j]));\r\n\t\t\t\t\t\t\t\t\tfor (var k = 0; k < __sub__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\t\tvar G = __call__ (__iadd__, null, G, __mul__ (A.__getitem__ ([i, k]), A.__getitem__ ([k, j])));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tA.__setitem__ ([__sub__ (i, 1), j], __call__ (__isub__, null, A.__getitem__ ([__sub__ (i, 1), j]), __mul__ (G, __call__ (__conj__, null, __getitem__ (T, i)))));\r\n\t\t\t\t\t\t\t\t\tfor (var k = 0; k < __sub__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\t\tA.__setitem__ ([k, j], __call__ (__isub__, null, A.__getitem__ ([k, j]), __mul__ (G, __call__ (__conj__, null, A.__getitem__ ([i, k])))));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tA.__setitem__ ([i, i], 1);\r\n\t\t\t\t\t\t\tfor (var j = 0; j < i; j++) {\r\n\t\t\t\t\t\t\t\tvar __left0__ = 0;\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([j, i], __left0__);\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([i, j], __left0__);\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\tvar hessenberg = function (A, overwrite_a) {\r\n\t\t\t\t\t\tif (typeof overwrite_a == 'undefined' || (overwrite_a != null && overwrite_a .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar overwrite_a = false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tif (__eq__ (n, 1)) {\r\n\t\t\t\t\t\t\treturn tuple ([__call__ (array, null, list ([list ([1])]), A.dtype), A]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!(overwrite_a)) {\r\n\t\t\t\t\t\t\tvar A = __call__ (copy, null, A);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar T = __call__ (empty, null, tuple ([n]), A.dtype);\r\n\t\t\t\t\t\t__call__ (hessenberg_reduce_0, null, A, T);\r\n\t\t\t\t\t\tvar Q = __call__ (copy, null, A.copy);\r\n\t\t\t\t\t\t__call__ (hessenberg_reduce_1, null, Q, T);\r\n\t\t\t\t\t\tfor (var x = 0; x < n; x++) {\r\n\t\t\t\t\t\t\tfor (var y = __add__ (x, 2); y < n; y++) {\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([y, x], 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn tuple ([Q, A]);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar qr_step = function (n0, n1, A, Q, shift) {\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tvar c = __sub__ (A.__getitem__ ([n0, n0]), shift);\r\n\t\t\t\t\t\tvar s = A.__getitem__ ([__add__ (n0, 1), n0]);\r\n\t\t\t\t\t\tvar v = __call__ (hypot, null, __call__ (hypot, null, c.real, c.imag), __call__ (hypot, null, s.real, s.imag));\r\n\t\t\t\t\t\tif (__eq__ (v, 0)) {\r\n\t\t\t\t\t\t\tvar v = 1;\r\n\t\t\t\t\t\t\tvar c = 1;\r\n\t\t\t\t\t\t\tvar s = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar c = __call__ (__idiv__, null, c, v);\r\n\t\t\t\t\t\t\tvar s = __call__ (__idiv__, null, s, v);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (var k = n0; k < n; k++) {\r\n\t\t\t\t\t\t\tvar x = A.__getitem__ ([n0, k]);\r\n\t\t\t\t\t\t\tvar y = A.__getitem__ ([__add__ (n0, 1), k]);\r\n\t\t\t\t\t\t\tA.__setitem__ ([n0, k], __add__ (__mul__ (__call__ (__conj__, null, c), x), __mul__ (__call__ (__conj__, null, s), y)));\r\n\t\t\t\t\t\t\tA.__setitem__ ([__add__ (n0, 1), k], __add__ (__mul__ (__neg__ (s), x), __mul__ (c, y)));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (var k = 0; k < __call__ (min, null, n1, __add__ (n0, 3)); k++) {\r\n\t\t\t\t\t\t\tvar x = A.__getitem__ ([k, n0]);\r\n\t\t\t\t\t\t\tvar y = A.__getitem__ ([k, __add__ (n0, 1)]);\r\n\t\t\t\t\t\t\tA.__setitem__ ([k, n0], __add__ (__mul__ (c, x), __mul__ (s, y)));\r\n\t\t\t\t\t\t\tA.__setitem__ ([k, __add__ (n0, 1)], __add__ (__mul__ (__neg__ (__call__ (__conj__, null, s)), x), __mul__ (__call__ (__conj__, null, c), y)));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!(__call__ (isinstance, null, Q, bool))) {\r\n\t\t\t\t\t\t\tfor (var k = 0; k < n; k++) {\r\n\t\t\t\t\t\t\t\tvar x = Q.__getitem__ ([k, n0]);\r\n\t\t\t\t\t\t\t\tvar y = Q.__getitem__ ([k, __add__ (n0, 1)]);\r\n\t\t\t\t\t\t\t\tQ.__setitem__ ([k, n0], __add__ (__mul__ (c, x), __mul__ (s, y)));\r\n\t\t\t\t\t\t\t\tQ.__setitem__ ([k, __add__ (n0, 1)], __add__ (__mul__ (__neg__ (__call__ (__conj__, null, s)), x), __mul__ (__call__ (__conj__, null, c), y)));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (var j = n0; j < __sub__ (n1, 2); j++) {\r\n\t\t\t\t\t\t\tvar c = A.__getitem__ ([__add__ (j, 1), j]);\r\n\t\t\t\t\t\t\tvar s = A.__getitem__ ([__add__ (j, 2), j]);\r\n\t\t\t\t\t\t\tvar v = __call__ (hypot, null, __call__ (hypot, null, c.real, c.imag), __call__ (hypot, null, s.real, s.imag));\r\n\t\t\t\t\t\t\tif (__eq__ (v, 0)) {\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([__add__ (j, 1), j], 0);\r\n\t\t\t\t\t\t\t\tvar v = 1;\r\n\t\t\t\t\t\t\t\tvar c = 1;\r\n\t\t\t\t\t\t\t\tvar s = 0;\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\tA.__setitem__ ([__add__ (j, 1), j], v);\r\n\t\t\t\t\t\t\t\tvar c = __call__ (__idiv__, null, c, v);\r\n\t\t\t\t\t\t\t\tvar s = __call__ (__idiv__, null, s, v);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tA.__setitem__ ([__add__ (j, 2), j], 0);\r\n\t\t\t\t\t\t\tfor (var k = __add__ (j, 1); k < n; k++) {\r\n\t\t\t\t\t\t\t\tvar x = A.__getitem__ ([__add__ (j, 1), k]);\r\n\t\t\t\t\t\t\t\tvar y = A.__getitem__ ([__add__ (j, 2), k]);\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([__add__ (j, 1), k], __add__ (__mul__ (__call__ (__conj__, null, c), x), __mul__ (__call__ (__conj__, null, s), y)));\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([__add__ (j, 2), k], __add__ (__mul__ (__neg__ (s), x), __mul__ (c, y)));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tfor (var k = 0; k < __call__ (min, null, n1, __add__ (j, 4)); k++) {\r\n\t\t\t\t\t\t\t\tvar x = A.__getitem__ ([k, __add__ (j, 1)]);\r\n\t\t\t\t\t\t\t\tvar y = A.__getitem__ ([k, __add__ (j, 2)]);\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([k, __add__ (j, 1)], __add__ (__mul__ (c, x), __mul__ (s, y)));\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([k, __add__ (j, 2)], __add__ (__mul__ (__neg__ (__call__ (__conj__, null, s)), x), __mul__ (__call__ (__conj__, null, c), y)));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (!(__call__ (isinstance, null, Q, bool))) {\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < n; k++) {\r\n\t\t\t\t\t\t\t\t\tvar x = Q.__getitem__ ([k, __add__ (j, 1)]);\r\n\t\t\t\t\t\t\t\t\tvar y = Q.__getitem__ ([k, __add__ (j, 2)]);\r\n\t\t\t\t\t\t\t\t\tQ.__setitem__ ([k, __add__ (j, 1)], __add__ (__mul__ (c, x), __mul__ (s, y)));\r\n\t\t\t\t\t\t\t\t\tQ.__setitem__ ([k, __add__ (j, 2)], __add__ (__mul__ (__neg__ (__call__ (__conj__, null, s)), x), __mul__ (__call__ (__conj__, null, c), y)));\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\tvar hessenberg_qr = function (A, Q) {\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tvar norm = 0;\r\n\t\t\t\t\t\tfor (var x = 0; x < n; x++) {\r\n\t\t\t\t\t\t\tfor (var y = 0; y < __call__ (min, null, __add__ (x, 2), n); y++) {\r\n\t\t\t\t\t\t\t\tvar norm = __call__ (__iadd__, null, norm, __add__ (__mul__ (A.__getitem__ ([y, x]).real, A.__getitem__ ([y, x]).real), __mul__ (A.__getitem__ ([y, x]).imag, A.__getitem__ ([y, x]).imag)));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar norm = __truediv__ (__call__ (sqrt, null, norm), n);\r\n\t\t\t\t\t\tif (__eq__ (norm, 0)) {\r\n\t\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar n0 = 0;\r\n\t\t\t\t\t\tvar n1 = n;\r\n\t\t\t\t\t\tvar eps = __truediv__ (ctx_eps, __mul__ (100, n));\r\n\t\t\t\t\t\tvar maxits = __mul__ (ctx_dps, 4);\r\n\t\t\t\t\t\tvar __left0__ = 0;\r\n\t\t\t\t\t\tvar its = __left0__;\r\n\t\t\t\t\t\tvar totalits = __left0__;\r\n\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\tvar k = n0;\r\n\t\t\t\t\t\t\twhile (__lt__ (__add__ (k, 1), n1)) {\r\n\t\t\t\t\t\t\t\tvar s = __add__ (__add__ (__add__ (__call__ (abs, null, A.__getitem__ ([k, k]).real), __call__ (abs, null, A.__getitem__ ([k, k]).imag)), __call__ (abs, null, A.__getitem__ ([__add__ (k, 1), __add__ (k, 1)]).real)), __call__ (abs, null, A.__getitem__ ([__add__ (k, 1), __add__ (k, 1)]).imag));\r\n\t\t\t\t\t\t\t\tif (__lt__ (s, __mul__ (eps, norm))) {\r\n\t\t\t\t\t\t\t\t\tvar s = norm;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (__lt__ (__call__ (abs, null, A.__getitem__ ([__add__ (k, 1), k])), __mul__ (eps, s))) {\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar k = __call__ (__iadd__, null, k, 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (__lt__ (__add__ (k, 1), n1)) {\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([__add__ (k, 1), k], 0);\r\n\t\t\t\t\t\t\t\tvar n0 = __add__ (k, 1);\r\n\t\t\t\t\t\t\t\tvar its = 0;\r\n\t\t\t\t\t\t\t\tif (__ge__ (__add__ (n0, 1), n1)) {\r\n\t\t\t\t\t\t\t\t\tvar n0 = 0;\r\n\t\t\t\t\t\t\t\t\tvar n1 = __add__ (k, 1);\r\n\t\t\t\t\t\t\t\t\tif (__lt__ (n1, 2)) {\r\n\t\t\t\t\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tif (__eq__ (__mod__ (its, 30), 10)) {\r\n\t\t\t\t\t\t\t\t\tvar shift = A.__getitem__ ([__sub__ (n1, 1), __sub__ (n1, 2)]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (__eq__ (__mod__ (its, 30), 20)) {\r\n\t\t\t\t\t\t\t\t\tvar shift = __call__ (abs, null, A.__getitem__ ([__sub__ (n1, 1), __sub__ (n1, 2)]));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (__eq__ (__mod__ (its, 30), 29)) {\r\n\t\t\t\t\t\t\t\t\tvar shift = norm;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tvar t = __add__ (A.__getitem__ ([__sub__ (n1, 2), __sub__ (n1, 2)]), A.__getitem__ ([__sub__ (n1, 1), __sub__ (n1, 1)]));\r\n\t\t\t\t\t\t\t\t\tvar s = __add__ (__pow__ (__sub__ (A.__getitem__ ([__sub__ (n1, 1), __sub__ (n1, 1)]), A.__getitem__ ([__sub__ (n1, 2), __sub__ (n1, 2)])), 2), __mul__ (__mul__ (4, A.__getitem__ ([__sub__ (n1, 1), __sub__ (n1, 2)])), A.__getitem__ ([__sub__ (n1, 2), __sub__ (n1, 1)])));\r\n\t\t\t\t\t\t\t\t\tif (__gt__ (s.real, 0)) {\r\n\t\t\t\t\t\t\t\t\t\tvar s = __call__ (cmath.sqrt, cmath, s);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tvar s = __mul__ (__call__ (cmath.sqrt, cmath, __neg__ (s)), complex (0, 1.0));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvar a = __truediv__ (__add__ (t, s), 2);\r\n\t\t\t\t\t\t\t\t\tvar b = __truediv__ (__sub__ (t, s), 2);\r\n\t\t\t\t\t\t\t\t\tif (__gt__ (__call__ (abs, null, __sub__ (A.__getitem__ ([__sub__ (n1, 1), __sub__ (n1, 1)]), a)), __call__ (abs, null, __sub__ (A.__getitem__ ([__sub__ (n1, 1), __sub__ (n1, 1)]), b)))) {\r\n\t\t\t\t\t\t\t\t\t\tvar shift = b;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tvar shift = a;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar its = __call__ (__iadd__, null, its, 1);\r\n\t\t\t\t\t\t\t\tvar totalits = __call__ (__iadd__, null, totalits, 1);\r\n\t\t\t\t\t\t\t\t__call__ (qr_step, null, n0, n1, A, Q, shift);\r\n\t\t\t\t\t\t\t\tif (__gt__ (its, maxits)) {\r\n\t\t\t\t\t\t\t\t\tvar __except0__ = __call__ (RuntimeError, null, __mod__ ('qr: failed to converge after %d steps', its));\r\n\t\t\t\t\t\t\t\t\t__except0__.__cause__ = null;\r\n\t\t\t\t\t\t\t\t\tthrow __except0__;\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\tvar schur = function (A, overwrite_a) {\r\n\t\t\t\t\t\tif (typeof overwrite_a == 'undefined' || (overwrite_a != null && overwrite_a .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar overwrite_a = false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tif (__eq__ (n, 1)) {\r\n\t\t\t\t\t\t\treturn tuple ([__call__ (array, null, list ([list ([1])]), A.dtype), A]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!(overwrite_a)) {\r\n\t\t\t\t\t\t\tvar A = __call__ (copy, null, A);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar T = __call__ (empty, null, tuple ([n]), A.dtype);\r\n\t\t\t\t\t\t__call__ (hessenberg_reduce_0, null, A, T);\r\n\t\t\t\t\t\tvar Q = __call__ (copy, null, A);\r\n\t\t\t\t\t\t__call__ (hessenberg_reduce_1, null, Q, T);\r\n\t\t\t\t\t\tfor (var x = 0; x < n; x++) {\r\n\t\t\t\t\t\t\tfor (var y = __add__ (x, 2); y < n; y++) {\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([y, x], 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t__call__ (hessenberg_qr, null, A, Q);\r\n\t\t\t\t\t\treturn tuple ([Q, A]);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar eig_tr_r = function (A) {\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tvar ER = __call__ (identity, null, n, A.dtype);\r\n\t\t\t\t\t\tvar eps = ctx_eps;\r\n\t\t\t\t\t\tvar unfl = __call__ (ctx_ldexp, null, ctx_one, __mul__ (__neg__ (ctx_prec), 30));\r\n\t\t\t\t\t\tvar smlnum = __mul__ (unfl, __truediv__ (n, eps));\r\n\t\t\t\t\t\tvar simin = __truediv__ (1, __call__ (sqrt, null, eps));\r\n\t\t\t\t\t\tvar rmax = 1;\r\n\t\t\t\t\t\tfor (var i = 1; i < n; i++) {\r\n\t\t\t\t\t\t\tvar s = A.__getitem__ ([i, i]);\r\n\t\t\t\t\t\t\tvar smin = __call__ (max, null, __mul__ (eps, __call__ (abs, null, s)), smlnum);\r\n\t\t\t\t\t\t\tfor (var j = __sub__ (i, 1); j > __neg__ (1); j--) {\r\n\t\t\t\t\t\t\t\tvar r = 0;\r\n\t\t\t\t\t\t\t\tfor (var k = __add__ (j, 1); k < __add__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\tvar r = __call__ (__iadd__, null, r, __mul__ (A.__getitem__ ([j, k]), ER.__getitem__ ([k, i])));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar t = __sub__ (A.__getitem__ ([j, j]), s);\r\n\t\t\t\t\t\t\t\tif (__lt__ (__call__ (abs, null, t), smin)) {\r\n\t\t\t\t\t\t\t\t\tvar t = smin;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar r = __truediv__ (__neg__ (r), t);\r\n\t\t\t\t\t\t\t\tER.__setitem__ ([j, i], r);\r\n\t\t\t\t\t\t\t\tvar rmax = __call__ (max, null, rmax, __call__ (abs, null, r));\r\n\t\t\t\t\t\t\t\tif (__gt__ (rmax, simin)) {\r\n\t\t\t\t\t\t\t\t\tfor (var k = j; k < __add__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\t\tER.__setitem__ ([k, i], __call__ (__idiv__, null, ER.__getitem__ ([k, i]), rmax));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvar rmax = 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\tif (__ne__ (rmax, 1)) {\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < __add__ (i, 1); k++) {\r\n\t\t\t\t\t\t\t\t\tER.__setitem__ ([k, i], __call__ (__idiv__, null, ER.__getitem__ ([k, i]), rmax));\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\treturn ER;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar eig_tr_l = function (A) {\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tvar EL = __call__ (identity, null, n, A.dtype);\r\n\t\t\t\t\t\tvar eps = ctx_eps;\r\n\t\t\t\t\t\tvar unfl = __call__ (ctx_ldexp, null, ctx_one, __mul__ (__neg__ (ctx_prec), 30));\r\n\t\t\t\t\t\tvar smlnum = __mul__ (unfl, __truediv__ (n, eps));\r\n\t\t\t\t\t\tvar simin = __truediv__ (1, __call__ (cmath.sqrt, cmath, eps));\r\n\t\t\t\t\t\tvar rmax = 1;\r\n\t\t\t\t\t\tfor (var i = 0; i < __sub__ (n, 1); i++) {\r\n\t\t\t\t\t\t\tvar s = A.__getitem__ ([i, i]);\r\n\t\t\t\t\t\t\tvar smin = __call__ (max, null, __mul__ (eps, __call__ (abs, null, s)), smlnum);\r\n\t\t\t\t\t\t\tfor (var j = __add__ (i, 1); j < n; j++) {\r\n\t\t\t\t\t\t\t\tvar r = 0;\r\n\t\t\t\t\t\t\t\tfor (var k = i; k < j; k++) {\r\n\t\t\t\t\t\t\t\t\tvar r = __call__ (__iadd__, null, r, __mul__ (EL.__getitem__ ([i, k]), A.__getitem__ ([k, j])));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar t = __sub__ (A.__getitem__ ([j, j]), s);\r\n\t\t\t\t\t\t\t\tif (__lt__ (__call__ (abs, null, t), smin)) {\r\n\t\t\t\t\t\t\t\t\tvar t = smin;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar r = __truediv__ (__neg__ (r), t);\r\n\t\t\t\t\t\t\t\tEL.__setitem__ ([i, j], r);\r\n\t\t\t\t\t\t\t\tvar rmax = __call__ (max, null, rmax, __call__ (abs, null, r));\r\n\t\t\t\t\t\t\t\tif (__gt__ (rmax, simin)) {\r\n\t\t\t\t\t\t\t\t\tfor (var k = i; k < __add__ (j, 1); k++) {\r\n\t\t\t\t\t\t\t\t\t\tEL.__setitem__ ([i, k], __call__ (__idiv__, null, EL.__getitem__ ([i, k]), rmax));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvar rmax = 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\tif (__ne__ (rmax, 1)) {\r\n\t\t\t\t\t\t\t\tfor (var k = i; k < n; k++) {\r\n\t\t\t\t\t\t\t\t\tEL.__setitem__ ([i, k], __call__ (__idiv__, null, EL.__getitem__ ([i, k]), rmax));\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\treturn EL;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar eig = function (A, left, right, overwrite_a) {\r\n\t\t\t\t\t\tif (typeof left == 'undefined' || (left != null && left .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar left = false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tif (typeof right == 'undefined' || (right != null && right .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar right = true;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tif (typeof overwrite_a == 'undefined' || (overwrite_a != null && overwrite_a .hasOwnProperty (\"__kwargtrans__\"))) {;\r\n\t\t\t\t\t\t\tvar overwrite_a = false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tvar n = __getitem__ (A.shape, 0);\r\n\t\t\t\t\t\tif (__eq__ (n, 1)) {\r\n\t\t\t\t\t\t\tif (left && !(right)) {\r\n\t\t\t\t\t\t\t\treturn tuple ([list ([__getitem__ (A, 0)]), __call__ (array, null, list ([list ([1])]), A.dtype)]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (right && !(left)) {\r\n\t\t\t\t\t\t\t\treturn tuple ([list ([__getitem__ (A, 0)]), __call__ (array, null, list ([list ([1])]), A.dtype)]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn tuple ([list ([__getitem__ (A, 0)]), __call__ (array, null, list ([list ([1])]), A.dtype), __call__ (array, null, list ([list ([1])]), A.dtype)]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!(overwrite_a)) {\r\n\t\t\t\t\t\t\tvar A = __call__ (copy, null, A);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar T = __call__ (zeros, null, tuple ([n]), 'complex64');\r\n\t\t\t\t\t\t__call__ (hessenberg_reduce_0, null, A, T);\r\n\t\t\t\t\t\tif (left || right) {\r\n\t\t\t\t\t\t\tvar Q = __call__ (copy, null, A);\r\n\t\t\t\t\t\t\t__call__ (hessenberg_reduce_1, null, Q, T);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar Q = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (var x = 0; x < n; x++) {\r\n\t\t\t\t\t\t\tfor (var y = __add__ (x, 2); y < n; y++) {\r\n\t\t\t\t\t\t\t\tA.__setitem__ ([y, x], 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t__call__ (hessenberg_qr, null, A, Q);\r\n\t\t\t\t\t\tvar E = (function () {\r\n\t\t\t\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\t\t\t\tfor (var i = 0; i < n; i++) {\r\n\t\t\t\t\t\t\t\t__call__ (__accu0__.append, __accu0__, A.__getitem__ ([i, i]));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn __accu0__;\r\n\t\t\t\t\t\t}) ();\r\n\t\t\t\t\t\tif (!(left || right)) {\r\n\t\t\t\t\t\t\treturn E;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (left) {\r\n\t\t\t\t\t\t\tvar EL = __call__ (eig_tr_l, null, A);\r\n\t\t\t\t\t\t\tvar EL = __matmul__ (EL, __call__ (__call__ (__conj__, null, Q).transpose, __call__ (__conj__, null, Q)));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (right) {\r\n\t\t\t\t\t\t\tvar ER = __call__ (eig_tr_r, null, A);\r\n\t\t\t\t\t\t\tvar ER = __matmul__ (Q, ER);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (left && !(right)) {\r\n\t\t\t\t\t\t\treturn tuple ([E, EL]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (right && !(left)) {\r\n\t\t\t\t\t\t\treturn tuple ([E, ER]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn tuple ([E, EL, ER]);\r\n\t\t\t\t\t};\r\n\t\t\t\t\t__pragma__ ('<use>' +\r\n\t\t\t\t\t\t'cmath' +\r\n\t\t\t\t\t\t'math' +\r\n\t\t\t\t\t\t'numscrypt' +\r\n\t\t\t\t\t'</use>')\r\n\t\t\t\t\t__pragma__ ('<all>')\r\n\t\t\t\t\t\t__all__.__name__ = __name__;\r\n\t\t\t\t\t\t__all__.acos = acos;\r\n\t\t\t\t\t\t__all__.acosh = acosh;\r\n\t\t\t\t\t\t__all__.array = array;\r\n\t\t\t\t\t\t__all__.asin = asin;\r\n\t\t\t\t\t\t__all__.asinh = asinh;\r\n\t\t\t\t\t\t__all__.atan = atan;\r\n\t\t\t\t\t\t__all__.atan2 = atan2;\r\n\t\t\t\t\t\t__all__.atanh = atanh;\r\n\t\t\t\t\t\t__all__.ceil = ceil;\r\n\t\t\t\t\t\t__all__.conjugate = conjugate;\r\n\t\t\t\t\t\t__all__.copy = copy;\r\n\t\t\t\t\t\t__all__.cos = cos;\r\n\t\t\t\t\t\t__all__.cosh = cosh;\r\n\t\t\t\t\t\t__all__.ctx_dps = ctx_dps;\r\n\t\t\t\t\t\t__all__.ctx_eps = ctx_eps;\r\n\t\t\t\t\t\t__all__.ctx_ldexp = ctx_ldexp;\r\n\t\t\t\t\t\t__all__.ctx_one = ctx_one;\r\n\t\t\t\t\t\t__all__.ctx_prec = ctx_prec;\r\n\t\t\t\t\t\t__all__.degrees = degrees;\r\n\t\t\t\t\t\t__all__.e = e;\r\n\t\t\t\t\t\t__all__.eig = eig;\r\n\t\t\t\t\t\t__all__.eig_tr_l = eig_tr_l;\r\n\t\t\t\t\t\t__all__.eig_tr_r = eig_tr_r;\r\n\t\t\t\t\t\t__all__.empty = empty;\r\n\t\t\t\t\t\t__all__.exp = exp;\r\n\t\t\t\t\t\t__all__.expm1 = expm1;\r\n\t\t\t\t\t\t__all__.floor = floor;\r\n\t\t\t\t\t\t__all__.hessenberg = hessenberg;\r\n\t\t\t\t\t\t__all__.hessenberg_qr = hessenberg_qr;\r\n\t\t\t\t\t\t__all__.hessenberg_reduce_0 = hessenberg_reduce_0;\r\n\t\t\t\t\t\t__all__.hessenberg_reduce_1 = hessenberg_reduce_1;\r\n\t\t\t\t\t\t__all__.hsplit = hsplit;\r\n\t\t\t\t\t\t__all__.hstack = hstack;\r\n\t\t\t\t\t\t__all__.hypot = hypot;\r\n\t\t\t\t\t\t__all__.identity = identity;\r\n\t\t\t\t\t\t__all__.inf = inf;\r\n\t\t\t\t\t\t__all__.isinf = isinf;\r\n\t\t\t\t\t\t__all__.isnan = isnan;\r\n\t\t\t\t\t\t__all__.log = log;\r\n\t\t\t\t\t\t__all__.log10 = log10;\r\n\t\t\t\t\t\t__all__.log1p = log1p;\r\n\t\t\t\t\t\t__all__.log2 = log2;\r\n\t\t\t\t\t\t__all__.nan = nan;\r\n\t\t\t\t\t\t__all__.ndarray = ndarray;\r\n\t\t\t\t\t\t__all__.ns_buffertype = ns_buffertype;\r\n\t\t\t\t\t\t__all__.ns_complex = ns_complex;\r\n\t\t\t\t\t\t__all__.ns_complextype = ns_complextype;\r\n\t\t\t\t\t\t__all__.ns_createbuf = ns_createbuf;\r\n\t\t\t\t\t\t__all__.ns_ctors = ns_ctors;\r\n\t\t\t\t\t\t__all__.ones = ones;\r\n\t\t\t\t\t\t__all__.pi = pi;\r\n\t\t\t\t\t\t__all__.pow = pow;\r\n\t\t\t\t\t\t__all__.qr_step = qr_step;\r\n\t\t\t\t\t\t__all__.radians = radians;\r\n\t\t\t\t\t\t__all__.round = round;\r\n\t\t\t\t\t\t__all__.schur = schur;\r\n\t\t\t\t\t\t__all__.sin = sin;\r\n\t\t\t\t\t\t__all__.sinh = sinh;\r\n\t\t\t\t\t\t__all__.sqrt = sqrt;\r\n\t\t\t\t\t\t__all__.tan = tan;\r\n\t\t\t\t\t\t__all__.tanh = tanh;\r\n\t\t\t\t\t\t__all__.trunc = trunc;\r\n\t\t\t\t\t\t__all__.vsplit = vsplit;\r\n\t\t\t\t\t\t__all__.vstack = vstack;\r\n\t\t\t\t\t\t__all__.zeros = zeros;\r\n\t\t\t\t\t__pragma__ ('</all>')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\t(function () {\r\n\t\tvar __name__ = '__main__';\r\n\t\tif (__envir__.executor_name == __envir__.transpiler_name) {\r\n\t\t\tvar num = __init__ (__world__.numscrypt);\r\n\t\t\tvar linalg = __init__ (__world__.numscrypt.linalg);\r\n\t\t}\r\n\t\tvar show = function () {\r\n\t\t\tvar args = tuple ([].slice.apply (arguments).slice (0));\r\n\t\t\t__call__.apply (null, [print].concat ([null]).concat (args));\r\n\t\t};\r\n\t\tvar __iterable0__ = __getslice__ (tuple ([__call__ (num.array, num, list ([list ([0, complex (0, 1.0)]), list ([__neg__ (complex (0, 1.0)), 1])]), 'complex128'), __call__ (num.array, num, list ([list ([1, __neg__ (2), 3, 1]), list ([5, 8, __neg__ (1), __neg__ (5)]), list ([2, 1, 1, 100]), list ([2, 1, __neg__ (1), 0])]), 'complex128'), __call__ (num.array, num, list ([list ([1, 1, 0, 0]), list ([0, 2, 2, 0]), list ([0, 0, 3, 3]), list ([0, 0, 0, 4])]), 'complex128')]), 1, 2, 1);\r\n\t\tfor (var __index0__ = 0; __index0__ < len (__iterable0__); __index0__++) {\r\n\t\t\tvar a = __getitem__ (__iterable0__, __index0__);\r\n\t\t\tvar __left0__ = __call__ (linalg.eig, linalg, a);\r\n\t\t\tvar eVals = __left0__ [0];\r\n\t\t\tvar eVecs = __left0__ [1];\r\n\t\t\tvar enumSorted = __call__ (sorted, null, __call__ (enumerate, null, __call__ (eVals.tolist, eVals)), __kwargtrans__ ({key: (function __lambda__ (elem) {\r\n\t\t\t\treturn __neg__ (__add__ (__getitem__ (elem, 1).real, __truediv__ (__getitem__ (elem, 1).imag, 1000)));\r\n\t\t\t})}));\r\n\t\t\tvar indicesSorted = (function () {\r\n\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\tvar __iterable1__ = enumSorted;\r\n\t\t\t\tfor (var __index1__ = 0; __index1__ < len (__iterable1__); __index1__++) {\r\n\t\t\t\t\tvar elem = __getitem__ (__iterable1__, __index1__);\r\n\t\t\t\t\t__call__ (__accu0__.append, __accu0__, __getitem__ (elem, 0));\r\n\t\t\t\t}\r\n\t\t\t\treturn __accu0__;\r\n\t\t\t}) ();\r\n\t\t\tvar eValsSorted = (function () {\r\n\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\tvar __iterable1__ = enumSorted;\r\n\t\t\t\tfor (var __index1__ = 0; __index1__ < len (__iterable1__); __index1__++) {\r\n\t\t\t\t\tvar elem = __getitem__ (__iterable1__, __index1__);\r\n\t\t\t\t\t__call__ (__accu0__.append, __accu0__, __getitem__ (elem, 1));\r\n\t\t\t\t}\r\n\t\t\t\treturn __accu0__;\r\n\t\t\t}) ();\r\n\t\t\tvar eValsMat = __call__ (num.empty, num, a.shape, a.dtype);\r\n\t\t\tfor (var iRow = 0; iRow < __getitem__ (a.shape, 0); iRow++) {\r\n\t\t\t\tfor (var iCol = 0; iCol < __getitem__ (a.shape, 1); iCol++) {\r\n\t\t\t\t\teValsMat.__setitem__ ([iRow, iCol], __getitem__ (eVals, iCol));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar eVecsNorms = __call__ (num.empty, num, tuple ([__getitem__ (eVecs.shape, 1)]), a.dtype);\r\n\t\t\tfor (var iNorm = 0; iNorm < __getitem__ (eVecsNorms.shape, 0); iNorm++) {\r\n\t\t\t\t__setitem__ (eVecsNorms, iNorm, __call__ (complex, null, __call__ (linalg.norm, linalg, eVecs.__getitem__ ([tuple ([0, null, 1]), iNorm]))));\r\n\t\t\t}\r\n\t\t\tvar eVecsCanon = __call__ (num.empty, num, a.shape, a.dtype);\r\n\t\t\tfor (var iRow = 0; iRow < __getitem__ (a.shape, 0); iRow++) {\r\n\t\t\t\tfor (var iCol = 0; iCol < __getitem__ (a.shape, 1); iCol++) {\r\n\t\t\t\t\teVecsCanon.__setitem__ ([iRow, iCol], __truediv__ (eVecs.__getitem__ ([iRow, iCol]), eVecs.__getitem__ ([0, iCol])));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar eVecsSorted = __call__ (num.empty, num, a.shape, a.dtype);\r\n\t\t\tfor (var iRow = 0; iRow < __getitem__ (a.shape, 0); iRow++) {\r\n\t\t\t\tfor (var iCol = 0; iCol < __getitem__ (a.shape, 1); iCol++) {\r\n\t\t\t\t\teVecsSorted.__setitem__ ([iRow, iCol], eVecsCanon.__getitem__ ([iRow, __getitem__ (indicesSorted, iCol)]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t__call__ (show, null, '=========================================');\r\n\t\t\t__call__ (show, null, '\\n---------------- eigVecsSorted ----------');\r\n\t\t\t__call__ (show, null, (function () {\r\n\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\tvar __iterable1__ = __call__ (eVecsSorted.tolist, eVecsSorted);\r\n\t\t\t\tfor (var __index1__ = 0; __index1__ < len (__iterable1__); __index1__++) {\r\n\t\t\t\t\tvar row = __getitem__ (__iterable1__, __index1__);\r\n\t\t\t\t\t__call__ (__accu0__.append, __accu0__, (function () {\r\n\t\t\t\t\t\tvar __accu1__ = [];\r\n\t\t\t\t\t\tvar __iterable2__ = row;\r\n\t\t\t\t\t\tfor (var __index2__ = 0; __index2__ < len (__iterable2__); __index2__++) {\r\n\t\t\t\t\t\t\tvar value = __getitem__ (__iterable2__, __index2__);\r\n\t\t\t\t\t\t\t__call__ (__accu1__.append, __accu1__, tuple ([__call__ (round, null, __add__ (value.real, 1e-10), 3), __call__ (round, null, __add__ (value.imag, 1e-10), 3)]));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn __accu1__;\r\n\t\t\t\t\t}) ());\r\n\t\t\t\t}\r\n\t\t\t\treturn __accu0__;\r\n\t\t\t}) ());\r\n\t\t\t__call__ (show, null, '\\n---------------- eigValsSorted ----------');\r\n\t\t\t__call__ (show, null, (function () {\r\n\t\t\t\tvar __accu0__ = [];\r\n\t\t\t\tvar __iterable1__ = eValsSorted;\r\n\t\t\t\tfor (var __index1__ = 0; __index1__ < len (__iterable1__); __index1__++) {\r\n\t\t\t\t\tvar value = __getitem__ (__iterable1__, __index1__);\r\n\t\t\t\t\t__call__ (__accu0__.append, __accu0__, tuple ([__call__ (round, null, __add__ (value.real, 1e-10), 3), __call__ (round, null, __add__ (value.imag, 1e-10), 3)]));\r\n\t\t\t\t}\r\n\t\t\t\treturn __accu0__;\r\n\t\t\t}) (), '\\n');\r\n\t\t\t__call__ (show, null, '=========================================');\r\n\t\t}\r\n\t\t__pragma__ ('<use>' +\r\n\t\t\t'numscrypt' +\r\n\t\t\t'numscrypt.linalg' +\r\n\t\t'</use>')\r\n\t\t__pragma__ ('<all>')\r\n\t\t\t__all__.__name__ = __name__;\r\n\t\t\t__all__.a = a;\r\n\t\t\t__all__.eVals = eVals;\r\n\t\t\t__all__.eValsMat = eValsMat;\r\n\t\t\t__all__.eValsSorted = eValsSorted;\r\n\t\t\t__all__.eVecs = eVecs;\r\n\t\t\t__all__.eVecsCanon = eVecsCanon;\r\n\t\t\t__all__.eVecsNorms = eVecsNorms;\r\n\t\t\t__all__.eVecsSorted = eVecsSorted;\r\n\t\t\t__all__.enumSorted = enumSorted;\r\n\t\t\t__all__.iCol = iCol;\r\n\t\t\t__all__.iNorm = iNorm;\r\n\t\t\t__all__.iRow = iRow;\r\n\t\t\t__all__.indicesSorted = indicesSorted;\r\n\t\t\t__all__.show = show;\r\n\t\t__pragma__ ('</all>')\r\n\t}) ();\r\n return __all__;\r\n}", "title": "" }, { "docid": "97f25759ff2312b34f735a2a774e7cd5", "score": "0.5488553", "text": "function util() {\n\n}", "title": "" }, { "docid": "5219a9f4556c9f66c03865d6105c2091", "score": "0.538515", "text": "function Phantomjssmith() {\n // No options for our engine\n}", "title": "" }, { "docid": "51cecfb13f93396ca050c83b22782b61", "score": "0.5361747", "text": "function cjsHarness() {\n module = {\n exports: {}\n };\n exports = module.exports;\n process = {\n title: 'Atomic CommonJS Harness'\n };\n }", "title": "" }, { "docid": "d86a6f6dd9900bf17f45fd538755383b", "score": "0.533817", "text": "get itself() { return System.get(System.decanonicalize(\"lively.modules/index.js\")); }", "title": "" }, { "docid": "5b70201237bf3a7694a9a7b4db3a0077", "score": "0.5294434", "text": "function gl(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}", "title": "" }, { "docid": "51516f7c0c249417d7500ce4577afc47", "score": "0.5286721", "text": "function compiler() {\n const util = require('util')\n const semver = require('semver')\n\n // standard combinators\n const combinators = {\n empty: { since: '0.4.0' },\n seq: { components: true, since: '0.4.0' },\n sequence: { components: true, since: '0.4.0' },\n if: { args: [{ _: 'test' }, { _: 'consequent' }, { _: 'alternate', optional: true }], since: '0.4.0' },\n if_nosave: { args: [{ _: 'test' }, { _: 'consequent' }, { _: 'alternate', optional: true }], since: '0.4.0' },\n while: { args: [{ _: 'test' }, { _: 'body' }], since: '0.4.0' },\n while_nosave: { args: [{ _: 'test' }, { _: 'body' }], since: '0.4.0' },\n dowhile: { args: [{ _: 'body' }, { _: 'test' }], since: '0.4.0' },\n dowhile_nosave: { args: [{ _: 'body' }, { _: 'test' }], since: '0.4.0' },\n try: { args: [{ _: 'body' }, { _: 'handler' }], since: '0.4.0' },\n finally: { args: [{ _: 'body' }, { _: 'finalizer' }], since: '0.4.0' },\n retain: { components: true, since: '0.4.0' },\n retain_catch: { components: true, since: '0.4.0' },\n let: { args: [{ _: 'declarations', type: 'object' }], components: true, since: '0.4.0' },\n mask: { components: true, since: '0.4.0' },\n action: { args: [{ _: 'name', type: 'string' }, { _: 'action', type: 'object', optional: true }], since: '0.4.0' },\n managed_action: { args: [{ _: 'name', type: 'string' }, { _: 'action', type: 'object', optional: true }], since: '0.4.0' },\n composition: { args: [{ _: 'name', type: 'string' }, { _: 'composition' }], since: '0.4.0' },\n repeat: { args: [{ _: 'count', type: 'number' }], components: true, since: '0.4.0' },\n retry: { args: [{ _: 'count', type: 'number' }], components: true, since: '0.4.0' },\n value: { args: [{ _: 'value', type: 'value' }], since: '0.4.0' },\n literal: { args: [{ _: 'value', type: 'value' }], since: '0.4.0' },\n function: { args: [{ _: 'function', type: 'object' }], since: '0.4.0' }\n }\n\n // composer error class\n class ComposerError extends Error {\n constructor(message, argument) {\n super(message + (argument !== undefined ? '\\nArgument: ' + util.inspect(argument) : ''))\n }\n }\n\n // composition class\n class Composition {\n // weaker instanceof to tolerate multiple instances of this class\n static [Symbol.hasInstance](instance) {\n return instance.constructor && instance.constructor.name === Composition.name\n }\n\n // construct a composition object with the specified fields\n constructor(composition) {\n return Object.assign(this, composition)\n }\n\n // apply f to all fields of type composition\n visit(f) {\n const combinator = combinators[this.type]\n if (combinator.components) {\n this.components = this.components.map(f)\n }\n for (let arg of combinator.args || []) {\n if (arg.type === undefined) {\n this[arg._] = f(this[arg._], arg._)\n }\n }\n }\n }\n\n // compiler class\n class Compiler {\n // detect task type and create corresponding composition object\n task(task) {\n if (arguments.length > 1) throw new ComposerError('Too many arguments')\n if (task === null) return this.empty()\n if (task instanceof Composition) return task\n if (typeof task === 'function') return this.function(task)\n if (typeof task === 'string') return this.action(task)\n throw new ComposerError('Invalid argument', task)\n }\n\n // function combinator: stringify function code\n function(fun) {\n if (arguments.length > 1) throw new ComposerError('Too many arguments')\n if (typeof fun === 'function') {\n fun = `${fun}`\n if (fun.indexOf('[native code]') !== -1) throw new ComposerError('Cannot capture native function', fun)\n }\n if (typeof fun === 'string') {\n fun = { kind: 'nodejs:default', code: fun }\n }\n if (typeof fun !== 'object' || fun === null) throw new ComposerError('Invalid argument', fun)\n return new Composition({ type: 'function', function: { exec: fun } })\n }\n\n // lowering\n\n _empty() {\n return this.sequence()\n }\n\n _seq(composition) {\n return this.sequence(...composition.components)\n }\n\n _value(composition) {\n return this._literal(composition)\n }\n\n _literal(composition) {\n return this.let({ value: composition.value }, () => value)\n }\n\n _retain(composition) {\n return this.let(\n { params: null },\n args => { params = args },\n this.mask(...composition.components),\n result => ({ params, result }))\n }\n\n _retain_catch(composition) {\n return this.seq(\n this.retain(\n this.finally(\n this.seq(...composition.components),\n result => ({ result }))),\n ({ params, result }) => ({ params, result: result.result }))\n }\n\n _if(composition) {\n return this.let(\n { params: null },\n args => { params = args },\n this.if_nosave(\n this.mask(composition.test),\n this.seq(() => params, this.mask(composition.consequent)),\n this.seq(() => params, this.mask(composition.alternate))))\n }\n\n _while(composition) {\n return this.let(\n { params: null },\n args => { params = args },\n this.while_nosave(\n this.mask(composition.test),\n this.seq(() => params, this.mask(composition.body), args => { params = args })),\n () => params)\n }\n\n _dowhile(composition) {\n return this.let(\n { params: null },\n args => { params = args },\n this.dowhile_nosave(\n this.seq(() => params, this.mask(composition.body), args => { params = args }),\n this.mask(composition.test)),\n () => params)\n }\n\n _repeat(composition) {\n return this.let(\n { count: composition.count },\n this.while(\n () => count-- > 0,\n this.mask(this.seq(...composition.components))))\n }\n\n _retry(composition) {\n return this.let(\n { count: composition.count },\n params => ({ params }),\n this.dowhile(\n this.finally(({ params }) => params, this.mask(this.retain_catch(...composition.components))),\n ({ result }) => result.error !== undefined && count-- > 0),\n ({ result }) => result)\n }\n\n // define combinator methods for the standard combinators\n static init() {\n for (let type in combinators) {\n const combinator = combinators[type]\n // do not overwrite hand-written combinators\n Compiler.prototype[type] = Compiler.prototype[type] || function () {\n const composition = new Composition({ type })\n const skip = combinator.args && combinator.args.length || 0\n if (!combinator.components && (arguments.length > skip)) {\n throw new ComposerError('Too many arguments')\n }\n for (let i = 0; i < skip; ++i) {\n const arg = combinator.args[i]\n const argument = arg.optional ? arguments[i] || null : arguments[i]\n switch (arg.type) {\n case undefined:\n composition[arg._] = this.task(argument)\n continue\n case 'value':\n if (typeof argument === 'function') throw new ComposerError('Invalid argument', argument)\n composition[arg._] = argument === undefined ? {} : argument\n continue\n case 'object':\n if (argument === null || Array.isArray(argument)) throw new ComposerError('Invalid argument', argument)\n default:\n if (typeof argument !== arg.type) throw new ComposerError('Invalid argument', argument)\n composition[arg._] = argument\n }\n }\n if (combinator.components) {\n composition.components = Array.prototype.slice.call(arguments, skip).map(obj => this.task(obj))\n }\n return composition\n }\n }\n }\n\n // return combinator list\n get combinators() {\n return combinators\n }\n\n // recursively deserialize composition\n deserialize(composition) {\n if (arguments.length > 1) throw new ComposerError('Too many arguments')\n composition = new Composition(composition) // copy\n composition.visit(composition => this.deserialize(composition))\n return composition\n }\n\n // label combinators with the json path\n label(composition) {\n if (arguments.length > 1) throw new ComposerError('Too many arguments')\n if (!(composition instanceof Composition)) throw new ComposerError('Invalid argument', composition)\n\n const label = path => (composition, name, array) => {\n composition = new Composition(composition) // copy\n composition.path = path + (name !== undefined ? (array === undefined ? `.${name}` : `[${name}]`) : '')\n // label nested combinators\n composition.visit(label(composition.path))\n return composition\n }\n\n return label('')(composition)\n }\n\n // recursively label and lower combinators to the desired set of combinators (including primitive combinators)\n lower(composition, combinators = []) {\n if (arguments.length > 2) throw new ComposerError('Too many arguments')\n if (!(composition instanceof Composition)) throw new ComposerError('Invalid argument', composition)\n if (!Array.isArray(combinators) && typeof combinators !== 'boolean' && typeof combinators !== 'string') throw new ComposerError('Invalid argument', combinators)\n\n if (combinators === false) return composition // no lowering\n if (combinators === true || combinators === '') combinators = [] // maximal lowering\n if (typeof combinators === 'string') { // lower to combinators of specific composer version \n combinators = Object.keys(this.combinators).filter(key => semver.gte(combinators, this.combinators[key].since))\n }\n\n const lower = composition => {\n composition = new Composition(composition) // copy\n // repeatedly lower root combinator\n while (combinators.indexOf(composition.type) < 0 && this[`_${composition.type}`]) {\n const path = composition.path\n composition = this[`_${composition.type}`](composition)\n if (path !== undefined) composition.path = path\n }\n // lower nested combinators\n composition.visit(lower)\n return composition\n }\n\n return lower(composition)\n }\n }\n\n Compiler.init()\n\n return { ComposerError, Composition, Compiler }\n}", "title": "" }, { "docid": "8bf9187596a93a6be28b1817e3b0aba6", "score": "0.5262822", "text": "function Generator() {} // 84", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52552354", "text": "function r(){}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.5239765", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.5239765", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.5239765", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.5239765", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.5239765", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.5239765", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.5239765", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "0a3946053c61ac379fc1dc66adb075c3", "score": "0.523619", "text": "function Util() {}", "title": "" }, { "docid": "fd97c14b11aca0bafe7323252f941e19", "score": "0.5209355", "text": "function Generator() {} // 81", "title": "" }, { "docid": "da7b02050143c8eacf4cfb719cdb92db", "score": "0.5140663", "text": "function Test_GetMatchingPattern_Apache20() {\r\n Test_GetMatchingPattern_Core(\r\n\"Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); \" +\r\n\"you may not use this file except in compliance with the License. \" +\r\n\"You may obtain a copy of the License at \" +\r\n\"http://www.apache.org/licenses/LICENSE-2.0 \" +\r\n\"Unless required by applicable law or agreed to in writing, software \" +\r\n\"distributed under the License is distributed on an \\\"AS IS\\\" BASIS, \" +\r\n\"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \" +\r\n\"See the License for the specific language governing permissions and \" +\r\n\"limitations under the License.\");\r\n}", "title": "" }, { "docid": "c2bb532dd756c7469a7f9b0524bb50cd", "score": "0.5127742", "text": "function i(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "b58e6fe7365275f6b524a25431188b68", "score": "0.51169586", "text": "function yg(){return yg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yg.apply(this,arguments)}", "title": "" }, { "docid": "094bbfc0888d58fb068ba9ee14807827", "score": "0.5116853", "text": "function At(t,e){return t(e={exports:{}},e.exports),e.exports}", "title": "" }, { "docid": "52b494d5d122f71b9f1588171db91c28", "score": "0.5088959", "text": "function universalModule() {\n\t var $Object = Object;\n\n\tfunction createClass(ctor, methods, staticMethods, superClass) {\n\t var proto;\n\t if (superClass) {\n\t var superProto = superClass.prototype;\n\t proto = $Object.create(superProto);\n\t } else {\n\t proto = ctor.prototype;\n\t }\n\t $Object.keys(methods).forEach(function (key) {\n\t proto[key] = methods[key];\n\t });\n\t $Object.keys(staticMethods).forEach(function (key) {\n\t ctor[key] = staticMethods[key];\n\t });\n\t proto.constructor = ctor;\n\t ctor.prototype = proto;\n\t return ctor;\n\t}\n\n\tfunction superCall(self, proto, name, args) {\n\t return $Object.getPrototypeOf(proto)[name].apply(self, args);\n\t}\n\n\tfunction defaultSuperCall(self, proto, args) {\n\t superCall(self, proto, 'constructor', args);\n\t}\n\n\tvar $traceurRuntime = {};\n\t$traceurRuntime.createClass = createClass;\n\t$traceurRuntime.superCall = superCall;\n\t$traceurRuntime.defaultSuperCall = defaultSuperCall;\n\t\"use strict\";\n\tfunction is(first, second) {\n\t if (first === second) {\n\t return first !== 0 || second !== 0 || 1 / first === 1 / second;\n\t }\n\t if (first !== first) {\n\t return second !== second;\n\t }\n\t if (first && typeof first.equals === 'function') {\n\t return first.equals(second);\n\t }\n\t return false;\n\t}\n\tfunction invariant(condition, error) {\n\t if (!condition)\n\t throw new Error(error);\n\t}\n\tvar DELETE = 'delete';\n\tvar SHIFT = 5;\n\tvar SIZE = 1 << SHIFT;\n\tvar MASK = SIZE - 1;\n\tvar NOT_SET = {};\n\tvar CHANGE_LENGTH = {value: false};\n\tvar DID_ALTER = {value: false};\n\tfunction MakeRef(ref) {\n\t ref.value = false;\n\t return ref;\n\t}\n\tfunction SetRef(ref) {\n\t ref && (ref.value = true);\n\t}\n\tfunction OwnerID() {}\n\tfunction arrCopy(arr, offset) {\n\t offset = offset || 0;\n\t var len = Math.max(0, arr.length - offset);\n\t var newArr = new Array(len);\n\t for (var ii = 0; ii < len; ii++) {\n\t newArr[ii] = arr[ii + offset];\n\t }\n\t return newArr;\n\t}\n\tfunction assertNotInfinite(size) {\n\t invariant(size !== Infinity, 'Cannot perform this action with an infinite size.');\n\t}\n\tfunction ensureSize(iter) {\n\t if (iter.size === undefined) {\n\t iter.size = iter.__iterate(returnTrue);\n\t }\n\t return iter.size;\n\t}\n\tfunction wrapIndex(iter, index) {\n\t return index >= 0 ? (+index) : ensureSize(iter) + (+index);\n\t}\n\tfunction returnTrue() {\n\t return true;\n\t}\n\tfunction wholeSlice(begin, end, size) {\n\t return (begin === 0 || (size !== undefined && begin <= -size)) && (end === undefined || (size !== undefined && end >= size));\n\t}\n\tfunction resolveBegin(begin, size) {\n\t return resolveIndex(begin, size, 0);\n\t}\n\tfunction resolveEnd(end, size) {\n\t return resolveIndex(end, size, size);\n\t}\n\tfunction resolveIndex(index, size, defaultIndex) {\n\t return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index);\n\t}\n\tvar imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) {\n\t a = a | 0;\n\t b = b | 0;\n\t var c = a & 0xffff;\n\t var d = b & 0xffff;\n\t return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0;\n\t};\n\tfunction smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t}\n\tfunction hash(o) {\n\t if (!o) {\n\t return 0;\n\t }\n\t if (o === true) {\n\t return 1;\n\t }\n\t var type = typeof o;\n\t if (type === 'number') {\n\t var h = o | 0;\n\t while (o > 0xFFFFFFFF) {\n\t o /= 0xFFFFFFFF;\n\t h ^= o;\n\t }\n\t return smi(h);\n\t }\n\t if (type === 'string') {\n\t return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n\t }\n\t if (o.hashCode) {\n\t return hash(typeof o.hashCode === 'function' ? o.hashCode() : o.hashCode);\n\t }\n\t return hashJSObj(o);\n\t}\n\tfunction cachedHashString(string) {\n\t var hash = stringHashCache[string];\n\t if (hash === undefined) {\n\t hash = hashString(string);\n\t if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n\t STRING_HASH_CACHE_SIZE = 0;\n\t stringHashCache = {};\n\t }\n\t STRING_HASH_CACHE_SIZE++;\n\t stringHashCache[string] = hash;\n\t }\n\t return hash;\n\t}\n\tfunction hashString(string) {\n\t var hash = 0;\n\t for (var ii = 0; ii < string.length; ii++) {\n\t hash = 31 * hash + string.charCodeAt(ii) | 0;\n\t }\n\t return smi(hash);\n\t}\n\tfunction hashJSObj(obj) {\n\t var hash = weakMap && weakMap.get(obj);\n\t if (hash)\n\t return hash;\n\t hash = obj[UID_HASH_KEY];\n\t if (hash)\n\t return hash;\n\t if (!canDefineProperty) {\n\t hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n\t if (hash)\n\t return hash;\n\t hash = getIENodeHash(obj);\n\t if (hash)\n\t return hash;\n\t }\n\t if (Object.isExtensible && !Object.isExtensible(obj)) {\n\t throw new Error('Non-extensible objects are not allowed as keys.');\n\t }\n\t hash = ++objHashUID;\n\t if (objHashUID & 0x40000000) {\n\t objHashUID = 0;\n\t }\n\t if (weakMap) {\n\t weakMap.set(obj, hash);\n\t } else if (canDefineProperty) {\n\t Object.defineProperty(obj, UID_HASH_KEY, {\n\t 'enumerable': false,\n\t 'configurable': false,\n\t 'writable': false,\n\t 'value': hash\n\t });\n\t } else if (obj.propertyIsEnumerable && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n\t obj.propertyIsEnumerable = function() {\n\t return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n\t };\n\t obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n\t } else if (obj.nodeType) {\n\t obj[UID_HASH_KEY] = hash;\n\t } else {\n\t throw new Error('Unable to set a non-enumerable property on object.');\n\t }\n\t return hash;\n\t}\n\tvar canDefineProperty = (function() {\n\t try {\n\t Object.defineProperty({}, 'x', {});\n\t return true;\n\t } catch (e) {\n\t return false;\n\t }\n\t}());\n\tfunction getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1:\n\t return node.uniqueID;\n\t case 9:\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t}\n\tvar weakMap = typeof WeakMap === 'function' && new WeakMap();\n\tvar objHashUID = 0;\n\tvar UID_HASH_KEY = '__immutablehash__';\n\tif (typeof Symbol === 'function') {\n\t UID_HASH_KEY = Symbol(UID_HASH_KEY);\n\t}\n\tvar STRING_HASH_CACHE_MIN_STRLEN = 16;\n\tvar STRING_HASH_CACHE_MAX_SIZE = 255;\n\tvar STRING_HASH_CACHE_SIZE = 0;\n\tvar stringHashCache = {};\n\tvar ITERATE_KEYS = 0;\n\tvar ITERATE_VALUES = 1;\n\tvar ITERATE_ENTRIES = 2;\n\tvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\tvar REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n\tvar ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\tvar Iterator = function Iterator(next) {\n\t this.next = next;\n\t};\n\t($traceurRuntime.createClass)(Iterator, {toString: function() {\n\t return '[Iterator]';\n\t }}, {});\n\tIterator.KEYS = ITERATE_KEYS;\n\tIterator.VALUES = ITERATE_VALUES;\n\tIterator.ENTRIES = ITERATE_ENTRIES;\n\tvar IteratorPrototype = Iterator.prototype;\n\tIteratorPrototype.inspect = IteratorPrototype.toSource = function() {\n\t return this.toString();\n\t};\n\tIteratorPrototype[ITERATOR_SYMBOL] = function() {\n\t return this;\n\t};\n\tfunction iteratorValue(type, k, v, iteratorResult) {\n\t var value = type === 0 ? k : type === 1 ? v : [k, v];\n\t iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {\n\t value: value,\n\t done: false\n\t });\n\t return iteratorResult;\n\t}\n\tfunction iteratorDone() {\n\t return {\n\t value: undefined,\n\t done: true\n\t };\n\t}\n\tfunction hasIterator(maybeIterable) {\n\t return !!_iteratorFn(maybeIterable);\n\t}\n\tfunction isIterator(maybeIterator) {\n\t return maybeIterator && typeof maybeIterator.next === 'function';\n\t}\n\tfunction getIterator(iterable) {\n\t var iteratorFn = _iteratorFn(iterable);\n\t return iteratorFn && iteratorFn.call(iterable);\n\t}\n\tfunction _iteratorFn(iterable) {\n\t var iteratorFn = iterable && ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL]);\n\t if (typeof iteratorFn === 'function') {\n\t return iteratorFn;\n\t }\n\t}\n\tvar Iterable = function Iterable(value) {\n\t return isIterable(value) ? value : Seq(value);\n\t};\n\tvar $Iterable = Iterable;\n\t($traceurRuntime.createClass)(Iterable, {\n\t toArray: function() {\n\t assertNotInfinite(this.size);\n\t var array = new Array(this.size || 0);\n\t this.valueSeq().__iterate((function(v, i) {\n\t array[i] = v;\n\t }));\n\t return array;\n\t },\n\t toIndexedSeq: function() {\n\t return new ToIndexedSequence(this);\n\t },\n\t toJS: function() {\n\t return this.toSeq().map((function(value) {\n\t return value && typeof value.toJS === 'function' ? value.toJS() : value;\n\t })).__toJS();\n\t },\n\t toKeyedSeq: function() {\n\t return new ToKeyedSequence(this, true);\n\t },\n\t toMap: function() {\n\t assertNotInfinite(this.size);\n\t return Map(this.toKeyedSeq());\n\t },\n\t toObject: function() {\n\t assertNotInfinite(this.size);\n\t var object = {};\n\t this.__iterate((function(v, k) {\n\t object[k] = v;\n\t }));\n\t return object;\n\t },\n\t toOrderedMap: function() {\n\t assertNotInfinite(this.size);\n\t return OrderedMap(this.toKeyedSeq());\n\t },\n\t toOrderedSet: function() {\n\t assertNotInfinite(this.size);\n\t return OrderedSet(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toSet: function() {\n\t assertNotInfinite(this.size);\n\t return Set(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toSetSeq: function() {\n\t return new ToSetSequence(this);\n\t },\n\t toSeq: function() {\n\t return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();\n\t },\n\t toStack: function() {\n\t assertNotInfinite(this.size);\n\t return Stack(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toList: function() {\n\t assertNotInfinite(this.size);\n\t return List(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toString: function() {\n\t return '[Iterable]';\n\t },\n\t __toString: function(head, tail) {\n\t if (this.size === 0) {\n\t return head + tail;\n\t }\n\t return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n\t },\n\t concat: function() {\n\t for (var values = [],\n\t $__2 = 0; $__2 < arguments.length; $__2++)\n\t values[$__2] = arguments[$__2];\n\t return reify(this, concatFactory(this, values));\n\t },\n\t contains: function(searchValue) {\n\t return this.some((function(value) {\n\t return is(value, searchValue);\n\t }));\n\t },\n\t entries: function() {\n\t return this.__iterator(ITERATE_ENTRIES);\n\t },\n\t every: function(predicate, context) {\n\t var returnValue = true;\n\t this.__iterate((function(v, k, c) {\n\t if (!predicate.call(context, v, k, c)) {\n\t returnValue = false;\n\t return false;\n\t }\n\t }));\n\t return returnValue;\n\t },\n\t filter: function(predicate, context) {\n\t return reify(this, filterFactory(this, predicate, context, true));\n\t },\n\t find: function(predicate, context, notSetValue) {\n\t var foundValue = notSetValue;\n\t this.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t foundValue = v;\n\t return false;\n\t }\n\t }));\n\t return foundValue;\n\t },\n\t forEach: function(sideEffect, context) {\n\t return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n\t },\n\t join: function(separator) {\n\t separator = separator !== undefined ? '' + separator : ',';\n\t var joined = '';\n\t var isFirst = true;\n\t this.__iterate((function(v) {\n\t isFirst ? (isFirst = false) : (joined += separator);\n\t joined += v !== null && v !== undefined ? v : '';\n\t }));\n\t return joined;\n\t },\n\t keys: function() {\n\t return this.__iterator(ITERATE_KEYS);\n\t },\n\t map: function(mapper, context) {\n\t return reify(this, mapFactory(this, mapper, context));\n\t },\n\t reduce: function(reducer, initialReduction, context) {\n\t var reduction;\n\t var useFirst;\n\t if (arguments.length < 2) {\n\t useFirst = true;\n\t } else {\n\t reduction = initialReduction;\n\t }\n\t this.__iterate((function(v, k, c) {\n\t if (useFirst) {\n\t useFirst = false;\n\t reduction = v;\n\t } else {\n\t reduction = reducer.call(context, reduction, v, k, c);\n\t }\n\t }));\n\t return reduction;\n\t },\n\t reduceRight: function(reducer, initialReduction, context) {\n\t var reversed = this.toKeyedSeq().reverse();\n\t return reversed.reduce.apply(reversed, arguments);\n\t },\n\t reverse: function() {\n\t return reify(this, reverseFactory(this, true));\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t var resolvedBegin = resolveBegin(begin, this.size);\n\t var resolvedEnd = resolveEnd(end, this.size);\n\t if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n\t return this.toSeq().cacheResult().slice(begin, end);\n\t }\n\t var skipped = resolvedBegin === 0 ? this : this.skip(resolvedBegin);\n\t return reify(this, resolvedEnd === undefined || resolvedEnd === this.size ? skipped : skipped.take(resolvedEnd - resolvedBegin));\n\t },\n\t some: function(predicate, context) {\n\t return !this.every(not(predicate), context);\n\t },\n\t sort: function(comparator) {\n\t return reify(this, sortFactory(this, comparator));\n\t },\n\t values: function() {\n\t return this.__iterator(ITERATE_VALUES);\n\t },\n\t butLast: function() {\n\t return this.slice(0, -1);\n\t },\n\t count: function(predicate, context) {\n\t return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);\n\t },\n\t countBy: function(grouper, context) {\n\t return countByFactory(this, grouper, context);\n\t },\n\t equals: function(other) {\n\t return deepEqual(this, other);\n\t },\n\t entrySeq: function() {\n\t var iterable = this;\n\t if (iterable._cache) {\n\t return new ArraySeq(iterable._cache);\n\t }\n\t var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();\n\t entriesSequence.fromEntrySeq = (function() {\n\t return iterable.toSeq();\n\t });\n\t return entriesSequence;\n\t },\n\t filterNot: function(predicate, context) {\n\t return this.filter(not(predicate), context);\n\t },\n\t findLast: function(predicate, context, notSetValue) {\n\t return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n\t },\n\t first: function() {\n\t return this.find(returnTrue);\n\t },\n\t flatMap: function(mapper, context) {\n\t return reify(this, flatMapFactory(this, mapper, context));\n\t },\n\t flatten: function(depth) {\n\t return reify(this, flattenFactory(this, depth, true));\n\t },\n\t fromEntrySeq: function() {\n\t return new FromEntriesSequence(this);\n\t },\n\t get: function(searchKey, notSetValue) {\n\t return this.find((function(_, key) {\n\t return is(key, searchKey);\n\t }), undefined, notSetValue);\n\t },\n\t getIn: function(searchKeyPath, notSetValue) {\n\t var nested = this;\n\t if (searchKeyPath) {\n\t var iter = getIterator(searchKeyPath) || getIterator($Iterable(searchKeyPath));\n\t var step;\n\t while (!(step = iter.next()).done) {\n\t var key = step.value;\n\t nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;\n\t if (nested === NOT_SET) {\n\t return notSetValue;\n\t }\n\t }\n\t }\n\t return nested;\n\t },\n\t groupBy: function(grouper, context) {\n\t return groupByFactory(this, grouper, context);\n\t },\n\t has: function(searchKey) {\n\t return this.get(searchKey, NOT_SET) !== NOT_SET;\n\t },\n\t isSubset: function(iter) {\n\t iter = typeof iter.contains === 'function' ? iter : $Iterable(iter);\n\t return this.every((function(value) {\n\t return iter.contains(value);\n\t }));\n\t },\n\t isSuperset: function(iter) {\n\t return iter.isSubset(this);\n\t },\n\t keySeq: function() {\n\t return this.toSeq().map(keyMapper).toIndexedSeq();\n\t },\n\t last: function() {\n\t return this.toSeq().reverse().first();\n\t },\n\t max: function(comparator) {\n\t return maxFactory(this, comparator);\n\t },\n\t maxBy: function(mapper, comparator) {\n\t return maxFactory(this, comparator, mapper);\n\t },\n\t min: function(comparator) {\n\t return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);\n\t },\n\t minBy: function(mapper, comparator) {\n\t return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);\n\t },\n\t rest: function() {\n\t return this.slice(1);\n\t },\n\t skip: function(amount) {\n\t return reify(this, skipFactory(this, amount, true));\n\t },\n\t skipLast: function(amount) {\n\t return reify(this, this.toSeq().reverse().skip(amount).reverse());\n\t },\n\t skipWhile: function(predicate, context) {\n\t return reify(this, skipWhileFactory(this, predicate, context, true));\n\t },\n\t skipUntil: function(predicate, context) {\n\t return this.skipWhile(not(predicate), context);\n\t },\n\t sortBy: function(mapper, comparator) {\n\t return reify(this, sortFactory(this, comparator, mapper));\n\t },\n\t take: function(amount) {\n\t return reify(this, takeFactory(this, amount));\n\t },\n\t takeLast: function(amount) {\n\t return reify(this, this.toSeq().reverse().take(amount).reverse());\n\t },\n\t takeWhile: function(predicate, context) {\n\t return reify(this, takeWhileFactory(this, predicate, context));\n\t },\n\t takeUntil: function(predicate, context) {\n\t return this.takeWhile(not(predicate), context);\n\t },\n\t valueSeq: function() {\n\t return this.toIndexedSeq();\n\t },\n\t hashCode: function() {\n\t return this.__hash || (this.__hash = hashIterable(this));\n\t }\n\t}, {});\n\tvar IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n\tvar IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n\tvar IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n\tvar IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\n\tvar IterablePrototype = Iterable.prototype;\n\tIterablePrototype[IS_ITERABLE_SENTINEL] = true;\n\tIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;\n\tIterablePrototype.toJSON = IterablePrototype.toJS;\n\tIterablePrototype.__toJS = IterablePrototype.toArray;\n\tIterablePrototype.__toStringMapper = quoteString;\n\tIterablePrototype.inspect = IterablePrototype.toSource = function() {\n\t return this.toString();\n\t};\n\tIterablePrototype.chain = IterablePrototype.flatMap;\n\t(function() {\n\t try {\n\t Object.defineProperty(IterablePrototype, 'length', {get: function() {\n\t if (!Iterable.noLengthWarning) {\n\t var stack;\n\t try {\n\t throw new Error();\n\t } catch (error) {\n\t stack = error.stack;\n\t }\n\t if (stack.indexOf('_wrapObject') === -1) {\n\t console && console.warn && console.warn('iterable.length has been deprecated, ' + 'use iterable.size or iterable.count(). ' + 'This warning will become a silent error in a future version. ' + stack);\n\t return this.size;\n\t }\n\t }\n\t }});\n\t } catch (e) {}\n\t})();\n\tvar KeyedIterable = function KeyedIterable(value) {\n\t return isKeyed(value) ? value : KeyedSeq(value);\n\t};\n\t($traceurRuntime.createClass)(KeyedIterable, {\n\t flip: function() {\n\t return reify(this, flipFactory(this));\n\t },\n\t findKey: function(predicate, context) {\n\t var foundKey;\n\t this.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t foundKey = k;\n\t return false;\n\t }\n\t }));\n\t return foundKey;\n\t },\n\t findLastKey: function(predicate, context) {\n\t return this.toSeq().reverse().findKey(predicate, context);\n\t },\n\t keyOf: function(searchValue) {\n\t return this.findKey((function(value) {\n\t return is(value, searchValue);\n\t }));\n\t },\n\t lastKeyOf: function(searchValue) {\n\t return this.toSeq().reverse().keyOf(searchValue);\n\t },\n\t mapEntries: function(mapper, context) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t return reify(this, this.toSeq().map((function(v, k) {\n\t return mapper.call(context, [k, v], iterations++, $__0);\n\t })).fromEntrySeq());\n\t },\n\t mapKeys: function(mapper, context) {\n\t var $__0 = this;\n\t return reify(this, this.toSeq().flip().map((function(k, v) {\n\t return mapper.call(context, k, v, $__0);\n\t })).flip());\n\t }\n\t}, {}, Iterable);\n\tvar KeyedIterablePrototype = KeyedIterable.prototype;\n\tKeyedIterablePrototype[IS_KEYED_SENTINEL] = true;\n\tKeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;\n\tKeyedIterablePrototype.__toJS = IterablePrototype.toObject;\n\tKeyedIterablePrototype.__toStringMapper = (function(v, k) {\n\t return k + ': ' + quoteString(v);\n\t});\n\tvar IndexedIterable = function IndexedIterable(value) {\n\t return isIndexed(value) ? value : IndexedSeq(value);\n\t};\n\t($traceurRuntime.createClass)(IndexedIterable, {\n\t toKeyedSeq: function() {\n\t return new ToKeyedSequence(this, false);\n\t },\n\t filter: function(predicate, context) {\n\t return reify(this, filterFactory(this, predicate, context, false));\n\t },\n\t findIndex: function(predicate, context) {\n\t var key = this.toKeyedSeq().findKey(predicate, context);\n\t return key === undefined ? -1 : key;\n\t },\n\t indexOf: function(searchValue) {\n\t var key = this.toKeyedSeq().keyOf(searchValue);\n\t return key === undefined ? -1 : key;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t var key = this.toKeyedSeq().lastKeyOf(searchValue);\n\t return key === undefined ? -1 : key;\n\t },\n\t reverse: function() {\n\t return reify(this, reverseFactory(this, false));\n\t },\n\t splice: function(index, removeNum) {\n\t var numArgs = arguments.length;\n\t removeNum = Math.max(removeNum | 0, 0);\n\t if (numArgs === 0 || (numArgs === 2 && !removeNum)) {\n\t return this;\n\t }\n\t index = resolveBegin(index, this.size);\n\t var spliced = this.slice(0, index);\n\t return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));\n\t },\n\t findLastIndex: function(predicate, context) {\n\t var key = this.toKeyedSeq().findLastKey(predicate, context);\n\t return key === undefined ? -1 : key;\n\t },\n\t first: function() {\n\t return this.get(0);\n\t },\n\t flatten: function(depth) {\n\t return reify(this, flattenFactory(this, depth, false));\n\t },\n\t get: function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return (index < 0 || (this.size === Infinity || (this.size !== undefined && index > this.size))) ? notSetValue : this.find((function(_, key) {\n\t return key === index;\n\t }), undefined, notSetValue);\n\t },\n\t has: function(index) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1);\n\t },\n\t interpose: function(separator) {\n\t return reify(this, interposeFactory(this, separator));\n\t },\n\t last: function() {\n\t return this.get(-1);\n\t },\n\t skip: function(amount) {\n\t var iter = this;\n\t var skipSeq = skipFactory(iter, amount, false);\n\t if (isSeq(iter) && skipSeq !== iter) {\n\t skipSeq.get = function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 ? iter.get(index + amount, notSetValue) : notSetValue;\n\t };\n\t }\n\t return reify(this, skipSeq);\n\t },\n\t skipWhile: function(predicate, context) {\n\t return reify(this, skipWhileFactory(this, predicate, context, false));\n\t },\n\t take: function(amount) {\n\t var iter = this;\n\t var takeSeq = takeFactory(iter, amount);\n\t if (isSeq(iter) && takeSeq !== iter) {\n\t takeSeq.get = function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 && index < amount ? iter.get(index, notSetValue) : notSetValue;\n\t };\n\t }\n\t return reify(this, takeSeq);\n\t }\n\t}, {}, Iterable);\n\tIndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;\n\tIndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;\n\tvar SetIterable = function SetIterable(value) {\n\t return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);\n\t};\n\t($traceurRuntime.createClass)(SetIterable, {\n\t get: function(value, notSetValue) {\n\t return this.has(value) ? value : notSetValue;\n\t },\n\t contains: function(value) {\n\t return this.has(value);\n\t },\n\t keySeq: function() {\n\t return this.valueSeq();\n\t }\n\t}, {}, Iterable);\n\tSetIterable.prototype.has = IterablePrototype.contains;\n\tfunction isIterable(maybeIterable) {\n\t return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);\n\t}\n\tfunction isKeyed(maybeKeyed) {\n\t return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);\n\t}\n\tfunction isIndexed(maybeIndexed) {\n\t return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);\n\t}\n\tfunction isAssociative(maybeAssociative) {\n\t return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n\t}\n\tfunction isOrdered(maybeOrdered) {\n\t return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);\n\t}\n\tIterable.isIterable = isIterable;\n\tIterable.isKeyed = isKeyed;\n\tIterable.isIndexed = isIndexed;\n\tIterable.isAssociative = isAssociative;\n\tIterable.isOrdered = isOrdered;\n\tIterable.Keyed = KeyedIterable;\n\tIterable.Indexed = IndexedIterable;\n\tIterable.Set = SetIterable;\n\tIterable.Iterator = Iterator;\n\tfunction keyMapper(v, k) {\n\t return k;\n\t}\n\tfunction entryMapper(v, k) {\n\t return [k, v];\n\t}\n\tfunction not(predicate) {\n\t return function() {\n\t return !predicate.apply(this, arguments);\n\t };\n\t}\n\tfunction neg(predicate) {\n\t return function() {\n\t return -predicate.apply(this, arguments);\n\t };\n\t}\n\tfunction quoteString(value) {\n\t return typeof value === 'string' ? JSON.stringify(value) : value;\n\t}\n\tfunction defaultNegComparator(a, b) {\n\t return a > b ? -1 : a < b ? 1 : 0;\n\t}\n\tfunction deepEqual(a, b) {\n\t if (a === b) {\n\t return true;\n\t }\n\t if (!isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) {\n\t return false;\n\t }\n\t if (a.size === 0 && b.size === 0) {\n\t return true;\n\t }\n\t var notAssociative = !isAssociative(a);\n\t if (isOrdered(a)) {\n\t var entries = a.entries();\n\t return b.every((function(v, k) {\n\t var entry = entries.next().value;\n\t return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));\n\t })) && entries.next().done;\n\t }\n\t var flipped = false;\n\t if (a.size === undefined) {\n\t if (b.size === undefined) {\n\t a.cacheResult();\n\t } else {\n\t flipped = true;\n\t var _ = a;\n\t a = b;\n\t b = _;\n\t }\n\t }\n\t var allEqual = true;\n\t var bSize = b.__iterate((function(v, k) {\n\t if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {\n\t allEqual = false;\n\t return false;\n\t }\n\t }));\n\t return allEqual && a.size === bSize;\n\t}\n\tfunction hashIterable(iterable) {\n\t if (iterable.size === Infinity) {\n\t return 0;\n\t }\n\t var ordered = isOrdered(iterable);\n\t var keyed = isKeyed(iterable);\n\t var h = ordered ? 1 : 0;\n\t var size = iterable.__iterate(keyed ? ordered ? (function(v, k) {\n\t h = 31 * h + hashMerge(hash(v), hash(k)) | 0;\n\t }) : (function(v, k) {\n\t h = h + hashMerge(hash(v), hash(k)) | 0;\n\t }) : ordered ? (function(v) {\n\t h = 31 * h + hash(v) | 0;\n\t }) : (function(v) {\n\t h = h + hash(v) | 0;\n\t }));\n\t return murmurHashOfSize(size, h);\n\t}\n\tfunction murmurHashOfSize(size, h) {\n\t h = imul(h, 0xCC9E2D51);\n\t h = imul(h << 15 | h >>> -15, 0x1B873593);\n\t h = imul(h << 13 | h >>> -13, 5);\n\t h = (h + 0xE6546B64 | 0) ^ size;\n\t h = imul(h ^ h >>> 16, 0x85EBCA6B);\n\t h = imul(h ^ h >>> 13, 0xC2B2AE35);\n\t h = smi(h ^ h >>> 16);\n\t return h;\n\t}\n\tfunction hashMerge(a, b) {\n\t return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0;\n\t}\n\tfunction mixin(ctor, methods) {\n\t var proto = ctor.prototype;\n\t var keyCopier = (function(key) {\n\t proto[key] = methods[key];\n\t });\n\t Object.keys(methods).forEach(keyCopier);\n\t Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n\t return ctor;\n\t}\n\tvar Seq = function Seq(value) {\n\t return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);\n\t};\n\tvar $Seq = Seq;\n\t($traceurRuntime.createClass)(Seq, {\n\t toSeq: function() {\n\t return this;\n\t },\n\t toString: function() {\n\t return this.__toString('Seq {', '}');\n\t },\n\t cacheResult: function() {\n\t if (!this._cache && this.__iterateUncached) {\n\t this._cache = this.entrySeq().toArray();\n\t this.size = this._cache.length;\n\t }\n\t return this;\n\t },\n\t __iterate: function(fn, reverse) {\n\t return seqIterate(this, fn, reverse, true);\n\t },\n\t __iterator: function(type, reverse) {\n\t return seqIterator(this, type, reverse, true);\n\t }\n\t}, {of: function() {\n\t return $Seq(arguments);\n\t }}, Iterable);\n\tvar KeyedSeq = function KeyedSeq(value) {\n\t return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : keyedSeqFromValue(value);\n\t};\n\tvar $KeyedSeq = KeyedSeq;\n\t($traceurRuntime.createClass)(KeyedSeq, {\n\t toKeyedSeq: function() {\n\t return this;\n\t },\n\t toSeq: function() {\n\t return this;\n\t }\n\t}, {of: function() {\n\t return $KeyedSeq(arguments);\n\t }}, Seq);\n\tmixin(KeyedSeq, KeyedIterable.prototype);\n\tvar IndexedSeq = function IndexedSeq(value) {\n\t return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();\n\t};\n\tvar $IndexedSeq = IndexedSeq;\n\t($traceurRuntime.createClass)(IndexedSeq, {\n\t toIndexedSeq: function() {\n\t return this;\n\t },\n\t toString: function() {\n\t return this.__toString('Seq [', ']');\n\t },\n\t __iterate: function(fn, reverse) {\n\t return seqIterate(this, fn, reverse, false);\n\t },\n\t __iterator: function(type, reverse) {\n\t return seqIterator(this, type, reverse, false);\n\t }\n\t}, {of: function() {\n\t return $IndexedSeq(arguments);\n\t }}, Seq);\n\tmixin(IndexedSeq, IndexedIterable.prototype);\n\tvar SetSeq = function SetSeq(value) {\n\t return (value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value).toSetSeq();\n\t};\n\tvar $SetSeq = SetSeq;\n\t($traceurRuntime.createClass)(SetSeq, {toSetSeq: function() {\n\t return this;\n\t }}, {of: function() {\n\t return $SetSeq(arguments);\n\t }}, Seq);\n\tmixin(SetSeq, SetIterable.prototype);\n\tSeq.isSeq = isSeq;\n\tSeq.Keyed = KeyedSeq;\n\tSeq.Set = SetSeq;\n\tSeq.Indexed = IndexedSeq;\n\tvar IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\n\tSeq.prototype[IS_SEQ_SENTINEL] = true;\n\tvar ArraySeq = function ArraySeq(array) {\n\t this._array = array;\n\t this.size = array.length;\n\t};\n\t($traceurRuntime.createClass)(ArraySeq, {\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var array = this._array;\n\t var maxIndex = array.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var array = this._array;\n\t var maxIndex = array.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar ObjectSeq = function ObjectSeq(object) {\n\t var keys = Object.keys(object);\n\t this._object = object;\n\t this._keys = keys;\n\t this.size = keys.length;\n\t};\n\t($traceurRuntime.createClass)(ObjectSeq, {\n\t get: function(key, notSetValue) {\n\t if (notSetValue !== undefined && !this.has(key)) {\n\t return notSetValue;\n\t }\n\t return this._object[key];\n\t },\n\t has: function(key) {\n\t return this._object.hasOwnProperty(key);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var object = this._object;\n\t var keys = this._keys;\n\t var maxIndex = keys.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t var key = keys[reverse ? maxIndex - ii : ii];\n\t if (fn(object[key], key, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var object = this._object;\n\t var keys = this._keys;\n\t var maxIndex = keys.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var key = keys[reverse ? maxIndex - ii : ii];\n\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;\n\tvar IterableSeq = function IterableSeq(iterable) {\n\t this._iterable = iterable;\n\t this.size = iterable.length || iterable.size;\n\t};\n\t($traceurRuntime.createClass)(IterableSeq, {\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterable = this._iterable;\n\t var iterator = getIterator(iterable);\n\t var iterations = 0;\n\t if (isIterator(iterator)) {\n\t var step;\n\t while (!(step = iterator.next()).done) {\n\t if (fn(step.value, iterations++, this) === false) {\n\t break;\n\t }\n\t }\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterable = this._iterable;\n\t var iterator = getIterator(iterable);\n\t if (!isIterator(iterator)) {\n\t return new Iterator(iteratorDone);\n\t }\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, iterations++, step.value);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar IteratorSeq = function IteratorSeq(iterator) {\n\t this._iterator = iterator;\n\t this._iteratorCache = [];\n\t};\n\t($traceurRuntime.createClass)(IteratorSeq, {\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterator = this._iterator;\n\t var cache = this._iteratorCache;\n\t var iterations = 0;\n\t while (iterations < cache.length) {\n\t if (fn(cache[iterations], iterations++, this) === false) {\n\t return iterations;\n\t }\n\t }\n\t var step;\n\t while (!(step = iterator.next()).done) {\n\t var val = step.value;\n\t cache[iterations] = val;\n\t if (fn(val, iterations++, this) === false) {\n\t break;\n\t }\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = this._iterator;\n\t var cache = this._iteratorCache;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t if (iterations >= cache.length) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t cache[iterations] = step.value;\n\t }\n\t return iteratorValue(type, iterations, cache[iterations++]);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tfunction isSeq(maybeSeq) {\n\t return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);\n\t}\n\tvar EMPTY_SEQ;\n\tfunction emptySequence() {\n\t return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n\t}\n\tfunction keyedSeqFromValue(value) {\n\t var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined;\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of [k, v] entries, ' + 'or keyed object: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction indexedSeqFromValue(value) {\n\t var seq = maybeIndexedSeqFromValue(value);\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of values: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction seqFromValue(value) {\n\t var seq = maybeIndexedSeqFromValue(value) || (typeof value === 'object' && new ObjectSeq(value));\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of values, or keyed object: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction maybeIndexedSeqFromValue(value) {\n\t return (isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined);\n\t}\n\tfunction isArrayLike(value) {\n\t return value && typeof value.length === 'number';\n\t}\n\tfunction seqIterate(seq, fn, reverse, useKeys) {\n\t assertNotInfinite(seq.size);\n\t var cache = seq._cache;\n\t if (cache) {\n\t var maxIndex = cache.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t }\n\t return seq.__iterateUncached(fn, reverse);\n\t}\n\tfunction seqIterator(seq, type, reverse, useKeys) {\n\t var cache = seq._cache;\n\t if (cache) {\n\t var maxIndex = cache.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n\t }));\n\t }\n\t return seq.__iteratorUncached(type, reverse);\n\t}\n\tfunction fromJS(json, converter) {\n\t return converter ? _fromJSWith(converter, json, '', {'': json}) : _fromJSDefault(json);\n\t}\n\tfunction _fromJSWith(converter, json, key, parentJSON) {\n\t if (Array.isArray(json)) {\n\t return converter.call(parentJSON, key, IndexedSeq(json).map((function(v, k) {\n\t return _fromJSWith(converter, v, k, json);\n\t })));\n\t }\n\t if (isPlainObj(json)) {\n\t return converter.call(parentJSON, key, KeyedSeq(json).map((function(v, k) {\n\t return _fromJSWith(converter, v, k, json);\n\t })));\n\t }\n\t return json;\n\t}\n\tfunction _fromJSDefault(json) {\n\t if (Array.isArray(json)) {\n\t return IndexedSeq(json).map(_fromJSDefault).toList();\n\t }\n\t if (isPlainObj(json)) {\n\t return KeyedSeq(json).map(_fromJSDefault).toMap();\n\t }\n\t return json;\n\t}\n\tfunction isPlainObj(value) {\n\t return value && value.constructor === Object;\n\t}\n\tvar Collection = function Collection() {\n\t throw TypeError('Abstract');\n\t};\n\t($traceurRuntime.createClass)(Collection, {}, {}, Iterable);\n\tvar KeyedCollection = function KeyedCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $KeyedCollection.prototype, arguments);\n\t};\n\tvar $KeyedCollection = KeyedCollection;\n\t($traceurRuntime.createClass)(KeyedCollection, {}, {}, Collection);\n\tmixin(KeyedCollection, KeyedIterable.prototype);\n\tvar IndexedCollection = function IndexedCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $IndexedCollection.prototype, arguments);\n\t};\n\tvar $IndexedCollection = IndexedCollection;\n\t($traceurRuntime.createClass)(IndexedCollection, {}, {}, Collection);\n\tmixin(IndexedCollection, IndexedIterable.prototype);\n\tvar SetCollection = function SetCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $SetCollection.prototype, arguments);\n\t};\n\tvar $SetCollection = SetCollection;\n\t($traceurRuntime.createClass)(SetCollection, {}, {}, Collection);\n\tmixin(SetCollection, SetIterable.prototype);\n\tCollection.Keyed = KeyedCollection;\n\tCollection.Indexed = IndexedCollection;\n\tCollection.Set = SetCollection;\n\tvar Map = function Map(value) {\n\t return value === null || value === undefined ? emptyMap() : isMap(value) ? value : emptyMap().withMutations((function(map) {\n\t KeyedIterable(value).forEach((function(v, k) {\n\t return map.set(k, v);\n\t }));\n\t }));\n\t};\n\t($traceurRuntime.createClass)(Map, {\n\t toString: function() {\n\t return this.__toString('Map {', '}');\n\t },\n\t get: function(k, notSetValue) {\n\t return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue;\n\t },\n\t set: function(k, v) {\n\t return updateMap(this, k, v);\n\t },\n\t setIn: function(keyPath, v) {\n\t return this.updateIn(keyPath, (function() {\n\t return v;\n\t }));\n\t },\n\t remove: function(k) {\n\t return updateMap(this, k, NOT_SET);\n\t },\n\t removeIn: function(keyPath) {\n\t return this.updateIn(keyPath, (function() {\n\t return NOT_SET;\n\t }));\n\t },\n\t update: function(k, notSetValue, updater) {\n\t return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater);\n\t },\n\t updateIn: function(keyPath, notSetValue, updater) {\n\t if (!updater) {\n\t updater = notSetValue;\n\t notSetValue = undefined;\n\t }\n\t var updatedValue = updateInDeepMap(this, getIterator(keyPath) || getIterator(Iterable(keyPath)), notSetValue, updater);\n\t return updatedValue === NOT_SET ? undefined : updatedValue;\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._root = null;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyMap();\n\t },\n\t merge: function() {\n\t return mergeIntoMapWith(this, undefined, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__3 = 1; $__3 < arguments.length; $__3++)\n\t iters[$__3 - 1] = arguments[$__3];\n\t return mergeIntoMapWith(this, merger, iters);\n\t },\n\t mergeIn: function(keyPath) {\n\t for (var iters = [],\n\t $__4 = 1; $__4 < arguments.length; $__4++)\n\t iters[$__4 - 1] = arguments[$__4];\n\t return this.updateIn(keyPath, emptyMap(), (function(m) {\n\t return m.merge.apply(m, iters);\n\t }));\n\t },\n\t mergeDeep: function() {\n\t return mergeIntoMapWith(this, deepMerger(undefined), arguments);\n\t },\n\t mergeDeepWith: function(merger) {\n\t for (var iters = [],\n\t $__5 = 1; $__5 < arguments.length; $__5++)\n\t iters[$__5 - 1] = arguments[$__5];\n\t return mergeIntoMapWith(this, deepMerger(merger), iters);\n\t },\n\t mergeDeepIn: function(keyPath) {\n\t for (var iters = [],\n\t $__6 = 1; $__6 < arguments.length; $__6++)\n\t iters[$__6 - 1] = arguments[$__6];\n\t return this.updateIn(keyPath, emptyMap(), (function(m) {\n\t return m.mergeDeep.apply(m, iters);\n\t }));\n\t },\n\t sort: function(comparator) {\n\t return OrderedMap(sortFactory(this, comparator));\n\t },\n\t sortBy: function(mapper, comparator) {\n\t return OrderedMap(sortFactory(this, comparator, mapper));\n\t },\n\t withMutations: function(fn) {\n\t var mutable = this.asMutable();\n\t fn(mutable);\n\t return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n\t },\n\t asMutable: function() {\n\t return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n\t },\n\t asImmutable: function() {\n\t return this.__ensureOwner();\n\t },\n\t wasAltered: function() {\n\t return this.__altered;\n\t },\n\t __iterator: function(type, reverse) {\n\t return new MapIterator(this, type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t this._root && this._root.iterate((function(entry) {\n\t iterations++;\n\t return fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t return iterations;\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this.__altered = false;\n\t return this;\n\t }\n\t return makeMap(this.size, this._root, ownerID, this.__hash);\n\t }\n\t}, {}, KeyedCollection);\n\tfunction isMap(maybeMap) {\n\t return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);\n\t}\n\tMap.isMap = isMap;\n\tvar IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\n\tvar MapPrototype = Map.prototype;\n\tMapPrototype[IS_MAP_SENTINEL] = true;\n\tMapPrototype[DELETE] = MapPrototype.remove;\n\tvar ArrayMapNode = function ArrayMapNode(ownerID, entries) {\n\t this.ownerID = ownerID;\n\t this.entries = entries;\n\t};\n\tvar $ArrayMapNode = ArrayMapNode;\n\t($traceurRuntime.createClass)(ArrayMapNode, {\n\t get: function(shift, keyHash, key, notSetValue) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t len = entries.length; ii < len; ii++) {\n\t if (is(key, entries[ii][0])) {\n\t return entries[ii][1];\n\t }\n\t }\n\t return notSetValue;\n\t },\n\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t var removed = value === NOT_SET;\n\t var entries = this.entries;\n\t var idx = 0;\n\t for (var len = entries.length; idx < len; idx++) {\n\t if (is(key, entries[idx][0])) {\n\t break;\n\t }\n\t }\n\t var exists = idx < len;\n\t if (exists ? entries[idx][1] === value : removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t (removed || !exists) && SetRef(didChangeSize);\n\t if (removed && entries.length === 1) {\n\t return;\n\t }\n\t if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {\n\t return createNodes(ownerID, entries, key, value);\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t if (exists) {\n\t if (removed) {\n\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t } else {\n\t newEntries[idx] = [key, value];\n\t }\n\t } else {\n\t newEntries.push([key, value]);\n\t }\n\t if (isEditable) {\n\t this.entries = newEntries;\n\t return this;\n\t }\n\t return new $ArrayMapNode(ownerID, newEntries);\n\t }\n\t}, {});\n\tvar BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) {\n\t this.ownerID = ownerID;\n\t this.bitmap = bitmap;\n\t this.nodes = nodes;\n\t};\n\tvar $BitmapIndexedNode = BitmapIndexedNode;\n\t($traceurRuntime.createClass)(BitmapIndexedNode, {\n\t get: function(shift, keyHash, key, notSetValue) {\n\t if (keyHash === undefined) {\n\t keyHash = hash(key);\n\t }\n\t var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));\n\t var bitmap = this.bitmap;\n\t return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);\n\t },\n\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t if (keyHash === undefined) {\n\t keyHash = hash(key);\n\t }\n\t var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t var bit = 1 << keyHashFrag;\n\t var bitmap = this.bitmap;\n\t var exists = (bitmap & bit) !== 0;\n\t if (!exists && value === NOT_SET) {\n\t return this;\n\t }\n\t var idx = popCount(bitmap & (bit - 1));\n\t var nodes = this.nodes;\n\t var node = exists ? nodes[idx] : undefined;\n\t var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\t if (newNode === node) {\n\t return this;\n\t }\n\t if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {\n\t return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);\n\t }\n\t if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n\t return nodes[idx ^ 1];\n\t }\n\t if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n\t return newNode;\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n\t var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);\n\t if (isEditable) {\n\t this.bitmap = newBitmap;\n\t this.nodes = newNodes;\n\t return this;\n\t }\n\t return new $BitmapIndexedNode(ownerID, newBitmap, newNodes);\n\t }\n\t}, {});\n\tvar HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) {\n\t this.ownerID = ownerID;\n\t this.count = count;\n\t this.nodes = nodes;\n\t};\n\tvar $HashArrayMapNode = HashArrayMapNode;\n\t($traceurRuntime.createClass)(HashArrayMapNode, {\n\t get: function(shift, keyHash, key, notSetValue) {\n\t if (keyHash === undefined) {\n\t keyHash = hash(key);\n\t }\n\t var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t var node = this.nodes[idx];\n\t return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;\n\t },\n\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t if (keyHash === undefined) {\n\t keyHash = hash(key);\n\t }\n\t var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t var removed = value === NOT_SET;\n\t var nodes = this.nodes;\n\t var node = nodes[idx];\n\t if (removed && !node) {\n\t return this;\n\t }\n\t var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\t if (newNode === node) {\n\t return this;\n\t }\n\t var newCount = this.count;\n\t if (!node) {\n\t newCount++;\n\t } else if (!newNode) {\n\t newCount--;\n\t if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {\n\t return packNodes(ownerID, nodes, newCount, idx);\n\t }\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newNodes = setIn(nodes, idx, newNode, isEditable);\n\t if (isEditable) {\n\t this.count = newCount;\n\t this.nodes = newNodes;\n\t return this;\n\t }\n\t return new $HashArrayMapNode(ownerID, newCount, newNodes);\n\t }\n\t}, {});\n\tvar HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) {\n\t this.ownerID = ownerID;\n\t this.keyHash = keyHash;\n\t this.entries = entries;\n\t};\n\tvar $HashCollisionNode = HashCollisionNode;\n\t($traceurRuntime.createClass)(HashCollisionNode, {\n\t get: function(shift, keyHash, key, notSetValue) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t len = entries.length; ii < len; ii++) {\n\t if (is(key, entries[ii][0])) {\n\t return entries[ii][1];\n\t }\n\t }\n\t return notSetValue;\n\t },\n\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t if (keyHash === undefined) {\n\t keyHash = hash(key);\n\t }\n\t var removed = value === NOT_SET;\n\t if (keyHash !== this.keyHash) {\n\t if (removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t SetRef(didChangeSize);\n\t return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);\n\t }\n\t var entries = this.entries;\n\t var idx = 0;\n\t for (var len = entries.length; idx < len; idx++) {\n\t if (is(key, entries[idx][0])) {\n\t break;\n\t }\n\t }\n\t var exists = idx < len;\n\t if (exists ? entries[idx][1] === value : removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t (removed || !exists) && SetRef(didChangeSize);\n\t if (removed && len === 2) {\n\t return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t if (exists) {\n\t if (removed) {\n\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t } else {\n\t newEntries[idx] = [key, value];\n\t }\n\t } else {\n\t newEntries.push([key, value]);\n\t }\n\t if (isEditable) {\n\t this.entries = newEntries;\n\t return this;\n\t }\n\t return new $HashCollisionNode(ownerID, this.keyHash, newEntries);\n\t }\n\t}, {});\n\tvar ValueNode = function ValueNode(ownerID, keyHash, entry) {\n\t this.ownerID = ownerID;\n\t this.keyHash = keyHash;\n\t this.entry = entry;\n\t};\n\tvar $ValueNode = ValueNode;\n\t($traceurRuntime.createClass)(ValueNode, {\n\t get: function(shift, keyHash, key, notSetValue) {\n\t return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n\t },\n\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t var removed = value === NOT_SET;\n\t var keyMatch = is(key, this.entry[0]);\n\t if (keyMatch ? value === this.entry[1] : removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t if (removed) {\n\t SetRef(didChangeSize);\n\t return;\n\t }\n\t if (keyMatch) {\n\t if (ownerID && ownerID === this.ownerID) {\n\t this.entry[1] = value;\n\t return this;\n\t }\n\t return new $ValueNode(ownerID, this.keyHash, [key, value]);\n\t }\n\t SetRef(didChangeSize);\n\t return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);\n\t }\n\t}, {});\n\tArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function(fn, reverse) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n\t if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n\t return false;\n\t }\n\t }\n\t};\n\tBitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function(fn, reverse) {\n\t var nodes = this.nodes;\n\t for (var ii = 0,\n\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t var node = nodes[reverse ? maxIndex - ii : ii];\n\t if (node && node.iterate(fn, reverse) === false) {\n\t return false;\n\t }\n\t }\n\t};\n\tValueNode.prototype.iterate = function(fn, reverse) {\n\t return fn(this.entry);\n\t};\n\tvar MapIterator = function MapIterator(map, type, reverse) {\n\t this._type = type;\n\t this._reverse = reverse;\n\t this._stack = map._root && mapIteratorFrame(map._root);\n\t};\n\t($traceurRuntime.createClass)(MapIterator, {next: function() {\n\t var type = this._type;\n\t var stack = this._stack;\n\t while (stack) {\n\t var node = stack.node;\n\t var index = stack.index++;\n\t var maxIndex;\n\t if (node.entry) {\n\t if (index === 0) {\n\t return mapIteratorValue(type, node.entry);\n\t }\n\t } else if (node.entries) {\n\t maxIndex = node.entries.length - 1;\n\t if (index <= maxIndex) {\n\t return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n\t }\n\t } else {\n\t maxIndex = node.nodes.length - 1;\n\t if (index <= maxIndex) {\n\t var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n\t if (subNode) {\n\t if (subNode.entry) {\n\t return mapIteratorValue(type, subNode.entry);\n\t }\n\t stack = this._stack = mapIteratorFrame(subNode, stack);\n\t }\n\t continue;\n\t }\n\t }\n\t stack = this._stack = this._stack.__prev;\n\t }\n\t return iteratorDone();\n\t }}, {}, Iterator);\n\tfunction mapIteratorValue(type, entry) {\n\t return iteratorValue(type, entry[0], entry[1]);\n\t}\n\tfunction mapIteratorFrame(node, prev) {\n\t return {\n\t node: node,\n\t index: 0,\n\t __prev: prev\n\t };\n\t}\n\tfunction makeMap(size, root, ownerID, hash) {\n\t var map = Object.create(MapPrototype);\n\t map.size = size;\n\t map._root = root;\n\t map.__ownerID = ownerID;\n\t map.__hash = hash;\n\t map.__altered = false;\n\t return map;\n\t}\n\tvar EMPTY_MAP;\n\tfunction emptyMap() {\n\t return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n\t}\n\tfunction updateMap(map, k, v) {\n\t var newRoot;\n\t var newSize;\n\t if (!map._root) {\n\t if (v === NOT_SET) {\n\t return map;\n\t }\n\t newSize = 1;\n\t newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);\n\t } else {\n\t var didChangeSize = MakeRef(CHANGE_LENGTH);\n\t var didAlter = MakeRef(DID_ALTER);\n\t newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);\n\t if (!didAlter.value) {\n\t return map;\n\t }\n\t newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n\t }\n\t if (map.__ownerID) {\n\t map.size = newSize;\n\t map._root = newRoot;\n\t map.__hash = undefined;\n\t map.__altered = true;\n\t return map;\n\t }\n\t return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n\t}\n\tfunction updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t if (!node) {\n\t if (value === NOT_SET) {\n\t return node;\n\t }\n\t SetRef(didAlter);\n\t SetRef(didChangeSize);\n\t return new ValueNode(ownerID, keyHash, [key, value]);\n\t }\n\t return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);\n\t}\n\tfunction isLeafNode(node) {\n\t return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n\t}\n\tfunction mergeIntoNode(node, ownerID, shift, keyHash, entry) {\n\t if (node.keyHash === keyHash) {\n\t return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);\n\t }\n\t var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;\n\t var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t var newNode;\n\t var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n\t return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);\n\t}\n\tfunction createNodes(ownerID, entries, key, value) {\n\t if (!ownerID) {\n\t ownerID = new OwnerID();\n\t }\n\t var node = new ValueNode(ownerID, hash(key), [key, value]);\n\t for (var ii = 0; ii < entries.length; ii++) {\n\t var entry = entries[ii];\n\t node = node.update(ownerID, 0, undefined, entry[0], entry[1]);\n\t }\n\t return node;\n\t}\n\tfunction packNodes(ownerID, nodes, count, excluding) {\n\t var bitmap = 0;\n\t var packedII = 0;\n\t var packedNodes = new Array(count);\n\t for (var ii = 0,\n\t bit = 1,\n\t len = nodes.length; ii < len; ii++, bit <<= 1) {\n\t var node = nodes[ii];\n\t if (node !== undefined && ii !== excluding) {\n\t bitmap |= bit;\n\t packedNodes[packedII++] = node;\n\t }\n\t }\n\t return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n\t}\n\tfunction expandNodes(ownerID, nodes, bitmap, including, node) {\n\t var count = 0;\n\t var expandedNodes = new Array(SIZE);\n\t for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n\t expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n\t }\n\t expandedNodes[including] = node;\n\t return new HashArrayMapNode(ownerID, count + 1, expandedNodes);\n\t}\n\tfunction mergeIntoMapWith(map, merger, iterables) {\n\t var iters = [];\n\t for (var ii = 0; ii < iterables.length; ii++) {\n\t var value = iterables[ii];\n\t var iter = KeyedIterable(value);\n\t if (!isIterable(value)) {\n\t iter = iter.map((function(v) {\n\t return fromJS(v);\n\t }));\n\t }\n\t iters.push(iter);\n\t }\n\t return mergeIntoCollectionWith(map, merger, iters);\n\t}\n\tfunction deepMerger(merger) {\n\t return (function(existing, value) {\n\t return existing && existing.mergeDeepWith && isIterable(value) ? existing.mergeDeepWith(merger, value) : merger ? merger(existing, value) : value;\n\t });\n\t}\n\tfunction mergeIntoCollectionWith(collection, merger, iters) {\n\t iters = iters.filter((function(x) {\n\t return x.size !== 0;\n\t }));\n\t if (iters.length === 0) {\n\t return collection;\n\t }\n\t if (collection.size === 0 && iters.length === 1) {\n\t return collection.constructor(iters[0]);\n\t }\n\t return collection.withMutations((function(collection) {\n\t var mergeIntoMap = merger ? (function(value, key) {\n\t collection.update(key, NOT_SET, (function(existing) {\n\t return existing === NOT_SET ? value : merger(existing, value);\n\t }));\n\t }) : (function(value, key) {\n\t collection.set(key, value);\n\t });\n\t for (var ii = 0; ii < iters.length; ii++) {\n\t iters[ii].forEach(mergeIntoMap);\n\t }\n\t }));\n\t}\n\tfunction updateInDeepMap(existing, keyPathIter, notSetValue, updater) {\n\t var isNotSet = existing === NOT_SET;\n\t var step = keyPathIter.next();\n\t if (step.done) {\n\t var existingValue = isNotSet ? notSetValue : existing;\n\t var newValue = updater(existingValue);\n\t return newValue === existingValue ? existing : newValue;\n\t }\n\t invariant(isNotSet || (existing && existing.set), 'invalid keyPath');\n\t var key = step.value;\n\t var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);\n\t var nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater);\n\t return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated);\n\t}\n\tfunction popCount(x) {\n\t x = x - ((x >> 1) & 0x55555555);\n\t x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n\t x = (x + (x >> 4)) & 0x0f0f0f0f;\n\t x = x + (x >> 8);\n\t x = x + (x >> 16);\n\t return x & 0x7f;\n\t}\n\tfunction setIn(array, idx, val, canEdit) {\n\t var newArray = canEdit ? array : arrCopy(array);\n\t newArray[idx] = val;\n\t return newArray;\n\t}\n\tfunction spliceIn(array, idx, val, canEdit) {\n\t var newLen = array.length + 1;\n\t if (canEdit && idx + 1 === newLen) {\n\t array[idx] = val;\n\t return array;\n\t }\n\t var newArray = new Array(newLen);\n\t var after = 0;\n\t for (var ii = 0; ii < newLen; ii++) {\n\t if (ii === idx) {\n\t newArray[ii] = val;\n\t after = -1;\n\t } else {\n\t newArray[ii] = array[ii + after];\n\t }\n\t }\n\t return newArray;\n\t}\n\tfunction spliceOut(array, idx, canEdit) {\n\t var newLen = array.length - 1;\n\t if (canEdit && idx === newLen) {\n\t array.pop();\n\t return array;\n\t }\n\t var newArray = new Array(newLen);\n\t var after = 0;\n\t for (var ii = 0; ii < newLen; ii++) {\n\t if (ii === idx) {\n\t after = 1;\n\t }\n\t newArray[ii] = array[ii + after];\n\t }\n\t return newArray;\n\t}\n\tvar MAX_ARRAY_MAP_SIZE = SIZE / 4;\n\tvar MAX_BITMAP_INDEXED_SIZE = SIZE / 2;\n\tvar MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;\n\tvar ToKeyedSequence = function ToKeyedSequence(indexed, useKeys) {\n\t this._iter = indexed;\n\t this._useKeys = useKeys;\n\t this.size = indexed.size;\n\t};\n\t($traceurRuntime.createClass)(ToKeyedSequence, {\n\t get: function(key, notSetValue) {\n\t return this._iter.get(key, notSetValue);\n\t },\n\t has: function(key) {\n\t return this._iter.has(key);\n\t },\n\t valueSeq: function() {\n\t return this._iter.valueSeq();\n\t },\n\t reverse: function() {\n\t var $__0 = this;\n\t var reversedSequence = reverseFactory(this, true);\n\t if (!this._useKeys) {\n\t reversedSequence.valueSeq = (function() {\n\t return $__0._iter.toSeq().reverse();\n\t });\n\t }\n\t return reversedSequence;\n\t },\n\t map: function(mapper, context) {\n\t var $__0 = this;\n\t var mappedSequence = mapFactory(this, mapper, context);\n\t if (!this._useKeys) {\n\t mappedSequence.valueSeq = (function() {\n\t return $__0._iter.toSeq().map(mapper, context);\n\t });\n\t }\n\t return mappedSequence;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var ii;\n\t return this._iter.__iterate(this._useKeys ? (function(v, k) {\n\t return fn(v, k, $__0);\n\t }) : ((ii = reverse ? resolveSize(this) : 0), (function(v) {\n\t return fn(v, reverse ? --ii : ii++, $__0);\n\t })), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t if (this._useKeys) {\n\t return this._iter.__iterator(type, reverse);\n\t }\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t var ii = reverse ? resolveSize(this) : 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;\n\tvar ToIndexedSequence = function ToIndexedSequence(iter) {\n\t this._iter = iter;\n\t this.size = iter.size;\n\t};\n\t($traceurRuntime.createClass)(ToIndexedSequence, {\n\t contains: function(value) {\n\t return this._iter.contains(value);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t return this._iter.__iterate((function(v) {\n\t return fn(v, iterations++, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, iterations++, step.value, step);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar ToSetSequence = function ToSetSequence(iter) {\n\t this._iter = iter;\n\t this.size = iter.size;\n\t};\n\t($traceurRuntime.createClass)(ToSetSequence, {\n\t has: function(key) {\n\t return this._iter.contains(key);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._iter.__iterate((function(v) {\n\t return fn(v, v, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, step.value, step.value, step);\n\t }));\n\t }\n\t}, {}, SetSeq);\n\tvar FromEntriesSequence = function FromEntriesSequence(entries) {\n\t this._iter = entries;\n\t this.size = entries.size;\n\t};\n\t($traceurRuntime.createClass)(FromEntriesSequence, {\n\t entrySeq: function() {\n\t return this._iter.toSeq();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._iter.__iterate((function(entry) {\n\t if (entry) {\n\t validateEntry(entry);\n\t return fn(entry[1], entry[0], $__0);\n\t }\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t return new Iterator((function() {\n\t while (true) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t if (entry) {\n\t validateEntry(entry);\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, entry[0], entry[1], step);\n\t }\n\t }\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;\n\tfunction flipFactory(iterable) {\n\t var flipSequence = makeSequence(iterable);\n\t flipSequence._iter = iterable;\n\t flipSequence.size = iterable.size;\n\t flipSequence.flip = (function() {\n\t return iterable;\n\t });\n\t flipSequence.reverse = function() {\n\t var reversedSequence = iterable.reverse.apply(this);\n\t reversedSequence.flip = (function() {\n\t return iterable.reverse();\n\t });\n\t return reversedSequence;\n\t };\n\t flipSequence.has = (function(key) {\n\t return iterable.contains(key);\n\t });\n\t flipSequence.contains = (function(key) {\n\t return iterable.has(key);\n\t });\n\t flipSequence.cacheResult = cacheResultThrough;\n\t flipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k) {\n\t return fn(k, v, $__0) !== false;\n\t }), reverse);\n\t };\n\t flipSequence.__iteratorUncached = function(type, reverse) {\n\t if (type === ITERATE_ENTRIES) {\n\t var iterator = iterable.__iterator(type, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t if (!step.done) {\n\t var k = step.value[0];\n\t step.value[0] = step.value[1];\n\t step.value[1] = k;\n\t }\n\t return step;\n\t }));\n\t }\n\t return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);\n\t };\n\t return flipSequence;\n\t}\n\tfunction mapFactory(iterable, mapper, context) {\n\t var mappedSequence = makeSequence(iterable);\n\t mappedSequence.size = iterable.size;\n\t mappedSequence.has = (function(key) {\n\t return iterable.has(key);\n\t });\n\t mappedSequence.get = (function(key, notSetValue) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);\n\t });\n\t mappedSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k, c) {\n\t return fn(mapper.call(context, v, k, c), k, $__0) !== false;\n\t }), reverse);\n\t };\n\t mappedSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var key = entry[0];\n\t return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);\n\t }));\n\t };\n\t return mappedSequence;\n\t}\n\tfunction reverseFactory(iterable, useKeys) {\n\t var reversedSequence = makeSequence(iterable);\n\t reversedSequence._iter = iterable;\n\t reversedSequence.size = iterable.size;\n\t reversedSequence.reverse = (function() {\n\t return iterable;\n\t });\n\t if (iterable.flip) {\n\t reversedSequence.flip = function() {\n\t var flipSequence = flipFactory(iterable);\n\t flipSequence.reverse = (function() {\n\t return iterable.flip();\n\t });\n\t return flipSequence;\n\t };\n\t }\n\t reversedSequence.get = (function(key, notSetValue) {\n\t return iterable.get(useKeys ? key : -1 - key, notSetValue);\n\t });\n\t reversedSequence.has = (function(key) {\n\t return iterable.has(useKeys ? key : -1 - key);\n\t });\n\t reversedSequence.contains = (function(value) {\n\t return iterable.contains(value);\n\t });\n\t reversedSequence.cacheResult = cacheResultThrough;\n\t reversedSequence.__iterate = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k) {\n\t return fn(v, k, $__0);\n\t }), !reverse);\n\t };\n\t reversedSequence.__iterator = (function(type, reverse) {\n\t return iterable.__iterator(type, !reverse);\n\t });\n\t return reversedSequence;\n\t}\n\tfunction filterFactory(iterable, predicate, context, useKeys) {\n\t var filterSequence = makeSequence(iterable);\n\t if (useKeys) {\n\t filterSequence.has = (function(key) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v !== NOT_SET && !!predicate.call(context, v, key, iterable);\n\t });\n\t filterSequence.get = (function(key, notSetValue) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;\n\t });\n\t }\n\t filterSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }), reverse);\n\t return iterations;\n\t };\n\t filterSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (true) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var key = entry[0];\n\t var value = entry[1];\n\t if (predicate.call(context, value, key, iterable)) {\n\t return iteratorValue(type, useKeys ? key : iterations++, value, step);\n\t }\n\t }\n\t }));\n\t };\n\t return filterSequence;\n\t}\n\tfunction countByFactory(iterable, grouper, context) {\n\t var groups = Map().asMutable();\n\t iterable.__iterate((function(v, k) {\n\t groups.update(grouper.call(context, v, k, iterable), 0, (function(a) {\n\t return a + 1;\n\t }));\n\t }));\n\t return groups.asImmutable();\n\t}\n\tfunction groupByFactory(iterable, grouper, context) {\n\t var isKeyedIter = isKeyed(iterable);\n\t var groups = Map().asMutable();\n\t iterable.__iterate((function(v, k) {\n\t groups.update(grouper.call(context, v, k, iterable), (function(a) {\n\t return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a);\n\t }));\n\t }));\n\t var coerce = iterableClass(iterable);\n\t return groups.map((function(arr) {\n\t return reify(iterable, coerce(arr));\n\t }));\n\t}\n\tfunction takeFactory(iterable, amount) {\n\t if (amount > iterable.size) {\n\t return iterable;\n\t }\n\t if (amount < 0) {\n\t amount = 0;\n\t }\n\t var takeSequence = makeSequence(iterable);\n\t takeSequence.size = iterable.size && Math.min(iterable.size, amount);\n\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (amount === 0) {\n\t return 0;\n\t }\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t return ++iterations && fn(v, k, $__0) !== false && iterations < amount;\n\t }));\n\t return iterations;\n\t };\n\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = amount && iterable.__iterator(type, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t if (iterations++ > amount) {\n\t return iteratorDone();\n\t }\n\t return iterator.next();\n\t }));\n\t };\n\t return takeSequence;\n\t}\n\tfunction takeWhileFactory(iterable, predicate, context) {\n\t var takeSequence = makeSequence(iterable);\n\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t return predicate.call(context, v, k, c) && ++iterations && fn(v, k, $__0);\n\t }));\n\t return iterations;\n\t };\n\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var iterating = true;\n\t return new Iterator((function() {\n\t if (!iterating) {\n\t return iteratorDone();\n\t }\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var k = entry[0];\n\t var v = entry[1];\n\t if (!predicate.call(context, v, k, $__0)) {\n\t iterating = false;\n\t return iteratorDone();\n\t }\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t }));\n\t };\n\t return takeSequence;\n\t}\n\tfunction skipFactory(iterable, amount, useKeys) {\n\t if (amount <= 0) {\n\t return iterable;\n\t }\n\t var skipSequence = makeSequence(iterable);\n\t skipSequence.size = iterable.size && Math.max(0, iterable.size - amount);\n\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var skipped = 0;\n\t var isSkipping = true;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t if (!(isSkipping && (isSkipping = skipped++ < amount))) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }));\n\t return iterations;\n\t };\n\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = amount && iterable.__iterator(type, reverse);\n\t var skipped = 0;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (skipped < amount) {\n\t skipped++;\n\t iterator.next();\n\t }\n\t var step = iterator.next();\n\t if (useKeys || type === ITERATE_VALUES) {\n\t return step;\n\t } else if (type === ITERATE_KEYS) {\n\t return iteratorValue(type, iterations++, undefined, step);\n\t } else {\n\t return iteratorValue(type, iterations++, step.value[1], step);\n\t }\n\t }));\n\t };\n\t return skipSequence;\n\t}\n\tfunction skipWhileFactory(iterable, predicate, context, useKeys) {\n\t var skipSequence = makeSequence(iterable);\n\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var isSkipping = true;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }));\n\t return iterations;\n\t };\n\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var skipping = true;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step,\n\t k,\n\t v;\n\t do {\n\t step = iterator.next();\n\t if (step.done) {\n\t if (useKeys || type === ITERATE_VALUES) {\n\t return step;\n\t } else if (type === ITERATE_KEYS) {\n\t return iteratorValue(type, iterations++, undefined, step);\n\t } else {\n\t return iteratorValue(type, iterations++, step.value[1], step);\n\t }\n\t }\n\t var entry = step.value;\n\t k = entry[0];\n\t v = entry[1];\n\t skipping && (skipping = predicate.call(context, v, k, $__0));\n\t } while (skipping);\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t }));\n\t };\n\t return skipSequence;\n\t}\n\tfunction concatFactory(iterable, values) {\n\t var isKeyedIterable = isKeyed(iterable);\n\t var iters = [iterable].concat(values).map((function(v) {\n\t if (!isIterable(v)) {\n\t v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n\t } else if (isKeyedIterable) {\n\t v = KeyedIterable(v);\n\t }\n\t return v;\n\t })).filter((function(v) {\n\t return v.size !== 0;\n\t }));\n\t if (iters.length === 0) {\n\t return iterable;\n\t }\n\t if (iters.length === 1) {\n\t var singleton = iters[0];\n\t if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) {\n\t return singleton;\n\t }\n\t }\n\t var concatSeq = new ArraySeq(iters);\n\t if (isKeyedIterable) {\n\t concatSeq = concatSeq.toKeyedSeq();\n\t } else if (!isIndexed(iterable)) {\n\t concatSeq = concatSeq.toSetSeq();\n\t }\n\t concatSeq = concatSeq.flatten(true);\n\t concatSeq.size = iters.reduce((function(sum, seq) {\n\t if (sum !== undefined) {\n\t var size = seq.size;\n\t if (size !== undefined) {\n\t return sum + size;\n\t }\n\t }\n\t }), 0);\n\t return concatSeq;\n\t}\n\tfunction flattenFactory(iterable, depth, useKeys) {\n\t var flatSequence = makeSequence(iterable);\n\t flatSequence.__iterateUncached = function(fn, reverse) {\n\t var iterations = 0;\n\t var stopped = false;\n\t function flatDeep(iter, currentDepth) {\n\t var $__0 = this;\n\t iter.__iterate((function(v, k) {\n\t if ((!depth || currentDepth < depth) && isIterable(v)) {\n\t flatDeep(v, currentDepth + 1);\n\t } else if (fn(v, useKeys ? k : iterations++, $__0) === false) {\n\t stopped = true;\n\t }\n\t return !stopped;\n\t }), reverse);\n\t }\n\t flatDeep(iterable, 0);\n\t return iterations;\n\t };\n\t flatSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(type, reverse);\n\t var stack = [];\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (iterator) {\n\t var step = iterator.next();\n\t if (step.done !== false) {\n\t iterator = stack.pop();\n\t continue;\n\t }\n\t var v = step.value;\n\t if (type === ITERATE_ENTRIES) {\n\t v = v[1];\n\t }\n\t if ((!depth || stack.length < depth) && isIterable(v)) {\n\t stack.push(iterator);\n\t iterator = v.__iterator(type, reverse);\n\t } else {\n\t return useKeys ? step : iteratorValue(type, iterations++, v, step);\n\t }\n\t }\n\t return iteratorDone();\n\t }));\n\t };\n\t return flatSequence;\n\t}\n\tfunction flatMapFactory(iterable, mapper, context) {\n\t var coerce = iterableClass(iterable);\n\t return iterable.toSeq().map((function(v, k) {\n\t return coerce(mapper.call(context, v, k, iterable));\n\t })).flatten(true);\n\t}\n\tfunction interposeFactory(iterable, separator) {\n\t var interposedSequence = makeSequence(iterable);\n\t interposedSequence.size = iterable.size && iterable.size * 2 - 1;\n\t interposedSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t return (!iterations || fn(separator, iterations++, $__0) !== false) && fn(v, iterations++, $__0) !== false;\n\t }), reverse);\n\t return iterations;\n\t };\n\t interposedSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_VALUES, reverse);\n\t var iterations = 0;\n\t var step;\n\t return new Iterator((function() {\n\t if (!step || iterations % 2) {\n\t step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t }\n\t return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);\n\t }));\n\t };\n\t return interposedSequence;\n\t}\n\tfunction sortFactory(iterable, comparator, mapper) {\n\t if (!comparator) {\n\t comparator = defaultComparator;\n\t }\n\t var isKeyedIterable = isKeyed(iterable);\n\t var index = 0;\n\t var entries = iterable.toSeq().map((function(v, k) {\n\t return [k, v, index++, mapper ? mapper(v, k, iterable) : v];\n\t })).toArray();\n\t entries.sort((function(a, b) {\n\t return comparator(a[3], b[3]) || a[2] - b[2];\n\t })).forEach(isKeyedIterable ? (function(v, i) {\n\t entries[i].length = 2;\n\t }) : (function(v, i) {\n\t entries[i] = v[1];\n\t }));\n\t return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries);\n\t}\n\tfunction maxFactory(iterable, comparator, mapper) {\n\t if (!comparator) {\n\t comparator = defaultComparator;\n\t }\n\t if (mapper) {\n\t var entry = iterable.toSeq().map((function(v, k) {\n\t return [v, mapper(v, k, iterable)];\n\t })).reduce((function(max, next) {\n\t return comparator(next[1], max[1]) > 0 ? next : max;\n\t }));\n\t return entry && entry[0];\n\t } else {\n\t return iterable.reduce((function(max, next) {\n\t return comparator(next, max) > 0 ? next : max;\n\t }));\n\t }\n\t}\n\tfunction reify(iter, seq) {\n\t return isSeq(iter) ? seq : iter.constructor(seq);\n\t}\n\tfunction validateEntry(entry) {\n\t if (entry !== Object(entry)) {\n\t throw new TypeError('Expected [K, V] tuple: ' + entry);\n\t }\n\t}\n\tfunction resolveSize(iter) {\n\t assertNotInfinite(iter.size);\n\t return ensureSize(iter);\n\t}\n\tfunction iterableClass(iterable) {\n\t return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;\n\t}\n\tfunction makeSequence(iterable) {\n\t return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);\n\t}\n\tfunction cacheResultThrough() {\n\t if (this._iter.cacheResult) {\n\t this._iter.cacheResult();\n\t this.size = this._iter.size;\n\t return this;\n\t } else {\n\t return Seq.prototype.cacheResult.call(this);\n\t }\n\t}\n\tfunction defaultComparator(a, b) {\n\t return a > b ? 1 : a < b ? -1 : 0;\n\t}\n\tvar List = function List(value) {\n\t var empty = emptyList();\n\t if (value === null || value === undefined) {\n\t return empty;\n\t }\n\t if (isList(value)) {\n\t return value;\n\t }\n\t value = IndexedIterable(value);\n\t var size = value.size;\n\t if (size === 0) {\n\t return empty;\n\t }\n\t if (size > 0 && size < SIZE) {\n\t return makeList(0, size, SHIFT, null, new VNode(value.toArray()));\n\t }\n\t return empty.withMutations((function(list) {\n\t list.setSize(size);\n\t value.forEach((function(v, i) {\n\t return list.set(i, v);\n\t }));\n\t }));\n\t};\n\t($traceurRuntime.createClass)(List, {\n\t toString: function() {\n\t return this.__toString('List [', ']');\n\t },\n\t get: function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t if (index < 0 || index >= this.size) {\n\t return notSetValue;\n\t }\n\t index += this._origin;\n\t var node = listNodeFor(this, index);\n\t return node && node.array[index & MASK];\n\t },\n\t set: function(index, value) {\n\t return updateList(this, index, value);\n\t },\n\t remove: function(index) {\n\t return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = this._origin = this._capacity = 0;\n\t this._level = SHIFT;\n\t this._root = this._tail = null;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyList();\n\t },\n\t push: function() {\n\t var values = arguments;\n\t var oldSize = this.size;\n\t return this.withMutations((function(list) {\n\t setListBounds(list, 0, oldSize + values.length);\n\t for (var ii = 0; ii < values.length; ii++) {\n\t list.set(oldSize + ii, values[ii]);\n\t }\n\t }));\n\t },\n\t pop: function() {\n\t return setListBounds(this, 0, -1);\n\t },\n\t unshift: function() {\n\t var values = arguments;\n\t return this.withMutations((function(list) {\n\t setListBounds(list, -values.length);\n\t for (var ii = 0; ii < values.length; ii++) {\n\t list.set(ii, values[ii]);\n\t }\n\t }));\n\t },\n\t shift: function() {\n\t return setListBounds(this, 1);\n\t },\n\t merge: function() {\n\t return mergeIntoListWith(this, undefined, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__7 = 1; $__7 < arguments.length; $__7++)\n\t iters[$__7 - 1] = arguments[$__7];\n\t return mergeIntoListWith(this, merger, iters);\n\t },\n\t mergeDeep: function() {\n\t return mergeIntoListWith(this, deepMerger(undefined), arguments);\n\t },\n\t mergeDeepWith: function(merger) {\n\t for (var iters = [],\n\t $__8 = 1; $__8 < arguments.length; $__8++)\n\t iters[$__8 - 1] = arguments[$__8];\n\t return mergeIntoListWith(this, deepMerger(merger), iters);\n\t },\n\t setSize: function(size) {\n\t return setListBounds(this, 0, size);\n\t },\n\t slice: function(begin, end) {\n\t var size = this.size;\n\t if (wholeSlice(begin, end, size)) {\n\t return this;\n\t }\n\t return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));\n\t },\n\t __iterator: function(type, reverse) {\n\t return new ListIterator(this, type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t var eachFn = (function(v) {\n\t return fn(v, iterations++, $__0);\n\t });\n\t var tailOffset = getTailOffset(this._capacity);\n\t if (reverse) {\n\t iterateVNode(this._tail, 0, tailOffset - this._origin, this._capacity - this._origin, eachFn, reverse) && iterateVNode(this._root, this._level, -this._origin, tailOffset - this._origin, eachFn, reverse);\n\t } else {\n\t iterateVNode(this._root, this._level, -this._origin, tailOffset - this._origin, eachFn, reverse) && iterateVNode(this._tail, 0, tailOffset - this._origin, this._capacity - this._origin, eachFn, reverse);\n\t }\n\t return iterations;\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t return this;\n\t }\n\t return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, IndexedCollection);\n\tfunction isList(maybeList) {\n\t return !!(maybeList && maybeList[IS_LIST_SENTINEL]);\n\t}\n\tList.isList = isList;\n\tvar IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\n\tvar ListPrototype = List.prototype;\n\tListPrototype[IS_LIST_SENTINEL] = true;\n\tListPrototype[DELETE] = ListPrototype.remove;\n\tListPrototype.setIn = MapPrototype.setIn;\n\tListPrototype.removeIn = MapPrototype.removeIn;\n\tListPrototype.update = MapPrototype.update;\n\tListPrototype.updateIn = MapPrototype.updateIn;\n\tListPrototype.mergeIn = MapPrototype.mergeIn;\n\tListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n\tListPrototype.withMutations = MapPrototype.withMutations;\n\tListPrototype.asMutable = MapPrototype.asMutable;\n\tListPrototype.asImmutable = MapPrototype.asImmutable;\n\tListPrototype.wasAltered = MapPrototype.wasAltered;\n\tvar VNode = function VNode(array, ownerID) {\n\t this.array = array;\n\t this.ownerID = ownerID;\n\t};\n\tvar $VNode = VNode;\n\t($traceurRuntime.createClass)(VNode, {\n\t removeBefore: function(ownerID, level, index) {\n\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t return this;\n\t }\n\t var originIndex = (index >>> level) & MASK;\n\t if (originIndex >= this.array.length) {\n\t return new $VNode([], ownerID);\n\t }\n\t var removingFirst = originIndex === 0;\n\t var newChild;\n\t if (level > 0) {\n\t var oldChild = this.array[originIndex];\n\t newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n\t if (newChild === oldChild && removingFirst) {\n\t return this;\n\t }\n\t }\n\t if (removingFirst && !newChild) {\n\t return this;\n\t }\n\t var editable = editableVNode(this, ownerID);\n\t if (!removingFirst) {\n\t for (var ii = 0; ii < originIndex; ii++) {\n\t editable.array[ii] = undefined;\n\t }\n\t }\n\t if (newChild) {\n\t editable.array[originIndex] = newChild;\n\t }\n\t return editable;\n\t },\n\t removeAfter: function(ownerID, level, index) {\n\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t return this;\n\t }\n\t var sizeIndex = ((index - 1) >>> level) & MASK;\n\t if (sizeIndex >= this.array.length) {\n\t return this;\n\t }\n\t var removingLast = sizeIndex === this.array.length - 1;\n\t var newChild;\n\t if (level > 0) {\n\t var oldChild = this.array[sizeIndex];\n\t newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n\t if (newChild === oldChild && removingLast) {\n\t return this;\n\t }\n\t }\n\t if (removingLast && !newChild) {\n\t return this;\n\t }\n\t var editable = editableVNode(this, ownerID);\n\t if (!removingLast) {\n\t editable.array.pop();\n\t }\n\t if (newChild) {\n\t editable.array[sizeIndex] = newChild;\n\t }\n\t return editable;\n\t }\n\t}, {});\n\tfunction iterateVNode(node, level, offset, max, fn, reverse) {\n\t var ii;\n\t var array = node && node.array;\n\t if (level === 0) {\n\t var from = offset < 0 ? -offset : 0;\n\t var to = max - offset;\n\t if (to > SIZE) {\n\t to = SIZE;\n\t }\n\t for (ii = from; ii < to; ii++) {\n\t if (fn(array && array[reverse ? from + to - 1 - ii : ii]) === false) {\n\t return false;\n\t }\n\t }\n\t } else {\n\t var step = 1 << level;\n\t var newLevel = level - SHIFT;\n\t for (ii = 0; ii <= MASK; ii++) {\n\t var levelIndex = reverse ? MASK - ii : ii;\n\t var newOffset = offset + (levelIndex << level);\n\t if (newOffset < max && newOffset + step > 0) {\n\t var nextNode = array && array[levelIndex];\n\t if (!iterateVNode(nextNode, newLevel, newOffset, max, fn, reverse)) {\n\t return false;\n\t }\n\t }\n\t }\n\t }\n\t return true;\n\t}\n\tvar ListIterator = function ListIterator(list, type, reverse) {\n\t this._type = type;\n\t this._reverse = !!reverse;\n\t this._maxIndex = list.size - 1;\n\t var tailOffset = getTailOffset(list._capacity);\n\t var rootStack = listIteratorFrame(list._root && list._root.array, list._level, -list._origin, tailOffset - list._origin - 1);\n\t var tailStack = listIteratorFrame(list._tail && list._tail.array, 0, tailOffset - list._origin, list._capacity - list._origin - 1);\n\t this._stack = reverse ? tailStack : rootStack;\n\t this._stack.__prev = reverse ? rootStack : tailStack;\n\t};\n\t($traceurRuntime.createClass)(ListIterator, {next: function() {\n\t var stack = this._stack;\n\t while (stack) {\n\t var array = stack.array;\n\t var rawIndex = stack.index++;\n\t if (this._reverse) {\n\t rawIndex = MASK - rawIndex;\n\t if (rawIndex > stack.rawMax) {\n\t rawIndex = stack.rawMax;\n\t stack.index = SIZE - rawIndex;\n\t }\n\t }\n\t if (rawIndex >= 0 && rawIndex < SIZE && rawIndex <= stack.rawMax) {\n\t var value = array && array[rawIndex];\n\t if (stack.level === 0) {\n\t var type = this._type;\n\t var index;\n\t if (type !== 1) {\n\t index = stack.offset + (rawIndex << stack.level);\n\t if (this._reverse) {\n\t index = this._maxIndex - index;\n\t }\n\t }\n\t return iteratorValue(type, index, value);\n\t } else {\n\t this._stack = stack = listIteratorFrame(value && value.array, stack.level - SHIFT, stack.offset + (rawIndex << stack.level), stack.max, stack);\n\t }\n\t continue;\n\t }\n\t stack = this._stack = this._stack.__prev;\n\t }\n\t return iteratorDone();\n\t }}, {}, Iterator);\n\tfunction listIteratorFrame(array, level, offset, max, prevFrame) {\n\t return {\n\t array: array,\n\t level: level,\n\t offset: offset,\n\t max: max,\n\t rawMax: ((max - offset) >> level),\n\t index: 0,\n\t __prev: prevFrame\n\t };\n\t}\n\tfunction makeList(origin, capacity, level, root, tail, ownerID, hash) {\n\t var list = Object.create(ListPrototype);\n\t list.size = capacity - origin;\n\t list._origin = origin;\n\t list._capacity = capacity;\n\t list._level = level;\n\t list._root = root;\n\t list._tail = tail;\n\t list.__ownerID = ownerID;\n\t list.__hash = hash;\n\t list.__altered = false;\n\t return list;\n\t}\n\tvar EMPTY_LIST;\n\tfunction emptyList() {\n\t return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n\t}\n\tfunction updateList(list, index, value) {\n\t index = wrapIndex(list, index);\n\t if (index >= list.size || index < 0) {\n\t return list.withMutations((function(list) {\n\t index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);\n\t }));\n\t }\n\t index += list._origin;\n\t var newTail = list._tail;\n\t var newRoot = list._root;\n\t var didAlter = MakeRef(DID_ALTER);\n\t if (index >= getTailOffset(list._capacity)) {\n\t newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n\t } else {\n\t newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n\t }\n\t if (!didAlter.value) {\n\t return list;\n\t }\n\t if (list.__ownerID) {\n\t list._root = newRoot;\n\t list._tail = newTail;\n\t list.__hash = undefined;\n\t list.__altered = true;\n\t return list;\n\t }\n\t return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n\t}\n\tfunction updateVNode(node, ownerID, level, index, value, didAlter) {\n\t var idx = (index >>> level) & MASK;\n\t var nodeHas = node && idx < node.array.length;\n\t if (!nodeHas && value === undefined) {\n\t return node;\n\t }\n\t var newNode;\n\t if (level > 0) {\n\t var lowerNode = node && node.array[idx];\n\t var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n\t if (newLowerNode === lowerNode) {\n\t return node;\n\t }\n\t newNode = editableVNode(node, ownerID);\n\t newNode.array[idx] = newLowerNode;\n\t return newNode;\n\t }\n\t if (nodeHas && node.array[idx] === value) {\n\t return node;\n\t }\n\t SetRef(didAlter);\n\t newNode = editableVNode(node, ownerID);\n\t if (value === undefined && idx === newNode.array.length - 1) {\n\t newNode.array.pop();\n\t } else {\n\t newNode.array[idx] = value;\n\t }\n\t return newNode;\n\t}\n\tfunction editableVNode(node, ownerID) {\n\t if (ownerID && node && ownerID === node.ownerID) {\n\t return node;\n\t }\n\t return new VNode(node ? node.array.slice() : [], ownerID);\n\t}\n\tfunction listNodeFor(list, rawIndex) {\n\t if (rawIndex >= getTailOffset(list._capacity)) {\n\t return list._tail;\n\t }\n\t if (rawIndex < 1 << (list._level + SHIFT)) {\n\t var node = list._root;\n\t var level = list._level;\n\t while (node && level > 0) {\n\t node = node.array[(rawIndex >>> level) & MASK];\n\t level -= SHIFT;\n\t }\n\t return node;\n\t }\n\t}\n\tfunction setListBounds(list, begin, end) {\n\t var owner = list.__ownerID || new OwnerID();\n\t var oldOrigin = list._origin;\n\t var oldCapacity = list._capacity;\n\t var newOrigin = oldOrigin + begin;\n\t var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n\t if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n\t return list;\n\t }\n\t if (newOrigin >= newCapacity) {\n\t return list.clear();\n\t }\n\t var newLevel = list._level;\n\t var newRoot = list._root;\n\t var offsetShift = 0;\n\t while (newOrigin + offsetShift < 0) {\n\t newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n\t newLevel += SHIFT;\n\t offsetShift += 1 << newLevel;\n\t }\n\t if (offsetShift) {\n\t newOrigin += offsetShift;\n\t oldOrigin += offsetShift;\n\t newCapacity += offsetShift;\n\t oldCapacity += offsetShift;\n\t }\n\t var oldTailOffset = getTailOffset(oldCapacity);\n\t var newTailOffset = getTailOffset(newCapacity);\n\t while (newTailOffset >= 1 << (newLevel + SHIFT)) {\n\t newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n\t newLevel += SHIFT;\n\t }\n\t var oldTail = list._tail;\n\t var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;\n\t if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n\t newRoot = editableVNode(newRoot, owner);\n\t var node = newRoot;\n\t for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n\t var idx = (oldTailOffset >>> level) & MASK;\n\t node = node.array[idx] = editableVNode(node.array[idx], owner);\n\t }\n\t node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;\n\t }\n\t if (newCapacity < oldCapacity) {\n\t newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n\t }\n\t if (newOrigin >= newTailOffset) {\n\t newOrigin -= newTailOffset;\n\t newCapacity -= newTailOffset;\n\t newLevel = SHIFT;\n\t newRoot = null;\n\t newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);\n\t } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n\t offsetShift = 0;\n\t while (newRoot) {\n\t var beginIndex = (newOrigin >>> newLevel) & MASK;\n\t if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {\n\t break;\n\t }\n\t if (beginIndex) {\n\t offsetShift += (1 << newLevel) * beginIndex;\n\t }\n\t newLevel -= SHIFT;\n\t newRoot = newRoot.array[beginIndex];\n\t }\n\t if (newRoot && newOrigin > oldOrigin) {\n\t newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n\t }\n\t if (newRoot && newTailOffset < oldTailOffset) {\n\t newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n\t }\n\t if (offsetShift) {\n\t newOrigin -= offsetShift;\n\t newCapacity -= offsetShift;\n\t }\n\t }\n\t if (list.__ownerID) {\n\t list.size = newCapacity - newOrigin;\n\t list._origin = newOrigin;\n\t list._capacity = newCapacity;\n\t list._level = newLevel;\n\t list._root = newRoot;\n\t list._tail = newTail;\n\t list.__hash = undefined;\n\t list.__altered = true;\n\t return list;\n\t }\n\t return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n\t}\n\tfunction mergeIntoListWith(list, merger, iterables) {\n\t var iters = [];\n\t var maxSize = 0;\n\t for (var ii = 0; ii < iterables.length; ii++) {\n\t var value = iterables[ii];\n\t var iter = IndexedIterable(value);\n\t if (iter.size > maxSize) {\n\t maxSize = iter.size;\n\t }\n\t if (!isIterable(value)) {\n\t iter = iter.map((function(v) {\n\t return fromJS(v);\n\t }));\n\t }\n\t iters.push(iter);\n\t }\n\t if (maxSize > list.size) {\n\t list = list.setSize(maxSize);\n\t }\n\t return mergeIntoCollectionWith(list, merger, iters);\n\t}\n\tfunction getTailOffset(size) {\n\t return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);\n\t}\n\tvar OrderedMap = function OrderedMap(value) {\n\t return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations((function(map) {\n\t KeyedIterable(value).forEach((function(v, k) {\n\t return map.set(k, v);\n\t }));\n\t }));\n\t};\n\t($traceurRuntime.createClass)(OrderedMap, {\n\t toString: function() {\n\t return this.__toString('OrderedMap {', '}');\n\t },\n\t get: function(k, notSetValue) {\n\t var index = this._map.get(k);\n\t return index !== undefined ? this._list.get(index)[1] : notSetValue;\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._map.clear();\n\t this._list.clear();\n\t return this;\n\t }\n\t return emptyOrderedMap();\n\t },\n\t set: function(k, v) {\n\t return updateOrderedMap(this, k, v);\n\t },\n\t remove: function(k) {\n\t return updateOrderedMap(this, k, NOT_SET);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered() || this._list.wasAltered();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._list.__iterate((function(entry) {\n\t return entry && fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._list.fromEntrySeq().__iterator(type, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map.__ensureOwner(ownerID);\n\t var newList = this._list.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t this._list = newList;\n\t return this;\n\t }\n\t return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, Map);\n\tfunction isOrderedMap(maybeOrderedMap) {\n\t return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);\n\t}\n\tOrderedMap.isOrderedMap = isOrderedMap;\n\tOrderedMap.prototype[IS_ORDERED_SENTINEL] = true;\n\tOrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\tfunction makeOrderedMap(map, list, ownerID, hash) {\n\t var omap = Object.create(OrderedMap.prototype);\n\t omap.size = map ? map.size : 0;\n\t omap._map = map;\n\t omap._list = list;\n\t omap.__ownerID = ownerID;\n\t omap.__hash = hash;\n\t return omap;\n\t}\n\tvar EMPTY_ORDERED_MAP;\n\tfunction emptyOrderedMap() {\n\t return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n\t}\n\tfunction updateOrderedMap(omap, k, v) {\n\t var map = omap._map;\n\t var list = omap._list;\n\t var i = map.get(k);\n\t var has = i !== undefined;\n\t var newMap;\n\t var newList;\n\t if (v === NOT_SET) {\n\t if (!has) {\n\t return omap;\n\t }\n\t if (list.size >= SIZE && list.size >= map.size * 2) {\n\t newList = list.filter((function(entry, idx) {\n\t return entry !== undefined && i !== idx;\n\t }));\n\t newMap = newList.toKeyedSeq().map((function(entry) {\n\t return entry[0];\n\t })).flip().toMap();\n\t if (omap.__ownerID) {\n\t newMap.__ownerID = newList.__ownerID = omap.__ownerID;\n\t }\n\t } else {\n\t newMap = map.remove(k);\n\t newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);\n\t }\n\t } else {\n\t if (has) {\n\t if (v === list.get(i)[1]) {\n\t return omap;\n\t }\n\t newMap = map;\n\t newList = list.set(i, [k, v]);\n\t } else {\n\t newMap = map.set(k, list.size);\n\t newList = list.set(list.size, [k, v]);\n\t }\n\t }\n\t if (omap.__ownerID) {\n\t omap.size = newMap.size;\n\t omap._map = newMap;\n\t omap._list = newList;\n\t omap.__hash = undefined;\n\t return omap;\n\t }\n\t return makeOrderedMap(newMap, newList);\n\t}\n\tvar Stack = function Stack(value) {\n\t return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);\n\t};\n\tvar $Stack = Stack;\n\t($traceurRuntime.createClass)(Stack, {\n\t toString: function() {\n\t return this.__toString('Stack [', ']');\n\t },\n\t get: function(index, notSetValue) {\n\t var head = this._head;\n\t while (head && index--) {\n\t head = head.next;\n\t }\n\t return head ? head.value : notSetValue;\n\t },\n\t peek: function() {\n\t return this._head && this._head.value;\n\t },\n\t push: function() {\n\t if (arguments.length === 0) {\n\t return this;\n\t }\n\t var newSize = this.size + arguments.length;\n\t var head = this._head;\n\t for (var ii = arguments.length - 1; ii >= 0; ii--) {\n\t head = {\n\t value: arguments[ii],\n\t next: head\n\t };\n\t }\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t pushAll: function(iter) {\n\t iter = IndexedIterable(iter);\n\t if (iter.size === 0) {\n\t return this;\n\t }\n\t var newSize = this.size;\n\t var head = this._head;\n\t iter.reverse().forEach((function(value) {\n\t newSize++;\n\t head = {\n\t value: value,\n\t next: head\n\t };\n\t }));\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t pop: function() {\n\t return this.slice(1);\n\t },\n\t unshift: function() {\n\t return this.push.apply(this, arguments);\n\t },\n\t unshiftAll: function(iter) {\n\t return this.pushAll(iter);\n\t },\n\t shift: function() {\n\t return this.pop.apply(this, arguments);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._head = undefined;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyStack();\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t var resolvedBegin = resolveBegin(begin, this.size);\n\t var resolvedEnd = resolveEnd(end, this.size);\n\t if (resolvedEnd !== this.size) {\n\t return $traceurRuntime.superCall(this, $Stack.prototype, \"slice\", [begin, end]);\n\t }\n\t var newSize = this.size - resolvedBegin;\n\t var head = this._head;\n\t while (resolvedBegin--) {\n\t head = head.next;\n\t }\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this.__altered = false;\n\t return this;\n\t }\n\t return makeStack(this.size, this._head, ownerID, this.__hash);\n\t },\n\t __iterate: function(fn, reverse) {\n\t if (reverse) {\n\t return this.toSeq().cacheResult.__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t var node = this._head;\n\t while (node) {\n\t if (fn(node.value, iterations++, this) === false) {\n\t break;\n\t }\n\t node = node.next;\n\t }\n\t return iterations;\n\t },\n\t __iterator: function(type, reverse) {\n\t if (reverse) {\n\t return this.toSeq().cacheResult().__iterator(type, reverse);\n\t }\n\t var iterations = 0;\n\t var node = this._head;\n\t return new Iterator((function() {\n\t if (node) {\n\t var value = node.value;\n\t node = node.next;\n\t return iteratorValue(type, iterations++, value);\n\t }\n\t return iteratorDone();\n\t }));\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, IndexedCollection);\n\tfunction isStack(maybeStack) {\n\t return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);\n\t}\n\tStack.isStack = isStack;\n\tvar IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\tvar StackPrototype = Stack.prototype;\n\tStackPrototype[IS_STACK_SENTINEL] = true;\n\tStackPrototype.withMutations = MapPrototype.withMutations;\n\tStackPrototype.asMutable = MapPrototype.asMutable;\n\tStackPrototype.asImmutable = MapPrototype.asImmutable;\n\tStackPrototype.wasAltered = MapPrototype.wasAltered;\n\tfunction makeStack(size, head, ownerID, hash) {\n\t var map = Object.create(StackPrototype);\n\t map.size = size;\n\t map._head = head;\n\t map.__ownerID = ownerID;\n\t map.__hash = hash;\n\t map.__altered = false;\n\t return map;\n\t}\n\tvar EMPTY_STACK;\n\tfunction emptyStack() {\n\t return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n\t}\n\tvar Set = function Set(value) {\n\t return value === null || value === undefined ? emptySet() : isSet(value) ? value : emptySet().withMutations((function(set) {\n\t SetIterable(value).forEach((function(v) {\n\t return set.add(v);\n\t }));\n\t }));\n\t};\n\t($traceurRuntime.createClass)(Set, {\n\t toString: function() {\n\t return this.__toString('Set {', '}');\n\t },\n\t has: function(value) {\n\t return this._map.has(value);\n\t },\n\t add: function(value) {\n\t return updateSet(this, this._map.set(value, true));\n\t },\n\t remove: function(value) {\n\t return updateSet(this, this._map.remove(value));\n\t },\n\t clear: function() {\n\t return updateSet(this, this._map.clear());\n\t },\n\t union: function() {\n\t for (var iters = [],\n\t $__9 = 0; $__9 < arguments.length; $__9++)\n\t iters[$__9] = arguments[$__9];\n\t iters = iters.filter((function(x) {\n\t return x.size !== 0;\n\t }));\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t if (this.size === 0 && iters.length === 1) {\n\t return this.constructor(iters[0]);\n\t }\n\t return this.withMutations((function(set) {\n\t for (var ii = 0; ii < iters.length; ii++) {\n\t SetIterable(iters[ii]).forEach((function(value) {\n\t return set.add(value);\n\t }));\n\t }\n\t }));\n\t },\n\t intersect: function() {\n\t for (var iters = [],\n\t $__10 = 0; $__10 < arguments.length; $__10++)\n\t iters[$__10] = arguments[$__10];\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t iters = iters.map((function(iter) {\n\t return SetIterable(iter);\n\t }));\n\t var originalSet = this;\n\t return this.withMutations((function(set) {\n\t originalSet.forEach((function(value) {\n\t if (!iters.every((function(iter) {\n\t return iter.contains(value);\n\t }))) {\n\t set.remove(value);\n\t }\n\t }));\n\t }));\n\t },\n\t subtract: function() {\n\t for (var iters = [],\n\t $__11 = 0; $__11 < arguments.length; $__11++)\n\t iters[$__11] = arguments[$__11];\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t iters = iters.map((function(iter) {\n\t return SetIterable(iter);\n\t }));\n\t var originalSet = this;\n\t return this.withMutations((function(set) {\n\t originalSet.forEach((function(value) {\n\t if (iters.some((function(iter) {\n\t return iter.contains(value);\n\t }))) {\n\t set.remove(value);\n\t }\n\t }));\n\t }));\n\t },\n\t merge: function() {\n\t return this.union.apply(this, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__12 = 1; $__12 < arguments.length; $__12++)\n\t iters[$__12 - 1] = arguments[$__12];\n\t return this.union.apply(this, iters);\n\t },\n\t sort: function(comparator) {\n\t return OrderedSet(sortFactory(this, comparator));\n\t },\n\t sortBy: function(mapper, comparator) {\n\t return OrderedSet(sortFactory(this, comparator, mapper));\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._map.__iterate((function(_, k) {\n\t return fn(k, k, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._map.map((function(_, k) {\n\t return k;\n\t })).__iterator(type, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return this.__make(newMap, ownerID);\n\t }\n\t}, {\n\t of: function() {\n\t return this(arguments);\n\t },\n\t fromKeys: function(value) {\n\t return this(KeyedIterable(value).keySeq());\n\t }\n\t}, SetCollection);\n\tfunction isSet(maybeSet) {\n\t return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);\n\t}\n\tSet.isSet = isSet;\n\tvar IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\n\tvar SetPrototype = Set.prototype;\n\tSetPrototype[IS_SET_SENTINEL] = true;\n\tSetPrototype[DELETE] = SetPrototype.remove;\n\tSetPrototype.mergeDeep = SetPrototype.merge;\n\tSetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n\tSetPrototype.withMutations = MapPrototype.withMutations;\n\tSetPrototype.asMutable = MapPrototype.asMutable;\n\tSetPrototype.asImmutable = MapPrototype.asImmutable;\n\tSetPrototype.__empty = emptySet;\n\tSetPrototype.__make = makeSet;\n\tfunction updateSet(set, newMap) {\n\t if (set.__ownerID) {\n\t set.size = newMap.size;\n\t set._map = newMap;\n\t return set;\n\t }\n\t return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap);\n\t}\n\tfunction makeSet(map, ownerID) {\n\t var set = Object.create(SetPrototype);\n\t set.size = map ? map.size : 0;\n\t set._map = map;\n\t set.__ownerID = ownerID;\n\t return set;\n\t}\n\tvar EMPTY_SET;\n\tfunction emptySet() {\n\t return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n\t}\n\tvar OrderedSet = function OrderedSet(value) {\n\t return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations((function(set) {\n\t SetIterable(value).forEach((function(v) {\n\t return set.add(v);\n\t }));\n\t }));\n\t};\n\t($traceurRuntime.createClass)(OrderedSet, {toString: function() {\n\t return this.__toString('OrderedSet {', '}');\n\t }}, {\n\t of: function() {\n\t return this(arguments);\n\t },\n\t fromKeys: function(value) {\n\t return this(KeyedIterable(value).keySeq());\n\t }\n\t}, Set);\n\tfunction isOrderedSet(maybeOrderedSet) {\n\t return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);\n\t}\n\tOrderedSet.isOrderedSet = isOrderedSet;\n\tvar OrderedSetPrototype = OrderedSet.prototype;\n\tOrderedSetPrototype[IS_ORDERED_SENTINEL] = true;\n\tOrderedSetPrototype.__empty = emptyOrderedSet;\n\tOrderedSetPrototype.__make = makeOrderedSet;\n\tfunction makeOrderedSet(map, ownerID) {\n\t var set = Object.create(OrderedSetPrototype);\n\t set.size = map ? map.size : 0;\n\t set._map = map;\n\t set.__ownerID = ownerID;\n\t return set;\n\t}\n\tvar EMPTY_ORDERED_SET;\n\tfunction emptyOrderedSet() {\n\t return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));\n\t}\n\tvar Record = function Record(defaultValues, name) {\n\t var RecordType = function Record(values) {\n\t if (!(this instanceof RecordType)) {\n\t return new RecordType(values);\n\t }\n\t this._map = Map(values);\n\t };\n\t var keys = Object.keys(defaultValues);\n\t var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n\t RecordTypePrototype.constructor = RecordType;\n\t name && (RecordTypePrototype._name = name);\n\t RecordTypePrototype._defaultValues = defaultValues;\n\t RecordTypePrototype._keys = keys;\n\t RecordTypePrototype.size = keys.length;\n\t try {\n\t keys.forEach((function(key) {\n\t Object.defineProperty(RecordType.prototype, key, {\n\t get: function() {\n\t return this.get(key);\n\t },\n\t set: function(value) {\n\t invariant(this.__ownerID, 'Cannot set on an immutable record.');\n\t this.set(key, value);\n\t }\n\t });\n\t }));\n\t } catch (error) {}\n\t return RecordType;\n\t};\n\t($traceurRuntime.createClass)(Record, {\n\t toString: function() {\n\t return this.__toString(recordName(this) + ' {', '}');\n\t },\n\t has: function(k) {\n\t return this._defaultValues.hasOwnProperty(k);\n\t },\n\t get: function(k, notSetValue) {\n\t if (!this.has(k)) {\n\t return notSetValue;\n\t }\n\t var defaultVal = this._defaultValues[k];\n\t return this._map ? this._map.get(k, defaultVal) : defaultVal;\n\t },\n\t clear: function() {\n\t if (this.__ownerID) {\n\t this._map && this._map.clear();\n\t return this;\n\t }\n\t var SuperRecord = Object.getPrototypeOf(this).constructor;\n\t return SuperRecord._empty || (SuperRecord._empty = makeRecord(this, emptyMap()));\n\t },\n\t set: function(k, v) {\n\t if (!this.has(k)) {\n\t throw new Error('Cannot set unknown key \"' + k + '\" on ' + recordName(this));\n\t }\n\t var newMap = this._map && this._map.set(k, v);\n\t if (this.__ownerID || newMap === this._map) {\n\t return this;\n\t }\n\t return makeRecord(this, newMap);\n\t },\n\t remove: function(k) {\n\t if (!this.has(k)) {\n\t return this;\n\t }\n\t var newMap = this._map && this._map.remove(k);\n\t if (this.__ownerID || newMap === this._map) {\n\t return this;\n\t }\n\t return makeRecord(this, newMap);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered();\n\t },\n\t __iterator: function(type, reverse) {\n\t var $__0 = this;\n\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t return $__0.get(k);\n\t })).__iterator(type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t return $__0.get(k);\n\t })).__iterate(fn, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map && this._map.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return makeRecord(this, newMap, ownerID);\n\t }\n\t}, {}, KeyedCollection);\n\tvar RecordPrototype = Record.prototype;\n\tRecordPrototype[DELETE] = RecordPrototype.remove;\n\tRecordPrototype.merge = MapPrototype.merge;\n\tRecordPrototype.mergeWith = MapPrototype.mergeWith;\n\tRecordPrototype.mergeIn = MapPrototype.mergeIn;\n\tRecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n\tRecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n\tRecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n\tRecordPrototype.setIn = MapPrototype.setIn;\n\tRecordPrototype.update = MapPrototype.update;\n\tRecordPrototype.updateIn = MapPrototype.updateIn;\n\tRecordPrototype.withMutations = MapPrototype.withMutations;\n\tRecordPrototype.asMutable = MapPrototype.asMutable;\n\tRecordPrototype.asImmutable = MapPrototype.asImmutable;\n\tfunction makeRecord(likeRecord, map, ownerID) {\n\t var record = Object.create(Object.getPrototypeOf(likeRecord));\n\t record._map = map;\n\t record.__ownerID = ownerID;\n\t return record;\n\t}\n\tfunction recordName(record) {\n\t return record._name || record.constructor.name;\n\t}\n\tvar Range = function Range(start, end, step) {\n\t if (!(this instanceof $Range)) {\n\t return new $Range(start, end, step);\n\t }\n\t invariant(step !== 0, 'Cannot step a Range by 0');\n\t start = start || 0;\n\t if (end === undefined) {\n\t end = Infinity;\n\t }\n\t if (start === end && __EMPTY_RANGE) {\n\t return __EMPTY_RANGE;\n\t }\n\t step = step === undefined ? 1 : Math.abs(step);\n\t if (end < start) {\n\t step = -step;\n\t }\n\t this._start = start;\n\t this._end = end;\n\t this._step = step;\n\t this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n\t};\n\tvar $Range = Range;\n\t($traceurRuntime.createClass)(Range, {\n\t toString: function() {\n\t if (this.size === 0) {\n\t return 'Range []';\n\t }\n\t return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]';\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;\n\t },\n\t contains: function(searchValue) {\n\t var possibleIndex = (searchValue - this._start) / this._step;\n\t return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t begin = resolveBegin(begin, this.size);\n\t end = resolveEnd(end, this.size);\n\t if (end <= begin) {\n\t return __EMPTY_RANGE;\n\t }\n\t return new $Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n\t },\n\t indexOf: function(searchValue) {\n\t var offsetValue = searchValue - this._start;\n\t if (offsetValue % this._step === 0) {\n\t var index = offsetValue / this._step;\n\t if (index >= 0 && index < this.size) {\n\t return index;\n\t }\n\t }\n\t return -1;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t return this.indexOf(searchValue);\n\t },\n\t take: function(amount) {\n\t return this.slice(0, Math.max(0, amount));\n\t },\n\t skip: function(amount) {\n\t return this.slice(Math.max(0, amount));\n\t },\n\t __iterate: function(fn, reverse) {\n\t var maxIndex = this.size - 1;\n\t var step = this._step;\n\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t if (fn(value, ii, this) === false) {\n\t return ii + 1;\n\t }\n\t value += reverse ? -step : step;\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var maxIndex = this.size - 1;\n\t var step = this._step;\n\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var v = value;\n\t value += reverse ? -step : step;\n\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n\t }));\n\t },\n\t equals: function(other) {\n\t return other instanceof $Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other);\n\t }\n\t}, {}, IndexedSeq);\n\tvar RangePrototype = Range.prototype;\n\tRangePrototype.__toJS = RangePrototype.toArray;\n\tRangePrototype.first = ListPrototype.first;\n\tRangePrototype.last = ListPrototype.last;\n\tvar __EMPTY_RANGE = Range(0, 0);\n\tvar Repeat = function Repeat(value, times) {\n\t if (times <= 0 && EMPTY_REPEAT) {\n\t return EMPTY_REPEAT;\n\t }\n\t if (!(this instanceof $Repeat)) {\n\t return new $Repeat(value, times);\n\t }\n\t this._value = value;\n\t this.size = times === undefined ? Infinity : Math.max(0, times);\n\t if (this.size === 0) {\n\t EMPTY_REPEAT = this;\n\t }\n\t};\n\tvar $Repeat = Repeat;\n\t($traceurRuntime.createClass)(Repeat, {\n\t toString: function() {\n\t if (this.size === 0) {\n\t return 'Repeat []';\n\t }\n\t return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._value : notSetValue;\n\t },\n\t contains: function(searchValue) {\n\t return is(this._value, searchValue);\n\t },\n\t slice: function(begin, end) {\n\t var size = this.size;\n\t return wholeSlice(begin, end, size) ? this : new $Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n\t },\n\t reverse: function() {\n\t return this;\n\t },\n\t indexOf: function(searchValue) {\n\t if (is(this._value, searchValue)) {\n\t return 0;\n\t }\n\t return -1;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t if (is(this._value, searchValue)) {\n\t return this.size;\n\t }\n\t return -1;\n\t },\n\t __iterate: function(fn, reverse) {\n\t for (var ii = 0; ii < this.size; ii++) {\n\t if (fn(this._value, ii, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var $__0 = this;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t return ii < $__0.size ? iteratorValue(type, ii++, $__0._value) : iteratorDone();\n\t }));\n\t },\n\t equals: function(other) {\n\t return other instanceof $Repeat ? is(this._value, other._value) : deepEqual(other);\n\t }\n\t}, {}, IndexedSeq);\n\tvar RepeatPrototype = Repeat.prototype;\n\tRepeatPrototype.last = RepeatPrototype.first;\n\tRepeatPrototype.has = RangePrototype.has;\n\tRepeatPrototype.take = RangePrototype.take;\n\tRepeatPrototype.skip = RangePrototype.skip;\n\tRepeatPrototype.__toJS = RangePrototype.__toJS;\n\tvar EMPTY_REPEAT;\n\tvar Immutable = {\n\t Iterable: Iterable,\n\t Seq: Seq,\n\t Collection: Collection,\n\t Map: Map,\n\t OrderedMap: OrderedMap,\n\t List: List,\n\t Stack: Stack,\n\t Set: Set,\n\t OrderedSet: OrderedSet,\n\t Record: Record,\n\t Range: Range,\n\t Repeat: Repeat,\n\t is: is,\n\t fromJS: fromJS\n\t};\n\n\t return Immutable;\n\t}", "title": "" }, { "docid": "990c121cbf4c2a478a13692e0748086b", "score": "0.50882155", "text": "function r(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "title": "" }, { "docid": "990c121cbf4c2a478a13692e0748086b", "score": "0.50882155", "text": "function r(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "title": "" }, { "docid": "86f35bd5e9ddb33fa23decb4ff63fca2", "score": "0.50784403", "text": "function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "title": "" }, { "docid": "e0b35f903fcabebb70f7461226d13645", "score": "0.50748134", "text": "function foo(..) { .. }", "title": "" }, { "docid": "e0b35f903fcabebb70f7461226d13645", "score": "0.50748134", "text": "function foo(..) { .. }", "title": "" }, { "docid": "344b14eea51ac25183beaa0488250c1d", "score": "0.50720763", "text": "function Module() {}", "title": "" }, { "docid": "344b14eea51ac25183beaa0488250c1d", "score": "0.50720763", "text": "function Module() {}", "title": "" }, { "docid": "344b14eea51ac25183beaa0488250c1d", "score": "0.50720763", "text": "function Module() {}", "title": "" }, { "docid": "8b0e3905850406b4e46eb7244e1dc8ef", "score": "0.50692725", "text": "function _b(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "title": "" }, { "docid": "26d030a26ac248a0e8ed9bd6949edc71", "score": "0.5069185", "text": "function intro_module_t(){\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\nintro_module_t=function(){return e};var e={},n=Object.prototype,r=n.hasOwnProperty,i=\"function\"==typeof Symbol?Symbol:{},o=i.iterator||\"@@iterator\",a=i.asyncIterator||\"@@asyncIterator\",s=i.toStringTag||\"@@toStringTag\";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},\"\")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),a=new S(r||[]);return o._invoke=function(t,e,n){var r=\"suspendedStart\";return function(i,o){if(\"executing\"===r)throw new Error(\"Generator is already running\");if(\"completed\"===r){if(\"throw\"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===h)continue;return s}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(\"suspendedStart\"===r)throw r=\"completed\",n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);r=\"executing\";var c=u(t,e,n);if(\"normal\"===c.type){if(r=n.done?\"completed\":\"suspendedYield\",c.arg===h)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(r=\"completed\",n.method=\"throw\",n.arg=c.arg)}}}(t,n,a),o}function u(t,e,n){try{return{type:\"normal\",arg:t.call(e,n)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=l;var h={};function p(){}function f(){}function d(){}var b={};c(b,o,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(j([])));v&&v!==n&&r.call(v,o)&&(b=v);var g=d.prototype=p.prototype=Object.create(b);function y(t){[\"next\",\"throw\",\"return\"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(i,o,a,s){var c=u(t[i],t,o);if(\"throw\"!==c.type){var l=c.arg,h=l.value;return h&&\"object\"==typeof h&&r.call(h,\"__await\")?e.resolve(h.__await).then((function(t){n(\"next\",t,a,s)}),(function(t){n(\"throw\",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n(\"throw\",t,a,s)}))}s(c.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,\"throw\"===e.method){if(t.iterator.return&&(e.method=\"return\",e.arg=void 0,x(t,e),\"throw\"===e.method))return h;e.method=\"throw\",e.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return h}var r=u(n,t.iterator,e.arg);if(\"throw\"===r.type)return e.method=\"throw\",e.arg=r.arg,e.delegate=null,h;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,\"return\"!==e.method&&(e.method=\"next\",e.arg=void 0),e.delegate=null,h):i:(e.method=\"throw\",e.arg=new TypeError(\"iterator result is not an object\"),e.delegate=null,h)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(_,this),this.reset(!0)}function j(t){if(t){var e=t[o];if(e)return e.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return f.prototype=d,c(g,\"constructor\",d),c(d,\"constructor\",f),f.displayName=c(d,s,\"GeneratorFunction\"),e.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===f||\"GeneratorFunction\"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,\"GeneratorFunction\")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},y(w.prototype),c(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new w(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(g),c(g,s,\"Generator\"),c(g,o,(function(){return this})),c(g,\"toString\",(function(){return\"[object Generator]\"})),e.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=j,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)\"t\"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type=\"throw\",a.arg=t,e.next=n,r&&(e.method=\"next\",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if(\"root\"===o.tryLoc)return n(\"end\");if(o.tryLoc<=this.prev){var s=r.call(o,\"catchLoc\"),c=r.call(o,\"finallyLoc\");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error(\"try statement without catch or finally\");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,\"finallyLoc\")&&this.prev<i.finallyLoc){var o=i;break}}o&&(\"break\"===t||\"continue\"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method=\"next\",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if(\"throw\"===r.type){var i=r.arg;k(n)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},\"next\"===this.method&&(this.arg=void 0),h}},e}", "title": "" }, { "docid": "aa02566922a43c52bcf3b10a5b46748f", "score": "0.5059379", "text": "function Util() {\n}", "title": "" }, { "docid": "74a482502833019b430fecb7570b7197", "score": "0.5052944", "text": "function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gl.apply(this,arguments)}", "title": "" }, { "docid": "1b76eeda477659a97ec1bfe7bd97e92a", "score": "0.5049991", "text": "function Example() {}", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.5041351", "text": "function Utils() {}", "title": "" }, { "docid": "95c83684d25f58b42d65a98ed25551cd", "score": "0.5037424", "text": "function c() {}", "title": "" }, { "docid": "95c83684d25f58b42d65a98ed25551cd", "score": "0.5037424", "text": "function c() {}", "title": "" }, { "docid": "810ef888b13bbd3f377664c813c6b2f7", "score": "0.50341105", "text": "function o0(stdlib,o1,Module) {\n try {\n\"use asm\";\n}catch(e){}\n function add(o2,o3) {\n try {\nthis;\n}catch(e){}\n try {\no56.prototype = +e;\n}catch(e){}\n try {\nreturn +(o2+o3);\n}catch(\"TextMetrics\"){}\n }\n \n var o263 = 4096\n \n var o7 = [add,add,add,add];\n \n \n try {\nreturn { \n o4 : o4\n };\n}catch(e){}\n}", "title": "" }, { "docid": "17cda68506bed33128e0ebfb00dfc655", "score": "0.50319433", "text": "export( obj ) {}", "title": "" }, { "docid": "6be0bc88975a5327bf4b6f5b9af054c8", "score": "0.5023327", "text": "mr() {}", "title": "" }, { "docid": "6be0bc88975a5327bf4b6f5b9af054c8", "score": "0.5023327", "text": "mr() {}", "title": "" }, { "docid": "6f442779a5aed173c1a3fd71728b8dd2", "score": "0.5022092", "text": "initialize () {\n }", "title": "" }, { "docid": "952a3578ddd67da9e6695a3637def864", "score": "0.50181746", "text": "function e(t,e,i,s){var a,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(r<3?a(n):r>3?a(e,i,n):a(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n\n/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */}", "title": "" }, { "docid": "1672762961294f9511b9e4dd1af52b4a", "score": "0.50098723", "text": "function Module(global, env, buffer) {\n \"use asm\";\n function test1() {\n var x = 0;\n x = -1 / 1 | 0;\n return x | 0;\n }\n function test2() {\n var x = 0;\n x = (-1 / 1) | 0;\n return x | 0;\n }\n return { test1: test1, test2: test2 };\n}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50044596", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50044596", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50044596", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50044596", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50044596", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50044596", "text": "initialize() {}", "title": "" }, { "docid": "5f84bdf546d3be35c6df995549b1778c", "score": "0.500225", "text": "function Test1() {\n var objs = [\n \"Object\", \"Function\", \"Array\", \"String\", \"Boolean\", \"Number\", \"Math\", \"Date\", \"RegExp\", \"Error\",\n \"Object.prototype\", \"Function.prototype\", \"Array.prototype\", \"String.prototype\", \"Boolean.prototype\",\n \"Number.prototype\", \"Date.prototype\", \"RegExp.prototype\", \"Error.prototype\",\n \"o\", \"f\", \"foo\", \"foo.prototype\", \"a\", \"s\", \"b\", \"n\", \"d\", \"r\", \"e\"\n ]\n \n var props = [\n \"abs\", \"acos\", \"anchor\", \"apply\", \"Array\", \"asin\", \"atan\", \"atan2\", \"big\", \"bind\",\n \"blink\", \"bold\", \"Boolean\", \"call\", \"ceil\", \"charAt\", \"charCodeAt\", \"concat\", \"constructor\", \"cos\",\n \"Date\", \"decodeURI\", \"decodeURIComponent\", \"description\", \"E\", \"encodeURI\", \"encodeURIComponent\", \"escape\", \"Error\", \"eval\", \"EvalError\",\n \"every\", \"exec\", \"exp\", \"flags\", \"filter\", \"fixed\", \"floor\", \"fontcolor\", \"fontsize\", \"forEach\",\n \"fromCharCode\", \"Function\", \"getDate\", \"getDay\", \"getFullYear\", \"getHours\", \"getMilliseconds\", \"getMinutes\", \"getMonth\", \"getSeconds\",\n \"getTime\", \"getTimezoneOffset\", \"getUTCDate\", \"getUTCDay\", \"getUTCFullYear\", \"getUTCHours\", \"getUTCMilliseconds\", \"getUTCMinutes\", \"getUTCMonth\",\n \"getUTCSeconds\", \"getYear\", \"hasOwnProperty\", \"indexOf\", \"Infinity\", \"isFinite\", \"isNaN\", \"isPrototypeOf\", \"italics\", \"join\", \"lastIndexOf\",\n \"length\", \"link\", \"LN10\", \"LN2\", \"localeCompare\", \"log\", \"LOG10E\", \"LOG2E\", \"map\", \"Math\",\n \"max\", \"MAX_VALUE\", \"match\", \"message\", \"min\", \"MIN_VALUE\", \"NaN\", \"name\", \"Now\", \"Number\",\n \"number\", \"NEGATIVE_INFINITY\", \"Object\", \"parse\", \"parseFloat\", \"parseInt\", \"PI\", \"pop\", \"POSITIVE_INFINITY\", \"pow\",\n \"propertyIsEnumerable\", \"prototype\", \"push\", \"random\", \"RangeError\", \"reduce\", \"reduceRight\", \"ReferenceError\", \"replace\", \"reverse\",\n \"round\", \"RegExp\", \"search\", \"setDate\", \"setFullYear\", \"setHours\", \"setMilliseconds\", \"setMinutes\", \"setMonth\", \"setSeconds\",\n \"setTime\", \"setUTCDate\", \"setUTCFullYear\", \"setUTCHours\", \"setUTCMilliseconds\", \"setUTCMinutes\", \"setUTCMonth\", \"setUTCSeconds\", \"setYear\", \"shift\",\n \"sin\", \"slice\", \"some\", \"sort\", \"source\", \"splice\", \"split\", \"sqrt\", \"SQRT1_2\", \"SQRT2\",\n \"strike\", \"String\", \"sub\", \"substring\", \"substr\", \"sup\", \"SyntaxError\", \"tan\", \"test\", \"toDateString\",\n \"toExponential\", \"toFixed\", \"toISOString\", \"toJSON\", \"toLocaleDateString\", \"toLocaleLowerCase\", \"toLocaleString\", \"toLocaleTimeString\",\n \"toLocaleUpperCase\", \"toLowerCase\", \"toPrecision\", \"toString\", \"toTimeString\", \"toUpperCase\", \"toUTCString\", \"trim\", \"TypeError\", \"undefined\",\n \"unescape\", \"unshift\", \"URIError\", \"UTC\", \"valueOf\", \"enumerable\", \"configurable\", \"writable\", \"value\", \"get\", \"set\", \"defineProperty\",\n \"defineProperties\", \"toGMTString\", \"compile\", \"global\", \"lastIndex\", \"multiline\", \"ignoreCase\", \"index\", \"input\",\n \"lastMatch\", \"lastParen\", \"leftContext\", \"rightContext\",\n \"x\", \"y\"\n ];\n \n for (var i=0; i<objs.length; i++)\n {\n for (var j=0; j< props.length; j++)\n {\n doEval(objs[i] + \".propertyIsEnumerable(\\\"\" + props[j] + \"\\\")\");\n }\n }\n}", "title": "" }, { "docid": "d588b4437f06c3807eac1bc17c01d016", "score": "0.49999616", "text": "function Utils() {\n\n}", "title": "" }, { "docid": "61ca88693656d589c172066000bfffa2", "score": "0.49964932", "text": "initialize() {\n }", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49774095", "text": "constructor() {}", "title": "" } ]
8384dc3b135b8bc2587ef2dcd4eefae9
Add libdoc xml libraries that will be used if python/robot environment is not available. libraries: list of paths pointing to libdoc xml files.
[ { "docid": "00cb83e5430308d75b7cada8b55f45d2", "score": "0.67179525", "text": "addFallbackLibraries(libdocPaths){\r\n for(const libraryPath of libdocPaths){\r\n const libraryName = pathUtils.basename(libraryPath, pathUtils.extname(libraryPath))\r\n fallbackLibraries.set(libraryName, {path: libraryPath, name: libraryName})\r\n }\r\n }", "title": "" } ]
[ { "docid": "2f7798c3433c8b6b4fbccaadf9f84e9f", "score": "0.5916945", "text": "addLibrary(lib) {\n this.tree\n .getRootNode()\n .addChildren(this.createLibraryNode(lib));\n }", "title": "" }, { "docid": "9112d0508d7e279ed507b7378df50148", "score": "0.55790097", "text": "function loadLib() {\n //INSERT LIB\n }", "title": "" }, { "docid": "1f22cb324ca4bea99c3f6cdaeec7c462", "score": "0.5566178", "text": "function library(library, dependencies) {\r\n\t\r\n}", "title": "" }, { "docid": "6bd98963f9b0b85b7c645ab7fe5774db", "score": "0.5475554", "text": "function loadLibraries(libraries, callback) {\n // libNames keeps track of all libraries which are not executed yet.\n var libNames = [];\n\n // complete() generates a function that when invokes, markes library 'name'\n // as been loaded. That is, the returned function removes it from the\n // list of names.\n function complete(name) {\n return function() {\n var index = libNames.indexOf(name);\n libNames.splice(index, 1);\n if (libNames.length == 0) {\n\tcallback();\n }\n }\n }\n\n libraries.forEach(function(e) {\n libNames.push(e.name);\n gapi.client.load(e.name, e.version, complete(e.name), e.root);\n });\n}", "title": "" }, { "docid": "4ca8631a1ebbf5a130435e1be50d4ee2", "score": "0.5308535", "text": "function Libraries() {\n this._registry = [];\n this._coreLibIndex = 0;\n }", "title": "" }, { "docid": "6a6567773dce5cd57838a66cd999bbe4", "score": "0.5224541", "text": "function linkingOptions(libraries, cb) {\n cb(_.reduce(libraries, function(built, path) {\n //TODO: does this work *with* a space?\n return built + ' -I' + environment.headers() + path + ' ';\n }, ''));\n}", "title": "" }, { "docid": "a7d702de659ef386b1997835ee7d691b", "score": "0.51730114", "text": "static set symlinkLibraries(value) {}", "title": "" }, { "docid": "b967b23afed96c15316a7a42d2f93b9f", "score": "0.5118507", "text": "function loadFailedLibraries(libraryNames){\n const libraries = []\n for(const libraryName of libraryNames){\n const fallbackLibrary = fallbackLibraries.get(libraryName)\n if(fallbackLibrary){\n let fileContent = fs.readFileSync(fallbackLibrary.path).toString();\n libraries.push({\n status: 'success',\n message: 'Library is in process of being imported',\n fallback: true,\n name: libraryName,\n xmlLibdocPath: fallbackLibrary.path\n })\n libRepo.appendLibraries(libraries)\n }\n }\n}", "title": "" }, { "docid": "8c97aa0db4cfb9c908c2e2c7368805b7", "score": "0.5118503", "text": "async __notifyLibraries() {\n if (this.__librariesNotified) {\n return;\n }\n this.__librariesNotified = true;\n for (\n let i = 0, arr = this._compilerApi.getLibraryApis();\n i < arr.length;\n i++\n ) {\n let libraryApi = arr[i];\n await libraryApi.load();\n }\n await this._compilerApi.afterLibrariesLoaded();\n }", "title": "" }, { "docid": "04c26a6fb6ee2f14038945103f590474", "score": "0.511323", "text": "function parseLibraries(libraries) {\n\t\t\n\t\tvar geoJson = xmlToGeoJson(libraries);\n\t\t\n\t\tvar map = initMap();\n\n var popup = L.popup();\n\n function onMapClick(e) {\n popup\n .setLatLng(e.latlng)\n .setContent(\"<pre>\" + JSON.stringify(geoJson, null, 2) +\"</pre>\")\n .openOn(map);\n }\n \n map.on('click', onMapClick);\n\n L.geoJSON(geoJson, {\n onEachFeature: displayLibraryInfo\n }).addTo(map);\n\t}", "title": "" }, { "docid": "8f3f77d762a0e9a77b46bbd50bdd6faa", "score": "0.5110421", "text": "importLibraries(libDir, pythonExecutable){\r\n if(importStatus==='busy' || importStatus==='scheduled'){\r\n importStatus = 'scheduled'\r\n return Promise.resolve('scheduled')\r\n } else{\r\n importStatus = 'busy'\r\n }\r\n const libraryNames = getLibraryNames()\r\n try{\r\n libRepo.reset(libraryNames)\r\n keywordsRepo.reset(libDir)\r\n loadFailedLibraries(libraryNames)\r\n parseManagedLibraries()\r\n const moduleSearchPath = getRobotDistinctPaths()\r\n return libRepo.importLibraries(libraryNames, libDir, moduleSearchPath, pythonExecutable).then (()=>{\r\n parseManagedLibraries()\r\n if(importStatus==='busy'){\r\n importStatus = 'idle'\r\n return 'finished'\r\n } else if(importStatus==='scheduled'){\r\n importStatus = 'idle'\r\n return this.importLibraries(libDir, pythonExecutable)\r\n }\r\n })\r\n } catch(error){\r\n const libraries = libRepo.getLibrariesByName()\r\n const missingLibraries = []\r\n for(libraryName of libraryNames){\r\n if(!libraries.get(libraryName)){\r\n missingLibraries.push({\r\n name: libraryName,\r\n status: 'error',\r\n message: `${error.stack ? error.stack : error}`,\r\n fallback: false\r\n })\r\n }\r\n }\r\n libRepo.appendLibraries(missingLibraries)\r\n return 'finished'\r\n }\r\n }", "title": "" }, { "docid": "3bde4c8b864e4ee20d297d9a51f71479", "score": "0.50601643", "text": "function AemClientLibraries () {\n}", "title": "" }, { "docid": "93d070c68b4de2a6b3a97c01d455e47d", "score": "0.4726548", "text": "function fetchedMyLibraries(libs) {\n return {type: \"FETCHED_MY_LIBRARIES\", payload: libs}\n}", "title": "" }, { "docid": "4f3ae5230acaf5761042285c7b96abf4", "score": "0.47146934", "text": "function updateTheLibs(libs, latestVersions){\n var libRegex = /\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/(.+?)\\/(.+?)\\//g;\n data.reduce((libs, group)=>{\n return group.items.reduce((libs, item)=>{\n if (item.data.html.match(cloudFlareRegex)) {\n\n item.data.html = item.data.html.replace(libRegex, function (full, name, version){\n return `//cdnjs.cloudflare.com/ajax/libs/${name}/${latestVersions[name] || version}/`;\n });\n\n getData.update(item);\n }\n }, libs)\n }, []);\n}", "title": "" }, { "docid": "466ce69bfebce8fc6d3ff6a382e64fed", "score": "0.4694787", "text": "checkLibraries() {\n const constructor = this;\n const regex = /__[^_]+_+/g;\n let unlinkedLibraries = constructor.binary.match(regex);\n\n if (unlinkedLibraries !== null) {\n unlinkedLibraries = unlinkedLibraries\n .map((\n name // Remove underscores\n ) => name.replace(/_/g, \"\"))\n .sort()\n .filter((name, index, arr) => {\n // Remove duplicates\n if (index + 1 >= arr.length) {\n return true;\n }\n\n return name !== arr[index + 1];\n })\n .join(\", \");\n\n const error = `${\n constructor.contractName\n } contains unresolved libraries. You must deploy and link the following libraries before you can deploy a new version of ${\n constructor.contractName\n }: ${unlinkedLibraries}`;\n\n throw new Error(error);\n }\n }", "title": "" }, { "docid": "499e4b2dd73e76f1c59bffe03289433e", "score": "0.46875462", "text": "static get symlinkLibraries() {}", "title": "" }, { "docid": "2bbf6ecc83fc7ff26842f63d6e95077b", "score": "0.45508626", "text": "function GenerateStandardDynamicLibraryMakefiles( library,\n winDefFile, extraDefinitions, winExtraDefinitions, extraIncludeDirs, extraLibDirs, extraLibraries )\n{\n writeSeparator();\n console.writeln( \"Generating makefiles for dynamic library: \" + library );\n console.flush();\n\n var files = new FileLists( PCLSRCDIR + '/' + library );\n\n var parameters = new GeneratorParameters();\n parameters.id = File.extractName( library );\n parameters.type = \"DynamicLibrary\";\n parameters.official = true;\n parameters.winDefFile = winDefFile;\n parameters.winExtraDefinitions.push( \"_CRT_SECURE_NO_WARNINGS\" );\n for ( var i = 0; i < extraDefinitions.length; ++i )\n parameters.extraDefinitions.push( extraDefinitions[i] );\n for ( var i = 0; i < winExtraDefinitions.length; ++i )\n parameters.winExtraDefinitions.push( winExtraDefinitions[i] );\n for ( var i = 0; i < extraIncludeDirs.length; ++i )\n parameters.extraIncludeDirs.push( extraIncludeDirs[i] );\n for ( var i = 0; i < extraLibDirs.length; ++i )\n parameters.extraLibDirs.push( extraLibDirs[i] );\n for ( var i = 0; i < extraLibraries.length; ++i )\n parameters.extraLibraries.push( extraLibraries[i] );\n\n GenerateAll( files, parameters );\n}", "title": "" }, { "docid": "fd05d89b0b085560e9896d7b8c230479", "score": "0.4518461", "text": "function GenerateStandardStaticLibraryMakefiles( library, extraDefinitions, winExtraDefinitions, extraIncludeDirs )\n{\n writeSeparator();\n console.writeln( \"Generating makefiles for static library: \" + library );\n console.flush();\n\n var files = new FileLists( PCLSRCDIR + '/' + library );\n\n var parameters = new GeneratorParameters();\n parameters.id = File.extractName( library );\n parameters.type = \"StaticLibrary\";\n parameters.official = true;\n parameters.winExtraDefinitions.push( \"_CRT_SECURE_NO_WARNINGS\" );\n for ( var i = 0; i < extraDefinitions.length; ++i )\n parameters.extraDefinitions.push( extraDefinitions[i] );\n for ( var i = 0; i < winExtraDefinitions.length; ++i )\n parameters.winExtraDefinitions.push( winExtraDefinitions[i] );\n for ( var i = 0; i < extraIncludeDirs.length; ++i )\n parameters.extraIncludeDirs.push( extraIncludeDirs[i] );\n\n GenerateAll( files, parameters );\n}", "title": "" }, { "docid": "9466a661ed95ec7fba058da32bcbed1b", "score": "0.45145917", "text": "function addLibraryPlugin(lib) {\n\t lib.fn.swiper = function (params) {\n\t var firstInstance;\n\t lib(this).each(function () {\n\t var s = new Swiper(this, params);\n\t if (!firstInstance) firstInstance = s;\n\t });\n\t return firstInstance;\n\t };\n\t }", "title": "" }, { "docid": "9466a661ed95ec7fba058da32bcbed1b", "score": "0.45145917", "text": "function addLibraryPlugin(lib) {\n\t lib.fn.swiper = function (params) {\n\t var firstInstance;\n\t lib(this).each(function () {\n\t var s = new Swiper(this, params);\n\t if (!firstInstance) firstInstance = s;\n\t });\n\t return firstInstance;\n\t };\n\t }", "title": "" }, { "docid": "9466a661ed95ec7fba058da32bcbed1b", "score": "0.45145917", "text": "function addLibraryPlugin(lib) {\n\t lib.fn.swiper = function (params) {\n\t var firstInstance;\n\t lib(this).each(function () {\n\t var s = new Swiper(this, params);\n\t if (!firstInstance) firstInstance = s;\n\t });\n\t return firstInstance;\n\t };\n\t }", "title": "" }, { "docid": "9466a661ed95ec7fba058da32bcbed1b", "score": "0.45145917", "text": "function addLibraryPlugin(lib) {\n\t lib.fn.swiper = function (params) {\n\t var firstInstance;\n\t lib(this).each(function () {\n\t var s = new Swiper(this, params);\n\t if (!firstInstance) firstInstance = s;\n\t });\n\t return firstInstance;\n\t };\n\t }", "title": "" }, { "docid": "3dda72d6439d0f474d536e14c8ca916b", "score": "0.45119956", "text": "function onReceivingXmls(env, resolve, xmls) {\n //packages.config must be aligned with new versions (e.g: Mongodb)\n //xmls[].proj\n //xmls[].projPath\n //xmls[].xmlDoc\n //xmls[].assemblyName\n this.solutions[env] = xmls;\n this.csprojDirs[env] = xmls.map(function(xml) { return xml.projPath });\n resolve();\n}", "title": "" }, { "docid": "691b4c38eb6038928a24bfa17c6f28ef", "score": "0.44949266", "text": "function addDocLibrary(docLibaryName, docLibaryType, loadFromHostWeb) {\n var deferred = $q.defer();\n var requestDigest = spContext.securityValidation;\n var url = addRequestExecuterContext(loadFromHostWeb, documentUrl, spContext.hostWeb.url);\n\n var req = {\n method: 'POST',\n url: url,\n headers: {\n 'accept': 'application/json;odata=verbose',\n 'content-type': 'application/json;odata=verbose',\n 'X-RequestDigest': requestDigest\n },\n data: JSON.stringify({\n '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 101,\n 'ContentTypesEnabled': true, 'Description': docLibaryType, 'Title': docLibaryName\n })\n };\n\n\n $http(req).then(function (data) {\n log.Debug('data', data, serviceId + '.addDocLibrary');\n\n deferred.resolve(data);\n }, function (error) {\n log.Error('ERROR', error, serviceId + '.addDocLibrary');\n deferred.reject(error);\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "c939945a009786beba9861c51205025d", "score": "0.44937742", "text": "function addLibraryPath(env) {\n if (!kNodeShared) {\n return;\n }\n\n env = env || process.env;\n env.LD_LIBRARY_PATH = (env.LD_LIBRARY_PATH ? env.LD_LIBRARY_PATH + path.delimiter : '') + path.join(kExecPath, 'lib.target'); // For AIX.\n\n env.LIBPATH = (env.LIBPATH ? env.LIBPATH + path.delimiter : '') + path.join(kExecPath, 'lib.target'); // For Mac OSX.\n\n env.DYLD_LIBRARY_PATH = (env.DYLD_LIBRARY_PATH ? env.DYLD_LIBRARY_PATH + path.delimiter : '') + kExecPath; // For Windows.\n\n env.PATH = (env.PATH ? env.PATH + path.delimiter : '') + kExecPath;\n} // Get the full path of shared lib.", "title": "" }, { "docid": "e4f03be1ce151215da0aa4d080c78366", "score": "0.4487761", "text": "async afterLibrariesLoaded() {\n for (let arr = this.getLibraryApis(), i = 0; i < arr.length; i++) {\n await arr[i].afterLibrariesLoaded();\n }\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "89a1014e84dada3aac79f6769344a9de", "score": "0.44621542", "text": "function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }", "title": "" }, { "docid": "7d444e400641d8022e02fc468271527a", "score": "0.44583833", "text": "function findAllLibraries(libraryIds) {\n\n var deferred = q.defer();\n\n LibraryModel\n .find({'_id': { $in: libraryIds}}, function(err, libraryObjects) {\n\n if(err) {\n deferred.reject(err); // reject\n } else {\n deferred.resolve(libraryObjects);\n }\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "c8c341574536f4f247cab8168517dbad", "score": "0.44500625", "text": "function importLibs() {\n if (!imported) {\n\n\n //require('./js/favorites.js');\n\n imported = true;\n }\n }", "title": "" }, { "docid": "91fe63bdf2b3e73e31f09005a0e2131e", "score": "0.44494277", "text": "function populateLibrary( library )\n{\t\n\t//'library' contains all of the links to the user's images.\n\tfor (var i = 0; i < library.length; i++)\n\t{\n\t\t//add an image to the UI\n\t\taddBookmark( library[ i ] );\n\t}\n}", "title": "" }, { "docid": "fdd2995d7e6db5eba362f0f8fcb2da31", "score": "0.43583742", "text": "function addBookToLibrary() {\n let argsArray = [...arguments];\n for(let i = 0; i < argsArray.length; i++) {\n myLibrary.push(argsArray[i]);\n }\n}", "title": "" }, { "docid": "43b4017375d8a28d307c474a9f45790a", "score": "0.433945", "text": "addNativeLibrary(nativeLibraryPathAndFilename) {\n\t\tthis.nativeLibraries.push(nativeLibraryPathAndFilename);\n\t}", "title": "" }, { "docid": "22874e5967d896db1c0bf620ab71c3ef", "score": "0.43370494", "text": "function makeDoclet(tagStrings) {\n var comment = '/**\\n' + tagStrings.join('\\n') + '\\n*/';\n\n return new jsdoc.doclet.Doclet(comment, {});\n }", "title": "" }, { "docid": "b635783f3f21b70981e496f5ae682946", "score": "0.42685592", "text": "function loadLib() {//loads specified library\n console.log(\"fired loadLib\");\n gapi.client.load('analytics', 'v3', makeApiCall);\n }", "title": "" }, { "docid": "cb79e274a3e4221ebeb0be497d722fcd", "score": "0.4243505", "text": "function addBookToLibrary(book) {\n myLibrary.push(book);\n render(myLibrary);\n}", "title": "" }, { "docid": "6f3c550460cbfe36333dd77e01efb6bd", "score": "0.42342484", "text": "function init() {\n\t\tif (trimlibs === false) {\n\t\t\ttrimlibs = {};\n\t\t\t$('link[rel=trimlib]').each(function() {\n\t\t\t\tvar trimlib = new Trimlib(this);\n\t\t\t\ttrimlibs[trimlib.namespace] = trimlib;\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e800faed3dd38d534b98ad2a0197d8b6", "score": "0.42153233", "text": "function addBookToLibrary(book) {\n myLibrary.push(book);\n}", "title": "" }, { "docid": "e800faed3dd38d534b98ad2a0197d8b6", "score": "0.42153233", "text": "function addBookToLibrary(book) {\n myLibrary.push(book);\n}", "title": "" }, { "docid": "ee88c591851e4a1c61e55de294ee6336", "score": "0.4208931", "text": "function addBookToLibrary(newBook) {\n library.push(newBook);\n}", "title": "" }, { "docid": "762b02830df49909c9e7852cd1899ca8", "score": "0.42044628", "text": "getLibrariesByName(libraryName){\r\n return libRepo.getLibrariesByName()\r\n }", "title": "" }, { "docid": "0314c01369fe9b7532c83806b43e89ff", "score": "0.41982183", "text": "function inject_imports(doc,callback,baseurl)\n {\n if (!baseurl)\n baseurl = \"\";\n\n var imports = null;\n var stylesheet = doc.selectSingleNode(\"/xsl:stylesheet\");\n if (stylesheet)\n imports = stylesheet.selectNodes(\"xsl:import\");\n\n if (!imports || imports.length==0)\n {\n if (callback)\n callback();\n return;\n }\n\n // Using \"idoc\" for callbacks to distiguish between the document\n // element of the outer and inner closures.\n\n // I prefer a non-nodelist snapshot of the import nodes. I'm not\n // confident that removing the elements as we process them will\n // change the contents of the nodelist or properly decrement the\n // value of imports.length.\n var arr_imports = [];\n for (var i=0; i<imports.length; ++i)\n arr_imports.push(imports[i]);\n\n // Force synchronous processing to ensure order of import priority\n function pop_and_process()\n {\n if (arr_imports.length)\n {\n var ireq = arr_imports.pop();\n var iurl = baseurl + ireq.getAttribute(\"href\");\n\n function readydoc(idoc)\n {\n merge_elements(idoc, ireq);\n stylesheet.removeChild(ireq);\n pop_and_process();\n }\n \n function gotdoc(idoc)\n {\n if (idoc)\n inject_imports(idoc, function(){readydoc(idoc);}, get_baseurl(iurl));\n else\n console.log(\"inject_imports failed to open '\" + iurl + \"'\");\n }\n\n // Use getNewDoc to impose namespace:\n getNewDoc(iurl, gotdoc, nsXSL);\n }\n else\n callback();\n }\n\n pop_and_process();\n\n function merge_elements(idoc, importnode)\n {\n var nl = idoc.selectNodes(\"/xsl:stylesheet/*\");\n\n // Insert every child that doesn't already exist in doc:\n for (var i=0, stop=nl.length; i<stop; ++i)\n {\n var node = nl[i];\n var name = node.tagName;\n \n // Make xpath to same-named nodes (homonyms) in doc:\n var xpath = \"/xsl:stylesheet/\" + name;\n for (var j=0; j<ta_len; ++j)\n {\n var testname = tmpl_attribs[j];\n var aname = node.getAttribute(testname);\n\n if (aname)\n {\n aname = aname.replace(/\\'/g, '&apos;');\n xpath += \"[@\" + testname + \"='\" + aname + \"']\";\n }\n else\n xpath += \"[not(@\" + testname + \")]\";\n }\n\n // Find any homonyms, only insert node if not already there:\n var homonyms = doc.selectNodes(xpath);\n if (homonyms.length==0)\n stylesheet.insertBefore(make_importable_node(doc,node,true),\n importnode);\n }\n }\n }", "title": "" }, { "docid": "1951c6607f4a81696781218ee494cc46", "score": "0.41605935", "text": "function loadlibs(done) {\n\t if(typeof window.d33 === 'undefined'){\n $.getScript(d33_LIB_URL, function(data, textStatus, jqxhr) {\n window.d33 = window.d3;\n window.d3 = null;\n console.log(\"just loaded!\", window.d33.version);\n done(textStatus === 'success');\n }); \n\t }else{ \n console.log(d33.version, \" is already loaded\");\n done(true);\n } \n\n\t}", "title": "" }, { "docid": "90602897ef5a71b6cb7087961adbef8c", "score": "0.4157849", "text": "function xmlMerge(resolve) {\n var solutionData = this.solutions.mainSolution;\n for (var csprojIndex = 0, csproj, references, assemblyPath; csproj = solutionData[csprojIndex]; csprojIndex++) {\n references = csproj.xmlDoc.documentElement.getElementsByTagName('Reference');\n assemblyPath = utils.strFormat('{0}\\\\{1}\\\\{2}\\\\{3}.dll', csproj.projPath, 'bin', 'debug', csproj.assemblyName);\n for (var referenceIndex = 0, reference; reference = references[referenceIndex]; i++) {\n changeXmlCsproj.call(this, csproj.assemblyName, assemblyPath, reference, csproj.projPath);\n }\n }\n\n writeXmls.call(this);\n resolve();\n}", "title": "" }, { "docid": "f1008dbe045bf34fbb92d3395f7325f1", "score": "0.4148647", "text": "async function uploadLibraryFiles(files) {\n try {\n disableUploads();\n if (files.length === 0) {\n return;\n }\n else if (files.length > 1) {\n throw \"Can't upload more than one file\";\n }\n const file = files[0];\n if (file.type !== \"application/json\") {\n throw \"Only json files are supported for upload\";\n }\n const library = await new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener(\"load\", () => {\n try {\n resolve(JSON.parse(reader.result));\n }\n catch (err) {\n reject(err);\n }\n });\n reader.addEventListener(\"error\", evt => {\n reject(evt);\n });\n reader.readAsText(file);\n });\n setFileData(library.playlists, library.albums);\n }\n catch (err) {\n toast(err);\n }\n finally {\n enableUploads();\n }\n }", "title": "" }, { "docid": "b2309ac1f41a8879fb4e0d9a4287488a", "score": "0.4122463", "text": "function setup(){\n loadDoc(document.head, \"head\", true, [], basicLoad);\n loadDoc(document.body, \"header\", true, [], basicLoad);\n loadDoc(document.body, \"footer\", false, [], basicLoad);\n}", "title": "" }, { "docid": "cd9f76e7b2ac0ec78ddf69f61a4df126", "score": "0.41203526", "text": "loadLibraries() {\n const script = document.createElement('script');\n const link = document.createElement('link');\n\n script.src = \"https://cdn.jsdelivr.net/npm/spectrum-colorpicker2/dist/spectrum.min.js\";\n link.href = \"https://cdn.jsdelivr.net/npm/spectrum-colorpicker2/dist/spectrum.min.css\";\n link.rel = \"stylesheet\";\n\n document.body.append(link);\n document.body.append(script);\n }", "title": "" }, { "docid": "68ef938d8cd71fd3a61e4ab6ad9d0d3c", "score": "0.41195667", "text": "function trySwaggerCodegenInLib() {\n return kew.fcall(function () {\n var lib = path.join(libPath, 'location.js');\n var liblock ='C:\\\\Dgital\\\\Project\\\\swagger-codegen\\\\Test\\\\node_modules\\\\swagger-codegen\\\\lib\\\\location.js';\n var file = fso.existsSync(liblock);\n console.log('lib: ' + liblock +' exists: '+file)\n var libModule = require(lib)\n if (libModule.location) {\n console.log('swagger-codegen is previously installed at ' + libModule.location)\n exit(0)\n }\n }).fail(function (e) {\n //console.log(\"errror:\" + e)\n // silently swallow any errors\n })\n}", "title": "" }, { "docid": "87e8f974671e00df7bc11b80a989e18b", "score": "0.41180393", "text": "function mklib(lib) {\n if (Array.isArray(lib)) {\n lib = { sources: lib }\n } else if (typeof lib == \"string\") {\n lib = { sources: [lib] }\n } else {\n lib = deepclone(lib) // copy so we can modify\n if (!lib.sources) {\n throw new Error(`missing \"sources\" list property in lib ${lib.name||\"\"}`)\n } else if (!Array.isArray(lib.sources)) {\n lib.sources = [ lib.sources ]\n }\n }\n if (!lib.name) {\n lib.name = `clib_${autoNameCounter++}`\n }\n lib[kConfig] = config\n lib.__proto__ = Lib.prototype\n config.clibs.push(lib)\n return lib\n }", "title": "" }, { "docid": "267529823e7e19a9908ee8272c15234d", "score": "0.41157848", "text": "function addToLibrary(_title, _author, _pages, _read) {\n const newBook = new book(_title, _author, _pages, _read)\n myLibrary.push(newBook)\n}", "title": "" }, { "docid": "23177b2f0dd6f9aa9c83d0905daee68e", "score": "0.41044226", "text": "function getSubLibrary(subLibraries, code) {\n\tvar subLibraryLogic;\n\n\tfor (var i = 0; i < subLibraries.length; i++) {\n\t\tif (subLibraries[i].getAttribute('id') == code) {\n\t\t\tsubLibraryLogic = subLibraries[i];\n\t\t}\n\t}\n\treturn subLibraryLogic;\n}", "title": "" }, { "docid": "5c3a9e5aa027ec34c30fd479cbe0d8c4", "score": "0.40988418", "text": "async function package_deps() {\n // Add entries from package-deps here manually\n // (to prevent loading atom-package-deps and package.json when the deps are already loaded)\n const deps = [\"atom-ide-base\", \"atom-typescript\", \"linter-eslint\", \"autocomplete-paths\", \"javascript-drag-import\"]\n if (deps.some((p) => !atom.packages.isPackageLoaded(p))) {\n await import(\"atom-package-deps\").then((atom_package_deps) => {\n // install if not installed\n atom_package_deps.install(\"atom-ide-javascript\", false)\n // enable if disabled\n deps\n .filter((p) => !atom.packages.isPackageLoaded(p))\n .forEach((p) => {\n atom.notifications.addInfo(`Enabling package ${p} that is needed for atom-ide-javascript`)\n atom.packages.enablePackage(p)\n })\n })\n }\n}", "title": "" }, { "docid": "9feb2e7072bc08d8326672e6039d21e5", "score": "0.4095724", "text": "async function getLibDefs(defsDir) {\n const libDefs = [];\n const defsDirItems = await _node.fs.readdir(defsDir);\n await P.all(defsDirItems.map(async item => {\n const itemPath = _node.path.join(defsDir, item);\n\n const itemStat = await _node.fs.stat(itemPath);\n\n if (itemStat.isDirectory()) {\n if (item.charAt(0) === '@') {\n // directory is of the form '@<scope>', so go one level deeper\n const scope = item;\n const defsDirItems = await _node.fs.readdir(itemPath);\n await P.all(defsDirItems.map(async item => {\n const itemPath = _node.path.join(defsDir, scope, item);\n\n const itemStat = await _node.fs.stat(itemPath);\n\n if (itemStat.isDirectory()) {\n // itemPath is a lib dir\n await addLibDefs(itemPath, libDefs);\n } else {\n const error = `Expected only directories in the 'definitions/npm/@<scope>' directory!`;\n throw new _ValidationError.ValidationError(error);\n }\n }));\n } else {\n // itemPath is a lib dir\n await addLibDefs(itemPath, libDefs);\n }\n } else {\n const error = `Expected only directories in the 'definitions/npm' directory!`;\n throw new _ValidationError.ValidationError(error);\n }\n }));\n return libDefs;\n}", "title": "" }, { "docid": "c9ca205fa937db16b84cdca78ffa9a58", "score": "0.40953997", "text": "function isLibrary() {\n return fs.existsSync(path + '/bin/trinte');\n}", "title": "" }, { "docid": "73ad65d876d2552cb4ed4a2a4a94a227", "score": "0.4095088", "text": "function Dapps(cb, _library) {\n\t\t\tself = this;\n\t\t\tlibrary = _library;\n\t\t\tcb(null, self);\n\t\t}", "title": "" }, { "docid": "ae69dcae70f6807f8e287ffdfcb483d2", "score": "0.4093007", "text": "function Dapps(cb, _library) {\n\t\tself = this;\n\t\tlibrary = _library;\n\t\tcb(null, self);\n\t}", "title": "" }, { "docid": "fa5334327f15189b81f853bf44dd21d0", "score": "0.40738285", "text": "async function buildDocs(paths) {\n\n const { inputPath, outputPath } = paths;\n\n const sourcePaths = await sourceFilesInDirectory(inputPath);\n const projectDocs = await projectDocsFromSourceFiles(sourcePaths);\n \n // Skip extending documentation in diagnostic mode.\n if (!WRITE_UNEXTENDEDONLY) {\n extendDocs(projectDocs);\n }\n \n // Clean output folder by removing it then recreating it.\n await removeAsync(outputPath);\n await ensureDirAsync(outputPath);\n\n await writeProjectDocsToDirectory(projectDocs, outputPath);\n \n if (WRITE_UNEXTENDEDONLY) {\n // Issue an error to note this diagnostic path.\n process.exit(1);\n }\n}", "title": "" }, { "docid": "bfe90d2860d381218822255ddc2b04bf", "score": "0.406624", "text": "mergeAddons(addonConfig, requestedLibraries, config) {\n\n let dependencies = config.dependencies;\n let devDependencies = config.devDependencies;\n // let rmDependencies = config.rmDependencies;\n\n for (let key in addonConfig) {\n\n if (requestedLibraries.indexOf(key) !== -1) {\n\n // inject dependencies\n if (addonConfig[key].dependencies) {\n\n for (let depend in addonConfig[key].dependencies) {\n\n dependencies[depend] = addonConfig[key].dependencies[depend];\n\n }\n\n }\n\n // inject dev dependencies\n if (addonConfig[key].devDependencies) {\n\n for (let depend in addonConfig[key].devDependencies) {\n\n devDependencies[depend] = addonConfig[key].devDependencies[depend];\n\n }\n }\n // adding dev dependencies\n }\n\n }\n\n // Remove certain package dependencies\n requestedLibraries.forEach(item => {\n\n if (typeof addonConfig[item] !== undefined &&\n addonConfig[item].rmDependencies !== undefined) {\n\n dependencies = this.removeDependencies(dependencies, addonConfig[item].rmDependencies);\n devDependencies = this.removeDependencies(devDependencies, addonConfig[item].rmDependencies);\n\n }\n\n });\n\n\n // sort package properties\n let sortedDependencies = sortProps(dependencies);\n let sortedDevDependencies = sortProps(devDependencies);\n\n // assing sorted dependencies\n config.dependencies = sortedDependencies;\n config.devDependencies = sortedDevDependencies;\n\n // return new configuration\n return config;\n\n }", "title": "" }, { "docid": "a897165a37cef7b473a798e06a69fd38", "score": "0.4058583", "text": "function addMixinDocs(doc, aliasMap, flUtilities, createDocMessage, log) {\n if (doc.mixins && (doc.mixins.length > 0))\n {\n\tdoc.mixin_docs = _.map(doc.mixins, function(mixin, midx) {\n\t\t\t\t var mdocs = aliasMap.getDocs(mixin);\n\t\t\t\t var md = null;\n\n\t\t\t\t if (mdocs.length < 1)\n\t\t\t\t {\n\t\t\t\t log.warn(createDocMessage('no mixin doc with name \\'' + mixin + '\\'', doc));\n \t\t\t\t }\n\t\t\t\t else if (mdocs.length > 1)\n\t\t\t\t {\n\t\t\t\t log.warn(createDocMessage('multiple mixin docs with name \\'' + mixin + '\\', using first one', doc));\n\t\t\t\t md = mdocs[0];\n \t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t md = mdocs[0];\n\t\t\t\t }\n\n\t\t\t\t if (md)\n\t\t\t\t {\n\t\t\t\t return {\n\t\t\t\t\t id: md.id,\n\t\t\t\t\t name: md.name,\n\t\t\t\t\t state: md.state,\n\t\t\t\t\t type: md.docType,\n\t\t\t\t\t outputPath: md.outputPath,\n\t\t\t\t\t path: md.path\n\t\t\t\t };\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t return { };\n\t\t\t\t }\n\t\t\t });\n }\n else\n {\n\tdoc.mixin_docs = [ ];\n }\n}", "title": "" }, { "docid": "2a50c6bb6f6c53dd9b00a5e5811e4bed", "score": "0.4050518", "text": "function iterateLibaries(libaries, file) {\n if(libaries.length > 0) {\n libaries.forEach(libary => {\n var tag = file == 'css' ? 'link' : false || file == 'js'? 'script' : false;\n var cdn = document.createElement(tag);\n \n if(libary[1].css.length > 0 && file == 'css') {\n console.log(3,' Append CDN CSS');\n cdn.rel = 'stylesheet';\n cdn.href = libary[1].css\n banner.append(cdn); //document.head.appendChild(cdn);\n }\n if(libary[1].javascript.length > 0 && file == 'js') {\n console.log(5,' Append CDN JS');\n cdn.src = libary[1].javascript;\n banner.append(cdn); //document.body.appendChild(cdn);\n }\n });\n }\n }", "title": "" }, { "docid": "a058ad048aa85bab6f312c8d688f6cf4", "score": "0.4046447", "text": "function validPath(librarypath) {\n var extension = path.extname(librarypath);\n if (extension != '.xml')\n return false;\n return true;\n}", "title": "" }, { "docid": "3f393f5bfe7e7fd96e864bcf69867dc7", "score": "0.4032479", "text": "async function package_deps() {\n // Add entries from package-deps here manually\n // (to prevent loading atom-package-deps and package.json when the deps are already loaded)\n const deps = [\"atom-ide-base\", \"atom-typescript\", \"linter-eslint\", \"autocomplete-paths\", \"javascript-drag-import\"];\n\n if (deps.some(p => !atom.packages.isPackageLoaded(p))) {\n await Promise.resolve().then(() => _interopRequireWildcard(require(\"atom-package-deps\"))).then(atom_package_deps => {\n // install if not installed\n atom_package_deps.install(\"atom-ide-javascript\", false); // enable if disabled\n\n deps.filter(p => !atom.packages.isPackageLoaded(p)).forEach(p => {\n atom.notifications.addInfo(`Enabling package ${p} that is needed for atom-ide-javascript`);\n atom.packages.enablePackage(p);\n });\n });\n }\n}", "title": "" }, { "docid": "1d85a2370c28065d0bfd746e461d369e", "score": "0.40260157", "text": "function installDOM3XPathSupport(doc, p) {\r\n\tdoc.createExpression = function(e, r) {\r\n\t\ttry {\r\n\t\t\treturn new XPathExpression(e, r, p);\r\n\t\t} catch (e) {\r\n\t\t\tthrow new XPathException(XPathException.INVALID_EXPRESSION_ERR, e);\r\n\t\t}\r\n\t};\r\n\tdoc.createNSResolver = function(n) {\r\n\t\treturn new NodeXPathNSResolver(n);\r\n\t};\r\n\tdoc.evaluate = function(e, cn, r, t, res) {\r\n\t\tif (t < 0 || t > 9) {\r\n\t\t\tthrow { code: 0, toString: function() { return \"Request type not supported\"; } };\r\n\t\t}\r\n return doc.createExpression(e, r, p).evaluate(cn, t, res);\r\n\t};\r\n}", "title": "" }, { "docid": "9ba6df1b943ce2ad3f4d91fea81e567a", "score": "0.40247616", "text": "function PsdLib() {\n}", "title": "" }, { "docid": "0995fee590050a99d5d189927e07a62b", "score": "0.40165526", "text": "function displayLibrary(books) {\n document.body.innerHTML = `<div class=\"my-library\">\n ${books.map(getBookHtml).join('')}\n </div>`\n}", "title": "" }, { "docid": "593d498481193980cd6139f603b24e49", "score": "0.4009663", "text": "function addEJ2PackageRootConfig(options, libOptions) {\n return (host) => {\n const workspace = config_1.getWorkspace(host);\n const project = get_project_1.getProjectFromWorkspace(workspace, options.project);\n let validModules;\n let availableModules = libOptions.moduleName.replace(/Module/g, '').trim();\n if (options.modules !== '') {\n let preferredModule = [];\n options.modules.split(',').forEach((module) => {\n let validatedModule = (validateEJ2Modules(module.trim(), libOptions)).toString().trim();\n if (validatedModule === '') {\n console.log('\\x1b[31m%s\\x1b[0m', 'The ' + module + 'module is not part of the' +\n ' package, ' + libOptions.pkgName + '. The available modules are ' + availableModules + '.');\n }\n else {\n preferredModule.push(validatedModule);\n }\n });\n validModules = preferredModule.toString().replace(/,/g, ', ');\n }\n else {\n validModules = libOptions.moduleName;\n }\n (options.modulePath !== undefined && options.modulePath !== \"\") ? addModuleImportToCustomModule(host, options, validModules, libOptions) :\n ast_1.addModuleImportToRootModule(host, validModules, libOptions.pkgName, project);\n return host;\n };\n}", "title": "" }, { "docid": "2af3494a2f22f91f2efd298ed379d67c", "score": "0.40090007", "text": "function AddReferencesForClass1(oProj)\n{\n\ttry\n\t{\n\t\tvar refmanager = GetCSharpReferenceManager(oProj);\n// var bExpanded = IsReferencesNodeExpanded(oProj)\n\t\trefmanager.Add(\"MSCorLib\");\n\t\trefmanager.Add(\"System\");\n\t\trefmanager.Add(\"System.XML\");\n// if(!bExpanded)\n// CollapseReferencesNode(oProj);\n\t}\n\tcatch(e)\n\t{\n\t var L_ErrMsg30_Text = \"Error in adding references for Class: \";\n\t\twizard.ReportError( L_ErrMsg30_Text + e.description);\n\t}\n}", "title": "" }, { "docid": "9ddb2fc422e2f176fa67ce6eb19fdf34", "score": "0.39993513", "text": "function resetLibrary() {\n extEvt.reply(\"reset-library\");\n}", "title": "" }, { "docid": "ed7b73b8b97ea5dad7321a26d1014ee8", "score": "0.3997835", "text": "function addBooktoLibrary(title, author, pages, readNotread){\n let newBook = new Book(title, author, pages, readNotread);\n myLibrary.push(newBook)\n}", "title": "" }, { "docid": "bd07cb3ca28c5404e13c42a4464b618b", "score": "0.39955503", "text": "function installDOM3XPathSupport(doc, p) {\n\tdoc.createExpression = function(e, r) {\n\t\ttry {\n\t\t\treturn new XPathExpression(e, r, p);\n\t\t} catch (e) {\n\t\t\tthrow new XPathException(XPathException.INVALID_EXPRESSION_ERR, e);\n\t\t}\n\t};\n\tdoc.createNSResolver = function(n) {\n\t\treturn new NodeXPathNSResolver(n);\n\t};\n\tdoc.evaluate = function(e, cn, r, t, res) {\n\t\tif (t < 0 || t > 9) {\n\t\t\tthrow { code: 0, toString: function() { return \"Request type not supported\"; } };\n\t\t}\n return doc.createExpression(e, r, p).evaluate(cn, t, res);\n\t};\n}", "title": "" }, { "docid": "bd07cb3ca28c5404e13c42a4464b618b", "score": "0.39955503", "text": "function installDOM3XPathSupport(doc, p) {\n\tdoc.createExpression = function(e, r) {\n\t\ttry {\n\t\t\treturn new XPathExpression(e, r, p);\n\t\t} catch (e) {\n\t\t\tthrow new XPathException(XPathException.INVALID_EXPRESSION_ERR, e);\n\t\t}\n\t};\n\tdoc.createNSResolver = function(n) {\n\t\treturn new NodeXPathNSResolver(n);\n\t};\n\tdoc.evaluate = function(e, cn, r, t, res) {\n\t\tif (t < 0 || t > 9) {\n\t\t\tthrow { code: 0, toString: function() { return \"Request type not supported\"; } };\n\t\t}\n return doc.createExpression(e, r, p).evaluate(cn, t, res);\n\t};\n}", "title": "" }, { "docid": "bd07cb3ca28c5404e13c42a4464b618b", "score": "0.39955503", "text": "function installDOM3XPathSupport(doc, p) {\n\tdoc.createExpression = function(e, r) {\n\t\ttry {\n\t\t\treturn new XPathExpression(e, r, p);\n\t\t} catch (e) {\n\t\t\tthrow new XPathException(XPathException.INVALID_EXPRESSION_ERR, e);\n\t\t}\n\t};\n\tdoc.createNSResolver = function(n) {\n\t\treturn new NodeXPathNSResolver(n);\n\t};\n\tdoc.evaluate = function(e, cn, r, t, res) {\n\t\tif (t < 0 || t > 9) {\n\t\t\tthrow { code: 0, toString: function() { return \"Request type not supported\"; } };\n\t\t}\n return doc.createExpression(e, r, p).evaluate(cn, t, res);\n\t};\n}", "title": "" }, { "docid": "bd07cb3ca28c5404e13c42a4464b618b", "score": "0.39955503", "text": "function installDOM3XPathSupport(doc, p) {\n\tdoc.createExpression = function(e, r) {\n\t\ttry {\n\t\t\treturn new XPathExpression(e, r, p);\n\t\t} catch (e) {\n\t\t\tthrow new XPathException(XPathException.INVALID_EXPRESSION_ERR, e);\n\t\t}\n\t};\n\tdoc.createNSResolver = function(n) {\n\t\treturn new NodeXPathNSResolver(n);\n\t};\n\tdoc.evaluate = function(e, cn, r, t, res) {\n\t\tif (t < 0 || t > 9) {\n\t\t\tthrow { code: 0, toString: function() { return \"Request type not supported\"; } };\n\t\t}\n return doc.createExpression(e, r, p).evaluate(cn, t, res);\n\t};\n}", "title": "" }, { "docid": "61d59b9e3bc0030c31bb51d5ec4ac173", "score": "0.39759344", "text": "function getLibraryNames(){\r\n const libraryNames = new Set(['BuiltIn'])\r\n for(resourceKey in keywordsRepo.resourcesMap){\r\n const resource = keywordsRepo.resourcesMap[resourceKey]\r\n for(const library of resource.imports.libraries){\r\n libraryNames.add(library.name)\r\n }\r\n }\r\n\r\n return Array.from(libraryNames)\r\n}", "title": "" }, { "docid": "35fe28d56e778b5ee9e04b8a115e6ff8", "score": "0.39470264", "text": "function injectLibSources() {\n return new Promise(function (resolve, reject) {\n log('INFO', 'Injecting Lib Sources');\n //run('mkdir tmp');\n mkdirIfNotExist('./projects/tibco-tcstk');\n copyDir('./tmp/TCSDK-Angular/projects/tibco-tcstk', './projects/tibco-tcstk');\n //use debug versions\n var now = new Date();\n mkdirIfNotExist('./backup/');\n // Make Backups in the back up folder\n copyFile('./tsconfig.json', './backup/tsconfig-Before-Debug(' + now + ').json');\n copyFile('./angular.json', './backup/angular-Before-Debug(' + now + ').json');\n copyFile('./package.json', './backup/package-Before-Debug(' + now + ').json');\n copyFile('./tsconfig.debug.json', './tsconfig.json');\n copyFile('./angular.debug.json', './angular.json');\n //copyFile('./package.debug.json', './package.json');\n run('npm uninstall ' + props.TCSTDebugPackages);\n //do NPM install\n //npmInstall('./');\n npmInstall('./', 'lodash-es');\n log('INFO', 'Now you can debug the cloud library sources in your browser !!');\n resolve();\n });\n}", "title": "" }, { "docid": "589b0851de488d04b33ad8dbbc5f9a32", "score": "0.39370304", "text": "function addBookToLibrary(book) {\n myLibrary.push(book)\n setLocal()\n}", "title": "" }, { "docid": "0af14bb4f005c2a9bc7fd59a53b7ff46", "score": "0.3906446", "text": "function addLibraryToHTML(path, html, tab, jsToHead) {\n var libraryExtension = utils.getExtension(path);\n var appendToTag = 'head';\n var tag;\n\n // find what and where to insert the link/script tag\n if (libraryExtension === 'css') {\n tag = '<link rel=\"stylesheet\" href=\"' + path + '\" />';\n } else {\n tag = '<script src=\"' + path + '\"></script>';\n if (!jsToHead) {\n appendToTag = 'body';\n }\n }\n\n // first try to match whitespace prior to the end head/body tag to\n // accurately determine how far to indent the inserted tag\n var rTarget = new RegExp('^([ \\t]*)</' + appendToTag + '>', 'im');\n if (!rTarget.test(html)) {\n // if this doesn't work, resort to just matching the end tag\n rTarget = new RegExp('</' + appendToTag + '>', 'i');\n\n if (!rTarget.test(html)) {\n console.error('Could not find ' + appendToTag + ' tag. Please' +\n ' insert ' + tag + ' yourself.');\n return html;\n }\n }\n\n return html.replace(rTarget, function(fullMatch, matches) {\n if (matches[1]) {\n // the regex matched whitespace prior to the end head/body tag;\n // prepend this to the inserted tag along with a tab\n return matches[1] + tab + tag + '\\n' + fullMatch;\n } else {\n return tab + tag + '\\n' + fullMatch;\n }\n });\n}", "title": "" }, { "docid": "d00477f0f7589e1448e14c48d5106fbc", "score": "0.38908595", "text": "function checkLibraryList() {\n var libraryList = $.mobile.activePage.find('div.librarylist');\n \n // If there's a library list at all, we want to refresh its contents (e.g.,\n // after the user closes the \"add new library\" dialog box)\n if (libraryList.length == 0)\n return;\n \n var ajax_url = libraryList.attr('data-fetch-url');\n \n $.ajax({\n url: ajax_url,\n type: 'get',\n dataType: 'html',\n cache: false,\n success: function(data) {\n var libraryList = $.mobile.activePage.find('div.librarylist')\n libraryList.html(data);\n libraryList.find('ul').listview().trigger('updatelayout');\n }\n });\n}", "title": "" }, { "docid": "c8447b0ee89d7aaefa911585aebeb2bc", "score": "0.38908273", "text": "function addBookToLibrary(title, author, pages, read){\r\n let newBook = new book(title, author, pages, read);\r\n myLibrary.push(newBook)\r\n}", "title": "" }, { "docid": "156a0024718ae3125283f8ebdb8fdc7b", "score": "0.38862967", "text": "function libs() {\n\treturn src([\n\t\t'node_modules/jquery/dist/jquery.min.js', // npm vendor example (npm i --save-dev jquery)\n\t\t])\n\t.pipe(concat('libs.js'))\n\t.pipe(uglify()) // Minify JS (opt.)\n\t.pipe(dest('app/js'))\n\t.pipe(browserSync.stream())\n}", "title": "" }, { "docid": "df2f60bba8f54cce9094f27f494d0212", "score": "0.38860333", "text": "function addPolyfills () {\n\n // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n if (!Array.prototype.find) {\n Array.prototype.find = function (predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n };\n }\n\n // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n if (!String.prototype.includes) {\n String.prototype.includes = function (search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > this.length) {\n return false;\n }\n else {\n return this.indexOf(search, start) !== -1;\n }\n };\n }\n}", "title": "" }, { "docid": "807adc7b81bb2b6091ae02d86cb7d807", "score": "0.38798654", "text": "function addBookToLibrary(newBook){\n myLibrary.push(newBook);\n}", "title": "" }, { "docid": "f9e300b1c924b997c7310b891e559897", "score": "0.38756523", "text": "function parseLibraries(response) {\n \n $(response).find(\"library\").each(function () {\n \n // get the relevant information from the xml\n var id = $(this).find('id')[0].textContent;\n var info = $(this).find(\"info\")[0];\n\n // get the lat and long\n var lat = $(info).find(\"lat\")[0].textContent;\n var lng = $(info).find(\"lng\")[0].textContent;\n\n // address of the library\n var address = $(info).find(\"address\")[0].textContent;\n\n // capacity of library\n var capacity = $(info).find(\"capacity\")[0].textContent;\n\n // loop through tbe books, if any\n var books = $(this).find(\"books\")[0];\n var listBooks = [];\n var numBooks = 0;\n\n // loop through the books and add them to geoJSON.\n // I had to do this to be able to show the books in the popup...\n $(books).find(\"book\").each(function (index, book) {\n\n var currentBook = $(book);\n listBooks.push({\n \"title\": currentBook.find(\"title\")[0].textContent,\n \"author\": currentBook.find(\"author\")[0].textContent,\n \"year\": currentBook.find(\"year\")[0].textContent\n });\n numBooks ++;\n });\n\n // addToForm(address, numBooks, capacity, id);\n $(\"#libraries\").append(\n \"<option value='\" + id + \"'>\" + address + \"</option>\"\n );\n });\n\n $('#libraries').on('change', function() {\n\n var id = $(this).val();\n $.ajax({\n type: \"GET\",\n cache: false,\n url: \"libraries/libs.xml\",\n success: function(response) {\n changeFormData(id, response);\n },\n error: function(response) {\n alert('There was an error showing the page. Please reload and try again');\n }\n });\n });\n }", "title": "" }, { "docid": "523e900d4eac2f25a765b8385ca0753b", "score": "0.38675332", "text": "function loadYUITest(libPath) {\n var mod = libPath ? path.join(libPath, 'yuitest') : 'yuitest';\n try {\n YUITest = require(mod);\n } catch (ex) {\n console.error('require(\"' + mod + '\") did not work; please ensure that yuitest is available as a devDependency for your package and is installed where this tester can access it');\n throw ex;\n }\n}", "title": "" }, { "docid": "455c07873ee2a8fb2629087ddc7e1a5d", "score": "0.38670978", "text": "function loadYUI(libPath) {\n var mod = libPath ? path.join(libPath, 'yui') : 'yui';\n try {\n YUI = require(mod).YUI;\n } catch (ex) {\n console.error('require(\"' + mod + '\") did not work; please ensure that yui is available as a devDependency for your package and is installed where this tester can access it');\n throw ex;\n }\n}", "title": "" }, { "docid": "e91e26fe08cea98f53384707221cc5fd", "score": "0.3858276", "text": "function findBaseLibraryURL () {\n Scene.library_base_url = '';\n var scripts = document.getElementsByTagName('script'); // document.querySelectorAll('script[src*=\".js\"]');\n for (var s=0; s < scripts.length; s++) {\n var match = scripts[s].src.indexOf('tangram.debug.js');\n if (match >= 0) {\n Scene.library_type = 'debug';\n }\n else {\n match = scripts[s].src.indexOf('tangram.min.js');\n }\n if (match >= 0) {\n Scene.library_type = Scene.library_type || 'min';\n Scene.library_base_url = scripts[s].src.substr(0, match);\n break;\n }\n }\n}", "title": "" }, { "docid": "93e9669a97414d8748a84254d7bf8b1d", "score": "0.38524008", "text": "function addBookToLibrary(newBook) {\n library.push(newBook);\n displayLibrary();\n saveLibrary();\n}", "title": "" }, { "docid": "203bf2047276a9ff908f3a6d8b1ca678", "score": "0.38486323", "text": "function ui5LibStyles() {\n try {\n const mapPathToDev = sPath => sPath.replace(new RegExp(`^${SRC}`), DEV)\n const aSelectLibrarySources = UI5_LIBS.filter(noPrebuild).map(\n oLibrary => `${mapPathToDev(oLibrary.path)}/**/library.source.less`\n )\n\n return paths.libStyles.src.length === 0\n ? Promise.resolve()\n : new Promise((resolve, reject) => {\n // 1. copy theme resources (assets) to DEV\n gulp\n .src(paths.libStyles.src, {\n base: SRC,\n // filter out unchanged files between runs\n since: gulp.lastRun(ui5LibStyles)\n })\n // don't exit the running watcher task on errors\n .pipe(plumber())\n .pipe(gulp.dest(DEV))\n .on('error', reject)\n .on('end', resolve)\n }).then(\n () =>\n new Promise((resolve, reject) => {\n // 2. compile library.css\n gulp\n .src(aSelectLibrarySources, {\n base: DEV,\n read: true\n })\n // don't exit the running watcher task on errors\n .pipe(plumber())\n .pipe(\n tap(oFile => {\n ui5CompileLessLib(oFile)\n })\n )\n .pipe(gulp.dest(DEV))\n .on('error', reject)\n .on('end', resolve)\n })\n )\n } catch (error) {\n spinner.fail(error)\n }\n}", "title": "" }, { "docid": "28eb2d04fdfd6a3e05eddbb84155e7a0", "score": "0.38424248", "text": "function libPath(namespace, library)\n{\n let devId = system.deviceData.deviceId;\n let isa = \"\";\n\n switch (devId) {\n case \"MSP432E\":\n case \"MSP432P401R\":\n case \"MSP432P4111\":\n isa = \"m4f\";\n break;\n\n case \"CC32XX\":\n isa = \"m4\";\n break;\n\n /* TODO: add more devices */\n\n /* is there a good default? For now, just use devId so users\n * see it's broken and report what devId isn't handled here\n */\n default:\n isa = devId;\n break;\n }\n\n return(namespace + \"/lib/\" + getToolchainDir() + \"/\" + isa + \"/\" +\n library);\n}", "title": "" }, { "docid": "957f56982f8b5be2febfda64b3795258", "score": "0.38383073", "text": "function loadPlugPlugLibrary(filePath){\r //filePath is escaped, so unescape it before using it.\r filePath = unescape(filePath);\r try {\r var externalLibrary = null;\r var plugPlugLibraryFile = File(filePath);\r if (plugPlugLibraryFile.exists) {\r var externalLibrary = new ExternalObject(\"lib:\"+ plugPlugLibraryFile.fullName);\r var data = \"PlugPlug library successfully loaded!\";\r var csxsEvent = createCSXSEvent(\"plugPlugSuccess\", data);\r csxsEvent.dispatch();\r }\r else {\r throw new Error(\"Can't find PlugPlugExternalObject: \" + plugPlugLibraryFile.fullName + \" File: \" + $.fileName + \" Line: \" + $.line);\r }\r }\r catch(error){\r alert(error); \r } \r}", "title": "" }, { "docid": "b0562690534f3d294c11819fd3a48d1e", "score": "0.38361797", "text": "function addBookToLibrary(title, author, pages, read) {\n const addedBook = new Book(title, author, pages, read);\n myLibrary.push(addedBook);\n}", "title": "" }, { "docid": "6ca23dd783434022649e2b2281a2daf2", "score": "0.3817766", "text": "function loadLibrary(url) {\n return new Promise((resolve, reject) => {\n let scriptHTML = document.createElement('script');\n\n scriptHTML.type = 'text/javascript';\n scriptHTML.charset = 'utf-8';\n scriptHTML.async = true;\n scriptHTML.src = url;\n\n scriptHTML.onload = function () {\n resolve(url);\n }\n\n scriptHTML.onerror = function () {\n reject('Failed to load library: ' + url);\n }\n\n headTag.appendChild(scriptHTML);\n })\n}", "title": "" } ]
e064c384c0c4481c4d68af9b5da162d3
Start the game and log the results
[ { "docid": "ed261c018d32074cd3eeedd6de8501a5", "score": "0.0", "text": "function playGame(userChoice, computerChoice) {\n\tvar userChoice = getUserChoice(\"rock\");\n\tconsole.log(userChoice);\n\tvar computerChoice = getComputerChoice();\n\tconsole.log(computerChoice);\n\tconsole.log(determineWinner(userChoice, computerChoice));\n}", "title": "" } ]
[ { "docid": "7dbbc4799f435eebf5dd93b685fb3505", "score": "0.72738516", "text": "startGame() {\n console.log(\"Game started !\")\n }", "title": "" }, { "docid": "98a26f710f7664c0de22f42f15ae297f", "score": "0.7214815", "text": "function startgame(){\n console.log(\"start\");\n\n}", "title": "" }, { "docid": "7b01dfa7e9422dea7dc22aa51452d1b2", "score": "0.704307", "text": "function startGame() {\n//INITIALISATION\n\tconsole.clear();\n\tinitializeGame();\n\n//JEUX\n\tshowGameState();\n\tgameLoop();\n\t\n//AFFICHAGE RESULTAT\n\tshowGameWinner();\n}", "title": "" }, { "docid": "c12effa7110f27604793ef9e9063d072", "score": "0.6996524", "text": "static start(game: Game): void {\n const player1: Player = game.player1;\n const player2: Player = game.player2;\n const round: Round = game.round;\n const result: RoundResult = round.result;\n const winner: string = result.winner ? result.winner.name : 'N/A';\n\n process.stdout.write([\n '---------------------------------------',\n `# Round ${round.index + 1}`,\n `# Fight: ${result.choice1.name} vs ${result.choice2.name}`,\n `# Winner: ${winner}`,\n '# Scores:',\n ` - ${player1.name}: ${player1.score}`,\n ` - ${player2.name}: ${player2.score}`,\n '---------------------------------------',\n '',\n ].join('\\n'));\n }", "title": "" }, { "docid": "8625d8ed26f6cb0e68bdf6090e9c3004", "score": "0.69856226", "text": "startTurn() { \n\t\tthis.clearConsole();\n this.app.renderOptions();\n process.stdout.write(\"\\n\\n\\n\" + \"Human Vs \" + this.opponentType + \"\\n\");\n\t\tthis.board.renderBoard();\n\t\tprocess.stdout.write(\"\\n\\nPlayer \" + this.currentPlayer.mark + \"'s Turn:\\n\");\n\t\t\n\t\t// get the current players move\n\t\tthis.getMove();\n\t}", "title": "" }, { "docid": "5584661b3748eb9a31e0d8d3764a8755", "score": "0.6925257", "text": "function startGame() {}", "title": "" }, { "docid": "515a3fa0c8c5cf6bd7cfb68146b646af", "score": "0.6917649", "text": "function gameStart() {\n\twins = 0;\n\tlosses = 0;\n\twriteStartText();\n\twriteWins();\n\twriteLosses();\n\tgenerateHitCount();\n\tgenerateImagePoints();\n\tresetScoreCounter();\n}", "title": "" }, { "docid": "68035d6daf22d27db529caf271ec0242", "score": "0.6884643", "text": "function startGame() {\n alert(\"Starting game \" + gameName + \"!\\nAuth token: \" + authToken);\n sergis.socket.emit(\"ready\", {\n gameName: gameName,\n authToken: authToken\n }, function (err, contentComponents) {\n if (err) {\n alert(\"ERROR FROM SERVER: \" + err);\n } else {\n alert(\"JSON Response from server: \" + JSON.stringify(contentComponents));\n }\n });\n }", "title": "" }, { "docid": "82f3c2d9db07f79262778370a2084c0c", "score": "0.6844737", "text": "start_game() {\n console.log(\"Start new game from player of type \", this.type);\n }", "title": "" }, { "docid": "1b1e1ea673f3680593c07b5e7bddcb05", "score": "0.6827532", "text": "async start() {\n\t\tpino.info(\">> Starting game..\");\n\t\t// Only prep data if new game\n\t\tObject.keys(this.gameData.clientData).length === 0 &&\n\t\t\t(await this.gameData.prepAndGetData());\n\t\tconsole.log(this.gameData.answers);\n\t\t// Signal game start on socket\n\t\tthis.gameCommunication.signalStart({\n\t\t\tid: this.gameID,\n\t\t\tdata: this.gameData.clientData,\n\t\t});\n\t\t// Wait for user level submissions\n\t\tthis.gameCommunication.listenForAnswers(this.checkIfRight.bind(this));\n\t}", "title": "" }, { "docid": "5a574ca366863d419f322bd8bd5941f9", "score": "0.6814969", "text": "startGame() {\n this.gameStarted = true;\n this.emitToNativeScript(START_GAME, true);\n }", "title": "" }, { "docid": "a0a215884697c6af3343733458794691", "score": "0.67637813", "text": "startGame() {\n this.promptForGridSize();\n this.promptPlayerChoice();\n this.initializeGame();\n console.log(color(playerColor(this.turn.letter), false, `${this.turn} will go first.`));\n this.play();\n console.log(color(228, false, '\\n' + '-'.repeat(80)));\n }", "title": "" }, { "docid": "546ad8d2ae6f2e611615acb70d4f0a01", "score": "0.674152", "text": "function startGame(){\n\t\t\tgame.state.start('GamePlay');\n\t\t}", "title": "" }, { "docid": "5056009764113bcf5c94a9e87ae90c51", "score": "0.67034495", "text": "function startGame() {\n startTimer();\n renderQuestion();\n }", "title": "" }, { "docid": "7c387aa1571dbbcca48223a82b31ff85", "score": "0.6693335", "text": "start() {\n\t\tplaySound( 'lvls' );\n\t\tgame.loading = true;\n\n\t\t// the game noticibly lags while setting the terrain, so this makes it look like a loading\n\t\t// black screen for 100 ms whenever it is loaded\n\t\tsetTimeout( () => {\n\t\t\tpause_name = '';\n\n\t\t\t//I think this maybe saved like 8 bytes over just saying game.loading, game.started... etc\n\t\t\tObject.assign( game, {\n\t\t\t\tloading: 0,\n\t\t\t\tstarted: 1,\n\t\t\t\tpaused: 0,\n\t\t\t\tscrolling: 1,\n\t\t\t\tlvln: 1,\n\t\t\t\ta: [],\n\t\t\t\tspawns: [],\n\t\t\t\tpl: new Player(),\n\t\t\t\tscore: 0,\n\t\t\t\tsmult: 1,\n\t\t\t\tspfr: 0,\n\t\t\t\ttss: TSS,\n\t\t\t\ti: null\n\t\t\t} );\n\t\t\tgame.createObjects();\n\t\t\tgame.camToLvl( game.lvln );\n\t\t\tgame.fade( true );\n\t\t}, 100 );\n\t}", "title": "" }, { "docid": "f38773ab98e0340626b0308bbf091e0f", "score": "0.6668237", "text": "function startGame () {\n\n gameSetup();\n randomizeTiles();\n createGameBoard();\n\n timeStarted = timeAssignment();\n\n}", "title": "" }, { "docid": "cc85d4b377052a41c06b35376b5bf1d2", "score": "0.66626257", "text": "function startGame() {\n // Reset score and display score\n var newScore = dataCtrl.resetScore();\n UICtrl.displayScore(newScore);\n\n // Restart game timer\n gameTimer(dataCtrl.getGameTimeMS());\n\n // Start showing new targets\n newTargetTimer(true);\n }", "title": "" }, { "docid": "bb9540e24a28a0c0b331f209dab28ad6", "score": "0.6643943", "text": "function Start(){\n\t\tgameStatus=\"start\";\n\t\tconsole.log(gameStatus);\n\t}", "title": "" }, { "docid": "95814a29bd231a148874823a6b9c84c6", "score": "0.66209567", "text": "startGame (){\n\n }", "title": "" }, { "docid": "1c8601459b56adae1440543fc3cd9237", "score": "0.66182333", "text": "startGame() {\n this.addNewGameGrid();\n this.resetGameStatus();\n this.updateStatus(\"\");\n this.addCurrentMoveSymbol();\n this.removeDraggedSymbolsFromDOM();\n }", "title": "" }, { "docid": "9b874efc26bde938b1601bae7b8882e0", "score": "0.6613972", "text": "function startMatch(){\n\tsetTurn(1);\n\n\tconsole.log(\"Partida Iniciada\");\n}", "title": "" }, { "docid": "78e16edde4e4ee3352f51e7b7f811cfd", "score": "0.6606225", "text": "function startGame() {\n removeSplashScreen();\n // later we need to add clearing of the gameOverScreen\n removeGameOverScreen();\n\n game = new Game();\n game.gameScreen = createGameScreen();\n\n game.start();\n // End the game\n game.passGameOverCallback(function() {\n gameOver(game.score);\n });\n }", "title": "" }, { "docid": "4b62aa3163a75f6b292324f753d5a21b", "score": "0.6605576", "text": "function startGame() {\n resetGame();\n buildGrid();\n generateMines();\n smileyAlive();\n displayFlagCount();\n}", "title": "" }, { "docid": "49650db829ee9705cfea2f0890cc53ea", "score": "0.66032636", "text": "function startGame() {\n if (!isGameRunning) {\n nextLevel();\n isGameRunning = true;\n }\n}", "title": "" }, { "docid": "47bab744234cba1873a3dda2c3c37c9b", "score": "0.6574125", "text": "StartGame() {\n this.game.StartGame();\n this.Draw();\n }", "title": "" }, { "docid": "05523bbb3c03477672bca52628b053d8", "score": "0.65708053", "text": "function playGame(evt) {\n resetArrays();\n startGame(currentRound);\n printResults();\n}", "title": "" }, { "docid": "a2fb02b4ae0dfb5975eac94331d13cba", "score": "0.65616137", "text": "function startGame() {\n removeSplashScreen();\n removeGameOverScreen();\n\n playersName = splashScreen.querySelector(\".name-input\").value;\n if (playersName == \"\") {\n playersName = \"the guest\";\n }\n\n game = new Game();\n game.gameScreen = createGameScreen();\n\n game.start();\n\n // End the game\n game.passGameOverCallback(function () {\n updateScore();\n gameOver(game.score);\n });\n }", "title": "" }, { "docid": "b3ec2a7763a8a9f10160e0b69977145d", "score": "0.6535246", "text": "function startGame() {\n\n resetScreen();\n results = [];\n currentGameObj = new game();\n $('#timer').show();\n currentGameObj.startGame();\n\n}", "title": "" }, { "docid": "bc60f285aa413b95ddcfa27a6698d54a", "score": "0.65288955", "text": "function startGame() {\n\n //create new game\n let game = new Game(GameType.multiplayer);\n document.game = game;\n\n //close left menu (opens on switch to new game if not turned off)\n closeLeftMenu();\n\n //sends game data package\n let json = {\n \"action\": SessionAction.startGame,\n \"data\": {\n \"cards\": game.getCardsInOrder()\n }\n };\n document.session.sendMessage(json);\n\n pages.game.open();\n }", "title": "" }, { "docid": "1837dcfdb7ef907ce314b3d257f0cf81", "score": "0.65195477", "text": "runGame() {\n this.gameMessage()\n this.multiplayer()\n this.outcome()\n this.restart()\n }", "title": "" }, { "docid": "8da9c33ce3898cc2f5266585411edfe1", "score": "0.65105075", "text": "function gameStart() {\n\tconsole.log(\"This is a new game.\")\n\tconsole.log(\"current wins: \" + wins);\n\tconsole.log(\"current losses: \" + losses);\n\tgenerateTargetScore();\n\t$(\"#targetScore\").html(\"<p>\" + targetScore + \"</p>\");\n\tgenerateCrystalValues();\n\tassignCrystalValues();\n\tmyScore = 0;\n\t$(\"#yourScore\").html(myScore);\n}", "title": "" }, { "docid": "086819c9486e62ef72df619593ff760f", "score": "0.65003246", "text": "function gameStart () { // Where it all begins\n scanner()\n}", "title": "" }, { "docid": "2d09a6c1d7bbe9820053e455e4f8b27f", "score": "0.64896095", "text": "start() {\n this.game.gameProcess = new GameProcess(this);\n this.game.gameProcess.init();\n }", "title": "" }, { "docid": "96c5bff51fbd8361013346a8aa8020af", "score": "0.6467985", "text": "function start() {\n g = new Game();\n g.startGame();\n}", "title": "" }, { "docid": "6a614c36ba34461335ca6e7ea03a0099", "score": "0.64592576", "text": "function start(){\n\tinit();\n\tconfig.runTimeout = setTimeout(run, 100);\n\tstats.moves = 0;\n\tstats.food = 0;\n\tstats.count = 0;\n}", "title": "" }, { "docid": "ae8e85fe8b1eb3b000eafed32e8ae8b2", "score": "0.64558023", "text": "function startGame(){\n\tscore = 0;\n\tround = 0;\n\tgameSpeed = 2000;\n\n\tchangeScoreText(score);\n\tchangeRoundText(round);\n\tremoveInstr();\n\n\taddRound();\n\tsetupEvents();\n\tanimate('run');\n\tremoveStartButton();\n}", "title": "" }, { "docid": "3d401745dc92e54b7baa24ec6cbe8f13", "score": "0.6440587", "text": "function startGame(){\n\tthis.game.state.start(\"Level\");\n}", "title": "" }, { "docid": "3853bcbc96e90bea2cc487d2a04067d0", "score": "0.6423726", "text": "clickStart() {\n console.log('clicked start');\n // start the game\n this.startGame();\n }", "title": "" }, { "docid": "3d9853cb9ade1db2c6500d6f4a58507e", "score": "0.6423309", "text": "function game_start () {\n\tif(started === true)\n\t\tnextSequence(), started=false;\n}", "title": "" }, { "docid": "627bed3088f44b2fdcc96238d036dc85", "score": "0.64187825", "text": "start() {\n\t\tthis.app.ticker.add(delta => this.gameLoop(delta));\n\t\tthis.gameRunning = true;\n\t}", "title": "" }, { "docid": "e72678f7ef797d81577fb13e10322546", "score": "0.641484", "text": "start() {\n this.setup()\n console.log(\"Starting\")\n \n while (!this.isOver()) {\n //console.log(this.isOver())\n this.playRound()\n }\n const winner = this.board.getWinner()\n\n if (winner !== null) {\n console.clear()\n this.board.print()\n console.log(`Player ${winner} has won.`)\n }\n else {\n console.clear()\n this.board.print()\n console.log(\"It's a draw!\")\n }\n }", "title": "" }, { "docid": "4d5e717c99fd1e5785ee768113e4a451", "score": "0.6405821", "text": "startGame() {\n this.state = \"playing\";\n this.playerBoard2.toggleVisible();\n this.showNotification(\"The game has started\", \"It is \" + this.getPlayerTurn() + \"'s turn\");\n }", "title": "" }, { "docid": "871fc80dd1bc793ab2f7f21565c47b88", "score": "0.64057827", "text": "function g20startGame() {\n console.log('function : g20startGame()');\n g20resetGame();\n g20getRandom();\n g20GameTimedown();\n g20roundDone = 0;\n}", "title": "" }, { "docid": "b34114da34f866eba30cf5beedac4138", "score": "0.6394723", "text": "function startGame()\n{\n\n sendAPIRequest(\"startGame\", {\"game_name\": gameName}, function(response) {\n console.log(\"Game started! Success: \" + response.success);\n\n\n })\n}", "title": "" }, { "docid": "654bca39b6173fb6c71f899e5f97d275", "score": "0.63920313", "text": "startGame() {\n let endDate = Date.now() + gameLength + 5000;\n pushStart(endDate);\n }", "title": "" }, { "docid": "91c378911bba1fe1bbe833a316c284fd", "score": "0.63916814", "text": "function startGame() {\n currentPlayer = 0;\n currentRound = 0;\n\n board = getList(0);\n pieces = getList(1);\n\n typeCount = [];\n for (var i = 0; i < 11; i++) {\n typeCount.push(createList(8, 0));\n }\n\n timePlace = [\n [],\n []\n ];\n timePick = [\n [],\n []\n ];\n\n selectedPiece = -1;\n lastBoardPos = -1;\n\n winInfo = {};\n\n hasWon = false;\n //if online game the game is started by the server monitor at the bottom of this file\n if (isOnlineGame(game)) {\n onlineStarted = false;\n } else {\n\n !isMonitor() && selectPiece();\n }\n}", "title": "" }, { "docid": "3a023c2a2ea3e65267762a1b26f8798d", "score": "0.6382182", "text": "function startGame() {\n camera = new Camera(0, 0);\n level = new level(canvasW, canvasH, 1);\n level.reset(null);\n hero = new heroObj(25, 25, \"green\", level.startX, level.startY);\n camera.newPos(hero, level);\n intro = new intro();\n hud = new hud();\n clock = new clock();\n genAudio();\n mainGame.start();\n}", "title": "" }, { "docid": "fad1c545f1056ddb23dbcebb57fc9e9d", "score": "0.63750035", "text": "start(){\n // enables keyboard input (controlling) of the game\n this.keyboard = true;\n\n // draws board\n this.board.drawBoard();\n\n // logs that game started\n this.log.clear();\n this.log.logMessage('Game started!');\n\n // turn is 1 by default\n this.turn = 1;\n this.board.drawAvailableFields();\n\n // logs turn\n this.log.logTurn(this);\n\n // set interval to generate power ups on fields\n this.doTheFight = this.doTheFight.bind(this);\n this.generatePowerUp = this.generatePowerUp.bind(this);\n const time = this.options.fasterPowerups ? 1200 : 2000; // time based on options\n this.powerUpInterval = setInterval(this.generatePowerUp, time);\n\n if(this.options.deadFields){\n this.blockFields();\n };\n }", "title": "" }, { "docid": "381e5d3a731544ba9aa19cf401303202", "score": "0.6372127", "text": "function startGame() {\r\n \r\n\tturn = player;\r\n setMessage( player + \" Can Start!\")\r\n }", "title": "" }, { "docid": "0c9fc6483bc0b874ff2cef2ebfe4b46e", "score": "0.63650364", "text": "function start_game() {\n // this function is used to start_game and reset_game\n reset_var_shallow();\n\n // console.log(\"Game has started!\");\n}", "title": "" }, { "docid": "cb1b6614ea2149909e48ed35b04c71c7", "score": "0.6325384", "text": "start() {\n //Game is Over \n if(this.checkIfGameOver()) {\n if(this.result === \"won\") {\n location.replace(\"states/won.html\"); //Go to the won file\n }\n else {\n location.replace(\"states/lost.html\"); //Go to the lost file \n }\n }\n this.checkForCollision(); //Checks for collision \n this.updateComponents(); //Updating all the components in the zombie game \n this.draw(); //Draws all the components of the game\n }", "title": "" }, { "docid": "734386f6c0fbcb267d2bb65da5a818a7", "score": "0.6321125", "text": "function startGame() {\n\t\tgameOver = false;\n\t\tuserTurn = false;\n\t\tspeed = 800;\n\t\t// set round counter to 0;\n\t\tround = 0;\n\t\t// empty arrays\n\t\tmoves = [];\n\t\ttestArr = [];\n\t\t// fills array of random moves\n\t\tfor (var i = 0; i < skillLevel; i++) {\n\t\t\tvar compMove = ((Math.random()*3)+1).toFixed();\n\t\t\tmoves.push(compMove);\n\t\t}\n\t\t// calls nextRound() after 600 millisec delay\n\t\tconsole.log(moves);\n\t\twindow.setTimeout(function () {\n\t \tnextRound(round);\n\t \t}, 600);\n\t}", "title": "" }, { "docid": "39ec927fc557bfd7d20824a149552736", "score": "0.63207966", "text": "function gameInit() {\n\tif (gameMemory.init()) return;\n\tutils.log(\"╔════════════════════════╗\\n║ ♫♪ ► Starting ◄ ♪♫ ║\\n║ v.\" + AI_VERSION + \" ║\\n╚════════════════════════╝ \");\n}", "title": "" }, { "docid": "d40e01ba1e330ac00f337b840d372da1", "score": "0.6317989", "text": "function startGame() {\n\n reset();\n if (on === false)\n return 0;\n\n emptyArr();\n set();\n addMove();\n return 1;\n}", "title": "" }, { "docid": "411b85e83867e5650f9182689227406d", "score": "0.6311067", "text": "startGame() {\n this.board.drawHTMLBoard();\n this.activePlayer.activeToken.drawHTMLToken();\n this.ready = true;\n }", "title": "" }, { "docid": "4da495eadd9f3c828f82223cdf65c6c9", "score": "0.6278162", "text": "function startGame() {\n resetCounter();\n generateMatchNumber();\n giveHerosRandomValues();\n}", "title": "" }, { "docid": "4d2763e1c520a1e054a75416ff76ede2", "score": "0.6274245", "text": "handleStart(message) {\n this.buffer = []\n let players = message.players\n this.gameID = message.gameID\n this.nextID++\n\n console.log(`starting game: ${players[0]} vs ${players[1]}`)\n window.track(\"startGame\")\n \n // Just use the gameID as the seed\n this.game.startGame(players, this.gameID)\n\n this.forceUpdate()\n }", "title": "" }, { "docid": "ca520e4ed05957a1a535add239ac7961", "score": "0.62738574", "text": "function handleStartPlay() {\n // generate environment objects\n game.envObjects = generateEnvObjects();\n\n // generate eggs\n game.eggs = generateEggs();\n\n for (player of game.players) {\n player.points = 0;\n }\n\n io.to(\"game-room\").emit(STATE_CHANGE, \"start-play\", {\n envObjects: game.envObjects,\n eggs: game.eggs,\n });\n\n const countdownFrom = 3;\n io.to(\"game-room\").emit(TIME_CHANGE, countdownFrom);\n game.startInterval(\n 1000,\n countdownFrom - 1,\n () => {\n io.to(\"game-room\").emit(TIME_CHANGE, game.time);\n },\n handlePlaying\n );\n }", "title": "" }, { "docid": "1edbace4277f1d82cd7fd43e550ef307", "score": "0.6261989", "text": "function startGame() {\n\tconsole.log(\"STARTING NEW GAME\")\n\n\tdocument.getElementById(\"centertext\").innerHTML = \"Cargando...\";\n\tdocument.getElementById(\"warning\").innerHTML = \"\";\n\n\tcurrentScore = 0;\n\tnewHighScore = false;\n\tvar playerCurrentBoost = 1;\t\n\n\tconsole.log(\"Cleaning scene...\")\n\tcleanScene();\n\tconsole.log(\"Scene cleaned.\")\n\n\tconsole.log(\"Generating structures...\")\n generateBuildings(scene_radius - 25);\n generateRings();\n\tconsole.log(\"Structures generated.\")\n\t\n\n\tconsole.log(\"Placing player...\")\n placePlayer();\n\n\tupdateScore(0);\n\n\tdocument.getElementById( 'centertext' ).innerText = \"\";\n\tdocument.getElementById( 'highscore' ).innerText = \"Record: \" + highScore;\n\n\tremainingTime = timeLimit * 1000;\n\tdocument.getElementById( 'time' ).innerText = \"\" + parseInt((remainingTime / 1000)+1);\n\n\tconsole.log(\"GAME START\");\n\tgameActive = true;\n\trestart = false;\n\tpause = true;\n\n\twind_audio.setPlaybackRate(1);\n\twind_audio.setVolume(windBaseVolume);\n\twind_audio.play();\n\tmusic.setVolume(musicBaseVolume);\n}", "title": "" }, { "docid": "d5eac89913fc199f97e5ccd46bded008", "score": "0.6259517", "text": "function startGame() {\n \n}", "title": "" }, { "docid": "d25741cb8045b39ef772f903474e0875", "score": "0.6231777", "text": "function startGame()\n\t{\n\t\t// Get wallet save data\n\t\tvar tempWallet = localStorage.getItem('wallet');\n\t\tif(tempWallet == null || tempWallet == undefined || tempWallet == \"undefined\" || tempWallet == \"null\")\n\t\t{\n\t\t\t// No save data, create new object\n\t\t\tthis.currWallet = new wallet(0,250);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// valid save data, get values\n\t\t\ttempWallet = JSON.parse(tempWallet);\n\t\t\tloadWallet(tempWallet);\n\t\t}\n\n\t\t// Get market save data\n\t\tvar tempMarket = localStorage.getItem('market');\n\t\tif(tempMarket == null || tempMarket == undefined || tempMarket == \"undefined\" || tempMarket == \"null\")\n\t\t{\n\t\t\tvar tempPrices = new Array();\n\t\t\tfor(var i = 0; i < 300; i++)\n\t\t\t\ttempPrices[i] = 10;\n\n\t\t\tthis.currMarket = new market(10,10, 1, tempPrices, 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttempMarket = JSON.parse(tempMarket);\n\t\t\tloadMarket(tempMarket);\n\t\t}\n\t\t// Draws base graph on screen\n\t\tinitialGraph();\n\n\t\t// Set major intervals for mining, updating market, and activating random events\n\t\tthis.marketUpdate = setInterval(function(){\n\t\t\tthis.currMarket.updatePrice(this.currMarket.sellValue);\n\t\t\tupdateGraph();\n\t\t}, 1000);\n\n\t\tthis.trendUpdate = setInterval(function(){\n\t\t\tthis.currMarket.newTrend(this.gamer.algo);\n\t\t}, 5000);\n\n\t\tsetInterval(function(){\n\t\t\trandomEvent();\n\t\t}, 60000);\n\n\t\t// Start autosave, every 1/10 of second\n\t\t// Set initial values on screen\n\t\tthis.display = this.currWallet.bitcoin.toString();\n\t\tthis.display = this.display.substring(0,5);\n\t\tamount.innerHTML = this.display;\n\n\t\tstartMining();\n\n\t}", "title": "" }, { "docid": "ade7a8b6afc71783d9ba8b1c10085469", "score": "0.6226324", "text": "function gameStart() {\n //initialize all numbers\n //then set and report crystal value for debug and cheating\n hideSolution();\n numberInit();\n showCrystals();\n //Control Crystal Clicks which has a gamelogic function run each time\n crystalClicks();\n}", "title": "" }, { "docid": "ddbbe319c5e2c2671ef9894ae540b1db", "score": "0.6225826", "text": "start_game() {\n\t\tthis.#socket.send(new Uint8Array([\n\t\t\tLobbySocket.opcode.START_GAME, 0\n\t\t]));\n\t}", "title": "" }, { "docid": "413345eec6647f4eba6e89cdcf975ea2", "score": "0.6220329", "text": "function startGame(){\n if (gameState.isGameOn) {\n return false;\n }\n gameState.isGameOn = true;\n gameState.gameObjects = gameObjects;\n renderElements(\"level-1\");\n // Starts the game loop.\n gameState.gameLoop= gameLoop(gameState.loopArray);\n}", "title": "" }, { "docid": "6beab1dfa80c78e4ff06ec0fb552ce32", "score": "0.6216407", "text": "function iniciarJuego(){\n\n\t\t\t\tconsole.log('im here');\n\t\t\t\tgame.state.start(\"LoaderTime\");\n\n\t\t\t}", "title": "" }, { "docid": "5ab31219522019574ed5a331caed249d", "score": "0.62071186", "text": "function startNewGame(){\n stopAnimating();\n writeText(\"\\nNew game has begun!\")\n init();\n startAnimating(CONSTANTS.FPS);\n}", "title": "" }, { "docid": "11bdfcd080e6a675b04dc69db87f9fe3", "score": "0.61955917", "text": "function startNewGame() {\n\tsetUpGame(NUMROWS, NUMCOLS, NUMMINES);\n}", "title": "" }, { "docid": "a896aaee714d5ff65e4b42b4d155e36f", "score": "0.61935145", "text": "function startGame() {\n gameover = false;\n resetScore(selectScore);\n populategrid(grid);\n resetBombCount(grid);\n displayAnswer(grid);\n // getWinningCondition();\n}", "title": "" }, { "docid": "e642885f361ae5f6e6ec34f3ea84f5fe", "score": "0.6180347", "text": "onGameStart() {}", "title": "" }, { "docid": "b8449bceb8c32cd570cccf5dea729ceb", "score": "0.6175542", "text": "function startGame() {\n isOTurn = false;\n isAiTurn = !playAsX;\n Board.reset();\n Display.initialize(\n startGame,\n handlePlayerMoveClick,\n handleSelectX,\n handleSelectO,\n handleSelectDifficulty,\n isAiTurn,\n playAsX\n );\n if (isAiTurn) {\n aiMove();\n }\n }", "title": "" }, { "docid": "fd89f7896c25b24ed7bff3b4686e650b", "score": "0.6174497", "text": "function startGame(){\n // Get current player data.\n currentPlayer = game.players.find(function (p){\n return p.userName === currentPlayer.userName;\n });\n\n $('#current-player-name').html('<strong>' + currentPlayer.userName + '</strong>');\n // Start the interval.\n gameIntervalId = setInterval(getGameState, 300);\n\n // Hide the start game group.\n $('#start-section').css('display', 'none');\n\n $('.game-id').html(game.gameId);\n \n }", "title": "" }, { "docid": "d1003bc91605dd390d079ec51989d9d3", "score": "0.61704946", "text": "function runGame() {\n\tgameTimer();\n\tmoleAnimation();\t\n\tcheckIfMatch();\n\tendOfAnimation();\n}", "title": "" }, { "docid": "6e8c89926e091f86d6d6dcd8e2cf3c8e", "score": "0.6167795", "text": "startGame() {\n dispatchStartGame()\n this.playing = true\n this.gameInterval = setInterval(this.updateGameState, frameRate)\n }", "title": "" }, { "docid": "5c840fd3ee33b0647ab1e53f86ddf125", "score": "0.61667794", "text": "async function startGame() {\n startingRoom.restart();\n currentScene = startingRoom;\n continueGame();\n running = true;\n return;\n }", "title": "" }, { "docid": "8b0864a4dcfa691de8a743b0d838d31c", "score": "0.61660063", "text": "function hostStartGame(gameId) {\n console.log('Game Started.');\n db[gameId].gameStarted = true;\n sendWord.call(this, gameId);\n startTimer.call(this, gameId);\n}", "title": "" }, { "docid": "a2aa38b8cd625b8550f1f38382682878", "score": "0.6158927", "text": "function startNewGame(){\r\n stopGame();\r\n playMusic();\r\n displayGameSettings();\r\n setGameVariables();\r\n setEventListeners();\r\n launchGame();\r\n\r\n}", "title": "" }, { "docid": "c1fe293a52954a0a26d3ccc608bde6ef", "score": "0.61546516", "text": "function startGame() {\n\t\tmenu.current.style.opacity = 1;\n\t\tmenuFadeOut();\n\t\tstate.setStart();\n\t}", "title": "" }, { "docid": "51fa4397e14508a9a82e4839deb88cdb", "score": "0.6150976", "text": "function gameStart() {\n $(\"#ScoreOne\").html(\"0\");\n $(\"#ScoreTwo\").html(\"0\");\n $(\"#end\").show();\n //Report game start\n timeline_data.push({\n date: currentDate,\n title: 'Game Started!',\n content: 'A game has started, who will win? ' + team1 + ' or ' + team2 + '? Tweet your favorite team.'\n });\n reloadTimeline();\n }", "title": "" }, { "docid": "92f549642e870df1eb13ebaaac47d621", "score": "0.6141675", "text": "function startGame() {\n\n}", "title": "" }, { "docid": "92f549642e870df1eb13ebaaac47d621", "score": "0.6141675", "text": "function startGame() {\n\n}", "title": "" }, { "docid": "355729c48af076b8aa902ecd6138fb1b", "score": "0.6140897", "text": "begin() {\n\t\tthis.at_title_screen = false;\n\t\tthis.start_time = Date.now();\n\t\tthis.next_spawn_time = Date.now();\n\t\tthis.difficulty_interval = setInterval(() => ++this.difficulty, 30 * SECS);\n\t\tif (AUTOMATIC_FIRING)\n\t\t\tthis.automatic_firing_interval = setInterval(this.player.shoot, FIRING_RATE * SECS);\n\t}", "title": "" }, { "docid": "0a30fdf3dee7b252fe302096573736cd", "score": "0.6138451", "text": "function main() {\r\n setScreen();\r\n showTimestamp();\r\n runTests();\r\n}", "title": "" }, { "docid": "e6a952371d9024da513805abfd407c60", "score": "0.61331326", "text": "function startGame() {\n progress = 0;\n score = 0;\n scorePoints = 0;\n\n answerTime = 0;\n answerStartTime = 0;\n answerEndTime = 0;\n\n highScore = sessionStorage.mediaQuizHighScore;\n\n loadQuestion(questions[progress]);\n}", "title": "" }, { "docid": "5fb6e36cc56329cfceaa15ece9023eec", "score": "0.6132923", "text": "start() {\n if (this.timer) {\n console.warn('Tetris.start was called when the game timer is already running!');\n }\n this.setTimer(this.options.gameSpeed);\n }", "title": "" }, { "docid": "6302a9e313de6657f1b1e9f30b9b5602", "score": "0.6130265", "text": "function startGame(){\n\tlastBallStartOnLeft = leftIsLocalStream;\n\tnotifyOtherPlayerBallInField();\n\tinsertBallDelayed(lastBallStartOnLeft, countdownDuration);\n\trenamePlayButton(stringRestart);\n}", "title": "" }, { "docid": "b83aa036c4eed35a0ddc8f54142555ec", "score": "0.6128073", "text": "function start() {\n isGameStarted = true;\n music.play();\n }", "title": "" }, { "docid": "b2cb5ec2a9ab2ee9e480ea8c6171634f", "score": "0.6125504", "text": "function startGame (event) {\n //disable start button \n event.currentTarget.disabled = true;\n\n // game loop\n frameId = setInterval(update, dt);\n\n // create new asteroids\n asteroidsId = setInterval (createAsteroids, 150);\n\n //test\n console.log(\"Game started\")\n }", "title": "" }, { "docid": "00a438f7767cbe1a4e4b80922d3d8655", "score": "0.6123621", "text": "function start() {\n console.log(\"\");\n console.log(\"______________________________________\");\n console.log(\"\");\n console.log(\"Welcome to BAMAZON\");\n console.log(\"\");\n console.log(\"______________________________________\");\n console.log(\"\");\n}", "title": "" }, { "docid": "5d464f8f429ad858b1fac9a4bc08a288", "score": "0.6122717", "text": "function startGame() {\n // for (var i = 0; i < viewModel.players().length; i++) {\n // var player = viewModel.players()[i];\n // player.code = getCode(player.ai.id);\n // }\n \n v.game.state('playing');\n v.game.isPaused(false);\n}", "title": "" }, { "docid": "49fa01a40d47bc34f6f9e928354c4ad7", "score": "0.6121757", "text": "function startGame() {\n winningScore = generateWinningScore(75, 150);\n updateWinningScore();\n updateTotalScore();\n updateWinsTotal();\n updateLossesTotal();\n crystalPoints(1, 12);\n totalScore = 0;\n}", "title": "" }, { "docid": "4409e98ab9125f8830f421971bbbfe1b", "score": "0.6116658", "text": "begin() {\n //make sure that there are enough players to begin\n if(this.players.length < 2) {\n this.emit('insufficientplayers', this.players.length);\n return;\n }\n\n //mark game as having started\n this.gameStarted = true;\n\n //inform players that the game has begun\n this.emit('gamestarted');\n\n //begin new round\n this.newRound();\n\n }", "title": "" }, { "docid": "00ec65d9d977d86356783f5392a1fbf7", "score": "0.6115395", "text": "function startRound () {\n Session.set(\"gameOn\", true);\n Session.set(\"startGame\", false);\n requestWord();\n Meteor.setTimeout(endGame, 60000);\n}", "title": "" }, { "docid": "dd9c37bb9a33a6717cf4a0793e3157e1", "score": "0.6113793", "text": "function run() {\n\tgame.step();\n\t$(\"#round span\").text(game.round);\n}", "title": "" }, { "docid": "4c34938fc5e9eb0c3d188b4d62ae9747", "score": "0.61100984", "text": "function run() {\n\t\t\n\t\tdefineViews();\n\t\tstartAudio();\n\t\tloadIndex();\n\n\t}", "title": "" }, { "docid": "59b360382497ce525ab3f173b3547f97", "score": "0.6093749", "text": "function startGame() {\n showGuessesRemaining();\n showWins();\n showLoss();\n}", "title": "" }, { "docid": "63b0a2db705ada2e10b5ac6ebeb059a5", "score": "0.60927963", "text": "function startGame(user_id, map_status, map_data) {\n // map_status: 0 if the map needs to be regenerated\n // 1 if the map is loaded from server's database\n // map_data: if map_status is 1, map_data contains data for stored map\n // user_id: id for logged-in user in the database\n\n \n input = new p5.AudioIn();\n input.start();\n\tstart_verify=1;\n return;\n\n //myscore = new score(\"black\", canvas_width - 150, 60);\n\n //candy_flag = false;\n //candy_p = 0.5;\n //offset = createMap(map_status, map_data, user_id);\n\n}", "title": "" }, { "docid": "f8e5de9964e1ca9a02bc8dc7e96b12c2", "score": "0.6091724", "text": "function start() {\n \n }", "title": "" }, { "docid": "6fe7b0357d2cc4e19a5ecb37ccec7e9c", "score": "0.6087394", "text": "function start() {\n \n }", "title": "" }, { "docid": "509ff112725dc5c8061aa4dbf0ce94c0", "score": "0.608663", "text": "start () {\n //this._setScreen(new WelcomeScreen());\n this._setScreen(new PlaygroundScreen());\n\n //this._gameState.on('start', (isStarted) => {\n // if (isStarted) {\n // this._setScreen(new PlaygroundScreen());\n // } else {\n // this._setScreen(new GameOverScreen());\n // }\n //});\n this._gameState.on('start', () => {\n this._setScreen(new PlaygroundScreen());\n });\n this._gameState.on('stop', () => {\n this._setScreen(new GameOverScreen());\n });\n\n this._loop = setInterval(this._render.bind(this), 1000 / config.fps);\n }", "title": "" }, { "docid": "0fffd57b048beb257f743308236a9f73", "score": "0.6086617", "text": "function startGame() {\n //create first question slot for responses \n questionResponses[questionIndex] = {};\n fetch(`http://localhost:5000/questions/${questionIndex}`)\n .then(res => res.json())\n .then(json => {\n //questionIndex++;\n const questionData = json[0];\n emitTimer();\n // need to make the userPool incluse specifc user Data (pics)\n io.emit('userPool', userPool);\n io.emit('initializeGame', questionData);\n gameInterval = setInterval( () => {\n if (game_started) {\n emitTimer();\n }\n }, 1000);\n });\n }", "title": "" }, { "docid": "77282ab196020bf89d05b8ff7776ce96", "score": "0.60817665", "text": "function startGame () {\n\n\tgameloop = setInterval(function () {\n\n\t\tgrid.output();\n\n\t\tgrid.run();\n\n\t\tcounter++;\n\n\t\t$(\"#iteration_counter\").text(\"Iterations : \" + counter);\n\n\t\t$(\"#population_counter\").text(\"Population : \" + population);\n\n\t}, 250);//the game processes an iteration every 0.5 seconds\n\n}", "title": "" } ]
fca0fcca6b4daee5af28573fd2fc81c6
Call f for all linked documents.
[ { "docid": "ec73ada748a48d3a8d712e577df7d14a", "score": "0.7241715", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n\t function propagate(doc, skip, sharedHist) {\n\t if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n\t var rel = doc.linked[i];\n\t if (rel.doc == skip) continue;\n\t var shared = sharedHist && rel.sharedHist;\n\t if (sharedHistOnly && !shared) continue;\n\t f(rel.doc, shared);\n\t propagate(rel.doc, doc, shared);\n\t }\n\t }\n\t propagate(doc, null, true);\n\t }", "title": "" } ]
[ { "docid": "03bf0fafec6a67970c138878f96e65f6", "score": "0.72992796", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) {\n for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) {\n continue\n }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) {\n continue\n }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "b3c70866636965763d74fb4b34cd3eee", "score": "0.7287167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\r\n function propagate(doc, skip, sharedHist) {\r\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\r\n var rel = doc.linked[i];\r\n if (rel.doc == skip) continue;\r\n var shared = sharedHist && rel.sharedHist;\r\n if (sharedHistOnly && !shared) continue;\r\n f(rel.doc, shared);\r\n propagate(rel.doc, doc, shared);\r\n }\r\n }\r\n propagate(doc, null, true);\r\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "4b7619e999f2aa857ffc1e93c1c0aab7", "score": "0.7266578", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "57d150d70f60f8b13f99c1c952e56e9c", "score": "0.72633684", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) {\n for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) {\n continue;\n }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) {\n continue;\n }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "011547c2327c01ef656156c35171613b", "score": "0.72528714", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) {\n for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i]\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared)\n propagate(rel.doc, doc, shared)\n }\n }\n }\n propagate(doc, null, true)\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "f3c2fbcbc3a6bdd1e242dc9c49cc14d1", "score": "0.7237167", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }", "title": "" }, { "docid": "ca573a161b5028d201a2bcdd447bd270", "score": "0.7220414", "text": "function linkedDocs(doc, f, sharedHistOnly) {\r\n function propagate(doc, skip, sharedHist) {\r\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\r\n var rel = doc.linked[i];\r\n if (rel.doc == skip) { continue }\r\n var shared = sharedHist && rel.sharedHist;\r\n if (sharedHistOnly && !shared) { continue }\r\n f(rel.doc, shared);\r\n propagate(rel.doc, doc, shared);\r\n } }\r\n }\r\n propagate(doc, null, true);\r\n}", "title": "" }, { "docid": "9e1c78d10cb20ea196b225934816812c", "score": "0.7193693", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n\t function propagate(doc, skip, sharedHist) {\n\t if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n\t var rel = doc.linked[i];\n\t if (rel.doc == skip) { continue }\n\t var shared = sharedHist && rel.sharedHist;\n\t if (sharedHistOnly && !shared) { continue }\n\t f(rel.doc, shared);\n\t propagate(rel.doc, doc, shared);\n\t } }\n\t }\n\t propagate(doc, null, true);\n\t}", "title": "" }, { "docid": "9e1c78d10cb20ea196b225934816812c", "score": "0.7193693", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n\t function propagate(doc, skip, sharedHist) {\n\t if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n\t var rel = doc.linked[i];\n\t if (rel.doc == skip) { continue }\n\t var shared = sharedHist && rel.sharedHist;\n\t if (sharedHistOnly && !shared) { continue }\n\t f(rel.doc, shared);\n\t propagate(rel.doc, doc, shared);\n\t } }\n\t }\n\t propagate(doc, null, true);\n\t}", "title": "" }, { "docid": "3c8425ee6ab5f784cebebe66a65017c5", "score": "0.7183975", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n\t function propagate(doc, skip, sharedHist) {\n\t if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n\t var rel = doc.linked[i]\n\t if (rel.doc == skip) { continue }\n\t var shared = sharedHist && rel.sharedHist\n\t if (sharedHistOnly && !shared) { continue }\n\t f(rel.doc, shared)\n\t propagate(rel.doc, doc, shared)\n\t } }\n\t }\n\t propagate(doc, null, true)\n\t}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "24d155b334508520783f8c5e68599fab", "score": "0.7166822", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n}", "title": "" }, { "docid": "ef7877fa47811ecadcb1b376fc9d0eb7", "score": "0.71549785", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i]\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared)\n propagate(rel.doc, doc, shared)\n } }\n }\n propagate(doc, null, true)\n}", "title": "" }, { "docid": "ef7877fa47811ecadcb1b376fc9d0eb7", "score": "0.71549785", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i]\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared)\n propagate(rel.doc, doc, shared)\n } }\n }\n propagate(doc, null, true)\n}", "title": "" }, { "docid": "ef7877fa47811ecadcb1b376fc9d0eb7", "score": "0.71549785", "text": "function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i]\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared)\n propagate(rel.doc, doc, shared)\n } }\n }\n propagate(doc, null, true)\n}", "title": "" }, { "docid": "c17dfc428faa6d51c9d5d45e50af99b8", "score": "0.5986396", "text": "function withDocuments(urlList, onloadFunc, onrendezvousFunc)\r\n{\r\n var context = new Object();\r\n context.resultDocList = new Array();\r\n context.pendingCount = urlList.length;\r\n\r\n for (var u in urlList)\r\n {\r\n var dc = new DocumentContainer();\r\n dc.loadFromSameOrigin(urlList[u],\r\n function(curDoc) {\r\n if (onloadFunc != null) {\r\n onloadFunc(curDoc);\r\n }\r\n if (--context.pendingCount == 0) {\r\n if (onrendezvousFunc != null) {\r\n context.resultDocList.push(curDoc);\r\n onrendezvousFunc(context.resultDocList);\r\n }\r\n }\r\n }\r\n );\r\n }\r\n}", "title": "" }, { "docid": "239a4a4d008de009dcc954278aa7bcac", "score": "0.55441475", "text": "function withDocumentsSerialized(urlList, func, docList)\r\n{\r\n var curUrl = urlList.shift();\r\n if (docList == null)\r\n docList = new Array();\r\n\r\n var dc = new DocumentContainer();\r\n dc.loadFromSameOrigin(curUrl,\r\n function(curDoc) {\r\n if (urlList.length > 0)\r\n withDocuments(urlList, func, docList);\r\n else\r\n func(docList);\r\n }\r\n );\r\n}", "title": "" }, { "docid": "65fed1a4f43635aa9b9da781d8aec56e", "score": "0.54027", "text": "function attachLinksToDefinedTerms() {\n queryAll(document, 'dt').forEach(dt => {\n if (dt.id !== \"\") {\n attachSelfLink(dt);\n }\n });\n }", "title": "" }, { "docid": "a1bf541c8dbce421e15e88120848ad41", "score": "0.5371516", "text": "forEach(f) {\n while (this._hasNext()) {\n f(this._next());\n }\n }", "title": "" }, { "docid": "f08fd71cdbccd625c4464531fc1e9781", "score": "0.5361084", "text": "function reloadDocumentList() {\n}", "title": "" }, { "docid": "4234c279efa5bd7645c0df19a9fe1232", "score": "0.53585565", "text": "function forall(xpath,f) { \r\n var results=document.evaluate(xpath,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r\n for (var i=0; i<results.snapshotLength; i++) f(results.snapshotItem(i));\r\n}", "title": "" }, { "docid": "7235ce45b396513f8cba8b8c784c85fe", "score": "0.5322965", "text": "forEach(f) {\n for (let i = 0; i < this.content.length; i++)\n f(this.content[i], i, i + 1)\n }", "title": "" }, { "docid": "e5ec8bf4ec03f2f9780d291090d944d0", "score": "0.52636164", "text": "nodeWalkAllDocuments(predicate) {\n var results = [];\n for (var href in this.parsedDocuments) {\n var newNodes = dom5.nodeWalkAll(this.parsedDocuments[href], predicate);\n results = results.concat(newNodes);\n }\n return results;\n }", "title": "" }, { "docid": "e8fc1a1f0126961b150d9433b690399c", "score": "0.5226323", "text": "function loadDocumentOfAllGraph(callback) {\n //per ogni grafo vengono scaricati tutti gli item \n $.when(caricaListaDocumenti()).then(function (json)\n {\n var arrayPulito = json.results.bindings;\n listaDocGrafi = arrayPulito;\n callback();\n });\n}", "title": "" }, { "docid": "0b15026e4474a509fd7d0e37c99089f3", "score": "0.5176116", "text": "forEach(f) {\n var next;\n while (this._hasNext()) {\n next = this._next();\n if (this._itemIsValid(next)) {\n f(next);\n }\n }\n }", "title": "" }, { "docid": "4423ab043512688c55fb3462a6919441", "score": "0.5171113", "text": "async findDocumentList(fn) {\n if (!fn) return _EMPTY_LIST\n\n const list = await this.getDocumentList()\n return list.filter(fn)\n }", "title": "" }, { "docid": "576e73802c555ea6f01a742ac397d224", "score": "0.50881284", "text": "forEach(f) {\n let aux;\n if (!f || !f.call) return;\n\n this.resetIterator();\n aux = this.next();\n\n while (aux) {\n if (f(aux, this.store.idx)) {\n break;\n }\n\n aux = this.next();\n }\n\n this.resetIterator();\n }", "title": "" }, { "docid": "e0bd7b966de5907b297208b0bfe4ab2c", "score": "0.50601023", "text": "forEach(f) {\n this.iterator().forEach(f);\n }", "title": "" }, { "docid": "3439c0733c3dd38ea5d22245e1b68160", "score": "0.5036612", "text": "function traverse(f){\n\t\tvar currentNode = head.next;\n\n\t\twhile(currentNode !== null){\n\t\t\tf(currentNode);\n\t\t\tcurrentNode = currentNode.next;\n\t\t}\n\t}", "title": "" }, { "docid": "7a417b8e77b4d8b4da7af715bb8189ea", "score": "0.49993563", "text": "function eachViewLink (callback)\n\t{\n\t\tfor (var i = 0, il = viewLinks.length; i < il; i++) {\n\t\t\tcallback (viewLinks[i]);\n\t\t}\n\t}", "title": "" }, { "docid": "22f32db4fbeddbb027fdeb6ef972258a", "score": "0.49942935", "text": "function printLinks(idDoc,name,author,summery,link) \n \t\t\t{ \n \t\t\t\t \tvar fileDisplayArea2 = document.createElement('PRE');\n \t\t\t\t \tfileDisplayArea2.setAttribute(\"id\",\"fileDisplayArea\");\n \t\t\t\t \t//link to document\n \t\t\t\t \tvar a = document.createElement('a');\n\t\t\t\t\tvar linkText = document.createTextNode( \"\\n\" + \"Link To Document\" + \"\\n\" + \"\\n\");\n\t\t\t\t\ta.href = link;\n\t\t\t\t\ta.target= \"_blank\";\n\t\t\t\t\ta.setAttribute(\"id\",countDocResult);\n\t\t\t\t\t//attach to element\n\t\t\t\t\ta.appendChild(linkText);\n\t\t\t\t\t//create element for name of the doc\n\t\t\t\t\tvar nameB = document.createElement(\"B\"); \n\t\t\t\t\tvar title = document.createTextNode(name +\"\\n\"); \n\t\t\t\t\t//create element for author of the doc\n\t\t\t\t\tvar authorB = document.createElement(\"B\"); \n\t\t\t\t\tvar authorText = document.createTextNode(author +\"\\n\");\n\t\t\t\t\t//summery of the doc and attach it to paragraph\n\t\t\t\t\tvar details = document.createTextNode(summery);\n\t\t\t\t\t//create button\n\t\t\t\t\tvar button = document.createElement(\"input\");\n \t\t\t\t\tbutton.type = \"button\";\n \t\t\t\t\tbutton.value = \"Show\";\n \t\t\t\t\tbutton.setAttribute(\"id\",countDocResult);\n \t\t\t button.onclick = function()\n \t\t\t { \n \t\t\t \tif(flagShow==1)\n \t\t\t \t{\n \t\t\t \t\t$(\"#docPre\").remove();\n \t\t\t \t\tflagShow=0;\n \t\t\t \t}\n \t\t\t \tif(flagShow==0)\n\t\t\t\t\t{\n \t\t\t \tvar newIdDoc=idDoc-1;\n\t\t\t\t\tvar idBtn=this.id;\n\t\t\t\t\tvar showDocument = document.createElement('PRE');\n \t\t\t\t \tshowDocument.setAttribute(\"id\",\"docPre\");\n\t\t\t\t\tvar allDoc = document.createTextNode(documentArray[newIdDoc]);\n\t\t\t\t\tshowDocument.appendChild(allDoc);\n\t\t\t\t\tparaShow.appendChild(showDocument);\n\t\t\t\t\tvar srcString = $(\"#allDocument\").html();\n\t\t\t\t\tfor(var index=0;index<wordBuzz.length;index++)\n\t\t\t\t\t{\n\t\t\t\t\tvar term = wordBuzz[index];\n\t\t\t\t\tif(term!=\" \")\n\t\t\t\t\t{\n\t\t\t\t\tterm = term.replace(/\\s\\s+/g,\"(<[^>]+>)*$1(<[^>]+>)*\");\n\t\t\t\t\tvar pattern = new RegExp(\"(\"+term+\")\", \"gi\");\n\t\t\t\t\tsrcString = srcString.replace(pattern, \"<mark>$1</mark>\");\n\t\t\t\t\tsrcString = srcString.replace(/(<mark>[^<>]*)((<[^>]+>)+)([^<>]*<\\/mark>)/,\"$1</mark>$2<mark>$4\");\n\t\t\t\t\t$(\"#allDocument\").html(srcString);\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//print the document\n\t\t\t\t\tprintDocument($(allDocument).html());\n\t\t\t\t\tflagShow=1;\t\n\t\t\t\t\t}\n \t\t\t\t };\n\t\t\t\t\tnameB.appendChild(title);\n\t\t\t\t\tfileDisplayArea2.appendChild(nameB);\n\t\t\t\t\tauthorB.appendChild(authorText);\n\t\t\t\t\tfileDisplayArea2.appendChild(authorB);\n\t\t\t\t\tfileDisplayArea2.appendChild(details);\n \t\t\t\t\tfileDisplayArea2.appendChild(button);\n \t\t\t\t\tfileDisplayArea2.appendChild(a);\n \t\t\t\t \twrapper.appendChild(fileDisplayArea2);\n \t\t\t\t \tcountDocResult++;\t\t\t \n \t\t\t\t \twindow.onload = function() {\n \t\t\t\t \tdocument.getElementById(this.id).onclick = function() {}\n \t\t\t\t };\t\n \t\t}", "title": "" }, { "docid": "2a9d24af9ae4517ea6735028e9c89b97", "score": "0.49509674", "text": "getGoogleDocList(){}", "title": "" }, { "docid": "b8f2a4c277f546eb858067b002abed39", "score": "0.49499962", "text": "nodeWalkDocuments(predicate) {\n var results = [];\n for (var href in this.parsedDocuments) {\n var newNodes = dom5.nodeWalkAll(this.parsedDocuments[href], predicate);\n results = results.concat(newNodes);\n }\n return results;\n }", "title": "" }, { "docid": "e24027c2888cf6d5b61a5c195f0f316b", "score": "0.49482745", "text": "function forEachMatch(path, f, root) {\n\tvar el;\n\tvar root = (root == null) ? document : root;\n\tvar matches = root.evaluate(\n\t\tpath, root, null,\n\t\tXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\n\tfor (var i = 0; el=matches.snapshotItem(i); i++)\n\t\tf(el);\n}", "title": "" }, { "docid": "dc9cf279483f26aa45b9b679c1106d4e", "score": "0.49175206", "text": "function each(array, f, callback) {\n\t\t//TODO: this function also exists in file-indexer.js. Put into utils.js and remove from both.\n\t\tfunction loop(i) {\n\t\t\tif (i<array.length) {\n\t\t\t\tf(array[i], function () {\n\t\t\t\t\tloop(i+1);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\t\tloop(0);\n\t}", "title": "" }, { "docid": "960110f911e28221e00ee37ea24d32ed", "score": "0.49126178", "text": "function forEachMatch(path, f, root) {\r\n var root = (root == null) ? document : root;\r\n var matches = root.evaluate(\r\n path, root, null,\r\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i = 0; i < matches.snapshotLength; i++)\r\n f(matches.snapshotItem(i));\r\n }", "title": "" }, { "docid": "ec519516924b9b258eb2caf3603030e1", "score": "0.4885538", "text": "iterChanges(f, individual = false) {\n iterChanges(this, f, individual);\n }", "title": "" }, { "docid": "634aea04e4f59fb8dc7e76964f7c11fd", "score": "0.485095", "text": "iterChanges(f, individual = false) {\n iterChanges(this, f, individual);\n }", "title": "" }, { "docid": "fef2008d545cf78c68d40c25759dfa79", "score": "0.48455033", "text": "iterChanges(f, individual = false) {\n iterChanges(this, f, individual);\n }", "title": "" }, { "docid": "f0c01387693de0aa9240e7b2fd71553c", "score": "0.48408228", "text": "forEach(f) {\n this._items.forEach(f);\n }", "title": "" }, { "docid": "c290eacea30104ccb6b50b0d3404d9aa", "score": "0.48345318", "text": "function showFilms(container, films_urls)\n{\n ol = document.createElement('ol')\n container.appendChild(ol)\n for (let i = 0 ; i < films_urls.length ; i++)\n {\n send_request(films_urls[i], (obj) => showFilm(ol, obj))\n }\n}", "title": "" }, { "docid": "806b6432534ac3f608393f647c31d2f4", "score": "0.48297605", "text": "function documentsLoaded() {\n\t\t\t\tif (scope.onDocumentsLoaded) {\n\t\t\t\t\tscope.onDocumentsLoaded(vm.relatedResponse);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "bc4e3ef6a28d296aafc27da47e3842af", "score": "0.48215306", "text": "function documentListOnClick(e) {\n e.preventDefault();\n //change list highlighting\n $('.active').removeClass('active');\n $(e.target).addClass('active');\n //stop remote document sharing for the old document, if any\n editor = $('.document-area');\n mobwrite.unshare(editor[0]);\n transport.dropView(clientId);\n //switch to a new document\n $('#documentPanel').show();\n $('#title').text(e.target.innerText);\n editor.attr('id', 'document_' + e.target.id);\n editor.text('');\n $('.shadow').text('');\n // start remote sharing for a new document\n mobwrite.syncGateway = '/document/' + e.target.id;\n mobwrite.share(editor[0]);\n}", "title": "" }, { "docid": "e6f86f22d4eed76f15eb278cb4ee6571", "score": "0.48161304", "text": "function caricadocumento(data) {\n\tuser_actual_document=data;\n\t$(\"#tabs section .nano-content\").empty();/*svuoto eventuale roba contenuta nella tab*/\n\t$(\"#loader\").fadeIn(\"fast\");\n\t$.ajax({\n\t\ttype: 'GET',/*prima get. serve per riempire la mainarea con l'articolo (solo con quello, senza metadati)*/\n\t\tdataType: 'html',\n\t\turl: \"../cgi-bin/maindoc.py\",\n\t\tdata: {link:data},/*passo il link con cui fare la open*/\n\t\tsuccess: function (d) {\n\t\t\t$(\"#tabs section .nano-content\").append(d);/*inserisco l'articolo*/\n\t\t\t$(\"#loader\").fadeOut(\"fast\");\n\t\t\t$(\".nano\").nanoScroller(); /*solito scroller che si aggiorna*/ \n\t\t\tannotadoc(data);\n\t\t\tannotafram(data);\n\t\t\tgetDim();\n\t\t\tavoidhref(); \n\t\t},\n\t\terror: function (request, status, error) {\n\t\t\talert(\"errore\");\n\t\t}\n\t});\n\t$.ajax({\n\t\ttype: 'GET', /*con questa chiedo solo i metadati*/\n\t\tdataType: 'html',\n\t\turl: \"../cgi-bin/metadoc.py\",\n\t\tdata: {link:data},\n\t\tsuccess: function (d) {\n\t\t\t$('#metaarea section .nano-content').empty();\n\t\t\t$('#metaarea section .nano-content').append(d);\n\t\t\t$(\".nano\").nanoScroller();\n\t\t\tgetDim();\n\t\t\tavoidhref();\n\t\t},\n\t\terror: function (request, status, error) {\n\t\t\talert(\"errore\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "afa166b319690706cc57ba5a935b78e2", "score": "0.47969165", "text": "function processLinks(docbody) {\n // Links are of the form \"[Link Name](http://example.com/page/address)\"\n var link = docbody.findText('\\\\[.*?\\\\]\\\\(https?:\\\\/\\\\/.*?\\\\)');\n if (link) {\n var start = link.getStartOffset();\n var end = link.getEndOffsetInclusive();\n var text = link.getElement().asText();\n var linkName = text.getText().split('[')[1].split(']')[0];\n var url = text.getText().split(']')[1].split('(')[1].split(')')[0];\n text.deleteText(start, end);\n text.insertText(start, linkName);\n text.setLinkUrl(start, start + linkName.length - 1, url);\n numChanged++;\n processLinks(docbody);\n }\n}", "title": "" }, { "docid": "9f1e70a933f6de4b3c14c08c220010b8", "score": "0.47954437", "text": "function caricaDoc() {\n // solo nel momento in cui loadDocumentofAllGraphh ha finito, allora viene fatta la chiamata al\n // server per prendere i titoli\n loadDocumentOfAllGraph(function () {\n \n var lista = JSON.stringify(listaDocGrafi);\n \n $.ajax({\n type: 'POST',\n url: 'php/cacheListaDocumenti.php',\n // dataType: 'json',\n data: 'listaDoc=' + lista, \n success: function (json) {\n var queryResults = jsonParse(json);\n // per ogni titolo e url che ci ritorna, allora lo stampiamo nella docList\n $('#docList').empty();\n $.each(queryResults, function (i, url, titolo) {\n var titolo = queryResults[i].titolo;\n var cleanTitle = titolo.replace(/(['\"&:;])/g, \"\"); // Replace di virgolette singole, doppie e caratteri speciali con un escape\n var url = queryResults[i].url;\n var doc = \"\";\n if (url === activeURI) {\n doc += '<a class=\"list-group-item active\" href=\"#\" data-toggle=\"collapse\" data-target=\"#collapseOne\" title=\"' + titolo + '\" name=\"' + url\n + '\" onclick=\"apriDocumento(\\'' + cleanTitle + '\\',\\'' + url + '\\');\">' + titolo + '</a>';\n } else {\n doc += '<a class=\"list-group-item\" href=\"#\" data-toggle=\"collapse\" data-target=\"#collapseOne\" title=\"' + titolo + '\" name=\"' + url\n + '\" onclick=\"apriDocumento(\\'' + cleanTitle + '\\',\\'' + url + '\\');\">' + titolo + '</a>';\n }\n $('#docList').append(doc);\n docNum++;\n $('.badgeDocumenti').text(docNum + \" Annotati\");\n $('#loading1').attr('class', ''); // Stop icona caricamento\n\n });\n pageList();\n },\n error: function (jqXHR, textStatus, errorThrown) {\n avviso(\"Qualcosa è andato storto nel caricamento della lista dei documenti.\");\n }\n });\n });\n}", "title": "" }, { "docid": "35ac2a9edf2d926d7a275559f230c848", "score": "0.4785486", "text": "static for_each(f, node) {\n const nodes = Array.isArray(node) ? node : [node];\n const traverse = function (node) {\n f(node);\n if (node.children)\n for (let i = 0; i < node.children.length; i++)\n traverse(node.children[i]);\n };\n for (let i = 0; i < nodes.length; i++)\n traverse(nodes[i]);\n }", "title": "" }, { "docid": "f0c90d2deb5521d8cf482dbe141543ea", "score": "0.47829378", "text": "loadAll() {\n dbPouch.allDocs({include_docs: true})\n .then(function (response) {\n viewer.display(response);\n }).catch(function (err) {\n console.log(err);\n });\n }", "title": "" }, { "docid": "f8134366b3dd12be196e5819dd6148a3", "score": "0.47713345", "text": "function load_doc(elem, dopush) {\r\n $(\"div.addon_documentation-navi li\").removeClass(\"current\");\r\n $(\"div.addon_documentation-navi a\").removeClass(\"current\");\r\n $(elem).addClass(\"current\");\r\n $(elem).parent().addClass(\"current\");\r\n $(\"html, body\").animate({\r\n scrollTop: 0\r\n }, 200);\r\n\r\n $url = $(elem).attr(\"href\") + \"&ajax=true\";\r\n $target = $(\"div.addon_documentation-content\").find(\"div.panel-body\");\r\n $doctitle = $(\"div.addon_documentation-content\").find(\"#doc-file-name\");\r\n $document = getUrlParameter(\"document_file\", $url);\r\n $($doctitle).html($document);\r\n\r\n $($target).html(\r\n '<div style=\"text-align:center;color:#9ba4b1;\"><i class=\"fa fa-cog fa-spin fa-2x fa-fw\"></i></div>'\r\n );\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n url: $url,\r\n cache: true,\r\n dataType: \"html\",\r\n success: function (response) {\r\n $($target).html(response);\r\n // Externe Links in neuem Fenster\r\n $(\"section.addon_documentation\")\r\n .find(\"a\")\r\n .each(function () {\r\n var a = new RegExp(\"/\" + window.location.host + \"/\");\r\n if (!a.test(this.href) && this.href) {\r\n $(this).addClass(\"extern\");\r\n $(this).click(function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n window.open(this.href, \"_blank\");\r\n });\r\n }\r\n });\r\n // Bei internen Links Dokument laden\r\n $(\"div.addon_documentation-content a.doclink\").on(\"click\", function (\r\n event,\r\n container\r\n ) {\r\n if (!$(this).hasClass(\"extern\")) {\r\n load_doc($(this), true);\r\n }\r\n event.preventDefault();\r\n return false;\r\n });\r\n // Link in der Navigaton hervorheben\r\n $(\"div.addon_documentation-navi\")\r\n .find('a[href$=\"' + $document + '\"]')\r\n .each(function () {\r\n if ($(this).html() != \"\") {\r\n $(this).addClass(\"current\");\r\n $(this).parent().addClass(\"current\");\r\n }\r\n });\r\n if (dopush) {\r\n history.pushState($document, $document, $(elem).attr(\"href\"));\r\n }\r\n }\r\n }).fail(function (jqXHR, textStatus) {\r\n $($target).html(\r\n '<div class=\"alert alert-danger\">AJAX-Error: ' + textStatus + '<br>' + $url + \"</div>\"\r\n );\r\n });\r\n}", "title": "" }, { "docid": "f1c3e9dd519b3dc25d1270e9d6da9273", "score": "0.4766212", "text": "function getDocumentData(e) {\n e.preventDefault();\n var $self = $('form[action=\"/posts\"][method=post]');\n var url = $self.find('*[name=link]').val();\n\n if ($self.data('link') === url) return;\n\n $self.addClass('loading');\n $self.data('link', url);\n\n var rg = /^(http|https):\\/\\/(([a-zA-Z0-9$\\-_.+!*'(),;:&=]|%[0-9a-fA-F]{2})+@)?(((25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9]|[1-9][0-9]|[0-9])(\\.(25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9]|[1-9][0-9]|[0-9])){3})|localhost|([a-zA-Z0-9\\-\\u00C0-\\u017F]+\\.)+([a-zA-Z]{2,}))(:[0-9]+)?(\\/(([a-zA-Z0-9$\\-_.+!*'(),;:@&=]|%[0-9a-fA-F]{2})*(\\/([a-zA-Z0-9$\\-_.+!*'(),;:@&=]|%[0-9a-fA-F]{2})*)*)?(\\?([a-zA-Z0-9$\\-_.+!*'(),;:@&=\\/?]|%[0-9a-fA-F]{2})*)?(\\#([a-zA-Z0-9$\\-_.+!*'(),;:@&=\\/?]|%[0-9a-fA-F]{2})*)?)?$/;\n if (!url.match(rg)) {\n $('form[action=\"/posts\"][method=post]').removeClass('loading');\n return;\n }\n\n $.post('/documents', {\n url: url\n }, function(doc, status, xhr) {\n console.log(doc);\n\n $self.find('*[data-bind=preview]').removeClass('hidden');\n\n if (!$self.data('name-touched')) {\n $self.find('*[name=\"document[name]\"]').val(doc.title);\n $self.find('*[data-bind=document-name]').html(doc.title);\n }\n if (!$self.data('description-touched')) {\n $self.find('*[name=\"document[description]\"]').val(doc.description);\n $self.find('*[data-bind=document-description]').html(doc.description);\n }\n\n if (doc.image && doc.image.url) {\n $self.find('*[data-bind=document-image]').attr('src', doc.image.url);\n }\n\n $('form[action=\"/posts\"][method=post]').removeClass('loading');\n }, 'json');\n}", "title": "" }, { "docid": "24145f7d9bff7c29a60989475144a141", "score": "0.47637275", "text": "function main() {\n if (!documents.length) {\n alert('Error\\nOpen a document and try again');\n return;\n }\n\n if (!selection.length || selection.typename == 'TextRange') {\n alert('Error\\nPlease select atleast one object');\n return;\n }\n\n var doc = activeDocument,\n selPaths = [];\n\n getPaths(selection, selPaths);\n\n for (var i = 0, selLen = selPaths.length; i < selLen; i++) {\n reverseGradient(selPaths[i]);\n }\n}", "title": "" }, { "docid": "5804f4e403261d0ac859159ee001f43c", "score": "0.47586668", "text": "function getAllDocs() {\n self.showAllOptions = false;\n getNextLimitDocuments('all');\n }", "title": "" }, { "docid": "8f0a5cd8b0fa73a58867cbec4e01a4df", "score": "0.474592", "text": "forEach(fn) {\n this._objects.forEach(fn);\n }", "title": "" }, { "docid": "8f0a5cd8b0fa73a58867cbec4e01a4df", "score": "0.474592", "text": "forEach(fn) {\n this._objects.forEach(fn);\n }", "title": "" }, { "docid": "b827edc8b2d30868c43d46d1cf68ee85", "score": "0.4731495", "text": "function iterate(i, f) {\n elt = i.iterateNext();\n while (elt) {\n f(elt);\n elt = i.iterateNext();\n }\n}", "title": "" }, { "docid": "5b290b3ad46237d97aeff177b2ff23e0", "score": "0.47037804", "text": "function loadDocuments() {\n\tconnect(\"/hiwi/Admin/js/loadDocuments\", \"\", handleLoadDocuments);\n\tselectedDocument = null;\n}", "title": "" }, { "docid": "1f72734a96f2f9c3381ee52a54fd8f01", "score": "0.46909848", "text": "function loopList(doc) {\n return __awaiter(this, void 0, void 0, function () {\n var parts, field, nextField;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n parts = [];\n return [4 /*yield*/, doc.rdf$first];\n case 1:\n field = _a.sent();\n if (!field) return [3 /*break*/, 3];\n return [4 /*yield*/, loopList(doc.rdf$rest)];\n case 2:\n nextField = _a.sent();\n parts = parts.concat([field.value], nextField);\n _a.label = 3;\n case 3: return [2 /*return*/, parts];\n }\n });\n });\n}", "title": "" }, { "docid": "29b24dca975d01c888e32d60294f1c85", "score": "0.46890858", "text": "function forEachManaged(f) {\n return self => forEachManaged_(self, f);\n}", "title": "" }, { "docid": "dc0f837b2243689adb5fe2ff9a8e3419", "score": "0.4684252", "text": "allFilesAndFoldersDo(closure) {\n this.allFilesAndFoldersBfsDo( closure )\n }", "title": "" } ]
ef0eff67e23d0972b18b8315c808a953
get base and quote asset from the Bittrex ticker name
[ { "docid": "dca5203bc53fa187e51548c935de08f1", "score": "0.826975", "text": "function bittrex_get_assets(ticker) {\n let l = ticker.split(\"-\");\n return {\"base\": (l[0]).toUpperCase(), \"quote\": (l[1]).toUpperCase()};\n}", "title": "" } ]
[ { "docid": "322c1f75c8d3158c2202ab4f49d8b4a9", "score": "0.7098674", "text": "function get_asset_2(market, asset_1) {\n if (market['quote'] === asset_1) {\n return market['base'];\n } else {\n return market['quote'];\n }\n}", "title": "" }, { "docid": "332eb83281b4c71c3aba5abbc1d671d6", "score": "0.62499136", "text": "function get_market(markets, base, quote) {\n for (market of markets) {\n let base_equal = (market['base'] === base);\n let quote_equal = (market['quote'] === quote);\n if (base_equal && quote_equal) {\n return market;\n }\n }\n return \"Failed to Find Market\";\n}", "title": "" }, { "docid": "0b47e88c8d38ed1e2f6169d64d0f75eb", "score": "0.5951807", "text": "function getStockData(ticker) {\n\tconst queryPromise = axios ({\n\t\turl: `http://marketdata.websol.barchart.com/getQuote.json?key=4bfdb2da99476a86a66cae1eef9b6aaa&symbols=${ticker}`,\n\t\tmethod: 'GET',\n\t})\n\treturn queryPromise;\n}", "title": "" }, { "docid": "6749c682a7a2a2d2cebbd89b9bd96130", "score": "0.5670245", "text": "getCoinData( item ) {\n let reg = /^([A-Z]+)(BTC|ETH|BNB|USDT|TUSD)$/;\n let symbol = String( item.s ).replace( /[^\\w\\-]+/g, '' ).toUpperCase();\n let token = symbol.replace( reg, '$1' );\n let asset = symbol.replace( reg, '$2' );\n let name = token;\n let pair = token +'/'+ asset;\n let icon = this.iconbase + token.toLowerCase() + '_.png';\n let open = parseFloat( item.o );\n let high = parseFloat( item.h );\n let low = parseFloat( item.l );\n let close = parseFloat( item.c );\n let change = parseFloat( item.p );\n let percent = parseFloat( item.P );\n let trades = parseInt( item.n );\n let tokenVolume = Math.round( item.v );\n let assetVolume = Math.round( item.q );\n let sign = ( percent >= 0 ) ? '+' : '';\n let arrow = ( percent >= 0 ) ? '▲' : '▼';\n let info = [ pair, close.toFixed( 8 ), '(', arrow, sign + percent.toFixed( 2 ) +'%', '|', sign + change.toFixed( 8 ), ')' ].join( ' ' );\n let style = '';\n \n if ( percent > 0 ) style = 'gain';\n if ( percent < 0 ) style = 'loss';\n \n return { symbol, token, asset, name, pair, icon, open, high, low, close, change, percent, trades, tokenVolume, assetVolume, sign, arrow, style, info };\n }", "title": "" }, { "docid": "4e5a49bee9f2baa986a418b14f825598", "score": "0.55899787", "text": "async function KuCoinGetTicker(symbol) {\n\ttry {\n\t\tlet r = await api.getTicker(symbol);\n\t\tif (symbol === \"BTC-USDT\") {\n\t\t\tvar bit_bid_price = parseFloat(\n\t\t\t\tparseFloat(r.data.bestBid).toFixed(2)\n\t\t\t);\n\t\t\tvar bit_ask_price = parseFloat(\n\t\t\t\tparseFloat(r.data.bestAsk).toFixed(2)\n\t\t\t);\n\t\t\tbitcoin_prices[\"KuCoin_bidPrice\"] = bit_bid_price;\n\t\t\tbitcoin_prices[\"KuCoin_askPrice\"] = bit_ask_price;\n\t\t} else if (symbol === \"ETH-USDT\") {\n\t\t\tvar eth_bid_price = parseFloat(\n\t\t\t\tparseFloat(r.data.bestBid).toFixed(2)\n\t\t\t);\n\t\t\tvar eth_ask_price = parseFloat(\n\t\t\t\tparseFloat(r.data.bestAsk).toFixed(2)\n\t\t\t);\n\t\t\tethereum_prices[\"KuCoin_bidPrice\"] = eth_bid_price;\n\t\t\tethereum_prices[\"KuCoin_askPrice\"] = eth_ask_price;\n\t\t}\n\t} catch (err) {\n\t\tconsole.log(err);\n\t}\n}", "title": "" }, { "docid": "2d735fae90569c7d5dfd7804d4cd40bc", "score": "0.5575127", "text": "function getCompanyName(ticker = 'goog') {\n try {\n request(`http://d.yimg.com/aq/autoc?query=${ticker}&region=US&lang=en-US`, function(error, response, body) {\n body = JSON.parse(body)\n body = body.ResultSet.Result[0].name\n document.getElementById('companyName').innerHTML = body\n })\n } catch(e) {\n console.log(e)\n }\n}", "title": "" }, { "docid": "8240eec4742b8ca3e35f39ce9b4b5695", "score": "0.55177355", "text": "getTickerByPrice(ticker) {\n const headers = {\n \"x-rapidapi-key\": this.secret,\n \"x-rapidapi-host\": \"twelve-data1.p.rapidapi.com\",\n };\n return axios_1.default.get(`https://${this.host}/price`, {\n headers,\n params: {\n symbol: ticker,\n format: 'json',\n outputsize: '1'\n }\n }).then(data => {\n this.logger.log(base_1.LogLevel.INFO, `${this.constructor.name}#getTickerByPrice = status: ${data.status} statusText: ${data.statusText} -- code: ${data.data.code} -- data: ${util_1.inspect(data.data)}`);\n if (data.data.hasOwnProperty('code') && data.data.code != 200) {\n return Promise.reject(new exceptions_1.UnrecoverableWorkerError(`ERROR: Failed to get current price for ${ticker}, MESSAGE: ${data.data.message}`));\n }\n return data.data.price;\n });\n }", "title": "" }, { "docid": "e1c1c4231760e4f768bbf430b5695961", "score": "0.5460011", "text": "function OHLCV_currency(__ccxt, __symbol, __timeframe) {\r\n if (__ccxt.hasFetchOHLCV) {\r\n console.log(__ccxt.id + ' has OHLCV');\r\n (async() => {\r\n let OHLCV = await __ccxt.fetchOHLCV(__symbol, __timeframe);\r\n console.dir(OHLCV);\r\n })();\r\n } else {\r\n console.log(__ccxt.id + ' dont have OHLCV');\r\n }\r\n}", "title": "" }, { "docid": "6ca8b95ba9f05c08ef70aa3401a2ea64", "score": "0.54161376", "text": "function getSymbol() {\n return {\n und: 'AAPL',\n price: 23.5,\n expiration: '03-04-2017',\n }\n}", "title": "" }, { "docid": "9fcb44f48754b8f3a90e3a00d6f5cbd6", "score": "0.53989255", "text": "function price_currency(__ccxt, __symbol) {\r\n (async() => {\r\n let prices = await __ccxt.fetchTicker(__symbol);\r\n console.log(__symbol + ':');\r\n console.log(prices);\r\n })();\r\n}", "title": "" }, { "docid": "564b6b92699fdf0e69777534c99b8eb9", "score": "0.5386646", "text": "function get_markets(markets, asset) {\n let ans = [];\n for (let market of markets) {\n if (market['base'] === asset || market['quote'] === asset) {\n ans.push(market);\n }\n }\n return ans;\n}", "title": "" }, { "docid": "516808c9f68eb02b36888e0c7f27a486", "score": "0.5344437", "text": "async function checkOrderBook(baseAssetSymbol, quoteAssetSymbol) {\n\tconst baseAssetAddress = ASSET_ADDRESSES[baseAssetSymbol].substring(2, 42)\n\tconst quoteAssetAddress = ASSET_ADDRESSES[quoteAssetSymbol].substring(2, 42)\n\tconst zrxResponse = await axios.get(`https://api.0x.org/sra/v3/orderbook?baseAssetData=0xf47261b0000000000000000000000000${baseAssetAddress}&quoteAssetData=0xf47261b0000000000000000000000000${quoteAssetAddress}&perPage=1000`)\n\tconst zrxData = zrxResponse.data\n\n\tconst bids = zrxData.bids.records\n\n\tbids.forEach((o) => {\n\t\tcheckArb({zrxOrder: o.order, assetOrder: [baseAssetSymbol, quoteAssetSymbol, baseAssetSymbol]}) // E.G. WETH, DAI, WETH\n\t})\n}", "title": "" }, { "docid": "63e516facb09851444f990a43f436a76", "score": "0.5335838", "text": "async handleCoinImage(symbol){\n const response = await fetch(`https://min-api.cryptocompare.com/data/all/coinlist`); //crypto.compare api \n if(response.status === 200){\n let data = await response.json();\n \n return data.Data[symbol];\n \n } else {\n throw new Error('unable to fetch coin info');\n }\n }", "title": "" }, { "docid": "313bdc52ab02fb090da814abf4ca0c06", "score": "0.533442", "text": "async function getCurrentStockPrice(symbol) {\n let apiToken = \"c1vjtst37jkpmefgjjvg\"; // Hard coded\n let url = \"https://finnhub.io/api/v1/quote?symbol=\" + symbol + \"&token=\" + apiToken;\n\n try {\n const response = await got(url);\n // console.log('DEBUG api response = ', response.body);\n let json = JSON.parse(response.body);\n // console.log('response.body c = ', json.c);\n\n return json.c;\n } catch (error) {\n console.log(error.response.body);\n }\n\n return null;\n}", "title": "" }, { "docid": "4556cfa0cbb50f9baf438909b513c340", "score": "0.5325051", "text": "function fetchStockPrice(tickerName) {\n\n removeButtons();\n getStoredSymbols();\n let callURL = 'https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=' + tickerName + '&apikey=S5E23FUR0IXVEJ9R'\n\n fetch(callURL)\n //this is the original fetch\n .then(response => response.json())\n //this fetch gets the price action\n .then(data => {\n let stockInfo = data['Global Quote']\n\n //calling the below function with an additional fetch to a different API to get company name\n getCompanyName(stockInfo)\n\n })\n .catch(error => {\n console.log('Error:', error);\n });\n\n}", "title": "" }, { "docid": "0bb3d71cc5de51d2c4efdbdedb79128b", "score": "0.5319929", "text": "async function getCurrentBtcDetails() {\n let url = BTC_BASE_URL+\"?api_key=\"+BTC_API_KEY;\n\n const result = await axios.get(url);\n const rates = result.data.USD;\n var currentdate = new Date(); \n\n var btc = new Btc(currentdate, rates);\n return btc;\n}", "title": "" }, { "docid": "d94cf789aba6885afcafc803c202b5e1", "score": "0.5269799", "text": "function getCompanyName(stockInfo) {\n let ticker = stockInfo['01. symbol']\n fetch('https://www.alphavantage.co/query?function=OVERVIEW&symbol=' + ticker + '&apikey=ZT0JKRPGS8C92ST0')\n .then(response => response.json())\n .then(tickerNameData => {\n\n // let tickerNameData = data\n if (tickerNameData == \"\") {\n alert(\"Couldn't find that stock, please try again!\")\n } else {\n populateBoxes(stockInfo, tickerNameData)\n }\n })\n\n .catch(error => {\n console.log('Error:', error);\n });\n}", "title": "" }, { "docid": "d8ebb8ecf09c63c68d7424f9150c2382", "score": "0.5261033", "text": "function getQuote() {\n fetch('https://animechan.vercel.app/api/random')\n .then(response => response.json())\n .then(result => quotes(result))\n}", "title": "" }, { "docid": "722d657e5ab49eb2e49876d696b3e3fd", "score": "0.5249541", "text": "function getStock(stockName) {\n return axios.get(getURL(stockName), {params}).then((response) => {\n if (response.data.quandl_error) {\n return Promise.reject(response.data.quandl_error);\n }\n else {\n // convert stock data from string to millisecond timestamps\n const data = response.data.dataset_data.data;\n \n data.forEach((element) => {\n element[0] = Date.parse(element[0]);\n });\n \n return Promise.resolve({name: stockName, data});\n }\n });\n}", "title": "" }, { "docid": "a6480062dfa371b6d60a6aaed7327203", "score": "0.52404034", "text": "function getTicker(userStock) {\n const ticker = userStock.symbol;\n\n if (userStock.type === \"currency\") {\n const currency =\n userStock.intermediateCurrency || storage.getUserSetting(\"currency\");\n\n return `${ticker}-${currency}`;\n } else {\n return ticker;\n }\n}", "title": "" }, { "docid": "84e7bebd2365c122aeab2dbe9989d88d", "score": "0.5216925", "text": "async function getStocksAlpha(coin1, chn, usr){\n let price = '';\n let vol = '';\n let change = '';\n \n let alphaJSON = await alpha.stocks.quote(coin1);\n \n let quote = JSON.stringify(alphaJSON[\"Global Quote\"]);\n if(!quote || 2 === quote.length) {\n chn.send(\"API Error: Ticker **\" + coin1.toUpperCase() + \"** not found.\");\n return;\n }\n //console.log(alphaJSON);\n price = alphaJSON[\"Global Quote\"][\"05. price\"];\n vol = alphaJSON[\"Global Quote\"][\"06. volume\"];\n change = alphaJSON[\"Global Quote\"][\"10. change percent\"];\n \n console.log(chalk.green('Alpha Vantage API ticker response: ' + chalk.cyan(price) + \" by: \") + chalk.yellow(usr.username));\n \n chn.send(\"Market price for **$\" + coin1.toUpperCase() + \"** is: `\" + price + \"` (`\" + parseFloat(change).toFixed(2) + \"%`).\");\n}", "title": "" }, { "docid": "25cbcb0098ec0f7597116b293d1746b4", "score": "0.51719904", "text": "async function fetchName() {\n if (typeof window.ethereum !== 'undefined') {\n const provider = new ethers.providers.Web3Provider(window.ethereum)\n const contract = new ethers.Contract(talonAddress, Talon.abi, provider)\n try {\n const data = await contract.name()\n const symbol = await contract.symbol()\n \n setData(data)\n setSymbol(symbol)\n \n } catch (err) {\n console.log(\"Error: \", err)\n }\n } \n }", "title": "" }, { "docid": "cfcfe74b07e46580557f331ea075eaf5", "score": "0.5146082", "text": "function getStockName(stock_name) {\n let realStockName;\n switch(stock_name) {\n case \"Tesla\":\n realStockName = \"tsla\";\n break;\n case \"Ferrari\":\n realStockName = \"race\";\n break;\n case \"Ford\":\n realStockName = \"f\";\n break;\n case \"Microsoft\":\n realStockName = \"msft\";\n break;\n case \"Apple\":\n realStockName = \"aapl\";\n break;\n } \n return realStockName;\n }", "title": "" }, { "docid": "fcc4ec10aa5c88dff79d2780f7582c91", "score": "0.5134899", "text": "function getCurrentPrice(coinSymbol) {\r\n for (let key in coinMarketCapData[\"data\"]) {\r\n if (coinMarketCapData[\"data\"][key][\"symbol\"] === coinSymbol) {\r\n return coinMarketCapData[\"data\"][key][\"quotes\"][\"USD\"][\"price\"];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "c620866a02ec3fcef16c6f54b26eacca", "score": "0.51186097", "text": "async getCurrencyQuote(currency = 'BTC') {\n console.log('currency', currency)\n return this.get(`/cryptocurrency/quotes/latest?&convert=USD&symbol=${currency}`,{},\n { headers: {\n //Retrieve coinmarketcap api key from context\n // set the X-CMC_PRO_API_KEY header for this request\n 'X-CMC_PRO_API_KEY': `${this.context.cmcApiKey}`,\n },\n });\n }", "title": "" }, { "docid": "71417ad1569936997babbce15873cbe7", "score": "0.50970626", "text": "async function getPriceCoinbase(chn, coin1, coin2){\n\n let fail = false;\n let tickerJSON = '';\n if (typeof coin2 === 'undefined') {\n coin2 = 'BTC';\n }\n if (coin2.toLowerCase() === 'usd' || coin1.toLowerCase() === 'btc'){\n coin2 = 'USD';\n }\n tickerJSON = await clientCoinbase.fetchTicker(coin1.toUpperCase() + '/' + coin2.toUpperCase()).catch(function (rej) {\n console.log(chalk.red.bold('Coinbase error: Ticker '\n + chalk.cyan(coin1.toUpperCase() + '/' + coin2.toUpperCase()) + ' not found!'));\n chn.send('API Error: Coinbase does not have market symbol __' + coin1.toUpperCase() + '/' + coin2.toUpperCase() + '__');\n fail = true;\n });\n if (fail) {\n //exit the function if ticker didn't exist, or api failed to respond\n return;\n }\n //console.log(tickerJSON);\n let s = parseFloat(tickerJSON['last']).toFixed(8);\n console.log(chalk.green('Coinbase API ticker response: ' + chalk.cyan(s)));\n let c = tickerJSON['info'].priceChangePercent;\n c = Math.round(c * 100) / 100;\n\n let ans = '__Coinbase__ Price for **' + coin1.toUpperCase() + '-' + coin2.toUpperCase() + '** is: `' + s + ' ' + coin2.toUpperCase() + '` .';// + '(' + '`' + c + '%' + '`' + ')' + '.';\n chn.send(ans);\n}", "title": "" }, { "docid": "1fdbfd8dfb30ac013fff4076b46b916d", "score": "0.5095385", "text": "function getUrl(targetSymbol, baseCurrency = defaultBaseCurrency) {\n\tconst apiBaseUrl = 'https://api.exchangeratesapi.io/latest';\n\tconst baseCurrencyQuery = `?base=${baseCurrency}`;\n\tconst targetCurrencySlot = `&symbols=${targetSymbol}`;\n\treturn `${apiBaseUrl}${baseCurrencyQuery}${targetCurrencySlot}`;\n}", "title": "" }, { "docid": "a690335394177f69298c65e146544233", "score": "0.5091472", "text": "function getBTC() \n{\n\treturn new Promise(resolve=>{\n\t\taxios.get('https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC&tsyms=USD')\n\t\t.then((response) => {\n\t\t\tif (response)\n\t\t\t{\n\t\t\t\tvar BTCval=response.data.BTC.USD;\n\t\t\t\tresolve (BTCval);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log(\"Error In Connection\");\n\t\t\t}\n\t\t})\n\t\t.catch((err) => {\n\t\t\tconsole.log(err);\n\t\t// reject(err);\n\t\t})\n\t})\n}", "title": "" }, { "docid": "42706aaa4d01a03f363aaf6d75c2fce6", "score": "0.5084615", "text": "function getStockCurrentPrice(argStock) {\r\n //console.log(`Processing current prices for '${argStock}'`);\r\n const url = encodeURI('https://finance.yahoo.com/quote/' + argStock + '?p=' + argStock);\r\n https.get(url, (resp) => {\r\n // ok the logic here is this: add chunks to the data and check for the occurrence of \"HistoricalPriceStore\":{\"prices\":[\r\n // when that occurs trim data to begin with that and startlooking for the end bracket: ']'. When that occurs trim your data \r\n // to include that and your data is complete. Ignore the rest of the chunks arriving\r\n  let data = '';\r\n let sourceIntervalFound = 0;\r\n let regularMarketPriceFound = 0;\r\n let regularMarketChangeFound = 0;\r\n let gotThePrice = 0;\r\n let gotTheChange = 0;\r\n let thePrice = null;\r\n let theChange = null;\r\n\r\n const sourceIntervalPattern = '\"' + argStock + '\":{\"sourceInterval\":';\r\n const regularMarketPricePattern = '\"regularMarketPrice\":{\"raw\":';\r\n const regularMarketChangePattern = '\"regularMarketChange\":{\"raw\":';\r\n\r\n //\"SYMBOL\":{\"sourceInterval\": is unique after which the first \"regularMarketPrice\":{\"raw\": should be the current price\r\n\r\n // A chunk of data has been recieved.\r\n  resp.on('data', (chunk) => {\r\n if (gotThePrice < 1 || gotTheChange < 1) {\r\n data += chunk;\r\n let sourceIntervalIdx = data.indexOf(sourceIntervalPattern);\r\n if ( sourceIntervalIdx > -1){\r\n data = data.substring( sourceIntervalIdx );\r\n sourceIntervalFound = 1;\r\n //check if regularMarketPrice immediately after it occurred - might be here as well\r\n let regularMarketPriceAfterSourceIntervalIdx = data.indexOf(regularMarketPricePattern);\r\n if (regularMarketPriceAfterSourceIntervalIdx > -1){\r\n regularMarketPriceFound = 1;\r\n //data = data.substring(regularMarketPriceAfterSourceIntervalIdx);\r\n // get the comma immediately after\r\n let commaAfterRegMarketPrIdx = data.indexOf(',', regularMarketPriceAfterSourceIntervalIdx + regularMarketPricePattern.length);\r\n if (commaAfterRegMarketPrIdx > -1){\r\n thePrice = data.substring(regularMarketPriceAfterSourceIntervalIdx + regularMarketPricePattern.length, commaAfterRegMarketPrIdx);\r\n gotThePrice = 1;\r\n console.log(`Price for '${argStock}' is ${thePrice}`);\r\n // save it to allStockPricesObj\r\n // allStockPricesObj[argStock] = data;\r\n }\r\n }\r\n // now for the market change:\r\n let regularMarketChangeAfterSourceIntervalIdx = data.indexOf(regularMarketChangePattern);\r\n if (regularMarketChangeAfterSourceIntervalIdx > -1){\r\n regularMarketChangeFound = 1;\r\n //data = data.substring(regularMarketPriceAfterSourceIntervalIdx);\r\n // get the comma immediately after\r\n let commaAfterRegMarketChIdx = data.indexOf(',', regularMarketChangeAfterSourceIntervalIdx + regularMarketChangePattern.length);\r\n if (commaAfterRegMarketChIdx > -1){\r\n theChange = data.substring(regularMarketChangeAfterSourceIntervalIdx + regularMarketChangePattern.length, commaAfterRegMarketChIdx);\r\n gotTheChange = 1;\r\n console.log(`Change for '${argStock}' is ${theChange}`);\r\n }\r\n }\r\n\r\n if(thePrice && theChange){\r\n allStockPricesObj[argStock] = thePrice + '|' + theChange;\r\n }\r\n\r\n }// if ( sourceIntervalIdx > -1){ ...\r\n \r\n\r\n } // end of if (gotThePrice < 1 || gotTheChange < 1) { ...}\r\n \r\n\r\n   });\r\n // The whole response has been received. Print out the result.\r\n  resp.on('end', () => {\r\n //console.log('Resp end occurred but it\\'s ok because we processed the stream as it came in');\r\n //process.exit(0);\r\n  });\r\n resp.on('error', (err) => {\r\n  console.log(\"Error in getStockCurrentPrice Response: \" + err.message);\r\n });\r\n\r\n }).on(\"error\", (err) => {\r\n  console.log(\"Error in getStockCurrentPrice GET: \" + err.message);\r\n //process.exit(0);\r\n });\r\n\r\n}", "title": "" }, { "docid": "f74f3b270340367e5c68de9a59f1a961", "score": "0.5079555", "text": "function getStockPrice(ticker = 'goog') {\n try {\n request(`http://finance.google.com/finance/info?q=${ticker}`, function(error, response, body) {\n body = body.slice(3)\n body = JSON.parse(body)\n newPrice(body)\n })\n } catch(e) {\n console.log(e)\n }\n}", "title": "" }, { "docid": "01a68ea402e3574cdfbfedbd82c743f0", "score": "0.50580794", "text": "function getTickerInfo(symbol, callback) {\n if(tickerstore[symbol] === undefined) {\n if(tickerstorewait[symbol] === undefined)\n {\n tickerstorewait[symbol] = [function() { callback(tickerstore[symbol]); }];\n log(\"Requesting \" + symbol);\n \n MakeReq(\"http://dev.markitondemand.com/Api/v2/Quote/json?symbol=\" + symbol, function(ticker) {\n log(\"Got ticker info for \" + symbol);\n tickerstore[symbol] = ticker;\n tickerstorewait[symbol].forEach(function(callback){ callback(); });\n tickerstorewait[symbol] = null;\n });\n }\n else {\n log(\"Queueing request for \" + symbol);\n tickerstorewait[symbol].push(function() { callback(tickerstore[symbol]); } );\n }\n }\n else {\n log(\"Using cached request for \" + symbol);\n callback(tickerstore[symbol]);\n }\n}", "title": "" }, { "docid": "01596138141a28be3d2a8b997622fa46", "score": "0.50472623", "text": "function currency_trades(__ccxt, __symbol) {\r\n (async() => {\r\n let trades = await __ccxt.fetchTrades(__symbol);\r\n console.log(__symbol);\r\n console.log(trades);\r\n })();\r\n}", "title": "" }, { "docid": "6335df24842bbb0309251f25438a49f0", "score": "0.50360936", "text": "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-30,\"y\":-60,\"w\":60,\"h\":60},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAAHElEQVR42u3BAQEAAACCIP+vbkhA\\nAQAAAAAAfBoZKAABfmfvpAAAAABJRU5ErkJggg==\",\n\t};\n}", "title": "" }, { "docid": "b1b037c6d33bcb76a67a12709b90eea1", "score": "0.503543", "text": "async function getQuote() {\n showLoadingSpinner();\n const proxyUrl = \"https://sheltered-badlands-52292.herokuapp.com/\";\n //\"https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json\";\n const apiUrl = \"https://type.fit/api/quotes\";\n\n try {\n const response = await fetch(proxyUrl + apiUrl);\n\n const apiQuotes = await response.json();\n\n newQuote(apiQuotes);\n\n removerLoadingSpinner();\n } catch (error) {}\n}", "title": "" }, { "docid": "64f6bd7e6c1eead1eec0fb7e0bea332c", "score": "0.50156987", "text": "async function getStonkQuote(ticker) {\n try {\n const fetchedStonkQuote =\n (await get(`${apiUrl}/api/stock/quote/${ticker}`)) || false;\n return setStonkQuote(fetchedStonkQuote);\n } catch (error) {\n console.log(`failed to fetch ${ticker}: ${error.toString()}`);\n resetForm();\n return setStonkQuote(false);\n }\n }", "title": "" }, { "docid": "9b2ddde34ca7643bc960beb45471f2c0", "score": "0.5010707", "text": "async function aV(symbol) {\n try {\n const url = 'https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=';\n const apiKey = process.env.AV_API;\n const uri = url + symbol + '&apikey=' + apiKey;\n\n const quoteData = await axios(uri);\n\n const { '05. price': price } = quoteData.data['Global Quote'];\n\n return price;\n } catch (e) {\n console.log(e);\n }\n\n}", "title": "" }, { "docid": "1716bf6eaa986fce9658ec345f751c57", "score": "0.5008657", "text": "async getDrinkByName (name) {\n // search by Name --> `https://www.thecocktaildb.com/api/json/v1/1/search.php?s=${name}`\n const apiResponse = await fetch(`https://www.thecocktaildb.com/api/json/v1/1/search.php?s=${name}`);\n // return a json apiResponse\n const cocktails = await apiResponse.json();\n //return results as object\n return {\n cocktails\n }\n }", "title": "" }, { "docid": "2d5b09b916ecc067af85d93e2f949ac3", "score": "0.49962807", "text": "async function getUSDFromCoingecko(item){\n let apiUrl = `https://api.coingecko.com/api/v3/simple/token_price/ethereum?contract_addresses=${item}&vs_currencies=usd`\n try {\n return axios.get(apiUrl)\n } catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "5b9a05a4b82c7daab9a95ff5a0bb8421", "score": "0.4964882", "text": "function getAssetData(e) {\r\n\t\tticker = e.innerHTML;\r\n\r\n\t\tfetch(\"http://127.0.0.1:5000/getPrice\", {\r\n\t\t\tmethod: \"POST\",\r\n\t\t\tcredentials: \"include\",\r\n\t\t\tbody: JSON.stringify(ticker),\r\n\t\t\tcache: \"no-cache\",\r\n\t\t\theaders: new Headers({\r\n\t\t\t\t\"content-type\": \"application/json\"\r\n\t\t\t})\r\n\t\t})\r\n\t\t\t.then(response => response.json())\r\n\t\t\t.then(data => {\r\n\r\n\t\t\t\tprice = data[\"price\"];\r\n\t\t\t\tytdChange = data[\"ytdChange\"]\r\n\t\t\t\tcompanyName = data[\"companyName\"]\r\n\r\n\t\t\t\tdocument.getElementById(\"labelTickerSymbol\").innerText = ticker;\r\n\t\t\t\tdocument.getElementById(\"labelCompanyName\").innerText = companyName;\r\n\t\t\t\tdocument.getElementById(\"labelCurrentPrice\").innerText = \"$ \" + price;\r\n\t\t\t\tdocument.getElementById(\"labelYearDate\").innerText = ytdChange + \" %\";\r\n\r\n\t\t\t})\r\n\t}", "title": "" }, { "docid": "b0e67b63f19b2261441cbb70ec7474b2", "score": "0.49417472", "text": "async function getQuote(){\n const apiURL = 'https://type.fit/api/quotes';\n showLoader();\n try{\n const response = await fetch(apiURL);\n //parse as json: \n apiQuotes = await response.json();\n newQuote();\n }catch(err){\n console.log(\"no quote\", err);\n }\n \n}", "title": "" }, { "docid": "ada099cdc2d5df8a3bb3a981b3508d47", "score": "0.49410853", "text": "function get_assets(name, extension)\n\t{\n\t\tlet chunk = json.assetsByChunkName[name]\n\n\t\t// a chunk could be a string or an array, so make sure it is an array\n\t\tif (!(Array.isArray(chunk)))\n\t\t{\n\t\t\tchunk = [chunk]\n\t\t}\n\n\t\treturn chunk\n\t\t\t// filter by extension\n\t\t\t.filter(name => path.extname(name).split('?')[0] === `.${extension}`)\n\t\t\t// adjust the real path (can be http, filesystem)\n\t\t\t.map(name => assets_base_url + name)\n\t}", "title": "" }, { "docid": "653edf3acc6adf8269b587c2b414e31d", "score": "0.49342924", "text": "offerCurrency(offer) {\n let currency = {\n 'icon': true\n };\n\n if (offer.currency && offer.currency.data && offer.currency.data.system) {\n\n let charCode = offer.currency.data.system.char_code.toLowerCase();\n currency = charCode;\n } else {\n //Default\n currency = 'rub';\n }\n\n return currency;\n }", "title": "" }, { "docid": "068c7c05e356c333f8f93c9a1ac6eae1", "score": "0.4924247", "text": "function get_assets(name, extension) {\n\t\tvar chunk = json.assetsByChunkName[name];\n\n\t\t// a chunk could be a string or an array, so make sure it is an array\n\t\tif (!Array.isArray(chunk)) {\n\t\t\tchunk = [chunk];\n\t\t}\n\n\t\treturn chunk\n\t\t// filter by extension\n\t\t.filter(function (name) {\n\t\t\treturn _path2.default.extname(name) === '.' + extension;\n\t\t})\n\t\t// adjust the real path (can be http, filesystem)\n\t\t.map(function (name) {\n\t\t\treturn assets_base_url + name;\n\t\t});\n\t}", "title": "" }, { "docid": "698a937d8255d8b822ee5b8145f37e99", "score": "0.49133813", "text": "function prices_currencies(__ccxt) {\r\n (async() => {\r\n let prices = await __ccxt.fetchTickers();\r\n console.log(prices);\r\n })();\r\n}", "title": "" }, { "docid": "c3fc97029354f0416c0e7eafa442ece0", "score": "0.4908302", "text": "async exchangeRates(parent, args, ctx, info) {\n const baseCurrency = args.baseCurrency // Will be logged in users currency\n const data = await fetch(\n `https://api.exchangeratesapi.io/latest?base=${baseCurrency}`\n ).then(resp => resp.json())\n console.log(\"exchange data \", data)\n return data\n }", "title": "" }, { "docid": "c771a635d2f99dc84a8f08745d3e5892", "score": "0.490747", "text": "async markets() {\n if (this.data.markets != null) {\n return this.data.markets;\n }\n await this.fetch_tickers();\n this.data.markets = [];\n var raw_markets = await this.ccxt('fetch_markets');\n raw_markets\n .filter(raw_market => raw_market.active == true && ['spot', 'future'].includes(raw_market.type))\n .forEach(raw_market => {\n const id = raw_market.id;\n const symbol = raw_market.symbol;\n const tvsymbol = 'DERIBIT:' + raw_market.symbol.replace('-','').replace('PERPETUAL', 'PERP')\n const type = raw_market.type;\n if (type != undefined) {\n const base = raw_market.base;\n const quote = raw_market.quote;\n var ticker = this.data.tickers.hasOwnProperty(symbol) ? this.data.tickers[symbol] : null;\n const bid = ticker != null ? ticker.bid : null;\n const ask = ticker != null ? ticker.ask : null;\n const expiration = (raw_market.info.expiration_timestamp != null ? raw_market.info.expiration_timestamp : null);\n const contract_size = (raw_market.info.contract_size != null ? (symbol == 'BTC-PERPETUAL' ? 1 : raw_market.info.contract_size) : 1);\n const precision = raw_market.precision;\n const raw = raw_market.info;\n const market = new this.classes.market(id, symbol, type, base, quote, bid, ask, expiration, contract_size, precision, tvsymbol, raw)\n this.data.markets.push(market);\n }\n });\n await this.index_markets();\n await this.update_markets_usd_price();\n return this.data.markets;\n }", "title": "" }, { "docid": "99511a642764925aa5030e01c227098e", "score": "0.49043685", "text": "async getAsset(ctx, key) {\n\t\tlet assetBuffer = await ctx.stub\n\t\t\t.getState(key)\n\t\t\t.catch(err => console.log(err));\n\n\t\tif (assetBuffer.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet assetObject = JSON.parse(assetBuffer.toString());\n\n\t\treturn assetObject;\n\t}", "title": "" }, { "docid": "a4408b069c30e9a54856abcbfc4884f4", "score": "0.4896631", "text": "function getQuote() {\n fetch('https://animechan.vercel.app/api/random') /*https://animechan.vercel.app */\n .then(response => response.json())\n .then(data => {\n animeQuotes.innerHTML = `${data.character} from ${data.anime}, once said: ${data.quote}`\n });\n}", "title": "" }, { "docid": "86bde5a92c5061712d1fd99b4e440040", "score": "0.48921368", "text": "async function market_price() {\n try {\n if (exchange.has['fetchTickers']) {\n log.bright.yellow(\"================ Market Price of ======================\");\n console.log(await (exchange.fetchTickers (symbols)))\n }\n else {\n console.log(exchange.id + ' does not have ' + symbols)\n }\n\n } catch (e) {\n\n if (e instanceof ccxt.DDoSProtection) {\n log.bright.yellow (exchange.id, '[DDoS Protection] ' + e.message)\n } else if (e instanceof ccxt.RequestTimeout) {\n log.bright.yellow (exchange.id, '[Request Timeout] ' + e.message)\n } else if (e instanceof ccxt.AuthenticationError) {\n log.bright.yellow (exchange.id, '[Authentication Error] ' + e.message)\n } else if (e instanceof ccxt.ExchangeNotAvailable) {\n log.bright.yellow (exchange.id, '[Exchange Not Available] ' + e.message)\n } else if (e instanceof ccxt.ExchangeError) {\n log.bright.yellow (exchange.id, '[Exchange Error] ' + e.message)\n } else if (e instanceof ccxt.NetworkError) {\n log.bright.yellow (exchange.id, '[Network Error] ' + e.message)\n } else {\n throw e\n }\n }\n}", "title": "" }, { "docid": "d54fd56ee64065b427c286f90a472742", "score": "0.48854694", "text": "getStock({Elements}){\n\t\treturn Elements[1].DataSeries.volume.values;\n\t}", "title": "" }, { "docid": "dd8f8bb2e8ca9462bac8c2b38e8c9d62", "score": "0.4881817", "text": "async function getPriceMex(coin1, err, chn){\n \n let s = '';\n let c = '';\n let coin2 = 'btc';\n let tickerJSON = '';\n let today = new Date();\n let dd = String(today.getDate()).padStart(2, '0');\n let mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!\n let yy = today.getFullYear() - 2000;\n let m = '';\n let done = false;\n //console.log(mm + \"::\" + dd + \":::\" + yy);\n \n // Figure out current contract code\n if ((mm <= 12 && (mm >= 1 && mm <= 3)) && !done) {if((mm === 3 && dd >= 28)){m = 'M'; done=true;} else{m = 'H'; done=true;}}\n if (mm >= 3 && mm <= 6 && !done) {if((mm === 6 && dd >= 28)){m = 'U'; done=true;} else{m = 'M'; done=true;}}\n if (mm >= 6 && mm <= 9 && !done) {if((mm === 9 && dd >= 28)){m = 'Z'; done=true;} else{m = 'U'; done=true;}}\n if (mm >= 9 && mm <= 12 && !done) {if((mm === 12 && dd >= 28)){m = 'H';} else{m = 'Z';}}\n let contractCode = m + yy;\n //console.log(chalk.blue(contractCode));\n \n // This implementation changes as the BitMEX contract period code changes every 3 months\n switch(coin1.toUpperCase()) {\n case 'BTC':\n tickerJSON = await bitmex.fetchTicker('BTC/USD');\n coin2 = 'usd';\n break;\n case 'ETH':\n tickerJSON = await bitmex.fetchTicker('ETH/USD');\n coin2 = 'usd';\n break;\n case 'BCH':\n tickerJSON = await bitmex.fetchTicker('BCH' + contractCode);\n break;\n case 'EOS':\n tickerJSON = await bitmex.fetchTicker('EOS' + contractCode);\n break;\n case 'ADA':\n tickerJSON = await bitmex.fetchTicker('ADA' + contractCode);\n break;\n case 'LTC':\n tickerJSON = await bitmex.fetchTicker('LTC' + contractCode);\n break;\n case 'TRX':\n tickerJSON = await bitmex.fetchTicker('TRX' + contractCode);\n break\n case 'XRP':\n tickerJSON = await bitmex.fetchTicker('XRP' + contractCode);\n break\n default:\n chn.send('BitMEX Error: `Ticker \"' + err.toUpperCase() + '\" not found.`');\n return;\n } \n \n s = tickerJSON['last'];\n console.log (chalk.green('BitMEX REST API ticker response: '+ chalk.cyan(s)));\n c = tickerJSON['percentage'];\n c = Math.round(c * 100) / 100;\n\n let ans = '__BitMEX__ Price for **' + coin1.toUpperCase() + '-' + coin2.toUpperCase() + '** is: `' + s + ' ' + coin2.toUpperCase() + '` ' + '(' + '`' + c + '%' + '`' + ')' + '.';\n chn.send(ans);\n}", "title": "" }, { "docid": "85d61a292aa9f8b9c12a7c02db35bb69", "score": "0.48741508", "text": "function getGBPRate(callback) {\n var currencyUrl = \"http://data.fixer.io/api/latest?access_key=cb0d0d21a8e9759bc7fc3a91f446fe7f&?base=USD\";\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4 && xhr.status === 200) {\n newRate = JSON.parse(xhr.responseText).rates.GBP;\n callback(newRate);\n }\n };\n xhr.open(\"GET\", currencyUrl, true);\n xhr.send(null);\n }", "title": "" }, { "docid": "270149ee3c5d8b57a40cdbc920e9f510", "score": "0.4872265", "text": "function getMarket(markets){\n let i = parseInt(Math.random() * markets.length)\n return markets[i]\n}", "title": "" }, { "docid": "82d09b7a3d11c08254b45909c93546bd", "score": "0.48699552", "text": "async function getQuotes() {\n const apiUrl = \"https://type.fit/api/quotes\";\n // const apiUrl = \"https://goquotes-api.herokuapp.com/api/v1/all/quotes\";\n let response = await fetch(apiUrl);\n apiQuotes = await response.json();\n // console.log(apiQuotes);\n // console.log(typeof apiQuotes);\n // console.log(apiQuotes.quotes);\n // console.log(apiQuotes.quotes[200].text);\n newQuote();\n}", "title": "" }, { "docid": "c8a9a2522ddf437384566c00fa1d1f4f", "score": "0.48691273", "text": "function get_assets(name) {\n\t\tvar extension = arguments.length <= 1 || arguments[1] === undefined ? 'js' : arguments[1];\n\n\t\tvar chunk = json.assetsByChunkName[name];\n\n\t\t// a chunk could be a string or an array, so make sure it is an array\n\t\tif (!Array.isArray(chunk)) {\n\t\t\tchunk = [chunk];\n\t\t}\n\n\t\treturn chunk\n\t\t// filter by extension\n\t\t.filter(function (name) {\n\t\t\treturn _path2['default'].extname(name) === '.' + extension;\n\t\t})\n\t\t// adjust the real path (can be http, filesystem)\n\t\t.map(function (name) {\n\t\t\treturn options.assets_base_url + name;\n\t\t});\n\t}", "title": "" }, { "docid": "4cae9cac0bfa77d93a44339036ad07ef", "score": "0.48572484", "text": "function getMarketStockDescriptions(){\n try {\n var data_url = '';\n \n // d is a dictionary used for create the api url\n var d = {\n 'url_base': 'https://api.tradingeconomics.com/markets/stockdescriptions',\n 'symbol': '',\n 'country': '',\n 'key': `?c=${apikey}`,\n 'output_type' : ''\n }\n \n // if (country != null && symbol == null){\n // //the 'key' value has to be changed due to url enpoint use of '?' or '&' characters. \n // d.key = `&c=${apikey}`;\n // d.country = `/companies?country=${country}`;\n // }\n // if (symbol != null && country == null) {\n // d.country = '';\n // d.symbol = `/symbol/${symbol}`;\n // }\n \n if (country){\n \n d.country = `/country/${country}`;\n }\n if (symbol) {\n \n d.symbol = `/symbol/${symbol}`;\n }\n \n if (symbol == null && country == null || symbol != null && country != null){\n console.log('you have to enter symbol or country')\n return \n }\n \n data_url = `${d.url_base}${d.symbol}${d.country}${d.key}`.replace (' ', '%20'); \n \n return func.makeTheRequest(data_url)\n \n // return fetch(data_url)\n // .then(func.handleErrors) \n // .then(function(response) { \n // return response.json(); // process it inside the `then` when calling the function \n // }).catch(function (err) {\n // return err.message;\n // });\n } catch (error) {\n throw error\n }\n \n}", "title": "" }, { "docid": "1c7a6040cf8d647ed6c7031e4800ddfb", "score": "0.4857118", "text": "function getDataIntraday(companySymbol) {\n fetch(`https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=${companySymbol}&interval=30min&apikey=${apiKey}`)\n .then(res => res.json())\n .then(data => {\n console.log(data);\n var allNumbers = data['Time Series (30min)'];\n var metaData = data['Meta Data']['2. Symbol'];\n getNumbers(allNumbers, metaData)})\n}", "title": "" }, { "docid": "bd39b5980c1373d4f8d61fb95d828098", "score": "0.4851844", "text": "function composeUri(symbol, start_date) {\n return BARCHART_HOST + \"/getHistory.json?key=\" + BARCHART_API_KEY + \"&type=daily&symbol=\" + symbol\n + \"&startDate=\" + start_date;\n}", "title": "" }, { "docid": "12ed4940b037dc05f479a7172ad5d77e", "score": "0.48494896", "text": "async function fetchQuoteAndJoke() {\n const quoteResponse = await axios.get(\n \"https://ron-swanson-quotes.herokuapp.com/v2/quotes\"\n );\n const jokeResponse = await axios.get(\"https://icanhazdadjoke.com\", {\n headers: { Accept: \"text/plain\" }\n });\n return {\n quote: quoteResponse.data[0],\n joke: jokeResponse.data\n };\n}", "title": "" }, { "docid": "8a0ef540ae9d8230d9e93f78d5933400", "score": "0.48442754", "text": "function getQuote() {\n ticker = $(\".get-quote input\").val();\n if (ticker !== \"\") {\n // fetch quote\n let url = `https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(\"${ticker}\")&format=json&env=store://datatables.org/alltableswithkeys&callback=`;\n let $quote = $(\"<p>\");\n\n $.getJSON(url, function (data) {\n if (data.query.results.quote.Ask !== null) {\n quote = data.query.results.quote.Ask;\n $quote.html(`Current price of ${ticker}: ${quote}`);\n }\n else {\n alert(`${ticker} ticker symbol not found`);\n }\n });\n\n // render quote\n $(\".render-quote\").empty().append($quote);\n\n // render chart\n // $(\".chart\").append(\"<div>\", new TradingView.widget({\n // \"width\": 500,\n // \"height\": 300,\n // \"symbol\": ticker,\n // \"interval\": \"D\",\n // \"timezone\": \"Etc/UTC\",\n // \"theme\": \"Light\",\n // \"style\": \"1\",\n // \"locale\": \"en\",\n // \"toolbar_bg\": \"#f1f3f6\",\n // \"enable_publishing\": false,\n // \"allow_symbol_change\": true,\n // \"hideideas\": true\n // }));\n\n } else {\n alert(\"Please enter ticker symbol\");\n }\n }", "title": "" }, { "docid": "7f183e1c19f89ef947037ddf3b2a09d1", "score": "0.48341307", "text": "async getCurrencyAPI() {\n const url = `https://min-api.cryptocompare.com/data/all/coinlist?api_key=${this.apikey}`;\n\n // Fetch al API\n const getCurrencyURL = await fetch(url);\n\n // Respuesta en JSON\n const currency = await getCurrencyURL.json();\n\n return {\n currency\n }\n }", "title": "" }, { "docid": "f83e96cd7347b7426d3a6b898ab6bd77", "score": "0.48216152", "text": "async function fetchHistorical(symbol, apiKey) {\n return easyGet(\n CRYPTOCOMPARE_MIN_ADDRESS +\n 'v2/histoday?fsym=' +\n symbol +\n '&tsym=' +\n 'USD' +\n '&limit=365' +\n '&api_key=' +\n apiKey\n );\n}", "title": "" }, { "docid": "a83f69d0e84805c4d86a20edc208225e", "score": "0.48168233", "text": "function getQuote(symbol=null) {\n if (!symbol) { symbol = self.searchText; }\n $log.info('GET QUOTE executes: ' + symbol);\n $log.info(self.progressShow);\n // TODO: clean-up previous display\n cleanup();\n self.favDetToggle = true;\n self.favStored = false;\n self.detailDisabled = false;\n $http.get(\"stockQuote.php?symbol=\" + symbol)\n .then(function(response) {\n // originally unblock detail here \n dismissProgress('infotab');\n dismissProgress('Price');\n \n setInfoTable(response.data);\n $window.stockPlotOjbect = response.data;\n var key = $window.stockPlotOjbect['Stock Ticker'].toUpperCase();\n if ($window.localStorage.getItem(key) !== null) {\n addFavorite();\n }\n self.favStored = $window.localStorage.getItem(key) !== null;\n $window.plotStockPrice();\n },\n function(response) {\n // error callback\n $log.info('error call-back!');\n showAlert('infotab');\n showAlert('Price');\n // self.detailDisabled = true; // \n $window.stockPlotOjbect = null;\n });\n }", "title": "" }, { "docid": "a19b07538f62d573fc624275b6330a23", "score": "0.48072797", "text": "function getTradeHubName(stationName) {\r\n if (stationName == \"Jita IV - Moon 4 - Caldari Navy Assembly Plant\") {\r\n return \"Jita\";\r\n } else if (stationName == \"Amarr VIII (Oris) - Emperor Family Academy\") {\r\n return \"Amarr\";\r\n } else if (stationName == \"Rens VI - Moon 8 - Brutor Tribe Treasury\") {\r\n return \"Rens\";\r\n } else if (stationName == \"Dodixie IX - Moon 20 - Federation Navy Assembly Plant\") {\r\n return \"Dodixie\";\r\n } else if (stationName == \"Hek VIII - Moon 12 - Boundless Creation Factory\") {\r\n return \"Hek\";\r\n }\r\n\r\n return stationName;\r\n}", "title": "" }, { "docid": "76247721d05a41804dd0eaed867a844d", "score": "0.4804833", "text": "function currency_orderbook(__ccxt, __symbol) {\r\n (async() => {\r\n let orderbook = await __ccxt.fetchOrderBook(__symbol);\r\n console.log(__symbol);\r\n console.log(orderbook);\r\n })();\r\n}", "title": "" }, { "docid": "882f68c51f426c8585fb991cfe7b35dc", "score": "0.4798398", "text": "fetchTickers(callback){\n const options = {\n url: this.baseURL3 + '/order/getTickerWithVolume',\n method: 'GET'\n }\n\n request(options, function(error, res, body) {\n if(!error){\n try{\n return callback(\"\", JSON.parse(body));\n }catch(err){\n return callback(\"Parsing error : fetchTickers\", \"\");\n }\n }else{\n return callback(\"Error in fetching tickers\");\n }\n });\n }", "title": "" }, { "docid": "8314a26bc796f1afa657bfc33cf9501b", "score": "0.4795989", "text": "function get_stickers(cb) {\n var name;\n\n name = \"sticker\" + 0 + \".png\";\n fetch('/get_stickers?name=' + name)\n .then(res => res.json())\n .then(url => url.stickerBase64)\n .then(sticker => {\n cb(sticker);\n })\n\n name = \"sticker\" + 1 + \".png\";\n fetch('/get_stickers?name=' + name)\n .then(res => res.json())\n .then(url => url.stickerBase64)\n .then(sticker => {\n cb(sticker);\n })\n\n name = \"sticker\" + 2 + \".png\";\n fetch('/get_stickers?name=' + name)\n .then(res => res.json())\n .then(url => url.stickerBase64)\n .then(sticker => {\n cb(sticker);\n })\n}", "title": "" }, { "docid": "0d2440b6260a8de8511dac9ee032e2ed", "score": "0.4787429", "text": "function fetchCoinData() {\n return axios.get(`${apiBaseUrl}/v1/ticker/?limit=${10}`);\n}", "title": "" }, { "docid": "e10ef661f2eb28d5f0aba7d7c33f0a60", "score": "0.4781546", "text": "function assetNameToURL(name) {\r\n switch(name) {\r\n case \"Spooky\":\r\n return browser.extension.getURL(\"assets/skull-trumpet.png\");\r\n case \"Spookier\":\r\n return browser.extension.getURL(\"assets/skeleton-angry.jpg\");\r\n case \"Spookiest\":\r\n return broswer.extension.getURL(\"assets/spookybois.jpg\")\r\n }\r\n }", "title": "" }, { "docid": "3ef670c031c0dee952abe53fa899e2b3", "score": "0.47811157", "text": "function getRate(sellSymbol, buySymbol){\n return $http.get('http://api.fixer.io/latest?base='+sellSymbol+'&symbols='+buySymbol)\n .then(getRateComplete)\n .catch(getRateFailed);\n\n function getRateComplete(response) {\n return response.data;\n }\n\n function getRateFailed(error) {\n console.log('Error ' + error.data);\n }\n }", "title": "" }, { "docid": "fdfe864666f482579863e770b494a36f", "score": "0.47809368", "text": "componentDidMount() {\n API.getTickerText().then(((r) => {\n if (r.data.length !== 0) {\n let ticker = 'Watchlist...';\n let tempTicker = [];\n for (let i=0; i<r.data.length; i++) {\n // API.findQuotes(r.data[i]).then(((r2) => {\n // console.log(r2);\n // }));\n ticker += r.data[i].uniqueStockSymbol + '...';\n tempTicker.push((r.data[i]).uniqueStockSymbol);\n }\n this.setState({tickerText: ticker});\n this.setState({tickerForApi: tempTicker});\n // console.log(r.data);\n // console.log(tempTicker);\n };\n }));\n }", "title": "" }, { "docid": "9e278ae175a32951c1a5756cd0b6dde3", "score": "0.47782856", "text": "async handleCoinValues(coinSearched){\n const response = await fetch(`https://api.coinmarketcap.com/v1/ticker/`); //crypto.compare api \n if(response.status === 200){\n let data = await response.json();\n //find the currency we searched for\n const currency = data.find((coin) => coin.symbol === coinSearched.toUpperCase() || coin.id === coinSearched.toLowerCase());\n return currency;\n } else {\n throw new Error('unable to fetch coin info');\n }\n }", "title": "" }, { "docid": "46f11c4ba667fa367bdd156a2e984069", "score": "0.4775531", "text": "uploadedExpenseExtractor(item) {\n\n let currency = item.expense.currency;\n if (!item.expense.currency || item.expense.currency === 'EUR') currency = '€';\n else if (item.expense.currency === 'DKK') currency = 'kr.'\n\n let tick = require('../img/tick.svg');\n\n return {\n avatar: {\n type: 'image',\n value: item.status === 'OK' ? tick : null,\n size: 'l'\n },\n date: {date: item.expense.date},\n title: item.expense.description,\n amount: currency + ' ' + item.expense.amount.toLocaleString('it'),\n }\n\n }", "title": "" }, { "docid": "8daeb667a8151bec5766690faaa13e57", "score": "0.47732595", "text": "async function getQuotes(){\n const apiurl= 'https://type.fit/api/quotes';\n try{\n const respons = await fetch(apiurl);\n apiQuotes = await respons.json();\n newQuote();\n }catch(error){\n // catch error \n }\n}", "title": "" }, { "docid": "f1437f2cb5c39926cc1549fc21c1ad02", "score": "0.47717935", "text": "function getQuote() {\n axios.get('https://thesimpsonsquoteapi.glitch.me/quotes').then(function(res) {\n console.log(res.data);\n let quoteAuthor = res.data[0].character;\n quote.innerText = res.data[0].quote;\n author.innerText = `- ${quoteAuthor}`\n })\n}", "title": "" }, { "docid": "97e05d2adade1ddab1570fc080f0fbbb", "score": "0.47709215", "text": "function getStockData() {\n\n const StockSearch = stockSymbolSearch;\n // const API_KEY = \"EFHRQZLWSBDE89TC\";\n // const url = `https://www.alphavantage.co/query?function=OVERVIEW&symbol=${StockSearch}&apikey=${API_KEY}`;\n // only works when StockSearch = \"IBM\";\n const url = `https://www.alphavantage.co/query?function=OVERVIEW&symbol=${StockSearch}&apikey=demo`;\n\n axios.get(`${url}`)\n .then((response) => {\n console.log(response);\n const apiStockData = response.data;\n\n //add info to update the state\n setStockMarketData(apiStockData);\n\n })\n .catch(error => console.error(`Error: ${error}`));\n }", "title": "" }, { "docid": "c435b1151393aba8692fc28725cdfdd1", "score": "0.4770252", "text": "function getAssetTransaction(params) {\n return new Promise((resolve, reject) => {\n var response;\n var assetName = params.asset;\n var transactionId = params.txid;\n multichain.getAssetTransaction({\n \"asset\": assetName,\n \"txid\": transactionId,\n \"verbose\": false\n },\n (err, res) => {\n\n if (err == null) {\n return resolve({\n response: res,\n message: \"Assets transactions returned...!\"\n });\n } else {\n\n return reject({\n status: 500,\n message: err.message\n });\n }\n }\n )\n\n })\n}", "title": "" }, { "docid": "381248000deb7f325d046286b43e5aa5", "score": "0.47699866", "text": "getQuoteData(){\n var request = 'https://mediasignal-quotes.herokuapp.com/quotes';\n data_request(request, this);\n }", "title": "" }, { "docid": "c7c8dc1164fbf472e6e467846d79387d", "score": "0.4768145", "text": "function callApi (finishedApi, stock_ticker) {\n request('https://cloud.iexapis.com/stable/stock/'+stock_ticker+'/quote?token=pk_1e073f092d094f109d2aa9c6299eaaa2', { json: true }, (err, res, body) => {\n if (err) return console.log(err);\n if (res.statusCode === 200) {\n finishedApi(body);\n }\n});\n}", "title": "" }, { "docid": "dfa150efca8bd622dc2cb044a1a5078d", "score": "0.47668585", "text": "function getExchangeRate(from){\n return axios\n .get(`https://api.exchangeratesapi.io/latest?base=${from}`)\n .then(response => response.data.rates[\"SEK\"])\n .catch(error => console.log(error));\n}", "title": "" }, { "docid": "a403b19dc42ce342535eb48917ae978f", "score": "0.4763733", "text": "async getBalance(asset = 'BTC') {\n\t\tif (settings.trade.simulated_trading) {\n\t\t\tswitch (asset) {\n\t\t\t\tcase 'BTC' :\n\t\t\t\t\tif (settings.trade.simulated_balance.bittrex.btc > 0) {\n\t\t\t\t\t\treturn settings.trade.simulated_balance.bittrex.btc; // it'll get promisified\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ETH' :\n\t\t\t\t\tif (settings.trade.simulated_balance.eth > 0) {\n\t\t\t\t\t\treturn settings.trade.simulated_balance.eth; // it'll get promisified\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'USDT' :\n\t\t\t\t\tif (settings.trade.simulated_balance.usdt > 0) {\n\t\t\t\t\t\treturn settings.trade.simulated_balance.usdt; // it'll get promisified\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tbittrexApi.getbalance({ currency: asset }, function (data, err) {\n\t\t\t\tif (err) {\n\t\t\t\t\treject(err);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(data.result.Available || 0);\n\t\t\t\t}\n\t\t\t})\n\t\t});\n\n\t}", "title": "" }, { "docid": "e5a15bdef751729b82c252fb10dec7d9", "score": "0.47637275", "text": "function getQuote() { \n var queryUrl = \"https://quotes.rest/qod/\"\n $.ajax({\n url: queryUrl,\n method: \"GET\"\n }).done(function(data) {\n var quote = data.contents.quotes[0].quote;\n var author = data.contents.quotes[0].author\n $(\"#healthFact\").append(quote);\n $(\"#quoteAuthor\").append(author);\n });\n }", "title": "" }, { "docid": "a33ed25f65670941f66dd174a762bc8e", "score": "0.47576126", "text": "function getAsset(axios, token, format) {\n var query = randomSeedQuery();\n if (format) {\n query += addFilter(format.includeAssetType, \"includeAssetType\");\n }\n return restAuthGet(axios, \"assets/\" + token + query);\n}", "title": "" }, { "docid": "6de8ec6c7ea762db73d62893ee149a39", "score": "0.47547892", "text": "getETHPrices (date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=ETH&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "df99d92c4daca5c48f2325b4e5451051", "score": "0.47546408", "text": "function getFormatTarif(format) {\n for (let i = 0, len = price.length; i < len; i++) {\n if (price[i].name === format) {\n return price[i];\n }\n }\n}", "title": "" }, { "docid": "de48c9300fc1136eff95de8668f44940", "score": "0.47490048", "text": "function fetchStockQuote(symbol, isInitMsg) {\n var req = new XMLHttpRequest();\n \n // build the GET request\n req.open('GET', 'http://dev.markitondemand.com/Api/Quote/json?symbol=' + symbol, true);\n req.onload = function(e) {\n if (req.readyState == 4) {\n // 200 - HTTP OK\n if(req.status == 200) {\n console.log(req.responseText);\n \n var response = JSON.parse(req.responseText);\n if (response['Message']) {\n // the markitondemand API sends a response with a Message\n // field when the symbol is not found\n Pebble.sendAppMessage({ 'QuoteKeyPrice': 'Not Found' });\n }\n if (response['Data']) {\n // data found, look for LastPrice\n var price = response['Data']['LastPrice'];\n console.log('Price is ' + price);\n\n Pebble.sendAppMessage({\n 'QuoteKeyInit': true,\n 'QuoteKeySymbol': symbol,\n 'QuoteKeyPrice': '$' + price.toString()\n }, function(e) {\n console.log('sent');\n }, function() {\n console.log('failed');\n });\n }\n } else {\n console.log('Request returned error code ' + req.status.toString());\n }\n }\n };\n req.send(null);\n}", "title": "" }, { "docid": "99ea30bf8279daecc3b68d1ca4dd43fc", "score": "0.47486082", "text": "function pDownloadTickerSymbolData(symbol, options) {\n var options = _.defaults({}, options, options, {\n start: 0,\n end: Math.floor(Date.now() / 1000),\n });\n\n return request(\n 'https://finance-yql.media.yahoo.com/v7/finance/chart/' + symbol +\n '?period2=' + options.end +\n '&period1=' + options.start +\n '&interval=1d' +\n '&indicators=quote' +\n '&includeTimestamps=true' +\n '&includePrePost=true' +\n '&corsDomain=finance.yahoo.com'\n )\n .then(JSON.parse)\n .then(function(obj) {\n return obj.chart.result[0];\n });\n}", "title": "" }, { "docid": "3ca5bfe2584c4248863097d378316a5e", "score": "0.4748212", "text": "function getHistoricPrices3([[[index]]]) {\n const bingo = index; // CHANGE ME\n return bingo;\n }", "title": "" }, { "docid": "74a6421c6e2d9c328881b9ad060883b0", "score": "0.47425133", "text": "get bucket() { return \"nextstrain-inrb\"; }", "title": "" }, { "docid": "56d0779a8f9ea2265e9c4bdfa394f1ed", "score": "0.47416478", "text": "fetchData() {\n let symbolList = [\n 'AAPL', \n 'TSLA', \n 'AMZN', \n 'GOOGL', \n 'AMD',\n 'BABA',\n 'FB',\n 'GM',\n 'UBER',\n 'HCA',\n 'DIS',\n 'SBUX',\n 'UNH',\n 'CAT'\n ];\n\n // I truly did not want to call the api for each symbol, however I was having a ton\n // of trouble finding the endpoint where I could send in multiple symbols in 1 call :(\n symbolList.forEach(symbol => {\n fetch(`/v1/bars/day?symbols=${symbol}&limit=1`, {\n method: \"GET\",\n headers: {\n \"APCA-API-KEY-ID\": process.env.REACT_APP_APCA_API_KEY_ID,\n \"APCA-API-SECRET-KEY\": process.env.REACT_APP_APCA_API_SECRET_KEY\n }\n })\n .then(response => {\n return response.json();\n })\n .then(parsedJSON => {\n let date = new Date().toLocaleTimeString();\n this.setState({tickerAssets: this.state.tickerAssets.concat({\n tickerSymbol: symbol,\n currentPrice: Math.floor(parsedJSON[symbol][0].c),\n highPrice: Math.floor(parsedJSON[symbol][0].h),\n lowPrice: Math.floor(parsedJSON[symbol][0].l),\n currentDate: date\n })})\n return this.state.tickerAssets;\n })\n .then(assets => {\n // honestly a super hacky way to get the initial view to be 'Gainers' on the filter\n // not proud of this one nor is it perfect since assets can load after the fact...\n return assets.sort((a, b) => {\n return b.currentPrice - a.currentPrice;\n })\n })\n .catch(error => { \n console.error('fetching API data failed: ', error);\n this.setState({error: true});\n });\n })\n }", "title": "" }, { "docid": "6cf4420bfe1341521e5b9f8cad473a17", "score": "0.47284973", "text": "function basePrice() {\n return currency( $(\".woocommerce-Price-amount:eq(1)\").first().text().slice(1) );\n }", "title": "" }, { "docid": "5d17337f4a671eab99cb77cf2ca3eaea", "score": "0.4723063", "text": "static get tagName() {\n return 'mbt-brix-converter';\n }", "title": "" }, { "docid": "42c7ca028aecaaff1a2a30fd82ba765b", "score": "0.47228956", "text": "function getCurrentStockAPIData(query) {\n const robinhoodURL = 'https://api.robinhood.com/quotes/?symbols='\n $.getJSON(robinhoodURL + query , (data) => {\n $('.stock-data').text(query + ': $' + round(data.results[0].bid_price, 2).toFixed(2));\n stockBidPrice = data.results[0].bid_price;\n stockAskPrice = data.results[0].ask_price;\n stockSymbol = data.results[0].symbol;\n })\n .error(() => {\n $('.portfolio-data').prepend('<div class=\"alert alert-danger\">' + '<strong>Error!</strong> That stock ticker does not exist!' + '</div>');\n setTimeout( () => {\n $('.alert').remove();\n }, 2000)\n });\n }", "title": "" }, { "docid": "962fe2f57aa6316bebb11e60e66892d3", "score": "0.47195047", "text": "async function get_commodities_quote() {\n return await get_quote(['/ES', '/CL', '/GC']);\n}", "title": "" }, { "docid": "5d0d3c8b387f43af738d904b051e8d06", "score": "0.47190574", "text": "function getApiData() {\n let apiArr = [];\n \n tickers.forEach(ticker => apiArr.push(fetch(`https://repeated-alpaca.glitch.me/v1/stock/${ticker}/quote`)\n .then(data => data.json())\n .catch(err => console.log(err))\n ));\n \n return Promise.all(apiArr).catch(err => console.log(err));\n }", "title": "" }, { "docid": "a414f94d3484914292eff86cc1c8d1c7", "score": "0.471561", "text": "async function getSymbologyByTicker(targetTicker) {\n try {\n const data = await te.getSymbology((ticker = targetTicker))\n console.log('Stock symbology:', '\\n', data)\n } catch (error) {\n console.log(error)\n }\n}", "title": "" }, { "docid": "0dc3ab96ef1d3ea59d3d7e18ea9160d3", "score": "0.47128394", "text": "function getStockName(symbol){\n\t\n\tindex = stocks.symbols.indexOf(symbol.toUpperCase());\n\t\n\tif(index>-1)\n\t\treturn stocks.names[index];\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "b0634f787b05d72b6f4addf4a3a1e5ad", "score": "0.47124162", "text": "function getMarketCapSpecific(message){\n let cursor = 1;\n //collect the data\n let cur = '';\n if(message.content.includes('.tb')){\n cur = message.content.replace('.tb ', '').split(\" \")[1].toUpperCase();\n }\n else{\n cur = message.content.replace('-t ', '').split(\" \")[1].toUpperCase();\n }\n if(cur === 'HAMMER'){message.channel.send('https://youtu.be/otCpCn0l4Wo?t=14'); return;}\n (async () => {\n console.log(chalk.yellow(message.author.username) + chalk.green(\" requested MC of: \" + chalk.cyan(cur)));\n let ticker = cmcArrayDictParsed;\n j = ticker.length;\n for (let i = 0; i < j; i++) {\n if (ticker[i][\"symbol\"] === cur || ticker[i][\"name\"].toUpperCase() === cur || ticker[i][\"cmc_rank\"]+'' === cur) {\n let name = ticker[i][\"name\"];\n let slug = ticker[i][\"slug\"];\n let price = parseFloat(ticker[i][\"quote\"][\"USD\"][\"price\"]).toFixed(6);\n let priceBTC = convertToBTCPrice(price).toFixed(8);\n let percent = ticker[i][\"quote\"][\"USD\"][\"percent_change_24h\"];\n let rank = ticker[i][\"cmc_rank\"];\n let percent7 = ticker[i][\"quote\"][\"USD\"][\"percent_change_7d\"];\n let symbol = ticker[i][\"symbol\"];\n let volume = ticker[i][\"quote\"][\"USD\"][\"volume_24h\"];\n let marketcap = parseInt(ticker[i][\"quote\"][\"USD\"][\"market_cap\"]);\n let supply = parseInt(ticker[i][\"circulating_supply\"]);\n let totalSupply = ticker[i][\"total_supply\"];\n let maxSupply = ticker[i][\"max_supply\"];\n let percent1h = ticker[i][\"quote\"][\"USD\"][\"percent_change_1h\"];\n \n //check for missing data and process values\n if(!supply){supply = \"n/a\";} else{supply = numberWithCommas(supply);}\n if(!totalSupply){totalSupply = \"n/a\";} else{totalSupply = numberWithCommas(parseFloat(totalSupply).toFixed(0));}\n if(!maxSupply){maxSupply = \"n/a\";} else{maxSupply = numberWithCommas(parseFloat(maxSupply).toFixed(0));}\n if(!volume){volume = \"n/a\";} else{volume = numberWithCommas(parseFloat(volume).toFixed(2));}\n if(!percent1h){percent = \"n/a\";} else{percent1h = parseFloat(percent1h).toFixed(2);}\n if(!percent){percent = \"n/a\";} else{percent = parseFloat(percent).toFixed(2);}\n if(!percent7){percent7 = \"n/a\";} else{percent7 = parseFloat(percent7).toFixed(2);}\n \n //verbose logging toggle\n const verbose = false;\n if(verbose){\n console.log(chalk.green(\"Rank: \") + chalk.cyan(rank));\n console.log(chalk.green(\"Name: \" + chalk.cyan(name)));\n console.log(chalk.green(\"Price: \" + chalk.cyan(price)));\n console.log(chalk.green(\"24hr Change: \") + chalk.cyan(percent));\n console.log(chalk.green(\"7d Change: \") + chalk.cyan(percent7));\n }\n\n let logo = 'https://is3-ssl.mzstatic.com/image/thumb/Purple118/v4/8e/5b/b4/8e5bb4b3-c3a4-2ce0-a48c-d6b614eda574/AppIcon-1x_' +\n 'U007emarketing-0-0-GLES2_U002c0-512MB-sRGB-0-0-0-85-220-0-0-0-6.png/246x0w.jpg';\n for (let j = 0, len = metadata.data.length; j < len; j++) {\n if(metadata.data[j].slug === slug) {\n if (metadata.data[j].logo) {\n logo = metadata.data[j].logo;\n }\n }\n }\n \n let l1 = \"MC Rank: #\" + rank + \"\\n\";\n let l2 = \"Market Cap: \" + numberWithCommas(marketcap) + \" USD\" + \"\\n\";\n let l3 = \"24hr Volume: \" + volume + \" USD\" + \"\\n\";\n let l4 = \"Circulating Supply: \" + supply + \" \" + symbol + \"\\n\";\n let l5 = \"Total Supply: \" + totalSupply + \" \" + symbol + \"\\n\";\n let l6 = '';\n if(maxSupply === 'n/a'){\n l6 = \"Maximum Supply: \" + maxSupply + \"\\n\";\n } else{\n l6 = \"Maximum Supply: \" + maxSupply + \" \" + symbol + \"\\n\";\n }\n let l7 = \"USD: `\" + price + \"`\\n\" + \"BTC: `\" + priceBTC + \"`\\n\" + \"ETH: `\" + convertToETHPrice(price).toFixed(6) + \"`\";\n let l8 = \"*1h:* `\" + percent1h + \"%` \" + \"\\n\" + \"*24h:* `\" + percent + \"%`\" + \" \\n\" + \"*7d:* `\" + percent7 + \"%`\";\n \n let embed = new Discord.RichEmbed()\n .addField(\"Market Data for \" + name + \" (\" + symbol + \")\", l1+l2+l3+l4+l5+l6, false)\n .addField(\"Current Prices:\", l7, true)\n .addField(\"Price Changes:\", l8, true)\n .setColor('#1b51be')\n .setThumbnail(logo)\n .setFooter('Powered by CoinMarketCap API', 'https://is3-ssl.mzstatic.com/image/thumb/Purple118/v4/8e/5b/b4/8e5bb4b3-c3a4-2ce0-a48c-d6b614eda574/AppIcon-1x_' +\n 'U007emarketing-0-0-GLES2_U002c0-512MB-sRGB-0-0-0-85-220-0-0-0-6.png/246x0w.jpg');\n\n\n message.channel.send({embed}).catch(function(rej){\n channel.send(\"Sorry, I was unable to process this command. Make sure that I have full send permissions for embeds and messages and then try again!\");\n console.log(chalk.red('Error sending MC response embed: ' + chalk.cyan(rej)));\n });\n }\n cursor++;\n }\n }) ();\n}", "title": "" }, { "docid": "1c717021513d941cb55bb6b318446a76", "score": "0.47118527", "text": "function getWatchItem(company, ticker, price, change)\n{\n change = change.toFixed(2);\n \n var sign = 'neutral';\n if (change > 0) sign = 'pos';\n if (change < 0) sign = 'neg';\n \n var template = \"\"\n + \"<li class='stock-item watch-item flex-hor' title='{ticker}'>\"\n + \"<div class='data-col'>\"\n + \"<p class='data-row name-row'>\"\n + \"<span class='company name-part'>{company}</span>\"\n + \"<span class='ticker name-art'> ({ticker})</span></p>\"\n + \"<p class='data-row price-row'>\"\n + \"<span class='live-price price-part'>${price}</span>\"\n + \"<span class='per-change price-part {sign}'>{change}%</span></p></div>\"\n + \"<div class='input-col'>\"\n + \"<button class='stock-button view'>\"\n + \"<span class='glyphicon glyphicon-eye-open'></span></button>\"\n + \"<button class='stock-button remove'>\"\n + \"<span class='glyphicon glyphicon-remove'></span></button>\"\n + \"</div>\"\n + \"</li>\";\n \n var html = template\n .split('{company}').join(company)\n .split('{ticker}').join(ticker)\n .split('{price}').join(price)\n .split('{change}').join(change)\n .split('{sign}').join(sign);\n \n return elementFromString(html);\n}", "title": "" }, { "docid": "db7e5b43667865c7a0447481dd5007df", "score": "0.47089136", "text": "function getAssetName(assetAddr){\n return tokenContract.methods.getContractName(assetAddr).call();\n }", "title": "" } ]
b891dc4e9d43ff95eb0e2f24c5a4f0fb
a oneitem menu to hide the glossay
[ { "docid": "f64e6c3344d4d32b4f3faa4cd0469fb1", "score": "0.71777993", "text": "function MakeGlossMenu_GlossOptions() {\n\tvar glossMenu = [{\n\t\tcName : \"Remove this glossary\",\n\t\tcReturn : \"removeglossary\"\n\t}];\n\t\n\tMenus.glossary = glossMenu;\n\t\n\t//now call the menu\n\tvar MenuSelection = getMenu(\"glossary\");\n\t\n\t//and do something with this menus results\n\tif (MenuSelection !== undefined && MenuSelection[0] === \"removeglossary\") {\n\t\tcalcStop();\n\t\tHideSpellSheetElement(event.target.name);\n\t\tcalcStart();\n\t}\n}", "title": "" } ]
[ { "docid": "a6a8534d2884999856093f704abc04c9", "score": "0.62991375", "text": "function recomend() \r\n{\r\n document.getElementById(\"menu\").style.display = \"block\"; \r\n document.getElementById(\"menu-page\").style.display = \"none\"; \r\n}", "title": "" }, { "docid": "971351a8af2f9e93ea968af8f221f850", "score": "0.61980885", "text": "function UilContextMenuHide() {\n if ( this.menuTag != null ) {\n debug( 'hide ' + this.name );\n\n // hide any visible submenus first\n for ( var i=0; i<this.items.length; i++ ) {\n if ( this.items[i].submenu != null &&\n this.items[i].submenu.isVisible ) {\n this.items[i].submenu.hide();\n }\n }\n\n // clear selection\n if ( this.selectedItem != null ) {\n this.selectedItem.setSelected( false );\n }\n\n // make the context menu hidden\n this.menuTag.style.visibility = \"hidden\";\n this.isVisible = false;\n this.isDismissable = true;\n\n // @01A - Show any items that were hidden by this menu\n var itemCount = this.hiddenItems.length;\n for (i=0; i<itemCount; i++)\n {\n var item = this.hiddenItems.pop();\n item.style.visibility = \"visible\";\n }\n\n // clear the launcher\n this.launcher = null;\n \n // reset action \n document.onmousedown = onmousedown_;\n }\n}", "title": "" }, { "docid": "462f4f6eb2ee024f9aebef41e363843b", "score": "0.61810476", "text": "function IdeA_tagmenuhide(){\n\t$('#MenU_ideatag').css('display','none');\t\n}", "title": "" }, { "docid": "d2c61044ea492f1a4a9cb49348dec702", "score": "0.6165253", "text": "function dm_ext_hideAllSubmenus(d_mi){_dmsm(d_mi);}", "title": "" }, { "docid": "1a4f56477092a8fc6c2f7070dab92005", "score": "0.6160844", "text": "function hideMenu() {\n\t\tmenu.Hide();\n\t\ttileTouchController.enableInput();\n\t\tcameraMovement.enableInput();\n\t}", "title": "" }, { "docid": "da3a8ff5d9ea1199f06c363023227d3b", "score": "0.61592263", "text": "function showNavMenu(){ \n k.go('scores');\n k.add([\n k.rect(k.height()*0.5, k.height()*0.5),\n k.color(k.rgba(0,0,0,0.8)),\n k.scale([global_scaleX,global_scaleY]),\n \"nav-item\"\n ]);\n k.add([\n k.text(\"nav1\", 32), \n k.pos(80, 80),\n k.scale([global_scaleX,global_scaleY]),\n k.layer(\"ui\"),\n \"nav-item\"\n ]);\n k.every(\"start_button\",(sb)=>{\n k.destroy(sb); \n }); \n \n}", "title": "" }, { "docid": "3c42df7a8bfecbb65a74483dfd903453", "score": "0.6144117", "text": "function showMenu() {\n\t\t$welcomView.hide();\n\t\t$sideBarView.show();\n\t\t$searchDishView.show();\n\t}", "title": "" }, { "docid": "bf3ecf60d77dece529545f32ea3427b5", "score": "0.61157674", "text": "function hideFilters(){\r\n\t\tMenuBar1.clearMenus($('bp_categories'));\r\n\t}", "title": "" }, { "docid": "9a171f08f56fff0dde297be75b37b812", "score": "0.6081658", "text": "function hideMenuPalette(){\n\tvar arrContext = document.getElementsByClassName(\"contextMenu\");\n\tfor(var i=0; i<arrContext.length; i++){\n\t\tarrContext[i].style.cssText = \"display: none;\";\n\t}\n\tvar arrListDiv = document.getElementsByClassName(\"palette\");\n\tfor(var j=0; j<arrListDiv.length; j++ ){\n\t\tarrListDiv[j].style.position = \"static\";\n\t}\n}", "title": "" }, { "docid": "0337ea8dc725e8dbe536300e5e06cd01", "score": "0.60367125", "text": "function shopToMenu() {\n state = \"menu\";\n if (volumeControl) {\n sound.closestore.setVolume(0.05);\n sound.closestore.play();\n }\n icon = {\n flash : false,\n heal : false,\n exhaust : false,\n ignite : false,\n barrier : false,\n };\n}", "title": "" }, { "docid": "952edbbdbd2c9c3981996d8a698dafaa", "score": "0.60271955", "text": "function hideDecorationsMenu() {\n $(\".ornaments-menu\").attr(\"on\", 0);\n $(\".ornaments-menu\").find(\"img\").attr(\"src\",\"./graphics/controls/ornaments-menu.png\");\n $(\".tab-in\").removeClass(\"slide-down\"); \n}", "title": "" }, { "docid": "0557975273f9d5aa0aa60938a5a91a6e", "score": "0.6015111", "text": "function Pg1_unload() {\n // Generate the menu items\n with (this){\n // If the last item in the list is \"New Item\" -- and it's not\n // the *only* item -- remove it\n var itemList = menuTree.treeNodes;\n var lastItem = itemList[itemList.length-1];\n var itemVals = lastItem.getAttribute(\"value\").split('|');\n if (itemList.length > 1 && itemVals[0] == LABEL_NewItem){\n lastItem.outerHTML = \"\";\n }\n \n // null out the firstFourItems array so we can repopulate\n // it if the user comes back to the Items tab.\n firstFourItems.length = 0;\n \n var menuItemArray = buildMenuItems(menuTree);\n theMenuItems = menuItemArray;\n \n // Get the height of the cells, unless height has been set manually by the user.\n if (autoItemHeight && G_textOnly) G_itemHeight = getItemHeight(menuTree.childNodes[3]);\n \n // Set all properties of menu object (most can be overridden if\n // the user chooses options in the Format and Position tabs).\n dwMenu.menuItems = menuItemArray;\n dwMenu.textUpColor = G_textUpColor;\n dwMenu.textOverColor = G_textOverColor;\n dwMenu.cellUpColor = G_cellUpColor;\n dwMenu.cellOverColor = G_cellOverColor;\n dwMenu.textAlignment = G_textAlignment;\n dwMenu.textBold = G_textBold;\n dwMenu.textItalic = G_textItalic;\n dwMenu.textOnly = G_textOnly;\n dwMenu.textFamily = G_textFamily;\n dwMenu.textSize = G_textSize;\n dwMenu.menuHeight = G_itemHeight;\n dwMenu.menuWidth = G_itemWidth;\n dwMenu.menuImagePath = G_menuImagePath;\n dwMenu.menuImagePath2 = G_menuImagePath2;\n dwMenu.horzOffset = G_horzOffset;\n dwMenu.vertOffset = G_vertOffset;\n dwMenu.vertAlignment = G_vertAlignment;\n dwMenu.hideTimeout = G_hideTimeout;\n dwMenu.horzSubmenuOffset = G_horzSubmenuOffset;\n dwMenu.vertSubmenuOffset = G_vertSubmenuOffset;\n dwMenu.submenuRelativeToItem = G_submenuRelativeToItem;\n dwMenu.menuItemSpacing = G_menuItemSpacing;\n dwMenu.menuItemPadding = G_menuItemPadding;\n dwMenu.opaqueBackground = G_showBorders;\n dwMenu.hiliteColor = G_hiliteColor;\n dwMenu.shadowColor = G_shadowColor; \n dwMenu.borderColor = G_borderColor;\n dwMenu.borderSize = G_borderSize;\n dwMenu.vertical = G_vertical;\n dwMenu.hideOnMouseOut = G_hideOnMouseOut;\n dwMenu.textIndent = G_menuItemIndent;\n dwMenu.autoItemWidth = autoItemWidth;\n dwMenu.autoItemHeight = autoItemHeight;\n \n var itemList = dwscripts.findDOMObject(\"menuItems\").childNodes;\n for (var i=3; i < itemList.length; i++){\n if (itemList[i].tagName == 'MM:TREENODE'){\n var compoundVal = itemList[i].getAttribute(\"value\");\n var itemVals = compoundVal.split('|');\n if (i < 7){\n firstFourItems[i-3] = itemVals[0];\n }\n rootNodes.push(itemList[i]);\n }\n }\n while (firstFourItems.length < 4){\n firstFourItems.push(firstFourItems[firstFourItems.length-1])\n }\n\n // Determine height of whole root menu\n G_menuHeight = parseInt(G_itemHeight * rootNodes.length);\n }\n \n T.obj.visibility = \"hidden\";\n T.obj.visibility = \"visible\";\n return true;\n}", "title": "" }, { "docid": "76d0313d2d01b8d790fd411fd58d22eb", "score": "0.60052186", "text": "function HideMenu()\n{\n if (_itemSelected)\n {\n ChangeOpacityForElement(0, _divContextMenu.id);\n UnselectCurrentMenuItem();\n }\n}", "title": "" }, { "docid": "71c7fda9fa4806f1f88b36ada7ac39ad", "score": "0.59941", "text": "function OperatE_tagmenu(){\t\n\t\t//custom the menucustom the menucustom the menucustom the menu\n\t\t//custom the menucustom the menucustom the menucustom the menu\t\t\t\t\t \n\t\t/*hide the idea create menu*/\n\t\t$('#MenU_ideatagback,#TaG_cancelcon').click(function(){\n\t\t\tIdeA_tagmenuhide();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t});\t\n}", "title": "" }, { "docid": "066a916e06545f71327405dfb078a8ec", "score": "0.5980382", "text": "function toMenu() {\n mainMenu.style.display = '';\n game.style.display = 'none';\n }", "title": "" }, { "docid": "d93a9c9333bbe54994a5854093fd1864", "score": "0.59737146", "text": "function hideOptionsPanel(){\r\n\t\tlayerTrasparente.style.visibility = \"hidden\";\r\n\t\tmenu.style.visibility = \"hidden\";\r\n\t\twindow.location.reload();\r\n\t}", "title": "" }, { "docid": "98cc498bf5a272cb8a8edff75ab7d19e", "score": "0.5924098", "text": "function Pg4_unload() {\n // Set properties of menu object that correspond to this tab \n// dwMenu.horzOffset = G_horzOffset;\n// dwMenu.vertOffset = G_vertOffset;\n dwMenu.hideOnMouseOut = G_hideOnMouseOut;\n\n T.obj.visibility = \"hidden\";\n T.obj.visibility = \"visible\";\n return true; \n}", "title": "" }, { "docid": "498d2899383ad9a8ff6dba1022cd6189", "score": "0.5887251", "text": "on_applet_clicked(event) {\n this.make_menu();\n this.menu.toggle();\n }", "title": "" }, { "docid": "ee82a617996767f392531ff32b71651c", "score": "0.58746135", "text": "function menu()\r\n{\r\n document.getElementById(\"Pizza\").style.display=\"block\";\r\n document.getElementById(\"menu-page\").style.display=\"none\";\r\n}", "title": "" }, { "docid": "de6126316fd630c80f7403609c98ffcb", "score": "0.58693314", "text": "function Hide (addr) { document.getElementById(addr).style.visibility = \"hidden\";\t} // fonction pour rendre le menu invisible", "title": "" }, { "docid": "a573e59394aef214b146af877fa6bfdb", "score": "0.5869217", "text": "onHideAssetMenu(asset) {\n asset.menu = false;\n }", "title": "" }, { "docid": "4a22ccdf265cb91b688cc0dbe7931e9b", "score": "0.5863719", "text": "function hideMenus(){\n\t\t\t$obj.removeClass('active'); //hides menu\n\t\t}", "title": "" }, { "docid": "8b848b799fc39a3c85f043f9d3c1ca20", "score": "0.585628", "text": "function megamenu(){\n\tapp.getView().render('components/header/megamenu');\n}", "title": "" }, { "docid": "7adc6aa6e1422341b4513571d6fdb8d3", "score": "0.58468723", "text": "function close_gnct() {\n menu.find('a').each(function(){this.onmouseup = this.blur()})\n tray.find('.gnct-easing').animate({\n left: '-200px', opacity: .8\n }, 300, 'linear', function() {\n tray.hide()\n icon.removeClass('ic-app-header__menu-list-item--active')\n })\n }", "title": "" }, { "docid": "81dc6476bc68bf2ca3f671d8f0cd68c6", "score": "0.5846229", "text": "function menudropdown(){\n\tif( document.getElementsByClassName(\"menuitems1\")[0].style.display == \"none\"){\n\t document.getElementsByClassName(\"menuitems1\")[0].style.display = \"block\";\n\t}\n\telse {\n\t\tdocument.getElementsByClassName(\"menuitems1\")[0].style.display = \"none\"\n\t}\n }", "title": "" }, { "docid": "496fc84bc48abc5ccab918c2b786dc4c", "score": "0.583633", "text": "function mouseDown() {\n // menu panel\n e(\"settings\").style.visibility = \"hidden\";\n // buttons\n e(\"input2button\").style.visibility = \"hidden\";\n e(\"generate\").style.visibility = \"hidden\";\n e(\"download\").style.visibility = \"hidden\";\n}", "title": "" }, { "docid": "621f09a2bf249a77e6032bafdd29a9c9", "score": "0.5833901", "text": "function showMenu() {\n document.getElementById('menubar').classList.toggle('selected');\n }", "title": "" }, { "docid": "75fdac8503f2c9670c85c7f176706b39", "score": "0.58320415", "text": "closeToolboxMenu() {\n this.menu.classList.remove(CSS.menuAnimation);\n this.menu.classList.add(CSS.hidden);\n this.unsetDeleteConfiramtion();\n }", "title": "" }, { "docid": "c001b1ef3b8a49ec0362bb03edba94b7", "score": "0.5804128", "text": "function hideMainMenu() {\n showHide('main-nav', 0);\n}", "title": "" }, { "docid": "7213ab5443c7c2ab696dcf81a6208cbe", "score": "0.57899994", "text": "function Pg2_unload() {\n with (this){\n // Build menuItems array again on assumption that user\n // changed font settings (which affect the maxWidth property\n // of each menuItem object).\n var menuItemArray = buildMenuItems(dwscripts.findDOMObject(\"menuItems\"));\n theMenuItems = menuItemArray;\n dwMenu.menuItems = menuItemArray;\n \n // Get item height again in case the user changed the\n // font face or font size. 12.17.01 If the user set the height \n // manually, make sure text will fit. If not, override the manual \n // setting.\n var sizeNeededToFit = getItemHeight(dwscripts.findDOMObject(\"menuItems\").childNodes[3]);\n if ((autoItemHeight && G_textOnly) || sizeNeededToFit > G_itemHeight){\n G_itemHeight = sizeNeededToFit;\n }\n \n // Determine height of whole root menu\n G_menuHeight = parseInt(G_itemHeight * rootNodes.length);\n\n // Set properties of menu object that correspond to this tab \n dwMenu.textUpColor = G_textUpColor;\n dwMenu.textOverColor = G_textOverColor;\n dwMenu.cellUpColor = G_cellUpColor;\n dwMenu.cellOverColor = G_cellOverColor;\n dwMenu.textAlignment = G_textAlignment;\n dwMenu.textBold = G_textBold;\n dwMenu.textItalic = G_textItalic;\n dwMenu.textOnly = G_textOnly;\n dwMenu.textFamily = G_textFamily;\n dwMenu.textSize = G_textSize;\n dwMenu.menuHeight = G_itemHeight;\n dwMenu.menuWidth = G_itemWidth;\n dwMenu.vertical = G_vertical;\n \n // Save settings for next time\n var theFile = MMNotes.open(BEHAVIOR_FILE, true);\n if (theFile){\n MMNotes.set(theFile,\"upText\",G_textUpColor);\n MMNotes.set(theFile,\"overText\",G_textOverColor);\n MMNotes.set(theFile,\"upCell\",G_cellUpColor);\n MMNotes.set(theFile,\"overCell\",G_cellOverColor);\n MMNotes.set(theFile,\"fontFamily\",G_textFamily);\n MMNotes.set(theFile,\"fontSize\",G_textSize);\n MMNotes.set(theFile,\"isBold\",G_textBold);\n MMNotes.set(theFile,\"isItalic\",G_textItalic); \n MMNotes.set(theFile,\"horzAlign\",G_textAlignment);\n MMNotes.close(theFile);\n }\n\n }\n T.obj.visibility = \"hidden\";\n T.obj.visibility = \"visible\";\n return true; \n}", "title": "" }, { "docid": "fb090fc842879f6775cb1d119da75446", "score": "0.5766419", "text": "function hideShowMenu() {\r\n \r\n if (isActive) {\r\n this.innerHTML = iconArray[0];\r\n document.getElementById(\"menu-options\").style.display = \"none\";\r\n isActive = false;\r\n }\r\n else {\r\n this.innerHTML = iconArray[1];\r\n document.getElementById(\"menu-options\").style.display = \"block\";\r\n isActive = true;\r\n }\r\n}", "title": "" }, { "docid": "46e4f19f6b8541a68af0ddb5e100db38", "score": "0.57630736", "text": "function hide_menu(id)\r\n{\r\n\tadm_menu_pos[id] ^= true;\r\n\t\r\n\tif (adm_menu_fx[id] !== undefined && adm_menu_fx[id] !== null)\r\n\t{\r\n\t\tadm_menu_fx[id].cancel();\r\n\t}\r\n\telse\r\n\t{\r\n\t\tadm_menu_fx[id] = new Fx.Morph(id,\r\n\t\t{\r\n\t\t\tduration: 500,\r\n\t\t\ttransition: Fx.Transitions.linear\r\n\t\t});\r\n\t}\r\n\r\n\t// On sauve la position du menu dans un cookie\r\n\tif (adm_menu_pos[id])\r\n\t{\r\n\t\tif (adm_menu_height[id] === null || adm_menu_height[id] === undefined)\r\n\t\t{\r\n\t\t\tadm_menu_height[id] = $(id).getCoordinates().height;\r\n\t\t}\r\n\r\n\t\tadm_menu_fx[id].start({\r\n\t\t\theight: [$(id).getStyle('height'), 0],\r\n\t\t\topacity: [$(id).getStyle('opacity'), 0]\r\n\t\t});\r\n\r\n\t\tCookie.write(id, \"C\", {duration: 31});\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$(id).setStyle('display', 'block');\r\n\t\tadm_menu_fx[id].start({\r\n\t\t\theight: [$(id).getStyle('height'), adm_menu_height[id]],\r\n\t\t\topacity: [$(id).getStyle('opacity'), 1]\r\n\t\t});\r\n\r\n\t\tCookie.write(id, \"O\", true);\r\n\t}\r\n}", "title": "" }, { "docid": "9330a79f54d5f5e1f9dbb28b970390cc", "score": "0.5749884", "text": "function twoDepthMenuHide() {\n\t\tvar $this = $(this);\n\t\t$this.removeClass('view');\n\t\t$this.children('.two-depth').stop().slideUp();\n\t}", "title": "" }, { "docid": "67c391f019cdfbc82c03b3a36e528776", "score": "0.57376224", "text": "function hide(event) {\n\t\tvar isClickInside = document.getElementById('meny').contains(event.target);\n\t\tvar meny = document.getElementById('burger').contains(event.target);\n\n\n\t if (!isClickInside && !meny) {\n\t \tevent.preventDefault();\n\t document.getElementById('meny').classList.remove(\"visabale\");\n\t\tdocument.removeEventListener('click', hide)\n\t }\n\t}", "title": "" }, { "docid": "489ea27dd64701b534a6259f361b2a67", "score": "0.57369536", "text": "function hideFeatures () {\n\t\tif ($('li.listItemSelected').hasClass(\"navSampleApp\")) {\n\t\t\t// container of menu items which have control-features\n\t\t\tvar features = $(\".navCategoryFeatures\");\n\t\t\tif (features.css(\"display\") !== \"none\") {\n\t\t\t\t// find control-feature-title, which is used by menu for click actions to toggle its state\n\t\t\t\t// and call invoke codes used on click\n\t\t\t\tvar title = features.siblings(\".navCategoryTitle\");\n\t\t\t\tif (title[0]) {\n\t\t\t\t\tOpenCloseMenuItem(title, \".navCategoryFeatures\", \".hamburgerMenu\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t }", "title": "" }, { "docid": "ac07324d13582aa9e1bba12d0278c4ad", "score": "0.5731298", "text": "function showHideMenu(){\n\t$.drawermenu.showhidemenu();\n\t$.drawermenu.menuOpen=!$.drawermenu.menuOpen;\n}", "title": "" }, { "docid": "5fe85893cf9a8697f913663bd6dff50d", "score": "0.5718417", "text": "function WAL_hideMenu(menuItemID, bFlag) {\r\n var JQSel = \"#\" + menuItemID;\r\n if (bFlag == true)\r\n $(JQSel).hide(); \r\n else\r\n $(JQSel).show(); \r\n }", "title": "" }, { "docid": "1623680fdf689ad01abedd1041b712ee", "score": "0.57078844", "text": "hide(){\n //hide the menu screen\n this.containerElement.style.display=\"none\";\n }", "title": "" }, { "docid": "115b962a120f93093b977400a73a0aff", "score": "0.57032037", "text": "hideMenu() {\n this.shadowRoot.querySelector(\"#listbox\").style.display = \"none\";\n }", "title": "" }, { "docid": "c0e48a26fe1863b791e885199d32c782", "score": "0.570022", "text": "function rightClick() {\n if (!menu) {\n const vl = this.getVerbList();\n var i;\n var height;\n\n for (i = 0; i < vl.length; i++) {\n console.log('verbs ' + vl[i]);\n if (i == 0) {\n var firstButton = new dropdownMenu(\n mousePosition[0],\n mousePosition[1],\n vl[i]\n );\n //firstButton.updateVerb(vl[i]);\n height = firstButton.getMenuButtonHeight();\n } else {\n var menu = new dropdownMenu(\n mousePosition[0],\n mousePosition[1] + i * height,\n vl[i]\n );\n //menu.updateVerb(vl[i]);\n }\n }\n } else {\n menu.hideSprite();\n }\n}", "title": "" }, { "docid": "a46dc62873ad8fd7f44ab7266fa4f314", "score": "0.56984603", "text": "function showMenu(layerName)\r\n{\r\n\tif (layerName.style.display == 'inline')\r\n\t\tlayerName.style.display = 'none';\r\n\telse\r\n\t\tlayerName.style.display = 'inline';\r\n}", "title": "" }, { "docid": "27c496e075f4e0e04215ce55e2bd4272", "score": "0.5697108", "text": "function menuuu(){\r\n document.getElementById('coifcoif').style.display = 'none';\r\n document.getElementById('CONTENEUR').style.display = 'block';\r\n document.getElementById('gymgym').style.display = 'none';\r\n}", "title": "" }, { "docid": "25456dd2f78e11d76cf882e4b5735b21", "score": "0.56921566", "text": "_applyVisibility(value, old) {\n super._applyVisibility(value, old);\n\n // hide the menu too\n var menu = this.getMenu();\n if (value != \"visible\" && menu) {\n menu.hide();\n }\n }", "title": "" }, { "docid": "bc682cbabbb8f11423e8ace3ebfacfee", "score": "0.5678364", "text": "function setupMenus() {\n if (!Menu.menuExists(\"Developer\")) {\n Menu.addMenu(\"Developer\");\n }\n if (!Menu.menuExists(\"Developer > Entities\")) {\n Menu.addMenu(\"Developer > Entities\");\n Menu.addMenuItem({ menuName: \"Developer > Entities\", menuItemName: \"Display Model Bounds\", isCheckable: true, isChecked: false });\n Menu.addMenuItem({ menuName: \"Developer > Entities\", menuItemName: \"Display Model Triangles\", isCheckable: true, isChecked: false });\n Menu.addMenuItem({ menuName: \"Developer > Entities\", menuItemName: \"Display Model Element Bounds\", isCheckable: true, isChecked: false });\n Menu.addMenuItem({ menuName: \"Developer > Entities\", menuItemName: \"Display Model Element Children\", isCheckable: true, isChecked: false });\n Menu.addMenuItem({ menuName: \"Developer > Entities\", menuItemName: \"Don't Do Precision Picking\", isCheckable: true, isChecked: false });\n Menu.addMenuItem({ menuName: \"Developer > Entities\", menuItemName: \"Don't Attempt Render Entities as Scene\", isCheckable: true, isChecked: false });\n Menu.addMenuItem({ menuName: \"Developer > Entities\", menuItemName: \"Don't Do Precision Picking\", isCheckable: true, isChecked: false });\n Menu.addMenuItem({ menuName: \"Developer > Entities\", menuItemName: \"Disable Light Entities\", isCheckable: true, isChecked: false });\n }\n}", "title": "" }, { "docid": "3e1bfa67568bcca89c6202027239adbc", "score": "0.5677292", "text": "function MainMenu(){\n // set all event variables t ofalse if you go back to the main menu\n // whenever I get arround to making them lmao\n var skip_to_tutorial = false;\n // Destroy the current game's layers.\n var currstate = game.state.states[game.state.current];\n if (currstate.manager){\n DestroyLayers(currstate);\n }\n // Start main menu state\n game.state.start(\"intro\");\n}", "title": "" }, { "docid": "ff8e9d55b3fa817d8bea2b2b87f1fc68", "score": "0.5674645", "text": "function makeMenus() { }", "title": "" }, { "docid": "cb3d591f55cadb65e6f345385554a2e2", "score": "0.56733966", "text": "function yanaCloseAll()\n{\n var nodelist = document.getElementsByTagName('ul');\n for (var i = 0; i < nodelist.length; i++)\n {\n if (nodelist[i].className == 'menu') {\n nodelist[i].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "037353fb36877fb43b76ed3f4481a18c", "score": "0.5670186", "text": "function hide() {\n if (contextMenu != null) {\n contextMenu.hide();\n }\n}", "title": "" }, { "docid": "037353fb36877fb43b76ed3f4481a18c", "score": "0.5670186", "text": "function hide() {\n if (contextMenu != null) {\n contextMenu.hide();\n }\n}", "title": "" }, { "docid": "5d6a8b6f85ef41d2036df089618bdf39", "score": "0.5666894", "text": "function displayMenu() {\r\n let slicePoint = this.id.indexOf(\"L\");\r\n menuId = this.id.slice(0, slicePoint);\r\n switch (menuId) {\r\n case \"entrees\":\r\n mapMenuItems(menuItemsEntrees, menuPopulated, menuId);\r\n break;\r\n case \"rolls\":\r\n mapMenuItems(menuItemsRolls, menuPopulated, menuId);\r\n break;\r\n case \"desserts\":\r\n mapMenuItems(menuItemsDesserts, menuPopulated, menuId);\r\n break;\r\n }\r\n menuPopulated[menuId] = \"true\";\r\n appetizerMenu.classList.remove(\"visible\");\r\n entreeMenu.classList.remove(\"visible\");\r\n rollMenu.classList.remove(\"visible\");\r\n dessertMenu.classList.remove(\"visible\");\r\n document.getElementById(menuId).classList.toggle(\"visible\");\r\n}", "title": "" }, { "docid": "a91637df538d3a5225a56220f5a755c8", "score": "0.5653318", "text": "function hideContextualMenu() {\n\t// Don't hide if a layout is being displayed\n\tvar isLayoutVisible = ($('.clonedWSV').length === 0) ? false : true;\n\tif(!isLayoutVisible) {\n\t\t$('.tooltip').removeClass('wrapper')\n\t\t$('.tooltip').addClass('hide');\n\n\t\tresetLayoutIcon();\n\n\t\ttmpCurrentEntity = null;\n\t\tconsole.log('set tmpCurrentEntity to null')\n\t}\n\t// contextualMenuVisible = false\n}", "title": "" }, { "docid": "ed7a1493a4ff6f195b17a8f7c4f1e366", "score": "0.5650013", "text": "function mainmenubutton() {\n\n\t\tkgMenubutton.on('click', function() {\n\t\t\tkgMenubar.toggleClass('menu-open');\n\t\t});\n\n\t\tkgMenubarLink.on('click', function() {\n\t\t\tkgMenubar.removeClass('menu-open');\n\t\t});\n\t\t\n\t\tkgPage.on('click', function() {\n\t\t\tkgMenubar.removeClass('menu-open');\n\t\t});\n\n\t}", "title": "" }, { "docid": "0a35ebe2d3627fe60f53682aa0216cbc", "score": "0.5649964", "text": "function showDecorationsMenu() {\n $(\".ornaments-menu\").find(\"img\").attr(\"src\",\"./graphics/controls/ornaments-menu-open.png\");\n $(\".tab-in\").addClass(\"slide-down\");\n /*if any chests with decorations are currently show, animate close and hide the chest*/\n $(\".chest\").each(function () {\n if ($(this).attr(\"chest-open\") == 1) {\n $(this).addClass(\"chest-closed\");\n $(this).removeClass(\"chest-open\");\n restartAnimation($('.chest-closed'))\n $(this).attr(\"chest-open\", 0);\n var $target = $($(this).find(\"button\").attr(\"href\"));\n if ($target.hasClass('show')) {\n $target.collapse('hide');\n }\n }\n })\n}", "title": "" }, { "docid": "5a1df82bd830d6001ef47b6332ca16c9", "score": "0.5645421", "text": "function hideGoMenu() {\n var menu = document.getElementById(\"gameOverMenu\");\n menu.style.zIndex = -1;\n menu.style.visibility = \"hidden\";\n}", "title": "" }, { "docid": "07f4ec98538e407bc13c967b33a1ef3f", "score": "0.56423026", "text": "function showMiscMenu() {\r\n if(address==\"\") return;\r\n document.getElementById(\"miscMenu\").style.display=\"block\"; \r\n document.getElementById(\"showMiscMenu\").style.display=\"none\"; \r\n document.getElementById(\"hideMiscMenu\").style.display=\"block\"; \r\n refreshImmediately = true; \r\n rescaleWindow();\r\n}", "title": "" }, { "docid": "461b1a7c9d880ddcc15b532b164ffaa4", "score": "0.56412655", "text": "function showMyMenue()\r\n {\r\n let navBar=document.getElementById(\"navDiv\");\r\n navBar.classList.toggle('show');\r\n }", "title": "" }, { "docid": "2460f560f1f203d566f6c3b6105e4fc1", "score": "0.56306374", "text": "hideSubmenu() {\n $(this).removeClass(\"hover\").find('.subMenu').hide();\n }", "title": "" }, { "docid": "f0f9122f78f7d3777893a59ea0b97565", "score": "0.5622449", "text": "function hideMallNav()\n\t{\n\t\tclassie.add( mallNav, 'mallnav--hidden' );\n\t}", "title": "" }, { "docid": "e5fc8600026942700496b8556f3bf034", "score": "0.5615369", "text": "function hideMenuItem(path) {\r\n\t\r\n\t/*document.getElementById(\"demoPage\").innerHTML = \"Page path is: \" + path;*/\r\n\t\r\n\tswitch (path) {\r\n\t\tcase \"/\":\r\n\t\tcase \"/index.htm\":\r\n\t\tcase \"/index.html\":\r\n\t\t\tdocument.getElementById(\"Main\").setAttribute(\"class\", \"hidden\");\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase \"/evaluation\":\r\n\t\t\tdocument.getElementById(\"Evaluation Calculator\").setAttribute(\"class\", \r\n\t\t\t\"hidden\");\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase \"/gpa\":\r\n\t\t\tdocument.getElementById(\"GPA Calculator\").setAttribute(\"class\", \r\n\t\t\t\"hidden\");\r\n\t\t\r\n\t\t\tbreak;\r\n\t\tcase \"/course\":\r\n\t\t\tdocument.getElementById(\"Add Course\").setAttribute(\"class\", \r\n\t\t\t\"hidden\");\r\n\t\t\r\n\t\t\tbreak;\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "a05076d7c556cd80d649be8e18b58572", "score": "0.56088245", "text": "function hideMenu(menu) {\n\t$(menu).removeClass('show', 200);\n}", "title": "" }, { "docid": "160fde22a8b827f4c5c4fddc20bdc6d9", "score": "0.56086826", "text": "function beforeShowKinderglossary(e)\n{\n BindKinderGlossaryDetails(currentBook);\n closeNav();\n}", "title": "" }, { "docid": "f77be15462556776863caa4b414a9923", "score": "0.5607364", "text": "function dropdownManagerMod(){\n if (menuShownMod == false){\n openMenuMod();\n headingOptionHover();\n menuShownMod = true\n }\n else{\n closeMenuMod();\n headingOptionLeave();\n menuShownMod=false;\n }\n\n}", "title": "" }, { "docid": "9c597f4ae7187dc7fd47fdf883f1fb01", "score": "0.5605972", "text": "function showMallNav()\n\t{\n\t\tclassie.remove( mallNav, 'mallnav--hidden' );\n\t}", "title": "" }, { "docid": "4c91424cd704bb5759eafb3c66ee073e", "score": "0.5604731", "text": "function showMenu() {\n\t\tsuper.showMenu();\n\t}", "title": "" }, { "docid": "57c29f26eabdc90901458b2d8a9932b4", "score": "0.56033814", "text": "function hide(ninja) {\n ninja.visibility = false;\n}", "title": "" }, { "docid": "33a64c923e56239fc23bc40849284251", "score": "0.56016093", "text": "function hideMenus(menuObj) { // Public method\n refreshMenuItems(menuObj);\n for (var i = 0, len = menuObj.childNodes.length; i < len; i++) {\n if (menuObj.childNodes[i].enabled && menuObj.childNodes[i].subMenu) {\n hideMenus(menuObj.childNodes[i].subMenu.menuObj);\n }\n }\n if (menuObj.style.position == \"fixed\") {\n menuObj.style.position = \"absolute\";\n menuObj.style.visibility = \"hidden\";\n menuObj.style.position = \"fixed\";\n }\n else {\n menuObj.style.visibility = \"hidden\";\n menuObj.style.left = \"0px\";\n menuObj.style.top = \"0px\";\n menuObj.initialLeft = 0;\n menuObj.initialTop = 0;\n }\n}", "title": "" }, { "docid": "849a366cc44c83634c375c73ed6fb6bd", "score": "0.5595219", "text": "function generateCustomSideMenu()\n{\n\thtml=\"\";\n\tfor(var i=0;i<GRAPH_TYPES.length;i++)\n\t{\n\t\thtml+='<li data-action=\"'+GRAPH_TYPES[i].id+'\" title=\"'+GRAPH_TYPES[i].tooltip+'\">'+GRAPH_TYPES[i].menuText+'</li>';\n\t}\n\thtml+='<li data-action=\"close\" title=\"Hides this menu\">Hide</li>';\n\tdocument.getElementById('side-menu').innerHTML = html;\n}", "title": "" }, { "docid": "aa3a4f50ccbcf0aedb4c869fb7b3bdf7", "score": "0.55876654", "text": "function book(){\r\n menuSelection.style.display = \"none\";\r\n menuSelection1.style.display = \"none\";\r\n getWood.style.display = \"none\";\r\n getStone.style.display = \"none\";\r\n getWater.style.display = \"none\";\r\n hunt.style.display = \"none\";\r\n bookFull.style.display = \"inline-block\";\r\n}", "title": "" }, { "docid": "44ae622febe5bcd487c9e005cf27ead7", "score": "0.55698895", "text": "function menu(){\n\n \n switch(menuStep){ //case for main menu button\n case 0:\n menuLevel[1].visible = false; //mode menu\n menuLevel[2].visible = false; //configurator menu\n menuLevel[3].visible = false;\n menuLevel[4].visible = false;\n menuLevel[5].visible = false;\n menuLevel[6].visible = false;\n\n tooltip.visible = false;\n tooltip2.visible = false;\n\n for (var i = 0; i <= robo.length -1 ; i++){\n robo[i].visible = false;\n }\n\n workpiece[0].visible = false;\n workpiece[1].visible = false;\n workpiece[2].visible = false;\n conveyor[0].visible = false;\n conveyor[1].visible = false;\n conveyor[2].visible = false;\n \n\n break;\n\n case 1:\n menuLevel[1].visible = true;\n menuLevel[2].visible = false;\n menuLevel[3].visible = false;\n menuLevel[4].visible = false;\n menuLevel[5].visible = false;\n menuLevel[6].visible = false;\n \n if('undefined' !== typeof text){\n tooltip.visible = true;\n tooltip2.visible = false;\n }\n \n controller1.paintOff();\n\n for (var i = 0; i <= robo.length -1 ; i++){\n robo[i].visible = false;\n }\n\n workpiece[0].visible = false;\n workpiece[1].visible = false;\n workpiece[2].visible = false;\n conveyor[0].visible = false;\n conveyor[1].visible = false;\n conveyor[2].visible = false;\n \n break;\n\n case 2:\n menuLevel[1].visible = false;\n menuLevel[2].visible = true;\n menuLevel[3].visible = true;\n menuLevel[4].visible = true;\n menuLevel[5].visible = true;\n menuLevel[6].visible = false;\n\n tooltip.visible = true;\n tooltip2.visible = true;\n\n for (var i = 0; i <= robo.length -1 ; i++){\n robo[i].visible = true;\n robo[i].position.set(roundPositions[i].position.x, roundPositions[i].position.y, roundPositions[i].position.z);\n\n if ( i === 1){\n robo[i].scale.set(0.10 * robo[i].userData.factor, 0.1 * robo[i].userData.factor, 0.1 * robo[i].userData.factor);\n } else {\n robo[i].scale.set(0.05 * robo[i].userData.factor, 0.05 * robo[i].userData.factor, 0.05 * robo[i].userData.factor);\n }\n }\n\n CNC[0].visible = false;\n workpiece[0].visible = false;\n workpiece[1].visible = false;\n workpiece[2].visible = false;\n conveyor[0].visible = false;\n conveyor[1].visible = false;\n conveyor[2].visible = false;\n break; \n \n case 3:\n menuLevel[1].visible = false;\n menuLevel[2].visible = true;\n menuLevel[3].visible = true;\n menuLevel[4].visible = true;\n menuLevel[5].visible = true;\n \n\n for (var i = 0; i <= robo.length -1 ; i++){\n robo[i].visible = false;\n }\n\n CNC[0].visible = true;\n workpiece[0].visible = false;\n workpiece[1].visible = false;\n workpiece[2].visible = false;\n conveyor[0].visible = false;\n conveyor[1].visible = false;\n conveyor[2].visible = false;\n break;\n\n case 4:\n menuLevel[1].visible = false;\n menuLevel[2].visible = true;\n menuLevel[3].visible = true;\n menuLevel[4].visible = true;\n menuLevel[5].visible = true;\n menuLevel[6].visible = false;\n for (var i = 0; i <= robo.length -1 ; i++){\n robo[i].visible = false;\n }\n\n CNC[0].visible = false;\n conveyor[0].visible = false;\n conveyor[1].visible = false;\n conveyor[2].visible = false;\n\n workpiece[0].visible = true;\n workpiece[1].visible = true;\n workpiece[2].visible = true;\n\n for (var i = 0; i <= workpiece.length -1 ; i++){\n workpiece[i].visible = true;\n workpiece[i].position.set(roundPositions[i].position.x, roundPositions[i].position.y, roundPositions[i].position.z);\n }\n \n break;\n\n case 5:\n menuLevel[1].visible = false;\n menuLevel[2].visible = true;\n menuLevel[3].visible = true;\n menuLevel[4].visible = true;\n menuLevel[5].visible = true;\n menuLevel[6].visible = false;\n for (var i = 0; i <= robo.length -1 ; i++){\n robo[i].visible = false;\n }\n\n CNC[0].visible = false;\n\n workpiece[0].visible = false;\n workpiece[1].visible = false;\n workpiece[2].visible = false;\n\n conveyor[0].visible = true;\n conveyor[1].visible = true;\n conveyor[2].visible = true;\n\n for (var i = 0; i <= workpiece.length -1 ; i++){\n conveyor[i].visible = true;\n conveyor[i].position.set(roundPositions[i].position.x, roundPositions[i].position.y, roundPositions[i].position.z);\n\n if ( i === 1){\n conveyor[i].scale.set(0.10 * conveyor[i].userData.factor, 0.1 * conveyor[i].userData.factor, 0.1 * conveyor[i].userData.factor);\n } else {\n conveyor[i].scale.set(0.05 * conveyor[i].userData.factor, 0.05 * conveyor[i].userData.factor, 0.05 * conveyor[i].userData.factor);\n }\n }\n break;\n\n case 6:\n for (var i = 1; i < 6 ; i++){\n menuLevel[i].visible = false;\n }\n for (var i = 0; i < robo.length; i++){\n robo[i].visible = false;\n }\n for (var i = 0; i < CNC.length; i++){\n CNC[i].visible = false;\n }\n for (var i = 0; i < workpiece.length; i++){\n workpiece[i].visible = false;\n }\n for (var i = 0; i < conveyor.length; i++){\n conveyor[i].visible = false;\n }\n menuLevel[6].visible = true;\n \n }\n\n\n\n\n\n \n}", "title": "" }, { "docid": "576ed0205c68344bfd65389dc95b2b0a", "score": "0.5562781", "text": "function closeMenu() {\n gsap.to(\".menu-window\", { x: \"100%\", duration: 0.5 });\n}", "title": "" }, { "docid": "7cc4c37c014731cd11f01802bfcfbc62", "score": "0.556171", "text": "function showShop() {\n if (state === \"shop\") {\n\n shopToMenuButton.run();\n\n noFill();\n strokeWeight(10);\n if (mouseX >= width * 0.1 && mouseX <= width * 0.2 && mouseY >= height * 0.1 && mouseY <= height * 0.3) {\n cursor(\"assets/cursors/shop.cur\");\n }\n if (icon.flash) {\n stroke(0, 255, 255);\n }\n else {\n stroke(53, 0, 96);\n }\n rect(width * 0.1, height * 0.1, width * 0.1, height * 0.2);\n image(images.flash, width * 0.1, height * 0.1, width * 0.1, height * 0.2);\n\n if (mouseX >= width * 0.225 && mouseX <= width * 0.325 && mouseY >= height * 0.1 && mouseY <= height * 0.3) {\n cursor(\"assets/cursors/shop.cur\");\n }\n if (icon.heal) {\n stroke(0, 255, 255);\n }\n else {\n stroke(53, 0, 96);\n }\n rect(width * 0.225, height * 0.1, width * 0.1, height * 0.2);\n image(images.heal, width * 0.225, height * 0.1, width * 0.1, height * 0.2);\n\n if (mouseX >= width * 0.35 && mouseX <= width * 0.45 && mouseY >= height * 0.1 && mouseY <= height * 0.3) {\n cursor(\"assets/cursors/shop.cur\");\n }\n if (icon.barrier) {\n stroke(0, 255, 255);\n }\n else {\n stroke(53, 0, 96);\n }\n rect(width * 0.35, height * 0.1, width * 0.1, height * 0.2);\n image(images.barrier, width * 0.35, height * 0.1, width * 0.1, height * 0.2);\n\n if (mouseX >= width * 0.475 && mouseX <= width * 0.575 && mouseY >= height * 0.1 && mouseY <= height * 0.3) {\n cursor(\"assets/cursors/shop.cur\");\n }\n if (icon.ignite) {\n stroke(0, 255, 255);\n }\n else {\n stroke(53, 0, 96);\n }\n rect(width * 0.475, height * 0.1, width * 0.1, height * 0.2);\n image(images.ignite, width * 0.475, height * 0.1, width * 0.1, height * 0.2);\n\n if (mouseX >= width * 0.6 && mouseX <= width * 0.7 && mouseY >= height * 0.1 && mouseY <= height * 0.3) {\n cursor(\"assets/cursors/shop.cur\");\n }\n if (icon.exhaust) {\n stroke(0, 255, 255);\n }\n else {\n stroke(53, 0, 96);\n }\n rect(width * 0.6, height * 0.1, width * 0.1, height * 0.2);\n image(images.exhaust, width * 0.6, height * 0.1, width * 0.1, height * 0.2);\n \n }\n\n strokeWeight(1);\n}", "title": "" }, { "docid": "37232a1e18928c79d2b4653a69453c9d", "score": "0.555836", "text": "function hidesubmenu(item) {\n item.removeClass('show').stop().animate({'marginTop' : '-12em'});\n }", "title": "" }, { "docid": "5fcc5f3b7181410e40aa335567496a2d", "score": "0.5557004", "text": "function menu_map(){\r\n document.getElementById('mapmap').style.display = 'none';\r\n document.getElementById('mapmap_gym').style.display = 'none';\r\n document.getElementById('CONTENEUR').style.display = 'block';\r\n document.getElementById('the_map').style.display = 'none';\r\n document.getElementById('the_map_gym').style.display = 'none';\r\n\r\n\r\n}", "title": "" }, { "docid": "4004a3e95abc9c3899febaa7d3246825", "score": "0.5553431", "text": "openToolboxMenu() {\n this.showDeleteConfirmation = false;\n this.menu.classList.add(CSS.menuAnimation);\n this.menu.classList.remove(CSS.hidden);\n }", "title": "" }, { "docid": "19b3807c4117f6e6c30a67b16849562b", "score": "0.55504733", "text": "hoistMenuToBody () {\n this.menuSurface_.hoistMenuToBody ();\n }", "title": "" }, { "docid": "1f758289e9094cd3c62c9a5516ab7004", "score": "0.5549091", "text": "function uitklapMenu() {\n document.querySelector('.menu-categorie').classList.toggle('uitklapeffect1');\n document.querySelector('.fa-chevron-down').classList.toggle('fa-rotate-180');\n}", "title": "" }, { "docid": "f8aff87d51f958376789f1fee9759857", "score": "0.5546459", "text": "function menuButtonPressed(){\n\n // change instructions\n instructions.html('select a map type...')\n // hide the none menu buttons\n menuButton.hide();\n customSubmitButton.hide();\n customRunButton.hide();\n customTrainButton.hide();\n trainingStatus.hide();\n customSelect = false;\n if(customLake){\n customLake.hideEnv(); // hide the previous page content\n }\n \n gymDataButton.hide();\n //draw background\n stroke(0);\n fill(255);\n rectMode(CORNER)\n rect(0, 0, width-1, height-1);\n // show the menu buttons\n makeCustomButton.show();\n useDataButton.show();\n // clear q table and custom map if they exist\n setup();\n\n\n}", "title": "" }, { "docid": "2b27085c07f37432e52eaf92efe75d5d", "score": "0.55431247", "text": "function hidePopupMenu()\n{\n var menu = document.getElementById('popupmenu').style.display='none';\n}", "title": "" }, { "docid": "eb28dd0bcfb337ee464d02646c305880", "score": "0.5540633", "text": "function hideActiveMenu() {\n\tif( _activeMenu ) {\n\t _activeMenu.menu.style.display = 'none';\n\t dehighlightMenuImage( _activeMenu.menuImage );\n\t _activeMenu = null;\n\t}\n }", "title": "" }, { "docid": "db33a1460a3a68ddc884a833b723728f", "score": "0.5532507", "text": "function hideOthers(theLayer, myDocument) {\n myDocument.activeLayer = theLayer;\n // =======================================================\n var idShw = charIDToTypeID(\"Shw \");\n var desc10 = new ActionDescriptor();\n var idnull = charIDToTypeID(\"null\");\n var list4 = new ActionList();\n var ref7 = new ActionReference();\n var idLyr = charIDToTypeID(\"Lyr \");\n var idOrdn = charIDToTypeID(\"Ordn\");\n var idTrgt = charIDToTypeID(\"Trgt\");\n ref7.putEnumerated(idLyr, idOrdn, idTrgt);\n list4.putReference(ref7);\n desc10.putList(idnull, list4);\n var idTglO = charIDToTypeID(\"TglO\");\n desc10.putBoolean(idTglO, true);\n executeAction(idShw, desc10, DialogModes.NO);\n}", "title": "" }, { "docid": "57f1f5e6080998b40f6ae8c816740350", "score": "0.5529006", "text": "function logick_menu_item(name,onclick)\n{\n return menubar_Item(name,onclick,\"element-aktions\");\n}", "title": "" }, { "docid": "767495a64944c72e8b6806d1d1e3f0a8", "score": "0.55260444", "text": "function mostrarMenu()\n{\n\tdespliegaNivel(-1);\n}", "title": "" }, { "docid": "6959435f6b2ae755f2fa45cbd1e723c3", "score": "0.5525001", "text": "function Make_Pizza() \r\n{\r\ndocument.getElementById(\"Pizza\").style.display=\"none\";\r\n document.getElementById(\"menu\").style.display = \"block\"; \r\n}", "title": "" }, { "docid": "e8d85a3d3faedcd2cba8523ae6ef4a60", "score": "0.55232096", "text": "close() {\n this._isOpen = false;\n this._menuElm.classList.add(Config.CSS.Hidden);\n }", "title": "" }, { "docid": "faf5257287249484c51c7634ca49849c", "score": "0.55186194", "text": "function mainMenuProcess() {\n// $(\".Menu-outer\").hide();\n }", "title": "" }, { "docid": "71bbb8fcd487b284a19a74a508c615c2", "score": "0.55179185", "text": "removeHlMenus() {\n let ic = this.icn3d,\n me = ic.icn3dui\n $('#' + ic.pre + 'atomsCustom').val('')\n $('#' + ic.pre + 'atomsCustom')[0].blur()\n }", "title": "" }, { "docid": "3461330405ee23490537886c1dcc8ca0", "score": "0.55168587", "text": "function gmToMenu() {\n state = \"menu\";\n resetGame();\n if (volumeControl) {\n sound.startgame.play();\n }\n}", "title": "" }, { "docid": "e299e5aad5d38b72653657de07baad1b", "score": "0.5511443", "text": "function menuItemOut( li ) {\n\tli.className = '';\n }", "title": "" }, { "docid": "09f640348de12d3310b86a39bfd6b69b", "score": "0.55082244", "text": "function hideOptionsMenu() {\n\tlet dropDownMenu = $('.dropdown-menu');\n\tlet optionsMenu = $('.options-menu');\n\tlet playlistMenu = $('.playlists-menu');\n\tlet shareMenu = $('.share-menu');\n\tlet userMenu = $('.usermenu');\n\tlet albumMenu = $('.album-menu__item');\n\tif(userMenu.css('display') != \"none\") {\n\t\tuserMenu.css(\"display\", \"none\");\n\t}\n\tif(albumMenu.css('display') != \"none\") {\n\t\talbumMenu.css(\"display\", \"none\");\n\t}\n\tif(dropDownMenu.css('display') != \"none\") {\n\t\tdropDownMenu.css(\"display\", \"none\");\n\t\toptionsMenu.css(\"display\", \"none\");\n\t\tplaylistMenu.css(\"display\", \"none\");\n\t\tshareMenu.css(\"display\", \"none\");\n\t}\n\tmenu_open = false;\n}", "title": "" }, { "docid": "0bf6ab87bd195e90ade5735aa54ff64f", "score": "0.5505132", "text": "function initMenu() {\n $('#privateKeyMenuItem').hide();\n $('#publicKeyMenuItem').hide();\n $('#qr').hide();\n}", "title": "" }, { "docid": "dfd28e8b7f27bb61b92d090e35ddcb7a", "score": "0.550129", "text": "onWindowBlurred() {\n\t\tthis.hideMenu();\n\t}", "title": "" }, { "docid": "7755748a642335e3e44d7dbd421aa446", "score": "0.5500627", "text": "function showMenu() {\n\t\tmenu.Reveal();\n\t}", "title": "" }, { "docid": "4abe17b74a442b9d7cccfb61d085cfb8", "score": "0.5500182", "text": "function burgerMenu() {\n var x = document.getElementById(\"myLinks\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "e16d82e957d9c7de5c0a67c4297b4f5d", "score": "0.5497009", "text": "function menuItemOut() { // Private method\n if (this.enabled) {\n if (!(this.subMenu && this.subMenu.menuObj.style.visibility == \"visible\")) {\n this.className = this.itemClassName;\n }\n if (this.subMenu) {\n if (this.subMenu.menuObj.style.visibility == \"visible\") {\n this.arrowObj.className = this.arrowClassNameOver;\n if (this.iconObj) {\n this.iconObj.className = this.iconClassNameOver;\n }\n }\n }\n else {\n if (this.iconObj) {\n this.iconObj.className = this.iconClassName;\n }\n }\n }\n}", "title": "" }, { "docid": "7dec78e9bc1ff85df45100ad33d11439", "score": "0.5493623", "text": "function hideMenu() {\n sublist.classList.remove(\"show\");\n arrowUp.style.transform = \"rotate(00deg)\";\n}", "title": "" }, { "docid": "af89eb814c96bbb800d0e5dbeb616dbd", "score": "0.5492824", "text": "function removeUnusedMenu(menu) {\n menu.classList.add('hidden'); // Hides the unused menu. Must hide, not remove, to prevent issues with `/a/j/vnav.js`.\n }", "title": "" }, { "docid": "d62a11d3d4d24eea5001f7c252721df3", "score": "0.54881835", "text": "function onMenuInactive(event)\n {\n var elt;\n\n elt= event.target;\n if (elt.parentNode &&\n elt.parentNode.getAttribute(\"type\") === \"bookmarktags:tagpopup\" &&\n (document.getElementById(\"BookmarkTags-bmMenuToolbarbutton\") &&\n !document.getElementById(\"BookmarkTags-bmMenuToolbarbutton\").open) &&\n !document.getElementById(\"BookmarkTags-tagMenuBookmarksPopup\").open)\n {\n window.XULBrowserWindow.setOverLink(\"\", null);\n }\n }", "title": "" }, { "docid": "3a9b76725ba5307ae5c527ec327282f7", "score": "0.5469216", "text": "function remove_contextMenu(){\n\t}", "title": "" }, { "docid": "ff0e3f87502153fd60d70952d4204c95", "score": "0.54672503", "text": "closeAllWindows(){\n let pD = this.scene.get(\"paperdoll\");\n // let inv = this.scene.get(\"inventory\");\n let inv2 = this.scene.get(\"inventory-menu\");\n let shop = this.scene.get(\"shop\");\n let craft = this.scene.get(\"crafting-menu\");\n let skillMenu = this.scene.get(\"skill-menu\");\n let bank = this.scene.get(\"bank-menu\");\n pD.hide = true;\n // inv.hide = true;\n inv2.hide = true;\n craft.hide = true;\n shop.hide = true;\n skillMenu.hide = true;\n craft.hide = true;\n bank.hide = true;\n }", "title": "" }, { "docid": "46a62896bd1a401b4d3b79669d1f942a", "score": "0.5466839", "text": "function OnGUI() {\n\tGUI.DrawTexture(Rect(0,0,Screen.width,Screen.height),GUIHandler.menu);\n\tif (drawMenuOption(\"Survival Beta on Dam\",\"damButton\",0)) {\n\t\tselectedGamemode = new SurvivalMode();\n\t\tApplication.LoadLevel(\"Dam\");\n\t}\n\tif (drawMenuOption(\"Survival Beta on Bridge\",\"bridgeButton\",1)) {\n\t\tselectedGamemode = new SurvivalMode();\n\t\tApplication.LoadLevel(\"Bridge\");\n\t}\n\tif (drawMenuOption(\"Survival Beta on Carlisle\",\"carlisleButton\",2)) {\n\t\tselectedGamemode = new SurvivalMode();\n\t\tApplication.LoadLevel(\"Carlisle\");\n\t}\n\tif (drawMenuOption(\"Quit\",\"quitButton\",3))\n\t\tApplication.Quit();\n}", "title": "" } ]
3661a3d6bf3ec96f1bd610e2b5723e38
(For IE <=11) Handles a propertychange event, sending a `change` event if the value of the active element has changed.
[ { "docid": "67c3080a4ea59e604271f84cd10c5c99", "score": "0.0", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t var value = nativeEvent.srcElement.value;\n\t if (value === activeElementValue) {\n\t return;\n\t }\n\t activeElementValue = value;\n\n\t manualDispatchChangeEvent(nativeEvent);\n\t}", "title": "" } ]
[ { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.7149988", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "ee2f35f91251153f52bba4bf6f460cf6", "score": "0.6825748", "text": "function startWatchingForValueChange(target,targetID){activeElement=target,activeElementID=targetID,activeElementValue=target.value,activeElementValueProp=Object.getOwnPropertyDescriptor(target.constructor.prototype,\"value\"),Object.defineProperty(activeElement,\"value\",newValueProp),activeElement.attachEvent(\"onpropertychange\",handlePropertyChange)}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "8f472b1f3e1fd810f798113237adc4a7", "score": "0.68151665", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}", "title": "" }, { "docid": "eff4953521d2a287ef96d15e14d6e339", "score": "0.6767028", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElementValue=target.value;activeElementValueProp=Object.getOwnPropertyDescriptor(target.constructor.prototype,'value');// Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n// on DOM elements\nObject.defineProperty(activeElement,'value',newValueProp);if(activeElement.attachEvent){activeElement.attachEvent('onpropertychange',handlePropertyChange);}else{activeElement.addEventListener('propertychange',handlePropertyChange,false);}}", "title": "" }, { "docid": "31c5b15b942cec7a4945dec6081473fd", "score": "0.67625743", "text": "function propertychangeHandler(e) {\n // Limit to `value` property.\n if (e.propertyName !== 'value') {\n return;\n }\n setTimeout(handler);\n }", "title": "" }, { "docid": "4422db0fc04859130a8475951dc628cc", "score": "0.67578185", "text": "function handlePropertyChange(nativeEvent) {\r\n if (nativeEvent.propertyName !== 'value') {\r\n return;\r\n }\r\n if (getInstIfValueChanged(activeElementInst)) {\r\n manualDispatchChangeEvent(nativeEvent);\r\n }\r\n }", "title": "" }, { "docid": "38a1ce002dd05882c5f26c603d5c0dd0", "score": "0.6752862", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}var value=nativeEvent.srcElement.value;if(value===activeElementValue){return;}activeElementValue=value;manualDispatchChangeEvent(nativeEvent);}", "title": "" }, { "docid": "38a1ce002dd05882c5f26c603d5c0dd0", "score": "0.6752862", "text": "function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}var value=nativeEvent.srcElement.value;if(value===activeElementValue){return;}activeElementValue=value;manualDispatchChangeEvent(nativeEvent);}", "title": "" }, { "docid": "8f81ff04d168c1346cfd800cfbc95c20", "score": "0.6742994", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "8f81ff04d168c1346cfd800cfbc95c20", "score": "0.6742994", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "d7e81950d8b4b332e6a6788d26d4f366", "score": "0.6738847", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t\n\t if (getInstIfValueChanged(activeElementInst)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "19025865839ae3c6dbaa8653dd7cc2f7", "score": "0.67329645", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "19025865839ae3c6dbaa8653dd7cc2f7", "score": "0.67329645", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "d943afc6a459cafee565b1428860b4de", "score": "0.6730164", "text": "function handlePropertyChange(nativeEvent) {\r\n if (nativeEvent.propertyName !== 'value') {\r\n return;\r\n }\r\n if (getInstIfValueChanged(activeElementInst)) {\r\n manualDispatchChangeEvent(nativeEvent);\r\n }\r\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "57cb46cc2d256ac0422b04a5d1e06042", "score": "0.67090064", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n }", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "3ceb82cb21a6309b0b605b8bfa80901e", "score": "0.66956097", "text": "function handlePropertyChange(nativeEvent) {\n\t if (nativeEvent.propertyName !== 'value') {\n\t return;\n\t }\n\t if (getInstIfValueChanged(activeElementInst, nativeEvent)) {\n\t manualDispatchChangeEvent(nativeEvent);\n\t }\n\t}", "title": "" }, { "docid": "09781e1072551ae1fed54f2ff61e2fc5", "score": "0.6678741", "text": "function handlePropertyChange(nativeEvent) {\r\n if (nativeEvent.propertyName !== 'value') {\r\n return;\r\n }\r\n if (getInstIfValueChanged(activeElementInst)) {\r\n manualDispatchChangeEvent(nativeEvent);\r\n }\r\n}", "title": "" }, { "docid": "b0c9802774438f98721e7ab6370177d2", "score": "0.66750735", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElementValue=target.value;activeElementValueProp=Object.getOwnPropertyDescriptor(target.constructor.prototype,'value');// Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n\t// on DOM elements\n\tObject.defineProperty(activeElement,'value',newValueProp);if(activeElement.attachEvent){activeElement.attachEvent('onpropertychange',handlePropertyChange);}else{activeElement.addEventListener('propertychange',handlePropertyChange,false);}}", "title": "" }, { "docid": "12d1d0e41afcc88565a78a6c0e8d74c0", "score": "0.66630614", "text": "function handlePropertyChange(nativeEvent){if(\"value\"===nativeEvent.propertyName){var value=nativeEvent.srcElement.value;value!==activeElementValue&&(activeElementValue=value,manualDispatchChangeEvent(nativeEvent))}}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" }, { "docid": "840f64a85ddf6d2e4238339971113cc9", "score": "0.66629696", "text": "function handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}", "title": "" } ]
f32ea9b1cc39bd21fe4ee4adf571804a
ionRangeSlider Directive for Ion Range Slider
[ { "docid": "124561855107d32b9537341256ae2d8d", "score": "0.8494849", "text": "function ionRangeSlider() {\r\n return {\r\n restrict: 'A',\r\n scope: {\r\n rangeOptions: '='\r\n },\r\n link: function (scope, elem, attrs) {\r\n elem.ionRangeSlider(scope.rangeOptions);\r\n }\r\n }\r\n}", "title": "" } ]
[ { "docid": "b51a2c1e6e8bd75507a93cd84e3813d4", "score": "0.8514852", "text": "function ionRangeSlider() {\n return {\n restrict: 'A',\n scope: {\n rangeOptions: '='\n },\n link: function (scope, elem, attrs) {\n elem.ionRangeSlider(scope.rangeOptions);\n }\n }\n}", "title": "" }, { "docid": "01316b933bb33ca830c8fdd1012cf36c", "score": "0.7761675", "text": "rangeslider() {\n $(\".js-range-slider\").ionRangeSlider({\n type: \"single\",\n grid: true,\n min: 20,\n max: 1000,\n from: 200,\n to: 800,\n prefix: \"$\"\n });\n }", "title": "" }, { "docid": "d1f67cff5638dc7ff5a0ee76e06beb59", "score": "0.73098916", "text": "function createSlider(slider_id, lowerlimit_id, upperlimit_id, min, max, from, to, step, postfix) {\r\n $(slider_id).ionRangeSlider({\r\n type: \"double\",\r\n min: min,\r\n max: max,\r\n from: $(lowerlimit_id).val(),\r\n to: $(upperlimit_id).val(),\r\n step: step,\r\n postfix: postfix,\r\n force_edges: true,\r\n onChange: function (data) {\r\n var from = $(slider_id).data('from');\r\n var to = $(slider_id).data('to');\r\n $(lowerlimit_id).val(from)\r\n $(upperlimit_id).val(to)\r\n }\r\n });\r\n}", "title": "" }, { "docid": "d1f67cff5638dc7ff5a0ee76e06beb59", "score": "0.73098916", "text": "function createSlider(slider_id, lowerlimit_id, upperlimit_id, min, max, from, to, step, postfix) {\r\n $(slider_id).ionRangeSlider({\r\n type: \"double\",\r\n min: min,\r\n max: max,\r\n from: $(lowerlimit_id).val(),\r\n to: $(upperlimit_id).val(),\r\n step: step,\r\n postfix: postfix,\r\n force_edges: true,\r\n onChange: function (data) {\r\n var from = $(slider_id).data('from');\r\n var to = $(slider_id).data('to');\r\n $(lowerlimit_id).val(from)\r\n $(upperlimit_id).val(to)\r\n }\r\n });\r\n}", "title": "" }, { "docid": "9eab70312c7dc863a26c39ee86b6f93d", "score": "0.6976886", "text": "function SliderValueRange() {\n this._initSliderValueRange();\n}", "title": "" }, { "docid": "18e509b57dee1e877a710a3cecf00f7a", "score": "0.6828591", "text": "function muestraSliderKm() {\n $(\"#range_09\").ionRangeSlider({\n grid: true,\n from: 0,\n values: [\n \"Ciudad\", \"10\", \"25\", \"35\", \"50\", \"Pais\"\n ]\n });\n}", "title": "" }, { "docid": "28fee6d15c1eb4dfc05c469bf1d08ff5", "score": "0.66573876", "text": "function setSliderRange(arg_values){\n var min = $(\"#slider\").slider(\"values\",0);\n var diff = $(\"#slider\").slider(\"values\",1) - $(\"#slider\").slider(\"values\",0);\n var max = $(\"#slider\").slider(\"option\",\"max\");\n $(\"#custom-range\").css({\n 'left': Math.floor(min / max * 100) + \"%\",\n 'width': (diff / max * 100) + \"%\"\n });\n}", "title": "" }, { "docid": "c78278d62baa8a054dbc74b818763efa", "score": "0.65446603", "text": "function createRangeSlider() {\n rangeSlider = document.getElementById('slider-range');\n var min = START_YEAR, max = END_YEAR;\n noUiSlider.create(rangeSlider, {\n start: [min, max],\n range: {\n 'min': [START_YEAR],\n 'max': [END_YEAR]\n },\n step: 1\n });\n rangeSlider.noUiSlider.on('update', function (values) {\n $('#min').val(String(values[0]).slice(0, -3));\n $('#max').val(String(values[1]).slice(0, -3));\n });\n }", "title": "" }, { "docid": "fc5c63deabe92e1bf6b6d6c50515be5d", "score": "0.65272635", "text": "onRangeChanged (range) {\n this.range = range\n this.render()\n }", "title": "" }, { "docid": "a05f3e70d03466ab53e0a3be9905a8e3", "score": "0.6329466", "text": "function UISlider (type, size, pos, range, dValue, vStep){\n // init super\n this._initElement(this);\n this.eType = type;\n \n // values\n this.minValue = range[0];\n this.minPos = null;\n this.maxValue = range[1];\n this.maxPos = null;\n this.eSliderValue = dValue;\n this.steps = vStep;\n var stringSteps = this.steps.toString();\n this.decimalPlaces = (stringSteps.indexOf('.') !== -1 ? stringSteps.split('.')[1].length : 0);\n \n // slider has a single event\n this.onValueChange = new UIEvent('onValueChange');\n \n // two renderables -- bar and nob\n this.eSlidierBar = new Renderable(gEngine.DefaultResources.getConstColorShader());\n this.eSlidierBar.setColor([1,1,1,1]);\n this.eSlidierBar.getXform().setPosition(pos[0], pos[1]);\n this.eSlidierBar.getXform().setSize(size[0], size[1]);\n \n this.eTextRenderable = new FontRenderable(dValue.toString());\n this.eTextRenderable.setColor([1, 1, 1, 1]);\n this.eTextRenderable.getXform().setPosition(pos[0], pos[1] + 10);\n this.eTextRenderable.setTextHeight(5);\n \n // slider nob texture\n this.eSliderBarTexture = null;\n this.eSliderBarTextureRenderer = null;\n this.eSliderNobTexture = null;\n this.eSliderNobTextureRenderer = null;\n \n \n // pos = (x - (size / 2)) + size * (dvalue / range[1])\n this.minPos = (pos[0]- (size[0] / 2));\n this.maxPos = (pos[0]+ (size[0] / 2));\n var nobXPos = (pos[0]- (size[0] / 2)) + size[0] * (dValue / range[0] - range[1]);\n \n this.eSliderNob = new Renderable(gEngine.DefaultResources.getConstColorShader());\n this.eSliderNob.setColor([0,0,1,1]);\n this.eSliderNob.getXform().setPosition(nobXPos, pos[1]);\n this.eSliderNob.getXform().setSize(size[1] * 2, size[1] * 2);\n \n \n this.isPressed = false;\n \n GameObject.call(this, this.eSliderNob);\n return this;\n}", "title": "" }, { "docid": "b269e71d4f513f3a331fa7f3abf74794", "score": "0.6253752", "text": "function multirangeslider() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n _classCallCheck(this, multirangeslider);\n\n options = this._transformOptions(options);\n this._validateOptions(options);\n this._bar = new _modulesBar2['default'](options);\n\n this.el = document.createElement('div');\n this.el.className = 'multirangeslider-slider';\n this.el.appendChild(this._bar.el);\n }", "title": "" }, { "docid": "179cce82774a5502e0c131cbbb14639e", "score": "0.6177675", "text": "function $slider(args)\n{\n\t\n\tvar thisPtr=this;\n\t\n\t//args passed to the constructor to init the slider\n\t//also editable using the inspector\n\tvar argsArr=LilyUtils.splitArgs(args);\n\tthis.args=args;\t\n\tthis.allowFont=false; //dont allow font changes\t\n\t\t\t\n\tvar bgcolor=argsArr[0]||\"#FF0000\";\n\tvar roundness=argsArr[1]||0;\n\tthis.orientation=(argsArr.length>=6&&typeof argsArr[5]!=\"undefined\")?argsArr[5]:\"horizontal\"; //slider orientation\t\n\tthis.rangeStart=(argsArr.length>=7&&typeof argsArr[6]!=\"undefined\")?parseInt(argsArr[6]):1; //slider range\n\tthis.rangeEnd=(argsArr.length>=8&&typeof argsArr[7]!=\"undefined\")?parseInt(argsArr[7]):20; //slider range\n\t\n\tthis.handleColor=bgcolor;\n\tthis.cornerRoundness=roundness;\n\t\n\t//default size\n\tvar default_height = 50;\n\tvar default_width = 300;\n\t\n\t//default handle dimensions\n\tvar handle = null; //dom node will go here...\n\tvar handleHeight = \"80%\";\n\tvar handleWidth = \"10%\";\t\t\t\n\t\t\t\n\t//used for determining the slider boundries.\n\tvar minX = 0;\n\tvar maxX = 0;\n\tvar minY = 0;\n\tvar maxY = 0;\n\t\n\t//initialize onchange\n\tvar on_change_value = 0;\t\n\t\n\tthis.inlet1 = new this.inletClass(\"inlet1\",this,\"\\\"set\\\" sets & positions slider\");\t\t\n\tthis.outlet1 = new this.outletClass(\"outlet1\",this,\"slider value during slide\");\n\tthis.outlet2 = new this.outletClass(\"outlet2\",this,\"slider value after slide\");\t\n\t\n\tthis.setInspectorConfig([\n\t\t{name:\"handleColor\",value:thisPtr.handleColor,label:\"Handle Color\",type:\"text\",input:\"text\"},\n\t\t{name:\"cornerRoundness\",value:thisPtr.cornerRoundness,label:\"% Corner Roundness\",type:\"number\",input:\"text\"},\n\t\t{name:\"orientation\",value:thisPtr.orientation,label:\"Orientation\",type:\"string\",options:[{label:\"Vertical\",value:\"vertical\"},{label:\"Horizontal\",value:\"horizontal\"}],input:\"radio\"},\n\t\t{name:\"rangeStart\",value:thisPtr.rangeStart,label:\"Range Start\",type:\"number\",input:\"text\"},\n\t\t{name:\"rangeEnd\",value:thisPtr.rangeEnd,label:\"Range End\",type:\"number\",input:\"text\"}\t\t\t\n\t]);\t\n\t\n\t//save the values returned by the inspector- returned in form {valueName:value...}\n\t//called after the inspector window is saved\n\tthis.saveInspectorValues=function(vals) {\n\t\t\n\t\t//update the local properties\n\t\tfor(var x in vals)\n\t\t\tthisPtr[x]=vals[x];\n\t\t\t\n\t\t//update the arg str\n\t\tthis.args=vals[\"handleColor\"]+\" \"+vals[\"cornerRoundness\"]+\" \"+vals[\"orientation\"]+\" \"+vals[\"rangeStart\"]+\" \"+vals[\"rangeEnd\"];\n\n\t\thandle.style.background=vals[\"handleColor\"];\n\t\thandle.style.MozBorderRadius=vals[\"cornerRoundness\"]+\"%\";\n\t\t\n\t\tthisPtr.init();\n\t\t\t\n\t}\n\t\t\n\t//custom html\n\tvar slider_html = \"<div style=\\\"border:0px #000000 solid;width:\"+default_width+\"px;height:\"+default_height+\"px\\\" id=\\\"\"+ this.createElID(\"slider\") +\"\\\">\"+\n\t\"<div id=\\\"\"+ this.createElID(\"sliderHandle\") +\"\\\" style=\\\"-moz-border-radius:\"+roundness+\"%;position:relative;height:\"+handleHeight+\";width:\"+handleWidth+\";background:\"+bgcolor+\"\\\"></div>\" +\n\t\"</div>\";\n\t\t\n\tthis.ui=new LilyObjectView(this,slider_html);\n\tthis.ui.draw();\n\t\n\tthis.resizeElement=this.ui.getElByID(this.createElID(\"slider\"));\n\tthis.displayElement=this.ui.getElByID(this.createElID(\"slider\"));\n\t\n\t//set up some handle dimnensions \n\thandle = this.ui.getElByID(this.createElID(\"sliderHandle\"));\n\tvar handleOffset = (this.orientation == \"vertical\")?Math.ceil(this.height*.10):Math.ceil(this.width*.10);\n\tvar horizOffset = (this.orientation == \"vertical\")?0:(parseInt(thisPtr.width/2)-parseInt(handleOffset/2));\t\t\t\n\t\n\tthis.controller.objResizeControl.cb=function() {\n\t\tthisPtr.init();\n\t}\n\t\n\t//calculate the boundries\n\tfunction setBounds() {\n\t\tminX = 0;\n\t\tminY = 0;\n\t\tmaxX = parseInt(thisPtr.width);\n\t\tmaxY = parseInt(thisPtr.height);\n\t}\n\t\n\tfunction handleMouseMove(e) {\n\t\t\t\t\t\n\t\tif(thisPtr.orientation == \"vertical\") {\n\t\t\tvar val = (parseInt(e.clientY)-parseInt(thisPtr.top))-parseInt(handleOffset);\n\t\t\tif(val<=0) {\n\t\t\t\thandle.style.top = (0)+\"px\";\t\n\t\t\t} else if(val+handleOffset>=maxY) {\n\t\t\t\thandle.style.top = (maxY-handleOffset)+\"px\";\n\t\t\t} else {\n\t\t\t\thandle.style.top = val+\"px\";\n\t\t\t}\n\t\t\tdoOutput(val);\n\t\t} else {\n\t\t\tvar val = (parseInt(e.clientX)-parseInt(thisPtr.left))-parseInt(handleOffset);\n\t\t\tif(val<=0) {\n\t\t\t\thandle.style.left = (0-horizOffset)+\"px\";\t\n\t\t\t} else if(val+handleOffset>=maxX) {\n\t\t\t\thandle.style.left = (maxX-handleOffset-horizOffset)+\"px\";\n\t\t\t} else {\n\t\t\t\thandle.style.left = (val-horizOffset)+\"px\";\n\t\t\t}\n\t\t\tdoOutput(val); \n\t\t}\n\t\t\n\t\ton_change_value = val;\n\t\t\n\t}\n\t\n\tfunction handleMouseUpFunc(e) {\n\t\tthisPtr.controller.patchController.removePatchObserver(thisPtr.createElID(\"slider\"),\"mouseup\",handleMouseUpFunc,\"performance\");\t\t\n\t\tthisPtr.controller.patchController.removePatchObserver(thisPtr.createElID(\"slider\"),\"mousemove\",handleMouseMove,\"performance\");\t\t\t\n\t\tdoOutputOnComplete(on_change_value);\n\t}\n\t\n\tfunction handleMouseDownFunc(e) {\n\t\tsetBounds();\n\t\thandleMouseMove(e);\n\t\tthisPtr.controller.patchController.attachPatchObserver(thisPtr.createElID(\"slider\"),\"mouseup\",handleMouseUpFunc,\"performance\");\n\t\tthisPtr.controller.patchController.attachPatchObserver(thisPtr.createElID(\"slider\"),\"mousemove\",handleMouseMove,\"performance\");\n\t}\n\t\n\tfunction setValue(val) {\n\t\t\n\t\tvar orgMax = (thisPtr.orientation == \"vertical\")?parseInt(thisPtr.height):parseInt(thisPtr.width);\t\t\n\t\tif(thisPtr.orientation == \"vertical\") {\t\t\t\n\t\t\tvar tmp = parseInt(LilyUtils.map(thisPtr.rangeStart,thisPtr.rangeEnd,0,orgMax-handleOffset,val));\t\t\t\t\n\t\t\tif(tmp<=0) {\n\t\t\t\thandle.style.top = (0)+\"px\";\n\t\t\t\tthisPtr.outlet2.doOutlet(0);\t\t\t\t\t\n\t\t\t} else if(tmp+handleOffset>=maxY) {\n\t\t\t\thandle.style.top = (maxY-handleOffset)+\"px\";\n\t\t\t\tthisPtr.outlet2.doOutlet(thisPtr.rangeEnd);\t\t\t\t\n\t\t\t} else {\n\t\t\t\thandle.style.top = (tmp)+\"px\";\n\t\t\t\tthisPtr.outlet2.doOutlet(parseInt(val));\t\t\t\t\n\t\t\t}\t\t\t\n\t\t} else {\n\t\t\tvar tmp = parseInt(LilyUtils.map(thisPtr.rangeStart,thisPtr.rangeEnd,0,orgMax-handleOffset,val));\t\n\t\t\tif(tmp<=0) {\n\t\t\t\thandle.style.left = (0-horizOffset)+\"px\";\n\t\t\t\tthisPtr.outlet2.doOutlet(0);\t\t\t\t\t\n\t\t\t} else if(tmp+handleOffset>=maxX) {\n\t\t\t\thandle.style.left = (maxX-handleOffset-horizOffset)+\"px\";\n\t\t\t\tthisPtr.outlet2.doOutlet(thisPtr.rangeEnd);\t\t\t\t\n\t\t\t} else {\n\t\t\t\thandle.style.left = (tmp-horizOffset)+\"px\";\n\t\t\t\tthisPtr.outlet2.doOutlet(parseInt(val));\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\tfunction doOutput(val) {\t\t\n\t\tvar orgMax = (thisPtr.orientation == \"vertical\")?parseInt(thisPtr.height):parseInt(thisPtr.width);\n\t\tvar tmp = LilyUtils.map(0,orgMax-handleOffset,thisPtr.rangeStart,thisPtr.rangeEnd,val);\n\t\tthisPtr.outlet1.doOutlet(parseInt(tmp));\n\t}\n\t\n\tfunction doOutputOnComplete(val) {\t\t\n\t\tvar orgMax = (thisPtr.orientation == \"vertical\")?parseInt(thisPtr.height):parseInt(thisPtr.width);\n\t\tvar tmp = LilyUtils.map(0,orgMax-handleOffset,thisPtr.rangeStart,thisPtr.rangeEnd,val);\n\t\tthisPtr.outlet2.doOutlet(parseInt(tmp));\n\t}\n\t\n\tfunction calculateHandleHeight() {\n\t\tif(thisPtr.height) {\n\t\t\tif(thisPtr.orientation == \"vertical\") {\n\t\t\t\tvar total_height = Math.ceil(thisPtr.height*.10);\n\t\t\t} else {\n\t\t\t\tvar total_height = Math.ceil(thisPtr.height*.80);\n\t\t\t}\n\t\t\tvar actual_height = total_height - (thisPtr.borderWidth*2);\n\t\t\tvar height_as_percent = parseInt(actual_height/thisPtr.height*100);\t\n\t\t\treturn height_as_percent+\"%\";\t\t\t\n\t\t}\n\t\treturn \"80%\"; //default\t\t\n\t}\n\t\n\tfunction calculateHandleWidth() {\n\t\tif(thisPtr.width) {\n\t\t\tif(thisPtr.orientation == \"vertical\") {\n\t\t\t\tvar total_width = Math.ceil(thisPtr.width*.80);\n\t\t\t} else {\n\t\t\t\tvar total_width = Math.ceil(thisPtr.width*.10);\n\t\t\t}\n\t\t\tvar actual_width = total_width - (thisPtr.borderWidth*2);\n\t\t\tvar width_as_percent = parseInt(actual_width/thisPtr.width*100);\t\t\t\n\t\t\treturn width_as_percent+\"%\";\n\t\t}\n\t\treturn \"10%\"; //default\t\t\t\t\n\t}\t\n\t\t\t\n\t//init\n\tthis.init=function() {\n\t\t\n\t\t//handle dimensions\n\t\thandleHeight = calculateHandleHeight();\n\t\thandleWidth = calculateHandleWidth();\n\t\t\n\t\tvar height = thisPtr.height||50;\n\t\tvar width = thisPtr.width||300;\t\t\n\t\t\n\t\thandleOffset = (thisPtr.orientation == \"vertical\")?Math.ceil(height*.10):Math.ceil(width*.10);\n\t\thorizOffset = (thisPtr.orientation == \"vertical\")?0:(parseInt(width/2)-parseInt(handleOffset/2));\n\t\tsetBounds();\n\n\t\tif(thisPtr.orientation == \"vertical\") {\n\t\t\thandle.style.top = \"0px\";\n\t\t\thandle.style.left = \"0px\";\t\t\t\n\t\t} else {\n\t\t\thandle.style.left = (0-horizOffset) + \"px\";\n\t\t\thandle.style.top = \"10%\";\t\t\t\n\t\t}\n\t\t\n\t\thandle.style.height = handleHeight;\n\t\thandle.style.width = handleWidth;\t\t\n\t\t\t\t\t\n\t}\n\t\n\tthis.inlet1[\"set\"]=function(num) {\n\t\tsetValue(parseInt(num));\n\t}\n\t\n\tthis.inlet1[\"num\"]=function(num) {\n\t\tsetValue(parseInt(num));\n\t}\t\n\t\n\tthis.controller.setNoBorders(true);\t\n\tthis.controller.attachObserver(this.createElID(\"slider\"),\"mousedown\",handleMouseDownFunc,\"performance\");\n\tthis.controller.attachObserver(this.createElID(\"slider\"),\"mouseup\",handleMouseUpFunc,\"performance\");\t\t\n\n\treturn this;\n}", "title": "" }, { "docid": "214b341df9dd5f2c9778529664a4b22f", "score": "0.61599916", "text": "function initializePriceRangeSlider() {\n noUiSlider.create(priceRange, {\n start: [1, 1000],\n connect: true,\n range: {\n 'min': 1,\n 'max': 1000\n },\n // Display integer values in the slider handles and tooltips\n format: {\n to: value => Math.round(value), // Convert to integer\n from: value => value\n },\n tooltips: [true, true] // Display tooltips for both handles\n });\n\n priceRange.noUiSlider.on('update', (values, handle) => {\n valuePriceRange.textContent = `${Math.round(values[0])} - ${Math.round(values[1])}`;\n });\n}", "title": "" }, { "docid": "1d743db2ed8fab97d64bbb48962d5d26", "score": "0.60826063", "text": "function customRange() {\n const range = document.querySelector('#range');\n\n /*добавляем разметку для визуализации трека и ползунка*/\n range.insertAdjacentHTML('beforeend', '<div class=\"range__wrapper\"><div class=\"range__wrap-inner\"><div class=\"range__track\"></div><div class=\"range__progress\"></div></div><div class=\"range__handle\"></div></div>');\n /*добавляем разметку отображения значения value*/\n range.insertAdjacentHTML('beforeend', '<div class=\"range__value\">');\n\n /*================*/\n const rangeInput = document.querySelector(\".range__input\"),\n rangeInputMin = rangeInput.min,\n rangeInputMax = rangeInput.max,\n rangeMinMax = rangeInputMax - rangeInputMin; // это значение нужно, что бы корректно вычислять ширину progress и положение handle при input min отличном от 0.\n\n\n const rangeProgress = document.querySelector(\".range__progress\"),\n rangeHandle = document.querySelector(\".range__handle\"),\n output = document.querySelector('.range__value');\n output.innerHTML = rangeInput.value; //вывоим начальное значение value\n\n const widthRange = document.querySelector('.range__wrap-inner').offsetWidth; //узнать ширину range\n const widthHandle = document.querySelector('.range__handle').offsetWidth; // узнать ширину .range__handle\n\n rangeInput.style.opacity = '0'; // задать стандартному input \"opacity: 0;\"\n\n rangeProgress.style.width = ((rangeInput.value - rangeInputMin) / rangeMinMax) * widthRange + 'px'; // установить начальную ширину progress\n\n rangeHandle.style.left = (widthRange - (((rangeInput.value - rangeInputMin) / rangeMinMax) * widthRange) - (widthHandle / 2)) + 'px'; // установить начальную точку handle\n\n // Изменить ширину .range__progress и координату handle (каждый раз когда двигаетм ползунок) oninput/onchange\n let ua = window.navigator.userAgent,\n isIE = /MSIE|Trident/.test(ua);\n\n if (isIE) {\n rangeInput.onchange = function () {\n output.innerHTML = rangeInput.value;\n rangeProgress.style.width = ((1 - ((rangeInput.value - rangeInputMin) / rangeMinMax)) * widthRange) + 'px';\n rangeHandle.style.left = (((rangeInput.value - rangeInputMin) / rangeMinMax) * widthRange - (widthHandle / 2)) + 'px';\n };\n\n } else {\n rangeInput.oninput = function () {\n output.innerHTML = this.value;\n rangeProgress.style.width = (1 - ((this.value - rangeInputMin) / rangeMinMax)) * widthRange + 'px';\n rangeHandle.style.left = (((this.value - rangeInputMin) / rangeMinMax) * widthRange - (widthHandle / 2)) + 'px';\n };\n }\n}", "title": "" }, { "docid": "ec1c7bca2fdf17213ea88688afde408d", "score": "0.60698736", "text": "function update() {\n min = isAttrNum(slider.min) ? +slider.min : 0;\n max = isAttrNum(slider.max) ? +slider.max : 100;\n if (max < min)\n max = min > 100 ? min : 100;\n step = isAttrNum(slider.step) && slider.step > 0 ? +slider.step : 1;\n range = max - min;\n draw(true);\n }", "title": "" }, { "docid": "f40ed9f526a650bb8cf1756a2480ac78", "score": "0.60526717", "text": "get rangePicker() { return this._rangePicker; }", "title": "" }, { "docid": "f40ed9f526a650bb8cf1756a2480ac78", "score": "0.60526717", "text": "get rangePicker() { return this._rangePicker; }", "title": "" }, { "docid": "f40ed9f526a650bb8cf1756a2480ac78", "score": "0.60526717", "text": "get rangePicker() { return this._rangePicker; }", "title": "" }, { "docid": "f40ed9f526a650bb8cf1756a2480ac78", "score": "0.60526717", "text": "get rangePicker() { return this._rangePicker; }", "title": "" }, { "docid": "f40ed9f526a650bb8cf1756a2480ac78", "score": "0.60526717", "text": "get rangePicker() { return this._rangePicker; }", "title": "" }, { "docid": "7a8fb62420aa852750567fc1dc3c793f", "score": "0.6047976", "text": "function SliderController( $scope, $element, $attrs, $$rAF, $window, $mdAria, $mdUtil, $mdConstant ) {\n this.init = function init( ngModelCtrl ) {\n var thumb = angular.element( $element[ 0 ].querySelector( '.md-thumb' ) );\n var thumbText = angular.element( $element[ 0 ].querySelector( '.md-thumb-text' ) );\n var thumbContainer = thumb.parent();\n var trackContainer = angular.element( $element[ 0 ].querySelector( '.md-track-container' ) );\n var activeTrack = angular.element( $element[ 0 ].querySelector( '.md-track-fill' ) );\n var tickContainer = angular.element( $element[ 0 ].querySelector( '.md-track-ticks' ) );\n var throttledRefreshDimensions = $mdUtil.throttle( refreshSliderDimensions, 5000 );\n // Default values, overridable by $attrss\n $attrs.min ? $attrs.$observe( 'min', updateMin ) : updateMin( 0 );\n $attrs.max ? $attrs.$observe( 'max', updateMax ) : updateMax( 100 );\n $attrs.step ? $attrs.$observe( 'step', updateStep ) : updateStep( 1 );\n // We have to manually stop the $watch on ngDisabled because it exists\n // on the parent $scope, and won't be automatically destroyed when\n // the component is destroyed.\n var stopDisabledWatch = angular.noop;\n if ( $attrs.ngDisabled ) {\n stopDisabledWatch = $scope.$parent.$watch( $attrs.ngDisabled, updateAriaDisabled );\n }\n $mdAria.expect( $element, 'aria-label' );\n $element.attr( 'tabIndex', 0 );\n $element.attr( 'role', 'slider' );\n $element.on( 'keydown', keydownListener );\n var hammertime = new Hammer( $element[ 0 ], {\n recognizers: [\n [ Hammer.Pan, {\n direction: Hammer.DIRECTION_HORIZONTAL\n } ]\n ]\n } );\n hammertime.on( 'hammer.input', onInput );\n hammertime.on( 'panstart', onPanStart );\n hammertime.on( 'pan', onPan );\n hammertime.on( 'panend', onPanEnd );\n // On resize, recalculate the slider's dimensions and re-render\n function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }\n setTimeout( updateAll );\n var debouncedUpdateAll = $$rAF.debounce( updateAll );\n angular.element( $window ).on( 'resize', debouncedUpdateAll );\n $scope.$on( '$destroy', function() {\n angular.element( $window ).off( 'resize', debouncedUpdateAll );\n hammertime.destroy();\n stopDisabledWatch();\n } );\n ngModelCtrl.$render = ngModelRender;\n ngModelCtrl.$viewChangeListeners.push( ngModelRender );\n ngModelCtrl.$formatters.push( minMaxValidator );\n ngModelCtrl.$formatters.push( stepValidator );\n /**\n * Attributes\n */\n var min;\n var max;\n var step;\n\n function updateMin( value ) {\n min = parseFloat( value );\n $element.attr( 'aria-valuemin', value );\n updateAll();\n }\n\n function updateMax( value ) {\n max = parseFloat( value );\n $element.attr( 'aria-valuemax', value );\n updateAll();\n }\n\n function updateStep( value ) {\n step = parseFloat( value );\n redrawTicks();\n }\n\n function updateAriaDisabled( isDisabled ) {\n $element.attr( 'aria-disabled', !!isDisabled );\n }\n // Draw the ticks with canvas.\n // The alternative to drawing ticks with canvas is to draw one $element for each tick,\n // which could quickly become a performance bottleneck.\n var tickCanvas, tickCtx;\n\n function redrawTicks() {\n if ( !angular.isDefined( $attrs.mdDiscrete ) ) return;\n var numSteps = Math.floor( ( max - min ) / step );\n if ( !tickCanvas ) {\n tickCanvas = angular.element( '<canvas style=\"position:absolute;\">' );\n tickCtx = tickCanvas[ 0 ].getContext( '2d' );\n tickCtx.fillStyle = 'black';\n tickContainer.append( tickCanvas );\n }\n var dimensions = getSliderDimensions();\n tickCanvas[ 0 ].width = dimensions.width;\n tickCanvas[ 0 ].height = dimensions.height;\n var distance;\n for ( var i = 0; i <= numSteps; i++ ) {\n distance = Math.floor( dimensions.width * ( i / numSteps ) );\n tickCtx.fillRect( distance - 1, 0, 2, dimensions.height );\n }\n }\n /**\n * Refreshing Dimensions\n */\n var sliderDimensions = {};\n refreshSliderDimensions();\n\n function refreshSliderDimensions() {\n sliderDimensions = trackContainer[ 0 ].getBoundingClientRect();\n }\n\n function getSliderDimensions() {\n throttledRefreshDimensions();\n return sliderDimensions;\n }\n /**\n * left/right arrow listener\n */\n function keydownListener( ev ) {\n if ( $element[ 0 ].hasAttribute( 'disabled' ) ) {\n return;\n }\n var changeAmount;\n if ( ev.keyCode === $mdConstant.KEY_CODE.LEFT_ARROW ) {\n changeAmount = -step;\n } else if ( ev.keyCode === $mdConstant.KEY_CODE.RIGHT_ARROW ) {\n changeAmount = step;\n }\n if ( changeAmount ) {\n if ( ev.metaKey || ev.ctrlKey || ev.altKey ) {\n changeAmount *= 4;\n }\n ev.preventDefault();\n ev.stopPropagation();\n $scope.$evalAsync( function() {\n setModelValue( ngModelCtrl.$viewValue + changeAmount );\n } );\n }\n }\n /**\n * ngModel setters and validators\n */\n function setModelValue( value ) {\n ngModelCtrl.$setViewValue( minMaxValidator( stepValidator( value ) ) );\n }\n\n function ngModelRender() {\n if ( isNaN( ngModelCtrl.$viewValue ) ) {\n ngModelCtrl.$viewValue = ngModelCtrl.$modelValue;\n }\n var percent = ( ngModelCtrl.$viewValue - min ) / ( max - min );\n $scope.modelValue = ngModelCtrl.$viewValue;\n $element.attr( 'aria-valuenow', ngModelCtrl.$viewValue );\n setSliderPercent( percent );\n thumbText.text( ngModelCtrl.$viewValue );\n }\n\n function minMaxValidator( value ) {\n if ( angular.isNumber( value ) ) {\n return Math.max( min, Math.min( max, value ) );\n }\n }\n\n function stepValidator( value ) {\n if ( angular.isNumber( value ) ) {\n return Math.round( value / step ) * step;\n }\n }\n /**\n * @param percent 0-1\n */\n function setSliderPercent( percent ) {\n activeTrack.css( 'width', ( percent * 100 ) + '%' );\n thumbContainer.css( $mdConstant.CSS.TRANSFORM, 'translate3d(' + getSliderDimensions().width * percent + 'px,0,0)' );\n $element.toggleClass( 'md-min', percent === 0 );\n }\n /**\n * Slide listeners\n */\n var isSliding = false;\n var isDiscrete = angular.isDefined( $attrs.mdDiscrete );\n\n function onInput( ev ) {\n if ( !isSliding && ev.eventType === Hammer.INPUT_START && !$element[ 0 ].hasAttribute( 'disabled' ) ) {\n isSliding = true;\n $element.addClass( 'active' );\n $element[ 0 ].focus();\n refreshSliderDimensions();\n onPan( ev );\n ev.srcEvent.stopPropagation();\n } else if ( isSliding && ev.eventType === Hammer.INPUT_END ) {\n if ( isSliding && isDiscrete ) onPanEnd( ev );\n isSliding = false;\n $element.removeClass( 'panning active' );\n }\n }\n\n function onPanStart() {\n if ( !isSliding ) return;\n $element.addClass( 'panning' );\n }\n\n function onPan( ev ) {\n if ( !isSliding ) return;\n // While panning discrete, update only the\n // visual positioning but not the model value.\n if ( isDiscrete ) adjustThumbPosition( ev.center.x );\n else doSlide( ev.center.x );\n ev.preventDefault();\n ev.srcEvent.stopPropagation();\n }\n\n function onPanEnd( ev ) {\n if ( isDiscrete && !$element[ 0 ].hasAttribute( 'disabled' ) ) {\n // Convert exact to closest discrete value.\n // Slide animate the thumb... and then update the model value.\n var exactVal = percentToValue( positionToPercent( ev.center.x ) );\n var closestVal = minMaxValidator( stepValidator( exactVal ) );\n setSliderPercent( valueToPercent( closestVal ) );\n $$rAF( function() {\n setModelValue( closestVal );\n } );\n ev.preventDefault();\n ev.srcEvent.stopPropagation();\n }\n }\n /**\n * Expose for testing\n */\n this._onInput = onInput;\n this._onPanStart = onPanStart;\n this._onPan = onPan;\n /**\n * Slide the UI by changing the model value\n * @param x\n */\n function doSlide( x ) {\n $scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent( x ) ) );\n } );\n }\n /**\n * Slide the UI without changing the model (while dragging/panning)\n * @param x\n */\n function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ) );\n var closestVal = minMaxValidator( stepValidator( exactVal ) );\n setSliderPercent( positionToPercent( x ) );\n thumbText.text( closestVal );\n }\n /**\n * Convert horizontal position on slider to percentage value of offset from beginning...\n * @param x\n * @returns {number}\n */\n function positionToPercent( x ) {\n return Math.max( 0, Math.min( 1, ( x - sliderDimensions.left ) / ( sliderDimensions.width ) ) );\n }\n /**\n * Convert percentage offset on slide to equivalent model value\n * @param percent\n * @returns {*}\n */\n function percentToValue( percent ) {\n return ( min + percent * ( max - min ) );\n }\n\n function valueToPercent( val ) {\n return ( val - min ) / ( max - min );\n }\n };\n }", "title": "" }, { "docid": "6e14d6dec48064680565390bf20df6af", "score": "0.6034705", "text": "function range(bind, el, param, value) {\n value = value !== undefined ? value : (+param.max + +param.min) / 2;\n var min = param.min || Math.min(0, +value) || 0,\n max = param.max || Math.max(100, +value) || 100,\n step = param.step || (0, _d3Array.tickStep)(min, max, 100);\n var node = (0, _element.default)('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n var label = (0, _element.default)('label', {}, +value);\n el.appendChild(node);\n el.appendChild(label);\n\n function update() {\n label.textContent = node.value;\n bind.update(+node.value);\n } // subscribe to both input and change\n\n\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n bind.elements = [node];\n\n bind.set = function (value) {\n node.value = value;\n label.textContent = value;\n };\n}", "title": "" }, { "docid": "eb57902eca3b7cb3daba4ed07625ca51", "score": "0.60327125", "text": "_setRange({ min, max }) {\n const min2Scale = this._toPixelScale(min || 0);\n const max2Scale = this._toPixelScale(max || 0);\n const minBounds = this._toPixelScale(this.props.min);\n const maxBounds = this._toPixelScale(this.props.max);\n if (min2Scale > max2Scale) {\n throw new Error(`Minimum slider value: ${min} is greater than max value: ${max}`);\n }\n if (min2Scale < minBounds || min2Scale > maxBounds) {\n throw new Error(`Minimum slider value: ${min} exceeds bounds:\n ${this.props.min} - ${this.props.max}`);\n }\n if (max2Scale < minBounds || max2Scale > maxBounds) {\n throw new Error(`Maximum slider value: ${max} exceeds bounds:\n ${this.props.min} - ${this.props.max}`);\n }\n // tslint:disable-next-line:no-console\n console.log(`range => (${min2Scale}, ${max2Scale})`);\n this._range = {\n min: min2Scale,\n max: max2Scale,\n };\n return this._range;\n }", "title": "" }, { "docid": "e2cfdcf6b14aae1351e85c23d7e0f413", "score": "0.60105705", "text": "function changeSlider() {\n $(this).rangeslider(\"update\", true);\n buildFace();\n}", "title": "" }, { "docid": "2ff0ee238e6bd66c4da7174ab3d5097a", "score": "0.60080177", "text": "function YServo_set_range(newval)\n { var rest_val;\n rest_val = String(newval);\n return this._setAttr('range',rest_val);\n }", "title": "" }, { "docid": "f2dcbbab56679090002edf5d3a5e7143", "score": "0.5987151", "text": "onStart(data) {\n // fired then range slider is ready\n }", "title": "" }, { "docid": "1180627a5d73f3623d1109e1c6d1150d", "score": "0.59606814", "text": "function range(bind, el, param, value) {\n value = value !== undefined ? value : ((+param.max) + (+param.min)) / 2;\n\n var min = param.min || Math.min(0, +value) || 0,\n max = param.max || Math.max(100, +value) || 100,\n step = param.step || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_d3_array__[\"f\" /* tickStep */])(min, max, 100);\n\n var node = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__element__[\"a\" /* default */])('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n\n var label = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__element__[\"a\" /* default */])('label', {}, +value);\n\n el.appendChild(node);\n el.appendChild(label);\n\n function update() {\n label.textContent = node.value;\n bind.update(+node.value);\n }\n\n // subscribe to both input and change\n // signal updates halt redundant values, maintaining performance\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n\n bind.elements = [node];\n bind.set = function(value) {\n node.value = value;\n label.textContent = value;\n };\n}", "title": "" }, { "docid": "e31ce55b0f1eda640215568cb8618d5e", "score": "0.5953594", "text": "isRange() {\n return __awaiter(this, void 0, void 0, function* () {\n return (yield (yield this.host()).hasClass('mdc-slider--range'));\n });\n }", "title": "" }, { "docid": "f275e1a227fbde9c82ece5e6e1fe44e4", "score": "0.59507203", "text": "function range(bind, el, param, value) {\n value = value !== undefined ? value : (+param.max + +param.min) / 2;\n const max = param.max != null ? param.max : Math.max(100, +value) || 100, min = param.min || Math.min(0, max, +value) || 0, step = param.step || d3Array.tickStep(min, max, 100);\n const node = element('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n const span = element('span', {}, +value);\n el.appendChild(node);\n el.appendChild(span);\n const update = () => {\n span.textContent = node.value;\n bind.update(+node.value);\n };\n // subscribe to both input and change\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n bind.elements = [node];\n bind.set = value => {\n node.value = value;\n span.textContent = value;\n };\n }", "title": "" }, { "docid": "d9fb897954225efa8635f6f4c55e9dd9", "score": "0.59453535", "text": "function rangeSlider(value) {\n\tbpmValue.innerHTML = value;\n}", "title": "" }, { "docid": "be3103aa76830a05ac8bdcada93f98d8", "score": "0.59178364", "text": "function range(bind, el, param, value) {\n value = value !== undefined ? value : ((+param.max) + (+param.min)) / 2;\n\n var min = param.min || Math.min(0, +value) || 0,\n max = param.max || Math.max(100, +value) || 100,\n step = param.step || Object(__WEBPACK_IMPORTED_MODULE_2_d3_array__[\"r\" /* tickStep */])(min, max, 100);\n\n var node = Object(__WEBPACK_IMPORTED_MODULE_0__element__[\"a\" /* default */])('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n\n var label = Object(__WEBPACK_IMPORTED_MODULE_0__element__[\"a\" /* default */])('label', {}, +value);\n\n el.appendChild(node);\n el.appendChild(label);\n\n function update() {\n label.textContent = node.value;\n bind.update(+node.value);\n }\n\n // subscribe to both input and change\n // signal updates halt redundant values, maintaining performance\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n\n bind.elements = [node];\n bind.set = function(value) {\n node.value = value;\n label.textContent = value;\n };\n}", "title": "" }, { "docid": "fdc1e230ab9f676a87d9851c5b701666", "score": "0.5915899", "text": "function modifyslider(Inslider,slider_value){\n\n console.log(\"In modifyslider Function\");\n\n var unit = Inslider.getAttribute('unit'),\n id = Inslider.getAttribute('id'),\n a = angular.element(document.getElementById(id));\n\n if(unit == 'kg'){\n var slider = range1.data(\"ionRangeSlider\");\n \n slider.update({\n value: slider_value,\n from: slider_value\n });\n\n //code to change the value shown in box\n var change = document.getElementById(\"snf5342-widget-select-weight\");\n change.value = slider_value;\n }\n else if(unit == 'ft'){\n var slider = range.data(\"ionRangeSlider\");\n slider.update({\n value: slider_value,\n from: slider_value\n });\n\n\n //code to change the value shown in box\n var f1 = document.getElementById(\"snf5342-widget-select-height\");\n var i1 = document.getElementById(\"snf5342-widget-select-height-in\");\n console.log(f1);\n console.log(i1);\n\n var feet = Math.floor( slider_value / 12);\n var inch = Math.floor( slider_value % 12);\n console.log(\"feet\" + feet);\n console.log(\"inch\", inch);\n\n f1.value = feet;\n i1.value = inch;\n\n }\n else if(unit == 'cm'){\n var slider = range2.data(\"ionRangeSlider\");\n slider.update({\n value: slider_value,\n from: slider_value\n });\n\n //code to change the value shown in box\n var change = document.getElementById(\"snf5342-widget-select-height-cm\");\n change.value = (slider_value)+'-'+(slider_value+1);\n }\n else if(unit == 'lb'){\n var slider = range3.data(\"ionRangeSlider\");\n slider.update({\n value: slider_value,\n from: slider_value\n });\n\n //code to change the value shown in box\n var change = document.getElementById(\"snf5342-widget-select-weight-lb\");\n change.value = (slider_value)+'-'+(slider_value+1);\n }\n\n a.scope().update(slider_value, unit);\n\n}", "title": "" }, { "docid": "e881d57739f6c06cf125ba0056349a56", "score": "0.5907393", "text": "function updateRange(ui, rangeInfo) {\n if (ui.values[1] - ui.values[0] >= 2) {\n $('#slider-range').slider(\"enable\");\n setStartEndIndex(ui.values[0], ui.values[1]);\n rangeInfo.html(toKm(g_data['kmstart']) + \" - \" + toKm(g_data['kmend']));\n $('#search-input .rangekm').html(toKm(g_data['kmstart']) + ' - ' + toKm(g_data['kmend']));\n }\n\n}", "title": "" }, { "docid": "9af4bbb996307ccfee88c9d166c10d11", "score": "0.58848697", "text": "range(){\n return this.max() - this.min()\n }", "title": "" }, { "docid": "40c4f700c4a830390e7d1a186f533932", "score": "0.58803016", "text": "function adjustSliderImmediately() {\n $('input[type=\"range\"]').rangeslider('update', true);\n }", "title": "" }, { "docid": "da196a1bf2b92e70f816a8780e8f2ca3", "score": "0.5874678", "text": "function range(bind, el, param, value) {\n value = value !== undefined ? value : (+param.max + +param.min) / 2;\n\n var min = param.min || Math.min(0, +value) || 0,\n max = param.max || Math.max(100, +value) || 100,\n step = param.step || (0, _d3Array.tickStep)(min, max, 100);\n\n var node = (0, _element2.default)('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n\n var label = (0, _element2.default)('label', {}, +value);\n\n el.appendChild(node);\n el.appendChild(label);\n\n function update() {\n label.textContent = node.value;\n bind.update(+node.value);\n }\n\n // subscribe to both input and change\n // signal updates halt redundant values, maintaining performance\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n\n bind.elements = [node];\n bind.set = function (value) {\n node.value = value;\n label.textContent = value;\n };\n}", "title": "" }, { "docid": "24253fbe94f4819e76c2dd41cf32d425", "score": "0.5864938", "text": "function getSliderRange(rangeId){\n\t\tvar rangeElement = document.getElementsByClassName('range'+rangeId+\" multirange original\")[0];\n\t\treturn {min:rangeElement.valueLow, max:rangeElement.valueHigh};\n\t}", "title": "" }, { "docid": "e7319d8e9935752b344e7259df3fd32e", "score": "0.58625376", "text": "function rangeSlider(elem, options) {\n\toptions = $.extend({ initial : 0 }, options || {});\n\toptions.initial = Math.min(1.0, Math.max(0, options.initial));\n\t\n\tvar $elem = $(elem);\n\tvar $handle = $('<span></span>').css({ position: 'absolute', left: 0, cursor: 'ew-resize' });\n\tvar $root = $(document.documentElement);\n\tvar $doc = $(document);\t\n\tvar lastRatio = options.initial;\n\n\t/** Mousemove event handler to track the mouse and move the slider. Generates slider:pos events. */\n\tfunction track(e) {\n\t\tvar pos = $elem.offset().left;\n\t\tvar width = $elem.innerWidth();\n\t\tvar handleWidth = $handle.outerWidth(false);\n\t\tvar range = width - handleWidth;\n\t\tif (range <= 0) return;\n\t\tvar delta = Math.min(range, Math.max (0, e.pageX - pos - handleWidth / 2));\n\t\tlastRatio = delta / range;\n\t\t$handle.css('left', \"\" + (delta * 100 / width) + '%');\n\t\t$elem.trigger('slider:pos', { ratio: lastRatio, handle: $handle[0] });\n\t}\n\n\t/** Mouseup event handler to stop mouse tracking. */\n\tfunction end(e) {\n\t\t$doc.off('mousemove', track);\n\t\t$doc.off('mouseup', end);\n\t\t$root.removeClass('no-select');\n\t}\n\n /** Snaps the slider to the given ratio and generates a slider:pos event with the new ratio. */\n\tfunction setTo(ratio) {\n\t\tvar w = $elem.innerWidth();\n\t\tif (w <= 0 || $elem.is(':hidden')) return;\n\t\tlastRatio = Math.min( 1.0, Math.max(0, ratio));\n\t\t$handle.css('left', \"\" + Math.max(0, 100 * (lastRatio * (w - $handle.outerWidth(false))) / w) + '%');\n\t\t$elem.trigger('slider:pos', { ratio: lastRatio, handle: $handle[0] });\n\t}\n\t\n\t/**\n\t * Moves the slider to the given ratio, clipped to [0..1], in duration milliseconds.\n\t * Generates slider:pos events during the animation. If duration <= 30, same as setTo.\n\t * Default duration is 500ms. If a callback is given, it's called once the animation\n\t * has completed.\n\t */\n\tfunction moveTo(ratio, duration, callback) {\n\t\tratio = Math.min(1.0, Math.max(0, ratio));\n\t\tif (ratio === lastRatio) {\n\t\t\tif (typeof callback == 'function') callback();\n\t\t\treturn;\n\t\t}\n\t\tif (typeof duration == 'undefined') duration = 500;\n\t\tif (duration <= 30) {\n\t\t\t // Cinema is 24 or 48 frames/sec, so 20-40ms per frame. Makes no sense to animate for such a short duration.\n\t\t\tsetTo(ratio);\n\t\t\tif (typeof callback == 'function') callback();\n\t\t} else {\n\t\t\tvar target = ratio * ($elem.innerWidth() - $handle.outerWidth(false));\n\t\t\tif (ratio > lastRatio) target--; else target++;\n\t\t\t$handle.stop().animate({left: target},\n\t\t\t\t{ 'duration' : duration,\n\t\t\t\t 'step' : function() {\n\t\t\t\t\t\tlastRatio = Math.min(1.0, Math.max(0, $handle.position().left / ($elem.innerWidth() - $handle.outerWidth(false))));\n\t\t\t\t\t\t$elem.trigger('slider:pos', { ratio : lastRatio, handle : $handle[0] });\n\t\t\t\t\t},\n\t\t\t\t 'complete' : function() { setTo(ratio); if (typeof callback == 'function') callback(); } // Ensure we have again a % value\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n\t\n\t/**\n\t * As moveTo, but determines an appropriate duration in the range [0..maxDuration] on its own,\n\t * depending on the distance the handle would move. If no maxDuration is given it defaults\n\t * to 1500ms.\n\t */\n\tfunction moveAuto(ratio, maxDuration, callback) {\n\t\tif (typeof maxDuration == 'undefined') maxDuration = 1500;\n\t\tvar delta = ratio - lastRatio;\n\t\tif (delta < 0) delta = -delta;\n\t\tvar speed = $elem.innerWidth() * delta * 2;\n\t\tif (speed > maxDuration) speed = maxDuration;\n\t\tmoveTo(ratio, speed, callback);\n\t}\n\n\t/** Returns the current ratio. */\n\tfunction getValue() {\n\t\treturn lastRatio;\n\t}\n\n\t$elem.append($handle);\n\tif (options.handleClass) {\n\t\t$handle.addClass(options.handleClass);\n\t} else { // Provide a default style so that it is at least visible\n\t\t$handle.css({ width: '10px', height: '10px', background: 'white', border: '1px solid black' });\n\t}\n\tif (options.initial) setTo(options.initial);\n\n\t/** Install mousedown handler to start mouse tracking. */\n\t$handle.on('mousedown', function(e) {\n\t\t$root.addClass('no-select');\n\t\t$doc.on('mousemove', track);\n\t\t$doc.on('mouseup', end);\n\t\te.stopPropagation();\n\t\te.preventDefault();\n\t});\n\n\treturn { setRatio: setTo, moveRatio: moveTo, 'moveAuto': moveAuto, getRatio: getValue, handle: $handle[0] };\n}", "title": "" }, { "docid": "de773bf4c959bd8238dabb5252727383", "score": "0.5861059", "text": "get rangeSliderSelected() {\n return this.rangeSlider.isMovable;\n }", "title": "" }, { "docid": "ccb9be6e4f9d041869c9a0de00520897", "score": "0.5861025", "text": "function rangeCustomV2() {\n const rangeAll = document.querySelectorAll('[data-range-v2]');\n\n rangeAll.forEach(item => {\n /*добавляем разметку для визуализации трека и ползунка*/\n item.insertAdjacentHTML('beforeend', '<div class=\"range-v2__wrapper\"><div class=\"range-v2__wrap-inner\"><div class=\"range-v2__track\"></div><div class=\"range-v2__progress\"></div></div><div class=\"range-v2__handle\"></div></div>');\n /*добавляем разметку отображения значения value*/\n item.insertAdjacentHTML('beforeend', '<div class=\"range-v2__value\">');\n\n /*================*/\n const rangeInput = item.querySelector(\".range-v2__input\"),\n rangeInputMin = rangeInput.min,\n rangeInputMax = rangeInput.max,\n rangeMinMax = rangeInputMax - rangeInputMin; // это значение нужно, что бы корректно вычислять ширину progress и положение handle при input min отличном от 0.\n\n\n const rangeProgress = item.querySelector(\".range-v2__progress\"),\n rangeHandle = item.querySelector(\".range-v2__handle\"),\n output = item.querySelector('.range-v2__value');\n\n output.innerHTML = rangeInput.value; //вывоим начальное значение value\n\n const widthRange = item.querySelector('.range-v2__wrap-inner').offsetWidth; //узнать ширину range\n const widthHandle = item.querySelector('.range-v2__handle').offsetWidth; // узнать ширину .range__handle\n\n rangeInput.style.opacity = '0'; // задать стандартному input \"opacity: 0;\"\n\n rangeProgress.style.width = ((rangeInput.value - rangeInputMin) / rangeMinMax) * widthRange + 'px'; // установить начальную ширину progress\n\n rangeHandle.style.left = (widthRange - (((rangeInput.value - rangeInputMin) / rangeMinMax) * widthRange) - (widthHandle / 2)) + 'px'; // установить начальную точку handle\n\n // Изменить ширину .range__progress и координату handle (каждый раз когда двигаем ползунок) oninput/onchange\n rangeInput.oninput = function () {\n output.innerHTML = this.value;\n rangeProgress.style.width = (1 - ((this.value - rangeInputMin) / rangeMinMax)) * widthRange + 'px'; //установить ширину rangeProgress\n rangeHandle.style.left = (((this.value - rangeInputMin) / rangeMinMax) * widthRange - (widthHandle / 2)) + 'px'; //установить left для rangeHandle\n };\n });\n}", "title": "" }, { "docid": "001ac8c4a4dd105466cf02c86dcb194f", "score": "0.58482796", "text": "function SliderController($scope, $element, $attrs, $$rAF, $window, $mdAria, $mdUtil, $mdConstant) {\n\n this.init = function init(ngModelCtrl) {\n var thumb = angular.element($element[0].querySelector('.md-thumb'));\n var thumbText = angular.element($element[0].querySelector('.md-thumb-text'));\n var thumbContainer = thumb.parent();\n var trackContainer = angular.element($element[0].querySelector('.md-track-container'));\n var activeTrack = angular.element($element[0].querySelector('.md-track-fill'));\n var tickContainer = angular.element($element[0].querySelector('.md-track-ticks'));\n var throttledRefreshDimensions = $mdUtil.throttle(refreshSliderDimensions, 5000);\n\n // Default values, overridable by $attrss\n $attrs.min ? $attrs.$observe('min', updateMin) : updateMin(0);\n $attrs.max ? $attrs.$observe('max', updateMax) : updateMax(100);\n $attrs.step ? $attrs.$observe('step', updateStep) : updateStep(1);\n\n // We have to manually stop the $watch on ngDisabled because it exists\n // on the parent $scope, and won't be automatically destroyed when\n // the component is destroyed.\n var stopDisabledWatch = angular.noop;\n if ($attrs.ngDisabled) {\n stopDisabledWatch = $scope.$parent.$watch($attrs.ngDisabled, updateAriaDisabled);\n }\n\n $mdAria.expect($element, 'aria-label');\n\n $element.attr('tabIndex', 0);\n $element.attr('role', 'slider');\n $element.on('keydown', keydownListener);\n\n var hammertime = new Hammer($element[0], {\n recognizers: [\n [Hammer.Pan, { direction: Hammer.DIRECTION_HORIZONTAL }]\n ]\n });\n hammertime.on('hammer.input', onInput);\n hammertime.on('panstart', onPanStart);\n hammertime.on('pan', onPan);\n hammertime.on('panend', onPanEnd);\n\n // On resize, recalculate the slider's dimensions and re-render\n function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }\n setTimeout(updateAll);\n\n var debouncedUpdateAll = $$rAF.debounce(updateAll);\n angular.element($window).on('resize', debouncedUpdateAll);\n\n $scope.$on('$destroy', function() {\n angular.element($window).off('resize', debouncedUpdateAll);\n hammertime.destroy();\n stopDisabledWatch();\n });\n\n ngModelCtrl.$render = ngModelRender;\n ngModelCtrl.$viewChangeListeners.push(ngModelRender);\n ngModelCtrl.$formatters.push(minMaxValidator);\n ngModelCtrl.$formatters.push(stepValidator);\n\n /**\n * Attributes\n */\n var min;\n var max;\n var step;\n function updateMin(value) {\n min = parseFloat(value);\n $element.attr('aria-valuemin', value);\n updateAll();\n }\n function updateMax(value) {\n max = parseFloat(value);\n $element.attr('aria-valuemax', value);\n updateAll();\n }\n function updateStep(value) {\n step = parseFloat(value);\n redrawTicks();\n }\n function updateAriaDisabled(isDisabled) {\n $element.attr('aria-disabled', !!isDisabled);\n }\n\n // Draw the ticks with canvas.\n // The alternative to drawing ticks with canvas is to draw one $element for each tick,\n // which could quickly become a performance bottleneck.\n var tickCanvas, tickCtx;\n function redrawTicks() {\n if (!angular.isDefined($attrs.mdDiscrete)) return;\n\n var numSteps = Math.floor( (max - min) / step );\n if (!tickCanvas) {\n tickCanvas = angular.element('<canvas style=\"position:absolute;\">');\n tickCtx = tickCanvas[0].getContext('2d');\n tickCtx.fillStyle = 'black';\n tickContainer.append(tickCanvas);\n }\n var dimensions = getSliderDimensions();\n tickCanvas[0].width = dimensions.width;\n tickCanvas[0].height = dimensions.height;\n\n var distance;\n for (var i = 0; i <= numSteps; i++) {\n distance = Math.floor(dimensions.width * (i / numSteps));\n tickCtx.fillRect(distance - 1, 0, 2, dimensions.height);\n }\n }\n\n\n /**\n * Refreshing Dimensions\n */\n var sliderDimensions = {};\n refreshSliderDimensions();\n function refreshSliderDimensions() {\n sliderDimensions = trackContainer[0].getBoundingClientRect();\n }\n function getSliderDimensions() {\n throttledRefreshDimensions();\n return sliderDimensions;\n }\n\n /**\n * left/right arrow listener\n */\n function keydownListener(ev) {\n if($element[0].hasAttribute('disabled')) {\n return;\n }\n\n var changeAmount;\n if (ev.keyCode === $mdConstant.KEY_CODE.LEFT_ARROW) {\n changeAmount = -step;\n } else if (ev.keyCode === $mdConstant.KEY_CODE.RIGHT_ARROW) {\n changeAmount = step;\n }\n if (changeAmount) {\n if (ev.metaKey || ev.ctrlKey || ev.altKey) {\n changeAmount *= 4;\n }\n ev.preventDefault();\n ev.stopPropagation();\n $scope.$evalAsync(function() {\n setModelValue(ngModelCtrl.$viewValue + changeAmount);\n });\n }\n }\n\n /**\n * ngModel setters and validators\n */\n function setModelValue(value) {\n ngModelCtrl.$setViewValue( minMaxValidator(stepValidator(value)) );\n }\n function ngModelRender() {\n\n if (isNaN(ngModelCtrl.$viewValue)) {\n ngModelCtrl.$viewValue = ngModelCtrl.$modelValue;\n }\n\n var percent = (ngModelCtrl.$viewValue - min) / (max - min);\n $scope.modelValue = ngModelCtrl.$viewValue;\n $element.attr('aria-valuenow', ngModelCtrl.$viewValue);\n setSliderPercent(percent);\n thumbText.text( ngModelCtrl.$viewValue );\n }\n\n function minMaxValidator(value) {\n if (angular.isNumber(value)) {\n return Math.max(min, Math.min(max, value));\n }\n }\n function stepValidator(value) {\n if (angular.isNumber(value)) {\n return Math.round(value / step) * step;\n }\n }\n\n /**\n * @param percent 0-1\n */\n function setSliderPercent(percent) {\n activeTrack.css('width', (percent * 100) + '%');\n thumbContainer.css(\n $mdConstant.CSS.TRANSFORM,\n 'translate3d(' + getSliderDimensions().width * percent + 'px,0,0)'\n );\n $element.toggleClass('md-min', percent === 0);\n }\n\n\n /**\n * Slide listeners\n */\n var isSliding = false;\n var isDiscrete = angular.isDefined($attrs.mdDiscrete);\n\n function onInput(ev) {\n if (!isSliding && ev.eventType === Hammer.INPUT_START &&\n !$element[0].hasAttribute('disabled')) {\n\n isSliding = true;\n\n $element.addClass('active');\n $element[0].focus();\n refreshSliderDimensions();\n\n onPan(ev);\n\n ev.srcEvent.stopPropagation();\n\n } else if (isSliding && ev.eventType === Hammer.INPUT_END) {\n\n if ( isSliding && isDiscrete ) onPanEnd(ev);\n isSliding = false;\n\n $element.removeClass('panning active');\n }\n }\n function onPanStart() {\n if (!isSliding) return;\n $element.addClass('panning');\n }\n function onPan(ev) {\n if (!isSliding) return;\n\n // While panning discrete, update only the\n // visual positioning but not the model value.\n\n if ( isDiscrete ) adjustThumbPosition( ev.center.x );\n else doSlide( ev.center.x );\n\n ev.preventDefault();\n ev.srcEvent.stopPropagation();\n }\n\n function onPanEnd(ev) {\n if ( isDiscrete && !$element[0].hasAttribute('disabled') ) {\n // Convert exact to closest discrete value.\n // Slide animate the thumb... and then update the model value.\n\n var exactVal = percentToValue( positionToPercent( ev.center.x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n\n setSliderPercent( valueToPercent(closestVal));\n $$rAF(function(){\n setModelValue( closestVal );\n });\n\n ev.preventDefault();\n ev.srcEvent.stopPropagation();\n }\n }\n\n /**\n * Expose for testing\n */\n this._onInput = onInput;\n this._onPanStart = onPanStart;\n this._onPan = onPan;\n\n /**\n * Slide the UI by changing the model value\n * @param x\n */\n function doSlide( x ) {\n $scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent(x) ));\n });\n }\n\n /**\n * Slide the UI without changing the model (while dragging/panning)\n * @param x\n */\n function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }\n\n /**\n * Convert horizontal position on slider to percentage value of offset from beginning...\n * @param x\n * @returns {number}\n */\n function positionToPercent( x ) {\n return Math.max(0, Math.min(1, (x - sliderDimensions.left) / (sliderDimensions.width)));\n }\n\n /**\n * Convert percentage offset on slide to equivalent model value\n * @param percent\n * @returns {*}\n */\n function percentToValue( percent ) {\n return (min + percent * (max - min));\n }\n\n function valueToPercent( val ) {\n return (val - min)/(max - min);\n }\n\n };\n}", "title": "" }, { "docid": "e6e03a3676228d73d7adf07b144f27ac", "score": "0.5828774", "text": "function setRangePreco(min, max) {\n if (min <= preco_min) {\n preco_min = min;\n }\n preco_min = min;\n if (max >= preco_max) {\n preco_max = max;\n }\n var n_input = '<input type=\"text\" class=\"\" value=\"\" '\n n_input += ' data-slider-min=\"' + (preco_min - 5) + '\" ';\n n_input += ' data-slider-max=\"' + (preco_max + 50) + '\" ';\n n_input += ' data-slider-step=\"30\" ';\n n_input += ' data-slider-value=\"[' + (preco_min - 5) + ',' + (preco_max + 50) + ']\" ';\n n_input += ' id=\"range-preco\">';\n $('#p-range-preco').html(n_input);\n $('#range-preco').slider().on('slide', function (ev) {\n v_min = ev.value[0];\n v_max = ev.value[1];\n $('.item-box').each(function () {\n var preco = $(this).data('preco');\n //var id = $(this).data('id');\n if (preco >= v_min && preco <= v_max) {\n $(this).fadeIn();\n } else {\n $(this).fadeOut();\n }\n });\n });\n}", "title": "" }, { "docid": "f1def422a51b9a6c0a42d974e3104a54", "score": "0.58100563", "text": "function RangeFilter(property, min, max, step, label) {\n FilterControl.call(this, property)\n\n var createSlider = function() {\n var input = document.createElement('input')\n input.setAttribute('type', 'range')\n input.setAttribute('min', min)\n input.setAttribute('max', max)\n input.setAttribute('step', step)\n input.classList.add('range-filter-slider')\n return input\n }\n var createLabel = function(text) {\n var span = document.createElement('span')\n span.appendChild(new Text(text))\n span.classList.add('range-filter-label')\n return span\n }\n var createIndicator = function() {\n var span = document.createElement('span')\n span.classList.add('range-filter-indicator')\n return span\n }\n\n this.minSlider = createSlider()\n this.minSlider.value = min\n var minIndicator = createIndicator()\n this.maxSlider = createSlider()\n this.maxSlider.value = max\n var maxIndicator = createIndicator()\n\n var updateMinIndicator = function() {\n minIndicator.textContent = this.minSlider.value\n }\n var updateMaxIndicator = function() {\n maxIndicator.textContent = this.maxSlider.value\n }\n\n var self = this\n this.minSlider.onmousemove = function() { updateMinIndicator.apply(self) }\n this.minSlider.onchange = this.minSlider.onmousemove\n this.maxSlider.onmousemove = function() { updateMaxIndicator.apply(self) }\n this.maxSlider.onchange = this.maxSlider.onmousemove\n\n this.root = document.createElement('div')\n this.root.appendChild(createLabel(label))\n var minContainer = document.createElement('div')\n minContainer.appendChild(createLabel('Min'))\n minContainer.appendChild(this.minSlider)\n minContainer.appendChild(minIndicator)\n this.root.appendChild(minContainer)\n var maxContainer = document.createElement('div')\n maxContainer.appendChild(createLabel('Max'))\n maxContainer.appendChild(this.maxSlider)\n maxContainer.appendChild(maxIndicator)\n this.root.appendChild(maxContainer)\n this.root.classList.add('range-filter')\n\n this.root.appendChild(this.removeButton)\n\n // Initialize indicator values\n updateMinIndicator.apply(self)\n updateMaxIndicator.apply(self)\n}", "title": "" }, { "docid": "ebfb2effa20f3d12257c9b316218551e", "score": "0.57820314", "text": "renderThumbRange(from, to) {\n const fromPercentageValue = this.calculatePercentage(from);\n const toPercentageValue = this.calculatePercentage(to);\n return html `\n ${this.renderThumb(from, fromPercentageValue, 'from')}\n ${this.renderThumb(to, toPercentageValue, 'to')}\n `;\n }", "title": "" }, { "docid": "18c7ef6bfa8f7fc62811a38bf5041bb2", "score": "0.57604426", "text": "function SliderWidget(args) {\r\n\tvar _this = this;\r\n\tthis.sliderValue = 30;\r\n\tthis.sliderChange = new Event(this);\r\n}", "title": "" }, { "docid": "8767a30bbf73d403c606eaa7d7ab6344", "score": "0.57567006", "text": "_rangeChanged() {\n this._setRangeValue();\n super._rangeChanged();\n }", "title": "" }, { "docid": "48aaf6edb0ff36e964b11d9153bd228b", "score": "0.57417554", "text": "function Slider (obj_name, min_edge, max_edge, touchable) {\n this.name = obj_name;\n this.min_edge = min_edge;\n this.max_edge = max_edge;\n this.touchable = (touchable) ? touchable : false;\n this.visible = true;\n this.current_seq = 0; \n this.sequence_order = [\"track\", \"scrubber\"];\n this.track = {\n xorigin : 0,\n yorigin : 0,\n xdistance : 0,\n ydistance : 0,\n xinc : 0,\n yinc : 0,\n starting_frame : 0,\n iterations : 1,\n current_iteration : 0,\n current_cel : 0,\n cels : []\n };\n this.scrubber = {\n selected : false,\n xorigin : 0,\n yorigin : 0,\n xdistance : 0,\n ydistance : 0,\n xinc : 0,\n yinc : 0,\n starting_frame : 0,\n iterations : 1,\n current_iteration : 0,\n current_cel : 0,\n cels : []\n };\n this.me = this;\n this.constructor = Slider;\n}", "title": "" }, { "docid": "9b157c90648f65fd320b0ec1a30f0368", "score": "0.5738271", "text": "function rangeEvent(event) {\n filterRange = this.value;\n}", "title": "" }, { "docid": "191812f03aa965a4d7f8e36ee2d030c4", "score": "0.57148784", "text": "function xrangeset(min, max) {\r\n // Force the slider thumbs to adjust to the appropriate place\r\n var sliderElem = document.getElementById('slider-range');\r\n if (sliderElem) {\r\n sliderElem.noUiSlider.set([min, max]);\r\n\r\n\r\n // ga event action, category, label\r\n googleAnalyticsEvent('slide', 'update-years', min + \"-\" + min);\r\n }\r\n }", "title": "" }, { "docid": "f67d2e24b9849791bf4ceb9354d27d41", "score": "0.56686413", "text": "function rangeSetter(v) {\n return function rangeSetterHandler(range, index) {\n if (withinRange(v, range.value)) {\n this.audioRange = range.value;\n\n if (this.lastRange !== range.value) {\n this.lastRange = range.value;\n }\n }\n };\n }", "title": "" }, { "docid": "0b2d794b54a0353edc187aaa6f8890f7", "score": "0.563829", "text": "updateSlider ()\n {\n const values = this.values;\n\n values.percent = Phaser.Math.Percent(values.current, values.min, values.max);\n\n this.slider.x = this.sliderLeft + (values.percent * this.sliderRange);\n\n if (this.slider.visible)\n {\n this.cropRect.width = (this.sliderRange * values.percent) + (this.slider.width / 2);\n }\n else\n {\n this.cropRect.width = (this.sliderRange * values.percent);\n }\n\n this.trackFull.setCrop(this.cropRect);\n\n this.emit('update', this, values.current, values.percent);\n\n return this;\n }", "title": "" }, { "docid": "13731dabe527875d2c7d46a10eee1668", "score": "0.5632796", "text": "function updateRangeValues() {\r\n if (paginationService.isRegistered(paginationId)) {\r\n var currentPage = paginationService.getCurrentPage(paginationId),\r\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\r\n totalItems = paginationService.getCollectionLength(paginationId);\r\n\r\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\r\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\r\n scope.range.total = totalItems;\r\n }\r\n }", "title": "" }, { "docid": "13731dabe527875d2c7d46a10eee1668", "score": "0.5632796", "text": "function updateRangeValues() {\r\n if (paginationService.isRegistered(paginationId)) {\r\n var currentPage = paginationService.getCurrentPage(paginationId),\r\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\r\n totalItems = paginationService.getCollectionLength(paginationId);\r\n\r\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\r\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\r\n scope.range.total = totalItems;\r\n }\r\n }", "title": "" }, { "docid": "bef4dd13420bd81e75db2214f5dbc5ee", "score": "0.56219614", "text": "function initRanges(){\n\t\t// slider event\n\t\tquerySelectorAll('#options .range').forEach(function(input){\n\t\t\tinput.addEventListener('change', function(){\n\t\t\t\tquerySelector('#' + this.id + 'Number').value = input.value;\n\t\t\t\tupdateDesignStats();\n\t\t\t}, false);\n\t\t});\n\t\tquerySelectorAll('#options .number').forEach(function(input){\n\t\t\tinput.addEventListener('keyup', function(){\n\t\t\t\tvar\n\t\t\t\t\trange = querySelector('#' + this.id.replace('Number', '')),\n\t\t\t\t\tvalue = parseInt(input.value)\n\t\t\t\t;\n\t\t\t\t// loudly enforce maximum number\n\t\t\t\tif (value > range.max){\n\t\t\t\t\tinput.value = range.max;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// silently ignore lower numbers\n\t\t\t\tif (value < range.min){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trange.value = value;\n\t\t\t\tupdateDesignStats();\n\t\t\t}, false);\n\t\t\tinput.addEventListener('change', function(){\n\t\t\t\tvar\n\t\t\t\t\trange = querySelector('#' + this.id.replace('Number', '')),\n\t\t\t\t\tvalue = parseInt(input.value)\n\t\t\t\t;\n\t\t\t\t// overwrite lower numbers when user is finished with the field\n\t\t\t\tif (value < range.min){\n\t\t\t\t\tinput.value = range.min;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}, false);\n\t\t});\n\t}", "title": "" }, { "docid": "4a3ce8fad41544650159b2ea214c29ff", "score": "0.5612755", "text": "set hasRange(value) {}", "title": "" }, { "docid": "e29017a26417c29c66849d455f0716a9", "score": "0.56086975", "text": "function sliders() {\n\tvar tracks = [\n\t\t'-webkit-slider-runnable-track',\n\t];\n\n\tvar thumbs = [\n\t\t'-webkit-slider-thumb',\n\t];\n\n\tinitSliders();\n\tvar sliderGroups = document.querySelectorAll('section[data-type=slider-group]');\n\tfor (var i=0;i<sliderGroups.length;i+=1) {\n\t\tinitSliderGroup(sliderGroups[i]);\n\t}\n\n\tfunction initSliders() {\n\t\tvar sliders = document.querySelectorAll('input[type=range]');\n\t\tvar testAndWK = window.getComputedStyle(sliders[0],'::-webkit-slider-thumb').background;\n\t\tfor (var i=0;i<sliders.length;i+=1) {\n\t\t\tif (!testAndWK) {\n\t\t\t\tsliders[i].style.WebkitAppearance = 'slider-horizontal';\n\t\t\t}\n\n\t\t\t// prepare a <style> tag that will be used by handleSlider()\n\n\t\t\tvar st = document.createElement('style');\n\t\t\tst.id = 's' + sliders[i].id;\n\t\t\tdocument.head.appendChild(st);\n\n\n\t\t\tsliders[i].addEventListener('input',function () {handleSlider(this)},false);\n\t\t\tsliders[i].addEventListener('change',function () {handleSlider(this)},false);\n\n\t\t\tsliders[i].output = sliders[i].parentNode.querySelector('output');\n\t\t\tvar dataSpan = sliders[i].parentNode.querySelector('span');\n\t\t\tif (dataSpan && dataSpan.getAttribute('data-labels')) {\n\t\t\t\tsliders[i].values = [];\n\t\t\t\tvar values = dataSpan.getAttribute('data-labels').split(';');\n\t\t\t\tfor (var j=0;j<values.length;j+=1) {\n\t\t\t\t\tsliders[i].values.push(values[j]);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif (sliders[i].value*1) {\n\t\t\t\thandleSlider(sliders[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction handleSlider(slider) {\n\n\t\t// this sets the gradient for one slider to the correct color stops\n\t\t// needs a prepared <style> tag created by initSliders()\n\n\t\tvar gradValue = Math.round((slider.value/slider.getAttribute('max')*1)*100);\n\t\tvar grad = 'linear-gradient(90deg,#FFFFFF ' + gradValue + '%,#903094 ' + (gradValue+1) + '%)';\n\t\tvar rangeSelector = 'input[id=\"'+slider.id+'\"]::';\n\t\tvar styleString = '';\n\t\tvar printedValue = (slider.values) ? slider.values[slider.value] : slider.value;\n\t\tslider.innerHTML = printedValue;\n\t\tfor (var j=0;j<tracks.length;j+=1) {\n\t\t\tstyleString += rangeSelector + tracks[j] + '{background: ' + grad + ';} ';\n\t\t}\n\t\tdocument.getElementById('s'+slider.id).textContent = styleString;\n\t}\n\n\tfunction initSliderGroup(parent) {\n\t\tvar sliders = parent.querySelectorAll('input[type=range]');\n\t\tvar max = parent.querySelector('div').getAttribute('data-total')*1;\n\t\tvar groupRoster = [];\n\t\tvar timeout;\n\t\tfor (var i=0;i<sliders.length;i+=1) {\n\t\t\tgroupRoster.push(sliders[i]);\n\t\t\tsliders[i].others = [];\n\t\t\tsliders[i].addEventListener('input',trackChange,false);\n\t\t\tsliders[i].addEventListener('change',trackChange,false);\n\t\t}\n\t\tfor (var i=0;i<sliders.length;i+=1) {\n\t\t\tfor (var j=0;j<groupRoster.length;j+=1) {\n\t\t\t\tif (groupRoster[j] !== sliders[i]) {\n\t\t\t\t\tsliders[i].others.push(groupRoster[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction trackChange () {\n\t\t\tvar that = this;\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = setTimeout(function () {\n\t\t\t\tsetOtherSliders(that);\n\t\t\t},100);\n\t\t}\n\n\t\tfunction setOtherSliders(slider) {\n\t\t\tvar currentTotal = calculateTotal();\n\t\t\tif (currentTotal > max) {\n\t\t\t\tvar excess = currentTotal - max;\n\t\t\t\tvar totalFromOthers = currentTotal - (slider.value*1);\n\t\t\t\tfor (var j=0;j<slider.others.length;j+=1) {\n\t\t\t\t\tvar newValue = Math.round(slider.others[j].value - ((slider.others[j].value/totalFromOthers)*excess));\n\t\t\t\t\tslider.others[j].value = newValue;\n\t\t\t\t\thandleSlider(slider.others[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction calculateTotal () {\n\t\t\tvar total = 0;\n\t\t\tfor (var i=0;i<groupRoster.length;i+=1) {\n\t\t\t\ttotal += groupRoster[i].value*1;\n\t\t\t}\n\t\t\treturn total;\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "44a1f3e803b6460cc02fc283676e1827", "score": "0.55881137", "text": "function range_events_handler(min_slider,max_slider){\n min_slider.addEventListener('change' , e => {\n\n let comun_part = min_slider.parentNode.getElementsByTagName('span')[0].innerHTML.split(':')[0];\n\n comun_part += ': ' + parseFloat(min_slider.value).toFixed(6)\n\n min_slider.parentNode.getElementsByTagName('span')[0].innerHTML = comun_part\n });\n max_slider.addEventListener('change' , e => {\n let comun_part = max_slider.parentNode.getElementsByTagName('span')[0].innerHTML.split(':')[0];\n\n comun_part += ': ' + parseFloat(max_slider.value).toFixed(6)\n\n max_slider.parentNode.getElementsByTagName('span')[0].innerHTML = comun_part\n });\n\n}", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.5582758", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.5582758", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.5582758", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "e662f75da1e3165208f809c279e6e2f7", "score": "0.5569454", "text": "function Range(){this._minimum=this._value=0;this._maximum=100;this._extent=0;this._isChanging=!1}", "title": "" }, { "docid": "d7c96cb91958d31880fb0d3d31050504", "score": "0.5569007", "text": "function DoubleRange(props) {\n const { start, end, use } = props;\n const selected = useSelector(state => state.filters[use]);\n const dispatch = useDispatch();\n\n const onChange = (e) => {\n let name = e.target.name;\n let value = parseInt(e.target.value);\n let state = { ...selected };\n if (((name === \"start\") && (value <= selected.end)) || (name === \"end\")) {\n state = { ...state, [name]: value };\n dispatch({ type:\"filters/\" + use + \"/set\", payload: state });\n }\n };\n const renderRange = (name, style) => {\n return (\n <input\n type=\"range\"\n step=\"1\"\n style={ style }\n className=\"appearance-none bg-red-200 h-2 z-10 absolute top-1/3\"\n name={ name }\n min={ (name === \"end\") ? selected.start:start }\n max={ end }\n value={ selected[name] }\n onChange={ onChange }\n />\n );\n }\n /* styles for inputs: */\n let endValue = 100 * ((end - selected.start) / (end - start));\n let rem = 0.0125 * endValue;\n let width = \"max(\" + endValue + \"% - \" + rem + \"rem, 1.26rem)\";\n let endStyle = { width };\n let startStyle = {\n \"--zi\": (selected.start === end) ? 20:10\n };\n /* style for indicator */\n let endPosition = 1-((selected.end - selected.start) / (end - selected.start));\n let startPosition = (selected.start - start) / (end - start);\n startPosition *= 100;\n let startRem = .0125 * (100-startPosition);\n let endRem = .0125 * (50-endPosition*endValue);\n endRem += .625 * (1-endPosition)\n let indicatorStyle = {\n \"--indicatorLeft\": \"calc(\" + startPosition + \"% + \" + (startRem-.1) + \"rem\",\n \"--indicatorRight\": \"calc(\"\n + width + \" * \" + endPosition\n + \" + \" + (endRem-.1) + \"rem)\",\n }\n return (\n <fieldset className=\"flex flex-wrap md:flex-nowrap flex-row justify-evenly mb-5 md:mb-2\">\n <span className=\"w-1/2 order-1 md:w-auto flex-grow text-left md:text-center mb-2 md:mb-0 pl-2 md:pl-0 md:pr-2\">{ selected.start }</span>\n <div className=\"w-full order-3 md:order-2 md:w-5/6 relative ranges\" style={ indicatorStyle }>\n { renderRange(\"start\", startStyle) }\n { renderRange(\"end\", endStyle) }\n </div>\n <span className=\"w-1/2 order-2 md:order-3 md:w-auto flex-grow text-right md:text-center mb-2 md:mb-0 pr-2 md:pr-0 md:pl-2\">{ selected.end }</span>\n </fieldset>\n )\n}", "title": "" }, { "docid": "33af3ea05ba56d0d1d756e69237c8abb", "score": "0.55683106", "text": "alignRangeInterval() {\n const { controls } = this.props;\n\n if (\n controls.settings.range.value < controls.settings.interval.value ||\n controls.settings.interval.value == \"\"\n ) {\n controls.settings.interval.value = controls.settings.range.value;\n }\n\n controls.settings.interval.max = controls.settings.range.value;\n }", "title": "" }, { "docid": "4ff9d9f9277ab7b1ee3ded1d45666910", "score": "0.5557768", "text": "function changeRangeSlider2(){\n\t\t\tvar slider2Range = slider2RangeFunct($(slider1).val(),params2);\n\t\t\t$(slider2).prop({\n\t\t\t\t'min': slider2Range[0],\n \t\t'max': slider2Range[1],\n \t});\n \t$(slider2Text).val($(slider2).val());\n\t\t}", "title": "" }, { "docid": "846d04016593cb802f3e67387729eec6", "score": "0.5524754", "text": "function updateRangeValues() {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }", "title": "" }, { "docid": "fc6987121ffc13f07f5aafb1232ee466", "score": "0.55125445", "text": "measureSlider() {\n this.sliderWidthPx = this.slider.getBoundingClientRect().width; // szerokosc slidera w danym momencie\n this.zipperWidthPx = this.from.getBoundingClientRect().width;\n this.sliderUnitPx = this.sliderWidthPx / (this.maxValue - this.minValue);\n\n }", "title": "" }, { "docid": "53831dce7fce7b01a3ca2378079927dc", "score": "0.5504779", "text": "function createSlider(sliderObj) {\n var listel = document.createElement(\"li\");\n var label = document.createElement(\"label\");\n var input = document.createElement(\"input\");\n input.type = \"range\";\n input.dataset.key = sliderObj.key;\n input.min = sliderObj.min;\n input.max = sliderObj.max;\n input.onchange = debouncedSendControls;\n label.innerHTML = sliderObj.label;\n listel.appendChild(label);\n listel.appendChild(input);\n sliderContainer.appendChild(listel);\n}", "title": "" }, { "docid": "3fbd114a02012050ea583a387e7816ab", "score": "0.5498233", "text": "static generateSlider({\n min = 0, max = 100, step = 5,\n initValue = 0,\n classname = 'slider'\n } = {}) {\n let slider = `<main style=\"flex-basis: 100%\">\n <form id=\"form\" class=\"${classname}\">\n <div class=\"range\">\n <input id=\"slider\" name=\"range\" type=\"range\" value=\"${initValue}\" min=\"${min}\" max=\"${max}\" step=\"${step}\">\n <div class=\"range-output\">\n <output id=\"output\" class=\"output\" name=\"output\" for=\"range\">\n ${initValue}\n </output>\n </div>\n </div>\n </form>\n </main>`;\n\n return slider;\n }", "title": "" }, { "docid": "33bc7cdb2e7079afedf6d79210c8fb24", "score": "0.54727614", "text": "function addRangeEventListeners() {\r\n\tvar ranges = document.querySelectorAll(\"input[type=range]\"); \r\n\tvar i;\r\n\tfor (i = 0; i < ranges.length; i++) {\r\n \r\n\t\tvar range = ranges[i];\r\n range.parentNode.getElementsByClassName(\"rangeValue\")[0].innerHTML = range.value;\r\n \r\n\t\taddCaptureEvent(range, \"input\", rangeValue);\r\n\t}\r\n}", "title": "" }, { "docid": "a9c824b64174d9b6e8eb099daea44c06", "score": "0.54705626", "text": "function createPriceRange(min, max) {\n $('#price-selector').slider({\n min: 1,\n max: 9999999,\n range: true,\n steps: 100000,\n values: [min,max],\n create: function(event, ui) {\n $('.price-from span').text(min);\n $('.price-to span').text(max);\n $('#price-min').val(min);\n $('#price-max').val(max);\n },\n slide: function(event, ui) {\n $('.price-from span').text(ui.values[0]);\n $('.price-to span').text(ui.values[1]);\n $('#price-min').val(ui.values[0]);\n $('#price-max').val(ui.values[1]);\n }\n });\n}", "title": "" }, { "docid": "b1c7ff4242f3cf0aecd777e6987771de", "score": "0.54701054", "text": "function addSliderHandle( options ){\n options.slider = _this;\n if (options.inclDataPercent)\n options.markerData = {\n 'data-base-slider-percent': _this.valueToPercent(options.value.value)\n };\n _this.handles[options.id] = ns.sliderHandle(options);\n }", "title": "" }, { "docid": "299c74cebdc7a3717419f0ae85f49f6f", "score": "0.5457793", "text": "function setup_uislider() {\r\n\t\tif ($('#uislider-demo').length) {\t\r\n\r\n\t\t\t$(\"#slider-range\").slider({\r\n\t\t\t range: true,\r\n\t\t\t min: 100,\r\n\t\t\t max: 500,\r\n\t\t\t values: [176, 329],\r\n\t\t\t slide: function(event, ui) {\r\n\t\t\t $(\"#amount\").val(\"$\" + ui.values[0] + \" - $\" + ui.values[1]);\r\n\t\t\t\r\n\t\t\t $('#slider-range .ui-slider-handle:first').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.values[0] + '</div></div>');\r\n\t\t\t $('#slider-range .ui-slider-handle:last').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.values[1] + '</div></div>');\r\n\t\t\t }\r\n\t\t\t});\r\n\t\t\t$(\"#amount\").val(\"$\" + $(\"#slider-range\").slider(\"values\", 0) + \" - $\" + $(\"#slider-range\").slider(\"values\", 1));\r\n\r\n\t\t\t\t\r\n\t\t\t$( \"#slider-range-min\" ).slider({\r\n\t\t range: \"min\",\r\n\t\t value: 461,\r\n\t\t min: 100,\r\n\t\t max: 900,\r\n\t\t slide: function( event, ui ) {\r\n\t\t $( \"#amount2\" ).val( \"$\" + ui.value );\r\n\t\t $('#slider-range-min .ui-slider-handle:first').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.value + '</div></div>');\r\n\t\t }\r\n\t\t });\r\n\t\t $(\"#amount2\").val( \"$\" + $( \"#slider-range-min\" ).slider(\"value\"));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$( \"#slider-range-max\" ).slider({\r\n\t\t range: \"max\",\r\n\t\t min: 100,\r\n\t\t max: 999,\r\n\t\t value: 507,\r\n\t\t slide: function( event, ui ) {\r\n\t\t $( \"#amount3\" ).val( \"$\" + ui.value );\r\n\t\t $('#slider-range-max .ui-slider-handle:first').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.value + '</div></div>');\r\n\t\t }\r\n\t\t });\r\n\t\t $(\"#amount3\" ).val( \"$\" + $( \"#slider-range-max\" ).slider( \"value\" ));\r\n\t\t \r\n\t\t\t$(\"#slider-range-step\").slider({\r\n\t\t\t range: true,\r\n\t\t\t min: 100,\r\n\t\t\t max: 999,\r\n\t\t\t step:100,\r\n\t\t\t values: [500, 550],\r\n\t\t\t slide: function(event, ui) {\r\n\t\t\t $(\"#amount4\").val(\"\" + ui.values[0] + \" - \" + ui.values[1]);\r\n\t\t\t\r\n\t\t\t $('#slider-range-step .ui-slider-handle:first').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.values[0] + '</div></div>');\r\n\t\t\t $('#slider-range-step .ui-slider-handle:last').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.values[1] + '</div></div>');\r\n\t\t\t }\r\n\t\t\t});\r\n\t\t\t$(\"#amount4\").val(\"\" + $(\"#slider-range-step\").slider(\"values\", 0) + \" - \" + $(\"#slider-range-step\").slider(\"values\", 1));\r\n\t\t\t\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6ccf46c8939f3bfbb407008e8732e299", "score": "0.5455565", "text": "get rangeList() { return this._rangeList; }", "title": "" }, { "docid": "07d236343082bb9265a3cc45ef89b003", "score": "0.54511064", "text": "function rangeInteractions() {\r\n\t$allergyBar.on(\"change mousemove\", function () {\r\n var val = ($(this).val() - $(this).attr('min')) / ($(this).attr('max') - $(this).attr('min'));\r\n styleRange($(this), val, allergyBarColor1, allergyBarColor2);\r\n\t});\r\n\r\n\t$noAllergyBar.on(\"change mousemove\", function () {\r\n var val = ($(this).val() - $(this).attr('min')) / ($(this).attr('max') - $(this).attr('min'));\r\n styleRange($(this), val, noAllergyBarColor1, noAllergyBarColor2);\r\n\t});\r\n}", "title": "" }, { "docid": "d2212c696d1226f2f86fcfe6d621d48b", "score": "0.5450534", "text": "function updateTabsSlider(min, max) {\n if( $( \"#tabs-slider\" ).slider(\"value\") > max ) {\n $( \"#tabs-slider\" ).slider(\"value\", max);\n }\n $( \"#tabs-slider\" ).slider(\"option\", \"min\", min);\n $( \"#tabs-slider\" ).slider(\"option\", \"max\", max);\n\n}", "title": "" }, { "docid": "f3aafee5496e15e5ab885ce015cdb4c6", "score": "0.54450095", "text": "get range() {\n return this.rangeValidationForm.controls;\n }", "title": "" }, { "docid": "6b66c42d7987dbfc3daa2ea73fbf9cf2", "score": "0.54339", "text": "function initializeSlider (forceGeneratingNumericData) {\n var inputControl,\n sliderValue,\n sliderParent,\n valueCalculationOptions; \n\n generateNumericItems.call(this, forceGeneratingNumericData);\n valueCalculationOptions = {\n minimum: this.Minimum,\n maximum: this.Maximum,\n selectedValue: this.SelectedValue,\n selectedValueStart: this.SelectedValueStart,\n selectedValueEnd: this.SelectedValueEnd,\n type: this.Type\n };\n\n sliderValue = calculateSliderValue.call(this, valueCalculationOptions);\n var that = this;\n var options = {\n formater: function (index) {\n var displayValue = index;\n if (index < that.getNumOfItems()) {\n displayValue = that.getDisplayName(that.at(index));\n }\n\n if (!displayValue) {\n displayValue = (Math.round(index * 10) / 10);\n }\n\n return that.ValuePrefix + displayValue + that.ValueSuffix;\n },\n\n getImageUrl: function (value) {\n return that.hasData() ? that.Items[value].ImageUrl : null;\n },\n\n isTitleBar: this.IsLabelVisible,\n hideTooltip: this.IsTooltipHidden,\n min: 0,\n max: this.getNumOfItems() - 1,\n step: 1,\n titleValuesStep: this.LabelsStep,\n sliderValue: sliderValue\n };\n\n inputControl = $(this.el).find(\".sliderControl\");\n\n // If it's already a slider control, then this will \"reset\"\n sliderParent = inputControl.parents(\".slider\");\n if (sliderParent.length > 0) {\n sliderParent.before(inputControl);\n sliderParent.remove();\n }\n\n var slider = inputControl.sliderCustom(options);\n this.sliderComponent = slider.data(\"slider\");\n\n this.sliderControl = slider[0];\n this.toggleEnable();\n\n slider.on(\"slide\", function (ev) {\n that.sliderValueChanged = true;\n if (Array.isArray(ev.value)) { \n that.selectRange([that.at(ev.value[0]), that.at(ev.value[1])]);\n } else {\n that.selectAt(ev.value);\n }\n });\n }", "title": "" }, { "docid": "a3041c255ed75729e897e3d11d4c3aae", "score": "0.5428512", "text": "updateSlider() {\n // just in case\n this.detached();\n\n let imgInf = this.image_config.image_info;\n\n // no slider for a 0 length dimension\n if (imgInf.dimensions['max_' + this.dim] <= 1) return;\n\n // create jquery slider\n $(this.elSelector).slider({\n orientation: this.dim === 'z' ? \"vertical\" : \"horizontal\",\n min: 0,\n max: imgInf.dimensions['max_' + this.dim] - 1 ,\n step: 0.01, value: imgInf.dimensions[this.dim],\n slide: (event, ui) => {\n if (this.player_info.handle !== null) return false;\n if (typeof event.keyCode === 'number') {\n let upKey =\n (event.keyCode === 38 || event.keyCode === 39);\n let downKey =\n (event.keyCode === 37 || event.keyCode === 40);\n let newVal = ui.value;\n if (upKey) newVal = Math.ceil(newVal);\n else if (downKey) newVal = Math.floor(newVal);\n $(this.elSelector).slider('value', newVal);\n return false;\n }\n let sliderValueSpan = $(this.elSelector + ' .slider-value');\n let newDimVal = Math.round(ui.value);\n let sliderTip =\n this.dim.toUpperCase() + \":\" + (newDimVal+1);\n if (this.dim === 't' && imgInf.image_delta_t.length > 0 &&\n newDimVal < imgInf.image_delta_t.length)\n sliderTip += \" [\" + imgInf.image_delta_t[newDimVal] + \"]\";\n sliderValueSpan.text(sliderTip);\n let percent = (ui.value / (imgInf.dimensions['max_' + this.dim] - 1)) * 100;\n if (this.dim === 'z') {\n sliderValueSpan.css({bottom: percent + \"%\"})\n } else {\n sliderValueSpan.css({left: percent + \"%\"})\n }\n sliderValueSpan.show();\n },\n stop: (event, ui) => {\n let sliderValueSpan = $(this.elSelector + ' .slider-value');\n sliderValueSpan.text(\"\");\n sliderValueSpan.hide();\n $(this.elSelector).slider('value', Math.round(ui.value));\n },\n change: (event, ui) => this.onChange(ui.value,\n event.originalEvent ? true : false)\n });\n $(this.element).show();\n }", "title": "" }, { "docid": "701ddd81e28a7d99b68e019a89c35866", "score": "0.54195875", "text": "connectedCallback() {\n // Create new input element\n const input = document.createElement('input');\n\n // Add <input> to the DOM inside the <range-slider>\n this.appendChild(input);\n\n // The first two options in the config are the values we set in Elm!\n const jsr = new JSR(input, {\n max: this.max,\n values: [this.val],\n sliders: 1,\n grid: false,\n });\n\n const rangeSliderNode = this;\n\n // Whenever the user drags the slider around, the <range-slider> element\n // will emit a \"slide\" event containing the new value they've chosen\n\n // Listen for update events from the jsr object\n jsr.addEventListener('update', (elem, value) => {\n // Create new slide event and store value inside of it\n const event = new CustomEvent('slide', {\n detail: { userSlidTo: value },\n });\n\n // Dispatch event from <range-slider>\n rangeSliderNode.dispatchEvent(event);\n });\n }", "title": "" }, { "docid": "3fbe6b6142f9c752e0364d90b831ac0d", "score": "0.5414275", "text": "injectSlider() {\n // injectujemy slider w HTML\n this.container.innerHTML = '<div class=\"slider\"><div class=\"from\"></div><div class=\"to\"></div></div>';\n this.from = this.container.querySelector('.from'); // lewy suwak from\n this.to = this.container.querySelector('.to'); // prawy suwak to\n this.slider = this.container.querySelector('.slider'); // slider\n }", "title": "" }, { "docid": "607cfaa02c79fbf720603d15a4997b53", "score": "0.5400748", "text": "get hasRange() {}", "title": "" }, { "docid": "b3a56b00ac93f90cb88c705609e22fa5", "score": "0.53992784", "text": "get range() {\r\n\t\treturn this.range$.slice(0, 2);\r\n\t}", "title": "" }, { "docid": "61c54908fa80510d2b2c634d5bc81ea5", "score": "0.538092", "text": "function rangeInputs(){\n redValue = document.querySelector(\"#redSlider\").value;\n greenValue = document.querySelector(\"#greenSlider\").value;\n blueValue = document.querySelector(\"#blueSlider\").value;\n}", "title": "" }, { "docid": "574228fb3ffd58938a7ff23f9058c8ef", "score": "0.53694737", "text": "function onRangeChange(){ // todo: possibly refactor since also called by collections -> col.dataLoaded\n elmTimeFrom.innerText = currentRange.start.toString()\n elmTimeTo.innerText = currentRange.end.toString()\n element.style.backgroundImage = view.rangeGradient\n //\n elmBefore.style.backgroundColor = view.colorFirst\n elmAfter.style.backgroundColor = view.colorLast\n //\n collections.render(currentRange)\n }", "title": "" }, { "docid": "d3c6791ca07325731928ec3b4e9631dc", "score": "0.5368056", "text": "function Slider(c, label, units, x, y, width, height, min, max, step, horizontal, changeListener) {\n this.label = label;\n this.units = units;\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.xKnob = x;\n this.yKnob = horizontal ? y + 20 : y;\n this.step = step;\n this.min = min;\n this.max = max;\n this.val = min;\n this.displayVal = min;\n this.horizontal = horizontal;\n this.radius = (horizontal ? height : width) / 2;\n this.changeListener = changeListener;\n this.clicked = false;\n this.font = '14px Arial';\n c.font = this.font;\n this.labelSize = c.measureText(label);\n this.unitsSize = c.measureText(`00.000 ${units}`);\n const self = this;\n this.getVal = (pos, minVal, length) => (\n (self.max - self.min) * ((pos - minVal) / length) + self.min\n );\n this.move = (xDiff, yDiff) => {\n self.setPos(self.x + xDiff, self.y + yDiff);\n };\n this.setPos = (xPos, yPos) => {\n self.x = xPos;\n self.y = yPos;\n if(self.horizontal) {\n self.yKnob = yPos + 20;\n } else {\n self.xKnob = xPos;\n }\n self.setToVal(self.val);\n };\n this.valueFn = () => {\n const value = self.val;\n return () => value;\n };\n this.updateDisplayVal = () => {\n if(self.step === 0) {\n self.displayVal = self.val;\n } else {\n const floor = self.step * Math.floor((self.val - self.min) / self.step);\n self.displayVal = (self.val - floor > self.step / 2) ? floor + self.step : floor;\n }\n };\n this.setToVal = (val) => {\n if(val >= self.min && val <= self.max) {\n if(self.horizontal) {\n self.xKnob = self.width * ((val - self.min) / (self.max - self.min)) + self.x;\n } else {\n self.yKnob = self.height * ((val - self.min) / (self.max - self.min)) + self.height;\n }\n self.val = val;\n if(self.changeListener) {\n self.changeListener(val);\n }\n self.updateDisplayVal();\n }\n };\n this.slide = (xDiff, yDiff) => {\n if(horizontal) {\n self.xKnob += xDiff;\n self.xKnob = clamp(self.xKnob, self.x, self.x + self.width);\n self.val = self.getVal(self.xKnob, self.x, self.width);\n } else {\n self.yKnob += yDiff;\n self.yKnob = clamp(self.yKnob, self.y, self.y + self.height);\n self.val = self.getVal(self.yKnob, self.y, self.height);\n }\n self.updateDisplayVal();\n if(self.changeListener) {\n self.changeListener(self.displayVal);\n }\n };\n this.hit = (xPos, yPos) => {\n self.clicked = x > self.xKnob - self.radius && xPos < self.xKnob + self.radius\n && yPos > self.yKnob - self.radius && yPos < self.yKnob + self.radius;\n return self.clicked;\n };\n this.draw = (ctx) => {\n ctx.beginPath();\n ctx.lineWidth = self.height / 4;\n ctx.lineCap = 'round';\n ctx.strokeStyle = '#05F';\n ctx.moveTo(self.x, self.y + 20);\n if(self.horizontal) {\n ctx.lineTo(self.x + self.width, self.y + 20);\n } else {\n ctx.lineTo(self.x, self.y + self.height);\n }\n ctx.closePath();\n ctx.stroke();\n ctx.beginPath();\n ctx.fillStyle = '#000';\n ctx.arc(self.xKnob, self.yKnob, self.radius + (self.clicked ? 1.5 : 0), 0, 2 * Math.PI);\n ctx.fillStyle = self.color;\n ctx.fill();\n ctx.closePath();\n ctx.font = self.font;\n const valStr = `${self.displayVal.toFixed(3)} ${self.units}`;\n if(self.horizontal) {\n const xMid = self.x + self.width / 2;\n ctx.fillText(self.label, xMid - self.labelSize.width / 2, self.y);\n ctx.fillText(valStr, xMid - self.unitsSize.width / 2, self.y + 13);\n } else {\n ctx.fillText(self.label, self.x + 10, self.y + 10);\n ctx.fillText(valStr, self.x + 10, self.y + 25);\n }\n };\n return this;\n}", "title": "" }, { "docid": "19ffd64f24ff99990b3263510833571e", "score": "0.53630155", "text": "function bindSliderEvents(behaviour) {\n // Attach the standard drag event to the handles.\n if (!behaviour.fixed) {\n scope_Handles.forEach(function (handle, index) {\n // These events are only bound to the visual handle\n // element, not the 'real' origin element.\n attachEvent(actions.start, handle.children[0], eventStart, {\n handleNumbers: [index]\n });\n });\n }\n\n // Attach the tap event to the slider base.\n if (behaviour.tap) {\n attachEvent(actions.start, scope_Base, eventTap, {});\n }\n\n // Fire hover events\n if (behaviour.hover) {\n attachEvent(actions.move, scope_Base, eventHover, {\n hover: true\n });\n }\n\n // Make the range draggable.\n if (behaviour.drag) {\n scope_Connects.forEach(function (connect, index) {\n if (connect === false || index === 0 || index === scope_Connects.length - 1) {\n return;\n }\n\n var handleBefore = scope_Handles[index - 1];\n var handleAfter = scope_Handles[index];\n var eventHolders = [connect];\n\n addClass(connect, options.cssClasses.draggable);\n\n // When the range is fixed, the entire range can\n // be dragged by the handles. The handle in the first\n // origin will propagate the start event upward,\n // but it needs to be bound manually on the other.\n if (behaviour.fixed) {\n eventHolders.push(handleBefore.children[0]);\n eventHolders.push(handleAfter.children[0]);\n }\n\n eventHolders.forEach(function (eventHolder) {\n attachEvent(actions.start, eventHolder, eventStart, {\n handles: [handleBefore, handleAfter],\n handleNumbers: [index - 1, index]\n });\n });\n });\n }\n }", "title": "" }, { "docid": "19ffd64f24ff99990b3263510833571e", "score": "0.53630155", "text": "function bindSliderEvents(behaviour) {\n // Attach the standard drag event to the handles.\n if (!behaviour.fixed) {\n scope_Handles.forEach(function (handle, index) {\n // These events are only bound to the visual handle\n // element, not the 'real' origin element.\n attachEvent(actions.start, handle.children[0], eventStart, {\n handleNumbers: [index]\n });\n });\n }\n\n // Attach the tap event to the slider base.\n if (behaviour.tap) {\n attachEvent(actions.start, scope_Base, eventTap, {});\n }\n\n // Fire hover events\n if (behaviour.hover) {\n attachEvent(actions.move, scope_Base, eventHover, {\n hover: true\n });\n }\n\n // Make the range draggable.\n if (behaviour.drag) {\n scope_Connects.forEach(function (connect, index) {\n if (connect === false || index === 0 || index === scope_Connects.length - 1) {\n return;\n }\n\n var handleBefore = scope_Handles[index - 1];\n var handleAfter = scope_Handles[index];\n var eventHolders = [connect];\n\n addClass(connect, options.cssClasses.draggable);\n\n // When the range is fixed, the entire range can\n // be dragged by the handles. The handle in the first\n // origin will propagate the start event upward,\n // but it needs to be bound manually on the other.\n if (behaviour.fixed) {\n eventHolders.push(handleBefore.children[0]);\n eventHolders.push(handleAfter.children[0]);\n }\n\n eventHolders.forEach(function (eventHolder) {\n attachEvent(actions.start, eventHolder, eventStart, {\n handles: [handleBefore, handleAfter],\n handleNumbers: [index - 1, index]\n });\n });\n });\n }\n }", "title": "" }, { "docid": "1bf738a88eb74300e226fe56493aa9a4", "score": "0.53622323", "text": "function changeRangeValue(range) {\n var initMin = range.min;\n var initMax = range.max;\n var initStep = range.step;\n var initVal = Number(range.value);\n\n range.min = initVal;\n range.max = initVal + 1;\n range.step = 1;\n range.value = initVal + 1;\n deletePropertySafe(range, 'value');\n range.min = initMin;\n range.max = initMax;\n range.step = initStep;\n range.value = initVal;\n }", "title": "" }, { "docid": "e2918fe61f7432fceeacd35498dd55a8", "score": "0.5356592", "text": "render() {\n return html `\n ${this.range && this.isShowInputField ? this.renderNumberField(this.from, 'from') : null}\n <div part=\"slider-wrapper\">\n <div part=\"slider\">\n ${this.renderTrackWrapper(this.range)}\n ${this.range ? this.renderThumbRange(this.fromNumber, this.toNumber) : this.renderThumb(this.valueNumber, this.calculatePercentage(Number(this.value)), 'value')}\n </div>\n </div>\n ${this.range && this.isShowInputField ? this.renderNumberField(this.to, 'to') : null}\n ${!this.range && this.isShowInputField ? this.renderNumberField(this.value, 'value') : null}\n `;\n }", "title": "" }, { "docid": "3a0b6f4a5cdd8e05bc9fdb10749944f9", "score": "0.534504", "text": "function displayRange(tower){\n\tvar range = TOWERS_DATA[tower.attr(\"type\")].range,\n\t\tsize = 30 - range;\n\n\ttower.hover(\n\t\tfunction(){\n\t\t\ttower.append(\"<div id='range\" + tower.attr(\"id\") + \"' \" +\n\t\t\t\"class='range'\" +\n\t\t\t\"style='height: \" + (range * 2) + \"px; width: \" + (range * 2) + \"px; \" + \n\t\t\t\"left: \" + size + \"px; top : \" + size + \"px;'\" +\n\t\t\t\"'></div>\");\n\t\t},\n\t\tfunction(){\n\t\t\t$(\"#range\" + tower.attr(\"id\")).remove();\n\t\t}\n\t);\n}", "title": "" }, { "docid": "b27afca274bbc9865d3818bc6eb8b101", "score": "0.5342801", "text": "function updateRangeValues() {\n $rootScope.$broadcast('refreshFixedColumns', {});\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }", "title": "" }, { "docid": "5389c5e963f4e250e948782015614bf1", "score": "0.53394264", "text": "function setupSlider(id, vals, initialVal) {\r\n $(`#${id}`).append($('<div>').addClass('step-marks'));\r\n $(`#${id}`).append($('<div>').addClass('step-labels'));\r\n $(`#${id}`).append($('<input type=\"range\" step=\"0.1\" id=\"' + 'input_' + id + '\">'));\r\n\r\n var min = 2.5;\r\n var max = 10;\r\n\r\n // initialise slider vals\r\n $(`#${id} input[type=range]`).attr({ min: min, max: max }).val(initialVal);\r\n\r\n vals.forEach((x, i) => {\r\n if (i < vals.length - 1) {\r\n $(`#${id} .step-marks`).append($(\"<div>\"));\r\n }\r\n var label = $(\"<span>\").text(x).on('click', () => $(`#${id} input[type=range]`).val(i));\r\n $(`#${id} .step-labels`).append(label);\r\n });\r\n\r\n var length = vals.length;\r\n var multiply = length / (length - 1);\r\n var widthVal = `calc(100% * ${multiply} - 25px)`;\r\n var marginVal = `calc(${widthVal} / ${length * -2} + 10px)`;\r\n\r\n $(`#${id} .step-labels`).css(\"width\", widthVal);\r\n $(`#${id} .step-labels`).css(\"margin-left\", marginVal);\r\n $(`#${id}`).show();\r\n}", "title": "" }, { "docid": "9fe819d62a6ebff20b9b0fcdfb6757c0", "score": "0.5337225", "text": "function WidgetSliderGUI() {\n this.addOutput(\"\", \"number\");\n this.properties = {\n value: 0.5,\n min: 0,\n max: 1,\n text: \"V\"\n };\n var that = this;\n this.size = [140, 40];\n this.slider = this.addWidget(\n \"slider\",\n \"V\",\n this.properties.value,\n function(v) {\n that.properties.value = v;\n },\n this.properties\n );\n this.widgets_up = true;\n }", "title": "" }, { "docid": "8b686d905352a80b893a5400cbdf0fa1", "score": "0.53219205", "text": "function performRangeChange(rangeId){\n\t\t//if(isRangeSame(rangeId))\t\t//We gotta check if the sliderRange is the same as the previous one\n\t\t\t//return;\n\t\tvar sliderRange = getSliderRange(rangeId);\n\t\tvar ageRange = convertToAgeRange(sliderRange);\n\t\t\n\t\tconsole.log(\"\"+rangeId+\":(\"+ageRange.min+\",\"+ageRange.max+\")\");\n\t\tsetupRegionShapes();\n\t}", "title": "" }, { "docid": "73485c4bb419ee6cdd002a2f8a540d1a", "score": "0.5319752", "text": "_constructSlider ({\n id = randomId(),\n min = 0,\n max = 100,\n step = 1,\n value = 0,\n color = randomColor(),\n label = ''\n }) {\n if (value < min) {\n throw new Error('Provided slider value can not be smaller than min.')\n }\n if (max < step) {\n throw new Error('Provided slider max can not be smaller than step.')\n }\n const [\n radius,\n size,\n viewBox,\n valueToArcRatio,\n stepToArcRatio,\n arcToValueRatio,\n value0,\n strokeDashArray,\n stepDecimals\n ] = this._calculateRenderProps(value, min, max, step)\n\n // Update svgSize to be used for scaling browser to svg coords\n this.svgSize = size\n\n // Create new slider arc\n const sliderElement = svg('path', {\n class: 'cs__slider',\n stroke: color,\n 'stroke-width': this.globalConfig.thickness,\n 'marker-end': `url(#cs-handle${this.uid})`,\n d: this._drawArc(this._valueToRadians(value0, valueToArcRatio), radius)\n })\n // Create background circle decoration\n const sliderDecor = svg('path', {\n class: 'cs__slider-decor',\n 'stroke-width': this.globalConfig.thickness,\n 'stroke-dasharray': strokeDashArray,\n d: this._drawArc(this.pi2, radius)\n })\n const sliderFragments = new DocumentFragment()\n sliderFragments.appendChild(sliderDecor)\n sliderFragments.appendChild(sliderElement)\n\n // Create info item\n const infoItem = html('li', { class: 'cs__info-item' },\n html('i', { class: 'cs__info-legend', style: `background-color:${color}` }),\n label && html('span', { class: 'cs__info-label' }, label)\n )\n const valueElement = html('span', { class: 'cs__info-value' }, value.toFixed(stepDecimals))\n infoItem.appendChild(valueElement)\n\n // Write to DOM\n this.dom.sliders.setAttributeNS(null, 'viewBox', viewBox)\n this.dom.sliders.appendChild(sliderFragments)\n this.dom.info.appendChild(infoItem)\n\n // Return references to DOM nodes with all calculated constants\n return {\n sliderElement,\n valueElement,\n id,\n min,\n max,\n step,\n stepDecimals,\n value,\n valueToArcRatio,\n stepToArcRatio,\n arcToValueRatio,\n radius\n }\n }", "title": "" }, { "docid": "a7d09dc21c5cf3760332fecdbaca4b7a", "score": "0.5316803", "text": "range(from, to = from) { return Range$1.create(from, to, this); }", "title": "" }, { "docid": "388d80c466059a4c4d20970c350ce6d2", "score": "0.5303983", "text": "function inputRanges() {\n document.querySelector(\".range-bottom\").innerHTML = minRange.value;\n document.querySelector(\".range-top\").innerHTML = maxRange.value;\n }", "title": "" }, { "docid": "ff84aefcef92c4089846a59dc3e1330f", "score": "0.5299852", "text": "function SliderIndicator(_dom, _slider, _slideTo){\n\n // attach the dom element\n this.dom = _dom;\n\n // add the parent slider and my index\n this.slider = _slider;\n this.slideTo = _slideTo;\n }", "title": "" }, { "docid": "fa0e44d668f7dc7ff87bfd15ec0b142e", "score": "0.52991116", "text": "function setSlider() {\n nSlider = select('#nSlider');\n nSlider.position(85, 22);\n}", "title": "" }, { "docid": "5e3485338b74a850714ea1bd36a3cf1b", "score": "0.5289958", "text": "function addSlider(object, propertyName) {\n var min = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.0;\n var max = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100.0;\n\n var slider = (0, _slider2.default)({\n textCreator: textCreator, propertyName: propertyName, object: object, min: min, max: max,\n initialValue: object[propertyName]\n });\n\n controllers.push(slider);\n hitscanObjects.push.apply(hitscanObjects, _toConsumableArray(slider.hitscan));\n\n return slider;\n }", "title": "" } ]
3cd4d7b984bc53df2c46a57725fa2724
CollectionChanges is considered dirty if it has any additions, moves, removals, or identity changes.
[ { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.65259504", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" } ]
[ { "docid": "203906454db16744dda4700b9d92e93b", "score": "0.6646814", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "203906454db16744dda4700b9d92e93b", "score": "0.6646814", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "f743068b563bb3880fde8ee5b5a44d4f", "score": "0.65439683", "text": "function IterableChanges() { }", "title": "" }, { "docid": "f743068b563bb3880fde8ee5b5a44d4f", "score": "0.65439683", "text": "function IterableChanges() { }", "title": "" }, { "docid": "f743068b563bb3880fde8ee5b5a44d4f", "score": "0.65439683", "text": "function IterableChanges() { }", "title": "" }, { "docid": "f743068b563bb3880fde8ee5b5a44d4f", "score": "0.65439683", "text": "function IterableChanges() { }", "title": "" }, { "docid": "f743068b563bb3880fde8ee5b5a44d4f", "score": "0.65439683", "text": "function IterableChanges() { }", "title": "" }, { "docid": "79641cf675fe9117f8f3d56f180e7df9", "score": "0.65174437", "text": "function IterableChanges(){}", "title": "" }, { "docid": "6781e5ba371438d1cf308e0afb0e7587", "score": "0.6475504", "text": "function IterableChanges() {}", "title": "" }, { "docid": "6781e5ba371438d1cf308e0afb0e7587", "score": "0.6475504", "text": "function IterableChanges() {}", "title": "" }, { "docid": "65ab8569aaedda78d47dce00bbe5dd02", "score": "0.61808085", "text": "hasChanges() {\n return !angular.equals(this.originalModel, this.model);\n }", "title": "" }, { "docid": "84d55d3007a73cdf01903456649b12a1", "score": "0.60464454", "text": "get isDirty() {\n if (this._isDirty) {\n return true;\n }\n if (this.relationChanges.length > 0) {\n return true;\n }\n const propDiffs = this.propertyDiff();\n if (propDiffs.length > 0) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "5f6da32a3eaf5ec11edb31e4af684799", "score": "0.60458195", "text": "function applyChanges() {\n changes = [];\n}", "title": "" }, { "docid": "994f0c71d50d6be7cecee9e3fce72390", "score": "0.60027003", "text": "isDirty() {\n return this._dirty\n }", "title": "" }, { "docid": "db38c774c116951eba83fedc31b02313", "score": "0.59798366", "text": "function flushChanges() {\n self.changes = [];\n }", "title": "" }, { "docid": "5f3fab13e9ef4552a690fd95040f4379", "score": "0.59077597", "text": "setDirty(value = true) {\n this._dirty = value ? this._dirty + 1 : 0;\n if (!value) {\n for (let rect of this.rects) {\n if (rect.setDirty)\n rect.setDirty(false);\n }\n }\n }", "title": "" }, { "docid": "72a45e8d07448a328cde1343b386ee37", "score": "0.5907359", "text": "get dirty() {\n return this._dirty;\n }", "title": "" }, { "docid": "72a45e8d07448a328cde1343b386ee37", "score": "0.5907359", "text": "get dirty() {\n return this._dirty;\n }", "title": "" }, { "docid": "9e6e32034511a3bf89151f57b57fdc54", "score": "0.59007937", "text": "@computed\n get isDirty() {\n return !isEqual(this.original.conditions, this.conditions);\n }", "title": "" }, { "docid": "ff78de5f9aa740568a80bd281a19a373", "score": "0.5878513", "text": "@computed\n get hasSetChanges() {\n return this.__setChanged;\n }", "title": "" }, { "docid": "9da54227593e06fa6a04c8ded6b417d8", "score": "0.5815017", "text": "get isDirty() {\n return this._dataDirty || this._inputDirty;\n }", "title": "" }, { "docid": "c28b0d3f63f499d5b3607c1026f633ab", "score": "0.5813553", "text": "setDirty() {\r\n this._setDirtyBits(-1 /* ALL */);\r\n }", "title": "" }, { "docid": "ff73f5a95757f1a69e2637104b2ecb9e", "score": "0.57746494", "text": "shouldUpdate(_changedProperties){return!0}", "title": "" }, { "docid": "66ae754183a77f5f974e528af36bb3b6", "score": "0.5761862", "text": "function checkDirty() {\n if(!canvas || sizeDirty || dataDirty) {\n render();\n if(!gridRendered) {\n gridRendered = true;\n renderGrid();\n }\n }\n }", "title": "" }, { "docid": "5dfe59e6a0ee541abb1e33a3f4f43674", "score": "0.5759826", "text": "_onCollectionUpdate(collection, options) {\n const changes = options.changes;\n this._removeChildModels(changes.removed);\n }", "title": "" }, { "docid": "25333b34542c882b8047f203d9797f9d", "score": "0.57554406", "text": "_onCollectionUpdate(collection, options) {\n const changes = options.changes;\n\n // Remove first since it'll be a shorter array lookup.\n const removedViews = changes.removed.length && this._removeChildModels(changes.removed);\n\n this._addedViews = changes.added.length && this._addChildModels(changes.added);\n\n this._detachChildren(removedViews);\n\n this.sort();\n\n // Destroy removed child views after all of the render is complete\n this._removeChildViews(removedViews);\n }", "title": "" }, { "docid": "38bad1cc2f55e2e8d9ddc5dee32febfd", "score": "0.57420236", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.5736819", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "be853521d2ac27d9f98f56660915b09b", "score": "0.56906796", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "be853521d2ac27d9f98f56660915b09b", "score": "0.56906796", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "1b2c6faf5627f70188c464c42b127172", "score": "0.5685571", "text": "get changes() {\n return this._changes.asObservable();\n }", "title": "" }, { "docid": "6f0f66fb057dbcab94e8dc91d2a51c41", "score": "0.56815565", "text": "function CompoundChange () {\n\t\tthis.changes = [];\n\t}", "title": "" }, { "docid": "6f0f66fb057dbcab94e8dc91d2a51c41", "score": "0.56815565", "text": "function CompoundChange () {\n\t\tthis.changes = [];\n\t}", "title": "" }, { "docid": "bbf5451f7b48bbba6f44ddba6be8f6f0", "score": "0.56617856", "text": "_dirtyCheck() {\n this._dirtyAll = true;\n const items = this._dirty;\n if (!items.length || !this._dirtyID) return true;\n const id = ++this._dirtyID;\n let item, mark, type, mdef, i, n, o;\n for ((i = 0, n = items.length); i < n; ++i) {\n item = items[i];\n mark = item.mark;\n if (mark.marktype !== type) {\n // memoize mark instance lookup\n type = mark.marktype;\n mdef = Marks[type];\n }\n if (mark.zdirty && mark.dirty !== id) {\n this._dirtyAll = false;\n dirtyParents(item, id);\n mark.items.forEach(i => {\n i.dirty = id;\n });\n }\n if (mark.zdirty) continue;\n // handle in standard drawing pass\n if (item.exit) {\n // EXIT\n if (mdef.nested && mark.items.length) {\n // if nested mark with remaining points, update instead\n o = mark.items[0];\n if (o._svg) this._update(mdef, o._svg, o);\n } else if (item._svg) {\n // otherwise remove from DOM\n o = item._svg.parentNode;\n if (o) o.removeChild(item._svg);\n }\n item._svg = null;\n continue;\n }\n item = mdef.nested ? mark.items[0] : item;\n if (item._update === id) continue;\n // already visited\n if (!item._svg || !item._svg.ownerSVGElement) {\n // ENTER\n this._dirtyAll = false;\n dirtyParents(item, id);\n } else {\n // IN-PLACE UPDATE\n this._update(mdef, item._svg, item);\n }\n item._update = id;\n }\n return !this._dirtyAll;\n }", "title": "" }, { "docid": "e1ed73008c492130da40897f6a1796c2", "score": "0.5654348", "text": "set dirty(d) { this._dirty = d; }", "title": "" }, { "docid": "dce8707137d690316e07b556c5706a30", "score": "0.56524926", "text": "function markChangesSweep() {\n // intentionally we process the proxies in reverse order;\n // ideally we start by processing leafs in the tree, because if a child has changed, we don't have to check the parent anymore\n // reverse order of proxy creation approximates this\n for (var i = states.length - 1; i >= 0; i--) {\n var state = states[i];\n if (state.modified === false) {\n if (Array.isArray(state.base)) {\n if (hasArrayChanges(state)) markChanged$1(state);\n } else if (hasObjectChanges(state)) markChanged$1(state);\n }\n }\n}", "title": "" }, { "docid": "1c0a4ddfcf555d338b41763dd6d386e3", "score": "0.5637102", "text": "get dirty() {\n if (!this._dirtyBounds) {\n return null;\n }\n return this._slice(this.dirtyBounds);\n }", "title": "" }, { "docid": "6f354c02ea4963cc0b49cf3b76c2b9f4", "score": "0.5637043", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "d1651aca3f39563646590545c1499c8d", "score": "0.5627395", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "d1651aca3f39563646590545c1499c8d", "score": "0.5627395", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "4fb557fe621f36b9d661130d58729b6f", "score": "0.55667806", "text": "setConvexHullDirty () {\n this._convexHullDirty = true;\n }", "title": "" }, { "docid": "76df1eabd19505c9ad48b970bbca1e14", "score": "0.5562931", "text": "markedChange() {\n this.bChanged = true;\n }", "title": "" }, { "docid": "76a34098b88716a03ac878d7c2d1b068", "score": "0.55622226", "text": "function reconcileCollection(root,new$,old,caret){\n\t\tvar k = new$.length;\n\t\tvar i = k;\n\t\tvar last = new$[k - 1];\n\t\t\n\t\t\n\t\tif (k == old.length && new$[0] === old[0]) {\n\t\t\t// running through to compare\n\t\t\twhile (i--){\n\t\t\t\tif (new$[i] !== old[i]) { break; };\n\t\t\t};\n\t\t};\n\t\t\n\t\tif (i == -1) {\n\t\t\treturn last && last._dom || caret;\n\t\t} else {\n\t\t\treturn reconcileCollectionChanges(root,new$,old,caret);\n\t\t};\n\t}", "title": "" }, { "docid": "6b8e5943dbe8f3836b39cb5278dc6591", "score": "0.5553012", "text": "_dirtyCheck() {\n this._dirtyAll = true;\n const items = this._dirty;\n if (!items.length || !this._dirtyID) return true;\n const id = ++this._dirtyID;\n let item, mark, type, mdef, i, n, o;\n\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n mark = item.mark;\n\n if (mark.marktype !== type) {\n // memoize mark instance lookup\n type = mark.marktype;\n mdef = Marks[type];\n }\n\n if (mark.zdirty && mark.dirty !== id) {\n this._dirtyAll = false;\n dirtyParents(item, id);\n mark.items.forEach(i => {\n i.dirty = id;\n });\n }\n\n if (mark.zdirty) continue; // handle in standard drawing pass\n\n if (item.exit) {\n // EXIT\n if (mdef.nested && mark.items.length) {\n // if nested mark with remaining points, update instead\n o = mark.items[0];\n if (o._svg) this._update(mdef, o._svg, o);\n } else if (item._svg) {\n // otherwise remove from DOM\n o = item._svg.parentNode;\n if (o) o.removeChild(item._svg);\n }\n\n item._svg = null;\n continue;\n }\n\n item = mdef.nested ? mark.items[0] : item;\n if (item._update === id) continue; // already visited\n\n if (!item._svg || !item._svg.ownerSVGElement) {\n // ENTER\n this._dirtyAll = false;\n dirtyParents(item, id);\n } else {\n // IN-PLACE UPDATE\n this._update(mdef, item._svg, item);\n }\n\n item._update = id;\n }\n\n return !this._dirtyAll;\n }", "title": "" }, { "docid": "41d0c50f8d255fbc73e08c54578940b7", "score": "0.5532223", "text": "function _clean() {\n Object.keys(this._dataAttributes).forEach(dataAttributeKey => {\n if (this._dataAttributes[dataAttributeKey]) {\n this._dataAttributes[dataAttributeKey].isDirty = false;\n }\n });\n}", "title": "" }, { "docid": "249ee2a8603b0834b755fe89a131ba83", "score": "0.5511695", "text": "async hasPendingChanges() {\n throw Error('Not implemented')\n }", "title": "" }, { "docid": "bc6c5de7a860156156cf597ca04b2d60", "score": "0.54987967", "text": "itemsChanged(newValue, oldValue, flags) {\n this.checkCollectionObserver();\n this.processViews(null, flags | exports.LifecycleFlags.updateTargetInstance);\n }", "title": "" }, { "docid": "7df7065990ecdc2b5da8ec937d19238f", "score": "0.54972595", "text": "reportChanged() {\n startBatch();\n // .build.es6/core/observable.js 里定义的propagateChanged\n propagateChanged(this);\n endBatch();\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "4a322891f9e3949e0c263670dc538f10", "score": "0.5493304", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "15ffd1da89fe360f249aec2ceb688a0d", "score": "0.5488987", "text": "function dnd_doWFMapDirtyDetection()\r\n{\r\n\twfMapDirtyDetection = true;\r\n}", "title": "" }, { "docid": "b43e2f79f3490993ffeb83415d070f4d", "score": "0.5463309", "text": "async getChanges() {\n throw Error('Not implemented')\n }", "title": "" }, { "docid": "e79eabc884e203ffa044e14273d58533", "score": "0.5461884", "text": "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "title": "" }, { "docid": "e79eabc884e203ffa044e14273d58533", "score": "0.5461884", "text": "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "title": "" }, { "docid": "adbcc734c234e24610df1e9eb66982f8", "score": "0.5437133", "text": "setTransformDirty () {\n this._transformDirty = true;\n this._inverseTransformDirty = true;\n this._transformedHullDirty = true;\n }", "title": "" }, { "docid": "e711fceb871100850bd93de25d8fbc93", "score": "0.5431802", "text": "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n } else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail) this._changesTail._nextChanged = null;\n if (this._additionsTail) this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "title": "" }, { "docid": "92f776730493d87f4195154b31feed03", "score": "0.5427662", "text": "function ChangeEventBuffer(collection) {\n this.subs = [];\n this.limit = 100;\n this.counter = 0;\n this.eventCounterMap = new WeakMap();\n this.buffer = [];\n this.collection = collection;\n this.subs.push(this.collection.$.pipe((0, _operators.filter)(cE => !cE.isLocal)).subscribe(cE => this._handleChangeEvent(cE)));\n }", "title": "" }, { "docid": "5b4f73e21687030f5dd2e7eae4afc04d", "score": "0.54190594", "text": "_updateDirtyBounds(bounds) {\n if (!this._dirtyBounds) {\n this._dirtyBounds = bounds;\n } else {\n const [ sx, sy, ex, ey ] = bounds;\n const [ dsx, dsy, dex, dey ] = this._dirtyBounds;\n this._dirtyBounds = [ Math.min(sx, dsx), Math.min(sy, dsy), Math.max(ex, dex), Math.max(ey, dey) ];\n }\n }", "title": "" }, { "docid": "a66e3211ecd690cff5afe5bdc11f617a", "score": "0.5415197", "text": "onUnsavedChangesChanged() {\n if (this._unsavedChangesChanged) {\n this._unsavedChangesChanged.raise();\n }\n }", "title": "" }, { "docid": "5dcd9bf51b42d3502f088adbfc86d421", "score": "0.541517", "text": "checkDirty() {\n if(this.select_.value && this.select_.value.length > 0) {\n this.element_.classList.add(this.CssClasses_.IS_DIRTY);\n } else {\n this.element_.classList.remove(this.CssClasses_.IS_DIRTY);\n }\n }", "title": "" }, { "docid": "e4faac120eec05c56658514f50aefd6c", "score": "0.54142636", "text": "checkCollectionObserver(flags) {\n const oldObserver = this.observer;\n\n if (flags & 64\n /* fromUnbind */\n ) {\n if (oldObserver !== void 0) {\n oldObserver.unsubscribe(this);\n }\n } else if (this.$controller.isActive) {\n const newObserver = this.observer = (0, _runtime.getCollectionObserver)(this.items);\n\n if (oldObserver !== newObserver && oldObserver) {\n oldObserver.unsubscribe(this);\n }\n\n if (newObserver) {\n newObserver.subscribe(this);\n }\n }\n }", "title": "" }, { "docid": "0301a381198d7b4b4b8ea0bee90af19d", "score": "0.54127616", "text": "checkDataChanges() { }", "title": "" }, { "docid": "516855baa514c0c52b731e1e3662905c", "score": "0.5410426", "text": "cloneObserversOnChange() {\n if (this._inheritingObservers) {\n this._inheritingObservers = false;\n this.observers = cloneObserverCollection(this.observers);\n }\n }", "title": "" }, { "docid": "012ff203329ef7f698cf4d41baf5f810", "score": "0.54079837", "text": "function IterableChangeRecord() { }", "title": "" }, { "docid": "012ff203329ef7f698cf4d41baf5f810", "score": "0.54079837", "text": "function IterableChangeRecord() { }", "title": "" }, { "docid": "012ff203329ef7f698cf4d41baf5f810", "score": "0.54079837", "text": "function IterableChangeRecord() { }", "title": "" }, { "docid": "012ff203329ef7f698cf4d41baf5f810", "score": "0.54079837", "text": "function IterableChangeRecord() { }", "title": "" }, { "docid": "012ff203329ef7f698cf4d41baf5f810", "score": "0.54079837", "text": "function IterableChangeRecord() { }", "title": "" }, { "docid": "4dd5e505770e45927541e71cc214e8e5", "score": "0.53966665", "text": "modify() {\n this.bChanged = true;\n }", "title": "" }, { "docid": "a07da251cac8005afad5f6b19c29c86b", "score": "0.5392936", "text": "get changes() {\n return this._changes || (this._changes = new EventEmitter());\n }", "title": "" }, { "docid": "043bf2e995a0b1fa90deb6e53336e6a7", "score": "0.5391978", "text": "applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) {\n // Rearrange the views to put them in the right location.\n changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => {\n let view;\n let operation;\n if (record.previousIndex == null) { // Item added.\n const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record));\n operation = view ? 1 /* INSERTED */ : 0 /* REPLACED */;\n }\n else if (currentIndex == null) { // Item removed.\n this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef);\n operation = 3 /* REMOVED */;\n }\n else { // Item moved.\n view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record));\n operation = 2 /* MOVED */;\n }\n if (itemViewChanged) {\n itemViewChanged({\n context: view === null || view === void 0 ? void 0 : view.context,\n operation,\n record,\n });\n }\n });\n }", "title": "" }, { "docid": "043bf2e995a0b1fa90deb6e53336e6a7", "score": "0.5391978", "text": "applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) {\n // Rearrange the views to put them in the right location.\n changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => {\n let view;\n let operation;\n if (record.previousIndex == null) { // Item added.\n const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record));\n operation = view ? 1 /* INSERTED */ : 0 /* REPLACED */;\n }\n else if (currentIndex == null) { // Item removed.\n this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef);\n operation = 3 /* REMOVED */;\n }\n else { // Item moved.\n view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record));\n operation = 2 /* MOVED */;\n }\n if (itemViewChanged) {\n itemViewChanged({\n context: view === null || view === void 0 ? void 0 : view.context,\n operation,\n record,\n });\n }\n });\n }", "title": "" }, { "docid": "043bf2e995a0b1fa90deb6e53336e6a7", "score": "0.5391978", "text": "applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) {\n // Rearrange the views to put them in the right location.\n changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => {\n let view;\n let operation;\n if (record.previousIndex == null) { // Item added.\n const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record));\n operation = view ? 1 /* INSERTED */ : 0 /* REPLACED */;\n }\n else if (currentIndex == null) { // Item removed.\n this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef);\n operation = 3 /* REMOVED */;\n }\n else { // Item moved.\n view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record));\n operation = 2 /* MOVED */;\n }\n if (itemViewChanged) {\n itemViewChanged({\n context: view === null || view === void 0 ? void 0 : view.context,\n operation,\n record,\n });\n }\n });\n }", "title": "" }, { "docid": "043bf2e995a0b1fa90deb6e53336e6a7", "score": "0.5391978", "text": "applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) {\n // Rearrange the views to put them in the right location.\n changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => {\n let view;\n let operation;\n if (record.previousIndex == null) { // Item added.\n const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record));\n operation = view ? 1 /* INSERTED */ : 0 /* REPLACED */;\n }\n else if (currentIndex == null) { // Item removed.\n this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef);\n operation = 3 /* REMOVED */;\n }\n else { // Item moved.\n view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record));\n operation = 2 /* MOVED */;\n }\n if (itemViewChanged) {\n itemViewChanged({\n context: view === null || view === void 0 ? void 0 : view.context,\n operation,\n record,\n });\n }\n });\n }", "title": "" }, { "docid": "3def403e0072b7eb5c5b635d3a13158b", "score": "0.53919613", "text": "hasChanges() {\n let initData = this[initialData];\n if (!initData) return true;\n let currentData = JSON.stringify(this.getData());\n return (initData !== currentData);\n }", "title": "" }, { "docid": "7070c07ea12b7f68b236bdfd388815b6", "score": "0.5382452", "text": "function IterableChangeRecord() {}", "title": "" }, { "docid": "7070c07ea12b7f68b236bdfd388815b6", "score": "0.5382452", "text": "function IterableChangeRecord() {}", "title": "" }, { "docid": "41a2d8850f49b121a3a12d0c79a0ea77", "score": "0.5378186", "text": "markChanged() {\n this.bChanged = true;\n }", "title": "" } ]
52c3484283855fe302e0dbb254a7cf1b
Set the curve link colour RGB Quick functuon to convert base RGB colours to p5.js's rgba color model Inputs are: rgbColor = an RGB array alphaValue = RGBA alpha value from 0 to 1
[ { "docid": "e5e2dd1b2bd8a6b4bedf0bd363fddb90", "score": "0.68104446", "text": "function setAlpha(rgbColor, alphaValue) {\n var rgbOutput = rgbColor.slice(); // Copy rgbColor array\n alphaValue = Math.round(255 * alphaValue); // Convert to nearest integer \n rgbOutput.push(alphaValue); // Build the output array\n return rgbOutput;\n}", "title": "" } ]
[ { "docid": "1608e0e0169392b09d1f581e8fb30a1b", "score": "0.65028626", "text": "function RGB2Color(r,g,b,alpha){\n return 'rgba(' + Math.round(r) + ',' + Math.round(g) + ',' + Math.round(b) + ','+alpha+')';\n}", "title": "" }, { "docid": "eedc8b4d2217e6a2ccd7ed3d3742c16a", "score": "0.6324185", "text": "function rgba(r, g, b, a){\n let color = {};\n color.r = r;\n color.g = g;\n color.b = b;\n color.a = a;\n return color;\n}", "title": "" }, { "docid": "1a9b1d189d25641cb3c3c682e5a3f981", "score": "0.6318646", "text": "set rgb(rgbaArray) {\n this.setColor(...rgbaArray)\n }", "title": "" }, { "docid": "3d4c1da82cbef025ab69f21f147421d8", "score": "0.6187967", "text": "function rgba(r,g,b,a){\n r = (r != undefined) ? r:255;\n g = (g != undefined) ? g:r;\n b = (b != undefined) ? b:g;\n a = (a != undefined) ? a:1.0;\n return \"rgba(\"+Math.floor(r)+\",\"+Math.floor(g)+\",\"+Math.floor(b)+\",\"+a.toFixed(3)+\")\"\n}", "title": "" }, { "docid": "5eb31a288dae03436cddae01c83d01b9", "score": "0.6186127", "text": "function convertLinearToRGBE(color){var maxComponent=Math.max(color.r,color.g,color.b);var fExp=Math.min(Math.max(Math.ceil(Math.log2(maxComponent)),-128.0),127.0);color.multiplyScalar(Math.pow(2.0,-fExp));var alpha=(fExp+128.0)/255.0;return alpha;}", "title": "" }, { "docid": "5eb31a288dae03436cddae01c83d01b9", "score": "0.6186127", "text": "function convertLinearToRGBE(color){var maxComponent=Math.max(color.r,color.g,color.b);var fExp=Math.min(Math.max(Math.ceil(Math.log2(maxComponent)),-128.0),127.0);color.multiplyScalar(Math.pow(2.0,-fExp));var alpha=(fExp+128.0)/255.0;return alpha;}", "title": "" }, { "docid": "1ebfa3e51a4f65966178f9c257673dd3", "score": "0.61674106", "text": "setColorObject(rgbObject){this._color.setColor(rgbObject.r, rgbObject.g, rgbObject.b);}", "title": "" }, { "docid": "c73ac826392d384c332270dcba47ceb1", "score": "0.6145116", "text": "function Color (r, g, b, a) {\r\n \r\n var rgba = ['r','g','b','a'];\r\n var x = 4; //rgba.length\r\n \r\n while (-1<--x) {\r\n this[rgba[x]] = arguments[x] || ((x==3) ? 1.0 : 0);\r\n }\r\n \r\n this.toString = function() {\r\n if (this.a >= 1.0) {\r\n return \"rgb(\"+[this.r,this.g,this.b].join(\",\")+\")\";\r\n } else {\r\n return \"rgba(\"+[this.r,this.g,this.b,this.a].join(\",\")+\")\";\r\n }\r\n };\r\n\r\n this.scale = function(rf, gf, bf, af) {\r\n x = 4; //rgba.length\r\n while (-1<--x) {\r\n if (arguments[x] != null)\r\n this[rgba[x]] *= arguments[x];\r\n }\r\n return this.normalize();\r\n };\r\n\r\n this.adjust = function(rd, gd, bd, ad) {\r\n x = 4; //rgba.length\r\n while (-1<--x) {\r\n if (arguments[x] != null)\r\n this[rgba[x]] += arguments[x];\r\n }\r\n return this.normalize();\r\n };\r\n\r\n this.clone = function() {\r\n return new Color(this.r, this.b, this.g, this.a);\r\n };\r\n\r\n var limit = function(val,minVal,maxVal) {\r\n return Math.max(Math.min(val, maxVal), minVal);\r\n };\r\n\r\n this.normalize = function() {\r\n this.r = limit(parseInt(this.r), 0, 255);\r\n this.g = limit(parseInt(this.g), 0, 255);\r\n this.b = limit(parseInt(this.b), 0, 255);\r\n this.a = limit(this.a, 0, 1);\r\n return this;\r\n };\r\n\r\n this.normalize();\r\n }", "title": "" }, { "docid": "a495188d4c8c0f74642213c9991f6d9f", "score": "0.6144369", "text": "function rgb() {\n\t\t\tvar animTime = 20;\n\t\t\tvar now = new Date().getTime();\n\t\t\tvar sync = now / 1000 % animTime;\n\t\t\tvar hue = (360 / animTime) * sync;\n\t\t\tdocument.documentElement.style.setProperty('--rgb', 'hsl(' + hue + ',100%,50%)');\n\t\t\tdocument.documentElement.style.setProperty('--rgb-d', 'hsl(' + hue + ',100%,25%)');\n\t\t\tdocument.documentElement.style.setProperty('--rgb-l', 'hsl(' + hue + ',100%,75%)');\n\t\t\trequestAnimationFrame(rgb);\n\t\t}", "title": "" }, { "docid": "da8e9c838932fc52643def30a55368cf", "score": "0.6142838", "text": "function RGBColor(c){this.ok=!1;\"#\"==c.charAt(0)&&(c=c.substr(1,6));c=c.replace(/0x/,\"\");c=c.replace(/ /g,\"\");c=c.toLowerCase();var g={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"00ffff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000000\",blanchedalmond:\"ffebcd\",blue:\"0000ff\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"00ffff\",\ndarkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dodgerblue:\"1e90ff\",feldspar:\"d19275\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",\nfuchsia:\"ff00ff\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgrey:\"d3d3d3\",lightgreen:\"90ee90\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",\nlightskyblue:\"87cefa\",lightslateblue:\"8470ff\",lightslategray:\"778899\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"00ff00\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"ff00ff\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370d8\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",\nnavy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"d87093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",red:\"ff0000\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",\nslateblue:\"6a5acd\",slategray:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",violetred:\"d02090\",wheat:\"f5deb3\",white:\"ffffff\",whitesmoke:\"f5f5f5\",yellow:\"ffff00\",yellowgreen:\"9acd32\"},f;for(f in g)c==f&&(c=g[f]);var l=[{re:/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,example:[\"rgb(123, 234, 45)\",\"rgb(255,234,245)\"],process:function(c){return[parseInt(c[1]),parseInt(c[2]),parseInt(c[3])]}},\n{re:/^(\\w{2})(\\w{2})(\\w{2})$/,example:[\"#00ff00\",\"336699\"],process:function(c){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]}},{re:/^(\\w{1})(\\w{1})(\\w{1})$/,example:[\"#fb0\",\"f0f\"],process:function(c){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]}}];for(f=0;f<l.length;f++){var m=l[f].process,p=l[f].re.exec(c);p&&(channels=m(p),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=0>this.r||isNaN(this.r)?0:255<this.r?255:this.r;this.g=\n0>this.g||isNaN(this.g)?0:255<this.g?255:this.g;this.b=0>this.b||isNaN(this.b)?0:255<this.b?255:this.b;this.toRGB=function(){return\"rgb(\"+this.r+\", \"+this.g+\", \"+this.b+\")\"};this.toHex=function(){var c=this.r.toString(16),f=this.g.toString(16),g=this.b.toString(16);1==c.length&&(c=\"0\"+c);1==f.length&&(f=\"0\"+f);1==g.length&&(g=\"0\"+g);return\"#\"+c+f+g};this.getHelpXML=function(){for(var c=[],f=0;f<l.length;f++)for(var m=l[f].example,p=0;p<m.length;p++)c[c.length]=m[p];for(var x in g)c[c.length]=x;m=\ndocument.createElement(\"ul\");m.setAttribute(\"id\",\"rgbcolor-examples\");for(f=0;f<c.length;f++)try{var y=document.createElement(\"li\"),C=new RGBColor(c[f]),M=document.createElement(\"div\");M.style.cssText=\"margin: 3px; border: 1px solid black; background:\"+C.toHex()+\"; color:\"+C.toHex();M.appendChild(document.createTextNode(\"test\"));var K=document.createTextNode(\" \"+c[f]+\" -> \"+C.toRGB()+\" -> \"+C.toHex());y.appendChild(M);y.appendChild(K);m.appendChild(y)}catch(F){}return m}}", "title": "" }, { "docid": "28e54449162e089a80c788318d7555a4", "score": "0.61013424", "text": "function rgba(r, g, b, a) {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n}", "title": "" }, { "docid": "17c0c458280f40f52d0b3a14efb62ed0", "score": "0.6079698", "text": "function setColour (r,g,b,a) {\n ctx.strokeStyle = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + a + \")\";\n turtle.colour.r = r;\n turtle.colour.g = g;\n turtle.colour.b = b;\n turtle.colour.a = a;\n}", "title": "" }, { "docid": "3f90e7724133fb968d7b75de724fdee8", "score": "0.6069716", "text": "function rgba(r, g, b, a) {\n if (exports.DEBUG)\n console.log(\"rgba: build\");\n return from(r).combine(function () {\n if (exports.DEBUG)\n console.log(\"rgba: init\");\n return function (r, g, b, a) {\n var val = \"rgba(\" + Math.floor(r) + \",\" + Math.floor(g) + \",\" + Math.floor(b) + \",\" + a + \")\";\n if (exports.DEBUG)\n console.log(\"rgba: \", val);\n return val;\n };\n }, from(g), from(b), from(a));\n}", "title": "" }, { "docid": "45db7929c2378eab97f7537bad1071d4", "score": "0.6064639", "text": "function setColor(color){\r\n\tfor(var i = 0; i < 3; i++){\r\n\t\trgb[i] = color[i] * 253;\r\n\t}\r\n}", "title": "" }, { "docid": "d4bdbfc59b878ea125524073f6dd8892", "score": "0.6061988", "text": "setColor(color){\n this.color = color ;\n this.curve.setUniform('color',this.color);\n return ;\n }", "title": "" }, { "docid": "bbcbe997cd6185cc9fe7a7658d333f4b", "score": "0.60593635", "text": "function rgba (r, g, b, a) {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'\n}", "title": "" }, { "docid": "e87ecc91ba617031b476e9fdc4fd6b1c", "score": "0.6047574", "text": "function curveColor(color=0) {\n color = parseInt(color,10);\n if (color > 0) {\n return Math.min(255, color+64);\n }\n return color;\n}", "title": "" }, { "docid": "10ec946efc75f795b9abb513c6a534f5", "score": "0.60438323", "text": "_colorToRGBA(inColor) {\r\n // return color if found in colorCache...\r\n if (inColor in this.colorCache) {\r\n return this.colorCache[inColor];\r\n }\r\n \r\n var theColor = inColor;\r\n // Check for 'var' colors\r\n let a0 = inColor.substr(0,3);\r\n if (a0.valueOf() === 'var') {\r\n theColor = this._getColorVariable(inColor);\r\n }\r\n \r\n // Get color from canvas. This always returns an rgba() value...\r\n var canvas = document.createElement('canvas');\r\n canvas.width = canvas.height = 1;\r\n var ctx = canvas.getContext('2d');\r\n \r\n ctx.clearRect(0, 0, 1, 1);\r\n ctx.fillStyle = theColor;\r\n ctx.fillRect(0, 0, 1, 1);\r\n const outColor = [ ...ctx.getImageData(0, 0, 1, 1).data ];\r\n \r\n this.colorCache[inColor] = outColor;\r\n return outColor;\r\n }", "title": "" }, { "docid": "72a6de71bd6b9ac5c80a6d653c2cf702", "score": "0.60282", "text": "function addColor () {\n\tvar canvasColor = document.getElementById(\"palette\");\n\tvar rSlider = document.getElementById(\"red-range\");\n\tvar gSlider = document.getElementById(\"green-range\");\n\tvar bSlider = document.getElementById(\"blue-range\");\n\tmodalColor[0] = rSlider.value;\n\tmodalColor[1] = gSlider.value;\n\tmodalColor[2] = bSlider.value;\n\tvar newColor = \"rgb(\" + modalColor[0] + \", \" + modalColor[1] + \", \" +\n\t\t\t\t\tmodalColor[2] + \")\";\n\tcanvasColor.appendChild(addPixel(newColor, true));\n\tpalette.push(newColor);\n\tcurrentColor = palette[palette.length-1];\n\tcloseModal();\n}", "title": "" }, { "docid": "dc19b0babac06374c840775cf5970d97", "score": "0.60265183", "text": "function rgba(color){\n\treturn [color[0]/255, color[1]/255, color[2]/255, color[3]/100];\n}", "title": "" }, { "docid": "b69afa55d0dce866296b71d21082ff89", "score": "0.6021278", "text": "function colorRandomizer() {\n \n// Here i generate random values for each RGB parameter between 0 & 256\n \nlet R = Math.round(Math.random()*256);\nlet G= Math.round(Math.random()*256);\nlet B= Math.round(Math.random()*256) ;\n \n//Here i convert the RGB values to HEX, Base 16\n \nR= R.toString(16);\nG= G.toString(16);\nB= B.toString(16); \nlet newColor =\"#\" + R + G +B;\n \n return newColor;\n \n}", "title": "" }, { "docid": "bd2a77bb39498bcdb3c9f808565f8695", "score": "0.6013169", "text": "function RGBColor(t){this.ok=!1,\"#\"==t.charAt(0)&&(t=t.substr(1,6)),t=t.replace(/ /g,\"\"),t=t.toLowerCase();var e={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"00ffff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000000\",blanchedalmond:\"ffebcd\",blue:\"0000ff\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"00ffff\",darkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dodgerblue:\"1e90ff\",feldspar:\"d19275\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"ff00ff\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgrey:\"d3d3d3\",lightgreen:\"90ee90\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",lightslateblue:\"8470ff\",lightslategray:\"778899\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"00ff00\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"ff00ff\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370d8\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"d87093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",red:\"ff0000\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",slategray:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",violetred:\"d02090\",wheat:\"f5deb3\",white:\"ffffff\",whitesmoke:\"f5f5f5\",yellow:\"ffff00\",yellowgreen:\"9acd32\"};for(var A in e)t==A&&(t=e[A]);for(var n=[{re:/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,example:[\"rgb(123, 234, 45)\",\"rgb(255,234,245)\"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\\w{2})(\\w{2})(\\w{2})$/,example:[\"#00ff00\",\"336699\"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\\w{1})(\\w{1})(\\w{1})$/,example:[\"#fb0\",\"f0f\"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],i=0;i<n.length;i++){var r=n[i].re,s=n[i].process,o=r.exec(t);o&&(channels=s(o),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return\"rgb(\"+this.r+\", \"+this.g+\", \"+this.b+\")\"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),A=this.b.toString(16);return 1==t.length&&(t=\"0\"+t),1==e.length&&(e=\"0\"+e),1==A.length&&(A=\"0\"+A),\"#\"+t+e+A},this.getHelpXML=function(){for(var t=new Array,A=0;A<n.length;A++)for(var i=n[A].example,r=0;r<i.length;r++)t[t.length]=i[r];for(var s in e)t[t.length]=s;var o=document.createElement(\"ul\");o.setAttribute(\"id\",\"rgbcolor-examples\");for(var A=0;A<t.length;A++)try{var a=document.createElement(\"li\"),c=new RGBColor(t[A]),l=document.createElement(\"div\");l.style.cssText=\"margin: 3px; border: 1px solid black; background:\"+c.toHex()+\"; color:\"+c.toHex(),l.appendChild(document.createTextNode(\"test\"));var u=document.createTextNode(\" \"+t[A]+\" -> \"+c.toRGB()+\" -> \"+c.toHex());a.appendChild(l),a.appendChild(u),o.appendChild(a)}catch(h){}return o}}", "title": "" }, { "docid": "bd2a77bb39498bcdb3c9f808565f8695", "score": "0.6013169", "text": "function RGBColor(t){this.ok=!1,\"#\"==t.charAt(0)&&(t=t.substr(1,6)),t=t.replace(/ /g,\"\"),t=t.toLowerCase();var e={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"00ffff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000000\",blanchedalmond:\"ffebcd\",blue:\"0000ff\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"00ffff\",darkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dodgerblue:\"1e90ff\",feldspar:\"d19275\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"ff00ff\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgrey:\"d3d3d3\",lightgreen:\"90ee90\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",lightslateblue:\"8470ff\",lightslategray:\"778899\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"00ff00\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"ff00ff\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370d8\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"d87093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",red:\"ff0000\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",slategray:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",violetred:\"d02090\",wheat:\"f5deb3\",white:\"ffffff\",whitesmoke:\"f5f5f5\",yellow:\"ffff00\",yellowgreen:\"9acd32\"};for(var A in e)t==A&&(t=e[A]);for(var n=[{re:/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,example:[\"rgb(123, 234, 45)\",\"rgb(255,234,245)\"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\\w{2})(\\w{2})(\\w{2})$/,example:[\"#00ff00\",\"336699\"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\\w{1})(\\w{1})(\\w{1})$/,example:[\"#fb0\",\"f0f\"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],i=0;i<n.length;i++){var r=n[i].re,s=n[i].process,o=r.exec(t);o&&(channels=s(o),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return\"rgb(\"+this.r+\", \"+this.g+\", \"+this.b+\")\"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),A=this.b.toString(16);return 1==t.length&&(t=\"0\"+t),1==e.length&&(e=\"0\"+e),1==A.length&&(A=\"0\"+A),\"#\"+t+e+A},this.getHelpXML=function(){for(var t=new Array,A=0;A<n.length;A++)for(var i=n[A].example,r=0;r<i.length;r++)t[t.length]=i[r];for(var s in e)t[t.length]=s;var o=document.createElement(\"ul\");o.setAttribute(\"id\",\"rgbcolor-examples\");for(var A=0;A<t.length;A++)try{var a=document.createElement(\"li\"),c=new RGBColor(t[A]),l=document.createElement(\"div\");l.style.cssText=\"margin: 3px; border: 1px solid black; background:\"+c.toHex()+\"; color:\"+c.toHex(),l.appendChild(document.createTextNode(\"test\"));var u=document.createTextNode(\" \"+t[A]+\" -> \"+c.toRGB()+\" -> \"+c.toHex());a.appendChild(l),a.appendChild(u),o.appendChild(a)}catch(h){}return o}}", "title": "" }, { "docid": "3e4870a8b908900dacf08f3b49f8807d", "score": "0.6002023", "text": "function setColorAlpha(buffer, startIndex, rgb, alpha) {\n var overlayColor = [rgb[0] * alpha, rgb[1] * alpha, rgb[2] * alpha];\n\n for (var i = 0; i < 3; i++) {\n buffer[startIndex + i] = overlayColor[i] + buffer[startIndex + i] * (1 - alpha);\n }\n }", "title": "" }, { "docid": "072de9e94fa21963e76742694a9d0643", "score": "0.5990824", "text": "function Color(r = 0, g = 0, b = 0, a = 1) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n this.renderColor = function() {\n return `rgba(${this.r},${this.g},${this.b},${this.a})`;\n }\n this.setColor = function(c) {\n this.r = c[0];\n this.g = c[1];\n this.b = c[2];\n this.a = c[3];\n }\n}", "title": "" }, { "docid": "09d3052d959bfa81086ce8a67417008b", "score": "0.5988621", "text": "function convertAlphaColor(color){\n if(color.length == 6){\n //convert abbreviated hexes to normal hexes\n color = \"#\"+color[1]+color[1]+color[2]+color[2]+color[3]+color[3];\n }\n return 'rgba('+base16To10(color[1]+color[2])+','+base16To10(color[3]+color[4])+','+base16To10(color[5]+color[6])+','+(base16To10(color[7]+color[8])/255)+')';\n \n}", "title": "" }, { "docid": "4e09bc57102333c1129106169df8c6a8", "score": "0.5987289", "text": "setColor(r, g, b, a = 255) {\n this.checkColorChange()\n this[0] = r\n this[1] = g\n this[2] = b\n this[3] = a\n }", "title": "" }, { "docid": "02f75f150b58420bafe0beaba06b3833", "score": "0.59707075", "text": "setColor(r,g,b){this._color.setColor(r,g,b);}", "title": "" }, { "docid": "9d2bbb2234ac4025c6c491c301ebe25a", "score": "0.5964203", "text": "function RGBColor(a) {\r\n this.ok = !1;\r\n \"#\" == a.charAt(0) && (a = a.substr(1, 6));\r\n a = a.replace(/ /g, \"\");\r\n a = a.toLowerCase();\r\n var b = {\r\n aliceblue: \"f0f8ff\",\r\n antiquewhite: \"faebd7\",\r\n aqua: \"00ffff\",\r\n aquamarine: \"7fffd4\",\r\n azure: \"f0ffff\",\r\n beige: \"f5f5dc\",\r\n bisque: \"ffe4c4\",\r\n black: \"000000\",\r\n blanchedalmond: \"ffebcd\",\r\n blue: \"0000ff\",\r\n blueviolet: \"8a2be2\",\r\n brown: \"a52a2a\",\r\n burlywood: \"deb887\",\r\n cadetblue: \"5f9ea0\",\r\n chartreuse: \"7fff00\",\r\n chocolate: \"d2691e\",\r\n coral: \"ff7f50\",\r\n cornflowerblue: \"6495ed\",\r\n cornsilk: \"fff8dc\",\r\n crimson: \"dc143c\",\r\n cyan: \"00ffff\",\r\n darkblue: \"00008b\",\r\n darkcyan: \"008b8b\",\r\n darkgoldenrod: \"b8860b\",\r\n darkgray: \"a9a9a9\",\r\n darkgreen: \"006400\",\r\n darkkhaki: \"bdb76b\",\r\n darkmagenta: \"8b008b\",\r\n darkolivegreen: \"556b2f\",\r\n darkorange: \"ff8c00\",\r\n darkorchid: \"9932cc\",\r\n darkred: \"8b0000\",\r\n darksalmon: \"e9967a\",\r\n darkseagreen: \"8fbc8f\",\r\n darkslateblue: \"483d8b\",\r\n darkslategray: \"2f4f4f\",\r\n darkturquoise: \"00ced1\",\r\n darkviolet: \"9400d3\",\r\n deeppink: \"ff1493\",\r\n deepskyblue: \"00bfff\",\r\n dimgray: \"696969\",\r\n dodgerblue: \"1e90ff\",\r\n feldspar: \"d19275\",\r\n firebrick: \"b22222\",\r\n floralwhite: \"fffaf0\",\r\n forestgreen: \"228b22\",\r\n fuchsia: \"ff00ff\",\r\n gainsboro: \"dcdcdc\",\r\n ghostwhite: \"f8f8ff\",\r\n gold: \"ffd700\",\r\n goldenrod: \"daa520\",\r\n gray: \"808080\",\r\n green: \"008000\",\r\n greenyellow: \"adff2f\",\r\n honeydew: \"f0fff0\",\r\n hotpink: \"ff69b4\",\r\n indianred: \"cd5c5c\",\r\n indigo: \"4b0082\",\r\n ivory: \"fffff0\",\r\n khaki: \"f0e68c\",\r\n lavender: \"e6e6fa\",\r\n lavenderblush: \"fff0f5\",\r\n lawngreen: \"7cfc00\",\r\n lemonchiffon: \"fffacd\",\r\n lightblue: \"add8e6\",\r\n lightcoral: \"f08080\",\r\n lightcyan: \"e0ffff\",\r\n lightgoldenrodyellow: \"fafad2\",\r\n lightgrey: \"d3d3d3\",\r\n lightgreen: \"90ee90\",\r\n lightpink: \"ffb6c1\",\r\n lightsalmon: \"ffa07a\",\r\n lightseagreen: \"20b2aa\",\r\n lightskyblue: \"87cefa\",\r\n lightslateblue: \"8470ff\",\r\n lightslategray: \"778899\",\r\n lightsteelblue: \"b0c4de\",\r\n lightyellow: \"ffffe0\",\r\n lime: \"00ff00\",\r\n limegreen: \"32cd32\",\r\n linen: \"faf0e6\",\r\n magenta: \"ff00ff\",\r\n maroon: \"800000\",\r\n mediumaquamarine: \"66cdaa\",\r\n mediumblue: \"0000cd\",\r\n mediumorchid: \"ba55d3\",\r\n mediumpurple: \"9370d8\",\r\n mediumseagreen: \"3cb371\",\r\n mediumslateblue: \"7b68ee\",\r\n mediumspringgreen: \"00fa9a\",\r\n mediumturquoise: \"48d1cc\",\r\n mediumvioletred: \"c71585\",\r\n midnightblue: \"191970\",\r\n mintcream: \"f5fffa\",\r\n mistyrose: \"ffe4e1\",\r\n moccasin: \"ffe4b5\",\r\n navajowhite: \"ffdead\",\r\n navy: \"000080\",\r\n oldlace: \"fdf5e6\",\r\n olive: \"808000\",\r\n olivedrab: \"6b8e23\",\r\n orange: \"ffa500\",\r\n orangered: \"ff4500\",\r\n orchid: \"da70d6\",\r\n palegoldenrod: \"eee8aa\",\r\n palegreen: \"98fb98\",\r\n paleturquoise: \"afeeee\",\r\n palevioletred: \"d87093\",\r\n papayawhip: \"ffefd5\",\r\n peachpuff: \"ffdab9\",\r\n peru: \"cd853f\",\r\n pink: \"ffc0cb\",\r\n plum: \"dda0dd\",\r\n powderblue: \"b0e0e6\",\r\n purple: \"800080\",\r\n red: \"ff0000\",\r\n rosybrown: \"bc8f8f\",\r\n royalblue: \"4169e1\",\r\n saddlebrown: \"8b4513\",\r\n salmon: \"fa8072\",\r\n sandybrown: \"f4a460\",\r\n seagreen: \"2e8b57\",\r\n seashell: \"fff5ee\",\r\n sienna: \"a0522d\",\r\n silver: \"c0c0c0\",\r\n skyblue: \"87ceeb\",\r\n slateblue: \"6a5acd\",\r\n slategray: \"708090\",\r\n snow: \"fffafa\",\r\n springgreen: \"00ff7f\",\r\n steelblue: \"4682b4\",\r\n tan: \"d2b48c\",\r\n teal: \"008080\",\r\n thistle: \"d8bfd8\",\r\n tomato: \"ff6347\",\r\n turquoise: \"40e0d0\",\r\n violet: \"ee82ee\",\r\n violetred: \"d02090\",\r\n wheat: \"f5deb3\",\r\n white: \"ffffff\",\r\n whitesmoke: \"f5f5f5\",\r\n yellow: \"ffff00\",\r\n yellowgreen: \"9acd32\"\r\n },\r\n c;\r\n for (c in b) a == c && (a = b[c]);\r\n b = [{ re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/, example: [\"rgb(123, 234, 45)\", \"rgb(255,234,245)\"], process: function(a) {\r\n return [parseInt(a[1], 10), parseInt(a[2], 10), parseInt(a[3], 10)] } }, {\r\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\r\n example: [\"#00ff00\", \"336699\"],\r\n process: function(a) {\r\n return [parseInt(a[1], 16), parseInt(a[2], 16), parseInt(a[3], 16)] }\r\n }, { re: /^(\\w{1})(\\w{1})(\\w{1})$/, example: [\"#fb0\", \"f0f\"], process: function(a) {\r\n return [parseInt(a[1] + a[1], 16), parseInt(a[2] + a[2], 16), parseInt(a[3] + a[3], 16)] } }];\r\n for (c = 0; c < b.length; c++) {\r\n var d = b[c].process,\r\n e = b[c].re.exec(a);\r\n e && (channels = d(e), this.r = channels[0], this.g = channels[1], this.b = channels[2], this.ok = !0) }\r\n this.cleanupRGB = function() {\r\n this.r = 0 > this.r || isNaN(this.r) ? 0 : 255 < this.r ? 255 : this.r;\r\n this.g =\r\n 0 > this.g || isNaN(this.g) ? 0 : 255 < this.g ? 255 : this.g;\r\n this.b = 0 > this.b || isNaN(this.b) ? 0 : 255 < this.b ? 255 : this.b\r\n };\r\n this.cleanupRGB();\r\n this.toRGB = function() {\r\n return \"rgb(\" + this.r + \", \" + this.g + \", \" + this.b + \")\" };\r\n this.toHex = function() {\r\n var a = this.r.toString(16),\r\n b = this.g.toString(16),\r\n c = this.b.toString(16);\r\n 1 == a.length && (a = \"0\" + a);\r\n 1 == b.length && (b = \"0\" + b);\r\n 1 == c.length && (c = \"0\" + c);\r\n return \"#\" + a + b + c };\r\n this.grayChannel = function() {\r\n var a = [0.199, 0.687, 0.114];\r\n return a[0] * this.r + a[1] * this.g + a[2] * this.b };\r\n this.blackWhiteContrast = function() {\r\n return 150 >\r\n this.grayChannel() ? \"white\" : \"black\"\r\n };\r\n this.darken = function(a) {\r\n var b = TradingView.rgbToHsl(this.r, this.g, this.b);\r\n a = TradingView.hslToRgb(b[0], b[1], b[2] - a / 100);\r\n this.r = a[0];\r\n this.g = a[1];\r\n this.b = a[2];\r\n this.cleanupRGB();\r\n return this }\r\n}", "title": "" }, { "docid": "9cf92f59dff3d3fb3a30bd435f7d1cef", "score": "0.59490997", "text": "function color(rgba) {\n return 'rgba(' + rgba[0] + ', ' + rgba[1] + ', ' + rgba[2] + ', ' + rgba[3] / 255 + ')';\n}", "title": "" }, { "docid": "cba7cb7810994fdbc3d8859bc812a689", "score": "0.59315574", "text": "setColor(r,g,b){\n if(r>255) r = 255;\n else if (r<0)r=0;\n this.r = r;\n \n if(g>255) g = 255;\n else if (g<0) g=0;\n this.g = g;\n \n if(b>255) b = 255;\n else if (b<0) b=0;\n this.b = b;\n }", "title": "" }, { "docid": "bbf981b61fcd81f42055877ee15813ff", "score": "0.5929453", "text": "function setRGBColor(rgb) {\n var c = new RGBColor();\n c.red = rgb[0];\n c.green = rgb[1];\n c.blue = rgb[2];\n return c;\n}", "title": "" }, { "docid": "9f0773b32d482fda31ce7c7799722918", "score": "0.5913624", "text": "function color(args) { /* (clr), or ('#clr'), or (clr, opacity) or (r,g,b) or (r,g,b,a) */\n var rawrgb, r, g, b, a = 1.0;\n\n if ( 3 <= arguments.length )\n {\n r = arguments[0];\n g = arguments[1];\n b = arguments[2];\n if ( 4 <= arguments.length ) { a = arguments[3]; }\n }\n else\n {\n if ( 2 === arguments.length )\n {\n a = arguments[1];\n }\n rawrgb = arguments[0];\n if (((typeof rawrgb) === 'string') || (rawrgb instanceof String))\n {\n // the only types we understand are #hhh and #hhhhhh\n if ( rawrgb.length === 4 )\n {\n rawrgb = '#' + rawrgb.substring(1,2) + rawrgb.substring(1,2) +\n rawrgb.substring(2,3) + rawrgb.substring(2,3) +\n rawrgb.substring(3,4) + rawrgb.substring(3,4);\n }\n r = parseInt(rawrgb.substring(1,3),16);\n g = parseInt(rawrgb.substring(3,5),16);\n b = parseInt(rawrgb.substring(5,7),16);\n }\n else\n {\n // this is an integer\n /*jslint bitwise:false */\n r = (rawrgb & 0xFF0000) >> 16;\n g = (rawrgb & 0xFF00) >> 8;\n b = (rawrgb & 0xFF);\n /*jslint bitwise:true */\n }\n }\n if ( r < 0 ) { r = 0; }\n if ( g < 0 ) { g = 0; }\n if ( b < 0 ) { b = 0; }\n if ( 255 < r ) { r = 255; }\n if ( 255 < g ) { g = 255; }\n if ( 255 < b ) { b = 255; }\n if ( a < 0.0 ) { a = 0.0; }\n if ( 1.0 < a ) { a = 1.0; }\n return new InternalColor( {r:r,g:g,b:b,a:a} );\n }", "title": "" }, { "docid": "1037855b0b092d82cab03694fe7cd0b3", "score": "0.59086084", "text": "function interpolateVertex1(val,color) {\r\n val = val/255;\r\n if (color == 'r'){\r\n\t\trgb1[0] = parseFloat(val);\r\n\t}\r\n\telse if (color == 'green'){\r\n\t\trgb1[1] = parseFloat(val);\r\n\t}\r\n\telse{\r\n\t\trgb1[2] = parseFloat(val);\r\n }\r\n\r\n}", "title": "" }, { "docid": "1920e4b90010dad09727d0db3c5f4fc0", "score": "0.58964187", "text": "setAlpha(alpha) {\n this.checkColorChange()\n this[3] = alpha // Uint8ClampedArray will clamp to 0-255\n }", "title": "" }, { "docid": "cdf067d8af364642205747403b112ebf", "score": "0.5858781", "text": "updateModelsColor(modelKeys, rgbaString) {\r\n var color = rgbaString.replace(\"rgba(\", \"\").replace(\")\", \"\").split(\",\")\r\n const alpha = color.pop()\r\n const rgb = color.map(ele => ele/255)\r\n modelKeys.forEach(modelKey => {\r\n var material = this.models.relatedModels[modelKey]._material\r\n material.diffuse = rgb\r\n material.specular = rgb\r\n material.alpha = alpha\r\n }) \r\n }", "title": "" }, { "docid": "4486fe2eae5a8447f4ac2a15c48269a2", "score": "0.5854616", "text": "DrawRgb()\n {\n line(this.previousPosition.x, this.previousPosition.y, this.position.x, this.position.y);\n }", "title": "" }, { "docid": "5f8bba9d1aa326f33953e969e3217b72", "score": "0.5843935", "text": "function rgbaColor(str) {\n /*\n Split the string by the following 3 characters: (),\n Regex - why so ugly tho?\n\n This will always leave an empty string as the last item in the array.\n */\n const [type, r, g, b, a, empty] = str.split(/[\\(\\),]/)\n const isRgb = type === 'rgb'\n const error = new TypeError(`\"${str}\" isn't a valid ${type} color.`)\n\n // Check for the correct ending and the correct empty string - there's always an empty string.\n if (!str.endsWith(')') || (isRgb ? a : empty) !== '') throw error\n\n const alpha = isRgb ? 1 : a\n const colorsOk = [r, g, b].every(num => numCheck(num))\n const alphaOk = numCheck(alpha, 0, 1)\n\n if (!colorsOk || !alphaOk) throw error\n\n const results = {r: +r, g: +g, b: +b, a: +alpha}\n return addHex(addHsl(results))\n}", "title": "" }, { "docid": "29c122cff8f0142e273d2407dc0f44f4", "score": "0.5831407", "text": "function setColor(r,g,b) {\n alpha = 1.0;\n gl.uniform4f(u_FragColor,r,g,b,alpha); // send color to GPU\n}", "title": "" }, { "docid": "d7203dcc5ec87b0e6d6d4b106989df02", "score": "0.58301705", "text": "function RgbColor(red, green, blue, alpha) {\n /**\n * Reduces hex values if possible e.g. #ff8866 to #f86\n */\n this.reduceHexValue = function (value) {\n if (value.length === 7\n && value[1] === value[2]\n && value[3] === value[4]\n && value[5] === value[6]) {\n return \"#\".concat(value[1]).concat(value[3]).concat(value[5]);\n }\n return value;\n };\n this.red = red;\n this.green = green;\n this.blue = blue;\n this.alpha = alpha || 1;\n }", "title": "" }, { "docid": "b2218af48b7698a71e57a25f16f678a4", "score": "0.58195543", "text": "function convertToWebGLColors(hexColor, choice){\n //Gets the red, green, and blue parts of the hexadecimal color by using the substring function\n var redString = hexColor.substring(1,3);\n var greenString = hexColor.substring(3,5);\n var blueString = hexColor.substring(5,7);\n \n //Converts the each part into RGB format 0 - 255\n var redInRGB = 16 * colorMap[redString.substring(0,1)] + 1 * colorMap[redString.substring(1,2)];\n var greenInRGB = 16 * colorMap[greenString.substring(0,1)] + 1 * colorMap[greenString.substring(1,2)];\n var blueInRGB = 16 * colorMap[blueString.substring(0,1)] + 1 * colorMap[blueString.substring(1,2)];\n \n //Checks whether the new color is going to be assigned to background color or foreground color\n if (choice === \"background\"){\n redInWebGLBackground = 1.0 * redInRGB / 255;\n greenInWebGLBackground = 1.0 * greenInRGB / 255;\n blueInWebGLBackground = 1.0 * blueInRGB / 255;\n configuration(); \n }\n else{\n foregroundColorArray = [];\n redInWebGLForeground = 1.0 * redInRGB / 255;\n greenInWebGLForeground = 1.0 * greenInRGB / 255;\n blueInWebGLForeground = 1.0 * blueInRGB / 255;\n \n foregroundColorArray.push(vec4(redInWebGLForeground, greenInWebGLForeground, blueInWebGLForeground, 1.0));\n configuration();\n } \n}", "title": "" }, { "docid": "f0a3dda4c00fe95f7e74ca0368b0906a", "score": "0.5809053", "text": "function colorToRGBA(col, alpha) {\n var r = Math.round(col.red() * 255);\n var g = Math.round(col.green() * 255);\n var b = Math.round(col.blue() * 255);\n return 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')';\n }", "title": "" }, { "docid": "2c07b3f512ea07dc87ae33431c19e5cc", "score": "0.5808008", "text": "function rgba(){\n return \"rgba(\" + random(255) + \",\" + random(255) + \",\" + random(255) + \", 0.5)\";\n }", "title": "" }, { "docid": "35da497dd967fff8d4dd7e50980db3a7", "score": "0.5797883", "text": "constructor(red,green,blue,alpha=255)\n {\n this.r = this.clamp(red);\n this.g = this.clamp(green);\n this.b = this.clamp(blue);\n this.a = this.clamp(alpha);\n }", "title": "" }, { "docid": "8070da29b0dddaa1180c330bc7a06540", "score": "0.5788716", "text": "function RgbaColor() {\n this.R = 0;\n this.G = 0;\n this.B = 0;\n this.A = RgbaColor.maxComponent; // Default to fully opaque.\n }", "title": "" }, { "docid": "55205e3ab353aff985202a6ad53dc912", "score": "0.5780887", "text": "function rgbaToArgbHex(r, g, b, a) {\n var hex = [pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];\n return hex.join(\"\");\n } // `equals`", "title": "" }, { "docid": "55205e3ab353aff985202a6ad53dc912", "score": "0.5780887", "text": "function rgbaToArgbHex(r, g, b, a) {\n var hex = [pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];\n return hex.join(\"\");\n } // `equals`", "title": "" }, { "docid": "4a648684ebce4c8594a5f3a5d0ecc783", "score": "0.5772544", "text": "constructor(red, green, blue, alpha = 1) {\n this.red = red;\n this.green = green;\n this.blue = blue;\n this.alpha = alpha;\n }", "title": "" }, { "docid": "dd27d248b770cd67b317b482be7ae035", "score": "0.5770584", "text": "toString() {\n return \"rgba(\" + Math.floor(this.r.clamp(0, 1) * 255) + \",\" + Math.floor(this.g.clamp(0, 1) * 255) + \",\" + Math.floor(this.b.clamp(0, 1) * 255) + \",\" + a + \")\";\n }", "title": "" }, { "docid": "0d10cc9e7e0752026b04a4c1dc9c906f", "score": "0.57693535", "text": "function rgbaToHex(r, g, b, a) {\n\n\t\t\t\t\tvar hex = [\n\t\t\t\t\t\t\tpad2(convertDecimalToHex(a)),\n\t\t\t\t\t\t\tpad2(mathRound(r).toString(16)),\n\t\t\t\t\t\t\tpad2(mathRound(g).toString(16)),\n\t\t\t\t\t\t\tpad2(mathRound(b).toString(16))\n\t\t\t\t\t];\n\n\t\t\t\t\treturn hex.join(\"\");\n\t\t\t}", "title": "" }, { "docid": "0d10cc9e7e0752026b04a4c1dc9c906f", "score": "0.57693535", "text": "function rgbaToHex(r, g, b, a) {\n\n\t\t\t\t\tvar hex = [\n\t\t\t\t\t\t\tpad2(convertDecimalToHex(a)),\n\t\t\t\t\t\t\tpad2(mathRound(r).toString(16)),\n\t\t\t\t\t\t\tpad2(mathRound(g).toString(16)),\n\t\t\t\t\t\t\tpad2(mathRound(b).toString(16))\n\t\t\t\t\t];\n\n\t\t\t\t\treturn hex.join(\"\");\n\t\t\t}", "title": "" }, { "docid": "f6833b89891968011962b19a3bc2bd38", "score": "0.57590413", "text": "function rgbaToHex(r, g, b, a) {\r\n var hex = [pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];\r\n\r\n return hex.join('');\r\n }", "title": "" }, { "docid": "feab1cb66785113d114f3f4d1d02ca73", "score": "0.57568717", "text": "function rgbaToHex(color) {\n let values = \"\";\n // collect RR , GG , BB in a variable values\n for (let i = 0; i < color.length; i++) {\n if (!isNaN(parseInt(color[i])) || color[i] == \",\") {\n values += color[i];\n }\n }\n // creat a list [ rr , gg , bb ]\n values = values.split(\",\");\n // Converting decimal --> Hexa\n for (let j = 0; j < values.length; j++) {\n values[j] = Number(values[j]).toString(16);\n // Making sure that every number has 2 digits\n if (values[j].length < 2) {\n values[j] = \"0\" + values[j];\n }\n }\n // return #rrggbb in Hexadecimal\n return \"#\" + values[0] + values[1] + values[2];\n}", "title": "" }, { "docid": "00375b231eb082f5f3c690bf5f1a9d63", "score": "0.5750949", "text": "function Color(r, g, b, a)\n {\n var rgba = ['r', 'g', 'b', 'a'];\n var x = 4;\n while (-1 < --x)\n {\n this[rgba[x]] = arguments[x] || ((x == 3) ? 1.0 : 0);\n }\n\n this.toString = function ()\n {\n return (this.a >= 1.0) ? 'rgb(' + [this.r, this.g, this.b].join(',') + ')' : 'rgba(' + [this.r, this.g, this.b, this.a].join(',') + ')';\n };\n\n this.scale = function (rf, gf, bf, af)\n {\n x = 4;\n while (-1 < --x)\n {\n if (arguments[x] != null)\n this[rgba[x]] *= arguments[x];\n }\n return this.normalize();\n };\n\n this.adjust = function (rd, gd, bd, ad)\n {\n x = 4;\n while (-1 < --x)\n {\n if (arguments[x] != null)\n this[rgba[x]] += arguments[x];\n }\n return this.normalize();\n };\n\n this.clone = function ()\n {\n return new Color(this.r, this.b, this.g, this.a);\n };\n\n var limit = function (val, minVal, maxVal)\n {\n return Math.max(Math.min(val, maxVal), minVal);\n };\n\n this.normalize = function ()\n {\n this.r = limit(parseInt(this.r), 0, 255);\n this.g = limit(parseInt(this.g), 0, 255);\n this.b = limit(parseInt(this.b), 0, 255);\n this.a = limit(this.a, 0, 1);\n return this;\n };\n\n this.normalize();\n }", "title": "" }, { "docid": "0136ceadfe85837ed6cafb63406dd2fd", "score": "0.57500726", "text": "function interpolateVertex2(val,color) {\r\n val = val/255;\r\n if (color == 'r'){\r\n\t\trgb2[0] = parseFloat(val);\r\n\t}\r\n\telse if (color == 'g'){\r\n\t\trgb2[1] = parseFloat(val);\r\n\t}\r\n\telse{\r\n\t\trgb2[2] = parseFloat(val);\r\n }\r\n\r\n}", "title": "" }, { "docid": "df58e61e98759188435ba1cce2c61f09", "score": "0.57461256", "text": "function tweenColors(colorA, colorB, fraction, minOpacity) {\n\n // improve error reporting here\n if (fraction>1) fraction = 1\n if (fraction<0) fraction = 0\n if (colorA.length!=3 && colorA.length!=4) return null\n if (colorB.length!=3 && colorB.length!=4) return null\n if (colorA.length==3) colorA[3]=1\n if (colorB.length==3) colorB[3]=1\n\n let colorAB = {}\n colorAB.arr = []\n colorAB.rgba = \"rgba(\"\n for (let i=0;i<4;i++) {\n colorAB.arr[i] = colorA[i]*fraction + colorB[i]*(1-fraction)\n // enforce min opacity constraint if one is defined\n if (minOpacity && i==3) colorAB.arr[i] = Math.max(minOpacity, colorAB.arr[i])\n // construct the .rgba property\n colorAB.rgba += colorAB.arr[i]\n if (i<3) colorAB.rgba += \",\"\n }\n colorAB.rgba += \")\" // complete the rgba string definition\n colorAB.r = colorAB.arr[0]\n colorAB.g = colorAB.arr[1]\n colorAB.b = colorAB.arr[2]\n colorAB.a = colorAB.arr[3]\n //console.log(\"colorA, colorB, fraction, colorAB\",colorA, colorB, fraction, colorAB)\n return colorAB\n}", "title": "" }, { "docid": "30b39ab8d9e1f40d32ea5333f9d2ee6a", "score": "0.573981", "text": "get rgba() {\n return this._color.toCSS();\n }", "title": "" }, { "docid": "f6e47ae58e4642cb34ded8feeaadbb1a", "score": "0.5736275", "text": "function Color()\n{\n var colors = {\n\t\"white\":\"#FFFFFF\",\n\t\"silver\":\"#C0C0C0\",\n\t\"gray\":\"#808080\",\n\t\"black\":\"#000000\",\n\t\"red\":\"#FF0000\",\n\t\"maroon\":\"#800000\",\n\t\"yellow\":\"#FFFF00\",\n\t\"lime\":\"#00FF00\",\n\t\"green\":\"#00FF00\",\n\t\"aqua\":\"#00FFFF\",\n\t\"teal\":\"#008080\",\n\t\"blue\":\"#0000FF\",\n\t\"navy\":\"#000080\",\n\t\"purple\":\"#800080\",\n\t\"violet\":\"#8F00FF\",\n\t\"indigo\":\"#4B0082\",\n\t\"orange\":\"#FF7F00\",\n\t\"pink\":\"#F660AB\",\n }\n //In case RGB values entered seperately, in decimal form\n var r = Math.round(arguments[0]);\n var g = Math.round(arguments[1]);\n var b = Math.round(arguments[2]);\n var colorCodePattern = /^#[ABCDEF0-9]{6}$/;\n if(typeof arguments[0]===\"string\" && arguments[0].toLowerCase() in colors)\n {\n\targuments[0] = colors[arguments[0]];\n }\n if(typeof arguments[0]===\"string\" && arguments[0].charAt(0)===\"#\" &&\n arguments[0].length==7 && arguments[0].match(colorCodePattern))\n {\n\tthis.red = hexToDec(arguments[0].substr(1,3).toUpperCase());\n\tthis.green = hexToDec(arguments[0].substr(3,5).toUpperCase());\n\tthis.blue = hexToDec(arguments[0].substr(5).toUpperCase());\n\treturn;\n }\n else if(typeof r===\"number\" && typeof g===\"number\" &&\n\t typeof g===\"number\" && Math.min(r,g,b)>=0 && Math.max(r,g,b)<=255)\n {\n\tthis.red = r;\n\tthis.green = g;\n\tthis.blue = b;\n }\n else { this.red=0; this.green=0; this.blue=0; }\n}", "title": "" }, { "docid": "80087c0f71407146a0a60b01dcbe7caa", "score": "0.5725269", "text": "function get_rand_rgba_color() {\n return [Math.floor(Math.random() * 220), Math.floor(Math.random() * 220), Math.floor(Math.random() * 220)];\n }", "title": "" }, { "docid": "0b7a054ce5d35c27f417d760afff67d9", "score": "0.57248545", "text": "static lerpColor(color1, color2, value){\n let returnColor = new RGB();\n returnColor.r = lerp(color1.r, color2.r, value); \n returnColor.g = lerp(color1.g, color2.g, value); \n returnColor.b = lerp(color1.b, color2.b, value); \n return returnColor;\n }", "title": "" }, { "docid": "c007e0c86c75d487f1c95e4d799beb07", "score": "0.5719859", "text": "function colorObj() {\n this.name;\n this.rgb;\n this.hex;\n this.textColor;\n this.taken;\n this.rgba = function (op) {\n\treturn 'rgba('+this.rgb+','+op+')';\n }\n\n\n}", "title": "" }, { "docid": "6ace86cb45922c62694915d0480c078e", "score": "0.571681", "text": "function RGBColor(color_string)\n{\n this.ok = false;\n\n // strip any leading #\n if (color_string.charAt(0) == '#') { // remove # if any\n color_string = color_string.substr(1,6);\n }\n\n color_string = color_string.replace(/ /g,'');\n color_string = color_string.toLowerCase();\n\n // array of color definition objects\n var color_defs = [\n {\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\n example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],\n process: function (bits){\n return [\n parseInt(bits[1]),\n parseInt(bits[2]),\n parseInt(bits[3])\n ];\n }\n },\n {\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\n example: ['#00ff00', '336699'],\n process: function (bits){\n return [\n parseInt(bits[1], 16),\n parseInt(bits[2], 16),\n parseInt(bits[3], 16)\n ];\n }\n },\n {\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\n example: ['#fb0', 'f0f'],\n process: function (bits){\n return [\n parseInt(bits[1] + bits[1], 16),\n parseInt(bits[2] + bits[2], 16),\n parseInt(bits[3] + bits[3], 16)\n ];\n }\n }\n ];\n\n // search through the definitions to find a match\n for (var i = 0; i < color_defs.length; i++) {\n var re = color_defs[i].re;\n var processor = color_defs[i].process;\n var bits = re.exec(color_string);\n if (bits) {\n channels = processor(bits);\n this.r = channels[0];\n this.g = channels[1];\n this.b = channels[2];\n this.ok = true;\n }\n }\n\n // validate/cleanup values\n this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);\n this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);\n this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);\n\n // some getters\n this.toRGB = function () {\n return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';\n }\n this.toHex = function () {\n var r = this.r.toString(16);\n var g = this.g.toString(16);\n var b = this.b.toString(16);\n if (r.length == 1) r = '0' + r;\n if (g.length == 1) g = '0' + g;\n if (b.length == 1) b = '0' + b;\n return '#' + r + g + b;\n }\n}", "title": "" }, { "docid": "63b48c66101562c9e7e424499c2f7ebf", "score": "0.57145125", "text": "changeColor() {\n this.c = color(random(255), random(255), random(255));\n }", "title": "" }, { "docid": "d26c0907d568d951a8bd65e3997c56c0", "score": "0.5712529", "text": "hoverColor(e) {\n const colorOnImg = ctx.getImageData((e.offsetX / canvas.clientWidth) * canvas.width, (e.offsetY / canvas.clientHeight) * canvas.height, 1, 1);\n const rgba = colorOnImg.data;\n const color = `rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3]})`;\n playerColor.style.background = color;\n }", "title": "" }, { "docid": "536f6d3accd4c918a4e549d52a429af8", "score": "0.571074", "text": "setColor(value) {\n\t\tthis.color = value;\n\t\tthis.cvfUniforms.color.value = [this.color[0]/255.0, this.color[1]/255.0, this.color[2]/255.0, 1.0];\n\t}", "title": "" }, { "docid": "48ada993d15b130408abbfda34af9af1", "score": "0.57072014", "text": "function RGB(r, g, b) {\n\tthis.r = r;\n\tthis.g = g;\n\tthis.b = b;\n\n\t/* Convert an RGB object to a string like \"rgb(255,255,255)\" */\n\tthis.toString = function(factor = 1) {\n\t\tconst r_round = Math.round(this.r * factor);\n\t\tconst g_round = Math.round(this.g * factor);\n\t\tconst b_round = Math.round(this.b * factor);\n\t\treturn 'rgb(' + r_round + ',' + g_round + ',' + b_round + ')';\n\t}\n\n\t/* Interpolate between two colours, from:\n\t\t\ta) first colour to white\n\t\t\tb) white to second colour\n\t\tSee https://www.desmos.com/calculator/jolvnp9iii for a graphical demo. */\n\tthis.interpRGB = function(other, t) {\n\t\tconst white = 255;\n\t\tvar r, g, b;\n\t\tif (t < 0.5) {\n\t\t\tr = white - 4 * (white-this.r) * Math.pow(t-0.5, 2);\n\t\t\tg = white - 4 * (white-this.g) * Math.pow(t-0.5, 2);\n\t\t\tb = white - 4 * (white-this.b) * Math.pow(t-0.5, 2);\n\t\t} else {\n\t\t\tr = white - 4 * (white-other.r) * Math.pow(t-0.5, 2);\n\t\t\tg = white - 4 * (white-other.g) * Math.pow(t-0.5, 2);\n\t\t\tb = white - 4 * (white-other.b) * Math.pow(t-0.5, 2);\n\t\t}\n\t\treturn new RGB(Math.round(r), Math.round(g), Math.round(b));\n\t}\n\n\t/* Same as above, except without going through a white phase in the middle. */\n\tthis.lininterpRGB = function(other, t) {\n\t\tvar r = this.r + (other.r - this.r) * t;\n\t\tvar g = this.g + (other.g - this.g) * t;\n\t\tvar b = this.b + (other.b - this.b) * t;\n\t\treturn new RGB(r, g, b);\n\t}\n}", "title": "" }, { "docid": "c0ce6f8dad2a7acac35639fe54020250", "score": "0.57036555", "text": "function colorChange(){\n var r = Math.floor((Math.random() * 255) +1);\n var g = Math.floor((Math.random() * 255) +1);\n var b = Math.floor((Math.random() * 255) +1);\n var color = `rgba(${r}, ${g}, ${b}, 0.5)`;\n return color;\n }", "title": "" }, { "docid": "c4eb56b226f0b9f599dd1c6e9c0da764", "score": "0.5694647", "text": "function Color4(\n /**\n * Defines the red component (between 0 and 1, default is 0)\n */\n r, \n /**\n * Defines the green component (between 0 and 1, default is 0)\n */\n g, \n /**\n * Defines the blue component (between 0 and 1, default is 0)\n */\n b, \n /**\n * Defines the alpha component (between 0 and 1, default is 1)\n */\n a) {\n if (r === void 0) { r = 0; }\n if (g === void 0) { g = 0; }\n if (b === void 0) { b = 0; }\n if (a === void 0) { a = 1; }\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }", "title": "" }, { "docid": "b91e1970cd9f811d8f1803bf43068ac9", "score": "0.56941867", "text": "function rgbaToArgbHex(r, g, b, a) {\n\t\n\t var hex = [pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];\n\t\n\t return hex.join(\"\");\n\t }", "title": "" }, { "docid": "9faa52c65839b766dd97f22bc0fa35f7", "score": "0.56888336", "text": "function cAdd(color, rgbAdd) { // (Color, Color) -> Color\n return new Color(\n color.r + rgbAdd.r,\n color.g + rgbAdd.g,\n color.b + rgbAdd.b\n );\n}", "title": "" }, { "docid": "83dde1359af89f48008bbbcb91ebbbd7", "score": "0.56859887", "text": "function updateA(color, a) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, color), { a: a, t: _consts__WEBPACK_IMPORTED_MODULE_2__[\"MAX_COLOR_ALPHA\"] - a, str: Object(_rgbaOrHexString__WEBPACK_IMPORTED_MODULE_1__[\"_rgbaOrHexString\"])(color.r, color.g, color.b, a, color.hex) });\n}", "title": "" }, { "docid": "f023a918f755884bf3381214d12cc429", "score": "0.567943", "text": "function setRBGAColor(rgb, percentage){\n var rgbaValues = rgb.substring(4, rgb.length-1).split(',')\n rgbaValues.push(percentage)\n\n var rgbaArray = [\"rgba(\"] + rgbaValues + [')']\n\n return rgbaArray\n}", "title": "" }, { "docid": "3ad11de206a6fddb40c5ca30b0ea3456", "score": "0.56690246", "text": "change(r,g,b,a) {\n try {\n if ((typeof(r) !== \"number\") || (typeof(g) !== \"number\") || (typeof(b) !== \"number\") || (typeof(a) !== \"number\"))\n throw \"color component not a number\";\n else if ((r<0) || (g<0) || (b<0) || (a<0))\n throw \"color component less than 0\";\n else if ((r>255) || (g>255) || (b>255) || (a>255))\n throw \"color component bigger than 255\";\n else {\n this[0] = r; this[1] = g; this[2] = b; this[3] = a;\n }\n } // end try\n\n catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "aed2f81c495f0f716711a565205b7028", "score": "0.5647845", "text": "function obtenerColorRGB()\n{\n\treturn rgbColor = 'rgb(' + obtenerColor() + ',' + obtenerColor() + ',' + obtenerColor() + ')';\n}", "title": "" }, { "docid": "1b84563c658bd1863c1e7d68cf63bdfa", "score": "0.56478065", "text": "function rgbaToArgbHex(r, g, b, a) {\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n return hex.join(\"\");\n }", "title": "" }, { "docid": "394564269eb432c5d4f996a3f02df0d9", "score": "0.56475955", "text": "function rgbaToHex(r, g, b, a) {\n\t\n\t\t\t\t\tvar hex = [\n\t\t\t\t\t\t\tpad2(convertDecimalToHex(a)),\n\t\t\t\t\t\t\tpad2(mathRound(r).toString(16)),\n\t\t\t\t\t\t\tpad2(mathRound(g).toString(16)),\n\t\t\t\t\t\t\tpad2(mathRound(b).toString(16))\n\t\t\t\t\t];\n\t\n\t\t\t\t\treturn hex.join(\"\");\n\t\t\t}", "title": "" }, { "docid": "394564269eb432c5d4f996a3f02df0d9", "score": "0.56475955", "text": "function rgbaToHex(r, g, b, a) {\n\t\n\t\t\t\t\tvar hex = [\n\t\t\t\t\t\t\tpad2(convertDecimalToHex(a)),\n\t\t\t\t\t\t\tpad2(mathRound(r).toString(16)),\n\t\t\t\t\t\t\tpad2(mathRound(g).toString(16)),\n\t\t\t\t\t\t\tpad2(mathRound(b).toString(16))\n\t\t\t\t\t];\n\t\n\t\t\t\t\treturn hex.join(\"\");\n\t\t\t}", "title": "" }, { "docid": "d686248eefb6fec41a8172483bc425ea", "score": "0.56396353", "text": "function rgbaToHex(r, g, b, a) {\n\n\t\t\t\tvar hex = [\n\t\t\t\t\t\tpad2(convertDecimalToHex(a)),\n\t\t\t\t\t\tpad2(mathRound(r).toString(16)),\n\t\t\t\t\t\tpad2(mathRound(g).toString(16)),\n\t\t\t\t\t\tpad2(mathRound(b).toString(16))\n\t\t\t\t];\n\n\t\t\t\treturn hex.join(\"\");\n\t\t}", "title": "" }, { "docid": "d686248eefb6fec41a8172483bc425ea", "score": "0.56396353", "text": "function rgbaToHex(r, g, b, a) {\n\n\t\t\t\tvar hex = [\n\t\t\t\t\t\tpad2(convertDecimalToHex(a)),\n\t\t\t\t\t\tpad2(mathRound(r).toString(16)),\n\t\t\t\t\t\tpad2(mathRound(g).toString(16)),\n\t\t\t\t\t\tpad2(mathRound(b).toString(16))\n\t\t\t\t];\n\n\t\t\t\treturn hex.join(\"\");\n\t\t}", "title": "" }, { "docid": "d686248eefb6fec41a8172483bc425ea", "score": "0.56396353", "text": "function rgbaToHex(r, g, b, a) {\n\n\t\t\t\tvar hex = [\n\t\t\t\t\t\tpad2(convertDecimalToHex(a)),\n\t\t\t\t\t\tpad2(mathRound(r).toString(16)),\n\t\t\t\t\t\tpad2(mathRound(g).toString(16)),\n\t\t\t\t\t\tpad2(mathRound(b).toString(16))\n\t\t\t\t];\n\n\t\t\t\treturn hex.join(\"\");\n\t\t}", "title": "" }, { "docid": "d686248eefb6fec41a8172483bc425ea", "score": "0.56396353", "text": "function rgbaToHex(r, g, b, a) {\n\n\t\t\t\tvar hex = [\n\t\t\t\t\t\tpad2(convertDecimalToHex(a)),\n\t\t\t\t\t\tpad2(mathRound(r).toString(16)),\n\t\t\t\t\t\tpad2(mathRound(g).toString(16)),\n\t\t\t\t\t\tpad2(mathRound(b).toString(16))\n\t\t\t\t];\n\n\t\t\t\treturn hex.join(\"\");\n\t\t}", "title": "" }, { "docid": "e5016669dfcb9e7170b39ea33ebabdd4", "score": "0.5636264", "text": "function parseColor(color,contrast){contrast=contrast||false;var rgbValues=$mdTheming.PALETTES[color.palette][color.hue];rgbValues=contrast?rgbValues.contrast:rgbValues.value;return $mdUtil.supplant('rgba({0}, {1}, {2}, {3})',[rgbValues[0],rgbValues[1],rgbValues[2],rgbValues[3]||color.opacity]);}", "title": "" }, { "docid": "d4e2a39b9edcb408fc1d236fd52da97a", "score": "0.5630531", "text": "function colorBlend(colorA, colorB, alpha) {\n return {\n r: alpha * colorB.r + (1 - alpha) * colorA.r,\n g: alpha * colorB.g + (1 - alpha) * colorA.g,\n b: alpha * colorB.b + (1 - alpha) * colorA.b,\n };\n}", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "1ea29228a882a59b31a20ca9a74974d7", "score": "0.5629833", "text": "function rgbaToHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n }", "title": "" }, { "docid": "208ebbc554e357f034fcdf876ed0d2d0", "score": "0.5627201", "text": "function color()\r\n{\r\n this.r = 0;\r\n this.g = 256;\r\n this.b = 128;\r\n}", "title": "" }, { "docid": "208ebbc554e357f034fcdf876ed0d2d0", "score": "0.5627201", "text": "function color()\r\n{\r\n this.r = 0;\r\n this.g = 256;\r\n this.b = 128;\r\n}", "title": "" }, { "docid": "e72421fb8320a13ba1ce0ec5f8b27edd", "score": "0.562423", "text": "function changeColor() {\n var r = $(\"#red\").val();\n var g = $(\"#green\").val();\n var b = $(\"#blue\").val();\n var a = $(\"#alpha\").val() / 100;\n\n $(\"#newColor\").css(\"background-color\", \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + a + \")\");\n console.log($(\"#newColor\").css(\"background-color\"));\n\n}", "title": "" }, { "docid": "59ceaef21d60e3e0ebdaa7d8cc786cec", "score": "0.5619012", "text": "function interpolateColor(rgbA, rgbB, value) {\n if (value > 0.4 && value < 0.6) {\n value = value + 0.4;\n }\n var rDiff = rgbA[0] - rgbB[0];\n var gDiff = rgbA[1] - rgbB[1];\n var bDiff = rgbA[2] - rgbB[2];\n value = 1 - value;\n return [\n rgbB[0] + rDiff * value,\n rgbB[1] + gDiff * value,\n rgbB[2] + bDiff * value\n ];\n}", "title": "" }, { "docid": "c90b28922c9840230d2e816ed7c027f7", "score": "0.56124604", "text": "changeColor() {\n\t\tthis.newColorEl.style.backgroundColor = \"rgb(\" + this.redEl.value + \",\" + this.greenEl.value + \", \" + this.blueEl.value + \")\";\n\t}", "title": "" }, { "docid": "2295966f310799183009a8a23a68c880", "score": "0.561157", "text": "function toColor(r, g, b, a) {\n var str = null;\n if (vp.utils.isString(r)) {\n str = r; // already a color string\n }\n else {\n if (arguments.length == 1) {\n var aray = r;\n r = aray[0];\n g = aray[1];\n b = aray[2];\n if (aray.length > 3) {\n a = aray[3];\n }\n }\n var red = vp.data.clamp(Math.round(r), 0, 255);\n var green = vp.data.clamp(Math.round(g), 0, 255);\n var blue = vp.data.clamp(Math.round(b), 0, 255);\n //if (true) // for now, always use just 3 colors // a === undefined)\n if (a === undefined) {\n //---- caution: SVG (at least in IE9) does NOT accept spaces betweeen commas ----\n str = (\"rgb(\" + red + \",\" + green + \",\" + blue + \")\");\n }\n else {\n var alpha = vp.data.clamp(Math.round(a), 0, 255);\n str = (\"rgba(\" + red + \",\" + green + \",\" + blue + \",\" + alpha + \")\");\n }\n }\n return str;\n }", "title": "" }, { "docid": "280bccc35ec40a025835c2f0a7c9831b", "score": "0.5610483", "text": "function RGBtoXY(red, green, blue, model)\n{\n\n if(red > 1 || green > 1 || blue > 1)\n {\n red /= 255;\n green /= 255;\n blue /= 255;\n }\n\n red = (red > 0.04045) ? Math.pow((red + 0.055) / (1.0 + 0.055), 2.4) : (red / 12.92);\n green = (green > 0.04045) ? Math.pow((green + 0.055) / (1.0 + 0.055), 2.4) : (green / 12.92);\n blue = (blue > 0.04045) ? Math.pow((blue + 0.055) / (1.0 + 0.055), 2.4) : (blue / 12.92);\n\n var X = red * 0.649926 + green * 0.103455 + blue * 0.197109;\n var Y = red * 0.234327 + green * 0.743075 + blue * 0.022598;\n var Z = red * 0.0000000 + green * 0.053077 + blue * 1.035763;\n\n var cx = X / (X + Y + Z);\n var cy = Y / (X + Y + Z);\n\n if (isNaN(cx)) {\n cx = 0.0;\n }\n\n if (isNaN(cy)) {\n cy = 0.0;\n }\n\n//Check if the given XY value is within the colourreach of our lamps.\n var xyPoint = XYPoint(cx, cy);\n\n var colorPoints = colorPointsForModel(model);\n\n var inReachOfLamps = checkPointInLampsReach(xyPoint, colorPoints);\n\n if (!inReachOfLamps)\n {\n //It seems the colour is out of reach\n //let's find the closest colour we can produce with our lamp and send this XY value out.\n\n //Find the closest point on each line in the triangle.\n\n var pAB =getClosestPointToPoints( colorPoints[cptRED], colorPoints[cptGREEN], xyPoint);\n\n var pAC =getClosestPointToPoints( colorPoints[cptBLUE], colorPoints[cptRED], xyPoint);\n\n var pBC =getClosestPointToPoints( colorPoints[cptGREEN], colorPoints[cptBLUE], xyPoint);\n\n //Get the distances per point and see which point is closer to our Point.\n var dAB = getDistanceBetweenTwoPoints(xyPoint, pAB);\n var dAC = getDistanceBetweenTwoPoints(xyPoint, pAC);\n var dBC = getDistanceBetweenTwoPoints(xyPoint, pBC);\n\n var lowest = dAB;\n\n var closestPoint = pAB;\n\n if (dAC < lowest) {\n lowest = dAC;\n closestPoint = pAC;\n }\n if (dBC < lowest) {\n lowest = dBC;\n closestPoint = pBC;\n }\n\n //Change the xy value to a value which is within the reach of the lamp.\n cx = closestPoint.x;\n cy = closestPoint.y;\n }\n\n return {\n x: cx,\n y: cy,\n bri: Y\n };\n}", "title": "" }, { "docid": "97ad995aae6d6a95f26fbc95bf2d166f", "score": "0.56046236", "text": "hsl(color) {\n\n //\n let rgb = [parseInt('0x' + color.substring(1, 3)) / 255, parseInt('0x' + color.substring(3, 5)) / 255, parseInt('0x' + color.substring(5, 7)) / 255];\n let min, max, delta, h, s, l;\n let r = rgb[0],\n g = rgb[1],\n b = rgb[2];\n\n //\n min = Math.min(r, Math.min(g, b));\n max = Math.max(r, Math.max(g, b));\n delta = max - min;\n l = (min + max) / 2;\n\n //\n s = 0;\n if (l > 0 && l < 1)\n s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));\n\n //\n h = 0;\n if (delta > 0) {\n if (max == r && max != g) h += (g - b) / delta;\n if (max == g && max != b) h += (2 + (b - r) / delta);\n if (max == b && max != r) h += (4 + (r - g) / delta);\n h /= 6;\n }\n return [parseInt(h * 255), parseInt(s * 255), parseInt(l * 255)];\n }", "title": "" } ]
4b7ba90d5829c7867af7947e89e123f7
(gibt es in JS nicht ) validateFacebookUser
[ { "docid": "eb42aa3c61957573bff480f254e4e486", "score": "0.7131798", "text": "function validateFacebookUser(params,info2)\n{\n\tApe.log(\"validateFacebookUser\");\n\t\t\n\tif(verfiyFacebookSession(params.FBSession))\n\t{\n\t\tApe.log(\"MD5 signaure of facebook cookie verified\");\n\t\t\n\t\tvar old_UserID = info2.user.UserID || 0;\n\t\t\n\t\tinfo2.user.Facebook=1;\n\t\t\n\t\tsqlStandardPool.query(\"SELECT \tfID,\" +\n\t\t\t\t\"\t\t\t\t\t\tfCredits,\" +\n\t\t\t\t\"\t\t\t\t\t\tfTotalCredits,\" +\n\t\t\t\t\"\t\t\t\t\t\tfGender,\" +\n\t\t\t\t\"\t\t\t\t\t\tfFBPermissions \" +\n\t\t\t\t\"FROM tUsers WHERE fFacebookID='\"+Ape.MySQL.escape(params.FBSession.uid)+\"' LIMIT 1\",\n\t\t\t\tfunction(res){\n\t\t\t\n\t\t\t\t\tif(res.length==1){ //If facebook user exists in tUsers, \n\t\t\t\t\t\t\t\t\t\t//ignore the locally saved authCookie\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Define the goOn for later use\n\t\t\t\t\t\tfunction goOn()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tinfo2.user.UserID=parseInt(res[0].fID);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tinfo2.user.Gender = parseInt(res[0].fGender);\n\t\t\t\t\t\t\tinfo2.user.FBPermissions = res[0].fFBPermissions;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tCreateClient(info2,params,function(){\n\t\t\t\t\t\t\t\tif(params.Properties)//If this Facebook login happened while the anonymous \n\t\t\t\t\t\t\t\t\t\t\t\t\t//user was looking for a partner, update his bla\n\t\t\t\t\t\t\t\t\tupdateClientsFiltersAndProperties(params,info2);\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\tif(info2.user.UserID ) //If the User was already connected as anonymous user\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo2.user.left(info2.user.UserID);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconvertAnonymousUser(info2.user,res[0],function()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsendToUserChannel(res[0].fID,'refreshSnapshots');\n\t\t\t\t\t\t\t\tgoOn();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tApe.log(\"Facebook User \"+res[0].fID+\" possibly ignoring anonymous user\");\n\n\t\t\t\t\t\t\tinfo2.user.CreditInfo={\t'Credits'\t\t: res[0].fCredits,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'TotalCredits'\t: res[0].fTotalCredits};\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgoOn();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}else{//If Facebook user does not exist, use the anonymous user from authCookie (if exists)\n\t\t\t\t\t\t\n\t\t\t\t\t\tApe.log(\"not existing FB user\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tfunction onNotExists()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsqlStandardPool.queryWithInsertId(\n\t\t\t\t\t\t\t\t\t\"INSERT INTO tUsers SET \" +\n\t\t\t\t\t\t\t\t\t\"fFacebookID = '\" + Ape.MySQL.escape(params.FBSession.uid) + \"' \",\n\t\t\t\t\t\t\t\t\tfunction(InsertId){\n\t\t\t\t\t\t\t\t\t\tinfo2.user.UserID = InsertId;\n\t\t\t\t\t\t\t\t\t\tApe.log(\"Facebook User Inserted: \"+info2.user.UserID);\n\t\t\t\t\t\t\t\t\t\tCreateClient(info2,params);\n\t\t\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\tif(params.authCookie \n\t\t\t\t\t\t\t\t&& AuthCookieSignature(params.authCookie.Payload)==params.authCookie.Signature)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tApe.log(\"Overwriting anonymous user\" + params.authCookie.Payload.UserID);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tinfo2.user.UserID = params.authCookie.Payload.UserID;\n\t\t\t\t\t\t\tgetAnonymousUserInfo(info2,params,\n\t\t\t\t\t\t\t\t\toverwriteAnonymousUser,onNotExists);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if($chk(info2.user.UserID))\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgetAnonymousUserInfo(info2,params,\n\t\t\t\t\t\t\t\t\toverwriteAnonymousUser,onNotExists);\n\t\t\t\t\t\t\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tonNotExists();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\n\t\treturn 1;\n\t\t\n\t}else\n\t\tApe.log(\"MD5 signaure of facebook cookie could not be verified\");\n\t\n\n\tfunction overwriteAnonymousUser()\n\t{\n\t\tsqlStandardPool.query(\n\t\t\t\"UPDATE tUsers SET \" +\n\t\t\t\"fFacebookID = '\" + Ape.MySQL.escape(params.FBSession.uid) + \"' \" +\n\t\t\t\"WHERE fID = '\" + Ape.MySQL.escape(info2.user.UserID) + \"' \",\n\t\t\tfunction(){\n\t\t\t\tApe.log(\"Facebook User Connected: \"+info2.user.UserID);\n\t\t\t\tif(params.authCookie)//New Facebook user which over-\n\t\t\t\t\t\t\t\t\t//writes a User and creates\n\t\t\t\t\t\t\t\t\t// a new client for it\n\t\t\t\t\tCreateClient(info2,params);\n\t\t\t\telse//If this is a after startup facebook connect,\n\t\t\t\t\t//only create a new cookie and no client, \n\t\t\t\t\t//as the client already exists\n\t\t\t\t\tCreateCookie(info2);\n\t\t\t});\n\t}\n\t\n\t\n\treturn 0;\n}", "title": "" } ]
[ { "docid": "5a66fcb3a8278e696ab2661f7d57086e", "score": "0.71728766", "text": "function validarUsuario() {\n FB.getLoginStatus(function (response) {\n statusChangeCallback(response);\n });\n}", "title": "" }, { "docid": "25880716b2d1f9af251596f865a6f86f", "score": "0.6913063", "text": "function validarUsuario(){\n\n\tFB.getLoginStatus(function(response){\n\n\t\tstatusChangeCallback(response);\n\t})\n}", "title": "" }, { "docid": "29c5ae467e78605a37f3b110a026b696", "score": "0.6672077", "text": "function validateUser(userobj) {\n //TODO: Validation\n return true;\n}", "title": "" }, { "docid": "651d3732cc86740d78c40adc5afcea1d", "score": "0.64919895", "text": "function fblogin() {\r\n\t//on appel le login de parse et demande les bonnes autorisations\r\nParse.FacebookUtils.logIn(\"email,user_about_me,user_birthday,user_location\", {\r\n\t success: function(user) {\r\n\t \r\n\t \t//si le user nexistait pas on le crée\r\n\t if (!user.existed()) {\r\n\t console.log(\"\\n ***** User signed up and logged in through Facebook! ***** \\n\");\r\n\t console.log(user);\r\n\t createUserAccount(user);\r\n\r\n\t\t//si le user existait on redirige direct vers le dashboard\r\n\t } else {\r\n\t $(\".user_first_name\").empty();\r\n\t $(\".user_first_name\").append(user.attributes.first_name);\r\n\t\t $('#facebookLoginComingSoon').modal('show');\r\n\t }\r\n\r\n\t },\r\n\t error: function(user, error) {\r\n\t console.log(\"\\n !!!!! User cancelled the Facebook login or did not fully authorize. !!!!! \\n\");\r\n\t }\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "85a289b09079c7bb7e84c0953459be67", "score": "0.6216946", "text": "function isUserValid(user){\n console.log('user Validity check.');\n\n if(user.email && user.password && user.displayName && user.imageUrl){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "4f394cdd2dab0d8900d0c62ff30a0957", "score": "0.61150676", "text": "function facebookSignIn(){\n facebookAuth()\n .then((result) => {\n const user = result.user;\n const token = result.credential.accesToken;\n createUser(user.uid, user.displayName, user.email, user.photoURL);\n window.location.hash = '#/home';\n console.log('auth user fb', result.user, user, token);\n })\n .catch((error) => {\n const errorMessage = error.message;\n alert(`Ups! Algo salió mal. Error detectado: ${errorMessage}`);\n console.log('error detectado:', error);\n });\n}", "title": "" }, { "docid": "4b84418ffad6ca22361acbfec6c497b8", "score": "0.6106527", "text": "function RegisteredWithFacebook(MyData)\n{\n try{\n if (MyData.FacebookToken != null)\n {\n return new FacebookAccess(MyData.FacebookToken, MyData.FacebookId);\n }\n\n return false;\n}\n catch (e)\n{\n return false;\n}\n\n\n}", "title": "" }, { "docid": "e2cce328457c2d90c52ac1e765adb581", "score": "0.60331976", "text": "function validateUser(user) {\n if (!validationLib.checkGender(user.gender)) {\n return false;\n }\n if (!validationLib.checkName(user.firstname)) {\n return false\n }\n if (!validationLib.checkName(user.lastname)) {\n return false\n }\n if (!validationLib.checkName(user.firstname)) {\n return false;\n }\n if (!validationLib.checkName(user.lastname)) {\n return false;\n }\n if (!validationLib.checkEmail(user.email)) {\n return false;\n }\n if (!validationLib.checkMobile(user.mobile)) {\n return false;\n }\n if (!validationLib.checkPassword(user.password)) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "b19a8b38a25ad2d0284b3c5ec93c0856", "score": "0.6006948", "text": "function valid_activity_user(user) {\n if (user) {\n return validators.MqlId(user.id, {\n if_valid:true, if_invalid:false, if_empty:false\n });\n }\n return false;\n}", "title": "" }, { "docid": "99eb2478ceb71200d99fde6148521885", "score": "0.6006618", "text": "function isValidUser(user) {\r\n\t\tif(user.properties.protectedUser) {\r\n\t\t\tuser.error = \"This user is protected.\";\r\n\t\t\treturn false;\r\n\t\t} else if(user.properties.statusesCount < $scope.minTweets) {\r\n\t\t\tuser.error = \"This user does not have enough tweets.\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tuser.valid = true;\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "6c555ae61f3f38eaa3a29e0e7841e556", "score": "0.59944046", "text": "function validateUserByLink(objLogin, callBack) {\n\ttry {\n\t\tnew sql.Request(db)\n\t\t\t.input('userId', sql.Int, objLogin.userId)\n\t\t\t.input('password', sql.VarChar(50), objLogin.password)\n\t\t\t.input('hours', sql.Int, objLogin.hours)\n\t\t\t.execute('spValidAttemptsOfLink', (error, result) => {\n\t\t\t\treturnResults(error, result, objLogin.emailId, callBack, \"validateUserByLink\", \"\");\n\t\t\t});\n\t}\n\tcatch (exception) {\n\t\thelperLogging.logException({ \"isServer\": 1, \"methodName\": \"validateUserByLink\", \"exceptionDetails\": exception.message, \"userId\": objLogin.emailId });\n\t\treturnError(exception.message, callBack);\n\t}\n}", "title": "" }, { "docid": "ac1c66063f73e8fdb7233ca4f24b748b", "score": "0.59859085", "text": "function isValidProfile(user) {\n// console.log(\"who I am in authenticate: \"+req.user);\n if (Object.keys(user.local).length===0 || typeof user.local.email === \"undefined\" || user.local.authenticated==\"0\") return false;\n return true;\n}", "title": "" }, { "docid": "96eed2e107cede8f1503c673992f0d76", "score": "0.59539825", "text": "function verifyFacebookUserAccessToken(token) {\n var deferred = Q.defer();\n var path = 'https://graph.facebook.com/me?access_token=' + token;\n request(path, function (error, response, body) {\n var data = JSON.parse(body);\n if (!error && response && response.statusCode && response.statusCode == 200) {\n var user = {\n facebookUserId: data.id,\n name: data.name\n };\n deferred.resolve(user);\n }\n else {\n console.log(data.error);\n //console.log(response);\n deferred.reject({code: response.statusCode, message: data.error.message});\n callback({code: response.statusCode, message: data.error.message});\n }\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "3c4477f5bf100ce05e02ae945aba3b31", "score": "0.5928278", "text": "validate() {\n return validateUser(this.user).error ? false : true;\n }", "title": "" }, { "docid": "96ea6df945095038c9b13e907e3f8929", "score": "0.59028894", "text": "function validUserParams(body) {\n\treturn (body.inputName && body.inputEmail && body.inputPassword && body.inputConfirmPassword);\n}", "title": "" }, { "docid": "844d415fb02546fd36ed23acd903efda", "score": "0.58636445", "text": "isValid() {\n if (!this.aditoUserId) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "7e45cbeeb6d0b0c7c27cbbaca7325366", "score": "0.58609426", "text": "function getFbUserData() {\r\n FB.api('/me?fields=name,first_name,last_name,email',\r\n function (response) {\r\n console.log('臉書登入登入登入登入登入登入登入');\r\n // alert(\"FB登入者=> \" + response.email);\r\n\r\n var email = response.email\r\n //判斷是否為會員email,AutoLoginCheck\r\n //Email確認是會員\r\n var combie = { \"email\": email };\r\n var json = JSON.stringify(combie);\r\n //利用ajax將json型態的email丟到Controller的AutoLoginCheck察看是否為會員的email\r\n $.ajax({\r\n type: \"post\",\r\n url: \"AutoLoginCheck\",\r\n data: json,\r\n success: function (jsonback) {\r\n\r\n // alert(\"AutoLoginCheck傳回 = \" + jsonback);\r\n\r\n if (jsonback == null || jsonback == \"\") {\r\n\r\n // alert(\"您的FB email非會員信箱\");\r\n \r\n //判斷是否為會員email,AutoLoginCheck\r\n // Email確認是會員\r\n // var combie = { \"email\": email };\r\n // var json = JSON.stringify(combie);\r\n\r\n $.ajax({\r\n type: \"post\",\r\n url: \"FbRegisterServlet\",\r\n data: json,\r\n success: function (reply) {\r\n\r\n\r\n // JSON.parse()將JSON字串剖析為JavaScript物件供操作使用。\r\n // alert(\"註冊資料正確,registerdata為\"+registerdata);\r\n\r\n // var mailmember = jsonback.replace(\"{\", \"\").replace(\"}\", \"\").replace(\"\\\"\").split(\",\")[1].split(\":\")[1];\r\n // // var goto = \"resucess.html?name=\"+mailmember\r\n // var goto = \"index.html?name=\" + mailmember\r\n // //重要!! 轉傳時要編碼一次編成URI\r\n // window.location.assign(encodeURI(goto)); \r\n // window.location.assign(encodeURI(goto)) ; \r\n if ($(\"#memberloginstatus\").text() == \"\") {\r\n $(\"#memberloginstatus\").append(\"Welcome\" + \" \" + reply);\r\n $(\"a#login\").hide();\r\n $(\"a#registerNav\").hide();\r\n $(\"a#memberlogoutstatus\").append(\"登出\");\r\n $(\"a#memberdescription\").show();\r\n\r\n //設定fbcookie\r\n var expire_days = 1; // 過期日期(天)\r\n var day = new Date();\r\n day.setTime(day.getTime() + (expire_days * 24 * 60 * 60 * 1000));\r\n // day.setTime(day.getTime() + (60 * 1000));\r\n var expires = \"expires=\" + day.toGMTString();\r\n // document.cookie = \"name=test\" + \"; \" + expires + '; domain=localhost:8080; path=/';\r\n cookie = \"email=\" + reply + \"; \" + expires + '; path=/';\r\n // alert(\"document.cookie=\" + cookie)\r\n //FB登入\r\n // alert(\"FB登入成功\")\r\n $(\"a#memberdescription\").show();\r\n alert(\"煩請到會員資料新增電話才可啟動租賃服務\")\r\n if ($('#modeltt').is(':hidden')) {\r\n } else {\r\n $('#modeltt').hide();\r\n window.location.reload(true);\r\n }\r\n \r\n }\r\n\r\n }\r\n });\r\n\r\n } else {\r\n\r\n\r\n\r\n\r\n // var goto = \"index.html?name=\"+jsonback\r\n // //重要!! 轉傳時要編碼一次編成URI\r\n // alert(\"Email為會員資料\");\r\n var cookie = document.cookie;\r\n // window.location.assign(encodeURI(goto)) ; \r\n // $(\"#memberloginstatus\").innerHTML= \"Welcome\"+jsonback;\r\n //因為footer和nav會同時執行login,因此會執行兩次login check,使用此方式產生一個welcome字串\r\n // var goto = \"index.html?name=\"+jsonback\r\n //重要!! 轉傳時要編碼一次編成URI\r\n // window.location.assign(encodeURI(goto)) ; \r\n if ($(\"#memberloginstatus\").text() == \"\") {\r\n $(\"#memberloginstatus\").append(\"Welcome\" + \" \" + jsonback);\r\n $(\"a#login\").hide();\r\n $(\"a#registerNav\").hide();\r\n $(\"a#memberlogoutstatus\").append(\"登出\");\r\n $(\"a#memberdescription\").show();\r\n\r\n //設定fbcookie\r\n var expire_days = 1; // 過期日期(天)\r\n var day = new Date();\r\n day.setTime(day.getTime() + (expire_days * 24 * 60 * 60 * 1000));\r\n // day.setTime(day.getTime() + (60 * 1000));\r\n var expires = \"expires=\" + day.toGMTString();\r\n // document.cookie = \"name=test\" + \"; \" + expires + '; domain=localhost:8080; path=/';\r\n cookie = \"email=\" + jsonback + \"; \" + expires + '; path=/';\r\n // alert(\"document.cookie=\" + cookie)\r\n //FB登入\r\n // alert(\"FB登入成功\")\r\n $(\"a#memberdescription\").show();\r\n alert(\"煩請到會員資料新增電話才可啟動租賃服務\")\r\n if ($('#modeltt').is(':hidden')) {\r\n } else {\r\n $('#modeltt').hide();\r\n window.location.reload(true);\r\n }\r\n \r\n }\r\n }\r\n }\r\n\r\n });\r\n\r\n\r\n\r\n });\r\n}", "title": "" }, { "docid": "c36c641c42ee06dded2dcb81d7b6471b", "score": "0.5820537", "text": "function get_facebook_login_status() {\n FB.getLoginStatus(function(response) {\n if (response.status === 'connected') {\n var fb_id = response.authResponse.userID;\n var user_img = 'http://graph.facebook.com/' + fb_id + '/picture?type=square';\n document.getElementById('welcome_user_picture_img_id').src = user_img;\n\n // temporary assign some values\n user.id = fb_id;\n user.name = '';\n user.surname = '';\n user.email = '';\n\n show_user_cabinet();\n // alert(\"connected FBID = \" + fb_id);\n\n } else if (response.status === 'not_authorized') { \n // show login dialog to enter email & pswd\n document.getElementById('show_login').click();\n\n } else {\n // show login dialog to enter email & pswd\n document.getElementById('show_login').click();\n }\n });\n}", "title": "" }, { "docid": "6fd624e77d8e15333d2184ff0cfe44e1", "score": "0.5800703", "text": "function checkFacebookStatus(){\r\n\t\tFB.getLoginStatus(function(response) {\r\n\t\t\t$(\".fb-message\").css(\"display\",\"none\");\r\n\t\t\tif ((response.status === 'connected') && (facebook_uid != \"\")) {\r\n\t\t\t\tsetFacebookInfo(response);\r\n\t\t\t\t$(\".social.facebook\").find(\"label\").removeClass(\"disabled\")\r\n\t\t\t\t$(\".social.facebook\").find(\"input\").removeAttr(\"disabled\",\"disabled\");\r\n\t\t\t} else if ((response.status === 'not_authorized') || (facebook_uid == \"\")) { // user is NOT AUTHORIZED\r\n\t\t\t\tif(facebook_uid != \"\") { // user delete our application from facebook but ID is still in DB\r\n\t\t\t\t\tlogoutFacebook();\r\n\t\t\t\t}\r\n\t\t\t\t$(\".fb-authorize\").css(\"display\",\"block\");\r\n\t\t\t} else { // user is LOGOUT\r\n\t\t\t\t$(\".fb-login\").css(\"display\",\"block\");\r\n\t\t\t\t$(\".social.facebook\").find(\"label\").addClass(\"disabled\")\r\n\t\t\t\t$(\".social.facebook\").find(\"input\").attr(\"disabled\",\"disabled\");\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "2a341d09d6a522099c75d2a3c45f4bd2", "score": "0.57900333", "text": "function validateUserFields(body, configuration, callback) {\n\tconsole.log('validating fields: ' + JSON.stringify(body));\n if(isString(body.username) && isString(body.firstname) && isString(body.lastname) && validator.isEmail(body.email) && validatePassword(body.password)) {\n \tconsole.log(\"Inputs validated.\");\n callback(null, body, configuration);\n }\n else {\n \tconsole.log('Invalid registration inputs');\n \tcallback({message: 'Invalid registration inputs', code:'400'});\n } \n}", "title": "" }, { "docid": "8976f8a8bc9517881ee86bc5db30c2ea", "score": "0.57842225", "text": "function loginSuccessful() {\r\n console.log('Bienvenido! Buscando su informacion.... ');\r\n FB.api('/me', function FacebookLogin(response) {\r\n //hago la llamada ajax al code behing para redireccionar a la home\r\n var dataValue = \"{facebookUserId: '\" + response.id.toString() + \"' , first_name: '\" + response.first_name + \"' , last_name: '\" + response.last_name + \"' , gender: '\" + response.gender + \"' , email: '\" + response.email + \"' }\";\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"login.aspx/LoginWithFacebook\",\r\n data: dataValue,\r\n contentType: 'application/json; charset=utf-8',\r\n dataType: 'json',\r\n error: function(XMLHttpRequest, textStatus, errorThrown) {\r\n alert(\"Request: \" + XMLHttpRequest.toString() + \"\\n\\nStatus: \" + textStatus + \"\\n\\nError: \" + errorThrown);\r\n },\r\n success: function(result) {\r\n window.location = \"Home.aspx\";\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "b1c14005a348393eb89dd8d965bf81ff", "score": "0.57568383", "text": "function validateUser(user){\n \n const schema = {\n etunimi: Joi.string().min(1).max(45).required(),\n sukunimi: Joi.string().min(1).max(45).required(),\n kayttajatunnus: Joi.string().min(1).max(255).required(),\n salasana: Joi.string().min(1).max(45).required()\n };\n return Joi.validate(user, schema);\n}", "title": "" }, { "docid": "04d98c8df85a8edc51e3a3ad4b909992", "score": "0.574398", "text": "function isValidUser(userObj){\n if(!userObj){\n return false;\n }\n if(!userObj.username || !users.hasOwnProperty(userObj.username)){\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "534ec429ed5386c34a6a07bc6206c9c4", "score": "0.57335895", "text": "function isUserValidSuccess(response)\n {\n if (response.data)\n {\n var userObjectId = localStorageFactory.get('userObjectId');\n console.log('User is valid in backendless.')\n\n introFactory.getUserProperties(userObjectId)\n .then (getUserPropertiesSuccess, getUserPropertiesFailed);\n }\n else\n {\n console.log('User is not currently valid in backendless. Not allowing auto login access.');\n }\n }", "title": "" }, { "docid": "1d760c3e01b54e309ee074309a753c86", "score": "0.57328373", "text": "function login() {\nFB.getLoginStatus(function(response) {\n console.log(\"roept ze aan\")\n if (response.status === 'connected') {\n window.location = \"#page\";\n console.log(\"Gelukt\");\n if (response.authResponse) {\n uid = response.authResponse.userID;\n console.log(\"Dit is bij login \" + uid)\n }\n\n }\n// else if\n// (response.status === 'not_authorized')\n// {\n// console.log(\"mss toch dit\");\n// }\n else {\n\n\n FB.login(function(response) {\n var naam;\n var voornaam;\n\n\n if (response.authResponse) {\n uid = response.authResponse.userID;\n\n var request = new XMLHttpRequest();\n request.open(\"GET\", BASE_URL + \"gebruikers/fbid/\" + uid);\n request.onload = function() {\n if (request.status === 200) {\n window.location = \"#page\";\n console.log(\"pagina 200 open\");\n }\n else\n {\n console.log(\"404\");\n window.location.href = \"#pageTut1\";\n FB.api('/me', function(response) {\n naam = response.last_name;\n voornaam = response.first_name;\n\n createGebruikerFromInput(uid, naam, voornaam);\n console.log(test);\n\n });\n\n }\n };\n request.send(null);\n // connected\n\n\n } else {\n // cancelled\n }\n\n });\n\n }\n\n});\n}", "title": "" }, { "docid": "66bfe94147f36387fc7e47247ed3ad7f", "score": "0.5710607", "text": "function facebook_login(){\n document.getElementById(\"register_success\").style.display = \"none\";\n\n\n var provider = new firebase.auth.FacebookAuthProvider();\n \n firebase.auth().signInWithPopup(provider).then(function(result) {\n // Te da el token de inicio de sesion de facebook\n var token = result.credential.accessToken;\n // Obtiene la informacion del usuario\n var user = result.user;\n document.getElementById(\"botones_primarios\").style.display = \"none\";\n document.getElementById(\"user_div\").style.display = \"block\";\n // En caso de no iniciar sesion correctamente se ejecuta la siguiente funcion\n }).catch(function(error) {\n // Errores en caso de no iniciar sesion\n var errorCode = error.code;\n var errorMessage = error.message;\n // El correo ya esta registrado en la base de datos\n var email = error.email;\n // La credencial Auth ya esta usada\n var credential = error.credential;\n // ...\n document.getElementById(\"user_already_exist_fb\").style.display = \"block\";\n setTimeout(function(){\n jQuery('#Iniciar_Sesion').modal('show');\n }, 1500);\n });\n}", "title": "" }, { "docid": "e077f6fa9c39c768baee1b4a733cce28", "score": "0.5707148", "text": "function isValidUserid(userObj){\n if(!userObj){\n return false;\n }\n if(!userObj.userid || !user.hasOwnProperty(userObj.userid)){\n return false;\n }\n return true\n}", "title": "" }, { "docid": "89a938245e9a1c99e82db14e6f08d414", "score": "0.56991667", "text": "function isUserKnown(){\n\tFB.getLoginStatus(function(response) {\n\t\t if(config.debug)console.log(response);\n\t\t if(response.status == 'not_authorized'){\n\t\t \t\t$(document).trigger('userKnown',false);\n\t\t }else if(response.status == 'connected'){\n\t\t \t\tuserId = response.authResponse.userID;\n\t\t \t\ttoken = response.authResponse.accessToken;\n\t\t \t\t$(document).trigger('userKnown',true);\n\t\t }else if(response.status == 'unknown'){\n\t\t \t\treload = true;\n\t\t \t\t$(document).trigger('userKnown',false);\n\t\t }\n\t});\n}", "title": "" }, { "docid": "fdd79fce17dde5f093b376463c35c240", "score": "0.56890726", "text": "function validateLoginData(userData) {\r\n const schema = Joi.object().keys({\r\n email: Joi.string().email({ minDomainAtoms: 2 }).required(),\r\n password: Joi.string().min(5),\r\n role: Joi.number(),\r\n gcm_id: Joi,\r\n platform: Joi.string(),\r\n });\r\n return Joi.validate(userData, schema);\r\n}", "title": "" }, { "docid": "09162ff176ddd8dfa186d28cb18555dd", "score": "0.56815606", "text": "function validateUserData(userData) {\n const schema = Joi.object().keys({\n fullName: Joi.string().min(4).max(30).required(),\n userName: Joi.string().min(4).max(30).required(),\n email: Joi.string().email({ minDomainAtoms: 2 }).required(),\n mobile: Joi.number().required(),\n password: Joi.string().min(5).regex(/^[a-zA-Z0-9]{3,30}$/),\n _id: Joi.string()\n });\n return Joi.validate(userData, schema);\n}", "title": "" }, { "docid": "e58beb9f35bb3f7d69a917335bf61fd8", "score": "0.5675367", "text": "static validateUserLogin(userLogin, callback) {\n if (userLogin.username && userLogin.password && userLogin.password.length > 5 && userLogin.username.length > 1) {\n userModel_1.User.findOne({ username: userLogin.username }, (err, res) => {\n if (res !== null) {\n this.hashPassword(userLogin.password, (hash) => {\n if (res.password === hash) {\n callback(true, res);\n }\n else {\n callback(false, null);\n }\n });\n }\n else {\n callback(false, null);\n }\n });\n }\n else {\n callback(false, null);\n }\n }", "title": "" }, { "docid": "2250b64b3fad77062866ca5caea31179", "score": "0.56750023", "text": "function FacebookLogin() {\n FB.login(function(response) {\n var userId = response.authResponse.userID;\n FB.api(\n \t\"/\"+userId,\n \tfunction (response){\n \t\tuser = {};\n \t\tuser[\"Email\"] = response.email;\n \t\tuser[\"Name\"] = response.name;\n \t\tuser[\"FacebookId\"] = response.id;\n \t\tUserModelChanged();\n \t},\n \t{fields: 'email,name'}\n ); \n }, {scope: 'public_profile,email'}); \n}", "title": "" }, { "docid": "b3e023a259daaad9dd9b3a80b0d3f3af", "score": "0.566624", "text": "async function validateUser(ctx, args){\n\n /**\n * \n * @var UserExist checks if user of same data exists before creating the user \n */\n const userExist = await ctx.prisma.userAuth({\n email:args\n }).catch( async() => {\n const user = await ctx.prisma.user({id: args})\n if(user)\n return true\n })\n if (userExist)\n return true\n\n return false\n}", "title": "" }, { "docid": "66727c37b54c9c77bdcfdebd33774f67", "score": "0.5659439", "text": "function facebookLogin() {\n\n FB.login(function (response) {\n console.log(response);\n if (response.authResponse) {\n showAlert(\"Please wait... &nbsp; <i class='fa fa-circle-o-notch fa-spin'></i>\");\n\n FB.api('/me/picture?type=normal', function (response) {\n regFBDP = response.data.url;\n console.log(response.data.url);\n });\n\n FB.api('/me?fields=name,picture,email,id,link', function (response) {\n\n regFBName = response.name;\n regFBEmail = response.email;\n regFBID = response.id;\n\n console.log(response);\n\n requests.userLogin(response.email, response.id, function (response) {\n if (response.status == \"Success\") {\n myUser = response;\n loginSuccess();\n }\n else facebookRegister();\n });\n });\n }\n else console.log('User cancelled login or did not fully authorize.');\n }, {scope: 'email,public_profile'});\n}", "title": "" }, { "docid": "6e243c77f9476c3a04a73edb543e0456", "score": "0.5643379", "text": "function validUser(user){\n // do stuff\n const validEmail = typeof user.email == 'string' &&\n user.email.trim() != '';\n\n const validPassword = typeof user.password == 'string' &&\n user.password.trim() != '' &&\n user.password.trim().length >= 6;\n\n return validEmail && validPassword;\n\n}", "title": "" }, { "docid": "33b2d45bcd4258d6bac6522adb30d822", "score": "0.56359845", "text": "function checkValidUser() {\n\t\tif (userData.includes(toUpperFirst(userNameInput))) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tcreateErrorMessage.invalid();\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "7f544493db27a1d867be6432242da807", "score": "0.5635003", "text": "function fbLogin() {\n FB.login(function (response) {\n if (response.authResponse) {\n // Get and display the user profile data\n getFbUserData();\n } else {\n document.getElementById('status').innerHTML = 'User cancelled login or did not fully authorize.';\n }\n }, {scope: 'email'});\n}", "title": "" }, { "docid": "9d310fe86063edf5f51227d2e100c8f7", "score": "0.56200325", "text": "function validateProfile(user) {\n const schema = {\n user_id: Joi.string().required(),\n user_name: Joi.string().required(),\n first_name: Joi.string().required(),\n last_name: Joi.string().required(),\n email_id: Joi.string().email().required(),\n user_image: Joi.string(),\n user_bio: Joi.string(),\n city: Joi.string(),\n state: Joi.string(),\n zip_code: Joi.string(),\n route: Joi.string()\n };\n\n return Joi.validate(user, schema);\n}", "title": "" }, { "docid": "f628175652844ef1f3d473e7f45e4e5c", "score": "0.56128734", "text": "userIsInvalid ({ commit }) {\n commit(SESSION_INVALID)\n }", "title": "" }, { "docid": "715e198922b2de802ed8b952f340e96f", "score": "0.5606519", "text": "static validateUserSignup(user, callback) {\n let status = true;\n if (!user.name || !user.username || !user.password) {\n status = false;\n }\n userModel_1.User.findOne({ username: user.username }, (err, res) => {\n status = (res === null);\n callback(status);\n });\n }", "title": "" }, { "docid": "c9e4e78887fe7f3d26f076856dd40d29", "score": "0.5591263", "text": "function isUserValid(bool) {\n\treturn bool;\n}", "title": "" }, { "docid": "8d8ca92a5c5224cf8d793f3078349e02", "score": "0.5580627", "text": "function checkFormIntegrityUser() {\n\n return true;\n}", "title": "" }, { "docid": "c70f1e11eacf722c9ca01386c3c4c82a", "score": "0.5578435", "text": "function handleFBLogin() {\n if (!firebase.auth().currentUser) {\n var provider = new firebase.auth.FacebookAuthProvider();\n firebase.auth().signInWithPopup(provider)\n .then(function (result) {\n var token = result.credential.accessToken;\n var user = result.user;\n alert(user.email);\n window.location.href = 'index.html'\n })\n .catch(function (error) {\n alert(error.message);\n })\n } else {\n handleSignOut();\n alert(\"Users is already signed out!\")\n }\n}", "title": "" }, { "docid": "1aacdeb44f86e447644ae24ccdb4b84e", "score": "0.5572901", "text": "function validateFields(user){\n var good = false;\n if(user !== undefined){\n good = true;\n\n if(user.name.length <= 0){\n good = false;\n }\n if(user.lastname.length <= 0){\n good = false;\n }\n if(user.age < 15){\n good = false;\n }\n if(user.city.province.value == ''){\n good = false;\n }\n if(user.city.canton.value == ''){\n good = false;\n }\n if(user.study.value == ''){\n good = false;\n }\n if(user.vehicleId == ''){\n good = false;\n }\n if(user.email == ''){\n good = false;\n }\n if(user.whatsapp <= 0){\n good = false;\n }\n \n /*\n * Must check if the user uploads something\n */\n user.image = 'http://res.cloudinary.com/dlxqbg8py/image/upload/v1460263761/profile-icon_tuhgvs.png';\n }\n return good;\n }", "title": "" }, { "docid": "b79260190dc311e2b85f510bdef52720", "score": "0.557158", "text": "function validateUser(user) {\n // Returns true if it matches correct format.\n user = /^[a-z0-9]+$/i.test(user);\n return user;\n}", "title": "" }, { "docid": "8acd542826aaad3b4c0ce021ddc826ae", "score": "0.55404913", "text": "facebook (req, res){\n let request = require('request');\n let fields = ['id', 'email', 'first_name', 'last_name', 'link', 'name'];\n let accessTokenUrl = 'https://graph.facebook.com/v2.5/oauth/access_token';\n let graphApiUrl = 'https://graph.facebook.com/v2.5/me?fields=' + fields.join(',');\n let CLIENT_SECRET = ENV_OBJ.FACEBOOK.CLIENT_SECRET;\n let params = {\n code: req.body.code,\n client_id: req.body.clientId,\n client_secret: ENV_OBJ.FACEBOOK.CLIENT_SECRET,\n redirect_uri: req.body.redirectUri\n };\n let userId = (req.body.userData) ? req.body.userData : \"\";\n req.body.platform = req.body.platform || 'WEB';\n req.body.deviceToken = req.body.deviceToken || '';\n\n // Step 1. Exchange authorization code for access token.\n request.get({ url: accessTokenUrl, qs: params, json: true }, function(err, response, accessToken) {\n if (response.statusCode !== 200) {\n //return res.status(500).send({ message: accessToken.error.message });\n return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n }\n\n // Step 2. Retrieve profile information about the current user.\n request.get({ url: graphApiUrl, qs: accessToken, json: true }, function(err, response, profile) {\n if (response.statusCode !== 200) {\n //return res.status(500).send({ message: profile.error.message });\n return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n }\n\n CommonService.isFacebookIdExist(profile.sub, UserModel, function (emailStatus) {\n\n if (emailStatus == false) {\n if (userId) {\n UserModel.findOneAndUpdate({_id : userId },{facebookId : profile.id},{upsert : false, new : true}, function(err, updateData) {\n if(err) return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n return res.json({resStatus:'success', msg : \"Google Account has been successfully linked\", result : updateData});\n });\n } else {\n\n CommonService.isEmailExist(profile.email, UserModel, function (emailExist) {\n\n if (emailExist == false) {\n let newUser = {};\n newUser.facebookId = profile.id;\n newUser.name = { first : profile.first_name, last : profile.last_name};\n newUser.profile = { photo : 'https://graph.facebook.com/v2.3/' + profile.id + '/picture?type=large'};\n newUser.email = profile.email;\n newUser.status = true;\n newUser.password = CommonService.generateOtp(10);\n let template = AppConstants.SOCIAL_REGISTRATION_TEMPLATE;\n template = template.replace(\"{{PASSWORD}}\", newUser.password);\n template = template.replace(\"{{USERNAME}}\", profile.name);\n UserModel(newUser).save(function(err, resData) {\n if (err) return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n let mailOptions = {\n from: AppConstants.EMAIL,\n to: resData.email,\n subject: \"Acount Password\",\n html: template\n }\n // UserModel.update({_id : resData._id },{isLogin : true},{upsert : false}, function(err, updateStatus) {\n // console.log(\"User logged into the application\");\n // });\n EmailService.send(mailOptions,function(err, response){\n if(err) {\n console.log(\"Email Not Sent\");\n } else {\n console.log(\"Email Sent Succesfully\");\n }\n });\n return res.json({resStatus:'success', msg :AppMessages.LOGIN, token: JwtService.issueToken(resData._id, req.body.platform, req.body.deviceToken),result: resData});\n });\n }else {\n UserModel.findOneAndUpdate({email : profile.email },{facebookId : profile.id},{upsert : false, new : true}, function(err, updateData) {\n if(err) return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n return res.json({resStatus:'success', msg : \"You have successfully logged in\", result : updateData});\n });\n }\n });\n }\n }else if (emailStatus == true) {\n if(userId) {\n UserModel.findOneAndUpdate({_id : userId },{facebookId : profile.id},{upsert : false, new : true}, function(err, updateData) {\n if(err) return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n return res.json({resStatus:'success', msg : \"Google Account has been successfully linked\", result : updateData});\n });\n } else {\n // Step 3a. Link user accounts.\n UserModel.findOne({facebookId : profile.id }, function(err, existingUser) {\n if (err) return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n if (existingUser) {\n // UserModel.update({_id : resData._id },{isLogin : true},{upsert : false}, function(err, updateStatus) {\n // console.log(\"User logged into the application\");\n // });\n return res.json({resStatus:'success', msg :AppMessages.LOGIN, token: JwtService.issueToken(existingUser._id, req.body.platform, req.body.deviceToken),result: existingUser});\n } else {\n return res.json({resStatus:'error', msg : AppMessages.DUPLICATE_ACCOUNT});\n }\n });\n }\n\n } else {\n return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n }\n });\n });\n });\n }", "title": "" }, { "docid": "a1e7e0972cd06ffe6ee4da707a2923cb", "score": "0.55261815", "text": "function validateUser(user) {\n const schema = {\n name: Joi.string().min(5).max(50).required(),\n email: Joi.string().min(5).max(50).required().email(),\n password:Joi.string().min(5).max(255).required(),\n confirmPassword:Joi.string().min(5).max(255).required()\n };\n \n return Joi.validate(user, schema);\n }", "title": "" }, { "docid": "185234de38fa02f620e474f9ae60d343", "score": "0.55132496", "text": "function validate() {\r\n var email = document.querySelector('.feedback__input[type=\"email\"]').value;\r\n \r\n if (!validateEmail(email)) {\r\n alert(\"Некорректный e-mail\");\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "7f55abe56a47094a4509a0563bc70b19", "score": "0.5512502", "text": "async _validate() {\n const userObj = await UserModel.getUser({ userName: this.userName });\n if (!userObj) {\n return Promise.reject({\n message: 'Invalid user'\n });\n }\n }", "title": "" }, { "docid": "802f0ccb3430fb72bc734ffb0c5617ce", "score": "0.5508663", "text": "static async checkIfValidUserForRequest(requestedUser, userId){\n let isValid = true; \n console.log(\"requested user is \" + JSON.stringify(requestedUser));\n console.log(\"userId sent is \" + JSON.stringify(userId));\n if(!requestedUser.superAdmin){\n console.log(\"is not super admin\")\n if(requestedUser._id.toString() !== userId ){\n console.log(\"user id dont match\");\n isValid = false;\n }\n else{\n console.log(\"user ids match\");\n }\n }\n else if(!requestedUser.active){\n console.log(\"super admin but not active\")\n isValid = false;\n }\n\n return isValid;\n }", "title": "" }, { "docid": "22da8e4353110ebf1ebe88461cd4b0c9", "score": "0.5507913", "text": "verifyUser() {}", "title": "" }, { "docid": "b6264a907d11a0b1f20ac56db07f6f82", "score": "0.5506212", "text": "function getFbUserData(){\n FB.api('/me', {locale: 'en_US', fields: 'id,first_name,last_name,email,picture'},\n function (response) {\n if (!response.email){\n var email = response.id\n }\n else{\n var email = response.email\n }\n var obj={\n id:response.id,\n username:response.first_name+' '+response.last_name,\n email:email,\n dp:response.picture.data.url\n };\n console.log(obj)\n var data_json = JSON.stringify(obj);\n $.ajax({\n url: \"/fblogin\",\n type: \"POST\",\n data: data_json,\n dataType: \"json\",\n async: false,\n contentType: \"application/json\",\n success: function (data, textStatus, jqXHR) {\n if (data == \"yes\") {\n location.replace(\"/profile\");\n }\n else if (data == \"exist\") {\n location.replace(\"/\");\n }\n }\n });\n });\n\n}", "title": "" }, { "docid": "9bc2c2fd5ae4ac2e8412123a70572784", "score": "0.5505041", "text": "checkLoginState () {\n window.FB.getLoginStatus((response) => {\n this.statusChangeCallback(response)\n })\n }", "title": "" }, { "docid": "19302d2431faaa908672bba866547e97", "score": "0.55047446", "text": "handleLoginButton() {\n if (this.state.facebookText != 'Đăng xuất')\n {\n loginFb(true,\n (data) => {\n if (data != false)\n {\n Alert.alert(\n 'HCMUS Avatar',\n 'Đăng nhập tài khoản Facebook thành công!',\n [{ text: 'OK' }]\n );\n };\n });\n }\n else\n {\n { this.handleLogoutButton() }\n }\n }", "title": "" }, { "docid": "da521fdc9a9c69a2f761e566e80001f8", "score": "0.55042124", "text": "function validEmail(body){\n\treturn (body.userEmail);\n}", "title": "" }, { "docid": "9690bdba1b75e7bc5b99648290c1cd20", "score": "0.55020666", "text": "function validateUser (user) {\n const schema = {\n name: Joi.string().min(3).max(50).required(),\n email: Joi.string().min(3).max(255).email(),\n phone: Joi.string().min(10).max(14).required(),\n org_id: Joi.string().min(7).max(10).required(),\n password: Joi.string().min(3).max(255).required(),\n group: Joi.string().min(3).max(255).required(),\n field: Joi.string(),\n secret: Joi.string().min(0).max(200)\n };\n\n return Joi.validate(user, schema);\n}", "title": "" }, { "docid": "9334f33a8c2cbc968b70453c9cfa322b", "score": "0.5496395", "text": "function validateUser(user) {\n\tconst schema = Joi.object({\n\t\tfirstName: Joi.string().min(3).max(50).required(),\n\t\tlastName: Joi.string().min(3).max(50).required(),\n\t\tusername: Joi.string().min(5).max(50).required().token(),\n\t\temail: Joi.string().min(5).max(255).required().email(),\n\t\tmobile: Joi.string()\n\t\t\t.min(5)\n\t\t\t.max(50)\n\t\t\t.required()\n\t\t\t.pattern(/^[0-9]+$/),\n\t\taddress: Joi.string().max(400),\n\t});\n\n\treturn schema.validate(user);\n}", "title": "" }, { "docid": "a25d78f8ff20a90ea6f02ba5970984b7", "score": "0.5492552", "text": "static validateUserEdit(user) {\n return !!(user.email && user.gender && user.name && user.phone);\n }", "title": "" }, { "docid": "d8bdf74d496a38b923c27886f2107c8b", "score": "0.54906267", "text": "function userValidation (data) {\n const userSchema = yup.object().shape({\n username: yup.string().min(5).max(30).required(),\n password: yup.string().min(10).matches(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/g).required(),\n email: yup.string().email().required(),\n });\n\n userSchema.validateSync(data);\n}", "title": "" }, { "docid": "acd895b8b54e2fa45225e0e01e6a0d0f", "score": "0.5490149", "text": "checkUser (callback) {\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'get',\n\t\t\t\tpath: '/users/' + this.unregisteredUser.user.id,\n\t\t\t\ttoken: this.token\n\t\t\t},\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tAssert.equal(response.user.lastInviteType, 'reviewNotification', 'lastInviteType should be \"reviewNotification\"');\n\t\t\t\tAssert.equal(response.user.inviteTrigger, `R${this.reviewId}`);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "ed9d4ffa14a76023ea016f21058e5176", "score": "0.5487899", "text": "fbVerify(event) {\n const queryParams = event.queryStringParameters;\n const rVerifyToken = queryParams['hub.verify_token']\n if (rVerifyToken === VERIFY_TOKEN) {\n const challenge = queryParams['hub.challenge']\n const response = {\n 'body': parseInt(challenge),\n 'statusCode': 200\n };\n callback(null, response);\n } else {\n const response = {\n 'body': 'Error, wrong validation token',\n 'statusCode': 422\n };\n callback(null, response);\n }\n }", "title": "" }, { "docid": "295d27f6c41621e7a7cf61ae8d6375fa", "score": "0.5479934", "text": "function loginFB(callback) {\n\t\t\t\tisLoggedInFB(function(e){\n\t\t\t\t\tif(!e){\n\t\t\t\t\t\tFB.login(\n\t\t\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\t\t\tif (response.session) {\n\t\t\t\t\t\t\t\t\tcallback(true);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcallback(false);\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ scope: \"email,user_checkins,publish_stream\" }\n\t\t\t\t\t\t);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tcallback(true);\n\t\t\t\t\t}\n\t\t\t\t}); \n }", "title": "" }, { "docid": "f8f560cad0ac2fdf56ee24c9b5fcc957", "score": "0.5469968", "text": "function validateForm() {\n return user.userName.length > 0 && user.password.length > 0;\n }", "title": "" }, { "docid": "b476eb222db4ab00f0995c2e76957192", "score": "0.5469454", "text": "function isSharexTokenValid(sharextoken, callback) { // returns error (could be null) and object if valid and username\n var res;\n var sql = 'SELECT username FROM users WHERE sharextoken = ?'\n // var result = db.get('SELECT username FROM users WHERE sharextoken = ?', sharextoken)\n \n db.get(sql, sharextoken, function(error, result) {\n if (error) {\n console.error(error)\n return callback(error)\n }\n else {\n if (!result) { // If username is NOT found that has matching sharextoken\n console.info(\"Sharextoken NOT found:\", sharextoken)\n callback(null, {\n valid: false,\n username: null\n })\n } else {\n console.info(\"Sharextoken FOUND\", sharextoken)\n callback(null, {\n valid: true,\n username: result.username\n })\n }\n }\n })\n}", "title": "" }, { "docid": "41a7102bda621d9c0bfe93c8b08908c9", "score": "0.54677504", "text": "function validateUser(user) {\n return user.email.toString().trim() !== '' &&\n user.password.toString().trim() !== '' &&\n user.username.toString().trim() !== ''\n}", "title": "" }, { "docid": "46648136781c5e1ce887a58c4829b06c", "score": "0.54618204", "text": "isValidProfile() { //auth.getUser();\n let profile = JSON.parse(localStorage.getItem(\"profile\"));\n let isValid = false;\n\n // Check that all fields in profile are filled out\n if(profile.currentWeight !== '' && profile.goalWeight !== '' && profile.feet !== '' && profile.inches !== ''\n && profile.gender !== '' && profile.timeline !== '' && profile.name !== '' && profile.birthDate > '1909-01-01T00:00:00'){\n isValid = true;\n }\n\n return isValid;\n\n }", "title": "" }, { "docid": "94e3e6d3a83c4818ecba62479f318a1b", "score": "0.5458164", "text": "static validateUserPassword(user, userData, callback) {\n if (user.newPassword && user.oldPassword && user.newPassword.length > 5) {\n this.hashPassword(user.oldPassword, (oldHash) => {\n if (userData.password !== oldHash) {\n callback(false, null);\n }\n else {\n this.hashPassword(user.newPassword, (newHash) => {\n callback(true, newHash);\n });\n }\n });\n }\n else {\n callback(false, null);\n }\n }", "title": "" }, { "docid": "407d6d6f7e48d3872df2619b2c9e2b11", "score": "0.54481995", "text": "function fb_login() {\r\n FB.login(function(response){\r\n statusChangeCallback(response);\r\n });\r\n}", "title": "" }, { "docid": "5bee06817c02d7981589bd182ee4c3be", "score": "0.5447956", "text": "validateEmail () {\n return validator.isEmail(this.state.email)\n }", "title": "" }, { "docid": "d714d173e28bf7e742fbe4ea860d71f2", "score": "0.54469883", "text": "FBstatusChangeCallback(response) {\n\t\t\n\t\tif (response.status === 'connected') {\n\t\t\t\n\t\t\tFB.api('/me', (response) => {\n\t\t\t\t\n\t\t\t\tif (response.name && !this.user) {\n\t\t\t\t \tresponse.type = 'fb';\t\n\t\t \t\tresponse.native_id = response.id;\n\t\t\t\t\tdelete response.id;\n\t\t\t\t\t\n\t\t\t\t\tthis.$http.post('/user/signup3rdParty', response)\n\t\t\t\t\t.then((res) => {\n\t\t\t\t\t\t\tif (res && res.data && res.data.id) {\n\t\t\t\t\t \t\tthis.user = res.data;\n\t\t\t\t\t \t\tupdateUser.call(this, res.data);\n\t\t\t\t\t \t}\n\t\t\t\t });\n\t\t\t\t}\n\n\t\t });\n\n\t\t} else if (response.status === 'not_authorized') {\n\t\t // The person is logged into Facebook, but not your app.\n\t\t //document.getElementById('status').innerHTML = 'Please log ' +'into this app.';\n\t\t} else {\n\t\t // The person is not logged into Facebook, so we're not sure if\n\t\t // they are logged into this app or not.\n\t\t //document.getElementById('status').innerHTML = 'Please log ' +'into Facebook.';\n\t\t}\n\t}", "title": "" }, { "docid": "64bfb439a3f08ba366b19ec629686ca8", "score": "0.5439931", "text": "function validateSignInData(data) {\n\n result = true;\n\n // Check user name\n inp = document.getElementById('userInput');\n msg = document.getElementById('userMsg');\n if (data.user == '') {\n inp.classList.add('fault');\n msg.innerText = 'Required.';\n msg.hidden = false;\n result = false;\n } else {\n msg.hidden = true;\n }\n\n // Check password\n inp = document.getElementById('passInput');\n msg = document.getElementById('passMsg');\n if (data.pass == '') {\n inp.classList.add('fault');\n msg.innerText = 'Required.';\n msg.hidden = false;\n result = false;\n } else {\n msg.hidden = true;\n }\n\n return result;\n\n}", "title": "" }, { "docid": "c66e69e8d2abf4ad28d161dbab3cd71a", "score": "0.5436698", "text": "function authenticateUser(){\n\tFB.login(function(response) {\n\t\t if(config.debug)console.log(response);\n\t\t if(response.status == 'unknown'){\n\t\t \t\t$(document).trigger('authenticatedUser',{authenticated:false});\n\t\t }else if(response.status == 'connected'){\n\t\t \t\ttoken = response.authResponse.accessToken;\n\t\t \t\tuserId = response.authResponse.userID;\n\t\t \t\t\n\t\t \t\t//now we need to check if the user has allowed us all the necessary permissions\n\t\t \t\tcheckUserPermissions();\n\t\t }\t\t \n\t},{scope:config.scope});\n\n}", "title": "" }, { "docid": "03ba6dce150b88a36caf190777f6445a", "score": "0.54360783", "text": "function HandleFaceBook(type) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\--- When the user has been identified to be logged into\n if (type==\"connected\")\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n var getUser = fbUser(function(model){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t \tvar user=GrabUserInfo(model.id);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t\t\tif (user=='0')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t\t\t{\tvar text='<div id=\"fbtext\">You are Logged on to facebook as \"'+model.username+'\". ';\t//\t\\\n \t\t\t\ttext=text+'Click the button below to create an account tied to this user. By linking ';\t//\t\\\n \t\t\t\ttext=text+'your CAD Wolf account to your facebook account, you only need to supply a ';\t//\t\\\n\t\t\t\ttext=text+'user name. ';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t\t\t\ttext=text+'Note that CAD Wolf uses only your name, gender, and time zone. We neither ';\t//\t\\\n\t\t\t\ttext=text+'request nor use your friends list or other information.</div>';\t\t\t\t//\t\\\n \t\t\t\ttext=text+'<div id=\"fb_link\">Create account with \"'+model.username+'\"</div>';\t\t\t//\t\\\n \t\t\t\t$('#facebook_data').html(text);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t\t\t}else\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t\t\t{\tvar text='<div id=\"fbtext\">You are Logged on to facebook as \"'+model.username+'\" ';\t\t//\t\\\n \t\t\t\ttext=text+'which is tied to the CAD Wolf user \"'+user+'\". Only one CAD Wolf account ';\t//\t\\\n \t\t\t\ttext=text+'can be created per facebook account.</div>';\t\t\t\t\t\t\t\t\t//\t\\\n \t\t\t\ttext=text+'<div id=\"fb_connected\" userid=\"'+user+'\">Log in as '+user+'</div>';\t\t\t//\t\\\n \t\t\t\t$('#facebook_data').html(text);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n \t});\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n }else if (type==\"not\")\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t{\tvar text='<div id=\"fbtext\">You are logged into facebook as a user that has not logged into ';\t//\t\\\n\t\ttext=text+'this website before. Click the button below to approve this app for your facebook ';\t//\t\\\n\t\ttext=text+'profile and create a CAD Wolf account linked to it. Note that CAD Wolf uses only ';\t//\t\\\n\t\ttext=text+'your name, gender, and time zone. We neither request nor use your friends list or ';\t//\t\\\n\t\ttext=text+'other information.</div>';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n\t\t$('#facebook_data').html(text);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n }else if (type==\"none\")\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n \tvar text='<div id=\"fbtext\">You are not logged in to facebook. Clicked the link below to log ';\t//\t\\\n \ttext=text+'into facebook. and then log into CAD Wolf through an associated account.</div>';\t\t//\t\\\n\t\t$('#facebook_data').html(text); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\\n}\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\\", "title": "" }, { "docid": "9ae2b6e39281c3814af193fd61c87562", "score": "0.5428169", "text": "function validateUserSurname() {\n\n // check if it is empty\n if (cognomeUtente == \"\") {\n return true;\n }\n\n // check if it contains numbers\n for (let i = 0; i < cognomeUtente.length; i++) {\n if ( !isNaN(cognomeUtente[i]) ) {\n return true;\n }\n }\n\n // check if it includes invalid characters\n const invalidCharacters = [\"!\", \"”\", \"#\", \"$\", \"%\", \"&\", \"(\", \")\", \"*\", \"+\", \",\", \"-\", \".\", \"/\", \":\", \";\", \"<\", \">\", \"=\", \"?\", \"@\", \"[\", \"^\", \"]\", \"_\", \"|\", \"{\", \"~\", \"}\", \"\\\\\"];\n for (let i = 0; i < invalidCharacters.length; i++) {\n if (cognomeUtente.includes(invalidCharacters[i])) {\n return true;\n } \n }\n\n // reurn false if the input is valid\n return false;\n}", "title": "" }, { "docid": "f9190e08119f82d72d337e816ab9a6c2", "score": "0.5427749", "text": "static validate(userToValildate) {\n\n const validationSchema = {\n userFirstName: Joi.string().required(),\n userSecondName: Joi.string().required(),\n userName: Joi.string().required().min(4).max(20),\n userPassword: Joi.string().required().min(4).max(20),\n };\n\n const error = Joi.validate(\n userToValildate, validationSchema, { abortEarly: false }).error;\n\n if (error) {\n return error.details.map(err => err.message)\n }\n\n return null;\n }", "title": "" }, { "docid": "8ecf34c4c4f9af1cefe7616ef6215caf", "score": "0.54194134", "text": "function fbLogin() {\n FB.login({\n scope: \"email\",\n return_scopes: true,\n }).then((response) => {\n if (response.status === \"connected\") {\n getFbUserData();\n } else {\n document.getElementById(\"loginAlert\").innerHTML =\n \"User cancelled login or did not fully authorize.\";\n }\n });\n }", "title": "" }, { "docid": "115e669711b5604cb8ecfb3e7608ca2d", "score": "0.54189867", "text": "function checkUsersValid(goodUsers) {\n return function allUsersValid(submittedUsers) {};\n}", "title": "" }, { "docid": "a7ae98d8d3fc98f56decc5e3b3987851", "score": "0.5417899", "text": "function userid_validation(uid,mx,my)\r\n{\r\nvar uid_len = uid.value.length;\r\nif (uid_len == 0 || uid_len >= my || uid_len < mx)\r\n{\r\nalert(\"User Id should not be empty / length be between \"+mx+\" to \"+my);\r\nuid.focus();\r\nreturn false;\r\n}\r\nreturn true;\r\n}", "title": "" }, { "docid": "14e1866c24a9d78a1bdc12955f6273fb", "score": "0.54178536", "text": "validarEmail() {\n var re = /\\S+@\\S+\\.\\S+/;\n if (!re.test(this.state.email)) {\n Alert.alert('Error', 'El email ingresado no parece ser válido.');\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "aaca5d1e497053ecffbf7ab8c4482486", "score": "0.5404904", "text": "function verifier() {\n var inp_name_new_user = $('#inp_name_new_user').value;\n var inp_firstname_new_user = $('#inp_firstname_new_user').value;\n var inp_email_new_user = $('#inp_email_new_user').value;\n var inp_password_new_user = $('#inp_password_new_user').value;\n\n if (inp_name_new_user == \"\" || inp_firstname_new_user == \"\" || inp_email_new_user == \"\" || inp_password_new_user == \"\") {\n alert('Veuillez complétez tous les champs du formulaire');\n $('#inp_name_new_user').focus;\n $('#inp_firstname_new_user').focus;\n $('#inp_email_new_user').focus;\n $('#inp_password_new_user').focus;\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "157685ca9d9e9d98e2879a740668dfea", "score": "0.5403291", "text": "function validateUser(user) {\n const schema = {\n fullName: joi.string().min(5).max(50).required(),\n email: joi.string().min(5).max(255).required().email(),\n contactNumber: joi.number().min(0).required(),\n fullAddress: joi.string().min(5).max(255).required(),\n password: joi.string().min(5).max(1024).required(),\n profileImage: joi.string(),\n // isAdmin: joi.boolean,\n };\n\n return joi.validate(user, schema);\n}", "title": "" }, { "docid": "a1ef92040bf61578b85e91b2cb011bf8", "score": "0.5402395", "text": "logInUserWithFacebook(req, res) {\n const token = req.body.access_token;\n if (!token || token === '') {\n return res\n .status(400)\n .json({ error: 'auth/facebook/invalid-access-token' });\n }\n\n const credential = admin.auth.FacebookAuthProvider.credential(token);\n let isNew, email, uid;\n\n return admin\n .auth()\n .signInWithCredential(credential)\n .then((data) => {\n isNew = data.additionalUserInfo.isNewUser;\n if (isNew) {\n authApi.createDocuments(data);\n } else {\n authApi.updateUserData(data);\n }\n uid = data.user.uid;\n email = data.user.email;\n return data.user.getIdToken();\n })\n .then((token) => {\n console.log(\n `User ${email} ` +\n (isNew ? 'signed up' : 'logged in') +\n ' successfully with Facebook'\n );\n return res.status(isNew ? 201 : 200).json({\n result: isNew ? 'auth/success-signup' : 'auth/success-login',\n uid,\n token,\n });\n })\n .catch((err) => {\n switch (err.code) {\n case 'auth/user-disabled':\n case 'auth/account-exists-with-different-credential':\n case 'auth/user-token-expired':\n default:\n return res.status(403).json({ error: err.code });\n }\n });\n }", "title": "" }, { "docid": "a30d215476b212e094ef1d84fe041f93", "score": "0.5396454", "text": "function useridVal(uid, my, my) {\n var uidLen = uid.value.length;\n if (uidLen == 0 || uidLen >= my || uidLen < mx) {\n alert(\" sorry the input is wrong\");\n uid.style.border = \"2px solid red\";\n uid.focus();\n\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "6d11743a2347bb08d3e5af970ec84e58", "score": "0.53913003", "text": "function checkFBstatus() {\n\n\t }", "title": "" }, { "docid": "49e9f70bd826e4501a67a00af780b6c6", "score": "0.5389998", "text": "function comprobarUsuario(){\n //Usuario Registrado\n if (Parse.User.current()){\n //alert(\"ESTA FIUNCIONANDO\");\n return true;\n \n //Usuario no registrado\n }else{\n //alert(\"aja\");\n return false;\n } \n }", "title": "" }, { "docid": "dfc01bde275f5741fd19e0a1e557a83d", "score": "0.5384342", "text": "function facebookLogin(){\n\tFB.login(function(response) {\n\t\t\tif (response.authResponse) {\n\t\t\t\tgetUserFacebookInfo(response.authResponse.userID);\n\t\t\t} else {\n\t\t\t\teventControl.eventDispatcher().trigger('facebookDisconnected');\n\t\t\t}\n\t\t},{scope: 'email'});\n}", "title": "" }, { "docid": "e15365b0b48654996addca3b7a766b4e", "score": "0.5383339", "text": "facebookSignIn() {\n this.$cordovaFacebook.getLoginStatus()\n .then((success) => {\n if (success.status === 'connected') {\n this.fbUserLoginToSystem(success.authResponse);\n } else {\n console.log('getLoginStatus', success.status);\n this.$ionicLoading.show();\n // Ask the permissions you need. You can learn more about\n // FB permissions here: https://developers.facebook.com/docs/facebook-login/permissions/v2.4\n this.$cordovaFacebook.login([\"public_profile\", \"email\", 'user_birthday'])\n .then(\n this.fbLoginSuccess.bind(this),\n this.fbLoginError.bind(this)\n );\n }\n }, (error) => {\n this.showAlert(error);\n });\n }", "title": "" }, { "docid": "7d7e746547f290424d322396530f22b2", "score": "0.538234", "text": "function userProfileFormCanBeSubmitted(urlValidateProfileName){\n\tvar isValidProfileName = validateProfileNameAjax(urlValidateProfileName);\n\tvar isValidProfileDescription = validateProfileDescription();\n\n\tif(isValidProfileName && isValidProfileDescription)\n\t\treturn true\n\n\treturn false;\n}", "title": "" }, { "docid": "ba102b77b5faddd4d8028e3319d07c20", "score": "0.5382132", "text": "function validate(user) {\n const schema = {\n email: Joi.string().min(5).max(255).required().email(),\n password: Joi.string().min(5).max(255).required()\n };\n \n return Joi.validate(user, schema);\n }", "title": "" }, { "docid": "9b1e55235e31d1fd13284a41dc138b35", "score": "0.5379978", "text": "function validateUsuario()\n{\n //verificar si el campo esta vacio\n if(checkIfEmpty(usuario)) return;\n if(!validateAlphanumeric(usuario)) return;\n return true;\n \n}", "title": "" }, { "docid": "17883f92249a686310887f941c35adc6", "score": "0.5375711", "text": "function validateRegisterData(userData) {\r\n const schema = Joi.object().keys({\r\n userName: Joi.string().required(),\r\n email: Joi.string().email({ minDomainAtoms: 2 }).required(),\r\n password: Joi.string().min(5).required(),\r\n phoneNo: Joi.number().required(),\r\n role: Joi.number().valid([1, 2, 3, 4, 5]).required(),\r\n });\r\n return Joi.validate(userData, schema);\r\n}", "title": "" }, { "docid": "705d266e0adb60697d0529f65cddae4b", "score": "0.53687257", "text": "function fbLogin() {\n FB.login(function (response) {\n if (response.authResponse) {\n // Get and display the user profile data\n getFbUserData();\n } else {\n //document.getElementById('status').innerHTML = 'User cancelled login or did not fully authorize.';\n console.error(\"User cancelled login or did not fully authorize.\");\n }\n }, {scope: 'public_profile,email'});\n }", "title": "" }, { "docid": "f7eec00ca4446106af4629c10fc8dff3", "score": "0.53600264", "text": "function validator() {\n let userName = prompt(\"ingrese su usuario:\");\n let pass = prompt(\"ingrese su password:\");\n let userHaveAccess = false;\n let userMach = false;\n for (let i = 0; i < users.length && !userMach; i++) {\n const user = users[i];\n userMach = user.checkData(userName, pass);\n if(userMach && user.getActive()) {\n userHaveAccess = true;\n }\n }\n if (userHaveAccess) {\n alert(\"usted se a logueado correctamente!\");\n } else {\n alert(\"error en la informacion o su usuario no esta activo.\");\n }\n return userHaveAccess;\n}", "title": "" }, { "docid": "6016d5f2fe127a162eef8cceab57fd3c", "score": "0.53552705", "text": "validateInput () {\n var context = this;\n return context.checkValidity()\n .then(function () {\n if (context.state.valid === true) {\n var payload = {app_id: context.state.appId, redirect_url: context.state.redirectUrl};\n if (context.state.type === \"password\") {\n payload.user_id = context.state.userId;\n payload.password = context.state.value;\n }\n else {\n payload.username = context.state.value;\n }\n axios.post(context.state.action, payload, {headers: {\"X-Requested-With\": \"AJAX\"}})\n .then(function(response) { context.handleResponse(response); })\n .catch(function(error) { context.handleResponse(error.response); });\n }\n });\n }", "title": "" }, { "docid": "fb863aea22330b47ede56ced8194b710", "score": "0.5354951", "text": "function checkLoginState() {\n fbLogin();\n //Use this fo status check.\n // FB.getLoginStatus(function(response) {\n // statusChangeCallback(response);\n // });\n}", "title": "" }, { "docid": "0089215578165c5874eb119bfaca04cd", "score": "0.5351993", "text": "function isValid() {\n const { username, email } = regDetails;\n return !(username.error || email.error) && gauge === \"strong\";\n }", "title": "" }, { "docid": "45a875bcab6b5fc33c550846a7e7a46e", "score": "0.5349952", "text": "function validateUser(){\n\t//We loop through aUsers array to see if there's any match with the emailLogin and the passwordLogin\n\tfor(var i=0; i<users.length; i++){\n\t\t//If there's a match, we'll return true\n\t\tif(emailLogin.value == users[i].email && passwordLogin.value == users[i].password){\n\t\t\tindexCurrentUser=i;\n\t\t\treturn true;\n\t\t}\n\t}\n\t//If there's no match after looping through the array, we'll return false\n\treturn false;\n}", "title": "" }, { "docid": "fd4050cf05088180a0948a218fee6849", "score": "0.534246", "text": "function isSignUpUserValid(userName){\r\n\tuserName = $.trim(userName); \r\n\tvar nameReg = /^[\\w\\.]{4,32}$/;\r\n\treturn nameReg.test(userName);\r\n}", "title": "" }, { "docid": "e3bbd2c82c27da244e4f834d6d1dd6b8", "score": "0.5340256", "text": "function validUser(user) {\n const validEmail = typeof user.email === \"string\" && user.email.trim() !== \"\";\n const validPassword = typeof user.password === \"string\" && user.password.trim() !== \"\";\n return validEmail && validPassword;\n}", "title": "" }, { "docid": "d4409b1bb0cb8bc53068c4cc12c746a4", "score": "0.5338753", "text": "function isValidUser(req) {\n\tif (req.body.username.length < 5 ||\n\t\treq.body.username.length > 30) {\n\t\treturn false;\n\t}\n\tif (req.body.hashed_password.length < 5 ||\n\t\treq.body.hashed_password.length > 30) {\n\t\treturn false;\n\t}\n\t// if (req.body.first_name.length == 0 ||\n\t// \treq.body.first_name.length > 30) {\n\t// \treturn false;\n\t// }\n\t// if (req.body.last_name.length == 0 ||\n\t// \treq.body.last_name.length > 30) {\n\t// \treturn false;\n\t// }\n\treturn isValidEmail(req.body.email);\n}", "title": "" } ]
3d951eea6cdc35b3e35c669ae31baefa
Ex.14 Write the function onlyTitles that creates an array with only the titles of the movies.
[ { "docid": "409dde04f0dc4944171ac1e07b2d46cc", "score": "0.8649276", "text": "function onlyTitles() {\n let output = [];\n for (i = 0; i < movies.length; i++) {\n output.push(movies[i].Title);\n }\n return output;\n }", "title": "" } ]
[ { "docid": "aecf53cfdf601006dd7422eb7ddea2e1", "score": "0.77529484", "text": "function onlyTheTitles() {\n let titleArr=[]\n for(let movie of movies){\n titleArr.push(movie.Title)\n }\n return titleArr\n}", "title": "" }, { "docid": "de301255c70b19931110c5b9b22a63be", "score": "0.74749786", "text": "function onlyTitles(arr) {\n let names = [];\n for (let i = 0; i < arr.length; i++) {\n names.push(arr[i].Title);\n }\n return names;\n}", "title": "" }, { "docid": "8986ae91cb38d433341ac18d8c1d507d", "score": "0.720716", "text": "function getAllTitles(movies) {\n return movies.map( function(movie) {\n return movie.title;\n })\n}", "title": "" }, { "docid": "f9b3fcef14c269692232872f7af597b4", "score": "0.6984848", "text": "function orderAlphabetically(movies){\n movies.sort(function(a, b){\n if (a.title > b.title) {\n return 1;\n }\n \n else if (a.title < b.title) {\n return -1;\n }\n return 0;\n })\n if (movies.length >= 20) {\n movies.splice(20);\n }\n\n var onlyTitles = movies.map(movie => movie.title);\n return onlyTitles;\n}", "title": "" }, { "docid": "289b6636780037b5406b22cf7a6e99eb", "score": "0.6642766", "text": "function orderAlphabetically(movies) {\n const allMovies = Array.from(movies);\n\n const onlyTitles = allMovies.map(function (movies) {\n return movies.title;\n });\n // -> HERE WE HAVE ALL THE MOVIES TITLES\n onlyTitles.sort();\n // -> ALPHABETIC ORDER OF TITLES\n onlyTitles.slice(0, onlyTitles.length);\n if (onlyTitles.length > 20) {\n return onlyTitles.slice(0, 20);\n }\n return onlyTitles;\n}", "title": "" }, { "docid": "6cbc6f1e7720b540bf408419ad15d65b", "score": "0.66392154", "text": "function orderAlphabetically(movies) {\n let onlyTitles = movies.map(function(element) {\n return element.title;\n });\n let sortedArray = onlyTitles.sort(function(a, b) {\n return a.localeCompare(b);\n }).slice(0, 20);\n return sortedArray;\n}", "title": "" }, { "docid": "04da69ffad1a70c6794130ae523e5cfd", "score": "0.66015834", "text": "function orderAlphabetically(arrMov) {\n const movieTitles = [ ];\n arrMov.forEach(movie =>{\n movieTitles.push(movie.title)\n })\n return movieTitles.sort().slice(0,20);\n \n}", "title": "" }, { "docid": "73f084b0567ae809a360bc9560420572", "score": "0.65766805", "text": "function movieNames(text,arrayMovie) {\n if (text === null) {\n return [];\n }\n if (text.length === 0) { \n return [];\n }\n const arr = arrayMovie.filter((movie) => {\n return movie.toUpperCase().startsWith(text.toUpperCase());\n });\n return arr;\n }", "title": "" }, { "docid": "569a7e35ecfda139c81edb1cb14593c5", "score": "0.6555717", "text": "function orderAlphabetically(array) {\n let newArray = [];\n array.forEach(function(elem) {\n newArray.push(elem);\n })\n \n //sort the array alphabetically\n const sortedByAlpha = newArray.sort(function (movie1,movie2) {\n if(movie1.title < movie2.title) return -1;\n if(movie1.title > movie2.title) return 1;\n \n });\n const onlyTitles = sortedByAlpha.map(function(movie) {\n return movie.title;\n });\n \n if(sortedByAlpha.length > 20) {\n let array20 = [];\n \n for(let i = 0; i < 20; i ++) {\n array20.push(onlyTitles[i]);\n }\n return array20;\n } \n else return onlyTitles;\n \n }", "title": "" }, { "docid": "9307a83c6af6e225dadad5efc4311836", "score": "0.65338683", "text": "function movieNames(text, arrayMovie) {\r\n if (text === null) {\r\n return [];\r\n }\r\n if (text.length === 0) {\r\n return [];\r\n }\r\n const arr = arrayMovie.filter((movie) => {\r\n return movie.toUpperCase().startsWith(text.toUpperCase());\r\n });\r\n return arr;\r\n}", "title": "" }, { "docid": "fa9ad5ca6324d546001044e60052e12b", "score": "0.65271974", "text": "function getMovies(){\n let arr = [];\n for(let i = 0; i < moviesArray.length; i++){\n arr.push(moviesArray[i].title);\n }\n return arr;\n}", "title": "" }, { "docid": "104bddfbf44acc83a04d5172dda64301", "score": "0.6521449", "text": "function orderAlphabetically(arr){\n var titleArray = [];\n arr.forEach(function(movie){\n titleArray.push(movie.title);\n });\n titleArray.sort();\n if (titleArray.length >= 20)\n {\n titleArray = titleArray.slice(0,20);\n }\n return titleArray;\n}", "title": "" }, { "docid": "03c405960308559849d0ec1d7b791a99", "score": "0.650689", "text": "function orderAlphabetically(movies) {\n let sortTitle = movies.sort(function (movie1, movie2) {\n if (movie1.title < movie2.title) {\n return -1\n } else {\n return 1\n }\n })\n let myTwenty = sortTitle.map(movieTitle => movieTitle.title)\n let onlyTwenty = myTwenty.slice(0, 20);\n return onlyTwenty\n}", "title": "" }, { "docid": "b40e2403fa6fb3a0aff37223856880bc", "score": "0.64991283", "text": "function orderAlphabetically(movies){\n \n let moviesOrderAlphabetically = movies.sort ((a, b) => {\n if (a.title > b.title) return 1;\n else return -1;\n })\n moviesOrderAlphabetically.splice(20)\n \n return moviesOrderAlphabetically.map(movie => movie.title)\n\n }", "title": "" }, { "docid": "a1bd832368e00849b1b2deaa2caad67b", "score": "0.6496728", "text": "function orderAlphabetically(arrMovies) {\n let arrayTitles = [];\n for (let i = 0; i < arrMovies.length; i++) {\n arrayTitles.push(arrMovies[i].title);\n }\n arrayTitles.sort();\n return arrayTitles.slice(0, 20);\n}", "title": "" }, { "docid": "473f0e5c725ef63292828b453778d4ff", "score": "0.6483764", "text": "function orderAlphabetically(movies) {\n\tconst titleArray = []\n\tfor (const movie of movies) {\n\t\ttitleArray.push(movie.title);\n\t}\n\ttitleArray.sort()\n\treturn titleArray.slice(0,20)\n}", "title": "" }, { "docid": "210c88938b0b117c7dfab427648a1404", "score": "0.6451227", "text": "function orderAlphabetically(movieArray){\n\n let titles = movieArray.map((movie, index)=>{\n return movie.title;\n });\n\n let sorted = titles.sort();\n let finalTitlesList = sorted.slice(0, 20);\n\n return finalTitlesList;\n}", "title": "" }, { "docid": "cbc909cad75271c9f7929836286175d5", "score": "0.64326006", "text": "function orderAlphabetically(moviesArray) {\n let copyMovies = moviesArray.slice()\n let sortedTitles = copyMovies.sort(function (a, b) {\n if (a.title > b.title) {\n return 1\n } else {\n return -1\n }\n\n });\n\n let titles = sortedTitles.map(movie => {\n return movie.title\n })\n return titles.slice(0, 20)\n\n}", "title": "" }, { "docid": "a18415ae5e52a6adf6a8f9cb2d0dbae5", "score": "0.6426493", "text": "function orderAlphabetically (movies) {\n let orderedTitles = movies.map(function (movie) {\n return movie.title\n }).sort();\n\n if (orderedTitles.length > 20) {\n return orderedTitles.splice(0, 20);\n } else if (orderedTitles.length <= 20) {\n return orderedTitles;\n };\n}", "title": "" }, { "docid": "bc802d007c72b4e46b222031bb6bc110", "score": "0.6387249", "text": "function orderAlphabetically(movieArr){\n return movieArr.slice().map(movieArr => movieArr.title).sort().slice(0,20);\n}", "title": "" }, { "docid": "6fc30228844ce11ea29c5ec65db7f93e", "score": "0.63826406", "text": "function orderAlphabetically(movies) {\n let titles = movies.map(movie => movie.title);\n let titlesSorted = titles.sort();\n\n return titlesSorted.splice(0, 20);\n}", "title": "" }, { "docid": "748dcdac2892e09940120229d7537857", "score": "0.6377975", "text": "function orderAlphabetically(movies) {\n\n let clonedArray = JSON.parse(JSON.stringify(movies))\n clonedArray.sort ((movies1, movies2) => {\n\n if (movies1.title > movies2.title) {\n return 1;\n }\n else if (movies1.title < movies2.title) {\n return -1;\n }\n \n })\n \n let titleArray = clonedArray.map(movie => {\n return movie.title;\n });\n\n if (titleArray.length > 20) {\n return titleArray.slice(0, 20) ;\n } \n return titleArray;\n}", "title": "" }, { "docid": "25abb36d805cd1b3d109481a446fd672", "score": "0.63094246", "text": "function orderAlphabetically(arr){\n var movies = Object.assign([], arr)\n return movies.map(function(movie){\n return movie.title\n }).sort(function(a, b){\n return a.localeCompare(b)\n }).filter(function(movie, index){\n return index < 20;\n })\n }", "title": "" }, { "docid": "45860169f4a86c8b6cde9dfc8819c828", "score": "0.630211", "text": "function orderAlphabetically(movieArray) {\n var movieTitles=[];\n movieArray.forEach(function(movie){\n movieTitles.push(movie.title);\n });\n movieTitles.sort(function (movie1, movie2){\n if (movie1<movie2){\n return -1\n }\n else {\n return 1\n }\n \n \n \n });\n return movieTitles.slice(0,20);\n }", "title": "" }, { "docid": "39cb28bcca5d0983ddbc2459adde51da", "score": "0.6298319", "text": "function orderAlphabetically(array) {\n const movieTitles = [];\n\n array.forEach(function(movie, index) {\n if (index < 20) {\n movieTitles.push(movie.title);\n }\n });\n\n movieTitles.sort(function(a, b) {\n return a.localeCompare(b);\n });\n console.log(movieTitles);\n return movieTitles;\n}", "title": "" }, { "docid": "6fbdd7c89df4d01f52608f0dc928890d", "score": "0.6293224", "text": "function orderAlphabetically(array) {\n let titleArray = array.map(movie => {\n return movie.title\n });\n let movTitle=titleArray.sort();\n return movTitle.slice(0,20);\n}", "title": "" }, { "docid": "6f679bd50a67af081959da8d92117208", "score": "0.6269065", "text": "function orderAlphabetically(movies) {\n const arr = [...movies];\n return arr\n .map((m) => m.title)\n .sort()\n .slice(0, 20);\n}", "title": "" }, { "docid": "749e195c472d783d587b70924b46770b", "score": "0.6267793", "text": "function orderAlphabetically(movies) {\n\tlet titles = movies.map((movie) => {\n\t\treturn movie.title;\n\t});\n\ttitles.sort();\n\treturn titles.splice(0, 20);\n}", "title": "" }, { "docid": "d07ac7bfb4e36aada19dd388465e11fe", "score": "0.6258168", "text": "function orderAlphabetically(movies) {\n return movies\n .map((x) => x.title)\n .sort()\n .slice(0, 20);\n}", "title": "" }, { "docid": "924c72de3fd8e402c9696d58745bf36b", "score": "0.62562805", "text": "function listTitles(booksArray) {\n const titleArray = books.map(b => b.title)\n return titleArray;\n}", "title": "" }, { "docid": "46cc8873626d3489e358a401eba9da2c", "score": "0.62427366", "text": "function orderAlphabetically(movies) {\n\n let moviesByTitle = movies.map( (movie, i) => {\n return movie.title;\n });\n \n moviesByTitle.sort( (a,b) => {\n return a === b ? 0 : a > b ? 1 : -1;\n });\n \n return moviesByTitle.slice(0,20);\n }", "title": "" }, { "docid": "5ec52740400692546685d7c23438f189", "score": "0.62304455", "text": "function orderAlphabetically(arrMovies){\n let newArr = arrMovies.map(movie=>movie.title);\n return newArr.sort(function(a, b) {\n if(a>b){\n return 1\n } else {return -1}\n }).filter((movie, index)=> index<20)\n}", "title": "" }, { "docid": "c6cd0f55f47156fd836d6b0bce7b140f", "score": "0.62290925", "text": "function orderAlphabetically(someArr){\n const sortedByName = someArr.slice().sort((x, y)=>{\n if (x.title > y.title) return 1;\n if (x.title < y.title) return -1;\n return 0;\n \n }); const titlesOnly = sortedByName.map(movie => movie.title);\n\n return titlesOnly.slice(0, 20);\n }", "title": "" }, { "docid": "0734223109e5de874c8154e830610f4b", "score": "0.62266517", "text": "function orderAlphabetically(arr) {\n const movieTitles = arr.map(movie => movie.title).sort();\n const first20Elements = movieTitles.slice(0,20);\n return first20Elements;\n}", "title": "" }, { "docid": "35907cf849d4358fcdfef6490d808371", "score": "0.6220848", "text": "function orderAlphabetically(movies) {\n let sortedMovies = movies.slice().sort(function (a, b) {\n if (a.title > a.title) return 1;\n if (a.title < b.title) return -1;\n if (a.title == b.title) return 0;\n });\n let newArray = sortedMovies.map(function (array) {\n return array.title\n });\n return newArray.slice(0, 20);\n}", "title": "" }, { "docid": "3a09148389c2ca4b77f1d8f3b1f027c7", "score": "0.62204844", "text": "static allByTitle() {\n return movies.sort(function (a, b) {\n if (a.title < b.title) {\n return -1;\n }\n if (a.title > b.title) {\n return 1;\n }\n return 0;\n });\n }", "title": "" }, { "docid": "bc9ba1cf3a663b374434f297107483df", "score": "0.6219561", "text": "function orderAlphabetically(movies) {\n\n\tlet sortedMovies = JSON.parse(JSON.stringify(movies));\n\n\tsortedMovies.sort((a, b) =>{\n\t\treturn a.title.localeCompare(b.title);\n\t});\n\t\n\t\n\tlet twentyMovies = []\n\tsortedMovies.forEach((element, index)=>{\n\t\tif (index < 20){\n\t\t\ttwentyMovies.push(element.title);\n\t\t}\n\t});\n\treturn twentyMovies;\n}", "title": "" }, { "docid": "1ff8690c2c7db3c81847a59dfa1cd3eb", "score": "0.6216575", "text": "function orderAlphabetically(movies) {\n\n const moviesOrderByYear = [...movies].sort((a, b) => {\n\n if (a.title < b.title) {\n return -1\n }\n if (a.title > b.title) {\n return 1\n }\n return 0\n })\n\n const titleOrderMovies = moviesOrderByYear.map(elem => {\n return elem.title\n })\n\n if (titleOrderMovies.length < 20) {\n return titleOrderMovies\n } else {\n const titles20 = titleOrderMovies.slice(0, 20)\n return titles20\n }\n \n\n}", "title": "" }, { "docid": "7b4a359383ddbe4e13214f36cea97bb8", "score": "0.62050277", "text": "function removeBlankTitles(array) {\n\tvar indexOfBlank = -1;\n\tvar done = false;\n\n\twhile(!done) {\n\t\tfor(var i = 0; i < array.length; i++) {\n\t\t\tif(array[i].title === undefined || array[i].title === '') {\n\t\t\t\tindexOfBlank = i;\n\t\t\t}\n\t\t}\n\n\t\tif(indexOfBlank > -1) {\n\t\t\tarray.splice(indexOfBlank, 1);\n\t\t\tindexOfBlank = -1;\n\t\t\tdone = false;\n\t\t} else {\n\t\t\tdone = true;\n\t\t}\n\t}\n\n\treturn array;\n}", "title": "" }, { "docid": "7b4a359383ddbe4e13214f36cea97bb8", "score": "0.62050277", "text": "function removeBlankTitles(array) {\n\tvar indexOfBlank = -1;\n\tvar done = false;\n\n\twhile(!done) {\n\t\tfor(var i = 0; i < array.length; i++) {\n\t\t\tif(array[i].title === undefined || array[i].title === '') {\n\t\t\t\tindexOfBlank = i;\n\t\t\t}\n\t\t}\n\n\t\tif(indexOfBlank > -1) {\n\t\t\tarray.splice(indexOfBlank, 1);\n\t\t\tindexOfBlank = -1;\n\t\t\tdone = false;\n\t\t} else {\n\t\t\tdone = true;\n\t\t}\n\t}\n\n\treturn array;\n}", "title": "" }, { "docid": "1030c0a39384b1f96349afde9f34d555", "score": "0.62024647", "text": "function orderAlphabetically(arr) {\n const alphabet = arr.slice().sort(function(a,b){\n return a.title.localeCompare(b.title);\n });\n return alphabet.slice(0,20).map(function(movie){\n return movie.title;\n });\n}", "title": "" }, { "docid": "1464c3f7677850d82afa6b3e6285f063", "score": "0.6198269", "text": "function orderAlphabetically(movies) {\n \n const moviesCopy = [...movies]\n return moviesCopy.sort((a, b) => {\n if (a.title > b.title) {\n return 1\n } else if (a.title < b.title) {\n return -1\n } else {\n return 0\n }\n })\n .map(movie => movie.title)\n .splice(0, 20)\n }", "title": "" }, { "docid": "db45a3a917998e31af15df336b7791e8", "score": "0.61971337", "text": "function orderAlphabetically(bunchaMovies){\n let arrayToUse = [...bunchaMovies];\n arrayToUse.sort((a,b)=>{\n if(a.title < b.title){\n return -1;\n } else if (b.title < a.title){\n return 1\n }\n return 0;\n })\n let blah = arrayToUse.slice(0,20);\n let titlesOnly = blah.map((eachMovieObject)=>{\n return eachMovieObject.title;\n })\n return titlesOnly;\n}", "title": "" }, { "docid": "44f16634cc1056161d0f078034fc5910", "score": "0.6194183", "text": "function orderAlphabetically(tabMovies){\n var tabTitlesSorted=tabMovies.map(el=>el.title).sort(); \n if(tabTitlesSorted.length<=20){return tabTitlesSorted}; \n return tabTitlesSorted.slice(0,20);\n}", "title": "" }, { "docid": "f6a8c10a6ba5e5625ca164075e899286", "score": "0.61755455", "text": "function orderAlphabetically(array) {\n let titlesArray = array.map((movie, index) => {\n return movie.title;\n });\n let sortedArray = titlesArray.sort((prev, next) => {\n return prev.toLowerCase().localeCompare(next.toLowerCase());\n });\n return sortedArray.filter((movie, index) => {\n if (index <= 19) return movie;\n });\n}", "title": "" }, { "docid": "53981467c019869303e7370f3d98f384", "score": "0.6165528", "text": "function orderAlphabetically(arr) {\n\n let moviesCopy = [...arr];\n\n\n // console.log(alphabetical);\n const alphabetical = moviesCopy.sort(function (a, b) {\n if (a.title > b.title) {\n return 1;\n }\n if (a.title < b.title) {\n return -1;\n }\n })\n\n const order = alphabetical.map(elm => elm.title);\n // console.log(order);\n const extract = order.slice(0, 20);\n // console.log(extract);\n return extract;\n\n}", "title": "" }, { "docid": "cf47584d192a36f9d5638ed18813694b", "score": "0.6160144", "text": "function orderAlphabetically(arr){\n let newArr=[...arr]\n return newArr = arr.map(function(movie){\n title = movie.title;\n return title\n }).sort().slice(0,20)\n}", "title": "" }, { "docid": "ad87189368d99b68f715ecad294693e0", "score": "0.61575514", "text": "function orderAlphabetically(movies) {\n let sortedMoviesByAlpha = movies.sort(function(a, b) {\n if (a.title < b.title) {\n return -1;\n } else if (a.title > b.title) {\n return 1;\n } else {\n return 0;\n }\n });\n\n return sortedMoviesByAlpha\n .map(movie => {\n return movie.title;\n })\n .slice(0, 20);\n}", "title": "" }, { "docid": "cb4437d21ebad5967b1fe4865456e356", "score": "0.61285", "text": "function orderAlphabetically(movies){\n var titles=movies.map(function(movie){\n return movie.title;\n }).sort();\n while (titles.length>20) titles.pop();\n return titles;\n}", "title": "" }, { "docid": "0ff9a90337e4ff91c261f1cc988761b0", "score": "0.61272556", "text": "function orderAlphabetically(array) {\n let sorted = array.sort((a,b) => {\n if (a.title < b.title) return -1\n if (a.title > b.title) return 1\n })\n \n let twenty = []\n\n sorted.forEach(movie => {\n if (twenty.length < 20) {\n twenty.push(movie.title)\n }\n })\n return twenty\n}", "title": "" }, { "docid": "b176dd16a342bd6f4f5cc0f9b8186c14", "score": "0.6119083", "text": "function orderAlphabetically(movies) {\nlet movieOrder = [];\nmovies.map(function(movie){\n movieOrder.push(movie.title)\n}) \n\nif (movieOrder.length> 20) {\nmovieOrder = movieOrder.sort().slice(0,20);\nreturn movieOrder\n\n} \nreturn movieOrder.sort() }", "title": "" }, { "docid": "14bf333054c5e97bfef25669d245ec52", "score": "0.61000514", "text": "function createArrayOfChartTitles() {\n\t\t\t// Build the titles array\n\t\t\tvar titlesArray = [\n\t\t\t\t{\n\t\t\t\t\t\"text\": \"Histogram of \" + totalNumberOfEvents + \" data events\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"text\": \"for data item '\" + scope.config.Label + \"'\",\n\t\t\t\t\t\"bold\": false\n\t\t\t\t}\n\t\t\t];\n\t\t\treturn titlesArray;\n\t\t}", "title": "" }, { "docid": "fd1934b53f414b52a856b87a7abb7cbb", "score": "0.60995436", "text": "function orderAlphabetically (array){\n var sortedFilms = array.sort(function(a , b){\n if (a.title > b.title){\n return 1;\n }\n if (a.title < b.title){\n return -1;\n }\n });\n return sortedFilms.filter(function(movie, index){\n return index < 20;\n });\n}", "title": "" }, { "docid": "38581dc8feb422b3354add89a5bca88f", "score": "0.60848224", "text": "function orderAlphabetically(movies) {\n var sorted = movies.sort(function (a, b) {\n if (a.title < b.title) { return -1; }\n if (a.title > b.title) { return 1; }\n return 0;\n });\n\n return sorted.splice(0, 20).map(function(movie) { return movie.title; });\n}", "title": "" }, { "docid": "2786a5c9eeff1a78bcecbf5c5ec1556e", "score": "0.60771036", "text": "function orderAlphabetically(movieArr) {\n const movies = movieArr.slice(0);\n const order = movies.sort((a,b) => {\n const titleA = a.title.toUpperCase();\n const titleB = b.title.toUpperCase();\n if(titleA < titleB) {\n return -1;\n } else if(titleA < titleB) {\n return 1;\n } else { return 0; }\n });\n const sliced = order.slice(0, 20); \n const first20Movies = sliced.map(m => m.title); \n return first20Movies;\n}", "title": "" }, { "docid": "4405678a879c2d5dd35caa3c5ec14900", "score": "0.6064109", "text": "function orderAlphabetically(movies){\n\n let moviesByAlpha = movies.sort(function(a, b){\n \n if(a.title > b.title){\n return 1\n }\n if(a.title < b.title){\n return -1\n }\n return 0\n });\n\n return moviesByAlpha.slice(0,20).map(listOfMovies => listOfMovies.title);\n }", "title": "" }, { "docid": "83b795c624131135937a68ad8b957ae4", "score": "0.60556644", "text": "function orderAlphabetically(movies){\n\n \n const orderAp = movies.map(theMovies => theMovies.title)\n\n const filmSort = orderAp.sort()\n \n if(filmSort.length > 20)filmSort.splice(20,filmSort.length - 20)\n\n return filmSort\n\n \n console.log(filmSort)\n \n \n \n}", "title": "" }, { "docid": "dbc3ed01fcf30ce6623068e7d7a15286", "score": "0.60401905", "text": "function orderAlphabetically(movieArr) {\n return movieArr.slice().sort(function (a, b) {\n return a.title.localeCompare(b.title);\n }).slice(0,20).reduce(function(acc, val, index, arr) {\n if (index < arr.length-1) {\n return acc += val.title + \"|\";\n }\n else {\n return acc += val.title;\n }\n },\"\").split(\"|\");\n }", "title": "" }, { "docid": "1237ce6839bd8251b3106b4228d982db", "score": "0.6039133", "text": "function orderAlphabetically(arr){\n const titles = arr.map(elem => elem['title'])\n titles.sort()\n let result = []\n if (titles.length > 19){\n for (let i = 0; i < 20; i++ ){\n result.push(titles[i])\n } \n \n }else {\n result =[...titles]\n }\n return result\n }", "title": "" }, { "docid": "f57da182a34e7587869a6c1b80da8e47", "score": "0.6033005", "text": "function getMovies(actorID, cb) {\n var moviesArr = [];\n MovieDB.discoverMovie({ with_cast: actorID }, function(err, res) {\n if (err) {\n console.log('I apologize, but we are having some type of problem at this time!');\n return;\n }\n var results = res.results;\n for (var i = 0; i < results.length; i++) {\n var title = results[i].title;\n //THIS RULE HERE WILL EXCLUDE ANY TITLE WITH THESE TYPES OF CHARACTERS.\n if (/^[a-zA-Z ]*$/g.test(title)) {\n moviesArr.push(title);\n }\n }\n var randomNumber = Math.floor(Math.random() * moviesArr.length);\n randomNumber -= 1;\n var chosenWord = moviesArr[randomNumber];\n module.exports.chosenWord = chosenWord;\n cb();\n });\n}", "title": "" }, { "docid": "618becdd179033911b187efae5dbb18e", "score": "0.6027188", "text": "function orderAlphabetically(array){\n var titleArray = [];\n array.forEach(function(elem){\n titleArray.push(elem.title);\n });\n titleArray.sort();\n if (titleArray.length >= 20){\n titleArray = titleArray.slice(0,20);\n }\n return titleArray;\n }", "title": "" }, { "docid": "5877233c8b747dc1299a50a517deea82", "score": "0.6024319", "text": "function orderAlphabetically(movies) {\n let moviesCopy = [...movies]\n // Ordenamos las peliculas en orden ascendente\n let orderedArr = moviesCopy.sort((a, b) => {\n if (a.title > b.titlle) {\n return 1\n } else if (a.title < b.title) {\n return -1\n }\n })\n // Del array ordenado solo cogemos los titulos\n let result = orderedArr.map(movie => movie.title)\n // Del array resultante solo retornamos los 20 primeros\n return result.splice(0, 20)\n}", "title": "" }, { "docid": "2eae149ba2085189d07e5e2d5a94182c", "score": "0.6003687", "text": "function onlyNames(array) {\n\n}", "title": "" }, { "docid": "49a62dc3caf91fbc7f10c4fa52b628ea", "score": "0.59983087", "text": "function orderAlphabetically(movies) {\n return movies.map(function (movie) {\n return movie.title\n }).sort(function (a, b) {\n return a.localeCompare(b)\n }).slice(0, 20)\n}", "title": "" }, { "docid": "f5f34c914106832b31916500f5108379", "score": "0.59875065", "text": "function orderAlphabetically(movies) {\n \n const Alphabetic = [...movies].sort((a, b) => a.title.localeCompare(b.title))\n \n const titleOrder = Alphabetic.slice(0, 20).map(movies => movies.title)\n return titleOrder\n }", "title": "" }, { "docid": "7cb251d3a126db99a0a861bd30c1c8ca", "score": "0.5987415", "text": "function orderAlphabetically(arr) {\n const sorted = arr.map(function (movie) {\n return movie.title;\n }).sort(function (a, b) {\n return a.localeCompare(b);\n }).slice(0, 20);\n return sorted;\n}", "title": "" }, { "docid": "09d17a17b59d53c4056483e7186ae7dc", "score": "0.5969371", "text": "function orderAlphabetically(arr) {\n const newArray = [...arr];\n const moviesTitle = newArray.map(function(movie,index,originalArray){\n return movie.title;\n });\n\n \n const orderAlphabetically = moviesTitle.sort(function(movie1, movie2) {\n if (movie1 > movie2) {\n return 1;\n } else if (movie1 < movie2) {\n return -1;\n } else {\n return 0;\n }\n });\n\n \n\n const first20 = orderAlphabetically.splice(20,orderAlphabetically.length-19);\n\n return moviesTitle;\n \n}", "title": "" }, { "docid": "78ab5dc87ef6757e06b8b582884c83a7", "score": "0.59675336", "text": "function orderAlphabetically(movies) {\n let allTitles = movies.map(function (elm) {\n return elm.title;\n });\n let top20 = allTitles.sort(function (a, b) {\n return a.localeCompare(b);\n });\n return top20.slice(0, 20);\n}", "title": "" }, { "docid": "913f097b5307dc6760c3bc80388b4f67", "score": "0.59624755", "text": "function orderAlphabetically(movies) {\n const sortedMovies = [...movies];\n sortedMovies.sort((movieA, movieB) => {\n // if they have the same year, then sort by title\n if (movieA.title < movieB.title) {\n return -1;\n }\n if (movieA.title > movieB.title) {\n return 1;\n }\n\n // same year and same title\n return 0;\n });\n /*\n return movies.map((m) => {\n return m.title;\n });\n */\n\n let mappedMovies = sortedMovies.map((m) => m.title);\n\n return mappedMovies.slice(0, 20);\n\n}", "title": "" }, { "docid": "965d3f297e5290d2b8decf19906acb8a", "score": "0.5959569", "text": "function orderAlphabetically(movies = []) {\n //Ordena los elementos\n movies.sort((movie1, movie2) => {\n if (movie1.title < movie2.title) {\n return -1;\n }\n\n if (movie1.title > movie2.title) {\n return 1;\n }\n return 0;\n });\n\n //Extrae solo los titulos\n let titles = movies.map((movie)=>{\n let title = '';\n title = movie.title;\n return title;\n });\n\n //Si es menor a 20 envia el arreglo tal cual\n if (titles.length < 20) {\n return titles;\n }\n\n //Corta el arreglo a los primeros 20 elementos\n titles.splice(20, titles.length - 20);\n return titles;\n}", "title": "" }, { "docid": "2386cc0012f42d3c28612193b47dc840", "score": "0.59521294", "text": "function orderAlphabetically(movies) {\n const moviesSorted = movies.sort((a, b) => {\n if (a.title < b.title)\n return -1\n if (a.title > b.title)\n return 1\n return 0\n })\n while (moviesSorted.length > 20) { moviesSorted.pop() }\n return moviesSorted.map(elements => elements.title.toString());\n}", "title": "" }, { "docid": "7920eafcdc781d4a052ec0c6d4c42439", "score": "0.59470844", "text": "function orderAlphabetically(moviesArr){\n let newArr=moviesArr.slice()\n let order=newArr.sort((a,b)=>{\n if(a.title >b.title){\n return 1\n }else{\n return -1\n }\n })\n //console.log(\"order\",order)\n let titels=order.map(i=>{\n return i.title\n })\n //console.log(titels)\n let first20=titels.slice(0,20)\n return first20\n}", "title": "" }, { "docid": "cdd3f03caae14b74f5eea39eaa9f2c88", "score": "0.59346783", "text": "function orderAlphabetically(movies) {\n let allMovies = [...movies]\n return allMovies.sort(function(movie1, movie2) {\n if(movie1.title < movie2.title) return -1;\n if(movie1.title > movie2.title) return 1;\n return 0;\n }).map(function(movie) {\n return movie.title;\n }).splice(0,20);\n }", "title": "" }, { "docid": "20b9e923e8d3b6604f7e95126f95d549", "score": "0.5929866", "text": "function orderAlphabetically(array){\n let newArray = array.map(movie => movie.title);\n newArray.sort((a, b) => a.localeCompare(b));\n newArray.splice(20);\n console.log(newArray);\n return newArray;\n}", "title": "" }, { "docid": "83df96dd6f38be456209d68f4eaf05b7", "score": "0.5927147", "text": "static getTitles(...books) {\n return books.map((book) => book.title);\n }", "title": "" }, { "docid": "63e54282ebaae78c36fb4271ad0f72db", "score": "0.5922964", "text": "function orderAlphabetically(movieArray) {\n let alphaOrder = movieArray;\n let alphaList = alphaOrder.map((eachMovie)=>{\n return eachMovie.title;\n });\n alphaList.sort((a,b)=>{\n if(a < b) {\n return -1;\n }\n if(a > b) {\n return 1;\n }\n return 0;\n });\n return alphaList.slice(0,20);\n}", "title": "" }, { "docid": "c7b8fa8b4b0e03125ec63a40475887ae", "score": "0.591411", "text": "function orderAlphabetically(arr){\n let newArr = arr.slice(0);\n let sorted = newArr.sort(function(a, b){\n if (a.title > b.title){\n return 1;\n }else{\n return -1;\n }\n })\n return sorted.map(function (films){\n return films.title}).slice(0, 20);\n }", "title": "" }, { "docid": "80c8722462c79266911e1042628d4584", "score": "0.59128803", "text": "function orderAlphabetically(arr) {\n let resultMovies = [];\n let newMovies = arr.map(function(movie) {\n return movie;\n })\n \n newMovies.sort(function(a,b) {\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n }\n return 0; \n })\n newMovies = newMovies.map(function(movie) {\n return movie.title;\n })\n\n if (newMovies.length <= 20) {\n newMovies.forEach(function(movie) {\n resultMovies.push(movie);\n });\n } else {\n for (let i = 0; i < 20; i++) {\n resultMovies.push(newMovies[i]);\n }\n }\n \n return resultMovies;\n}", "title": "" }, { "docid": "4aadbe5ea4dfce632efc221878af3170", "score": "0.5901987", "text": "function orderAlphabetically(moviesList) {\n let moviesTitles = moviesList.map(movie => movie.title);\n moviesTitles.sort();\n if (moviesTitles.length > 20) {\n moviesTitles.splice(20, moviesList.length - 20);\n }\n return moviesTitles;\n}", "title": "" }, { "docid": "3339e89653e855b7e730829bf420a752", "score": "0.5889118", "text": "function orderAlphabetically(movies) {\n //Create new array with .map() ordered by title with a .sort(), \n //.sort() compares 2 elements (\"a\", \"b\") with a ternary: if(\"?\") condition \"a\" > \"b\" is true = returns 1 (puts \"b\" element before \"a\" element)\n //else (\":\") returns 1 (puts \"a\" before \"b\"), we return only the first 20 results with .slice() (\".slice(0, 20)\")\n //The result is assigned to \"result\"\n let result = movies.map( obj => {return obj[\"title\"]}).sort((a, b) => (a > b) ? 1 : -1).slice(0, 20);\n console.log(\"EXERCICE 4 ->\", result);\n return result;\n}", "title": "" }, { "docid": "85e31758564c9b4cb7a1f97e1778c225", "score": "0.5863195", "text": "function orderAlphabetically(movies) {\n\n let onlyString = movies.map(movie => movie.title).sort((a, b) =>\n a.localeCompare(b, \"es\", {\n sensitivity: \"base\"\n })\n )\n\n return onlyString.splice(0, 20);\n}", "title": "" }, { "docid": "f36654f92808322a0031242cca39bd3f", "score": "0.58604", "text": "function orderAlphabetically(givenArray) {\n \n let newMappedArray = givenArray.map(movie => movie.title);\n\n let newArray = newMappedArray.sort((a, b) => {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n return 0;\n });\n\n let newArray20 = newArray.slice(0, 20)\n\n return newArray20\n}", "title": "" }, { "docid": "1d50c476bb849536c1974ff031803869", "score": "0.58530617", "text": "function onlyThisMillennium() {\r\n // loop through the objects in the array\r\n // check if the Year propriety is >= 2000\r\n let millennium = [];\r\n for (let movie of movies) {\r\n if (parseInt(movie.Year) >= 2000) {\r\n // millennium.push(movie.Title + ': ' + movie.Year)\r\n millennium.push(`${movie.Title}: ${movie.Year}`)\r\n };\r\n };\r\n return millennium\r\n}", "title": "" }, { "docid": "a0acfe0cefafb1f3ae8c8c36d8ce44d7", "score": "0.58470434", "text": "function orderAlphabetically() {\n const cloneMovies2 = [... movies ];\n const moviestitle = cloneMovies2.map(eachDtitle => eachDtitle.title);\n //console.log(moviestitle)\n const alphaMovies = moviestitle.sort((movie_a, movie_b) => {\n //Utilizamos las propiedades ordenamiento -1,0,1\n if (movie_a == movie_b) { return 0; }\n if (movie_a < movie_b) { return -1; }\n if (movie_a > movie_b) { return -1; } \n });\n \n console.log(alphaMovies)\n return alphaMovies.slice(0,20) \n}", "title": "" }, { "docid": "55fa36ce79f9ba64a85f3b463aa19d54", "score": "0.5814617", "text": "function orderAlphabetically(movies) {\n var titles = movies.map(movie => {\n return movie.title;\n })\n\n var orderedList = []\n if (movies.length < 20) {\n for (i = 0; i < movies.length; i++) {\n orderedList.push(titles[i])\n }\n }\n else {\n for (i = 0; i < 20; i++) {\n orderedList.push(titles[i])\n }\n }\n return orderedList.sort()\n\n}", "title": "" }, { "docid": "6d603f6fd379349bf20120859c462692", "score": "0.5801178", "text": "function transformTitles(titles) {\n let words = \"\";\n for (title of titles) {\n words += title.innerText + \" \";\n }\n result = words.split(\" \");\n return result;\n}", "title": "" }, { "docid": "bb044b77b54749de84b32fb095c3578b", "score": "0.57868916", "text": "function orderAlphabetically(movies) {\n movies.sort((a, b) => {\n return a.title - b.title;\n });\n var top20 = [];\n var limit = 20;\n if (movies.length < 20) {\n limit = movies.length;\n }\n for (let i = 0; i < limit; i++) {\n top20.push(movies[i].title);\n }\n return top20;\n}", "title": "" }, { "docid": "68e6e1dd74afc113e46d92444506bb54", "score": "0.57851434", "text": "function orderAlphabetically(array){\n\n let firstArray = array.sort((a,b)=>{\n\n if(a.title < b.title){\n return -1;\n }else if(b.title < a.title){\n return 1;\n }else{\n return 0;\n }\n });\n\n let titlesArray = firstArray.map((each)=>{\n return each.title;\n })\n\n titlesArray.splice(20);\n return titlesArray;\n\n}", "title": "" }, { "docid": "f198eccaf64ab266f9801ff85f81624f", "score": "0.5737", "text": "function orderAlphabetically(array) {\n var orderedByTitle = [];\n\n orderedByTitle = array.map(function (elem, i) {\n var element = Object.assign({}, el);\n if (i === 20){ break; }\n element = element.title.toLowerCase();\n \n });\n \n orderedByTitle.sort();\n \n\n return orderedByTitle;\n\n}", "title": "" }, { "docid": "f1c6b1e826a35f1967673e13b1becdd7", "score": "0.5699567", "text": "function orderAlphabetically(movies) {\n const array = [...movies].map(function (movie) {\n return movie.title;\n })\n var arraySortedOut = array.sort();\n var topTwenty = arraySortedOut.slice(0, 20);\n\n return topTwenty;\n}", "title": "" }, { "docid": "009db2ae461c9f963d8e0528b1982a18", "score": "0.56755173", "text": "function orderAlphabetically(movies) {\r\n return movies.map(movie => movie.title).sort((a, b) => {\r\n const firstMovie = a.toLowerCase();\r\n const secondMovie = b.toLowerCase();\r\n if (firstMovie > secondMovie) {\r\n return 1;\r\n } else if (firstMovie < secondMovie) {\r\n return -1;\r\n } else {\r\n return 0;\r\n }\r\n }).slice(0, 20);\r\n }", "title": "" }, { "docid": "4fdac95887292cf9ffc1bafb4f2fc7a3", "score": "0.56740546", "text": "function orderAlphabetically(arr) {\n\n let titlesArr = [];\n arr.forEach(element => {\n titlesArr.push(element.title);\n });\n\n let sortedArr = titlesArr.sort(function(a, b){\n if (a > b) {\n return 1;\n }\n if (b > a) {\n return -1;\n }\n return 0;\n });\n\n let arrLength = sortedArr.length;\n if (arrLength == 0) {\n return sortedArr;\n } else if (sortedArr.length < 20){\n return sortedArr;\n } else {\n return sortedArr.splice(0, 20);\n }\n }", "title": "" }, { "docid": "b1c1199aab36c0c11cd3ff41b6e20841", "score": "0.56520283", "text": "function getTitle(title, style, width) {\n var titleCollection = [];\n\n switch (style.textOverflow) {\n case 'Wrap':\n titleCollection = textWrap(title, width, style);\n break;\n\n case 'Trim':\n titleCollection.push(textTrim(width, title, style));\n break;\n\n default:\n titleCollection.push(title);\n break;\n }\n\n return titleCollection;\n }", "title": "" }, { "docid": "56a958c828e862836b42474303ee89a2", "score": "0.5631949", "text": "function orderAlphabetically(array) {\n var result = array.map(function (element) {\n return element.title;\n }).sort().filter(function (value, index) {\n return index < 20;\n })\n return result;\n}", "title": "" }, { "docid": "ebe0f484d3801965525b8eea97f5b34c", "score": "0.56187284", "text": "function OnlyThisMillennium() {\n let output = [];\n for (i = 0; i < movies.length; i++) {\n if (1999 < movies[i].Year) {\n output.push(movies[i]);\n }\n }\n return output;\n }", "title": "" }, { "docid": "835ce09f7f1e639cf42a07b8b3f1caaf", "score": "0.56142336", "text": "get titles() {\n }", "title": "" }, { "docid": "8c3fc1e307cf757aa749e0a923972380", "score": "0.5614064", "text": "function namesOnly(arr){\r\n const result = arr.map(function(namesOnly){\r\n return namesOnly.name\r\n });\r\n return result;\r\n }", "title": "" }, { "docid": "f1d819401eaa115d02192d78c38c7786", "score": "0.56060666", "text": "function orderAlphabetically (array){\n let newArray = array.map ((e) => e.title).sort((a, b) =>{\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n return 0;});\n if (array.length >= 20){\n return newArray.slice(0,20)\n }\n return newArray\n\n\n \n}", "title": "" }, { "docid": "2189b31b32c7fa2a93a7de82c6166c7c", "score": "0.5604302", "text": "function searchMovie(arr, str) {\n let moviesWithString = [];\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].Title.toUpperCase().includes(str.toUpperCase())) {\n moviesWithString.push(arr[i]);\n }\n }\n return moviesWithString;\n}", "title": "" }, { "docid": "1f96e3ac9a02a2bf7d0d91d884fcbfc1", "score": "0.55870783", "text": "function removeTitle(message, title, arr) {\n if(arr.indexOf(title.trim()) != -1) {\n arr.splice(arr.indexOf(title),1);\n }\n}", "title": "" } ]
0e07834032c72730e89f69623bd2095d
(For IE <=9) Removes the event listeners from the currentlytracked element, if any exists.
[ { "docid": "e2bd6116720392eafef519b7d4575185", "score": "0.0", "text": "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n activeElement = null;\n activeElementInst = null;\n}", "title": "" } ]
[ { "docid": "cfb62b788da4d5b58614062dbfab14c0", "score": "0.74633074", "text": "removeAllEventListeners() {\n\t\tObject.keys(this.evtCallbacks).forEach((evtName) => {\n\t\t\tconst events = this.evtCallbacks[evtName];\n\t\t\tevents.forEach(({ element, callback }) => {\n\t\t\t\telement.removeEventListener(evtName, callback);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "12136df9260cf297fa573474ac15c380", "score": "0.73938596", "text": "function removeEventListeners() {\n if (eventsAttached) {\n var i = eventListeners.length,\n listener;\n\n while( i-- ) {\n listener = eventListeners[ i ];\n listener[ 0 ].detachEvent( listener[ 1 ], listener[ 2 ] );\n }\n\n PIE.OnUnload.unobserve( removeEventListeners );\n eventsAttached = 0;\n eventListeners = [];\n }\n }", "title": "" }, { "docid": "533027965f0b6e12dc26815c84c6159c", "score": "0.7218015", "text": "function removeListeners() {\n element.removeEventListener('click', doit);\n element.removeEventListener('keydown', f);\n }", "title": "" }, { "docid": "f101db911853b8f0e60a0803e8cc618e", "score": "0.7193318", "text": "removeAllEventListener() {\n\t\tdelete this.__listeners;\n\t\tthis.__listeners = {};\n\t}", "title": "" }, { "docid": "575119b79b17f66c3c4259c55e33b37d", "score": "0.7102085", "text": "detach() {\n /* Disengage all the mouse events from each corresponding handler. */\n this._removeListeners();\n\n /* Remove the reference of the DOM element. */\n this.listenElement = null;\n }", "title": "" }, { "docid": "3f0891cbd4c7083609def3719a29887f", "score": "0.70857745", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "39aa04a71facc7ebdbae4582c0fce142", "score": "0.70622927", "text": "function removeListeners() {\r\n\t\t\t$element.unbind(START_EV, touchStart);\r\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\r\n\t\t\t$element.unbind(MOVE_EV, touchMove);\r\n\t\t\t$element.unbind(END_EV, touchEnd);\r\n\r\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\r\n\t\t\tif(LEAVE_EV) {\r\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\r\n\t\t\t}\r\n\r\n\t\t\tsetTouchInProgress(false);\r\n\t\t}", "title": "" }, { "docid": "7091154b669346d8c11a913b718ec0d2", "score": "0.70398426", "text": "function removeListeners() {\r\n $element.unbind(START_EV, touchStart);\r\n $element.unbind(CANCEL_EV, touchCancel);\r\n $element.unbind(MOVE_EV, touchMove);\r\n $element.unbind(END_EV, touchEnd);\r\n\r\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\r\n if (LEAVE_EV) {\r\n $element.unbind(LEAVE_EV, touchLeave);\r\n }\r\n\r\n setTouchInProgress(false);\r\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.70140564", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.70140564", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.70140564", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "97e7bfceff0a25b3824471a354d42119", "score": "0.70138466", "text": "clearEventListeners() {\n\t\tfor ( let args; args = this.eventListeners.pop(); ) {\n\t\t\tthis.host.removeEventListener( ...args );\n\t\t}\n\t}", "title": "" }, { "docid": "18572e5fd8d991fe9014215601afdc48", "score": "0.6975798", "text": "function removeAddedEvents() {\n // remove added native events\n nativeEvents.forEach(function (_ref) {\n var key = _ref.key,\n listener = _ref.listener;\n element.removeEventListener(key, listener);\n });\n nativeEvents = [];\n }", "title": "" }, { "docid": "8628fb86e6af78a9876fa5ed54c00777", "score": "0.6974614", "text": "function removeListeners() {\n$element.unbind(START_EV, touchStart);\n$element.unbind(CANCEL_EV, touchCancel);\n$element.unbind(MOVE_EV, touchMove);\n$element.unbind(END_EV, touchEnd);\n\n//we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit\nif(LEAVE_EV) {\n$element.unbind(LEAVE_EV, touchLeave);\n}\n\nsetTouchInProgress(false);\n}", "title": "" }, { "docid": "61be82743550c7a1eae6d6c7d438bf93", "score": "0.6969133", "text": "detachEventListeners() {\n\t\tthis.listeners.forEach(function (listenerArr) {\n\t\t\tif ('un' in listenerArr[0])\n\t\t\t\tlistenerArr[0].un(listenerArr[1]);\n\t\t\telse if ('off' in listenerArr[0])\n\t\t\t\tlistenerArr[0].off(listenerArr[1]);\n\t\t});\n\t\tthis.listeners = [];\n\t}", "title": "" }, { "docid": "84f5fd104421ff4fb60438147ffd4ab5", "score": "0.69672364", "text": "_removeListeners() {\n const { listenElement, eventMap } = this;\n\n Object.keys(eventMap).forEach(eventName => {\n const { listeners, added } = eventMap[eventName];\n\n if (added === true) {\n listeners.forEach(({ name, method }) =>\n listenElement.removeEventListener(name, method)\n );\n\n eventMap[eventName].added = false;\n }\n });\n }", "title": "" }, { "docid": "1a68ad85b42651f183a456aeae991413", "score": "0.69445616", "text": "_removeEventListeners() {\n this.el.removeEventListener('click', this._onClickBound);\n this.el.removeEventListener('focus', this._onFocusBound);\n this.el.removeEventListener('blur', this._onBlurBound);\n this.el.removeEventListener('keydown', this._onKeydownBound);\n }", "title": "" }, { "docid": "68362a354433d993129a76f3918ea718", "score": "0.69351935", "text": "function detachEvents() {\n if (browser.addEventListener) {\n // remove current event listeners\n element.removeEventListener('touchstart', events, false);\n element.removeEventListener('mousedown', events, false);\n element.removeEventListener('webkitTransitionEnd', events, false);\n element.removeEventListener('msTransitionEnd', events, false);\n element.removeEventListener('oTransitionEnd', events, false);\n element.removeEventListener('otransitionend', events, false);\n element.removeEventListener('transitionend', events, false);\n root.removeEventListener('resize', events, false);\n } else {\n root.onresize = null;\n }\n }", "title": "" }, { "docid": "5e0f55cac10d270e54ed57f3e393d60d", "score": "0.6892543", "text": "function removeListeners() {\n console.log(\"Remove listeners\");\n document.removeEventListener('click', clickListener, true)\n document.removeEventListener('change', changeListener, false)\n //document.removeEventListener('mouseover', hoverListener, false)\n //removeRecorderPanel();\n}", "title": "" }, { "docid": "6dc67befd9f71263c3301f11aab4486c", "score": "0.6885495", "text": "function removeListeners() {\n $element.off(START_EV, touchStart);\n $element.off(CANCEL_EV, touchCancel);\n $element.off(MOVE_EV, touchMove);\n $element.off(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.off(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "0c28a6e90d426fa5e7081d3f3d95c604", "score": "0.6865329", "text": "removeEventListeners() {\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\n\n if (this.gyroscope) {\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\n }\n\n if (this.glare || this.fullPageListening) {\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\n }\n }", "title": "" }, { "docid": "92002b1a80f61dfefe9f20687baee160", "score": "0.68497944", "text": "clearEvents() {\n if (!this.context) {\n return;\n }\n let len = this.context.eventListeners.length;\n\n while (len--) {\n let event = this.context.eventListeners[len];\n\n if (event) {\n this.removeEventListener(event.element, event.event, event.callback);\n }\n }\n }", "title": "" }, { "docid": "a3f7dc8b7607ecf63e079b434d1efc81", "score": "0.6848588", "text": "clearEvents(){\n for(let event of this._events){\n this.htmlObj.removeEventListener(event[0], event[1]);\n }\n }", "title": "" }, { "docid": "d2671b4379d4d4b182dd8ba8706bd9ce", "score": "0.68478864", "text": "removeEventListeners() {\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\n \n if (this.gyroscope) {\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\n }\n \n if (this.glare || this.fullPageListening) {\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\n }\n }", "title": "" }, { "docid": "b7779728be8c46938e5f48df585becd4", "score": "0.68027586", "text": "_removeListeners() {\n // Do nothing if listeners were already removed.\n if (!this._isListening) {\n return;\n }\n\n window.removeEventListener('resize', this.startUpdateCycle, true);\n window.removeEventListener('scroll', this.scheduleUpdate, true);\n\n this._removeHoverListener();\n\n if (!mutationsSupported) {\n this._repeatCycle = false;\n\n window.removeEventListener('click', this.startUpdateCycle, true);\n } else if (this._mutationsObserver) {\n this._mutationsObserver.disconnect();\n this._mutationsObserver = null;\n }\n\n this._isListening = false;\n }", "title": "" }, { "docid": "656cff94f4e659df50feab546a195d9a", "score": "0.68011504", "text": "function removeEventListeners() {\n\n\t\teventsAreBound = false;\n\n\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\tif( window.navigator.msPointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t}\n\n\t\tif ( config.progress && dom.progress ) {\n\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "656cff94f4e659df50feab546a195d9a", "score": "0.68011504", "text": "function removeEventListeners() {\n\n\t\teventsAreBound = false;\n\n\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\tif( window.navigator.msPointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t}\n\n\t\tif ( config.progress && dom.progress ) {\n\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "0d1c155eaa5094eefc437316c7c0478e", "score": "0.6798228", "text": "_removeTriggerEvents() {\n if (this._triggerElement) {\n pointerDownEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n }\n }\n }", "title": "" }, { "docid": "0d1c155eaa5094eefc437316c7c0478e", "score": "0.6798228", "text": "_removeTriggerEvents() {\n if (this._triggerElement) {\n pointerDownEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n }\n }\n }", "title": "" }, { "docid": "0d1c155eaa5094eefc437316c7c0478e", "score": "0.6798228", "text": "_removeTriggerEvents() {\n if (this._triggerElement) {\n pointerDownEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n }\n }\n }", "title": "" }, { "docid": "0d1c155eaa5094eefc437316c7c0478e", "score": "0.6798228", "text": "_removeTriggerEvents() {\n if (this._triggerElement) {\n pointerDownEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n }\n }\n }", "title": "" }, { "docid": "5328a7b221ac65902d13c195671e2ca8", "score": "0.678686", "text": "_removeRootElementListeners(element) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }", "title": "" }, { "docid": "5328a7b221ac65902d13c195671e2ca8", "score": "0.678686", "text": "_removeRootElementListeners(element) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }", "title": "" }, { "docid": "5328a7b221ac65902d13c195671e2ca8", "score": "0.678686", "text": "_removeRootElementListeners(element) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }", "title": "" }, { "docid": "964bed7d28dcf81c9c733f2a0b252ba5", "score": "0.6687728", "text": "removeEventListeners() {\n for (let i = 0; i < this.eventListeners.length; i++) {\n const eventListener = this.eventListeners[i];\n eventListener.target.removeEventListener(\n eventListener.type,\n eventListener.listener\n );\n }\n }", "title": "" }, { "docid": "8b33280c73ab503dba95f00ec44855a6", "score": "0.6656353", "text": "_removeEventListeners() {\n\n this.controlsEl.removeEventListener('touchstart', this._onTouchStartBound);\n this.controlsEl.removeEventListener('mousedown', this._onMouseDownBound);\n\n document.removeEventListener('spark.visible-children', this._onVisibleChildrenBound);\n\n for (var i = 0, len = this.inputEls.length; i < len; i++) {\n this.inputEls[i].removeEventListener('change', this._onChangeBound);\n }\n\n for (var j = 0, len2 = this.handleEls.length; i < len2; i++) {\n this.handleEls[j].removeEventListener('focus', this._onFocusBound);\n this.handleEls[j].removeEventListener('click', this._onClickBound);\n }\n\n window.removeEventListener('resize', this._onResizeBound);\n window.removeEventListener('orientationchange', this._onResizeBound);\n }", "title": "" }, { "docid": "4ee5ed0d5db39d530cf4ea4f3bdefb11", "score": "0.6652014", "text": "function detatchElementEvents() {\n const element = this.element;\n\n if (element.nodeName === 'FORM') {\n element.removeEventListener('submit', this.submitAjaxHandler);\n }\n\n switch (element.getAttribute('data-ajaxable-trigger-type')) {\n case 'timeout':\n clearTimeout(this.requestTimerId);\n break;\n case 'interval':\n clearTimeout(this.requestIntervalId);\n break;\n case 'click':\n element.removeEventListener('click', this.clickAjaxHandler);\n break;\n case 'hover':\n element.removeEventListener('click', this.hoverAjaxHandler);\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "5e07a07bfdf7db783805386de37c222e", "score": "0.6628159", "text": "function killListeners(){\n leftImage.removeEventListener('click', processClick);\n midImage.removeEventListener('click', processClick);\n rightImage.removeEventListener('click', processClick);\n}", "title": "" }, { "docid": "e118d259f2203d5d0617a0971140ab1e", "score": "0.6600455", "text": "removeEvents() {\n if (this.settings.closeOnClick) {\n document.removeEventListener('click', this.handleCloseOnClick.bind(this), false);\n }\n\n this.trigger.removeEventListener('click', this, false);\n document.removeEventListener('keydown', this, false);\n }", "title": "" }, { "docid": "e6cdec57760b11bf72839fc3adec2c76", "score": "0.6599556", "text": "removeEventListeners() {\n let mouseEventName = `mousedown.${EVENT_ID}${this.id}`;\n let resizeEventName = `resize.${EVENT_ID}${this.id}`;\n this.removeWindowListener(mouseEventName);\n this.removeWindowListener(resizeEventName);\n if (this.__scrollDeregister) {\n this.__scrollDeregister();\n }\n this.__handlerDefined = false;\n }", "title": "" }, { "docid": "fc316d2ec836d47832ee51bdee27c8d3", "score": "0.6587996", "text": "_removeEventListeners() {\n\n this.inputEl.removeEventListener('focus', this._onFocusBound);\n this.inputEl.removeEventListener('blur', this._onBlurBound);\n this.inputEl.removeEventListener('input', this._onInputBound);\n\n if (this.passwordToggleEl) {\n this.passwordToggleEl.removeEventListener('click', this._onTogglePasswordViewHideBound);\n }\n\n if (this.clearEl) {\n this.clearEl.removeEventListener('click', this._onClearClickBound);\n }\n }", "title": "" }, { "docid": "f27e83291946757ad456be8e9b05c635", "score": "0.65829045", "text": "_removeHistoryEventListener() {\n this.listElement.removeEventListener('click', this._eventHandler.history);\n }", "title": "" }, { "docid": "484204698e4cfad3e8585acdb6ee63d7", "score": "0.6581363", "text": "removeListenersAddedOnMousedownAndTouchstart() {\n const doc = this.el_.ownerDocument;\n\n this.off(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.off(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.off(doc, 'mouseup', this.handleMouseUpHandler_);\n this.off(doc, 'touchend', this.handleMouseUpHandler_);\n }", "title": "" }, { "docid": "d6949f702e00632cbd1850609f3376a5", "score": "0.6570808", "text": "removeListeners() {\n this.unlistenEvents.forEach((unlisten) => {\n unlisten();\n });\n\n this.unlistenEvents = [];\n }", "title": "" }, { "docid": "9748c6843a369138a3ec6895ec5fd5b6", "score": "0.6560058", "text": "static removeFrom(inputElement) {\n if (listeners.has(inputElement)) {\n inputElement.removeEventListener(listeners.get(inputElement).listenEvent, listeners.get(inputElement).listener)\n listeners.delete(inputElement)\n }\n }", "title": "" }, { "docid": "e5f3a8455ec71410c315319506014a17", "score": "0.6550185", "text": "detachEvents() {\n var event, handler;\n\n for (event in this.windowHandlers) {\n handler = this.windowHandlers[event];\n\n if (handler.bound) {\n handler.bound = false;\n window.removeEventListener(event, handler.listener, handler.useCapture);\n }\n }\n\n for (event in this.eventEmitterHandlers) {\n handler = this.eventEmitterHandlers[event];\n\n if (handler.bound) {\n handler.bound = false;\n eventEmitter.off(event, handler.listener);\n }\n }\n }", "title": "" }, { "docid": "1ac9a670690f827748d0d917c6601d07", "score": "0.65292287", "text": "removeMouseInteractions() {\n\t\tthis.ctx.canvas.removeEventListener(\"click\", this.levelMouseClick, false);\n\t\t\n\t\tthis.ctx.canvas.removeEventListener(\"mousemove\", this.levelMouseMove, false);\n\t\t\n\t\tthis.ctx.canvas.removeEventListener(\"mouseout\", this.levelMouseOut, false);\t\t\n\t}", "title": "" }, { "docid": "8d99f809a338b9caf93d0b8e9cc48620", "score": "0.65248686", "text": "_removeGlobalEvents() {\n const document = this._document;\n document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);\n document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);\n document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);\n document.removeEventListener('touchend', this._pointerUp, activeEventOptions);\n document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);\n const window = this._getWindow();\n if (typeof window !== 'undefined' && window) {\n window.removeEventListener('blur', this._windowBlur);\n }\n }", "title": "" }, { "docid": "8d99f809a338b9caf93d0b8e9cc48620", "score": "0.65248686", "text": "_removeGlobalEvents() {\n const document = this._document;\n document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);\n document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);\n document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);\n document.removeEventListener('touchend', this._pointerUp, activeEventOptions);\n document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);\n const window = this._getWindow();\n if (typeof window !== 'undefined' && window) {\n window.removeEventListener('blur', this._windowBlur);\n }\n }", "title": "" }, { "docid": "1f6f112feaf34b5735fda455d1f3896b", "score": "0.65234303", "text": "function unbindListeners() {\n if (this && this.eventListeners) {\n this.eventListeners.forEach(item => {\n const {\n element,\n type,\n callback,\n options\n } = item;\n element.removeEventListener(type, callback, options);\n });\n this.eventListeners = [];\n }\n}", "title": "" }, { "docid": "7a9caba9ae4a97f42aeca9ba1dfd859f", "score": "0.64947116", "text": "function removeEventListeners() {\n\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t}", "title": "" }, { "docid": "48188ae009d4c0e9c250aaf6fb0cb952", "score": "0.64904046", "text": "function stopWatching() {\n if (activeElement) {\n $(activeElement)\n .off(watchedEvents, queueEventTargetForNotification);\n activeElement = null;\n }\n }", "title": "" }, { "docid": "2975f3378b360351edab7ccaa151abcf", "score": "0.64861405", "text": "function removeListener(w,event,cb){w.detachEvent?w.detachEvent(\"on\"+event,cb):w.removeEventListener&&w.removeEventListener(event,cb,!1)}", "title": "" }, { "docid": "61495907957dbc98a866f3f3cfe216e5", "score": "0.64381045", "text": "function teardownEvents(elem) {\n\t\tvar $elem = $(elem), $document = $(document);\n\t\tvar ref = $elem.data('focus.handlerReferences') || 0;\n\n\t\tif (ref === 1) {\n\t\t\tif (elem.removeEventListener) {\n\t\t\t\telem.removeEventListener('focus', focusHandler, true);\n\t\t\t\tdocument.removeEventListener('focus', focusHandlerBody, true);\n\t\t\t\telem.removeEventListener('blur', blurHandler, true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\telem.onfocusin = null;\n\t\t\t\tdocument.onfocusin = null;\n\t\t\t\telem.onfocusout = null;\n\t\t\t}\n\t\t\t$elem.removeData('focus.handlerReferences');\n\t\t\t$elem.removeData('focus.isFocused');\n\t\t\t$document.removeData('focus.watchedObject');\n\t\t}\n\t\telse {\n\t\t\t$elem.data('focus.handlerReferences', ref - 1);\n\t\t}\n\t}", "title": "" }, { "docid": "9a555bde41aa2b47c22fcc9883ba6ccb", "score": "0.64309865", "text": "unregisterEventListeners_() {\n const openElements = this.element.querySelectorAll(\n '[amp-drilldown-submenu-open]'\n );\n openElements.forEach(element => {\n element.removeEventListener('click', this.submenuOpenHandler_);\n });\n const closeElements = this.element.querySelectorAll(\n '[amp-drilldown-submenu-close]'\n );\n closeElements.forEach(element => {\n element.removeEventListener('click', this.submenuCloseHandler_);\n });\n\n this.documentElement_.removeEventListener('keydown', this.keydownHandler_);\n }", "title": "" }, { "docid": "3f02221826b26c04d9ec0adadadb12f8", "score": "0.641546", "text": "function removeEvents() {\n $breakMinus.off();\n $breakPlus.off();\n $workMinus.off();\n $workPlus.off();\n }", "title": "" }, { "docid": "1c6bfa37b106951d7d1dcff5a820ee9c", "score": "0.6403705", "text": "function removeAllListeners(container,opt) {\n\t\t\tcontainer.children().each(function() {\n\t\t\t try{ jQuery(this).die('click'); } catch(e) {}\n\t\t\t try{ jQuery(this).die('mouseenter');} catch(e) {}\n\t\t\t try{ jQuery(this).die('mouseleave');} catch(e) {}\n\t\t\t try{ jQuery(this).unbind('hover');} catch(e) {}\n\t\t\t})\n\t\t\ttry{ container.die('click','mouseenter','mouseleave');} catch(e) {}\n\t\t\tclearInterval(opt.cdint);\n\t\t\tcontainer=null;\n\n\n\n\t\t}", "title": "" }, { "docid": "1c6bfa37b106951d7d1dcff5a820ee9c", "score": "0.6403705", "text": "function removeAllListeners(container,opt) {\n\t\t\tcontainer.children().each(function() {\n\t\t\t try{ jQuery(this).die('click'); } catch(e) {}\n\t\t\t try{ jQuery(this).die('mouseenter');} catch(e) {}\n\t\t\t try{ jQuery(this).die('mouseleave');} catch(e) {}\n\t\t\t try{ jQuery(this).unbind('hover');} catch(e) {}\n\t\t\t})\n\t\t\ttry{ container.die('click','mouseenter','mouseleave');} catch(e) {}\n\t\t\tclearInterval(opt.cdint);\n\t\t\tcontainer=null;\n\n\n\n\t\t}", "title": "" }, { "docid": "1978d44d739dc9e7b10b77cd58dde985", "score": "0.6399191", "text": "function _detachEvent() {\n if (_domObject !== null && _eventAttached) {\n _domObject.off('change');\n\n _domObject = null;\n _eventAttached = false;\n }\n }", "title": "" }, { "docid": "f89a3667e8fbef5a61fb17f76f4b316b", "score": "0.63944536", "text": "function _removeEvents() {\n\t Utils.removeELementsAndAttachedEvent(Constants.OVERLAY_STYLE, Constants.FLEX_CLICK);\n\n\t Utils.removeELementsAndAttachedEvent(Constants.BACK_BUTTON_TRIGGER, Constants.FLEX_CLICK);\n\n\t Utils.removeELementsAndAttachedEvent(Constants.NEXT_BUTTON_TRIGGER, Constants.FLEX_CLICK);\n\n\t Utils.removeELementsAndAttachedEvent(Constants.DONE_BUTTON_TRIGGER, Constants.FLEX_CLICK);\n\n\t Utils.removeELementsAndAttachedEvent(Constants.CLOSE_TOUR, Constants.FLEX_CLICK);\n\t}", "title": "" }, { "docid": "7da59092e16c4ffa9a94617e27ba6718", "score": "0.63933325", "text": "function removeAllListeners(container, opt) {\n container.children().each(function() {\n try {\n jQuery(this).die('click');\n } catch (e) {\n }\n try {\n jQuery(this).die('mouseenter');\n } catch (e) {\n }\n try {\n jQuery(this).die('mouseleave');\n } catch (e) {\n }\n try {\n jQuery(this).unbind('hover');\n } catch (e) {\n }\n })\n try {\n container.die('click', 'mouseenter', 'mouseleave');\n } catch (e) {\n }\n clearInterval(opt.cdint);\n container = null;\n\n\n\n }", "title": "" }, { "docid": "7da59092e16c4ffa9a94617e27ba6718", "score": "0.63933325", "text": "function removeAllListeners(container, opt) {\n container.children().each(function() {\n try {\n jQuery(this).die('click');\n } catch (e) {\n }\n try {\n jQuery(this).die('mouseenter');\n } catch (e) {\n }\n try {\n jQuery(this).die('mouseleave');\n } catch (e) {\n }\n try {\n jQuery(this).unbind('hover');\n } catch (e) {\n }\n })\n try {\n container.die('click', 'mouseenter', 'mouseleave');\n } catch (e) {\n }\n clearInterval(opt.cdint);\n container = null;\n\n\n\n }", "title": "" }, { "docid": "b958c60f32e2922bcc8e931a3af8869c", "score": "0.63914186", "text": "_clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }", "title": "" }, { "docid": "b958c60f32e2922bcc8e931a3af8869c", "score": "0.63914186", "text": "_clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }", "title": "" }, { "docid": "b958c60f32e2922bcc8e931a3af8869c", "score": "0.63914186", "text": "_clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }", "title": "" }, { "docid": "4e8bf44cbe327449f2cefb56f3834a7a", "score": "0.6387253", "text": "$_indicator_removeListeners() {\n if (!this.$_indicator_applied) return;\n\n this.$_indicator_applied = false;\n\n if (this.$_indicator_listener && this.$_indicator_listener.destroy) {\n this.$_indicator_listener.destroy();\n }\n }", "title": "" }, { "docid": "c6a9d75ff54fcff8acd5def32bf8195a", "score": "0.6376089", "text": "function removeAllListeners(container,opt) {\r\n\t\t\tcontainer.children().each(function() {\r\n\t\t\t try{ jQuery(this).die('click'); } catch(e) {}\r\n\t\t\t try{ jQuery(this).die('mouseenter');} catch(e) {}\r\n\t\t\t try{ jQuery(this).die('mouseleave');} catch(e) {}\r\n\t\t\t try{ jQuery(this).unbind('hover');} catch(e) {}\r\n\t\t\t})\r\n\t\t\ttry{ container.die('click','mouseenter','mouseleave');} catch(e) {}\r\n\t\t\tclearInterval(opt.cdint);\r\n\t\t\tcontainer=null;\r\n\r\n\r\n\r\n\t\t}", "title": "" }, { "docid": "edf72a9fdfd60e7c1879707a1caaf307", "score": "0.6372957", "text": "removeEventListner (eventName) {\n if (this.events && this.events[eventName]) {\n delete this.events[eventName];\n }\n }", "title": "" }, { "docid": "8cdacd6231b05c5309a035b9ba5a8ad8", "score": "0.6369733", "text": "removeListeners() {\n $('[data-target-page]').off('click', ET.handleNavigateTo);\n }", "title": "" }, { "docid": "9b420969aeb191dae6567a64b8870559", "score": "0.63695383", "text": "function cleanupInteractiveMouseListeners() {\n document.body.removeEventListener('mouseleave', scheduleHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n mouseMoveListeners = mouseMoveListeners.filter(function (listener) {\n return listener !== debouncedOnMouseMove;\n });\n }", "title": "" }, { "docid": "a8373ae0b3fd8e82d0dbbbdedf017a44", "score": "0.6364025", "text": "cleanUp() {\n // Stop observing for changes\n this.observer.disconnect();\n\n // Remove event listeners\n window.removeEventListener('hashchange', this.hashChangeEvent, );\n this.html.addEventListener('mousemove', this.mousrmovehtml);\n }", "title": "" }, { "docid": "73d5379b3ab138c02806871e9faa61db", "score": "0.63489044", "text": "unloadElement(el) {\n let root = this;\n root.elements.filter(element => element === el);\n root.__on = root.elements > 0;\n if (!root.__on) root.removeEventListeners();\n }", "title": "" }, { "docid": "fc0a012c76e4a302f5cd317b7a742cf1", "score": "0.6342871", "text": "removeAllListeners() {\n for (let i = this.listeners.length - 1; i >= 0; i--) {\n this.listeners.splice(i, 1);\n }\n\n this.listeners.map(listener => this.removeListener(listener.id));\n }", "title": "" }, { "docid": "f793a139c847462f03a29ee2342c51f5", "score": "0.63397616", "text": "function $cleanupAfterRemove(element, eventType) {\n\t\tvar data = element.data,\n\t\t\tmethods = data[eventType]\n\t\t;\n\t\tif (methods.length === 0) {\n\t\t\t// remove the event listener\n\t\t\telement.removeEventListener(eventType, $eventHandler, false);\n\n\t\t\t// remove the list of events from our data object\n\t\t\tdelete data[eventType];\n\n\t\t\t// remove the event from the list of events\n\t\t\tdata.events = (data.events || \"\").split(\" \").remove(eventType).join(\" \");\n\t\t\t// and update the _events attribute\n\t\t\tif (!data.events) {\n\t\t\t\tdelete data.events;\n\t\t\t\telement.removeAttribute(\"_events\");\n\t\t\t} else {\n\t\t\t\telement.setAttribute(\"_events\", data.events);\n\t\t\t}\n\t\t}\n\t\n\t}", "title": "" }, { "docid": "7090ed7d683cc3ec6352bb0e70731b4f", "score": "0.6336893", "text": "remove() {\n if (this.canvas.removeEventListener) {\n this.canvas.removeEventListener('click', this.mouseEventHandler);\n this.canvas.removeEventListener('dblclick', this.mouseEventHandler);\n this.canvas.removeEventListener('keydown', this.keyEventHandler);\n this.canvas.removeEventListener('wheel', this.scrollEventHandler);\n this.canvas.removeEventListener('touchstart', this.touchStartHandler);\n this.canvas.removeEventListener('touchmove', this.touchMoveHandler);\n this.canvas.removeEventListener('mousewheel', this.scrollEventHandler);\n window.removeEventListener('resize', this.resizeEventHandler);\n } \n }", "title": "" }, { "docid": "6a349269a0741bcd42475deb279ada43", "score": "0.6336737", "text": "function disableEventListeners() {\n\t\tif (this.state.eventsEnabled) {\n\t\t\tcancelAnimationFrame(this.scheduleUpdate);\n\t\t\tthis.state = removeEventListeners(this.reference, this.state);\n\t\t}\n\t}", "title": "" }, { "docid": "e85314b641bfe35d727b6b38f7f92c70", "score": "0.6330268", "text": "function cleanupOldMouseListeners() {\n document.body.removeEventListener('mouseleave', prepareHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n }", "title": "" }, { "docid": "e85314b641bfe35d727b6b38f7f92c70", "score": "0.6330268", "text": "function cleanupOldMouseListeners() {\n document.body.removeEventListener('mouseleave', prepareHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n }", "title": "" }, { "docid": "cb8ffec56ba9ca793cd920bd4e17c1bb", "score": "0.6327838", "text": "function removeListeners(array){ \n\t\tarray.forEach(function(item){\n \n var targetString = \"\";\n \n\t\t\tif(item.id){\n targetString = item.id;\n\t\t\t\tvar el = document.getElementById(item.id);\n commitListener(el, item.event, item.attach);\n\t\t\t} else if(item.el) {\n targetString = item.el.id;\n commitListener(item.el, item.event, item.attach);\n\t\t\t} else if(item.parentId){\n targetString = item.parentId;\n\t\t\t\tvar parentEl = document.getElementById(item.parentId);\n\t\t\t\tvar elArray = parentEl && parentEl.childNodes;\n \n if(!elArray){ return fail(); };\n \n for(var i = 0; i < elArray.length; i++){\n commitListener(elArray[i], item.event, item.attach); \n };\n };\n\t\t\t\n function commitListener(el, event, attach){\n if(!el || !event || !attach){ return fail(); }; \n \n //Attach Event\n el.removeEventListener(event, attach);\n };\n \n function fail(){\n console.log(\"Cannot find \" + targetString + \" to remove listener.\");\n };\n\t\t});\n\t}", "title": "" }, { "docid": "fed8a50d5856f0bca8ab76da434283a4", "score": "0.6314478", "text": "function disableEventListeners() {\n\t if (this.state.eventsEnabled) {\n\t cancelAnimationFrame(this.scheduleUpdate);\n\t this.state = removeEventListeners(this.reference, this.state);\n\t }\n\t}", "title": "" }, { "docid": "1d5847f864a19346a69c660d447558c9", "score": "0.63095224", "text": "function removeListeners() {\n if (!$scroller) { return; }\n $scroller.off('mousewheel.smoothscroll', onScroll);\n }", "title": "" }, { "docid": "36186271cf668a1aa9354fce02362593", "score": "0.62899154", "text": "function cleanupOldMouseMoveListeners() {\n document.body.removeEventListener('mouseleave', prepareHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n }", "title": "" }, { "docid": "05e56ff482486469f350d6686e3dd39d", "score": "0.62615216", "text": "function removeEventListener(id) {\n for(var key in listeners) {\n for (var i=0, len=listeners[key].length; i<len; i++) {\n if (listeners[key][i].id === id) {\n listeners[key].splice(i, 1);\n }\n }\n }\n }", "title": "" }, { "docid": "3304fb889e0b098d5e9e53a5a49c65bf", "score": "0.6258982", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "3304fb889e0b098d5e9e53a5a49c65bf", "score": "0.6258982", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "3304fb889e0b098d5e9e53a5a49c65bf", "score": "0.6258982", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "fd7331c4cbf17e335f920bbe78a3be9c", "score": "0.62557167", "text": "function _removeEventListeners(target) {\n\t for (var i in this._eventOutput.listeners) {\n\t target.removeEventListener(i, this.eventForwarder);\n\t }\n\t }", "title": "" }, { "docid": "fd7331c4cbf17e335f920bbe78a3be9c", "score": "0.62557167", "text": "function _removeEventListeners(target) {\n\t for (var i in this._eventOutput.listeners) {\n\t target.removeEventListener(i, this.eventForwarder);\n\t }\n\t }", "title": "" }, { "docid": "4de0260bfe71e8ec8180055c62169dae", "score": "0.6250426", "text": "function _remove() {\n _resolve = null;\n _reject = null;\n _node.removeEventListener(ELEMENT_EVENT_ERROR, scriptOnError, false);\n _node.removeEventListener(ELEMENT_EVENT_LOAD, scriptOnLoad, false);\n }", "title": "" }, { "docid": "d7dbb8bf63f562904517f0347147ab8e", "score": "0.6249767", "text": "_unlisten() {\n\t\tfor(const type of this.types)\n\t\t\tthis.target.removeEventListener(type, this);\n\t}", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" }, { "docid": "da7cb9a8abe318acc021093642fc5ac5", "score": "0.62441605", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "title": "" } ]
6f95642529ec563fb444ffd97bbeaa12
createConnect with default args builds the 'official' connect behavior. Calling it with different options opens up some testing and extensibility scenarios
[ { "docid": "e76084f3ff2a4c25ec2bde1b4f4d85cd", "score": "0.65312386", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\n\t }, extraOptions));\n\t };\n\t}", "title": "" } ]
[ { "docid": "5fdfbf1774dad6ac4a50ae7b3302b59e", "score": "0.65509003", "text": "function createConnect() {\r\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\r\n _ref$connectHOC = _ref.connectHOC,\r\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\r\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\r\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\r\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\r\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\r\n _ref$mergePropsFactor = _ref.mergePropsFactories,\r\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\r\n _ref$selectorFactory = _ref.selectorFactory,\r\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\r\n \r\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\r\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\r\n _ref2$pure = _ref2.pure,\r\n pure = _ref2$pure === undefined ? true : _ref2$pure,\r\n _ref2$areStatesEqual = _ref2.areStatesEqual,\r\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\r\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\r\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\r\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\r\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\r\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\r\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\r\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\r\n \r\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\r\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\r\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\r\n \r\n return connectHOC(selectorFactory, _extends({\r\n // used in error messages\r\n methodName: 'connect',\r\n \r\n // used to compute Connect's displayName from the wrapped component's displayName.\r\n getDisplayName: function getDisplayName(name) {\r\n return 'Connect(' + name + ')';\r\n },\r\n \r\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\r\n shouldHandleStateChanges: Boolean(mapStateToProps),\r\n \r\n // passed through to selectorFactory\r\n initMapStateToProps: initMapStateToProps,\r\n initMapDispatchToProps: initMapDispatchToProps,\r\n initMergeProps: initMergeProps,\r\n pure: pure,\r\n areStatesEqual: areStatesEqual,\r\n areOwnPropsEqual: areOwnPropsEqual,\r\n areStatePropsEqual: areStatePropsEqual,\r\n areMergedPropsEqual: areMergedPropsEqual\r\n \r\n }, extraOptions));\r\n };\r\n }", "title": "" }, { "docid": "cf52f21b17f8969c69e124ea7f912340", "score": "0.6548471", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect_objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect_extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "cf52f21b17f8969c69e124ea7f912340", "score": "0.6548471", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect_objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect_extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "c304ae9e6283c3c9a1184cc06aa2fa9b", "score": "0.65004534", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\t\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\t\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\t\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\t\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "c304ae9e6283c3c9a1184cc06aa2fa9b", "score": "0.65004534", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\t\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\t\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\t\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\t\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "c304ae9e6283c3c9a1184cc06aa2fa9b", "score": "0.65004534", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\t\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\t\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\t\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\t\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "c304ae9e6283c3c9a1184cc06aa2fa9b", "score": "0.65004534", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\t\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\t\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\t\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\t\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "c989564f494ec4347d3e3c97d759008d", "score": "0.6495789", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n var _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.6401241", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.6401241", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.6401241", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.6401241", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.6401241", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.6401241", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "ae67db482fefabf4a2ec2d3187779847", "score": "0.64003074", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2['default'] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2['default'] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2['default'] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2['default'] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2['default'] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2['default'] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2['default'] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2['default'] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "39bb413418023997f143faa2406ee460", "score": "0.63548577", "text": "function createConnect() {\r\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\r\n _ref$connectHOC = _ref.connectHOC,\r\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\r\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\r\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\r\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\r\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\r\n _ref$mergePropsFactor = _ref.mergePropsFactories,\r\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\r\n _ref$selectorFactory = _ref.selectorFactory,\r\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\r\n\r\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\r\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\r\n _ref2$pure = _ref2.pure,\r\n pure = _ref2$pure === undefined ? true : _ref2$pure,\r\n _ref2$areStatesEqual = _ref2.areStatesEqual,\r\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\r\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\r\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\r\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\r\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\r\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\r\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\r\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\r\n\r\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\r\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\r\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\r\n\r\n return connectHOC(selectorFactory, _extends({\r\n // used in error messages\r\n methodName: 'connect',\r\n\r\n // used to compute Connect's displayName from the wrapped component's displayName.\r\n getDisplayName: function getDisplayName(name) {\r\n return 'Connect(' + name + ')';\r\n },\r\n\r\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\r\n shouldHandleStateChanges: Boolean(mapStateToProps),\r\n\r\n // passed through to selectorFactory\r\n initMapStateToProps: initMapStateToProps,\r\n initMapDispatchToProps: initMapDispatchToProps,\r\n initMergeProps: initMergeProps,\r\n pure: pure,\r\n areStatesEqual: areStatesEqual,\r\n areOwnPropsEqual: areOwnPropsEqual,\r\n areStatePropsEqual: areStatePropsEqual,\r\n areMergedPropsEqual: areMergedPropsEqual\r\n\r\n }, extraOptions));\r\n };\r\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.6267631", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "143d6c0498339c109573df30869e28ab", "score": "0.61993176", "text": "function normalizeConnectArgs (args) {\n\tvar options = {}\n\n\tif (is.isObject(args[0])) {\n\t\t// connect(options, [cb])\n\t\toptions = args[0]\n\t} else {\n\t\t// connect(port, [host], [cb])\n\t\toptions.port = args[0]\n\t\tif (is.isString(args[1])) {\n\t\t\toptions.host = args[1]\n\t\t} else {\n\t\t\toptions.host = '127.0.0.1'\n\t\t}\n\t}\n\n\tvar cb = args[args.length - 1]\n\treturn is.isFunction(cb) ? [options, cb] : [options]\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.6179611", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.6179611", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.6179611", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.6179611", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.6179611", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.6179611", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.6179611", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "8862982ebf26bed8d5ded9e69055ad16", "score": "0.61302376", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "edc3bdbe6de51b868b8b7835530ede11", "score": "0.6112179", "text": "function createConnect(_temp) {\n\t var _ref = _temp === void 0 ? {} : _temp,\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory.default : _ref$selectorFactory;\n\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n\t if (_ref2 === void 0) {\n\t _ref2 = {};\n\t }\n\n\t var _ref3 = _ref2,\n\t _ref3$pure = _ref3.pure,\n\t pure = _ref3$pure === void 0 ? true : _ref3$pure,\n\t _ref3$areStatesEqual = _ref3.areStatesEqual,\n\t areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n\t _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _shallowEqual.default : _ref3$areOwnPropsEqua,\n\t _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n\t areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _shallowEqual.default : _ref3$areStatePropsEq,\n\t _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _shallowEqual.default : _ref3$areMergedPropsE,\n\t extraOptions = (0, _objectWithoutPropertiesLoose2.default)(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t return connectHOC(selectorFactory, (0, _extends2.default)({\n\t // used in error messages\n\t methodName: 'connect',\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return \"Connect(\" + name + \")\";\n\t },\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "2f60351c73823de1f1344a0b6ea0ae3a", "score": "0.61035454", "text": "function createConnect(_temp) {\n\t var _ref = _temp === void 0 ? {} : _temp,\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced[\"default\"] : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps[\"default\"] : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps[\"default\"] : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps[\"default\"] : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory[\"default\"] : _ref$selectorFactory;\n\t\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n\t if (_ref2 === void 0) {\n\t _ref2 = {};\n\t }\n\t\n\t var _ref3 = _ref2,\n\t _ref3$pure = _ref3.pure,\n\t pure = _ref3$pure === void 0 ? true : _ref3$pure,\n\t _ref3$areStatesEqual = _ref3.areStatesEqual,\n\t areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n\t _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _shallowEqual[\"default\"] : _ref3$areOwnPropsEqua,\n\t _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n\t areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _shallowEqual[\"default\"] : _ref3$areStatePropsEq,\n\t _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _shallowEqual[\"default\"] : _ref3$areMergedPropsE,\n\t extraOptions = (0, _objectWithoutPropertiesLoose2[\"default\"])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t return connectHOC(selectorFactory, (0, _extends2[\"default\"])({\n\t // used in error messages\n\t methodName: 'connect',\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return \"Connect(\" + name + \")\";\n\t },\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "2f60351c73823de1f1344a0b6ea0ae3a", "score": "0.61035454", "text": "function createConnect(_temp) {\n\t var _ref = _temp === void 0 ? {} : _temp,\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced[\"default\"] : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps[\"default\"] : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps[\"default\"] : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps[\"default\"] : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory[\"default\"] : _ref$selectorFactory;\n\t\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n\t if (_ref2 === void 0) {\n\t _ref2 = {};\n\t }\n\t\n\t var _ref3 = _ref2,\n\t _ref3$pure = _ref3.pure,\n\t pure = _ref3$pure === void 0 ? true : _ref3$pure,\n\t _ref3$areStatesEqual = _ref3.areStatesEqual,\n\t areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n\t _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _shallowEqual[\"default\"] : _ref3$areOwnPropsEqua,\n\t _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n\t areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _shallowEqual[\"default\"] : _ref3$areStatePropsEq,\n\t _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _shallowEqual[\"default\"] : _ref3$areMergedPropsE,\n\t extraOptions = (0, _objectWithoutPropertiesLoose2[\"default\"])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t return connectHOC(selectorFactory, (0, _extends2[\"default\"])({\n\t // used in error messages\n\t methodName: 'connect',\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return \"Connect(\" + name + \")\";\n\t },\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t }, extraOptions));\n\t };\n\t}", "title": "" } ]
92cbf6a811067d9aacaf6fe8f84542d5
Returns the value of a second in the current units
[ { "docid": "c8a5a15c24038e1fe1460143dda3616f", "score": "0.0", "text": "_secondsToUnits(seconds) {\n return (0, _Conversions.ftom)(super._secondsToUnits(seconds));\n }", "title": "" } ]
[ { "docid": "4c624ca04d44fe5a5d171324829a6ece", "score": "0.72670674", "text": "function sec(seconds){ return seconds * 1000; }", "title": "" }, { "docid": "aa390908f821020b89126ad15ae194ee", "score": "0.71416277", "text": "function currentSeconds(x){\n var minutes = parseFloat(x);\n var secondsPerMin = 60;\n return secondsPerMin *= minutes;\n}", "title": "" }, { "docid": "721078aa6dd395baad7a92cab9d998f8", "score": "0.69477063", "text": "get toSeconds() { return this / 1000 }", "title": "" }, { "docid": "55682d9b1aaf33cac9c5de2f6698ef77", "score": "0.67349946", "text": "function milisecond() {\n var elapsedTime = Date.now() - startTime;\n let milisec = ((elapsedTime / 1000).toFixed(2).split(\".\")[1])\n\n document.getElementById(\"milisecond\").innerHTML = milisec;\n}", "title": "" }, { "docid": "a3fa376e537c849965a18344fa8c1acf", "score": "0.6530013", "text": "function seconds(n) {\n\t\treturn n * 1000;\n}", "title": "" }, { "docid": "3cc7759dc12b040bb67a06d0f83facde", "score": "0.6459191", "text": "function two(min) {\n let sec = (min * 60).toFixed(2);\n return sec;\n}", "title": "" }, { "docid": "d073cb06b83a1b452c9f1836ab51a70d", "score": "0.6447833", "text": "function durationValue(value)\n{\n return value + 's';\n}", "title": "" }, { "docid": "132a88dfba3e2aa56ff23e3c9de18cb2", "score": "0.64016825", "text": "get seconds() {\n return this.getSecondsAtTime(this.now());\n }", "title": "" }, { "docid": "5916dc85b8d66cc8b6ebf7f523b9a082", "score": "0.63961166", "text": "function nowInSeconds() {\n return Date.now() / 1000;\n}", "title": "" }, { "docid": "36411e5686bd14a52ab7aa3e7baead00", "score": "0.63831115", "text": "function unit() {\n\t\treturn units.value\n\t}", "title": "" }, { "docid": "bbae599aa38ee827f634761809fe2819", "score": "0.63761735", "text": "function minutesToSeconds(minutes = 1, seconds = 60) {\n\n outcome = (seconds * minutes)\n}", "title": "" }, { "docid": "0f65d4511660cbe5713909af8cc85298", "score": "0.63647306", "text": "function now_sec()\n{\n return Date.now() / 1000;\n}", "title": "" }, { "docid": "9449e1dbcabfb7dccff7097bc129b66f", "score": "0.6346481", "text": "_secondsToUnits(seconds) {\n return 1 / seconds;\n }", "title": "" }, { "docid": "f084e0551f852ddd2a6a2ddfa4a46d19", "score": "0.63209647", "text": "get formattedSeconds() {\n return this.formattedUnit(this.seconds);\n }", "title": "" }, { "docid": "afe15f3a1912aa6e4512f80c4217f8bd", "score": "0.63161075", "text": "function litres(time) {\n return parseInt(time*0.5);\n}", "title": "" }, { "docid": "449389d58ba1b1b19fbba233a1c094d9", "score": "0.6314896", "text": "function __timer_getSEC() {\n\t\tvar jetzt = new Date();\n\t\tvar nActMilli = jetzt.getTime();\n\t\treturn (nActMilli - __timer_nMillisec) / 1000;\n\t}", "title": "" }, { "docid": "bd9c6f2defe71373c4a118168d03862b", "score": "0.6313976", "text": "function timeSeconds(){\n return Date.now()/1000;\n}", "title": "" }, { "docid": "bb6e4e3fc3994edac8c990aca07dec32", "score": "0.63042057", "text": "_secondsToUnits(seconds) {\n return 1 / seconds;\n }", "title": "" }, { "docid": "bb6e4e3fc3994edac8c990aca07dec32", "score": "0.63042057", "text": "_secondsToUnits(seconds) {\n return 1 / seconds;\n }", "title": "" }, { "docid": "175673999cfd4441f07f2e3983fa05f6", "score": "0.6288257", "text": "toSeconds() {\n return this.valueOf() / this._getPPQ() * (60 / this._getBpm());\n }", "title": "" }, { "docid": "3934f05fc1003234b11372087625a529", "score": "0.62689686", "text": "function getSeconds(value) {\n return (value & 0x8000) ? this.ToUint32((value & 0x7fff)) * 60 : value;\n}", "title": "" }, { "docid": "c48137669877f9ffaf69753b3823a32c", "score": "0.6258473", "text": "_secondsToUnits(seconds) {\n return seconds;\n }", "title": "" }, { "docid": "18bbde1b17afd570858c85058c9ae0a7", "score": "0.62218106", "text": "function TS(s) {\n return s / TIME_SCALE;\n}", "title": "" }, { "docid": "5eb33a8d14c7903d83df14689579283e", "score": "0.6185632", "text": "function getSeconds() {\n //Convert remaining hundredth seconds to seconds, then find the number of seconds within the current minute by accessing the remainder of the unit conversion from seconds to minutes.\n let seconds = (Math.floor(remainingTime / 100) % 60); \n\n //See if an extra zero is needed for formatting. \n if(seconds < 10) {\n return `0${seconds}`;\n } else {\n return seconds; \n }\n}", "title": "" }, { "docid": "74e6316c728a02d1348d647f50fa6971", "score": "0.6183354", "text": "toSeconds() {\n return (this.valueOf() / this._getPPQ()) * (60 / this._getBpm());\n }", "title": "" }, { "docid": "74e6316c728a02d1348d647f50fa6971", "score": "0.6183354", "text": "toSeconds() {\n return (this.valueOf() / this._getPPQ()) * (60 / this._getBpm());\n }", "title": "" }, { "docid": "99700e0e540acd438ff6b560927ec5d5", "score": "0.6173679", "text": "toSeconds() {\n return 1 / super.toSeconds();\n }", "title": "" }, { "docid": "99700e0e540acd438ff6b560927ec5d5", "score": "0.6173679", "text": "toSeconds() {\n return 1 / super.toSeconds();\n }", "title": "" }, { "docid": "a522d17e927879d26cdae4cadd11982d", "score": "0.614988", "text": "_secondsToUnits(seconds) {\n return seconds;\n }", "title": "" }, { "docid": "a522d17e927879d26cdae4cadd11982d", "score": "0.614988", "text": "_secondsToUnits(seconds) {\n return seconds;\n }", "title": "" }, { "docid": "dc725376b47ae4e2409493071db5d4a9", "score": "0.6140833", "text": "get seconds() {\n return this.getSecondsAtTime(this.now());\n }", "title": "" }, { "docid": "dc725376b47ae4e2409493071db5d4a9", "score": "0.6140833", "text": "get seconds() {\n return this.getSecondsAtTime(this.now());\n }", "title": "" }, { "docid": "dc725376b47ae4e2409493071db5d4a9", "score": "0.6140833", "text": "get seconds() {\n return this.getSecondsAtTime(this.now());\n }", "title": "" }, { "docid": "49a5188079c6a7d612ffd7928246b000", "score": "0.6138673", "text": "get seconds() {\n return this._clock.seconds;\n }", "title": "" }, { "docid": "6de41c4cf8c9ea05fbbc645b6833ea4e", "score": "0.61277986", "text": "get seconds() {\n return this._tickSource.seconds;\n }", "title": "" }, { "docid": "acdae86052b5c7bdc2a88b301ae1cddb", "score": "0.6127014", "text": "function sec(value) {\n return 1 / Math.cos(value);\n}", "title": "" }, { "docid": "f73fec1425c0304df15301f00249822e", "score": "0.61251515", "text": "function getSeconds(milliseconds) {\n return Math.round(milliseconds / 1000);\n }", "title": "" }, { "docid": "35d68647473f3e18b8b75a901358937a", "score": "0.6118702", "text": "function timeSeconds() {\n return new Date().getTime()/1000;\n}", "title": "" }, { "docid": "8348fa48d3adfdc61e2fb1ab738098f9", "score": "0.6117014", "text": "sampleTime() {\n const { elapsedTime } = this.state\n\n return Math.floor((elapsedTime / 1000))\n }", "title": "" }, { "docid": "3e17eab48fe681111538d4a4a979d4e3", "score": "0.6096988", "text": "function secToMs(time) {\n return time * 1000;\n}", "title": "" }, { "docid": "e8a2fcfbb9e96718d7490e992dc221ee", "score": "0.60836387", "text": "get seconds() {\n return this._tickSource.seconds;\n }", "title": "" }, { "docid": "e8a2fcfbb9e96718d7490e992dc221ee", "score": "0.60836387", "text": "get seconds() {\n return this._tickSource.seconds;\n }", "title": "" }, { "docid": "3eac453776e9af070384d3e36189450d", "score": "0.6082988", "text": "function hundredths2Sec(xx) {\n return parseFloat((xx / 100).toFixed(2));\n}", "title": "" }, { "docid": "e67005eaeb32bcbf3b878d353c9bde63", "score": "0.6082412", "text": "get seconds() {\n return this._clock.seconds;\n }", "title": "" }, { "docid": "e67005eaeb32bcbf3b878d353c9bde63", "score": "0.6082412", "text": "get seconds() {\n return this._clock.seconds;\n }", "title": "" }, { "docid": "a0719b0a9432b9897e2ebdac3be5766e", "score": "0.60677946", "text": "toSeconds() {\n return 1 / super.toSeconds();\n }", "title": "" }, { "docid": "69da7e8c69164d28127fe156f5845e22", "score": "0.60584277", "text": "s (date) {\n return date.getSeconds()\n }", "title": "" }, { "docid": "4640bd640b80ec13553ab552103a3f35", "score": "0.6024712", "text": "function show_time_spent()\r\n{\r\n counter_status = true;\r\n var lt_value=parseFloat(st_target.html());\r\n var second=(lt_value+interval_timeout/1000).toFixed(2);\r\n st_target.html(second);\r\n}", "title": "" }, { "docid": "45e00b46734de04d83067cf1050dbeb4", "score": "0.60222", "text": "function everySecond() {\n var timeObject = secondsToTime(Math.floor(myPlayer.ima3.adPlayer.duration() - myPlayer.ima3.adPlayer.currentTime()));\n document.getElementById('timeTarget').innerHTML = timeObject.m + ':' + timeObject.s;\n }", "title": "" }, { "docid": "74ff896e4c5ab38c0f66fa357e15d9a9", "score": "0.6017071", "text": "function timeConversion(seconds, no_secs_in_unit) {\n let calc = seconds / no_secs_in_unit\n let toFind = 0\n\n if(calc >= 1) {\n if(String(calc).includes('.')) {\n let parts = String(calc).split('.')\n\n toFind = parseInt(parts[0])\n\n let remainder = parseFloat(\".\" + parts[1])\n seconds = Math.round(remainder * no_secs_in_unit)\n\n }\n else {\n seconds = 0\n toFind = calc\n }\n }\n else {\n toFind = 0\n }\n return {\"sec\": seconds, \"res\": toFind}\n}", "title": "" }, { "docid": "5d3e05e9259ca51a25f94eb2e8549dc7", "score": "0.59903556", "text": "function seconds(totalSeconds){\n var secondsPerMin = 60;\n var currentMinutes = Math.floor(parseFloat(totalSeconds) / secondsPerMin);\n var remainder = parseFloat(totalSeconds) - currentMinutes * secondsPerMin;\n\n var secString = remainder.toString();\n\n if(secString.length === 1){\n return '0' + secString;\n }else{\n return secString;\n }\n}", "title": "" }, { "docid": "a6cbc9474a01b722a8333172594a8fb2", "score": "0.59873575", "text": "function getFormattedNanoSecond(time){\n let nano = time[0] * 1e9 + time[1]\n return nano.toLocaleString()\n}", "title": "" }, { "docid": "81b3cceae280f8a13923a00acf4afc40", "score": "0.5986241", "text": "static getSec(intTime) {\n return intTime % 60;\n }", "title": "" }, { "docid": "a62026b247e7ac9b8bdbf28c90852243", "score": "0.594477", "text": "function secondstotime(sec){\n var hours = Math.floor(sec/ 3600);\n var minutes = Math.floor((sec - (hours * 3600)) / 60);\n var seconds = sec - (hours * 3600) - (minutes * 60);\n timeSpent = ('0' + hours).slice(-2)+':'+('0' + minutes).slice(-2)+':'+('0' + parseInt(seconds)).slice(-2);\n\t\tif(minutes>4){\n\t\t\tdocument.getElementById(\"p\").style.color=\"blue\";\n\t\t}\n return timeSpent;\n}", "title": "" }, { "docid": "15899fb4fccf28ce88e39575639952de", "score": "0.593953", "text": "function toSeconds(ms){\n var sec=parseFloat(ms/1000);\n return sec;\n }", "title": "" }, { "docid": "15899fb4fccf28ce88e39575639952de", "score": "0.593953", "text": "function toSeconds(ms){\n var sec=parseFloat(ms/1000);\n return sec;\n }", "title": "" }, { "docid": "0b9d08b6b787d03ef9302bbd5804d4ae", "score": "0.5938754", "text": "getSeconds(ms) {\n return moment.duration(ms).format({\n template: 'ss',\n trim: false\n });\n }", "title": "" }, { "docid": "82383ac27ef5d160e83936d962adc63e", "score": "0.59342784", "text": "toSeconds() {\n return this.valueOf();\n }", "title": "" }, { "docid": "a89661a937460eef323a92eaa934373b", "score": "0.5924214", "text": "function getTimeDeltaSeconds({ x, fracOfC }) {\n\treturn x * fracOfC;\n}", "title": "" }, { "docid": "67c077872269f315382bea4fb30a944d", "score": "0.59164387", "text": "function getSecondsPerRound(){\n return _secondsPerRound;\n }", "title": "" }, { "docid": "053df49b3d9d25093c189a9786343928", "score": "0.59162956", "text": "function mintosec(min){\n var sec=min*60;\n return sec;\n\n}", "title": "" }, { "docid": "69ee86322e248d22f67e0a890454996d", "score": "0.59060264", "text": "function secConverter(min)\n{\n return min*60;\n}", "title": "" }, { "docid": "dfda72f000ad99253749ec0de73ff632", "score": "0.58837676", "text": "function getDuration(unit, count) {\n if (!__WEBPACK_IMPORTED_MODULE_0__utils_Type__[\"d\" /* hasValue */](count)) {\n count = 1;\n }\n return timeUnitDurations[unit] * count;\n}", "title": "" }, { "docid": "dfda72f000ad99253749ec0de73ff632", "score": "0.58837676", "text": "function getDuration(unit, count) {\n if (!__WEBPACK_IMPORTED_MODULE_0__utils_Type__[\"d\" /* hasValue */](count)) {\n count = 1;\n }\n return timeUnitDurations[unit] * count;\n}", "title": "" }, { "docid": "cbe801a1ab5aeecc1dfdcdfb99ba9008", "score": "0.58576477", "text": "function getDuration(unit, count) {\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_0__[\"hasValue\"](count)) {\n count = 1;\n }\n\n return timeUnitDurations[unit] * count;\n }", "title": "" }, { "docid": "7f073377f81cc141592c4390bdd5400d", "score": "0.58537674", "text": "toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6;}", "title": "" }, { "docid": "123ef386efb809f5b17cf2fb5032cb4c", "score": "0.585084", "text": "function msToSec(time) {\n return time / 1000;\n}", "title": "" }, { "docid": "8f207f1d2a91fdb4e2e5b02f01037dcb", "score": "0.5837075", "text": "function getHourMinuteSecond() {\n let divGetHourMinuteSecond = document.querySelector(\".content-current_hour-minute-seconde\");\n divGetHourMinuteSecond.innerHTML = getNumberToString(hours) + \":\" + getNumberToString(minutes) + \":\" + getNumberToString(seconds);\n if (seconds >= 59) {\n minutes += 1;\n seconds = 0;\n } else if (minutes >= 59) {\n hours += 1;\n minutes = 0;\n } else if (hours >= 24) {\n hours = 0;\n } else {\n seconds++;\n }\n}", "title": "" }, { "docid": "8d0b60c56339dbf9b7d798187070335e", "score": "0.58338153", "text": "function get_time_string(value) {\n return value/1000/60;\n}", "title": "" }, { "docid": "1d176c940e48750d1ed798e0375e061e", "score": "0.58058786", "text": "stopwatch() {\n var date = new Date();\n return date.getSeconds();\n }", "title": "" }, { "docid": "25cdaa58c60a72f299714a832cd42a85", "score": "0.5786994", "text": "function getDuration(unit, count) {\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_0__[\"hasValue\"](count)) {\n count = 1;\n }\n return timeUnitDurations[unit] * count;\n}", "title": "" }, { "docid": "25cdaa58c60a72f299714a832cd42a85", "score": "0.5786994", "text": "function getDuration(unit, count) {\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_0__[\"hasValue\"](count)) {\n count = 1;\n }\n return timeUnitDurations[unit] * count;\n}", "title": "" }, { "docid": "5d97beb50ffb766694eca09e8246f42c", "score": "0.576279", "text": "function sTime() {\n s = new Date();\n s.getMilliseconds();\n }", "title": "" }, { "docid": "a1bac4facfbdbf5223b6127d5d38b073", "score": "0.57483566", "text": "function getSecs(ms){\n if(ms)\n return (new Date().getTime() );\n else\n return (new Date().getTime() / 1000);\n}", "title": "" }, { "docid": "7082321d3d31df7ef847c4a16a3a2d86", "score": "0.57402885", "text": "function secondsToTimeValue(seconds)\n{\n var minutes = Math.floor(seconds / 60);\n seconds = seconds % 60;\n\n if(minutes < 10){minutes = \"0\"+minutes;}\n if(seconds < 10){seconds = \"0\"+seconds;}\n\n return minutes + \":\" + seconds;\n}", "title": "" }, { "docid": "3bb29549ef7c60b7dbfa59b8ed3e87cf", "score": "0.57349074", "text": "function litres(time) {\n\n let num = Math.floor(time / 2)\n console.log(num)\n\n return num\n }", "title": "" }, { "docid": "45666f708da519e40ce61c8ca3979c0f", "score": "0.573177", "text": "getSeconds()\n {\n return this.seconds;\n }", "title": "" }, { "docid": "95fd7c45244fb230d1c52916a791f500", "score": "0.57187885", "text": "function litres(time) {\r\n return Math.floor(time * 0.5);\r\n}", "title": "" }, { "docid": "7a184aa3c79fad36ad9a28ccc7cf556a", "score": "0.57158", "text": "function milliseconds(seconds) {\treturn Math.floor(seconds*1000);\t}", "title": "" }, { "docid": "0d0d7d42d8f11979aad9b65d7397f50e", "score": "0.5704612", "text": "function toSecond( time ) {\n var timeList = time.split( ':' );\n var totalTime = 0;\n var t = 0;\n\n for ( var i = timeList.length - 1; i >= 0; i-- ) {\n totalTime += parseInt( timeList[i] ) * Math.pow( 60, t );\n\n t++;\n }\n\n return totalTime;\n }", "title": "" }, { "docid": "87b89b81cad496ac1eb3e8d93e0d964a", "score": "0.5700073", "text": "function msToSec(ms) {\n return Math.round(ms / 1000);\n}", "title": "" }, { "docid": "5b1b06ea6c1e33eccd5628a9b7cea874", "score": "0.5698484", "text": "toSeconds() {\n return this.valueOf();\n }", "title": "" }, { "docid": "5b1b06ea6c1e33eccd5628a9b7cea874", "score": "0.5698484", "text": "toSeconds() {\n return this.valueOf();\n }", "title": "" }, { "docid": "09afd08a292c4aecbf7edd0321d69e43", "score": "0.56921554", "text": "ms () { return this.now() - this.startMS }", "title": "" }, { "docid": "d439d64f2b6d6c9f24284688bc5ebc8f", "score": "0.5685615", "text": "function getMilliseconds( time ) {\r\r\n if ( typeof time == 'number' ) {\r\r\n return time;\r\r\n }\r\r\n var matches = time.match( /(^\\d*\\.?\\d*)(\\w*)/ );\r\r\n var num = matches && matches[1];\r\r\n var unit = matches && matches[2];\r\r\n if ( !num.length ) {\r\r\n return 0;\r\r\n }\r\r\n num = parseFloat( num );\r\r\n var mult = msUnits[ unit ] || 1;\r\r\n return num * mult;\r\r\n }", "title": "" }, { "docid": "f0cd468c8616157961c391e734395488", "score": "0.5680988", "text": "get speedUS() {\n return this.speed / 1.6;\n }", "title": "" }, { "docid": "1be9235c110f51ed99b2302a0ef35f0a", "score": "0.56806546", "text": "get sustainedClockSpeed() {\n return this.getNumberAttribute('sustained_clock_speed');\n }", "title": "" }, { "docid": "c4cab55c26c79c8e1ba2d6dc90936261", "score": "0.5679158", "text": "function sec2hrsmins(Seconds,noUnits)\r\n{\r\n lSeconds = Seconds;\r\n lHrs = parseInt(lSeconds / 3600);\r\n lMinutes = (parseInt(lSeconds / 60)) - (lHrs * 60);\r\n\r\n if(lSeconds == 60)\r\n {\r\n lMinutes = lMinutes + 1;\r\n lSeconds = 0;\r\n }\r\n\r\n if(lMinutes == 60)\r\n {\r\n lMinutes = 0;\r\n lHrs = lHrs + 1;\r\n }\r\n\r\n tSeconds = lSeconds - ( (lHrs * 60)+(lMinutes * 60) );\r\n\r\n if (noUnits)\r\n return (lHrs + \":\" + lMinutes);\r\n else\r\n return (lHrs+\"H:\" + lMinutes + \"m\");\r\n}", "title": "" }, { "docid": "efc328b330b80c6dc8d5ddb45a5d2d95", "score": "0.5675494", "text": "function _SeSCurrMillis()\r\n{\r\n\tvar intMilliSecs = (new Date()).valueOf();\r\n\treturn intMilliSecs;\r\n}", "title": "" }, { "docid": "568e9c23ab33c41be957616d43c18e2b", "score": "0.56747454", "text": "getCurrentTimePercentage() {\n if (this.state.currentTime > 0) {\n return parseFloat(this.state.currentTime) / parseFloat(this.state.duration);\n }\n return 0;\n }", "title": "" }, { "docid": "c6743c63c1e762a529f137f99f4c4a90", "score": "0.56718177", "text": "function litres(time) {\n return Math.floor(time * 0.5);\n }", "title": "" }, { "docid": "89a6e5c71cb8690daf181afe63f30ac3", "score": "0.56704545", "text": "function getTimer( ) { return _playerState[\"GameTime\"][\"seconds\"]; }", "title": "" }, { "docid": "41b2fe8adf751c42db00a7cfec218981", "score": "0.56698924", "text": "getRemainingSecs() {\n return Math.floor(this.getRemaining() / 1000) + 1;\n }", "title": "" }, { "docid": "13c40ddb2b0d5d4326c278da7760e7ee", "score": "0.5668805", "text": "function __timer_getMS() {\n\t\tvar jetzt = new Date();\n\t\tvar nActMilli = jetzt.getTime();\n\t\treturn (nActMilli - __timer_nMillisec);\n\t}", "title": "" }, { "docid": "5cc5694627897e552d815dd90d45353e", "score": "0.5668783", "text": "function kilometerToMeter(kilometer){\n var meter = kilometer/1000\n return meter\n}", "title": "" }, { "docid": "70cf719b101375efb1b70b9ea97ca77c", "score": "0.56655204", "text": "function kilometerToMeter(oneKm){\n var meter = oneKm* 1000;\n return meter;\n}", "title": "" }, { "docid": "0ac945bc4db95a66b5dfeb5a45b5adfd", "score": "0.5665511", "text": "get speedUS() {\r\n return this.speed / 1.6;\r\n }", "title": "" }, { "docid": "f3ad81c48143c8711dea20ed9fb304c7", "score": "0.56648153", "text": "function durationFromSeconds(s) {\n return `${s}s`;\n}", "title": "" }, { "docid": "2dc9781c20657f6b58b1da24945a379f", "score": "0.5650047", "text": "function getRes(unit) {\n var measured,\n begin,\n count = 30,\n divisor = 1e3,\n ns = timer.ns,\n sample = [];\n\n // Get average smallest measurable time.\n while (count--) {\n if (unit == 'us') {\n divisor = 1e6;\n if (ns.stop) {\n ns.start();\n while (!(measured = ns.microseconds())) {}\n } else {\n begin = ns();\n while (!(measured = ns() - begin)) {}\n }\n }\n else if (unit == 'ns') {\n divisor = 1e9;\n begin = (begin = ns())[0] + (begin[1] / divisor);\n while (!(measured = ((measured = ns())[0] + (measured[1] / divisor)) - begin)) {}\n divisor = 1;\n }\n else if (ns.now) {\n begin = ns.now();\n while (!(measured = ns.now() - begin)) {}\n }\n else {\n begin = new ns().getTime();\n while (!(measured = new ns().getTime() - begin)) {}\n }\n // Check for broken timers.\n if (measured > 0) {\n sample.push(measured);\n } else {\n sample.push(Infinity);\n break;\n }\n }\n // Convert to seconds.\n return getMean(sample) / divisor;\n }", "title": "" }, { "docid": "69492ccf8e947fb25b475ae6106afb7c", "score": "0.56473464", "text": "function calculate(value) {\n const myValue = value * 2.54;\n console.log(\"The value in cm is \" + myValue + \"cm\");\n return myValue;\n}", "title": "" }, { "docid": "5856497fff8055e057eb0553ff4f89ea", "score": "0.5640284", "text": "function convertSeconds() {\n\tlet secondsValue = getIntegerFromInput(\"seconds-val\");\n\tconst answerBlock = document.getElementById(\"seconds-answer\");\n\tconst maxValue = 10;\n\tif (isNaN(secondsValue) || !isPositive(secondsValue) ||\n\t\tsecondsValue.toString().length > maxValue) {\n\t\tsetAnswer(answerBlock, errorMsg);\n\t\treturn;\n\t}\n\tconst secInHour = 3600;\n\tconst secInMinute = 60;\n\tconst hours = setTime(Math.floor(secondsValue / secInHour));\n\tconst minutes = setTime(Math.floor((secondsValue - (hours * secInHour)) / secInMinute));\n\tconst seconds = setTime(secondsValue - (hours * secInHour) - (minutes * secInMinute));\n\tconst result = `${hours}:${minutes}:${seconds}`;\n\tsetAnswer(answerBlock, result);\n}", "title": "" } ]
6a6e2dacf390897c8663316f4b05cdeb
Finds countries that match in API vs. typed
[ { "docid": "c59504932549258e426bc16205ae36ea", "score": "0.5681886", "text": "function findMatches(wordToMatch, country) {\n return country.filter(c => {\n if (\n wordToMatch.toLowerCase() ==\n c.name.toLowerCase().substring(0, wordToMatch.length)\n ) {\n return c;\n }\n });\n}", "title": "" } ]
[ { "docid": "29c5d1146a89580746bf4b18accd3a4f", "score": "0.6610324", "text": "function findCountry(response) {\n\tfor (j = 0; j < response.results[0].address_components.length; j++) {\n\t for (h = 0; h < response.results[0].address_components[j].types.length; h++) {\n\t if (response.results[0].address_components[j].types[h] === \"country\") {\n\t country = response.results[0].address_components[j].short_name;\n\t \t};\n\t };\n\t};\n\treturn country;\n}", "title": "" }, { "docid": "a62d82a21b47cc403b3df684d0e4c797", "score": "0.65519845", "text": "function checkCountry(cnt, value) { \n var found ; \n cnt.filter(function(d){\n if( d.properties.ISO_3_CODE == value ) { found = d ; return ; }\n });\n return found ; \n}", "title": "" }, { "docid": "a62d82a21b47cc403b3df684d0e4c797", "score": "0.65519845", "text": "function checkCountry(cnt, value) { \n var found ; \n cnt.filter(function(d){\n if( d.properties.ISO_3_CODE == value ) { found = d ; return ; }\n });\n return found ; \n}", "title": "" }, { "docid": "366de1a695a9c51fbfdef35f017dfa09", "score": "0.65372515", "text": "function get_popular_country(){ return ['US', 'GB']; }", "title": "" }, { "docid": "8b219363ccab7c23bc7f6b52255fe07f", "score": "0.6495381", "text": "function search(country)\n{\n var url = \"https://restcountries.eu/rest/v1/name/\" + country + \"?fullText=true\";\n $.ajax({\n method: \"GET\",\n url: url,\n dataType: \"json\"\n }).done(function (response)\n {\n $(\".no-country-found\").hide();\n showResult(response[0]);\n }).fail(function ()\n {\n $(\".no-country-found\").show();\n });\n}", "title": "" }, { "docid": "549583b9d51f35abce962c8b28383e4c", "score": "0.64311296", "text": "countries() {\n return requests.get(`all`)\n }", "title": "" }, { "docid": "b6f8d3944196d72a3259a894bce8b6eb", "score": "0.615805", "text": "getCountryFromIso(iso, countries) {\n const country = countries.find(country => country.iso && country.iso.toUpperCase() === iso && country.record_type === 1);\n if (country) {\n return country;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "0e46db08022d07891cb8bdad7ee691f6", "score": "0.6076688", "text": "function getCountries() {\n\n var res = axios.get(\"https://salary-data-api.herokuapp.com/salary_data/countries\");\n\n return res;\n }", "title": "" }, { "docid": "40a3f412aad7931b2625ce4db9c39cac", "score": "0.6073533", "text": "function getAllCountries () {\n return axios.post(\"\", {\n initials: \"\",\n count: 9999\n })\n }", "title": "" }, { "docid": "b6e5a7862a1a7e5c7f750d2c5e52529f", "score": "0.6057993", "text": "function getCountry(code){\n switch(code){\n case \"AF\": return \"Afghanistan\";\n case \"AX\": return \"┼land Islands\";\n case \"AL\": return \"Albania\";\n case \"DZ\": return \"Algeria\";\n case \"AS\": return \"American Samoa\";\n case \"AD\": return \"Andorra\";\n case \"AO\": return \"Angola\";\n case \"AI\": return \"Anguilla\";\n case \"AQ\": return \"Antarctica\";\n case \"AG\": return \"Antigua and Barbuda\";\n case \"AR\": return \"Argentina\";\n case \"AM\": return \"Armenia\";\n case \"AW\": return \"Aruba\";\n case \"AU\": return \"Australia\";\n case \"AT\": return \"Austria\";\n case \"AZ\": return \"Azerbaijan\";\n case \"BS\": return \"Bahamas\";\n case \"BH\": return \"Bahrain\";\n case \"BD\": return \"Bangladesh\";\n case \"BB\": return \"Barbados\";\n case \"BY\": return \"Belarus\";\n case \"BE\": return \"Belgium\";\n case \"BZ\": return \"Belize\";\n case \"BJ\": return \"Benin\";\n case \"BM\": return \"Bermuda\";\n case \"BT\": return \"Bhutan\";\n case \"BO\": return \"Bolivia\";\n case \"BA\": return \"Bosnia and Herzegovina\";\n case \"BW\": return \"Botswana\";\n case \"BV\": return \"Bouvet Island\";\n case \"BR\": return \"Brazil\";\n case \"IO\": return \"British Indian Ocean Territory\";\n case \"BN\": return \"Brunei Darussalam\";\n case \"BG\": return \"Bulgaria\";\n case \"BF\": return \"Burkina Faso\";\n case \"BI\": return \"Burundi\";\n case \"KH\": return \"Cambodia\";\n case \"CM\": return \"Cameroon\";\n case \"CA\": return \"Canada\";\n case \"CV\": return \"Cape Verde\";\n case \"KY\": return \"Cayman Islands\";\n case \"CF\": return \"Central African Republic\";\n case \"TD\": return \"Chad\";\n case \"CL\": return \"Chile\";\n case \"CN\": return \"China\";\n case \"CX\": return \"Christmas Island\";\n case \"CC\": return \"Cocos (Keeling) Islands\";\n case \"CO\": return \"Colombia\";\n case \"KM\": return \"Comoros\";\n case \"CG\": return \"Congo\";\n case \"CD\": return \"Congo\";\n case \"CK\": return \"Cook Islands\";\n case \"CR\": return \"Costa Rica\";\n case \"CI\": return \"Cote d'Ivoire\";\n case \"HR\": return \"Croatia\";\n case \"CU\": return \"Cuba\";\n case \"CY\": return \"Cyprus\";\n case \"XC\": return \"Czechoslovakia\"; \n case \"CZ\": return \"Czech Republic\";\n case \"DK\": return \"Denmark\";\n case \"DJ\": return \"Djibouti\";\n case \"DM\": return \"Dominica\";\n case \"DO\": return \"Dominican Republic\";\n case \"XG\": return \"East Germany\"; \n case \"EC\": return \"Ecuador\";\n case \"EG\": return \"Egypt\";\n case \"SV\": return \"El Salvador\";\n case \"GQ\": return \"Equatorial Guinea\";\n case \"ER\": return \"Eritrea\";\n case \"EE\": return \"Estonia\";\n case \"ET\": return \"Ethiopia\";\n case \"XE\": return \"Europe\";\n case \"FK\": return \"Falkland Islands (Malvinas)\";\n case \"FO\": return \"Faroe Islands\";\n case \"FJ\": return \"Fiji\";\n case \"FI\": return \"Finland\";\n case \"FR\": return \"France\"; \n case \"GF\": return \"French Guiana\";\n case \"PF\": return \"French Polynesia\"; \n case \"TF\": return \"French Southern Territories\";\n case \"GA\": return \"Gabon\"; \n case \"GM\": return \"Gambia\";\n case \"GE\": return \"Georgia\"; \n case \"DE\": return \"Germany\";\n case \"GH\": return \"Ghana\"; \n case \"GI\": return \"Gibraltar\";\n case \"GR\": return \"Greece\";\n case \"GL\": return \"Greenland\";\n case \"GD\": return \"Grenada\";\n case \"GP\": return \"Guadeloupe\";\n case \"GU\": return \"Guam\";\n case \"GT\": return \"Guatemala\";\n case \"GG\": return \"Guernsey\";\n case \"GN\": return \"Guinea\";\n case \"GW\": return \"Guinea-Bissau\";\n case \"GY\": return \"Guyana\";\n case \"HT\": return \"Haiti\";\n case \"HM\": return \"Heard and Mc Donald Islands\";\n case \"HN\": return \"Honduras\";\n case \"HK\": return \"Hong Kong\";\n case \"HU\": return \"Hungary\";\n case \"IS\": return \"Iceland\";\n case \"IN\": return \"India\";\n case \"ID\": return \"Indonesia\";\n case \"IR\": return \"Iran\";\n case \"IQ\": return \"Iraq\";\n case \"IE\": return \"Ireland\";\n case \"IM\": return \"Isle of Man\";\n case \"IL\": return \"Israel\";\n case \"IT\": return \"Italy\";\n case \"JM\": return \"Jamaica\";\n case \"JP\": return \"Japan\";\n case \"JE\": return \"Jersey\";\n case \"JO\": return \"Jordan\";\n case \"KZ\": return \"Kazakhstan\";\n case \"KE\": return \"Kenya\";\n case \"KI\": return \"Kiribati\";\n case \"KP\": return \"Korea (North)\";\n case \"KR\": return \"Korea (South)\";\n case \"KW\": return \"Kuwait\";\n case \"KG\": return \"Kyrgyzstan\";\n case \"LA\": return \"Lao People's Democratic Republic\";\n case \"LV\": return \"Latvia\";\n case \"LB\": return \"Lebanon\"; \n case \"LS\": return \"Lesotho\";\n case \"LR\": return \"Liberia\";\n case \"LY\": return \"Libyan Arab Jamahiriya\";\n case \"LI\": return \"Liechtenstein\";\n case \"LT\": return \"Lithuania\";\n case \"LU\": return \"Luxembourg\";\n case \"MO\": return \"Macau\";\n case \"MK\": return \"Macedonia\";\n case \"MG\": return \"Madagascar\";\n case \"MW\": return \"Malawi\";\n case \"MY\": return \"Malaysia\";\n case \"MV\": return \"Maldives\";\n case \"ML\": return \"Mali\";\n case \"MT\": return \"Malta\";\n case \"MH\": return \"Marshall Islands\";\n case \"MQ\": return \"Martinique\";\n case \"MR\": return \"Mauritania\";\n case \"MU\": return \"Mauritius\";\n case \"YT\": return \"Mayotte\";\n case \"MX\": return \"Mexico\";\n case \"FM\": return \"Micronesia\";\n case \"MD\": return \"Moldova\";\n case \"MC\": return \"Monaco\";\n case \"MN\": return \"Mongolia\";\n case \"ME\": return \"Montenegro\";\n case \"MS\": return \"Montserrat\";\n case \"MA\": return \"Morocco\";\n case \"MZ\": return \"Mozambique\";\n case \"MM\": return \"Myanmar\";\n case \"NA\": return \"Namibia\";\n case \"NR\": return \"Nauru\";\n case \"NP\": return \"Nepal\";\n case \"NL\": return \"Netherlands\";\n case \"AN\": return \"Netherlands Antilles\";\n case \"NC\": return \"New Caledonia\";\n case \"NZ\": return \"New Zealand\";\n case \"NI\": return \"Nicaragua\";\n case \"NE\": return \"Niger\";\n case \"NG\": return \"Nigeria\";\n case \"NU\": return \"Niue\";\n case \"NF\": return \"Norfolk Island\";\n case \"MP\": return \"Northern Mariana Islands\";\n case \"NO\": return \"Norway\";\n case \"OM\": return \"Oman\";\n case \"PK\": return \"Pakistan\";\n case \"PW\": return \"Palau\";\n case \"PS\": return \"Palestinian Territory\";\n case \"PA\": return \"Panama\";\n case \"PG\": return \"Papua New Guinea\";\n case \"PY\": return \"Paraguay\";\n case \"PE\": return \"Peru\";\n case \"PH\": return \"Philippines\";\n case \"PN\": return \"Pitcairn\";\n case \"PL\": return \"Poland\";\n case \"PT\": return \"Portugal\";\n case \"PR\": return \"Puerto Rico\";\n case \"QA\": return \"Qatar\";\n case \"RE\": return \"Reunion\";\n case \"RO\": return \"Romania\";\n case \"RU\": return \"Russian Federation\";\n case \"RW\": return \"Rwanda\";\n case \"BL\": return \"Saint BarthÚlemy\";\n case \"SH\": return \"Saint Helena\";\n case \"KN\": return \"Saint Kitts and Nevis\";\n case \"LC\": return \"Saint Lucia\";\n case \"MF\": return \"Saint Martin\";\n case \"PM\": return \"Saint Pierre and Miquelon\";\n case \"VC\": return \"Saint Vincent and The Grenadines\";\n case \"WS\": return \"Samoa\";\n case \"SM\": return \"San Marino\";\n case \"ST\": return \"Sao Tome and Principe\";\n case \"SA\": return \"Saudi Arabia\";\n case \"SN\": return \"Senegal\";\n case \"RS\": return \"Serbia\";\n case \"CS\": return \"Serbia and Montenegro\";\n case \"SC\": return \"Seychelles\";\n case \"SL\": return \"Sierra Leone\";\n case \"SG\": return \"Singapore\";\n case \"SK\": return \"Slovakia\";\n case \"SI\": return \"Slovenia\";\n case \"SB\": return \"Solomon Islands\";\n case \"SO\": return \"Somalia\";\n case \"ZA\": return \"South Africa\";\n case \"GS\": return \"South Georgia and the South Sandwich Islands\";\n case \"SU\": return \"Soviet Union\"; \n case \"ES\": return \"Spain\";\n case \"LK\": return \"Sri Lanka\";\n case \"SD\": return \"Sudan\";\n case \"SR\": return \"Suriname\";\n case \"SJ\": return \"Svalbard and Jan Mayen\";\n case \"SZ\": return \"Swaziland\";\n case \"SE\": return \"Sweden\";\n case \"CH\": return \"Switzerland\";\n case \"SY\": return \"Syrian Arab Republic\";\n case \"TW\": return \"Taiwan\";\n case \"TJ\": return \"Tajikistan\";\n case \"TZ\": return \"Tanzania, United Republic of\";\n case \"TH\": return \"Thailand\";\n case \"TL\": return \"Timor-Leste\";\n case \"TG\": return \"Togo\";\n case \"TK\": return \"Tokelau\";\n case \"TO\": return \"Tonga\";\n case \"TT\": return \"Trinidad and Tobago\";\n case \"TN\": return \"Tunisia\";\n case \"TR\": return \"Turkey\";\n case \"TM\": return \"Turkmenistan\";\n case \"TC\": return \"Turks and Caicos Islands\";\n case \"TV\": return \"Tuvalu\";\n case \"UG\": return \"Uganda\";\n case \"UA\": return \"Ukraine\";\n case \"AE\": return \"United Arab Emirates\";\n case \"GB\": return \"United Kingdom\";\n case \"US\": return \"United States\";\n case \"UM\": return \"United States Minor Outlying Islands\";\n case \"XU\": return \"Unknown\";\n case \"UY\": return \"Uruguay\";\n case \"UZ\": return \"Uzbekistan\";\n case \"VU\": return \"Vanuatu\";\n case \"VA\": return \"Vatican City State\";\n case \"VE\": return \"Venezuela\";\n case \"VN\": return \"Viet Nam\";\n case \"VG\": return \"Virgin Islands, British\";\n case \"VI\": return \"Virgin Islands, U.S.\";\n case \"WF\": return \"Wallis and Futuna Islands\";\n case \"EH\": return \"Western Sahara\";\n case \"XW\": return \"Worldwide\";\n case \"YE\": return \"Yemen\";\n case \"YU\": return \"Yugoslavia\"; \n case \"ZM\": return \"Zambia\";\n case \"ZW\": return \"Zimbabwe\";\n }\n}", "title": "" }, { "docid": "be3dc0357c1a8c7aa895d039d27dd266", "score": "0.6023484", "text": "function getCountry(code) {\n switch(code.toUpperCase()) {\n case 'AF': return 'Afghanistan';\n case 'AX': return 'Aland Islands';\n case 'AL': return 'Albania';\n case 'DZ': return 'Algeria';\n case 'AS': return 'American Samoa';\n case 'AD': return 'Andorra';\n case 'AO': return 'Angola';\n case 'AI': return 'Anguilla';\n case 'AQ': return 'Antarctica';\n case 'AG': return 'Antigua and Barbuda';\n case 'AR': return 'Argentina';\n case 'AM': return 'Armenia';\n case 'AW': return 'Aruba';\n case 'AU': return 'Australia';\n case 'AT': return 'Austria';\n case 'AZ': return 'Azerbaijan';\n case 'BS': return 'Bahamas, The';\n case 'BH': return 'Bahrain';\n case 'BD': return 'Bangladesh';\n case 'BB': return 'Barbados';\n case 'BY': return 'Belarus';\n case 'BE': return 'Belgium';\n case 'BZ': return 'Belize';\n case 'BJ': return 'Benin';\n case 'BM': return 'Bermuda';\n case 'BT': return 'Bhutan';\n case 'BO': return 'Bolivia';\n case 'BQ': return 'Bonaire, Saint Eustatius and Saba';\n case 'BA': return 'Bosnia and Herzegovina';\n case 'BW': return 'Botswana';\n case 'BV': return 'Bouvet Island';\n case 'BR': return 'Brazil';\n case 'IO': return 'British Indian Ocean Territory';\n case 'BN': return 'Brunei Darussalam';\n case 'BG': return 'Bulgaria';\n case 'BF': return 'Burkina Faso';\n case 'BI': return 'Burundi';\n case 'KH': return 'Cambodia';\n case 'CM': return 'Cameroon';\n case 'CA': return 'Canada';\n case 'CV': return 'Cape Verde';\n case 'KY': return 'Cayman Islands';\n case 'CF': return 'Central African Republic';\n case 'TD': return 'Chad';\n case 'CL': return 'Chile';\n case 'CN': return 'China';\n case 'CX': return 'Christmas Island';\n case 'CC': return 'Cocos (Keeling) Islands';\n case 'CO': return 'Colombia';\n case 'KM': return 'Comoros';\n case 'CG': return 'Congo';\n case 'CD': return 'Congo, The Democratic Republic of the';\n case 'CK': return 'Cook Islands';\n case 'CR': return 'Costa Rica';\n case 'CI': return 'Cote D\\'ivoire';\n case 'HR': return 'Croatia';\n case 'CW': return 'Curaçao';\n case 'CY': return 'Cyprus';\n case 'CZ': return 'Czech Republic';\n case 'DK': return 'Denmark';\n case 'DJ': return 'Djibouti';\n case 'DM': return 'Dominica';\n case 'DO': return 'Dominican Republic';\n case 'EC': return 'Ecuador';\n case 'EG': return 'Egypt';\n case 'SV': return 'El Salvador';\n case 'GQ': return 'Equatorial Guinea';\n case 'ER': return 'Eritrea';\n case 'EE': return 'Estonia';\n case 'ET': return 'Ethiopia';\n case 'FK': return 'Falkland Islands (Malvinas)';\n case 'FO': return 'Faroe Islands';\n case 'FJ': return 'Fiji';\n case 'FI': return 'Finland';\n case 'FR': return 'France';\n case 'GF': return 'French Guiana';\n case 'PF': return 'French Polynesia';\n case 'TF': return 'French Southern Territories';\n case 'GA': return 'Gabon';\n case 'GM': return 'Gambia, The';\n case 'GE': return 'Georgia';\n case 'DE': return 'Germany';\n case 'GH': return 'Ghana';\n case 'GI': return 'Gibraltar';\n case 'GR': return 'Greece';\n case 'GL': return 'Greenland';\n case 'GD': return 'Grenada';\n case 'GP': return 'Guadeloupe';\n case 'GU': return 'Guam';\n case 'GT': return 'Guatemala';\n case 'GG': return 'Guernsey';\n case 'GN': return 'Guinea';\n case 'GW': return 'Guinea-Bissau';\n case 'GY': return 'Guyana';\n case 'HT': return 'Haiti';\n case 'HM': return 'Heard Island and the McDonald Islands';\n case 'VA': return 'Holy See';\n case 'HN': return 'Honduras';\n case 'HK': return 'Hong Kong';\n case 'HU': return 'Hungary';\n case 'IS': return 'Iceland';\n case 'IN': return 'India';\n case 'ID': return 'Indonesia';\n case 'IQ': return 'Iraq';\n case 'IE': return 'Ireland';\n case 'IM': return 'Isle of Man';\n case 'IL': return 'Israel';\n case 'IT': return 'Italy';\n case 'JM': return 'Jamaica';\n case 'JP': return 'Japan';\n case 'JE': return 'Jersey';\n case 'JO': return 'Jordan';\n case 'KZ': return 'Kazakhstan';\n case 'KE': return 'Kenya';\n case 'KI': return 'Kiribati';\n case 'KR': return 'Korea, Republic of';\n case 'KW': return 'Kuwait';\n case 'KG': return 'Kyrgyzstan';\n case 'LA': return 'Lao People\\'s Democratic Republic';\n case 'LV': return 'Latvia';\n case 'LB': return 'Lebanon';\n case 'LS': return 'Lesotho';\n case 'LR': return 'Liberia';\n case 'LY': return 'Libya';\n case 'LI': return 'Liechtenstein';\n case 'LT': return 'Lithuania';\n case 'LU': return 'Luxembourg';\n case 'MO': return 'Macao';\n case 'MK': return 'Macedonia, The Former Yugoslav Republic of';\n case 'MG': return 'Madagascar';\n case 'MW': return 'Malawi';\n case 'MY': return 'Malaysia';\n case 'MV': return 'Maldives';\n case 'ML': return 'Mali';\n case 'MT': return 'Malta';\n case 'MH': return 'Marshall Islands';\n case 'MQ': return 'Martinique';\n case 'MR': return 'Mauritania';\n case 'MU': return 'Mauritius';\n case 'YT': return 'Mayotte';\n case 'MX': return 'Mexico';\n case 'FM': return 'Micronesia, Federated States of';\n case 'MD': return 'Moldova, Republic of';\n case 'MC': return 'Monaco';\n case 'MN': return 'Mongolia';\n case 'ME': return 'Montenegro';\n case 'MS': return 'Montserrat';\n case 'MA': return 'Morocco';\n case 'MZ': return 'Mozambique';\n case 'MM': return 'Myanmar';\n case 'NA': return 'Namibia';\n case 'NR': return 'Nauru';\n case 'NP': return 'Nepal';\n case 'NL': return 'Netherlands';\n case 'AN': return 'Netherlands Antilles';\n case 'NC': return 'New Caledonia';\n case 'NZ': return 'New Zealand';\n case 'NI': return 'Nicaragua';\n case 'NE': return 'Niger';\n case 'NG': return 'Nigeria';\n case 'NU': return 'Niue';\n case 'NF': return 'Norfolk Island';\n case 'MP': return 'Northern Mariana Islands';\n case 'NO': return 'Norway';\n case 'OM': return 'Oman';\n case 'PK': return 'Pakistan';\n case 'PW': return 'Palau';\n case 'PS': return 'Palestinian Territories';\n case 'PA': return 'Panama';\n case 'PG': return 'Papua New Guinea';\n case 'PY': return 'Paraguay';\n case 'PE': return 'Peru';\n case 'PH': return 'Philippines';\n case 'PN': return 'Pitcairn';\n case 'PL': return 'Poland';\n case 'PT': return 'Portugal';\n case 'PR': return 'Puerto Rico';\n case 'QA': return 'Qatar';\n case 'RE': return 'Reunion';\n case 'RO': return 'Romania';\n case 'RU': return 'Russian Federation';\n case 'RW': return 'Rwanda';\n case 'BL': return 'Saint Barthelemy';\n case 'SH': return 'Saint Helena, Ascension and Tristan da Cunha';\n case 'KN': return 'Saint Kitts and Nevis';\n case 'LC': return 'Saint Lucia';\n case 'MF': return 'Saint Martin';\n case 'PM': return 'Saint Pierre and Miquelon';\n case 'VC': return 'Saint Vincent and the Grenadines';\n case 'WS': return 'Samoa';\n case 'SM': return 'San Marino';\n case 'ST': return 'Sao Tome and Principe';\n case 'SA': return 'Saudi Arabia';\n case 'SN': return 'Senegal';\n case 'RS': return 'Serbia';\n case 'SC': return 'Seychelles';\n case 'SL': return 'Sierra Leone';\n case 'SG': return 'Singapore';\n case 'SX': return 'Sint Maarten';\n case 'SK': return 'Slovakia';\n case 'SI': return 'Slovenia';\n case 'SB': return 'Solomon Islands';\n case 'SO': return 'Somalia';\n case 'ZA': return 'South Africa';\n case 'GS': return 'South Georgia and the South Sandwich Islands';\n case 'ES': return 'Spain';\n case 'LK': return 'Sri Lanka';\n case 'SR': return 'Suriname';\n case 'SJ': return 'Svalbard and Jan Mayen';\n case 'SZ': return 'Swaziland';\n case 'SE': return 'Sweden';\n case 'CH': return 'Switzerland';\n case 'TW': return 'Taiwan';\n case 'TJ': return 'Tajikistan';\n case 'TZ': return 'Tanzania, United Republic of';\n case 'TH': return 'Thailand';\n case 'TL': return 'Timor-leste';\n case 'TG': return 'Togo';\n case 'TK': return 'Tokelau';\n case 'TO': return 'Tonga';\n case 'TT': return 'Trinidad and Tobago';\n case 'TN': return 'Tunisia';\n case 'TR': return 'Turkey';\n case 'TM': return 'Turkmenistan';\n case 'TC': return 'Turks and Caicos Islands';\n case 'TV': return 'Tuvalu';\n case 'UG': return 'Uganda';\n case 'UA': return 'Ukraine';\n case 'AE': return 'United Arab Emirates';\n case 'GB': return 'United Kingdom';\n case 'US': return 'United States';\n case 'UM': return 'United States Minor Outlying Islands';\n case 'UY': return 'Uruguay';\n case 'UZ': return 'Uzbekistan';\n case 'VU': return 'Vanuatu';\n case 'VE': return 'Venezuela';\n case 'VN': return 'Vietnam';\n case 'VG': return 'Virgin Islands, British';\n case 'VI': return 'Virgin Islands, U.S.';\n case 'WF': return 'Wallis and Futuna';\n case 'EH': return 'Western Sahara';\n case 'YE': return 'Yemen';\n case 'ZM': return 'Zambia';\n case 'ZW': return 'Zimbabwe';\n default: return 'Unknown';\n }\n}", "title": "" }, { "docid": "a67863a71eb3fb56e3c6af031b99a4a4", "score": "0.60113376", "text": "function resolveCountryNames(dataArr) {\n\tdataArr.forEach(collection => {\n\t\tcollection.forEach(d => {\n\t\t\tswitch (d['country']) {\n\t\t\t\tcase 'Bahamas, The' : d['country'] = 'Bahamas'; break;\n\t\t\t\tcase 'Czech Republic' : d['country'] = 'Czechia'; break;\n\t\t\t\tcase 'Slovak Republic' : d['country'] = 'Slovakia'; break;\n\t\t\t\tcase 'Egypt, Arab Rep.' : d['country'] = 'Egypt'; break;\n\t\t\t\tcase 'Iran, Islamic Rep.' : d['country'] = 'Iran'; break;\n\t\t\t\tcase 'Russian Federation' : d['country'] = 'Russia'; break;\n\t\t\t\tcase 'Kyrgyz Republic' : d['country'] = 'Kyrgyzstan'; break;\n\t\t\t\tcase 'Korea, Rep.' : d['country'] = 'South Korea'; break;\n\t\t\t\tcase 'Korea, Dem. People’s Rep.' : d['country'] = 'North Korea'; break;\n\t\t\t\tcase 'Lao PDR' : d['country'] = 'Laos'; break;\n\t\t\t\tcase 'Yemen, Rep.' : d['country'] = 'Yemen'; break;\n\t\t\t\tcase 'South Sudan' : d['country'] = 'S. Sudan'; break;\n\t\t\t\tcase 'Congo, Dem. Rep.' : d['country'] = 'Dem. Rep. Congo'; break;\n\t\t\t\tcase 'Congo, Rep.' : d['country'] = 'Congo'; break;\n\t\t\t\tcase 'Central African Republic' : d['country'] = 'Central African Rep.'; break;\n\t\t\t\tcase 'Cote d\\'Ivoire' : d['country'] = 'Côte d\\'Ivoire'; break;\n\t\t\t\tcase 'Syrian Arab Republic' : d['country'] = 'Syria'; break;\n\t\t\t\tcase 'Bosnia and Herzegovina' : d['country'] = 'Bosnia and Herz.'; break;\n\t\t\t\tcase 'Faroe Islands' : d['country'] = 'Faeroe Is.'; break;\n\t\t\t\tcase 'Dominican Republic' : d['country'] = 'Dominican Rep.'; break;\n\t\t\t\tcase 'Venezuela, RB' : d['country'] = 'Venezuela'; break;\n\t\t\t\tcase 'United States' : d['country'] = 'United States of America'; break;\n\t\t\t}\n\t\t})\n\t});\n}", "title": "" }, { "docid": "9cc99959e57758f802295d7b8c52d97d", "score": "0.6000015", "text": "function searchCountriesByInitials() {\n const searchKey = searchBox.value; /*THE BOX WHERE THE USER INPUTS VALUE*/\n\n const searchResult = countries.filter(element => {\n return element.toUpperCase().startsWith(searchKey.toUpperCase());\n });\n return searchResult;\n}", "title": "" }, { "docid": "d23d45bd49ceb12023d44049e5fef76d", "score": "0.59803015", "text": "function getCountries(){\n console.log(\"getting countries\");\n let url = PREFIX + \"api.airvisual.com/v2/countries?key=\" + API_KEY;\n \n $.ajax({\n dataType: \"json\", \n url: url,\n data: null,\n success: jsonCountries,\n error: noData\n });\n }", "title": "" }, { "docid": "6e3ada90c07b4adc8bf4a51d36172ea8", "score": "0.59777385", "text": "function countryCheck() {\n $.getJSON('https://ipinfo.io/json', function (data) {\n countryAbbr = data.country;\n if (countryAbbr != \"US\") {\n gdprCheck();\n }\n });\n}", "title": "" }, { "docid": "984b3aed76ca8fbef88557560ce777ee", "score": "0.5974805", "text": "function getCountry() {\n //Alternative ips are Singtel primary , secondary and finally Google's dns\n return iplocate(ip || '165.21.83.88' || '165.21.100.88' || '8.8.8.8')\n}", "title": "" }, { "docid": "cf8baa5421cd2f1916862b766f1bfb89", "score": "0.5964232", "text": "function getCountries(){\n\n var countriesUrl=\"https://api.geonames.org/searchJSON?country=KH&country=VN&country=MM&country=LA&country=PH&country=TH&country=MY&style=SHORT&featureClass=A&featureCode=PCLI&username=blomster\"\n var deferred = $q.defer();\n $http.get(countriesUrl).success(function(countryData){\n deferred.resolve(countryData);\n }).error(function(errorMessage){\n deferred.reject(errorMessage);\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "769291ac34ae72c32f76841c00752f4c", "score": "0.5953275", "text": "function filterCountry(text) {\n console.log(text);\n\n //Used to index through the countries\n var i;\n\n //Empty cities to display\n citiesToDisplay = [];\n\n for(i = 0; i < cities.length; i++) {\n //If the country contains the text\n if(cities[i].country.includes(text)) {\n //Add it to the cities to be displayed\n citiesToDisplay.push(cities[i]);\n }\n }\n changeTable();\n\n }", "title": "" }, { "docid": "a529779cc4b83651e96fe617b6a4c16e", "score": "0.59382045", "text": "function country2(cnt, n) {\n\t\t\t var sel = $('select.countryChoice')[0];\n\t\t\t for(var i = 0, l = cnt.length; i < l; i++) {\n\t\t\t if(cnt[i].id == n) {return cnt[i];}\n\t\t\t }\n\t\t\t}", "title": "" }, { "docid": "1834594631a465d2e451cf55214e73f8", "score": "0.58878404", "text": "function loadCountries(){\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", urlAPI +\"/Countries\", false);\n\txhr.send();\n\n\treturn JSON.parse(xhr.responseText);\n}", "title": "" }, { "docid": "fd036d69217d92d7002987a82bec6bf7", "score": "0.5886141", "text": "function getCountryCode(country) {\n for (let i = 0; i < countryList.length; i++) {\n if (countryList[i]['snippet'].name.toLowerCase() == country.toLowerCase())\n return countryList[i]['snippet'].gl;\n }\n}", "title": "" }, { "docid": "7aff808754cdc679d5329506aa0858b7", "score": "0.588293", "text": "function getFirstTenCountries() {}", "title": "" }, { "docid": "47087c459f83a6ead3e820842ffc72a4", "score": "0.5870241", "text": "function getCountries(allData){\n let countries = new Set();\n allData.forEach(partner => countries.add(partner.country));\n return countries;\n }", "title": "" }, { "docid": "a90f7c88ebd21332304a5e11bb1e9010", "score": "0.5867086", "text": "function getDataCountry(ip) {\n\t\t\t\t$.getJSON(`https://ipapi.co/${ip}/json/`)\n\t\t\t\t.done(sendCountry)\n\t\t\t\t.fail(sendError)\n\t\t\t}", "title": "" }, { "docid": "6ada781802400f6ab775ce72326c43cf", "score": "0.58485526", "text": "function country() {\r\n\tindex = countryName.map(x => x.code).indexOf(this.id);\r\n\t//console.log(this.id);\r\n\tgetCountry();\r\n}", "title": "" }, { "docid": "224be8be64c18a4fb49dddf95447116c", "score": "0.58290476", "text": "countrySearch( context, country ) {\n\t\t\treturn fetch( `/api/countries/${country}/search`, {\n\t\t\t\theaders: {\n\t\t\t\t\t'X-Requested-With': 'XMLHttpRequest',\n\t\t\t\t\t'X-CSRF-token': window.token,\n\t\t\t\t\t'Accept': 'application/json'\n\t\t\t\t}\n\t\t\t})\n\t\t\t\t.then( response => response.json() )\n\t\t\t\t.then( response => context.commit( 'countrySearch', response ) )\n\t\t\t\t.catch( error => console.error( 'countrySearch', error ) );\n\t\t}", "title": "" }, { "docid": "4a45984583e5351c019528bcc6d63ce9", "score": "0.5808443", "text": "function arrCountryName(res){\n const arrCountry = [];\n for(const country of res){ arrCountry.push(country.countryRegion)}\n const newCountry = arrCountry.filter((countries, i) => arrCountry.indexOf(countries) === i);\n return newCountry;\n}", "title": "" }, { "docid": "51c4753cc973fc9e7573e168005db242", "score": "0.58036584", "text": "function getDataByCountry(response) {\n flag = 2; //need to set to filter out Contry Data\n\n let i; //to go through JSON object\n let countryName = document.getElementById(\"c-dropdown\").value;\n\n for (i = 0; i < response[\"Countries\"].length; i++) {\n if (response[\"Countries\"][i][\"Country\"] === countryName)\n break;\n }\n\n let myObj = response[\"Countries\"][i];\n filterOutData(myObj);\n}", "title": "" }, { "docid": "30f859bee77e5007152b6a7e382dc801", "score": "0.5802728", "text": "function findByCountryName(name) {\n return COUNTRIES.find((country) => country.name === name.trim());\n}", "title": "" }, { "docid": "66d5408a785a42ba4da802251311aba0", "score": "0.5799276", "text": "function identifyCountries(message) {\n var countries = [];\n if (message.match(/colombia/i)) {\n countries.push(\"Colombia\")\n }\n if (message.match(/uruguay/i)) {\n countries.push(\"Uruguay\")\n }\n if (message.match(/estados unidos/i) || message.match(/ usa/i)) {\n countries.push(\"Estados Unidos\")\n }\n if (message.match(/paraguay/i)) {\n countries.push(\"Paraguay\")\n }\n if (message.match(/hait[íi]/i)) {\n countries.push(\"Haití\")\n }\n if (message.match(/per[uú]/i)) {\n countries.push(\"Perú\")\n }\n if (message.match(/brasil/i)) {\n countries.push(\"Brasil\")\n }\n if (message.match(/ecuador/i)) {\n countries.push(\"Ecuador\")\n }\n if (message.match(/jamaica/i)) {\n countries.push(\"Jamaica\")\n }\n if (message.match(/venezuela/i)) {\n countries.push(\"Venezuela\")\n }\n if (message.match(/m[eé]xico/i)) {\n countries.push(\"México\")\n }\n if (message.match(/panam[áa]/i)) {\n countries.push(\"Panamá\")\n }\n if (message.match(/bolivia/i)) {\n countries.push(\"Bolivia\")\n }\n if (message.match(/argentina/i)) {\n countries.push(\"Argentina\")\n }\n if (message.match(/chile/i)) {\n countries.push(\"Chile\")\n }\n if (message.match(/costa rica/i)) {\n countries.push(\"Costa Rica\")\n }\n\n return countries\n}", "title": "" }, { "docid": "a132d892ab1fc597603b5391ac7b6d78", "score": "0.5782882", "text": "function filterLocations(locations) {\n //Declare function variables\n var index, countries = [];\n //Filter and get countries from returned available Twitter trend locations\n for (index = 0; index < locations.length; index++) {\n if (locations[index].placeType.name === \"Country\") {\n countries.push(locations[index]);\n }\n }\n compareCountries(countries);\n }", "title": "" }, { "docid": "fb9f61120aa321b1dcb39c811ce2f073", "score": "0.5756232", "text": "function _getCountries() {\n var deferred = $q.defer();\n $http.get('data/countries.json').success(function(result){\n deferred.resolve(result);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "956328bad55a2b41f6abcca216075eec", "score": "0.5745172", "text": "getCountriesDictContent (testers) {\n return testers.reduce((prev, curr) => prev.includes(curr.country) ? prev : [...prev, curr.country], [])\n }", "title": "" }, { "docid": "d27a9d571c499e20c628ec585251cc74", "score": "0.57448506", "text": "function get_available_country_index( country ) {\n\t\t\tvar index = -1;\n\t\t\t$.each( available_countries, function( key, value ) {\n\t\t\t\tif ( country == value.domain ) {\n\t\t\t\t\tindex = key;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn index;\n\t\t}", "title": "" }, { "docid": "f609f5a7f48c086ea232c91964c9a5f5", "score": "0.5724244", "text": "getAllCountries(db){\n return db\n .distinct()\n .from('data')\n .pluck('country');\n }", "title": "" }, { "docid": "53ccb123f84536f492ddabac8c835b13", "score": "0.5718111", "text": "static excercise2(input) {\n return input\n .filter(country => country.region) // .filter(({region})) => region === \"Europe\"\n .map(country => country.name);\n }", "title": "" }, { "docid": "62e2a27118938a5d72a8687860b653b7", "score": "0.5715193", "text": "function filterCountries(arr) {\n\t// create a new array\n\tconst filtered = []\n\t// iterate over countries\n\tfor (let i = 0; i < arr.length; i++) {\n\t\t// check if the country starts with 'u'\n\t\tif (arr[i][0] === 'u') {\n\t\t\t// if yes then we add it to filtered\n\t\t\tfiltered.push(arr[i])\n\t\t}\n\t}\n\treturn filtered\n}", "title": "" }, { "docid": "25f1bd6b1c256ebe7355fe0fe293a7b5", "score": "0.5692035", "text": "function categorizeCountries(arr) {\n let newArray = arr.reduce(function (newArray, curr) {\n if (\n curr.includes('land') ||\n curr.includes('ia') ||\n curr.includes('island') ||\n curr.includes('stan') ||\n curr.includes('Land')\n ) {\n newArray.push(curr);\n }\n return newArray;\n }, []);\n return newArray;\n}", "title": "" }, { "docid": "e0200fadb9c35d73be0d2880a0a96f4c", "score": "0.56820774", "text": "function filterDisputedCountries (id) {\n return id.match(/^[A-Z][A-Z][A-Z]$/);\n }", "title": "" }, { "docid": "a4de092f96c25e6282dc3ad25a899885", "score": "0.5679619", "text": "function findByCountryId(id) {\n return COUNTRIES.find((country) => country.id === id);\n}", "title": "" }, { "docid": "ae0a0a413b2dfe5b80f86ac9c8116eff", "score": "0.56761605", "text": "function matchCampaignCountries (targetedCountries, adExchangeCountry){\n\tvar campaignCountries = [];\n \tvar currentCountries = targetedCountries.toString().split(',');\n \tfor (var index in currentCountries){\n \t\tif (currentCountries[index].toString() == adExchangeCountry.toString()){\n //console.log(\"Found Campaign with TargetedCountries::\" + currentCountries[index]);\n \t\t\treturn true;\n \t\t}\n \t}\n \t\n \treturn false;\n}", "title": "" }, { "docid": "39c06372e6539afd08f58943e0fd69a2", "score": "0.5662833", "text": "function isEuCountryCode(twoCharCountryCode) {\n var twoCharCountryCode = twoCharCountryCode || Drupal.settings.tesla.country;\n twoCharCountryCode = twoCharCountryCode.toUpperCase();\n\n var regions_by_country = {\n \"AD\": \"OT\",\n \"AE\": \"ME\",\n \"AF\": \"OT\",\n \"AG\": \"OT\",\n \"AI\": \"OT\",\n \"AL\": \"OT\",\n \"AM\": \"OT\",\n \"AN\": \"OT\",\n \"AO\": \"OT\",\n \"AQ\": \"OT\",\n \"AR\": \"OT\",\n \"AS\": \"OT\",\n \"AT\": \"EU\",\n \"AU\": \"AU\",\n \"AW\": \"OT\",\n \"AZ\": \"OT\",\n \"BA\": \"OT\",\n \"BB\": \"OT\",\n \"BD\": \"OT\",\n \"BE\": \"EU\",\n \"BF\": \"OT\",\n \"BG\": \"EU\",\n \"BH\": \"OT\",\n \"BI\": \"OT\",\n \"BJ\": \"OT\",\n \"BM\": \"OT\",\n \"BN\": \"OT\",\n \"BO\": \"OT\",\n \"BR\": \"OT\",\n \"BS\": \"OT\",\n \"BT\": \"OT\",\n \"BV\": \"OT\",\n \"BW\": \"OT\",\n \"BY\": \"OT\",\n \"BZ\": \"OT\",\n \"CA\": \"CA\",\n \"CC\": \"OT\",\n \"CD\": \"OT\",\n \"CF\": \"OT\",\n \"CG\": \"OT\",\n \"CH\": \"EU\",\n \"CI\": \"OT\",\n \"CK\": \"OT\",\n \"CL\": \"OT\",\n \"CM\": \"OT\",\n \"CN\": \"OT\",\n \"CO\": \"OT\",\n \"CR\": \"OT\",\n \"CU\": \"OT\",\n \"CV\": \"OT\",\n \"CX\": \"OT\",\n \"CY\": \"EU\",\n \"CZ\": \"EU\",\n \"DE\": \"EU\",\n \"DJ\": \"OT\",\n \"DK\": \"EU\",\n \"DM\": \"OT\",\n \"DO\": \"OT\",\n \"DZ\": \"OT\",\n \"EC\": \"OT\",\n \"EE\": \"OT\",\n \"EG\": \"OT\",\n \"EH\": \"OT\",\n \"ER\": \"OT\",\n \"ES\": \"EU\",\n \"EU\": \"EU\",\n \"ET\": \"OT\",\n \"FI\": \"EU\",\n \"FJ\": \"OT\",\n \"FK\": \"OT\",\n \"FM\": \"OT\",\n \"FO\": \"OT\",\n \"FR\": \"EU\",\n \"GA\": \"OT\",\n \"GB\": \"GB\",\n \"GD\": \"OT\",\n \"GE\": \"OT\",\n \"GF\": \"OT\",\n \"GH\": \"OT\",\n \"GI\": \"OT\",\n \"GL\": \"OT\",\n \"GM\": \"OT\",\n \"GN\": \"OT\",\n \"GP\": \"OT\",\n \"GQ\": \"OT\",\n \"GR\": \"EU\",\n \"GS\": \"OT\",\n \"GT\": \"OT\",\n \"GU\": \"OT\",\n \"GW\": \"OT\",\n \"GY\": \"OT\",\n \"HK\": \"HK\",\n \"HM\": \"OT\",\n \"HN\": \"OT\",\n \"HR\": \"EU\",\n \"HT\": \"OT\",\n \"HU\": \"EU\",\n \"ID\": \"OT\",\n \"IE\": \"EU\",\n \"IL\": \"OT\",\n \"IN\": \"OT\",\n \"IO\": \"OT\",\n \"IQ\": \"OT\",\n \"IR\": \"OT\",\n \"IS\": \"EU\",\n \"IT\": \"EU\",\n \"JM\": \"OT\",\n \"JO\": \"ME\",\n \"JP\": \"JP\",\n \"KE\": \"OT\",\n \"KG\": \"OT\",\n \"KH\": \"OT\",\n \"KI\": \"OT\",\n \"KM\": \"OT\",\n \"KN\": \"OT\",\n \"KP\": \"OT\",\n \"KR\": \"KR\",\n \"KW\": \"OT\",\n \"KY\": \"OT\",\n \"KZ\": \"OT\",\n \"LA\": \"OT\",\n \"LB\": \"OT\",\n \"LC\": \"OT\",\n \"LI\": \"EU\",\n \"LK\": \"OT\",\n \"LR\": \"OT\",\n \"LS\": \"OT\",\n \"LT\": \"OT\",\n \"LU\": \"EU\",\n \"LV\": \"OT\",\n \"LY\": \"OT\",\n \"MA\": \"OT\",\n \"MC\": \"EU\",\n \"MD\": \"OT\",\n \"ME\": \"OT\",\n \"MG\": \"OT\",\n \"MH\": \"OT\",\n \"MK\": \"OT\",\n \"ML\": \"OT\",\n \"MM\": \"OT\",\n \"MN\": \"OT\",\n \"MO\": \"MO\",\n \"MP\": \"OT\",\n \"MQ\": \"OT\",\n \"MR\": \"OT\",\n \"MS\": \"OT\",\n \"MT\": \"EU\",\n \"MU\": \"OT\",\n \"MV\": \"OT\",\n \"MW\": \"OT\",\n \"MX\": \"OT\",\n \"MY\": \"OT\",\n \"MZ\": \"OT\",\n \"NA\": \"OT\",\n \"NC\": \"OT\",\n \"NE\": \"OT\",\n \"NF\": \"OT\",\n \"NG\": \"OT\",\n \"NI\": \"OT\",\n \"NL\": \"EU\",\n \"NO\": \"EU\",\n \"NP\": \"OT\",\n \"NR\": \"OT\",\n \"NU\": \"OT\",\n \"NZ\": \"NZ\",\n \"OM\": \"OT\",\n \"PA\": \"OT\",\n \"PE\": \"OT\",\n \"PF\": \"OT\",\n \"PG\": \"OT\",\n \"PH\": \"OT\",\n \"PK\": \"OT\",\n \"PL\": \"OT\",\n \"PM\": \"OT\",\n \"PN\": \"OT\",\n \"PR\": \"OT\",\n \"PS\": \"OT\",\n \"PT\": \"EU\",\n \"PW\": \"OT\",\n \"PY\": \"OT\",\n \"QA\": \"OT\",\n \"RE\": \"OT\",\n \"RO\": \"OT\",\n \"RS\": \"OT\",\n \"RU\": \"OT\",\n \"RW\": \"OT\",\n \"SA\": \"OT\",\n \"SB\": \"OT\",\n \"SC\": \"OT\",\n \"SD\": \"OT\",\n \"SE\": \"EU\",\n \"SG\": \"OT\",\n \"SH\": \"OT\",\n \"SI\": \"OT\",\n \"SJ\": \"OT\",\n \"SK\": \"OT\",\n \"SL\": \"OT\",\n \"SM\": \"OT\",\n \"SN\": \"OT\",\n \"SO\": \"OT\",\n \"SR\": \"OT\",\n \"ST\": \"OT\",\n \"SV\": \"OT\",\n \"SY\": \"OT\",\n \"SZ\": \"OT\",\n \"TC\": \"OT\",\n \"TD\": \"OT\",\n \"TF\": \"OT\",\n \"TG\": \"OT\",\n \"TH\": \"OT\",\n \"TJ\": \"OT\",\n \"TK\": \"OT\",\n \"TL\": \"OT\",\n \"TM\": \"OT\",\n \"TN\": \"OT\",\n \"TO\": \"OT\",\n \"TR\": \"OT\",\n \"TT\": \"OT\",\n \"TV\": \"OT\",\n \"TW\": \"TW\",\n \"TZ\": \"OT\",\n \"UA\": \"OT\",\n \"UG\": \"OT\",\n \"UM\": \"OT\",\n \"US\": \"US\",\n \"UY\": \"OT\",\n \"UZ\": \"OT\",\n \"VA\": \"OT\",\n \"VC\": \"OT\",\n \"VE\": \"OT\",\n \"VG\": \"OT\",\n \"VI\": \"OT\",\n \"VN\": \"OT\",\n \"VU\": \"OT\",\n \"WF\": \"OT\",\n \"WS\": \"OT\",\n \"YE\": \"OT\",\n \"YT\": \"OT\",\n \"ZA\": \"OT\",\n \"ZM\": \"OT\",\n \"ZW\": \"OT\"\n };\n\n return regions_by_country[twoCharCountryCode] === \"EU\";\n}", "title": "" }, { "docid": "a1aca52ed955d298a3508eaa6107b090", "score": "0.56478256", "text": "function getAllCountries() {\n return new Promise((resolve, reject) => {\n connection.query('SELECT * from country', function (err, results) {\n if (err) {\n reject(err);\n } else {\n resolve(results)\n }\n })\n })\n}", "title": "" }, { "docid": "4aa8161092df36967ab6541ccddc7ce3", "score": "0.56460935", "text": "function searchContinents() {\n let continent_ = [];\n let counter = 0;\n for (let country in STATS_MODULE) {\n if (!continent_.includes(STATS_MODULE[country].continent) && STATS_MODULE[country].continent != null) {\n let newContinent = ' ';\n newContinent = STATS_MODULE[country].continent;\n continent_.push(newContinent);\n counter++;\n }\n }\n console.log('The life expectancy per continent: ');\n for (let counter = 0; counter < continent_.length; counter++) {\n if (continent_[counter] != 'Antarctica') {\n console.log(continent_[counter]);\n countriesLifeExpectancy(continent_[counter]);\n }\n }\n}", "title": "" }, { "docid": "9d3c33291e7b0c0e0f888f604b43a048", "score": "0.56377167", "text": "function guessUserCountry() {\n // maps from language to country\n const FALLBACK_COUNTRIES = { de: 'de', en: 'gb', fr: 'fr' };\n\n // see https://stackoverflow.com/a/52112155/3211062\n const navigator_lang =\n navigator.languages && navigator.languages.length\n ? navigator.languages[0]\n : navigator.language || navigator.browserLanguage;\n\n // taken from https://github.com/gagle/node-bcp47/blob/master/lib/index.js#L4\n const bcp47_regex = /^(?:(en-gb-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-be-fr|sgn-be-nl|sgn-ch-de)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))$|^((?:[a-z]{2,3}(?:(?:-[a-z]{3}){1,3})?)|[a-z]{4}|[a-z]{5,8})(?:-([a-z]{4}))?(?:-([a-z]{2}|\\d{3}))?((?:-(?:[\\da-z]{5,8}|\\d[\\da-z]{3}))*)?((?:-[\\da-wyz](?:-[\\da-z]{2,8})+)*)?(-x(?:-[\\da-z]{1,8})+)?$|^(x(?:-[\\da-z]{1,8})+)$/i;\n const bcp47_country = (bcp47_regex.exec(navigator_lang)[5] || '').toLowerCase();\n\n // If we cannot guess the user's country, it makes sense to fallback to the language.\n if (!navigator_lang || !bcp47_country) return FALLBACK_COUNTRIES[LOCALE];\n\n // If however we *can* guess the country but just don't support it, we show all companies.\n return SUPPORTED_COUNTRIES.includes(bcp47_country) ? bcp47_country : 'all';\n}", "title": "" }, { "docid": "97a8543d8e6c6b62cfa34b6c1cfe3c72", "score": "0.56294215", "text": "function getCountryFromStatus(desc) {\n if (desc.indexOf(\"United Kingdom\") > -1) return 'UK';\n if (desc.indexOf(\"Mexico\") > -1) return 'Mexico';\n if (desc.indexOf(\"Argentina\") > -1) return 'Argentina';\n if (desc.indexOf(\"Canada\") > -1) return 'Canada';\n if (desc.indexOf(\"Cayman\") > -1) return 'Caymans';\n if (desc.indexOf(\"Switzerland\") > -1) return 'Zurich';\n if (desc.indexOf(\"Japan\") > -1) return 'Japan';\n if (desc.indexOf(\"China\") > -1) return 'China';\n if (desc.indexOf(\"UAE\") > -1) return 'UAE'; // ???\n if (desc.indexOf(\"Arab\") > -1) return 'UAE'; // ???\n if (desc.indexOf(\"South\") > -1) return 'SA'; // ??\n if (desc.indexOf(\"Africa\") > -1) return 'SA'; // ??\n if (desc.indexOf(\"Hawaii\") > -1) return 'Hawaii';\n\n return null;\n }", "title": "" }, { "docid": "734b10008dcdcad6bb64b5663d2bd7bc", "score": "0.5616031", "text": "function countryInitials() {}", "title": "" }, { "docid": "1df411682add5e0304e28656abc2c0e2", "score": "0.56158787", "text": "function processLocation(country){\r\n for (let i = 0; i < data.length; i++) {\r\n // This loop check if the user's input is part of a country name\r\n if (data[i].englishShortName.toLowerCase().includes(country)) \r\n {\r\n // returns the object of the country to use country name and it's code.\r\n return data[i]; \r\n }\r\n }\r\n // if the user input invalid name - nothing returns.\r\n}", "title": "" }, { "docid": "945da3d222d890a801cd596bb05e365b", "score": "0.5611682", "text": "function showCountry(reply, app){}", "title": "" }, { "docid": "212d84f224ffadf0291b36213b0b85a5", "score": "0.55987304", "text": "function build_ft_countries_select() {\n let ft_countries_html = '<option selected>Add country</option>';\n for (const [index, country] of countries.entries()) {\n ft_countries_html += navigation.ft_countries.indexOf(country) == -1 ? `<option>${country}</option>` : '';\n }\n $('#ft_add_country').html(ft_countries_html);\n}", "title": "" }, { "docid": "0ea72d4ec7becf990f4a895789f15334", "score": "0.55976266", "text": "function getCountryCode(country) {\r\n country = country.replace(/\\s+/g, '').toLowerCase();\r\n for (var i = 0; i < country_codes.length; i++) {\r\n if (country_codes[i][2].replace(/\\s+/g, '').toLowerCase() == country) {\r\n return country_codes[i][0];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "fcaacf65651922b98bfabd32b70067af", "score": "0.55967546", "text": "async function listCountries() {\n let holidaysService = new HolidaysService(process.env.MICRO_API_TOKEN);\n let rsp = await holidaysService.countries({});\n console.log(rsp);\n}", "title": "" }, { "docid": "d310993997a7abf4c2285515085e8b8d", "score": "0.5593351", "text": "function countriesReceived() {\n let countries = JSON.parse(this.responseText);\n let list = document.querySelector(\"datalist[id=countries]\");\n list.innerHTML = \"\"; // Clean current countries\n\n // Add new suggestions\n for (let country in countries) {\n let item = document.createElement(\"option\");\n\t\titem.value = countries[country].name;\n list.appendChild(item);\n }\n}", "title": "" }, { "docid": "3f92671ead6493e358d15da27c17225d", "score": "0.5584776", "text": "async function getCountries(){\r\n const result = await axios.get('https://restcountries.eu/rest/v2/all');\r\n return result;\r\n}", "title": "" }, { "docid": "d0bc1903bea3cf0ef390671c1361a09e", "score": "0.55763763", "text": "function OktaviaSearch() {\n}", "title": "" }, { "docid": "18cbb253904dcb9fb13fd56d55092797", "score": "0.5570373", "text": "function getCountryCodes() {\n var offset = myOffset;\n var limit = maxLimit;\n $.ajax({\n url: \"https://restcountries.eu/rest/v2/all\",\n type: \"GET\",\n success: function (data) {\n console.log(data);\n console.log(\"country Code Count: \" + data.length);\n for (var i = 0; i < data.length; i++) {\n var countryObject = {\n name: \"\",\n code: \"\"\n };\n // only interested in the alpha 2 country code\n // for the webcams travel api\n countryObject.name = data[i].name;\n countryObject.code = data[i].alpha2Code;\n countryCodeObjectArray.push(countryObject);\n queryWebCamList(countryCodeObjectArray[i], offset, limit);\n }\n },\n error: function () {\n console.log(\"error getting country codes\");\n }\n });\n }", "title": "" }, { "docid": "6c3c22f54ed7901be58601309e985c3d", "score": "0.557006", "text": "function ajaxCountries(){\n\n $.ajax({\n cache: false,\n async: true,\n type: 'GET',\n url: 'https://restcountries.eu/rest/v1/all',\n success: handleData,\n error: errorHandle\n });\n }", "title": "" }, { "docid": "ad1ba7d3604e050a9da0fd4d09f1866c", "score": "0.55678445", "text": "async function getSameCurrencyCountries(){ \n let data = await fetch(`${apiData.apiUrl}currency/${iso.currencies[0].code}`)\n let countries = await data.json();\n countries.forEach(country =>{\n for (let i = 0; i < country.currencies.length; i++){\n page.ISODiv.innerHTML += `${country.name}: ${country.currencies[i].name}.<br>`\n }\n })\n }", "title": "" }, { "docid": "5a0385b5621db6d2a70734323e3dd0dd", "score": "0.5566348", "text": "async function getCountriesCases() {\n setCountries([]);\n\n let url = 'https://coronavirus-19-api.herokuapp.com/countries';\n\n await fetch(url)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n setCountries(data)\n })\n .catch(function (error) {\n console.error(\"Erro ao carregar os dados: \" + error.message);\n })\n }", "title": "" }, { "docid": "aa413eb08d1a16efe0afc6daef32762b", "score": "0.55607635", "text": "function printCountry() {\n\tfor (let field in countryListRaw){\n\t\tif (field === \"data\") {\n\t\t\tfor (let code in countryListRaw[field]) {\n\t\t\t\tif (countryListRaw[field][code].country.indexOf(' ') < 0) {\n\t\t\t\t\tcountryList.push(countryListRaw[field][code].country.toLowerCase());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tcountry = randomCountry();\n\tgenerateLetterButtons();\n}", "title": "" }, { "docid": "76faba30d31bbe439696d7c22b3a8f7f", "score": "0.55474716", "text": "function searchCountry() {\n let countryName = document.getElementById(\"country-input\").value;\n\n if (countryName) {\n document.querySelector(\".countries-list-container\").style.display = \"flex\";\n } else {\n document.querySelector(\".countries-list-container\").style.display = \"none\";\n }\n\n let oldIndex = []\n \n let countriesResult = covidData.filter((one, index) => {\n if (one[\"country\"].toLowerCase().includes(countryName.toLowerCase())) {\n oldIndex.push(index);\n return true;\n }\n })\n\n countriesResult.map((one, index) => {\n one[\"index\"] = oldIndex[index];\n })\n\n displayCovidVirusCountries(countriesResult);\n}", "title": "" }, { "docid": "4592985f8aa455406bf1ad02525f91ef", "score": "0.5544627", "text": "function compareCountries(a, b) {\n\tif(a.country < b.country) {\n\t\treturn -1;\n\t}\n\telse if(a.country > b.country) {\n\t\treturn 1;\n\t}\n\treturn 0;\t\n}", "title": "" }, { "docid": "a6f17ecafd138d9ba59e7e86990cb5d2", "score": "0.55323523", "text": "async function restcountriesAPI(country) {\n const baseUrl = \"https://restcountries.com\";\n const restcountriesURL = `${baseUrl}/v3/name/${country}`;\n data = await fetch(restcountriesURL).then((res) => res.json());\n return data;\n}", "title": "" }, { "docid": "616f6a0a9beaad21665e95e71c3c5bcc", "score": "0.5519347", "text": "async function getAllCountries() {\n try {\n const allCountriesURL = `https://api.airvisual.com/v2/countries?key=${API_KEY}`\n const response = await axios.get(allCountriesURL)\n const countriesList = response.data.data\n\n setCountryTags(countriesList)\n }\n catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "cfca0dfd38a5570943c2a13efe61c57e", "score": "0.55122346", "text": "function getCountries() {\n let countriesList = countries.length > 0\n && countries.map((item, i) => {\n return (\n <option key={i} value={item.value}>{item.label}</option>\n )\n }, this);\n\n setCountryType(countriesList);\n }", "title": "" }, { "docid": "39b4d7d8b2adb3901334164a3f49cb2a", "score": "0.5504163", "text": "function calcCountryKeys(data) {\n // more work to do if we want to filter this by a single country\n // becuase country can be a list, count will be incremented for other countries in that list \n // unless we trap that here\n var countryoption = d3.select(\"select#country\").node().value;\n\n var result = {};\n data.forEach(function(d) {\n // d.country can be a list of countries, so check for that, and split if so\n var names = d.fips.indexOf(\",\") ? d.fips.split(\",\") : [d.fips];\n names.forEach(function(fips){\n // trim whitespace\n if (fips == \"\") return;\n fips = fips.trim();\n \n // when country option is set, return if the fips doesn't match \n if (countryoption && fips != countryoption) return;\n\n // first time here, we need to set count to 0\n if (typeof result[fips] === \"undefined\") result[fips] = {\"count\": 0};\n result[fips][\"count\"] += 1;\n result[fips][\"name\"] = lookup[fips][\"name\"];\n result[fips][\"fips\"] = fips;\n result[fips][\"latitude\"] = lookup[fips][\"latitude\"];\n result[fips][\"longitude\"] = lookup[fips][\"longitude\"];\n }); \n });\n return result;\n}", "title": "" }, { "docid": "8172eba0c0f3a3697c4a96a15b43e834", "score": "0.5494347", "text": "function letterCountry(arr) {}", "title": "" }, { "docid": "d0f2ac1ab5ce811f36382ca3eb4efca6", "score": "0.54816633", "text": "static async getCountryData(country){\n let res = await this.request(`data/countries/${country}`);\n return res.data;\n }", "title": "" }, { "docid": "13ef7e81ae32e8cb9e80ee02d5e8ff33", "score": "0.5479647", "text": "getCountryIDofCountry() {\n let { country } = this.state;\n let countryID = '';\n if (country) {\n let { rawCountryList } = this.state;\n if (country) {\n for (let i = 0; i < rawCountryList.length; i++) {\n if (rawCountryList[i].Country_Name.toLowerCase() == country.toLowerCase()) {\n countryID = rawCountryList[i].Country_ID;\n break;\n }\n }\n }\n }\n return countryID;\n\n }", "title": "" }, { "docid": "42c641260d6374d479222fb970abfaa9", "score": "0.54718465", "text": "function checkAddressIsInUSA(pResults, type) {\n var lValidResult = null;\n \n $.each(pResults, function (pResultKey, pResultValue) {\n lValidResult = checkSingleAddressIsInUSA(pResultValue, type);\n\n\tif (lValidResult != null) {\n return;\n } // if\n }); // each\n\n return lValidResult;\n} // function checkAddressIsInUSA", "title": "" }, { "docid": "626a10e238ac35aa9bd36b7260016e1c", "score": "0.5466319", "text": "@computed get allCountries() {\n return this.countriesWithCities\n .map(c => c.country);\n }", "title": "" }, { "docid": "92c631bd2cbd7b426740110582d3511e", "score": "0.545579", "text": "function getCountry() {\n\t$.ajax({\n\t\turl: 'https://restcountries.eu/rest/v2/all?fields=name;callingCodes;flag',\n\t\ttype: 'GET',\n\t\tsuccess: function(data) {\n\t\t\tvar countryData = '';\n\t\t\t$.each(data, function(index, value) {\n\t\t\t\t//Get country data from API\n\t\t\t\t$('#uCountry').append(\n\t\t\t\t\t$('<option>', {\n\t\t\t\t\t\tvalue: value.name,\n\t\t\t\t\t\ttext: value.name\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t});\n\t\t},\n\n\t\terror: function(xhr, ajaxOptions, thrownError) {\n\t\t\tvar errorMsg = 'Ajax request failed: ' + xhr.responseText;\n\t\t\tconsole.log(errorMsg);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2678d9faccd196c986390b4331c582ab", "score": "0.545201", "text": "static async getCountriesData(){\n let res = await this.request('data/countries');\n return res.data;\n }", "title": "" }, { "docid": "aa14653e67bfc9ed742e827eaae39ccc", "score": "0.54436547", "text": "function filterByAulocation(data){\n return data.filter(function(al){\n var loc = al.location || '';\n return loc.toLowerCase().indexOf('australia') >= 0;\n });\n}", "title": "" }, { "docid": "7d7bd44d30c0964ab2e78e1c4c44691d", "score": "0.54435533", "text": "function getCountries (companyData) {\n let countries = new Set(\n companyData.features.map (\n\n company => company.properties.countryCode\n )\n );\n const countriesArray = Array.from(countries).sort(); // Convert set to array and sort\n return countriesArray;\n}", "title": "" }, { "docid": "5dce1bd431026e1ff039ee1df0977e64", "score": "0.54333866", "text": "getItemsByCountry(countryName) {\n\n const resultItems = [];\n\n for (let i = 0; i < items.length; i++) {\n if (items[i].locationCountry === countryName) {\n resultItems.push(items[i]);\n }\n }\n\n return resultItems;\n }", "title": "" }, { "docid": "1a342a4b8d22979f625024a057f94331", "score": "0.54327756", "text": "function ipLookUp () {\n $.get(\"https://ipinfo.io?token=0531e8937967f1\", function(response) {\n country = response.country;\n region = response.region;\n // console.log(region);\n }, \"jsonp\")\n }", "title": "" }, { "docid": "7d5dbd38312c140b799ef42f5da7c1eb", "score": "0.5403376", "text": "function createCountryList(data) {\n\n // collect names of all countries\n countriesList = [];\n data[0].forEach(function(country) {\n countriesList.push(country[\"Country Name\"])\n });\n autocomplete(document.getElementById(\"myInput\"), countriesList);\n}", "title": "" }, { "docid": "be9f30c9882c3e1b0b77e9ee26d1d86b", "score": "0.5397364", "text": "function getCountryByRegion(region) {\n return getReg.filter((val) => val.region == region).map((item) => item.Name);\n}", "title": "" }, { "docid": "712a354839662ca16afadbee8c11c562", "score": "0.53862834", "text": "function filterByregion(region) {\n $(\"#LoadingImage\").show();\n fetch(`https://restcountries.eu/rest/v2/region/${region}`)\n .then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response.json();\n })\n .then((response) => {\n $(\".list-of-countries\").html(\"\");\n $(\"#LoadingImage\").hide();\n displayCountries(response);\n })\n .catch((err) => {\n window.location.assign = \"http://localhost:3000/404error.html\";\n });\n}", "title": "" }, { "docid": "e487c2cf7b42a90d8378565523f1d543", "score": "0.5386017", "text": "getCountryCases(includeNoRecord=false){\n let cases = this.getAllCountries(includeNoRecord)\n .map(c => c.getCases())\n return cases\n }", "title": "" }, { "docid": "5c9ebf1024b8ac58157e257e6798827c", "score": "0.53840846", "text": "function isValidCountryCode(input) {\n var countryCodes = [\n \"AD\",\"AE\",\"AF\",\"AG\",\"AI\",\"AL\",\"AM\",\"AO\",\"AQ\",\"AR\",\n \"AS\",\"AT\",\"AU\",\"AW\",\"AX\",\"AZ\",\"BA\",\"BB\",\"BD\",\"BE\",\n \"BF\",\"BG\",\"BH\",\"BI\",\"BJ\",\"BL\",\"BM\",\"BN\",\"BO\",\"BQ\",\n \"BR\",\"BS\",\"BT\",\"BV\",\"BW\",\"BY\",\"BZ\",\"CA\",\"CC\",\"CD\",\n \"CF\",\"CG\",\"CH\",\"CI\",\"CK\",\"CL\",\"CM\",\"CN\",\"CO\",\"CR\",\n \"CU\",\"CV\",\"CW\",\"CX\",\"CY\",\"CZ\",\"DE\",\"DJ\",\"DK\",\"DM\",\n \"DO\",\"DZ\",\"EC\",\"EE\",\"EG\",\"EH\",\"ER\",\"ES\",\"ET\",\"FI\",\n \"FJ\",\"FK\",\"FM\",\"FO\",\"FR\",\"GA\",\"GB\",\"GD\",\"GE\",\"GF\",\n \"GG\",\"GH\",\"GI\",\"GL\",\"GM\",\"GN\",\"GP\",\"GQ\",\"GR\",\"GS\",\n \"GT\",\"GU\",\"GW\",\"GY\",\"HK\",\"HM\",\"HN\",\"HR\",\"HT\",\"HU\",\n \"ID\",\"IE\",\"IL\",\"IM\",\"IN\",\"IO\",\"IQ\",\"IR\",\"IS\",\"IT\",\n \"JE\",\"JM\",\"JO\",\"JP\",\"KE\",\"KG\",\"KH\",\"KI\",\"KM\",\"KN\",\n \"KP\",\"KR\",\"KW\",\"KY\",\"KZ\",\"LA\",\"LB\",\"LC\",\"LI\",\"LK\",\n \"LR\",\"LS\",\"LT\",\"LU\",\"LV\",\"LY\",\"MA\",\"MC\",\"MD\",\"ME\",\n \"MF\",\"MG\",\"MH\",\"MK\",\"ML\",\"MM\",\"MN\",\"MO\",\"MP\",\"MQ\",\n \"MR\",\"MS\",\"MT\",\"MU\",\"MV\",\"MW\",\"MX\",\"MY\",\"MZ\",\"NA\",\n \"NC\",\"NE\",\"NF\",\"NG\",\"NI\",\"NL\",\"NO\",\"NP\",\"NR\",\"NU\",\n \"NZ\",\"OM\",\"PA\",\"PE\",\"PF\",\"PG\",\"PH\",\"PK\",\"PL\",\"PM\",\n \"PN\",\"PR\",\"PS\",\"PT\",\"PW\",\"PY\",\"QA\",\"RE\",\"RO\",\"RS\",\n \"RU\",\"RW\",\"SA\",\"SB\",\"SC\",\"SD\",\"SE\",\"SG\",\"SH\",\"SI\",\n \"SJ\",\"SK\",\"SL\",\"SM\",\"SN\",\"SO\",\"SR\",\"SS\",\"ST\",\"SV\",\n \"SX\",\"SY\",\"SZ\",\"TC\",\"TD\",\"TF\",\"TG\",\"TH\",\"TJ\",\"TK\",\n \"TL\",\"TM\",\"TN\",\"TO\",\"TR\",\"TT\",\"TV\",\"TW\",\"TZ\",\"UA\",\n \"UG\",\"UM\",\"US\",\"UY\",\"UZ\",\"VA\",\"VC\",\"VE\",\"VG\",\"VI\",\n \"VN\",\"VU\",\"WF\",\"WS\",\"YE\",\"YT\",\"ZA\",\"ZM\",\"ZW\"\n ];\n\n if (countryCodes.indexOf(input.toUpperCase()) > -1) {\n return true;\n }\n}", "title": "" }, { "docid": "5b4333042b77da54c3912d47d2772d77", "score": "0.538348", "text": "function Countries() {\n FlightsSrv.getCountries().success(function(countries) {\n $scope.Countries = countries;\n });\n }", "title": "" }, { "docid": "5b4333042b77da54c3912d47d2772d77", "score": "0.538348", "text": "function Countries() {\n FlightsSrv.getCountries().success(function(countries) {\n $scope.Countries = countries;\n });\n }", "title": "" }, { "docid": "ff8edc41edb14c7b2f157865f78588f5", "score": "0.53745365", "text": "function country() {\n for (let i = 0; i < countries.length; i++) {\n console.log(countries[i].name);\n }\n}", "title": "" }, { "docid": "c66c46682db6b4773c80de3605bfc9fc", "score": "0.5373322", "text": "function CountryData(code) {\n for (var i = 0; i < iban_data.length; ++i)\n if (iban_data[i].code == code)\n return iban_data[i];\n return null;\n}", "title": "" }, { "docid": "91e42e51a40c601a263508f0897cfc8b", "score": "0.5362944", "text": "async function handleGuessCountry(req) {\n return { location: services.locationFromIp(req.ip) };\n}", "title": "" }, { "docid": "534d8ebfd6325a20e9298041f0998928", "score": "0.535261", "text": "function searchCoins() {\n var textToSearch = document.querySelector(\"#search-country-by-name\").value;\n result = coins.filter(({ name }) => name.includes(`${textToSearch}`));\n console.log(result);\n showAllCoins(result);\n}", "title": "" }, { "docid": "94a3cc34445ffa3ee55b330b0e1066da", "score": "0.53492874", "text": "function setAutocompleteCountry() {\n var country = document.getElementById('country').value;\n if (country == 'all') {\n autocomplete.setComponentRestrictions({ country: [] });\n map.setCenter({ lat: 15, lng: 0 });\n map.setZoom(2);\n } else {\n autocomplete.setComponentRestrictions({ country: country });\n map.setCenter(countries[country].center);\n map.setZoom(countries[country].zoom);\n }\n clearResults();\n clearMarkers();\n}", "title": "" }, { "docid": "ca26c3f4a97cc2136427fb8cbf3a9402", "score": "0.53479713", "text": "function getLanguageNames() {\n return $.getJSON(\"https://api.myjson.com/bins/155kj1\");\n}", "title": "" }, { "docid": "de11b373171b6c442808cf7a7bd28bbe", "score": "0.53475416", "text": "function getCountry()/*:String*/ {\n return this.country$ZOeQ;\n }", "title": "" }, { "docid": "c1f673cb4888035821d0f44371b65cb5", "score": "0.5346748", "text": "function getSatellitesByTypes(types) {\n var types_upper = new Array(types.length);\n for (var i = 0; i < types.length; i++) {\n types_upper[i] = types[i].toUpperCase();\n }\n\n var sats = [];\n for (var i = 0; i < sat_data.length; i++) {\n var sat_type = sat_data[i].type.toUpperCase();\n if (types_upper.includes(sat_type)) {\n sats.push(i);\n }\n }\n\n return sats;\n}", "title": "" }, { "docid": "45ea4efdc0087c7b9d57f15891283e72", "score": "0.5336758", "text": "function findByCountryCode(code) {\n return COUNTRIES.find((country) => country.code === code.trim());\n}", "title": "" }, { "docid": "85d30e27f864e1471a9d86f801826aed", "score": "0.5336586", "text": "function detectLanguageLocally(text, callback){\n //check the first 200 words against all languages\n var words = text.match(/\\w+/gi).slice(0,200);\n var hitsByLanguage = {};\n var languages = Object.keys(lookupsBySourceLanguage);\n for(var li in languages)\n hitsByLanguage[languages[li]] = 0;\n \n //try each word in all dictionaries\n for(var wi in words){\n for(var li in languages){\n var lookups = lookupsBySourceLanguage[languages[li]];\n for(var lj in lookups){\n var lookup = lookups[lj];\n hitsByLanguage[languages[li]] += (lookup[words[wi]] ? 1 : 0);\n }\n }\n }\n var mostHitsIndex = 0;\n var mostHits = 0;\n for(var li in languages){\n var hitsInLanguage = hitsByLanguage[languages[li]] / lookupsBySourceLanguage[languages[li]].length;\n if(hitsInLanguage > mostHits){\n mostHits = hitsInLanguage;\n mostHitsIndex = li;\n }\n }\n callback(languages[mostHitsIndex]);\n}", "title": "" }, { "docid": "4a1634b5d5b5d5c07d1f2685e9da0683", "score": "0.5325029", "text": "function setAutocompleteCountry() {\n const country = document.getElementById(\"country\").value;\n\n if (country == \"all\") {\n autocomplete.setComponentRestrictions({\n country: []\n });\n map.setCenter({\n lat: 15,\n lng: 0\n });\n map.setZoom(2);\n } else {\n autocomplete.setComponentRestrictions({\n country: country\n });\n map.setCenter(countries[country].center);\n map.setZoom(countries[country].zoom);\n }\n\n clearResults();\n clearMarkers();\n}", "title": "" }, { "docid": "bb1798fda4232adda01824fcdccc85f9", "score": "0.53220177", "text": "function getStateObjects(name) {\n if (name) {\n const foundCountry = COUNTRIES.find((country) => country.name === name.trim());\n return (foundCountry && foundCountry.states) || [];\n }\n return [];\n}", "title": "" }, { "docid": "9d17272787071c348509469434b81885", "score": "0.53183013", "text": "async function extractCountries() {\n try {\n const res = await axios.get('https://covid-api.mmediagroup.fr/v1/cases')\n const countries = Object.keys(res.data)\n\n for (let country of countries) {\n const option = document.createElement('option');\n option.append(country);\n option.value = country;\n option.classList.add = \"option\"\n listOfCountries.appendChild(option);\n frame.src = `https://www.google.com/maps/embed/v1/place?key=${myKey}&q=Iran&zoom=3`\n }\n }\n catch {\n console.log('Error on extracting countries name')\n }\n}", "title": "" }, { "docid": "65aba5df733c589d7a67386c6ee498b1", "score": "0.53165066", "text": "function getAutocompletePlaces(request, response) {\n\n $('.error-message').css('visibility', 'hidden');\n var input_term = 'Chicago IL ' + request.term;\n var service = new google.maps.places.AutocompleteService();\n service.getPlacePredictions({\n input: input_term,\n types: ['geocode'],\n componentRestrictions: {\n country: 'us'\n }\n }, function(predictions, status) {\n var cleanedResults = [];\n if (predictions === null) {\n cleanedResults = [];\n } else {\n cleanedResults = predictions.map(function(obj) {\n var rObj = {};\n rObj['label'] = obj.description.replace(\", Chicago, IL, United States\", \"\");\n rObj['place_id'] = obj.place_id;\n rObj['category'] = 'Addresses';\n rObj['types'] = obj.types;\n return rObj;\n });\n }\n // Concat results from Google with local filter:\n var localResults = getAutocompleteLocations(request.term);\n var allResults = localResults.concat(cleanedResults);\n\n if (allResults[0]) {\n var likelyResult = allResults[0];\n $autocomplete.data({\n label: likelyResult.label,\n place_id: likelyResult.place_id, \n category: likelyResult.category,\n types: likelyResult.types\n });\n } else {\n $autocomplete.data({\n label: 'None',\n place_id: 'None',\n category: 'None',\n types: 'None'\n });\n }\n response(allResults);\n });\n }", "title": "" }, { "docid": "4738196f32b680ff36e1569cae08c77e", "score": "0.5311549", "text": "function selectPlaceCountryDefaults() {\n var forms = $(\".search-form\");\n forms.each(function() {\n var form = $(this);\n var country_code = form.find(\"input[name='country_code']\").val();\n if (!country_code) {\n country_code = 'US';\n }\n form.find(\"select[name='place_country']\").val(country_code);\n });\n }", "title": "" }, { "docid": "8d3eec7d8749110909dca30e5c40810b", "score": "0.5305856", "text": "extractData(data, country) {\n return data.trk.find((item) => {\n return item.name === country;\n });\n }", "title": "" } ]
3c7fe6ad61b8e6ea72ae3b7e6a9f2c28
Leave (conference) call room
[ { "docid": "44f2822f193491856a47dba81e200071", "score": "0.6131077", "text": "function leaveRoom(sessionId, callback) {\n var userSession = userRegistry.getById(sessionId);\n\n if (!userSession) {\n return;\n }\n\n var room = rooms[userSession.roomName];\n\n if(!room){\n return;\n }\n\n console.log('notify all user that ' + userSession.id + ' is leaving the room ' + room.name);\n var usersInRoom = room.participants;\n delete usersInRoom[userSession.id];\n userSession.outgoingMedia.release();\n // release incoming media for the leaving user\n for (var i in userSession.incomingMedia) {\n userSession.incomingMedia[i].release();\n delete userSession.incomingMedia[i];\n }\n\n var data = {\n id: 'participantLeft',\n sessionId: userSession.id\n };\n for (var i in usersInRoom) {\n var user = usersInRoom[i];\n // release viewer from this\n user.incomingMedia[userSession.id].release();\n delete user.incomingMedia[userSession.id];\n\n // notify all user in the room\n user.sendMessage(data);\n }\n\n // Release pipeline and delete room when room is empty\n if (Object.keys(room.participants).length == 0) {\n room.pipeline.release();\n delete rooms[userSession.roomName];\n }\n delete userSession.roomName;\n}", "title": "" } ]
[ { "docid": "9b5072346586efd1ec2e4cdc7119151a", "score": "0.73524415", "text": "function leaveCall(){\n setCallEnded(true);\n userStream.current.getTracks().forEach(function(track) {\n track.stop();\n });\n document.getElementById('callEnded').innerHTML = 'Call ended';\n document.getElementById('callEndedDisplay').src = '../Call-ended.gif';\n partnerStream.current = null;\n }", "title": "" }, { "docid": "bb40f036a8a2270f241f4b98adc45cc9", "score": "0.6874608", "text": "leaveRoom() {\n\t\tthis.sendJSONToServer({\n\t\t\ttype: 'leave',\n\t\t\troom: this.room\n\t\t});\n\t}", "title": "" }, { "docid": "5143b7ea7f689336202f432422f36d2c", "score": "0.68426764", "text": "leave(room) {\n networkBridge.removeMembershipFromRoom(this, room);\n }", "title": "" }, { "docid": "e37f9b16ccc704995e80c152c532baa2", "score": "0.6827368", "text": "leave(roomCode, callback) {\n this.joinedRoomCode = undefined;\n this.rooms = {};\n callback();\n }", "title": "" }, { "docid": "144cb207c0717fafd972769aa2eafa97", "score": "0.6691103", "text": "leave() {\n let msg = new Message();\n msg.Namespace = this.nsConn.namespace;\n msg.Room = this.name;\n msg.Event = exports.OnRoomLeave;\n return this.nsConn.askRoomLeave(msg);\n }", "title": "" }, { "docid": "516087a4bdc24343b5748041f6b1f995", "score": "0.6678382", "text": "async function handleLeaveCall(){\n console.log('user left emitted to ' + roomID);\n leaveCall();\n console.log(peerRef.current);\n await peerRef.current.close();\n console.log(peerRef.current);\n peerRef.current = null;\n otherUser.current = null;\n sendChannel.current = null;\n document.getElementById('openButton').remove();\n document.getElementById('chatBox').remove();\n }", "title": "" }, { "docid": "006078bc6bc299d6fe28b83691d9dec5", "score": "0.6665835", "text": "function leaveRoom() {\n let user = User.list[socket.id];\n if (user) {\n user.exitRoom();\n socket.emit('leaveRoomResponse');\n }\n }", "title": "" }, { "docid": "133842ee3a5de53ab9d8266e630a4cc3", "score": "0.65977305", "text": "close() {\n // Clean up any outgoing verification request by us.\n if (!this.isChat) {\n this.cleanUpOutgoingVerificationRequests();\n }\n this._account._client.leave(this._roomId);\n this.forget();\n }", "title": "" }, { "docid": "5ffb1051883d37ec403ce633d5756e4c", "score": "0.6520001", "text": "function leaveRoom(room) {\n\tvar room_id = convertIntoId(room);\n\tdocument.getElementById(`lobby-msg`).classList.add(\"active\");\n\tsocket.emit('leave room', {\n\t\tname: room\n\t});\n\t$(\".error\").html('<span id=\"error\">You haven\\'t joined this room yet. <a onclick=\"joinRoom( \\'' + room + '\\' )\" id=\"joinBtn\" href=\"#\">Join</a> to see the conversation.</span>');\n\t$(`#${room_id}-msg`).attr(\"data-joined\", 0);\n\t$(`#${room_id}-msg`).hide();\n\t$(\".error\").show();\n}", "title": "" }, { "docid": "0084242a791100ab0c12524a6c452a88", "score": "0.6478894", "text": "botLeave() {\n\t\tlet that = this;\n\t\tsetTimeout(function(){\n\t\t\tthat.client.emit('chat', \"[Chakubot left the chatroom]\");\n\t\t\t// that.finishConversation();\n\t\t}, 300);\n\t}", "title": "" }, { "docid": "e074ca05c441d50dad12f6ccbf188d93", "score": "0.646433", "text": "leaveRoom(roomId, cb = emptyFn) {\r\n\t\t\tthis.user.leaveRoom({roomId: roomId}).then(cb); // (room)\r\n\t\t}", "title": "" }, { "docid": "164bf0e22d5dec89fb6f189cabca04f3", "score": "0.64482737", "text": "function leaveRoom() {\n\t\tvar userName = inputUserName.value;\n\t\tbuttonJoinRoom.disabled = false;\n\t\t$('#containerChat').hide();\n\t\t$('#containerJoin').show();\n\t\thasJoined = false;\n\t\teb.send(\"user/leave\", userName);\n\t}", "title": "" }, { "docid": "a12b41719201f3369a0971e7ffdc4cbe", "score": "0.64236194", "text": "function leaveRoom(room){\n socket.emit(\"leave\", room);\n updateCurrentRoom(\"\");\n updateData([]);\n updateRoomClients([]);\n }", "title": "" }, { "docid": "70e3d155785477df8e914253a661b534", "score": "0.6423379", "text": "function leaveEvent() {\n console.log(\"I am leaving now\");\n leave_room(socket.room);\n isInAnyRoom = false;\n}", "title": "" }, { "docid": "d1be9d8e4f6f30e432a22b8c411f2f35", "score": "0.6414852", "text": "function leaveRoom(room){\n socket.emit('leave', {\n 'username' : username,\n 'room' : room\n })\n }", "title": "" }, { "docid": "ccf53ca1a4f58aada5c9faecf23c45b5", "score": "0.6408905", "text": "async leave() {\n if (!this._session) {\n (0, _warning.default)(false, 'leave: should not be called in context without session');\n return;\n }\n\n switch (this._session.type) {\n case 'room':\n this._isHandled = true;\n return this._client.leaveRoom(this._session.room.id);\n\n case 'group':\n this._isHandled = true;\n return this._client.leaveGroup(this._session.group.id);\n\n default:\n (0, _warning.default)(false, 'leave: should not be called in context which is not room or group session');\n }\n }", "title": "" }, { "docid": "f0bcca3e7f1ba110c95ebd8d7cf41031", "score": "0.64029735", "text": "function leaveChannel() {\n\n client.leave(function() {\n console.log(\"client leaves channel\");\n localStreams.camera.stream.stop() // stop the camera stream playback\n client.unpublish(localStreams.camera.stream); // unpublish the camera stream\n localStreams.camera.stream.close(); // clean up and close the camera stream\n closeLocalStream(true);\n enableUiControls(localStreams.camera.stream);\n $(\"#remote-container\").empty() // clean up the remote feeds\n //disable the UI elements\n $(\"#exit-btn\").prop(\"disabled\", true);\n $(\"#mic-btn\").prop(\"disabled\", true);\n $(\"#video-btn\").prop(\"disabled\", true);\n // hide the mute/no-video overlays\n document.getElementById(\"Video call\").style.display=\"none\";\n document.getElementById(\"vc\").style.display=\"block\";\n if(!chatToggleBtn.hasClass('is-visible')){\n toggleChatWindow();\n }\n bigChatBox();\n }, function(err) {\n console.log(\"client leave failed \", err); //error handling\n });\n stopScreenShare();\n}", "title": "" }, { "docid": "522f945597abb2140c4e8f694570e0a9", "score": "0.636669", "text": "leave() {\n this.playerManager.removeAll();\n this.otherPlayers = undefined;\n if (this.communicator !== undefined) {\n this.communicator.close();\n this.communicator = undefined;\n }\n this.inLobby = false;\n this.currentlyChosen = undefined;\n this.scene = undefined;\n }", "title": "" }, { "docid": "67efbe973bceff3969273bd79b1c51a5", "score": "0.6286584", "text": "leaveRoom(room) {\n // messageFromRoom check for joined rooms so remove it from the list\n for (let index = 0; index < this.options.rooms.length; index++) {\n const joined = this.options.rooms[index];\n if (joined.jid === room.jid) {\n this.options.rooms.splice(index, 1);\n }\n }\n\n return this.client.send((() => {\n this.robot.logger.debug(`Leaving ${room.jid}/${this.robot.name}`);\n\n return new Stanza('presence', {\n to: `${room.jid}/${this.robot.name}`,\n type: 'unavailable'\n });\n }\n )());\n }", "title": "" }, { "docid": "f8273367517f88d6b0f154558443354d", "score": "0.62049377", "text": "function onLeaveRoom() {\n\n\t\tconsole.log('leavingRoom:' + currentRoom);\n\n\t\t//leave and tell the other users - leaving is not neccessary during disconnect, but doesn't cause any harm\n\t\tsocket.leave(currentRoom).broadcast.to(currentRoom).emit('clientLeftRoom', socket.id);\n\n\t\t//mark that the user is in no room at the moment\n\t\tcurrentRoom = undefined;\n\n\t\t//switch to event set for being in no Room\n\t\tlistenForEventsWhileUserIsNotInARoom();\n\t}", "title": "" }, { "docid": "a1a31b72ce76c20f10d18643594bd622", "score": "0.6175506", "text": "static async _teamLeaveRoom(game, roomKey, sessionId) {\n // Send messages to quizmaster and scoreboards\n sendMessageQuizmaster(roomKey, {\n type: 'quizmaster_teamLeft',\n sessionId: sessionId\n });\n sendMessageScoreBoards(roomKey, {\n type: 'scoreB_teamLeft',\n sessionId: sessionId\n });\n\n // Remove team\n await GameDAO.removeTeam(roomKey, sessionId);\n closeConnection(sessionId);\n SessionDAO.removeSession(sessionId);\n }", "title": "" }, { "docid": "23dcdbe779dba9aa7f79705e022e86b8", "score": "0.61643773", "text": "close() {\n if (!this._open) {\n return;\n }\n\n if (this._negotiator) {\n this._negotiator.cleanup();\n }\n\n this._open = false;\n\n const message = {\n roomName: this.name,\n };\n this.emit(sfuRoom_SFURoom.MESSAGE_EVENTS.leave.key, message);\n this.emit(sfuRoom_SFURoom.EVENTS.close.key);\n }", "title": "" }, { "docid": "ec7a255c78a911dbb4dce4391c2e2563", "score": "0.6163011", "text": "function declineCall (roomId, userId) {\n if (!rooms[roomId]) return\n\n const pp = rooms[roomId].participants.find(p => p.id === userId)\n pp.status = CallParticipantStatus.DISCONNECTED\n if (rooms[roomId].activeParticipants.length === 1) {\n if (++rooms[roomId].declines >= rooms[roomId].participants.length - 1) {\n rooms[roomId].endCall(CallEndedReason.Declined)\n return\n }\n }\n\n rooms[roomId].notifyActive({\n method: SocketMessage.LeaveCall,\n data: {\n roomId: roomId,\n id: userId\n }\n })\n}", "title": "" }, { "docid": "d5907364c6c3c42c29c08a66a7fd6984", "score": "0.6158267", "text": "function leave() {\n ch_leave_game();\n }", "title": "" }, { "docid": "ad9b7fa9f4a29d3c9049c6dbae9be84b", "score": "0.61571187", "text": "leaveRoom(nextLocation) {\n console.log('room route left');\n if (this.state.socket) {\n this.state.socket.disconnect();\n this.setState({\n player: null,\n socket: null,\n progress: 0,\n currTime: '0:00',\n duration: '0:00',\n playState: 'play',\n userList: [],\n videoHistory: [],\n videoId: '2g811Eo7K8U',\n messages: [],\n emoji: ''\n });\n }\n this.props.leaveRoom();\n }", "title": "" }, { "docid": "99ef9d5e8a9b510891283440ba7a7733", "score": "0.6132977", "text": "endPhoneCall(){\n Meteor.call(\"VideoCallServices/end\", err => {\n if(err)\n this.onError(err);\n });\n }", "title": "" }, { "docid": "3bcb6d781e5dc279b88f296379db3a41", "score": "0.61295676", "text": "function lpEndChat(){\n\tlpChatWidgetUI.endChatRequest();\n}", "title": "" }, { "docid": "427c5fc03fb3c669f9b6dab88fba9600", "score": "0.61277604", "text": "function leaveRoom(chatID){\n // Leave Chat\n socket.leave(chatID);\n // Updating chatroom info\n dbClient.collection('chats').findOneAndUpdate({_id:mID(chatID)},{$pull : {activeMembers: socket_userID}}, {returnOriginal:false}, (err, res) => {\n const chatInfo = res.value;\n // Only proccess if we do have chatInfo. Will ahve none if we try to leave deleted room\n if(chatInfo){\n frontEndID(chatInfo);\n // Removing extra unecessary stuff;\n delete chatInfo.messages;\n io.to(chatID).emit('chatInfoUpdate',chatInfo);\n }\n });\n }", "title": "" }, { "docid": "69d601153d84037496344ec864cc1c54", "score": "0.6127179", "text": "function endChat(){\n\t\tlogger.debug(\"endChat\", \"method is invoked\");\n\t\tisChatActive = false;\n\t\tshowChatWizContainerVisibility(false);\n\t}", "title": "" }, { "docid": "8675a4fd0b28d46beee742cc2ec98d80", "score": "0.61030453", "text": "function leaveRoom (data, nickname) {\n var s = data.split(' ');\n var roomname = s[1];\n console.log(roomname);\n var curr_room = _.findWhere(rooms, {'name': roomname}); //query rooms object based on roomname\n //if user is owner of room and he leaves the room, remove all other members and delete the room\n if(curr_room!==null){\n if(users[nickname].owns === curr_room.id){\n console.log(curr_room.id);\n broadcast(curr_room.id, nickname + ' left the server. The room is removed and you have been disconnected from it as well.\\n\\r',nickname);\n for (var i=0; i<curr_room.people.length; i++) { //remove room ID from inroom of all members of the current room\n users[curr_room.people[i]].inroom = null;\n }\n users[nickname].owns = null; //he no longer owns any room\n delete rooms[curr_room.id]; //remove the room object\n }\n if(users[nickname].inroom === curr_room.id){\n var existRoom = _.findWhere(rooms, {'id': users[nickname].inroom}); //query rooms based on id of the current users' room\n if(existRoom!==null){\n existRoom.people = _.without(existRoom.people, nickname); //remove the current user from the people \n if(users[nickname].owns !== existRoom.id) \n broadcast(existRoom.id, nickname + ' left the room.\\n\\r',nickname); //send status message to all members\n }\n \n users[nickname].inroom = null; //set inroom to null since he left the room\n }\n }\n\n }", "title": "" }, { "docid": "671b5a79354b0335a2df212a895c63b1", "score": "0.6088688", "text": "function leaveFunction(){\n endGame = 52; //Just manually set the endGame state for if they explored all rooms\n }", "title": "" }, { "docid": "9c30784338af3246731810ec85694434", "score": "0.60628927", "text": "async function joinCall() {\n const url = document.getElementById('room-url').value;\n\n await callFrame.join({\n url,\n showLeaveButton: true\n });\n}", "title": "" }, { "docid": "487e1dbc02c3c72e215280958e030827", "score": "0.6005556", "text": "function leave(roomId) {\n socket.emit('leave', roomId)\n }", "title": "" }, { "docid": "239ffb68ebff86ef248704bdca5d506f", "score": "0.5977298", "text": "leave () {\n this.socket.emit('leave');\n this.state.peers.forEach(peer => peer.pc.close());\n this.state.peers.clear();\n }", "title": "" }, { "docid": "e9e2cbcb8ba42a105f3e73095b1ca8f3", "score": "0.59594053", "text": "function unload() {\n room.leave();\n connection.disconnect();\n}", "title": "" }, { "docid": "9ccfea0bd67366734e5f13c60785e917", "score": "0.5945411", "text": "forget() {\n if (!this.isChat) {\n this.closeDm();\n }\n this._account.roomList.delete(this._roomId);\n GenericConversationPrototype.close.call(this);\n }", "title": "" }, { "docid": "296974473cb7357fdb3aaa82584f45b6", "score": "0.5941595", "text": "function leaveChat() {\n view('loading');\n $.getJSON(\"GhostChatServlet?action=leaveChat&username=\" + app.username, function(data) {\n app.joinedChat = false;\n view('start');\n popup('You left the chat');\n return;\n });\n}", "title": "" }, { "docid": "7de0b468be1a1ee7f869d2dff778dba4", "score": "0.59044236", "text": "function leaveUser(room) {\n if (room === void 0) { room = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var roomId, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, api.login({ username: config_1.mockUser.username, password: config_1.mockUser.password })];\n case 1:\n _b.sent();\n if (!room.id && !room.name)\n room.name = exports.testChannelName;\n if (!(room.id)) return [3 /*break*/, 2];\n _a = room.id;\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, channelInfo({ roomName: room.name })];\n case 3:\n _a = (_b.sent()).channel._id;\n _b.label = 4;\n case 4:\n roomId = _a;\n return [4 /*yield*/, api.post('channels.leave', { roomId: roomId })];\n case 5: return [2 /*return*/, _b.sent()];\n }\n });\n });\n}", "title": "" }, { "docid": "e6a356917f18b03950511685629ca702", "score": "0.5903379", "text": "leaveChannel(name) {\n //\n }", "title": "" }, { "docid": "e6a356917f18b03950511685629ca702", "score": "0.5903379", "text": "leaveChannel(name) {\n //\n }", "title": "" }, { "docid": "e6a356917f18b03950511685629ca702", "score": "0.5903379", "text": "leaveChannel(name) {\n //\n }", "title": "" }, { "docid": "4ae256c71fd3c2310dd974e547d95bb7", "score": "0.5882025", "text": "async leaveChat(chatId) {\n var res = await axios.post(`/chat/api/room/${chatId}/leave`);\n }", "title": "" }, { "docid": "49dc3df8d33ee1401882f41c3919c755", "score": "0.58748585", "text": "close() {\n for (const peerId in this.connections) {\n if (this.connections.hasOwnProperty(peerId)) {\n this.connections[peerId].forEach(connection => {\n connection.close();\n });\n }\n }\n const message = {\n roomName: this.name,\n };\n this.emit(meshRoom_MeshRoom.MESSAGE_EVENTS.leave.key, message);\n this.emit(meshRoom_MeshRoom.EVENTS.close.key);\n }", "title": "" }, { "docid": "1e2971cfe607085ce5cfbf46274b598b", "score": "0.58651286", "text": "function outboundRoomDisconnected(){\n // Trigger event for room\n updateRoomStatus();\n }", "title": "" }, { "docid": "d2098c412a7476b50bef6fb118c378a8", "score": "0.5840661", "text": "function leave_game() {\r\n\tsocket.emit('leave_game');\r\n\tdisplay_find_game();\r\n}", "title": "" }, { "docid": "b56d74b2440f6680429914b9b4528e16", "score": "0.5829167", "text": "function onLeaveChannelClick(channelInfoDialogView) {\n channelInfoDialogView.notifyAll(new LeaveChannelClickEvent());\n}", "title": "" }, { "docid": "29e1e40c1ad554c36e828d4b84ab4c8c", "score": "0.58191943", "text": "function disconnected() {\n var chatMessage = {\n sender: username,\n type: 'LEAVE',\n content: '',\n roomName: room,\n role: role\n };\n prevRoom = room;\n\n if (role === \"host\") {\n // Inform users that host left.\n server.send('/app/chat.userLeft', {}, JSON.stringify(chatMessage));\n // Remove the host & users from the room, and terminate the room\n server.send('/app/chat.removeAllUsers', {}, JSON.stringify(chatMessage));\n server.send('/app/chat.terminateRoom', {}, JSON.stringify(chatMessage));\n // Navigate user to home page\n chatPage.classList.add('hidden');\n sessionChooser.classList.remove('hidden');\n } else if (role === \"member\") {\n // Remove user from room\n server.send('/app/chat.removeUser', {}, JSON.stringify(chatMessage));\n // Send the leave message for both.\n server.send('/app/chat.userLeft', {}, JSON.stringify(chatMessage));\n // Navigate user to home page\n chatPage.classList.add('hidden');\n sessionChooser.classList.remove('hidden');\n }\n\n connectingElement.classList.add('hidden');\n}", "title": "" }, { "docid": "a2cd48bb9b9ac927ad94908cbe324922", "score": "0.5808554", "text": "leaveRoomHandler() {\n let room = this.socket.roomNum;\n let isHost = this.socket.isHost;\n if (room !== null) {\n roomList[room].removePlayer(this.socket);\n\n if (roomList[room].isEmpty()) {\n roomList[room] = null;\n // No need to broadcast here because there are no remaining players.\n } else {\n if (isHost && !roomList[room].isRunning()) {\n // Host leaves before the game starts\n roomList[room].closeRoom();\n roomList[room] = null;\n } else {\n roomList[room].broadcast(\n \"roster\",\n roomList[room].getUsernameList()\n );\n }\n }\n /*\n * socket.username is not null because it is always defined before the\n * definition of socket.roomNum.\n */\n console.log(`Player ${this.socket.username} has left room ` + `${room}`);\n\n if (roomList[room] === null) {\n console.log(`Room ${room} is closed`);\n }\n }\n }", "title": "" }, { "docid": "145f2ddcc17433c065ae575bbcc96f0d", "score": "0.5795756", "text": "leave(channel){\n let channels = [channel, 'private-' + channel, 'presence-' + channel];\n\n channels.forEach(function(channelName){\n this.channel(channelName).leave();\n }.bind(this));\n }", "title": "" }, { "docid": "29a982e78246681e907c9db77f882ca8", "score": "0.5776698", "text": "function leaveGameRoom (){\n dataStore.leavePlayer();\n dataStore.leaveRoom();\n location.reload();\n return true;\n}", "title": "" }, { "docid": "a955d949ccf12bf3bede295af312684f", "score": "0.5772644", "text": "handleClose() {\n this.room.leave(this);\n this.room.broadcast({\n type: \"note\",\n text: `${this.name} left ${this.room.name}.`,\n });\n }", "title": "" }, { "docid": "336834770fd6c065b7ad34a647b622b1", "score": "0.5770558", "text": "leave(name) {\n //\n }", "title": "" }, { "docid": "336834770fd6c065b7ad34a647b622b1", "score": "0.5770558", "text": "leave(name) {\n //\n }", "title": "" }, { "docid": "336834770fd6c065b7ad34a647b622b1", "score": "0.5770558", "text": "leave(name) {\n //\n }", "title": "" }, { "docid": "f807f24dd66b1cee24af27a385364be5", "score": "0.576487", "text": "function quit(nickname){\n count--;\n users[nickname].port.write(\" BYE\\n\\r\");\n \n if(users[nickname].inroom!==null){ //if he was a part of a chat room, update members\n var existRoom = _.findWhere(rooms, {'id': users[nickname].inroom});\n if(existRoom!==null){\n existRoom.people = _.without(existRoom.people, nickname);\n if(users[nickname].owns !== existRoom.id)\n broadcast(existRoom.id, nickname + ' left the room\\n\\r',nickname);\n }\n }\n if(users[nickname].owns!==null){ //If the user owned any chatroom, delete the room and inform members\n var curr_room = _.findWhere(rooms, {'id': users[nickname].owns});\n broadcast(curr_room.id, nickname + ' left the server. The room is removed and you have been disconnected from it as well.\\n\\r',nickname);\n for (var i=0; i<curr_room.people.length; i++) {\n users[room.people[i]].inroom = null;\n }\n delete rooms[curr_room.id];\n }\n conn.destroy(); //destroy the socket\n delete users[nickname]; //remove the user from list of online users\n \n \n }", "title": "" }, { "docid": "3a0796bb9693199248a30bf39d871e31", "score": "0.57619786", "text": "handleClose() {\n this.room.leave(this);\n this.room.broadcast({\n type: 'note',\n text: `${this.name} left ${this.room.name}.`\n });\n }", "title": "" }, { "docid": "8f488aa5203291ebb5e323bab870f296", "score": "0.57468575", "text": "function leaveRoom(room_name, player) {\n if(room_name in rooms) {\n rooms[room_name].removePlayer(player);\n }\n}", "title": "" }, { "docid": "dd558a29bc4fa2c732580f0b5cd2802c", "score": "0.57419", "text": "onLeave(client, consented) {\n this.handleAction({\n type: 'LeaveGameAction',\n userId: client.sessionId\n });\n //remove them from the game state\n //TODO wait 20 seconds for reconnection\n }", "title": "" }, { "docid": "bc1d075f9e336c8a972dcb96cb37fc66", "score": "0.5730611", "text": "function leaveLobby(socket, data) {\n try {\n var lobbyName = data.lobbyName;\n User.findByID(socket.id, function(err, data) {\n var name = data.name;\n wclog(name + ' left ' + lobbyName);\n lobbyMessage(socket, {\n lobbyName: lobbyName,\n message: name + ' has left ' + lobbyName + '.'\n });\n clearMessages(socket);\n socket.leave(lobbyName);\n broadcastLobbies();\n });\n } catch(err) {\n wcerror('lobby leave error', err);\n }\n}", "title": "" }, { "docid": "7a6c92580f28b28210b9717c6adf5c6f", "score": "0.5728646", "text": "leave (options, callback) {\n this.listen(msg => msg instanceof Message.LeaveMessage, options, callback)\n }", "title": "" }, { "docid": "83331f2e2de523cc6cf9e8a1265be6cf", "score": "0.57170475", "text": "leave() {\n\t\tif (!this.assist) return;\n\t\tthis.assist = null;\n\t\tthis.party.emit('battle.leave');\n\t}", "title": "" }, { "docid": "c20b31c219139cb6071195ccf0eecc57", "score": "0.57070684", "text": "function inboundRoomDisconnected(){\n // Trigger event for room\n updateRoomStatus();\n }", "title": "" }, { "docid": "fb41f1d47db8f1c8b4eba8f1ff7bc582", "score": "0.5704811", "text": "function leaveRoom(room, user) {\n if(!checkConnected()) {\n return;\n }\n user.room = null;\n socket.leave(room.name);\n //need to tell the game that the player left\n room.game.removePlayer(user);\n socket.emit(\"update\", \"You left: \"+room.name);\n room.people_in--;\n io.to(room.name).emit(user.name + \" has left.\");\n //destroy the room if empty\n if(room.people_in === 0) {\n delete rooms[room.name];\n }\n else {\n sendGameState(room);\n }\n }", "title": "" }, { "docid": "deef0c3af5f67ee02c323346aff1510d", "score": "0.56850404", "text": "leaveGame(data) {\n const id = data.id;\n const roomID = data.data.roomID;\n if (!this._games.hasOwnProperty(roomID)) {\n console.log('(leaveGame) no such game with id ' + roomID);\n return;\n }\n const players = this._games[roomID].players;\n delete players[id];\n //remove comments on production\n if (Object.keys(this._games[roomID].players).length === 0) {\n delete this._games[roomID];\n idGenerator.removeID(roomID);\n }\n const gamesSend = this.prepareGamesForClient();\n this.sendToAll({mType: 'returnAllGames', data: gamesSend});\n console.log(this._games);\n }", "title": "" }, { "docid": "7ecbd3c18d6311e0f13b829d293eb161", "score": "0.56770295", "text": "endGame() {\n\t\tthis.sockets.map(function(socket) {\n\t\t\tsocket.leave(this.roomId)\n\t\t\tsocket.removeAllListeners('newResult')\n\t\t\tsocket.removeAllListeners('historyUpdated')\n\t\t\tsocket.removeAllListeners('getHistory')\n\t\t}.bind(this))\n\t}", "title": "" }, { "docid": "c6784e6247514fd5b9c91cde877a1b9b", "score": "0.5673218", "text": "function username_socket_leave_current_room(username, socket) {\n\tif (!verify_username_socket_link(username, socket.id)) {\n\t\tconsole.log(\"error leaving room dur to username socket link\");\n\t\treturn;\n\t}\n\tif (username_info_object[username]['room']) {\n\t\tusername_socket_leave_room(username, username_info_object[username]['room'], socket);\n\t}\n}", "title": "" }, { "docid": "991382d061283ad2e989b7a530bbafc9", "score": "0.56595194", "text": "function quitChatRoom(){\n // for each data channel present in \"dataChannels\" object ...\n for( var id in dataChannels ){\n // ... close the data channel\n dataChannels[ id ].close();\n }\n // and quit chat room\n bc.quitRoom( room );\n}", "title": "" }, { "docid": "04ed71f15092ae0d03d02566626e608a", "score": "0.5658028", "text": "leave(name) {\n let channels = [name, 'private-' + name, 'presence-' + name];\n channels.forEach(name => {\n this.leaveChannel(name);\n });\n }", "title": "" }, { "docid": "04ed71f15092ae0d03d02566626e608a", "score": "0.5658028", "text": "leave(name) {\n let channels = [name, 'private-' + name, 'presence-' + name];\n channels.forEach(name => {\n this.leaveChannel(name);\n });\n }", "title": "" }, { "docid": "04ed71f15092ae0d03d02566626e608a", "score": "0.5658028", "text": "leave(name) {\n let channels = [name, 'private-' + name, 'presence-' + name];\n channels.forEach(name => {\n this.leaveChannel(name);\n });\n }", "title": "" }, { "docid": "73b6897dee336999dc804b0771ff07a7", "score": "0.56546485", "text": "function stopMeeting() {\n //meetingON be false\n setSingleMeeting((prevState) => {\n return {\n ...prevState,\n meetingON: false,\n endTime: new Date(),\n completed: false,\n \n };\n });\n closeSocket();\n }", "title": "" }, { "docid": "da269da9c7bba9ad70ae2cdd9a5123d2", "score": "0.5651609", "text": "async \"game:leave\"(from) {\n let user = this.getUser(from);\n let game = user.game;\n game.leave(user);\n\n // clean up empty games\n if (game.players.length === 0) {\n let pos = this.games.findIndex(g => g === game);\n this.games.splice(pos, 1);\n this.users.forEach(u => u.gameEnded());\n }\n }", "title": "" }, { "docid": "655a7cd0541e10dc29d879cdadeb4b08", "score": "0.5609553", "text": "function handle_leavingLobbyEvent(data) {\n\n\t\tvar client = this;\n\n\t\tclient.currentState = \"MultiplayerMenu\";\n\n\t\tconsole.log('--------------------------------------------------');\n\t\tconsole.log('===> handle_leavingLobbyEvent()');\n\t\tconsole.log('handle_leavingLobbyEvent(): client ' + client.user_id + ' leaving lobby of game = ' + data.game_id);\n\n\n\t\tvar game_handle = gameHandles[data.game_id];\n\n\t\t//check that the client is indeed in the game\n\t\tif(!game_handle.pending_game.isInTheGame(client)) {\n\t\t\tconsole.log(\"WARNING: client \"+client.user_id+\" was not found in the game \"+data.game_id);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//remove client from the pending game\n\t\tgame_handle.pending_game.removePlayer(data.spotNumber);\n\n\t\t//update state of the game handle according the number of players\n\t\tvar num_players = game_handle.pending_game.getNumPlayers();\t\t\t\n\t\tgame_handle.state = (num_players == 0) ? \"empty\" : \"joinable\";\n\t\t\n\t\t//notify followers that new user has left this game\n\t\tgame_handle.notifyFollowersGameStateChanged();\n\n\t\t//notify other players in the pending game's lobby that this player\n\t\t//has left the game\n\t\tgame_handle.pending_game.notifyOtherPlayersSomeUserLeft(data.spotNumber);\n\n\t\t//send the game list to client since he/she is going back to the MultiplayerMenu\n\t\tsendGameList.call(client);\n\t}", "title": "" }, { "docid": "d4174018f7cbe83ed8423b560a0ab559", "score": "0.5604792", "text": "stop() {\n logger.info('Stopping e2eping');\n\n this.conference.off(\n JitsiConferenceEvents.USER_JOINED,\n this.participantJoined);\n this.conference.off(\n JitsiConferenceEvents.USER_LEFT,\n this.participantLeft);\n this.conference.off(\n JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,\n this.messageReceived);\n this.conference.off(\n JitsiConferenceEvents.DATA_CHANNEL_OPENED,\n this.dataChannelOpened);\n\n for (const id in this.participants) {\n if (this.participants.hasOwnProperty(id)) {\n this.participants[id].clearIntervals();\n }\n }\n\n this.participants = {};\n }", "title": "" }, { "docid": "f6805f292f53c1dbf64c80a3c6dc373b", "score": "0.5598086", "text": "function joinOrLeaveChatRoom(chatRoom,uid,res,next,join,callback){\n if(!chatRoom || chatRoom.length==0){\n next(new BadRequest(\"Bad Request: must contains a chat room id\"));\n }else{\n var updateRequest = {}; \n var operator = join? \n addOperator({\n chatRoomStatus: new entities.ChatRoomStatus(chatRoom)\n }):\n removeOperator({\n chatRoomStatus:{\n rid: chatRoom\n }\n });\n db.user.update({\n _id: mongojs.ObjectId(uid)\n },\n operator,\n function(error,userUpdatedResult){\n if(error){\n next(new ServerError(error));\n }else if(userUpdatedResult.nMatched==0){\n next(new BadRequest(\"no chat room found\"));\n }\n else{\n var operator = join? \n addOperator({\n users: uid\n }):\n removeOperator({\n users: uid\n });\n db.chat_room.update({\n _id: mongojs.ObjectId(chatRoom)\n },operator,function(error,chatRoomUpdatedResult){\n if(error){\n next(new ServerError(error));\n }else{\n if(callback) \n callback();\n else\n res.json(new UpdateOperationResponse(join? \"join\":\"leave\"));\n }\n });\n }\n });\n }\n}", "title": "" }, { "docid": "9dfa0c2c204675caeb0d4798c89e8ef3", "score": "0.5592458", "text": "close() {\n Object.values(this.participants).forEach(p => {\n try {\n p.close();\n } catch (error) {\n logger.error(\n 'ROOM ' +\n this.id +\n ': Could not invoke close on participant ' +\n p.name\n );\n }\n });\n\n this.participants = {};\n this.pipeline.release();\n logger.info('Room - <' + this.id + '> closed');\n }", "title": "" }, { "docid": "43ede9e286aaccb7d75164191b2e8ddd", "score": "0.55870825", "text": "function leaveRoom (roomId) {\n if (!socket.handshake.session) return\n const room = getRoom(roomId)\n if (!room) return\n\n const ownerChanged = socket.handshake.session.user.id === room.ownerId\n\n // Remove the user from the room\n room.removeMember(socket.handshake.session.user.id)\n socket.leave(roomId)\n\n // If the room is empty, remove it\n if (!room.members.length) {\n deleteRoom(roomId)\n return io.sockets.emit('activeRooms', rooms)\n }\n\n io.sockets.in(roomId).emit('roomUsers', roomId, room.memberList)\n const msg = {\n type: 'leave',\n username: socket.handshake.session.user.username,\n roomId: roomId,\n timestamp: Date.now()\n }\n room.messages.push(msg)\n io.sockets.in(roomId).emit('newMessage', msg)\n io.sockets.emit('activeRooms', rooms)\n if (ownerChanged) {\n const msg2 = {\n type: 'ownerChange',\n username: room.owner.username,\n roomId: roomId,\n timestamp: Date.now()\n }\n room.messages.push(msg)\n io.sockets.in(roomId).emit('newMessage', msg2)\n }\n }", "title": "" }, { "docid": "b40e5d18dd2aec427b1a404e361cf2a3", "score": "0.55798656", "text": "static async _scoreboardLeaveRoom(game, roomKey, sessionId) {\n // Remove team\n await GameDAO.removeScoreboard(roomKey, sessionId);\n closeConnection(sessionId);\n SessionDAO.removeSession(sessionId);\n }", "title": "" }, { "docid": "8ec6ab2d3ad8557d37a243e744bd9c9d", "score": "0.55732393", "text": "rejectCall () {\n this.props.state.signalRConnection.invoke('endVideoCall', this.props.callFrom)\n this.props.videoCallClose()\n }", "title": "" }, { "docid": "f0650572c81217cb722500fd73b92c0f", "score": "0.557145", "text": "leave(name) {\n let channels = [name, 'private-' + name, 'presence-' + name];\n channels.forEach((name, index) => {\n this.leaveChannel(name);\n });\n }", "title": "" }, { "docid": "f0650572c81217cb722500fd73b92c0f", "score": "0.557145", "text": "leave(name) {\n let channels = [name, 'private-' + name, 'presence-' + name];\n channels.forEach((name, index) => {\n this.leaveChannel(name);\n });\n }", "title": "" }, { "docid": "f0650572c81217cb722500fd73b92c0f", "score": "0.557145", "text": "leave(name) {\n let channels = [name, 'private-' + name, 'presence-' + name];\n channels.forEach((name, index) => {\n this.leaveChannel(name);\n });\n }", "title": "" }, { "docid": "479f9ce03601faae6bd16de3dc85048f", "score": "0.5569422", "text": "function joinRoom(room) {\n if (room === '') {\n alert('Entrez un numéro de salle pour pouvoir continuer')\n } else {\n\t roomId = room\n socket.emit('join', room)\n\t showVideoConference()\n\n\t}\n }", "title": "" }, { "docid": "37e33660017e10c38f8589e642ebce36", "score": "0.55532", "text": "rejectCall() {\n var self = this;\n\n console.log('acceptCall() : Incoming call rejected');\n self.signaling.emit('call-reject');\n self.updateState('idle');\n }", "title": "" }, { "docid": "a91cad29e3dc409d4b51fd0633da5b31", "score": "0.5553018", "text": "remove_from_room() {\n this.room = null;\n }", "title": "" }, { "docid": "1d80d770991d809f627f2cdbd609f7ce", "score": "0.55422175", "text": "function hangup() {\n if (callSession) {\n txtCallStatus.innerHTML = txtCallStatus.value = 'Terminating the call...';\n console.log(\"call = \" + txtCallStatus.value);\n callSession.hangup({events_listener: { events: '*', listener: onSipEventSession }});\n }\n}", "title": "" }, { "docid": "58d7a9e940a3affc4f40911c2f0e18c4", "score": "0.55317456", "text": "quitRoom(room) {\n let joinedRooms = this.state.joinedRooms.filter((r) =>\n r._id !== room._id);\n let allRooms = this.state.allRooms;\n if (!room.private) {\n let allRooms = [\n ...this.state.allRooms,\n room,\n ];\n }\n this.socket.emit('quit', room._id);\n delete this.roomInfo[room._id];\n this.setState({\n allRooms,\n joinedRooms,\n });\n this.updateRoom(allRooms, joinedRooms);\n }", "title": "" }, { "docid": "4d247f6f2a4b9a4eb853e9c54bd625b3", "score": "0.5530988", "text": "onUnload(event) {\n socket.emit(\"leave room\", {\n room: this.props.match.params.id,\n user: this.props.currentUser\n });\n this.removeUser(this.props.currentUser);\n event.returnValue = \"Hello\";\n }", "title": "" }, { "docid": "53b3ede3690b7266c07e04fd802f5727", "score": "0.55303484", "text": "function unloadCallScreen(evt) { }", "title": "" }, { "docid": "b41b26cb315a25907d747ca489c5b976", "score": "0.5522441", "text": "endCall (isStarter) {\n if (_.isFunction(this.pc.stop)) this.pc.stop(isStarter)\n this.pc = {}\n this.config = null\n this.setState({\n localSrc: null,\n peerSrc: null\n });\n this.props.videoCallClose()\n }", "title": "" }, { "docid": "79468f68dc0f623313872ed9949204a7", "score": "0.5516589", "text": "leave( message, raw, senderClientId ) {\n // TODO\n let client = ClientStore.clients.find( cl => cl.clientId === senderClientId )\n if ( !client ) { return winston.debug( `No client with id ${senderClientId} found in pid ${process.pid} (this is fine, it might be on another pid).` ) }\n\n // again, backwards compatibility\n if ( message.streamId ) message.roomName = `stream-${message.streamId}`\n // just in case, if no room name, assemble it from resourceid and resource type\n if ( !message.roomName && message.resourceId && message.resourceId.trim( ) !== '' && message.resourceType && message.resourceId.trim( ) !== '' )\n message.roomName = `${message.resourceType}-${message.resourceId}`\n // if still no room name, exit left\n if ( !message.roomName ) return winston.error( `No roomName specified from client ${client.clientId}.` );\n\n let roomIndex = client.rooms.indexOf( message.roomName )\n if ( roomIndex !== -1 ) {\n client.rooms.splice( roomIndex, 1 )\n winston.debug( `Client with id ${senderClientId} left ${message.roomName}.` )\n }\n }", "title": "" }, { "docid": "3b27f5aebb3f53b406b6351a8080e23f", "score": "0.5515714", "text": "function kangaroo_leave(){\n\t\n}", "title": "" }, { "docid": "30104fbb40d8481243ae76562d019dd0", "score": "0.551311", "text": "onLeave (client, consented) { \n console.log(\"client left\", client.id);\n }", "title": "" }, { "docid": "ca2b84169f4110072d15bfd25ef3bcff", "score": "0.5485699", "text": "function leaveCommand(player, message) {\n room.kickPlayer(player.id, 'Bye !', false);\n}", "title": "" }, { "docid": "604aa4f1bc16a3eeeab667e8cc787764", "score": "0.5479549", "text": "leave(channel) {\n this.connector.leave(channel);\n }", "title": "" }, { "docid": "604aa4f1bc16a3eeeab667e8cc787764", "score": "0.5479549", "text": "leave(channel) {\n this.connector.leave(channel);\n }", "title": "" }, { "docid": "604aa4f1bc16a3eeeab667e8cc787764", "score": "0.5479549", "text": "leave(channel) {\n this.connector.leave(channel);\n }", "title": "" }, { "docid": "a671937348604b5ed9160470a305d51a", "score": "0.54686147", "text": "endGame() {\n\n console.log(\"endGame() is called\");\n var destination = '/home.html';\n clearInterval(this.tester);\n this.io.sockets.in(this.roomId).emit(\"gameEnded\",{\"destination\": destination, \"users\": this.gUsers});\n }", "title": "" }, { "docid": "625906aaa7bd74eeba575ddfaf83ede1", "score": "0.5460507", "text": "destroy() {\n for (var i = 0; i < this._players.length; i++) {\n this._players[i].leaveLobby();\n }\n }", "title": "" }, { "docid": "2f7719e2d26dfb8fd3fd90afa216bf6a", "score": "0.5459648", "text": "ionViewDidLeave() {\n this.events.subscribe('conversations', () => { });\n }", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "c52ed1c6c5d9295047f5bb40e78275b4", "score": "0.0", "text": "function t(e,t,r,n){var a={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[e+\" Tage\",e+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[e+\" Monate\",e+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[e+\" Jahre\",e+\" Jahren\"]};return t?a[r][0]:a[r][1]}", "title": "" } ]
[ { "docid": "eba7a54915599f144e0f867b7640f6f1", "score": "0.81141967", "text": "function ys(e,t,n){var a={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(a[n],+e)}", "title": "" }, { "docid": "d93cbc384ec5ca2395ed91c55ffe637e", "score": "0.7849099", "text": "function yt(e,t,n){var r={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(r[n],+e)}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "5d472c89985829e78746dd2ccee6a636", "score": "0.71400195", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data}else{if(typeof console!==\"undefined\"&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn(\"Locale \"+key+\" not found. Did you forget to load it?\")}}}return globalLocale._abbr}", "title": "" }, { "docid": "96429cc3f1ee77f92477a1c0f838fa77", "score": "0.69832134", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "96429cc3f1ee77f92477a1c0f838fa77", "score": "0.69832134", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "62948c6d3b3137c8820915b199eba8cd", "score": "0.66978", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(typeof values === 'undefined'){data = locale_locales__getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\n\tglobalLocale = data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "2c83a51fb5077040656e855f9655f4e9", "score": "0.6690814", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "2c83a51fb5077040656e855f9655f4e9", "score": "0.6690814", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "2c83a51fb5077040656e855f9655f4e9", "score": "0.6690814", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62765163", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62765163", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "4a6f10cf3c829e810d9763057a3eee1b", "score": "0.6203053", "text": "function ApexLocale() {}", "title": "" }, { "docid": "ce1aeb6bf552ec523ba14d3bcc01a368", "score": "0.61849964", "text": "function E(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=m(b)?H(a):F(a,b),c&&(ld=c)),ld._abbr}", "title": "" }, { "docid": "c8b0d3e3931c4dde93f5a594281ffb21", "score": "0.61835414", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n \n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n \n return globalLocale._abbr;\n }", "title": "" }, { "docid": "d58238f1806d55b8423ac5277b4f92ae", "score": "0.61600935", "text": "function initialize_date() {\n format = 'L<br/>LTS';\n datetime = document.getElementById(\"datetime\");\n moment.locale( window.navigator.languages );\n datetime.innerHTML = moment().format( format );\n setInterval( () => { datetime.innerHTML = moment().format( format ); }, 1000 );\n}", "title": "" }, { "docid": "9c0d0ea8dd2f120115abd8f0b67c7bdd", "score": "0.6134753", "text": "function configureGlobalMomentLocale(localeOverride = \"system-default\", weekStart = \"locale\") {\n var _a;\n const obsidianLang = localStorage.getItem(\"language\") || \"en\";\n const systemLang = (_a = navigator.language) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n let momentLocale = langToMomentLocale[obsidianLang];\n if (localeOverride !== \"system-default\") {\n momentLocale = localeOverride;\n }\n else if (systemLang.startsWith(obsidianLang)) {\n // If the system locale is more specific (en-gb vs en), use the system locale.\n momentLocale = systemLang;\n }\n const currentLocale = window.moment.locale(momentLocale);\n console.debug(`[Calendar] Trying to switch Moment.js global locale to ${momentLocale}, got ${currentLocale}`);\n overrideGlobalMomentWeekStart(weekStart);\n return currentLocale;\n}", "title": "" }, { "docid": "c4ca5e41a4aa0b61bf1d78f076ca18f7", "score": "0.61138785", "text": "function getSetGlobalLocale(key, values) {\n var data;\n // moment.duration._locale = moment._locale = data;\n return key && (data = isUndefined(values) ? getLocale(key) : defineLocale(key, values)) && (globalLocale = data), \n globalLocale._abbr;\n }", "title": "" }, { "docid": "fefc97e58de5fe47afa0204064b1ddcf", "score": "0.61022425", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "fefc97e58de5fe47afa0204064b1ddcf", "score": "0.61022425", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
9f392ae6bd853dbae3d6a952b455c940
Draw some rule lines fo debugging
[ { "docid": "8a6395a4618b78ec1027c5b864990565", "score": "0.0", "text": "function drawGrids() {\n context.strokeStyle = \"rgba(0,255,0,255)\";\n context.lineWidth = 1;\n context.beginPath();\n context.moveTo(0,0);\n context.lineTo(screenWidth, screenHeight);\n context.moveTo(0,screenHeight);\n context.lineTo(screenWidth, 0);\n context.stroke();\n}", "title": "" } ]
[ { "docid": "12cf34e7eab0bcc7905f603013be8824", "score": "0.6744044", "text": "function debug() {\n console.log(':::RULES:::');\n console.log(_rules);\n console.log(':::FUNCTIONS:::');\n console.log(_functions);\n console.log(':::VALIDATION PARTS:::');\n console.log(_validationParts);\n }", "title": "" }, { "docid": "c97f33dd7eb2004fe60e73fb15605d84", "score": "0.6417106", "text": "function debugLine(e, t, i) {\n\te === !0 && (e = \"true\"), e === !1 && (e = \"false\");var n = e;if (\"object\" == (typeof e === 'undefined' ? 'undefined' : _typeof(e))) {\n\t\tn = \"\";for (name in e) {\n\t\t\tvar r = e[name];n += \" \" + name + \": \" + r;\n\t\t}\n\t}if (1 != t || i || (n += \" \" + Math.random()), 1 == i) {\n\t\tvar o = jQuery(\"#debug_line\");o.width(200), o.height() >= 500 && o.html(\"\");var a = o.html();n = a + \"<br> -------------- <br>\" + n;\n\t}jQuery(\"#debug_line\").show().html(n);\n}", "title": "" }, { "docid": "1a2c33468f196fe45d21f521d447f865", "score": "0.61412036", "text": "function DebugStyling(){}", "title": "" }, { "docid": "d16c2f86e9dc04f5fe88c556b40beb70", "score": "0.5937806", "text": "function DebugStyling() {}", "title": "" }, { "docid": "e233653fab935a267081ad8c480627d2", "score": "0.59091705", "text": "function DebugStyling() { }", "title": "" }, { "docid": "12fc24ddcb6e4bd88cfda4b6ec43c3b7", "score": "0.5668242", "text": "function RainbowDebug() {\r\n}", "title": "" }, { "docid": "7c3305017ed77d4d379ead15cc142f07", "score": "0.56437385", "text": "function debug(graph, wm){\n\tgraph.print();\n}", "title": "" }, { "docid": "b2838fc558ae31cdc4599b2e7f31a892", "score": "0.56430686", "text": "function showPrintingDiagnostics() {\n showPrintingCropMarks();\n showPrintingDescription();\n showPrintingRulers();\n}", "title": "" }, { "docid": "8eb2a1a863c1931c19266529b5eebac8", "score": "0.55416846", "text": "function xxxdebugProperties(jo){\n\tconsole.log('\\n\\n' + jo.data['xath' ] + '\\n\\n' + jo.data['cod']\n\t + '\\n\\n' + jo.data['idn' ] + '\\n\\n' + jo.data['pk' ]\n\t + '\\n\\n' + jo.data['textQr'] + '\\n\\n');\n}", "title": "" }, { "docid": "76b8893b6292e0352fc3197dafc0692e", "score": "0.5515278", "text": "debug() {\n\t\tthis.log(\"GameMode - \" + this.name + \" | Version: \" + this.version);\n\t\tthis.log(\"Number of Resources - \" + this.resources.size);\n\t\tthis.log(\"Number of Stages - \" + this.stages.length);\n\n\t\tfor (var i = 0; i < this.stages.length; i++) {\n\t\t\tthis.log(\"Stage (\" + i + \") - \" + this.stages[i].name);\n\t\t\tthis.stages[i].debug();\n\t\t}\n\t}", "title": "" }, { "docid": "87e764a63edde88aa2f29ff5fbcfe830", "score": "0.54890347", "text": "debug( draw, steps=10, inc_dxdy=false, inc_dxdy2=false ){\r\n let prev = new Vec3();\r\n let pos = new Vec3();\r\n let dev = new Vec3();\r\n let t;\r\n\r\n // Draw First Point\r\n this.at( 0, prev );\r\n draw.pnt( prev, \"yellow\", 0.05, 1 );\r\n\r\n for( let i=1; i <= steps; i++ ){\r\n t = i / steps;\r\n\r\n //------------------------------------\r\n // Draw Step\r\n this.at( t, pos );\r\n draw\r\n .ln( prev, pos, \"yellow\" )\r\n .pnt( pos, \"yellow\", 0.05, 1 );\r\n\r\n //------------------------------------\r\n // Draw Forward Direction\r\n if( inc_dxdy ){\r\n this.at( t, null, dev );\r\n draw.ln( pos, dev.norm().scale( 0.4 ).add( pos ), \"white\" );\r\n }\r\n\r\n //------------------------------------\r\n // Draw Forward Direction\r\n if( inc_dxdy2 ){\r\n this.at( t, null, null, dev );\r\n draw.ln( pos, dev.norm().scale( 0.4 ).add( pos ), \"cyan\" );\r\n }\r\n\r\n //------------------------------------\r\n prev.copy( pos );\r\n }\r\n }", "title": "" }, { "docid": "a953c304ed49e37df21b631ce3f9ac33", "score": "0.5422858", "text": "function doDebug() {\n\n\t\tvar i = 0,\n\t\t\tnoView = 0,\n\t\t\tmyWindow,\n\t\t\tmyDocDebug;\n\n\t\t// Open new window for debug\n\t\tmyWindow = window.open('', 'Debug', \"width=700, height=400\", '');\n\t\tmyDocDebug = myWindow.document;\n\n\t\tmyDocDebug.open();\r\n \n\t\tmyDocDebug.writeln('<h2>Debug</h2>');\n\t\tmyDocDebug.body.style.backgroundColor = \"black\";\n\t\tmyDocDebug.body.style.color = \"white\";\n\t\tmyDocDebug.body.style.fontFamily = \"Courier\";\n\t\tmyDocDebug.writeln('<div id=\\\"debug\\\"></div>');\n\n\t\tmyDocDebug.close();\n\n\t\tif (typeof theObj === \"undefined\") {\n\t\t\tmyDocDebug.getElementById(\"debug\").innerHTML = \"Drawing not loaded\";\n\t\t} else {\n\t\t\tmyDocDebug.getElementById(\"debug\").innerHTML += doDebugLine(\"The type is:\", theObj.Header.Type, \"OK\");\n\t\t\tmyDocDebug.getElementById(\"debug\").innerHTML += doDebugLine(\"The name is:\", theObj.Header.Name, \"OK\");\n\t\t\tmyDocDebug.getElementById(\"debug\").innerHTML += doDebugLine(\"The title is:\", theObj.Header.Title, \"OK\");\n\n\t\t\tnoView = theObj.Views.length;\n\t\t\tmyDocDebug.getElementById(\"debug\").innerHTML += doDebugLine(\"The number of view is:\", noView, \"OK\");\n\t\t\tif (noView > 0) {\n\t\t\t\tfor (i = 0; i <= noView - 1; i += 1) {\n\t\t\t\t\tmyDocDebug.getElementById(\"debug\").innerHTML += doDebugLine(\"The number of shape in view\" + i + \" is:\", theObj.Views[i].Shapes.length, \"OK\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "6fd930b10c20d8a95f507f85d46e1511", "score": "0.54211956", "text": "function printRules () {\n\n\tvar d = document.getElementById(\"mainDivRule\");\n\n\twhile ( d.hasChildNodes() ) {\n\t\twhile ( d.childNodes.length >= 1 ) {\n\t\t\td.removeChild( d.firstChild ); \n\t\t} \n\t}\n\n\tvar table = document.createElement(\"table\");\n\n\tfor ( var key in systemRules ) {\n\t\tvar trow = document.createElement(\"tr\");\t\n\t\tvar tcol = document.createElement(\"td\");\n\n\t\tif ( !isLastKey (key, systemRules)) {\n\t\t\ttcol.setAttribute(\"style\",\"border-bottom:1px solid black\");\t\n\t\t}\n\n\t\ttcol.appendChild(document.createTextNode(\"IF \"));\n\t\tfor ( var key2 in systemRules[key].inputList ) {\n\t\t\tvar x = systemRules[key].inputList[key2];\n\n\t\t\tvar ns =\"\";\n\t\t\tif (x.negated){\n\t\t\t\tns = \"NOT\";\n\t\t\t} \n\n\t\t\tif ( strcmp(x.rightEl,\"(Not used)\") == 0 ) {\n\t\t\t} else {\n\t\t\t\tif ( !isFirstKey ( key2, systemRules[key].inputList ) ) {\n\t\t\t\t\ttcol.appendChild(document.createTextNode(systemRules[key].connective + \" \"));\n\t\t\t\t}\n\t\t\t\tif ( inputDivs[x.leftEl] !== undefined ) {\n\t\t\t\t\ttcol.appendChild(document.createTextNode(inputDivs[x.leftEl].varName + \" IS \" + ns + \" \" + x.rightEl + \" \"));\n\t\t\t\t} else {\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( (isLastKey (key2, systemRules[key].inputList))) {\n\t\t\t\ttcol.appendChild(document.createTextNode(\"THEN \"));\n\t\t\t}\n\t\t}\n\n\t\tfor ( var key2 in systemRules[key].outputList ) {\n\t\t\tvar x = systemRules[key].outputList[key2];\n\n\t\t\tvar ns =\"\";\n\t\t\tif (x.negated){\n\t\t\t\tns = \"NOT\";\n\t\t\t} \n\n\t\t\tif ( !isFirstKey ( key2, systemRules[key].outputList ) ) {\n\t\t\t\tif ( strcmp (x.rightEl, \"(Not used)\") != 0) { \n\t\t\t\t\ttcol.appendChild(document.createTextNode(systemRules[key].connective + \" \"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( strcmp(x.rightEl,\"(Not used)\") == 0 ) {\n\t\t\t} else {\n\t\t\t\tif ( outputDivs[x.leftEl] !== undefined ) {\n\t\t\t\t\ttcol.appendChild(document.createTextNode(outputDivs[x.leftEl].varName + \" IS \" + ns + \" \" + x.rightEl + \" \"));\n\t\t\t\t} else {\n\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\ttcol.appendChild(document.createTextNode(\"(\" + systemRules[key].weight + \")\"));\t\t\t\n\n\t\tvar tcol2 = document.createElement(\"td\");\n\n\t\tif ( !isLastKey (key, systemRules)) {\n\t\t\ttcol2.setAttribute(\"style\",\"border-bottom:1px solid black\");\t\n\t\t}\n\n\t\tvar deleteButton = document.createElement(\"button\");\n\t\tdeleteButton.className = \"btn btn-danger lowMarge\";\n\t\tdeleteButton.setAttribute (\"style\",\"float:right\")\n\t\tdeleteButton.appendChild(document.createTextNode(\"Delete\"));\n\t\tdeleteButton.setAttribute(\"onclick\", \"deleteRule(\" + s + \")\");\n\t\ttcol2.appendChild(deleteButton);\n\t\t\n\t\tvar editButton = document.createElement(\"button\");\n\t\teditButton.className = \"btn btn-primary lowMarge\";\n\t\teditButton.setAttribute (\"style\",\"float:right\")\n\t\teditButton.appendChild(document.createTextNode(\"Edit\"));\n\t\tvar s = \"\\\"\"+ key +\"\\\"\";\n\t\teditButton.setAttribute(\"onclick\", \"resetRuleCreator(); editRule(\" + s + \")\");\n\t\ttcol2.appendChild(editButton);\n\n\t\ttrow.appendChild(tcol);\n\t\ttrow.appendChild(tcol2);\n\t\ttable.appendChild(trow);\n\t}\n\n\td.appendChild(table);\n\n\tif ( getLength(true) == 2 && getLength(false) == 1 ) {\n\t\tdocument.getElementById(\"ruleTableTitle\").innerHTML = \"<h4 class='smallIndent'>Rule Tables</h4>\";\n\t\tprintRulesAsTable(\"AND\");\n\t\tprintRulesAsTable(\"OR\");\n\t} else {\n\t\tdocument.getElementById(\"ruleTableTitle\").innerHTML = \"\";\n\t\tclearNode(document.getElementById(\"ruleTableDivAND\"));\n\t\tclearNode(document.getElementById(\"ruleTableDivOR\"));\t\n\t}\n\t\n\n}", "title": "" }, { "docid": "c82216f2ee9993f730dd833900fea877", "score": "0.53949183", "text": "show() {\n strokeWeight(3);\n stroke(this.clr);\n line(this.posx, this.posy, this.endx, this.endy);\n this.posx = this.endx;\n this.posy = this.endy;\n }", "title": "" }, { "docid": "323d6e90fdaba8014e189c6ab0b6976a", "score": "0.5376806", "text": "function debugInfo(){\n\tif(!debug) return;\n\tvar s = '', min, max;\n\n\tfor(min=posActual; link[min-1]!==undefined; min--) continue;\n\ts+= mostrarLinks(min, min+3);\n\tif(min+4 < posActual-3) s+= '...\\n' + mostrarLinks(posActual-3, posActual+3);\n\telse s+= mostrarLinks(min+4, posActual+3);\n\n\tfor(max=posActual; link[max+1]!==undefined; max++) continue;\n\tif(posActual+4 < max-3) s+= '...\\n' + mostrarLinks(max-3, max);\n\telse s+= mostrarLinks(posActual+4, max);\n\n\talert(s);\n}", "title": "" }, { "docid": "bab2820192efe87f3e26022f17dad964", "score": "0.537536", "text": "function showScore(points) {\n addNewLine();\n console.log(myYellowAndBlue(\"Score ==> \" + points));\n addNewLine();\n}", "title": "" }, { "docid": "5c642db19740acc7f8c290f5cff34454", "score": "0.5360861", "text": "debug (results) {\n // Bail if drawing helpers haven't loaded\n if (typeof drawConnectors === 'undefined') return\n \n // Clear the canvas\n this.handsfree.debug.context.hands.clearRect(0, 0, this.handsfree.debug.$canvas.hands.width, this.handsfree.debug.$canvas.hands.height)\n \n // Draw skeletons\n if (results.multiHandLandmarks) {\n for (const landmarks of results.multiHandLandmarks) {\n drawConnectors(this.handsfree.debug.context.hands, landmarks, HAND_CONNECTIONS, {color: '#00FF00', lineWidth: 5})\n drawLandmarks(this.handsfree.debug.context.hands, landmarks, {color: '#FF0000', lineWidth: 2})\n }\n }\n }", "title": "" }, { "docid": "6440cfd0e4c2ac9de03c65c8a64be480", "score": "0.5347892", "text": "debug() {}", "title": "" }, { "docid": "709e47e5aa400d62fc5ea5e4dd4f7bef", "score": "0.5342057", "text": "function gamesRules(level, our_figures, right_col, left_col) {\n\n\tdocument.getElementById(\"line1\").innerHTML = right_col.substring(1, right_col.length).toUpperCase() + '&nbsp;color&nbsp;represents&nbsp;the&nbsp;RIGHT';\n\tdocument.getElementById(\"line2\").innerHTML = left_col.substring(1, left_col.length).toUpperCase() + '&nbsp;color&nbsp;represents&nbsp;the&nbsp;LEFT';\n\n\tif (level <= 2) {\n\n\t\tdocument.getElementById(\"line3\").innerHTML = 'WRISTS&nbsp;are&nbsp;represented&nbsp;as&nbsp;' + our_figures[0].replace(\"1\", \"\") + \"s\";\n\n\t} else if (level == 3) {\n\n\t\tdocument.getElementById(\"line3\").innerHTML = 'WRISTS&nbsp;are&nbsp;represented&nbsp;as&nbsp;' + our_figures[0].replace(\"1\", \"\") + \"s\";\n\t\tdocument.getElementById(\"line4\").innerHTML = 'KNEES&nbsp;are&nbsp;represented&nbsp;as&nbsp;' + our_figures[2].replace(\"1\", \"\") + \"s\";\n\n\t}\n\n\tdocument.getElementById(\"lineHint\").innerHTML = 'Knees&nbspare&nbspPURPLE&nbsp(use&nbspyour&nbspfavorite)';\n\n\t$(\"#rules\").fadeIn(0);\n\t$(\"#rules\").fadeOut(12000);\n\n}", "title": "" }, { "docid": "2217772fe2ed42195a7b5306af4bb622", "score": "0.53139174", "text": "function drawProof()\r\n{\r\n var point1; // local \"Spots\"\r\n var point2; // local \"Spots\"\r\n\r\n var material = new THREE.LineBasicMaterial({\r\n color: 0xff0000,\r\n linewidth: 5\r\n });\r\n\r\n // in the proofArray\r\n for ( i = proofArray.length; i > 1; i--)\r\n {\r\n point1 = proofArray.shift();\r\n if (point1.parent){\r\n \r\n point2 = point1.parent;\r\n // drawline between proofArrayPoints\r\n var mat = new THREE.LineBasicMaterial({color:0x8888FF, linewidth:25, vertexColors: THREE.VertexColors });\r\n var geo = new THREE.Geometry();\r\n geo.vertices.push( translate(point1.i, point1.j) );\r\n geo.vertices.push( translate(point2.i, point2.j) );\r\n console.warn(\"Line between \" + point1.i + \",\" + point1.j + \" and \" + point2.i + \",\" + point2.j)\r\n var line = new THREE.Line(geo);\r\n ABWorld.scene.add(line);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b31d25d618d992575542ff4c5468baab", "score": "0.5312247", "text": "function doDebugLine(varA, varB, varC) {\n\t\tvar MAXCHAR = 60;\n\t\tvar i, strTmp, nbpoint;\n\t\tstrTmp = varA + \" \" + varB + \" \";\n\t\tnbpoint = MAXCHAR - strTmp.length;\n\t\tfor (i = 0; i <= nbpoint - 1; i += 1) {\n\t\t\tstrTmp += \".\";\n\t\t}\n\t\tstrTmp += varC + \"<br>\";\n\t\treturn strTmp;\n\t}", "title": "" }, { "docid": "031a15ff9b0fe5e102bf5e73ebf16378", "score": "0.53074896", "text": "display() {\n var bodyAPos = this.chain.bodyA.position;\n var bodyBPos = this.chain.bodyB.position;\n strokeWeight(5);\n line(bodyAPos.x, bodyAPos.y, bodyBPos.x, bodyBPos.y);\n }", "title": "" }, { "docid": "b20886f27b7984e450d7c01344026c62", "score": "0.5304799", "text": "function printDebug() {\n console.log(paddles);\n console.log(ball);\n}", "title": "" }, { "docid": "509d14c7abc9ab14f42c0c476f860676", "score": "0.5300738", "text": "debug(state) {\n if (state) {\n this.debugGraphics = new PIXI.Graphics;\n this.debugGraphics.lineStyle(2, 0xFF0000, 1);\n this.ent.addChild(this.debugGraphics);\n } else {\n this.debugGraphics = undefined;\n }\n }", "title": "" }, { "docid": "929177488672350f0540bd28e73a8f27", "score": "0.5298684", "text": "function tnologo() {\r\n console.log(red('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));\r\n console.log(red(' ::::::::::: :::: ::: :::::::: :::::::: ::::::::: '));\r\n console.log(red(' :+: :+:+: :+: :+: :+: :+: :+: :+: :+: '));\r\n console.log(red(' +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ '));\r\n console.log(red(' +#+ +#+ +:+ +#+ +#+ +:+ +#++:++#++ +#++:++#+ '));\r\n console.log(red(' +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ '));\r\n console.log(red(' #+# #+# #+#+# #+# #+# #+# #+# #+# #+# '));\r\n console.log(red(' ### ### #### ######## ######## ######### '));\r\n}", "title": "" }, { "docid": "754eb22185adc2370b754476afe4bbaa", "score": "0.52833545", "text": "function checkVisibleLines () {\n\tif (allVisibleLinesJustified()) {\n\t\t$('#problemButton').show();\n\t\t$('#ruleInstructionsPartial').html('Correct! Click \\'Next Line\\' to continue.');\n\t}\n}", "title": "" }, { "docid": "5797fd37fc960b528adbc0133420d24b", "score": "0.5271143", "text": "function debug(where, extraName = '', extraVal = '') {\n\tconsole.log(`${where} ${extraName} ${extraVal}`);\n\tconsole.log(\n\t\t`left:${left} ----- right:${right} ----- currentL:${currentL} ----- currentR:${currentR} ----- middle:${middle} ----- tempArr= ${tempArr} ----- idList:${idList}`\n\t);\n}", "title": "" }, { "docid": "9281eb938811a06de5b02fd5dfcc4527", "score": "0.5269602", "text": "debug(...args) {\n console.debug(this.getColorOn() + args.join(\" \"));\n }", "title": "" }, { "docid": "daf2fe18797af8a8cc32b12dec8f00fd", "score": "0.5254365", "text": "function printMotionGuidelines (){\n\tvar activeItem = app.project.activeItem;\n\tif (activeItem != null && (activeItem instanceof CompItem)){\n\t\ttestString = \"\";\n\t\twriteString = \"\";\n\t\tactiveComp = activeItem;\n\t\tactiveCompName = activeComp.name;\n\t\tfps = activeComp.frameRate;\n\t\ttimeMS = activeComp.time * 1000;\n\t\tcompAnimStart = activeComp.workAreaStart * 1000;\n\t\tcompAnimDur = activeComp.workAreaDuration * 1000;\n\n\t\twriteString = activeCompName + lineReturn + \"Total Anim time \" + compAnimDur + \"MS\" + lineReturn;\n\t\t\n\t\t\n\t\tvar selectedLayers = activeComp.layers;\n\n\t\t\n\t\tfor (var i = 1; i <= selectedLayers.length; i++) {\n\t\t\twriteString += paragraph + selectedLayers[i].name;\n\t\t\tvar numProps = selectedLayers[i].numProperties;\n\n\t\t\t\n\t\t\t\n\t\t\tfunction findProperties(curItem) {\n\t\t\t var curLayer = selectedLayers[i];\n\t\t\t var report = \"\";\n\n\t\t\t findKeys(curLayer);\n\t\t\t \n\t\t\t return\n\t\t\t}\n\t\t\t \n\t\t\tfunction findKeys(property) {\n\t\t\t \n\t\t\t \n\t\t\t var propTypeString = \"Unknown\";\n\t\t\t if (property.propertyType == PropertyType.INDEXED_GROUP) { propTypeString = \"INDEXED_GROUP\"; }\n\t\t\t else if (property.propertyType == PropertyType.NAMED_GROUP) { propTypeString = \"NAMED_GROUP\"; }\n\t\t\t else if (property.propertyType == PropertyType.PROPERTY) { propTypeString = \"PROPERTY\"; }\n\t\t\t \n\t\t\t \n\t\t\t\n\t\t\t if (property.propertyType == PropertyType.PROPERTY && property.canVaryOverTime && property.numKeys > 0){\n\t\t\t \t\n\t\t\t \twriteString += lineReturn + property.name + lineReturn;\n\t\t\t \tfor (var j = 1; j <= property.numKeys; j++) {\n\t\t\t \t\t\n\t\t\t \t\tvar t = (property.keyTime(j) * 1000) - compAnimStart;\n\n\t\t\t \t\tvar keyValue = [];\n\t\t\t \t\tif(property.keyValue(j)[0]){\n\t\t\t \t\t\tfor (var x = 0; x < property.keyValue(j).length; x++) {\n\t\t\t\t \t\t\tkeyValue.push(property.keyValue(j)[x].toFixed(0));\n\t\t\t\t \t\t}\n\t\t\t \t\t}else{\n\t\t\t \t\t\tkeyValue.push(property.keyValue(j));\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\twriteString += t.toString() + \"MS \" + \" - \" + keyValue.toString() + lineReturn;\n\n\t\t\t \t\tif(j % 2 === 0){\n\n\t\t\t \t\t\tif(Number.isInteger(property.keyValue(j)) || Number.isInteger(property.keyValue(j)[0]) ){\n\t\t\t\t \t\t\tvar x1,x2,y1,y2;\n\t\t\t\t \t\t\tvar t1 = property.keyTime(j-1);\n\t\t\t\t \t\t\tvar t2 = property.keyTime(j);\n\t\t\t\t \t\t\tif (Number.isInteger(property.keyValue(j)[0])){\n\t\t\t\t \t\t\t\tvar val1 = property.keyValue(j-1)[0] + property.keyValue(j-1)[1];\n\t\t\t\t\t\t\t\t\tvar val2 = property.keyValue(j)[0] + property.keyValue(j)[1];\n\t\t\t\t\t\t\t\t\tif(property.keyValue(j)[2]){\n\t\t\t\t\t\t\t\t\t\tval1 += property.keyValue(j-1)[2];\n\t\t\t\t\t\t\t\t\t\tval2 += property.keyValue(j)[2];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t\t\t}else{\n\t\t\t\t \t\t\t\tvar val1 = property.keyValue(j-1);\n\t\t\t\t\t\t\t\t\tvar val2 = property.keyValue(j);\n\t\t\t\t \t\t\t}\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar delta_t = t2-t1;\n\t\t\t\t\t\t\t\tvar delta = val2-val1;\n\t\t\t\t\t\t\t\tvar avSpeed = Math.abs(val2-val1)/(t2-t1);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tif (val1<val2){ \n\t\t\t\t\t\t\t\t\tx1 = property.keyOutTemporalEase(j-1)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty1 = x1*property.keyOutTemporalEase(j-1)[0].speed / avSpeed;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\tx2 = 1-property.keyInTemporalEase(j)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty2 = 1-(1-x2)*(property.keyInTemporalEase(j)[0].speed / avSpeed);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (val2<val1){\n\t\t\t\t\t\t\t\t\tx1 = property.keyOutTemporalEase(j-1)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty1 = (-x1)*property.keyOutTemporalEase(j-1)[0].speed / avSpeed;\n\t\t\t\t\t\t\t\t\tx2 = property.keyInTemporalEase(j)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty2 = 1+x2*(property.keyInTemporalEase(j)[0].speed / avSpeed);\n\t\t\t\t\t\t\t\t\tx2 = 1-x2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (val1==val2){\n\t\t\t\t\t\t\t\t\tx1 = property.keyOutTemporalEase(j-1)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty1 = (-x1)*property.keyOutTemporalEase(j-1)[0].speed / ((property.maxValue-property.minValue)/(t2-t1)) ;\n\t\t\t\t\t\t\t\t\tx2 = property.keyInTemporalEase(j)[0].influence /100;\n\t\t\t\t\t\t\t\t\ty2 = 1+x2*(property.keyInTemporalEase(j)[0].speed / ((property.maxValue-property.minValue)/(t2-t1)));\n\t\t\t\t\t\t\t\t\tx2 = 1-x2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (x1 === y1 && x2 === y2){\n\t\t\t\t\t\t\t\t\twriteString += \"Linear\";\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\twriteString += \"Cubic-bezier(\" + x1.toFixed(2) + \", \" + y1.toFixed(2) + \", \" + x2.toFixed(2) + \", \" + y2.toFixed(2) + \")\" + lineReturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\twriteString += \"Can't calculate bezier on path anim\" + lineReturn;\n\t\t\t\t\t\t\t}\n\t\t\t \t\t\t\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \t\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t if (property.propertyType == PropertyType.INDEXED_GROUP || property.propertyType == PropertyType.NAMED_GROUP) {\n\t\t\t \n\t\t\t for (var d = 1; d <= property.numProperties; d++) {\n\t\t\t \tfindKeys(property.property(d));\n\t\t\t }\n\t\t\t }\n\t\t\t\n\t\t\t}\n\t\t\twriteString += paragraph;\n\t\t\tfindProperties(activeComp);\n\t\t\t \n\t\t\t\n\t\t\n\n\t\t\t\n\t\t}\n\t\t\n\t\teditText.text = writeString;\n\t}\n}", "title": "" }, { "docid": "2ed4d338c587c3a7e21eaf9c67120a48", "score": "0.52501297", "text": "function describeRule(rule) {\n var description = undefined\n if (rule.aliveBefore) {\n description = '<b>Die</b> if it'\n } else {\n description = '<b>Be born</b> if it'\n }\n\n function describeNeighborCount(count) {\n if (count == 1) return '1 neighbor'\n return count + ' neighbors'\n }\n\n /* Create a string describing the conditions of the rule in the most specific way possible */\n if (rule.minNeighborCount == 0 && rule.maxNeighborCount == 8) {\n description += ' is currently ' + (rule.aliveBefore? '<b>alive</b>': '<b>dead</b>')\n } else if (rule.minNeighborCount == rule.maxNeighborCount) {\n description += ' has <b>exactly ' + describeNeighborCount(rule.minNeighborCount) + '</b>'\n } else if (rule.minNeighborCount == 0) {\n description += ' has <b>' + describeNeighborCount(rule.maxNeighborCount) + ' or less</b>'\n } else if (rule.maxNeighborCount == 8) {\n description += ' has <b>at least ' + describeNeighborCount(rule.minNeighborCount) + '</b>'\n } else {\n description += ' has <b>' + rule.minNeighborCount + ' to ' + describeNeighborCount(rule.maxNeighborCount) + '</b>'\n }\n\n return description\n}", "title": "" }, { "docid": "8f2af3fc8b6894affa35b01b09560912", "score": "0.52344716", "text": "debug(el) {\n\t\tif (this.level >= 3) {\n\t\t\tconst color = \"\\x1b[33m%s\\x1b[0m\"\n\t\t\tconst log = \"Debug: \" + el\n\t\t\tconsole.log(color, log)\n\t\t}\n\t}", "title": "" }, { "docid": "d537c28465f652ac1495b950a2b3597f", "score": "0.5226625", "text": "function debug() {document.write('<div style=\"background:red;color:white;\">'+ this.buildExpandedUrl() +'</div>');}", "title": "" }, { "docid": "941303f66058ea7f8598041ff233ef12", "score": "0.5223218", "text": "function showDebugInfo() {\n\t\t\tconsole.log();\n\t\t}", "title": "" }, { "docid": "64a6400010a2e002f8dc310b4ca0113b", "score": "0.5223024", "text": "drawTrace() {\n super.drawTrace(this.trace, this.trace);\n }", "title": "" }, { "docid": "e0287ebe49f451ae29f0a8923758821a", "score": "0.52190423", "text": "function ruler(parsed) {\n let lineActivity = {};\n Object.keys(parsed).forEach(type => {\n switch (type) {\n case 'BreakStatement':\n case 'ReturnStatement':\n case 'YieldExpression':\n lineRules.addLines(type, 'SWAP', parsed[type], lineActivity);\n break;\n case 'FunctionDeclaration':\n case 'FunctionExpression':\n case 'ArrowFunctionExpression':\n case 'SwitchCase':\n lineRules.addLines(type, 'SCOPE', parsed[type], lineActivity);\n lineRules.addVariables(parsed[type], lineActivity);\n lineRules.addScopeName(parsed[type], lineActivity);\n break;\n case 'VariableDeclaration':\n lineRules.addLines(type, null, parsed[type], lineActivity);\n lineRules.addVariables(parsed[type], lineActivity);\n break;\n case 'CallExpression':\n case 'SwitchStatement':\n lineRules.addLines(type, 'VOID', parsed[type], lineActivity);\n break;\n default:\n lineRules.addLines(type, 'SCOPE', parsed[type], lineActivity);\n break;\n }\n });\n return lineActivity;\n}", "title": "" }, { "docid": "0f02bcfba53775f95b162d566f23eb8b", "score": "0.52120805", "text": "function addLine(){\n\t\t\tvar x = unCheck();\n\t\t\tvar y = check5(num3, line, W.spaces[num2]);\n\t\t\tswitch (y){\n\t\t\t\tcase \"diagonal1\":\n\t\t\t\t\t$(x + \".TL\").addClass(\"diagonal1\");\n\t\t\t\t\t$(x + \".MM\").addClass(\"diagonal1\");\n\t\t\t\t\t$(x + \".BR\").addClass(\"diagonal1\");\n\t\t\t\t\tline2 = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"diagonal2\":\n\t\t\t\t\t$(x + \".TR\").addClass(\"diagonal2\");\n\t\t\t\t\t$(x + \".MM\").addClass(\"diagonal2\");\n\t\t\t\t\t$(x + \".BL\").addClass(\"diagonal2\");\n\t\t\t\t\tline2 = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"horizontal\":\n\t\t\t\t\tif(num%9 < 3){\n\t\t\t\t\t\t$(x + \".TL\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".TM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".TR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(num%9 < 6){\n\t\t\t\t\t\t$(x + \".ML\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".MM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".MR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(x + \".BL\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".BM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".BR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\tline2 = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"vertical\":\n\t\t\t\t\tif (num%3 == 0){\n\t\t\t\t\t\t$(x + \".TL\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".ML\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BL\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(num%3 == 1){\n\t\t\t\t\t\t$(x + \".TM\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".MM\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BM\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(x + \".TR\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".MR\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BR\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\tline2 = 4;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f56cbc9d57880fcf7f0e694702ccc6a9", "score": "0.5206074", "text": "function print() {\n var allLines = \"[\";\n dataset.forEach(function(v, i, a) {\n allLines += \"{ base : { x : \" + v.base.x + \", y : \"\n + v.base.y + \"}, vector : { x : \" + v.vector.x + \", y : \"\n + v.vector.y + \"}, active = false, black = false, most = false},\";\n });\n allLines = allLines.substring(0, allLines.length - 1) + \"]\";\n console.log(allLines);\n }", "title": "" }, { "docid": "e89d1c73f74cc6ebcb05a9161ee9a2ad", "score": "0.52016956", "text": "printDebugLog() {\n this.printMemoryForDebug(this.memory, this.pointer);\n console.debug(`pointer is at ${this.pointer}`);\n console.debug(`relative base is ${this.base}`);\n console.debug(`flags: J:${this.flags.jumped ? 'X' : '-'}`);\n console.debug(`input queue: ${this.input}`);\n console.debug(`output queue: ${this.output}`);\n console.debug('');\n }", "title": "" }, { "docid": "7a5a6917cd8803e353984a76cff9c275", "score": "0.51998085", "text": "function printSettings() {\n\tconsole.log(\n\t\t'a_dir:', a_dir, ', a_col:', a_col, '\\n',\n\t\t't_dir:', t_dir, ', t_col:', t_col, '\\n',\n\t\t'g_dir:', g_dir, ', g_col:', g_col, '\\n',\n\t\t'c_dir:', c_dir, ', c_col:', c_col, '\\n', \n\t\t'x_dir:', x_dir, 'x_col:', x_col, '\\n', '\\n',\n\n\t\t'x_start:', x_start, ', y_start:', y_start, '\\n', \n\t\t\n\t\t'canvas_w:', canvas_w, ', canvas_h:', canvas_h, '\\n', '\\n',\n\n\t\t'dna_seq:', dna_seq\n\t);\n}", "title": "" }, { "docid": "4a25af5cd6b576d8e03be5e1d70a7975", "score": "0.518857", "text": "function setupDebug() {\n\t\t\t$('body').append('<div id=\"_debug\"><span class=\"_line\">0</span><span>Triggering events:</span><span class=\"_message\"></span></div>');\n\t\t\t$('#_debug').css({\n\t\t\t\tposition: 'fixed',\n\t\t\t\tbottom: 0,\n\t\t\t\tright: 0,\n\t\t\t\tbackground: '#ff0000',\n\t\t\t\tcolor: '#fff',\n\t\t\t\tpadding: 5,\n\t\t\t\tfontWeight: 'bold'\n\t\t\t});\n\t\t\t$('#_debug span').css({\n\t\t\t\tdisplay: 'block',\n\t\t\t\ttextAlign: 'right'\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "21dda977351bf146bdc4642fcd737779", "score": "0.5173557", "text": "function lines(){\n\n\tsetColors();\n\tstroke(colorOne,colorTwo,colorThree);\n\t//lines used to divide the space\n\t//line(0,0,500,500);\n\t//line(0,500,500,0);\n\t//line(0,250,500,250);\n\t//line(250,0,250,500);\n\n\t\n}", "title": "" }, { "docid": "ca0c40b06d2c9b3a1acf7306c8f2470b", "score": "0.51720643", "text": "function drawLineThroughShortTerm() {\n\t\t\t\t\t\ttaskStartColumn = -1;\n\t\t\t\t\t\ttaskEndColumn = 10;\n\t\t\t\t\t\tyPos = yPos + ySpaceIncrement;\n\t\t\t\t\t\tdrawTaskLine(canvas, context, taskStartColumn, taskEndColumn, xSpaceIncrement, yPos, parsedTask);\n\t\t\t\t\t}", "title": "" }, { "docid": "a2fac464a02166f6f64ba2ac84b021b7", "score": "0.5168503", "text": "dump () {\n\t\tconsole.log(this.name + \" : \" + this.type);\n\t\tconsole.log(\"\\tActions\", this.actions);\n\t\tconsole.log(\"\\tConditions\", this.conditions);\n\t\tconsole.log(\"\\tExpressions\", this.expressions);\n\t}", "title": "" }, { "docid": "ce0db4680cc0068cad85e1d79c65c5f4", "score": "0.51620734", "text": "function drawLine() {\n var i = term.width;\n while(i--) {\n term.blue(\"-\");\n }\n term.blue(\"\\n\");\n}", "title": "" }, { "docid": "403ca8af67e4564ee840b52b8d6b20c9", "score": "0.5156404", "text": "debug()\n {\n for (let i = 0; i < this.canvases.length; i++)\n {\n const canvas = this.canvases[i]\n console.log('yy-rendersheet: Sheet #' + (i + 1) + ' | size: ' + canvas.width + 'x' + canvas.height + ' | resolution: ' + this.resolution)\n }\n }", "title": "" }, { "docid": "0b360ffdc5b856d71ca32decdfc729e1", "score": "0.5139722", "text": "function drawLines() {\n}", "title": "" }, { "docid": "0b360ffdc5b856d71ca32decdfc729e1", "score": "0.5139722", "text": "function drawLines() {\n}", "title": "" }, { "docid": "2f39f646235b2da5a740aad896e71752", "score": "0.51389956", "text": "function appendLine (line) {\n\tline.ishidden = false;\n\tswitch (line.exclude) {\n\t\tcase 'rule':\n\t\t\tappendProblemLineExcludingRule(line);\n\t\t\tbreak;\n\t\tcase 'premises':\n\t\t\tappendProblemLineExcludingPremise(line);\n\t\t\tbreak;\n\t\tcase 'both':\n\t\t\tappendProblemLineExcludingBoth(line);\n\t\t\tbreak;\n\t\tcase 'allbutderived':\n\t\t\tappendProblemLineExcludingBoth(line);\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "fbfe8a973914fac2cd5b105b03d8e91e", "score": "0.5136958", "text": "help() {\n const lines = [];\n if (this.banner) { lines.unshift(`${this.banner}\\n`); }\n for (const rule of Array.from(this.rules)) {\n let spaces = 15 - rule.longFlag.length;\n spaces = spaces > 0 ? repeat(' ', spaces) : '';\n const letPart = rule.shortFlag ? `${rule.shortFlag}, ` : ' ';\n lines.push(` ${letPart}${rule.longFlag}${spaces}${rule.description}`);\n }\n return `\\n${lines.join('\\n')}\\n`;\n }", "title": "" }, { "docid": "b3599022ba17d2bd29d96a073273001f", "score": "0.51295656", "text": "display() {\n fill(this.color);\n\n triangle(this.x, this.y, this.x + 30, this.y - 55, this.x + 60, this.y);\n strokeWeight(7); //important for line to be visible\n strokeCap(SQUARE);\n stroke(this.color);\n\n //levitating line\n line(this.x, this.lineY - 30, this.x + 60, this.lineY - 30);\n\n //little eyes\n strokeWeight(3);\n stroke(\"white\");\n line(this.x + 10, this.y - 10, this.x + 20, this.y - 10);\n line(this.x + 30, this.y - 10, this.x + 40, this.y - 10);\n\n noStroke(); //reset so stroke doesn't carry into other creatures\n }", "title": "" }, { "docid": "38717ae4504299d94bcd4d58c88a4b3f", "score": "0.5128662", "text": "function showRules() {\n layer.open({\n type: 2,\n title: 'U Know Uno Rules',\n closeBtn: 1,\n area: ['400px', '600px'],\n shade: 0.5,\n shadeClose: true,\n content: ['/game/rules'],\n });\n}", "title": "" }, { "docid": "15475bcc50ffea738f5d7442b8c799b2", "score": "0.511946", "text": "function debug(string) {\n\tdocit(\"<b><font color='#FF2400'>\" + string + \"</font></b>\");\n}", "title": "" }, { "docid": "a68e58b47043592e3494ee77f433862e", "score": "0.51176023", "text": "processLine(myinline, printAllErrors) {\n\n if (printAllErrors !== false) {\n console.log( originalErrorColor (myinline ));\n }\n const myJson = JSON.parse(myinline); // convert String to object, then grab attributes\n const jsonKeys = Object.keys( myJson);\n const jMsg = this.getAttributeOrEmptyString( myJson.msg );\n const modulePart = this.getAttributeOrEmptyString( myJson.module); //grab module\n const eCode = this.parseErrorCode( /([\\d]{5})\\s*/, jMsg); //extract ERROR_CODE:ddddd from msg attribute;eCode = noErrorCode if not found;\n let detailMsg = '';\n let myTemplate = this.templateStrings[ eCode ];\n\n if (myTemplate != null) {\n detailMsg = this.processTemplate(jsonKeys, myTemplate, myJson ) ;\n }\n else {\n console.log( errorCodeColor('Message is missing errorCode; no template found: ' + myinline));\n return '';\n }\n\n const level = this.getLevel( myJson.level ); //grab level\n const shrIdPart = this.getAttributeOrEmptyString( myJson.shrId ); //grab shrId\n const mappingRulePart = this.getAttributeOrEmptyString( myJson.mappingRule ); //grab mappingRule\n const targetPart = this.getAttributeOrEmptyString( myJson.target ); //grab targetPart\n const targetSpecPart = this.getAttributeOrEmptyString( myJson.targetSpec ); //grab targetSpec\n\n switch (level) {\n case 'FATAL':\n case 'ERROR':\n codeColor = chalk.bold.redBright;\n break;\n case 'WARN':\n codeColor = chalk.bold.yellowBright;\n break;\n case 'INFO':\n codeColor = chalk.bold.whiteBright;\n break;\n case 'DEBUG':\n codeColor = chalk.bold.greenBright;\n break;\n default:\n codeColor = chalk.bold.whiteBright;\n }\n\n // now we have pieces; assemble the pieces into a formatted, colorized, multi-line message\n let outline = codeColor('\\n' + level + ' ' + eCode + ': ' + detailMsg ); // first part of new message is ERROR xxxxx: <<detail>>\n outline += errorDetailColor ( '\\n During: ' + this.translateNames( modulePart));\n // if parts are optional/missing, then only print them if they are found\n if (shrIdPart !== '') {\n outline += errorDetailColor( '\\n Class: ' + this.getUnqualifiedName(this.translateNames( shrIdPart)));\n }\n if ( targetSpecPart != '') {\n outline += errorDetailColor( '\\n Target Spec: ' + this.translateNames(targetSpecPart));\n }\n if ( targetPart != '') {\n outline += errorDetailColor( '\\n Target Class: ' + this.translateNames(targetPart));\n }\n if ( mappingRulePart != '') {\n outline += errorDetailColor( '\\n Mapping Rule: ' + this.translateNames( mappingRulePart)) ;\n }\n // lookup the suggested fix using eCode as the key\n let suggestedFix = this.solutionMap[ eCode ];\n if ( suggestedFix != null ) {\n suggestedFix = suggestedFix.replace(/'/g, '').trim() ;\n // only print suggested fix if it's available from the resource file (i.e. in the solutionMap)\n if (suggestedFix !== 'Unknown' && suggestedFix !== '') {\n outline += errorDetailColor( '\\n Suggested Fix: ' + suggestedFix.trim());\n }\n }\n const myDedupHashKey = this.buildHashKey( eCode, this.ruleMap, myJson ) ;\n\n if (myDedupHashKey === '' || this.showDuplicateErrors || printAllErrors) { // if you have no keys for deduplication in errorMessages.txt for this, print everything\n return [outline, outline];\n }\n else if (this.idSet.has(myDedupHashKey)) {\n let consoleOutput;\n // If more than deduplicationNumber errors of the same code are logged, start suppressing\n if (this.errorCount[myDedupHashKey] === deduplicationNumber) {\n consoleOutput = '\\nOver ' + deduplicationNumber + ' logs with code ' + eCode + '. Suppressing further output of this code. Full logs can be found in out.log.';\n consoleOutput = chalk.bold.magentaBright(consoleOutput);\n } else if (this.errorCount[myDedupHashKey] > deduplicationNumber) {\n consoleOutput = '';\n } else {\n consoleOutput = outline;\n }\n this.errorCount[myDedupHashKey] += 1;\n return [consoleOutput, outline];\n\n }\n else {\n this.idSet.add(myDedupHashKey);\n this.errorCount[myDedupHashKey] = 1;\n return [outline, outline];\n }\n }", "title": "" }, { "docid": "4300bfae177547109205fac7bc539a26", "score": "0.51087874", "text": "function checkLines() {\n for (var y = 0; y < dimention[1]; y++) {\n var lineComplete = field[y].every(function(cell, x) {\n return field[y][x] === field[y][(x + 1) % dimention[0]];\n });\n // ..and if so, blow the line up\n if (lineComplete) {\n if (debug) { Render.drawState(field); debugger; }\n for (var x = 0; x < dimention[0]; x++) {\n field[y][x] = Render.isNeutral(x, y) ? 0 : -field[y][x];\n }\n if (debug) { Render.drawState(field); debugger; }\n // ..and make all top blocks fall\n if (dir === 1) { // ..down\n for (var row = y - 1; row >= 0; row--) {\n moveLineDown(row);\n }\n } else { // ..up\n for (var row = y + 1; row < dimention[1]; row++) {\n moveLineDown(row);\n }\n }\n if (debug) { Render.drawState(field); debugger; }\n }\n }\n }", "title": "" }, { "docid": "6107368bc3b4a210b9afc899d9c8ed8e", "score": "0.51084274", "text": "function drawDebugInfo() {\n\tfill(255);\n\ttext(\"x: \"+ mouseX + \" y: \" + mouseY, 100, height-2);\n}", "title": "" }, { "docid": "237b863f145fb0d7928d68006e9233fb", "score": "0.5106905", "text": "function showRule(rule)\n{\n dhtml.getElementById(\"name\").value = rule.rule_name.value;\n dhtml.getElementById(\"sequence\").value = rule.rule_sequence.value;\n\n\tvar processRule = false;\n\tif(rule.rule_state.value.indexOf(\"ST_EXIT_LEVEL\") > 0)\n\t\tprocessRule = true;\n\n\tdhtml.getElementById(\"stop_processing_more_rules\").checked = processRule;\n\n \n if(rule.rule_condition.restype && rule.rule_condition.restype.value == \"RES_AND\") {\n\t\t// first try the condition as a single condition (with multiple restrictions)\n\t\tif (showCondition(rule.rule_condition) == false){\n\t\t\t// it wasn't a single condition...\n\t for(var i=0; i< rule.rule_condition.restriction.length; i++) {\n\t\t if(showCondition(rule.rule_condition.restriction[i]) == false) {\n\t\t\t alert(_(\"Unable to load a rule condition\"));\n\t\t\t\t}\n\t }\n\t\t}\n } else {\n if(showCondition(rule.rule_condition) == false) {\n alert(_(\"Unable to show the rule condition\"));\n return false;\n }\n }\n \n if(rule.rule_actions.length != 1) {\n alert(_(\"Unable to show a rule with more than one action\"));\n return false;\n }\n \n if(showAction(rule.rule_actions[0], rule.rule_state) == false) {\n alert(_(\"Unable to show the rule action\"));\n return false;\n }\n}", "title": "" }, { "docid": "028d1d645f9fb8b22f9cbe0cbd794efe", "score": "0.51040435", "text": "debug() {\n\t const vm = this.vm;\n\t if (vm.isWaitingForAnswer)\n\t return;\n\t this._stepOverCurrentLine();\n\t //continue to execute until it stops at another break point\n\t vm.state = vm.debugStateStart;\n\t return vm.state.debug();\n\t }", "title": "" }, { "docid": "3992a5861b930477f2146d2123e1cc98", "score": "0.50982106", "text": "function debugging() {\r\n\tvar setup = x2.loadPERPacket('/home/eyalc/x2-tests/test1-singlecell-HCANR-goodERFCAN/setup.per', true);\r\n\tvar deletep = x2.loadPERPacket('/home/eyalc/x2-tests/test1-singlecell-HCANR-goodERFCAN/delete_cell.per', true);\r\n\tvar add = x2.loadPERPacket('/home/eyalc/x2-tests/test1-singlecell-HCANR-goodERFCAN/add_cells.per', true);\r\n\tvar setupHelper = new ASNPathHelper(setup);\r\n\tvar addHelper = new ASNPathHelper(add);\r\n\tvar deleteHelper = new ASNPathHelper(deletep);\r\n\t\r\n\tprint('setup.per');\r\n\tprint(setupHelper.printSubtree());\r\n\tprint('add.per');\r\n\tprint(addHelper.printSubtree());\t\r\n\tprint('delete.per');\r\n\tprint(deleteHelper.printSubtree());\r\n}", "title": "" }, { "docid": "7ff7ab6263288c6056de3ef45ba22683", "score": "0.50969696", "text": "display()\n{\n//name space bodyA and bodyB position\nvar pointA = this.chain.bodyA.position;\nvar pointB = this.chain.bodyB.position;\n//make the constraint visible\nstrokeWeight(4);\nline(pointA.x,pointA.y,pointB.x,pointB.y);\n\n\n\n}", "title": "" }, { "docid": "b1929b9923127b236f82c8f13d9e9416", "score": "0.50934553", "text": "show () {\n stroke(255);\n line(this.initial.x, this.initial.y, this.final.x, this.final.y)\n }", "title": "" }, { "docid": "b98b00c5cd97eba67041903139a7e4e7", "score": "0.5086199", "text": "function Graphic2()\n{\n console.log(\"\\x1b[40m\\x1b[5m \");\n console.log(\".Z$ZZZOO8Z?. .$ \");\n console.log(\" ++....7O+ ~Z . \");\n console.log(\" .++. Z?.. OODOI. 7 ZD$Z8 .OINO. .O. .$:.. .ZOI. ..Z++ZI .$8DO \");\n console.log(\" .+?. $O I$ .$? .$Z 8. ? Z. ..Z, Z8.. Z =.ZZ. ,Z 7 O: \");\n console.log(\" .I? $$ ZO .$ I.I= $I Z$ $I. $ZO. $ ..Z..?+. ZZ $: \");\n console.log(\"..88Z$$$+:+ $8 .=~?$ 7Z7+ Z$..:O7Z $O. $7 Z..Z:7. .ID8O7+ II .Z$OZ7IOO,. \");\n console.log(\" =Z. .. I, +7 ?7. $: ?= I.. = := I,. 8 ..$Z. .$ .?7. $ :7 I: . \");\n console.log(\" .=~ :. ~: ??7. .,,. 7+..I ,=~,I .. + : +7 ==.. +?=:$ I?~?7 \");\n console.log(\" .$O,:,:~, . . . . .=. ,:=. \");\n console.log(\" . \");\n console.log(\" ______ _______ __ _ _______ _______ _____ _______ \");\n console.log(\" | ____ |______ | \\\\ | |______ |______ | |______ \");\n console.log(\" |_____| |______ | \\\\_| |______ ______| __|__ ______| \");\n console.log(\" \\x1b[0m\\n\\n\");\n\n}", "title": "" }, { "docid": "e5c2202bfaaa376c4f4a9343b38d7da4", "score": "0.5084086", "text": "function factsDebug() {\n\tvar temp=\"\";\n\tfor (i in factlist) {\n\t\ttemp += factlist[i].id+\" \"+factlist[i].name+\":: \"+factlist[i].value+\"<br>\";\n\t}\n\tvar title=\"<br><text> Fact Debug </text><br>\";\n\tdocument.getElementById(\"fact_debug\").innerHTML = title+\"<text>\"+temp+\"</text>\"+\"<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><text>DEBUG</text>\";\n}", "title": "" }, { "docid": "7f29f3e642987bb97319eb8704048979", "score": "0.50835645", "text": "function writelnColor(){\n\t\tfor(var i=0; i<arguments.length; i=i+2)\n\t\t\tgrunt.log.write(arguments[i][arguments[i+1]]);\n\t\tgrunt.log.writeln('');\n\t}", "title": "" }, { "docid": "ea75222321047acd5b7c5527a1597848", "score": "0.5076655", "text": "function rulesScreen() {\n fill(255, 0, 0);\n textFont(myFont, 30);\n textAlign(LEFT);\n text(\"WELCOME TO THE CABIN OF THE CATEGORICAL IMPERATIVE.\", 10, 20);\n text(\"YOU ARE TRAPPED HERE FOR THE NEXT 72HRS WITH ONLY A SINGLE GLASS OF\", 10, 40);\n text(\"WATER, AND THE VOICE OF KANTIAN REASON.\", 10, 60);\n text(\"ACCOMPANIED BY A MAN DYING OF THIRST YOU ARE LEFT WITH MANY CHOICES.\", 10, 80);\n text(\"WHAT WILL YOU DO?\", 10, 100);\n text(\"TO MAKE A CHOICE CLICK 'C'\", 10, 140);\n}", "title": "" }, { "docid": "84b658c92fd8040f85dc8826f4116dfa", "score": "0.50565815", "text": "print() {\n if (this.remainingEdges.length > 0) {\n console.error(\"Oooops, could not remove every edge. Trying to find which one, and advice some solutions...\");\n\n for (let edge of this.remainingEdges) {\n console.error(\"Not removable edge: \" + edge.v + \" -> \" + edge.w + \" , searching among the existing cycles.\");\n\n let validCycles = this._findEdgeInCycles(this.cycles, edge);\n\n if (validCycles.length === 0) {\n console.error(\"No cycle contains this edge. This might be normal, try to increase maxCycleLength using the program argument!\");\n } else {\n console.error(\"!!Bug in the code!!, we found \" + validCycles.length + \" cycles containing the edge, these are the following\");\n validCycles.forEach(path => console.error(path));\n }\n }\n }\n }", "title": "" }, { "docid": "646da3853641541355c276609066dcce", "score": "0.50565", "text": "display() {\n line(this.start.x, this.start.y, this.end.x, this.end.y);\n }", "title": "" }, { "docid": "8f2b0c8e1395f05ad2695821e35f6c16", "score": "0.5020925", "text": "p5display() {\n this.nodes.forEach(node => {\n node.draw();\n })\n\n strokeWeight(1)\n\n this.edges.forEach(edge => {\n let realNode1 = this.nodes.find(node => node.name === edge.node1);\n let realNode2 = this.nodes.find(node => node.name === edge.node2);\n\n line(realNode1.x, realNode1.y, realNode2.x, realNode2.y);\n })\n }", "title": "" }, { "docid": "22143720980cec117639fcf4d5716011", "score": "0.5020857", "text": "function mediumDebug(obj) {\n 'use strict';\n\n var msg = '',\n property,\n cad;\n\n for (property in obj) {\n if (typeof obj[property] === 'function') {\n var inicio = obj[property].toString().indexOf('function'),\n fin = obj[property].toString().indexOf(')') + 1,\n propertyValue = obj[property].toString().substring(inicio, fin);\n\n msg += (typeof obj[property]) + ' ' + property + ' : ' + propertyValue + ' ;\\n';\n\n } else if (typeof obj[property] === 'unknown') {\n msg += 'unknown ' + property + ' : unknown ;\\n';\n\n } else if (typeof obj[property] === 'object') {\n cad = (typeof obj[property]) + ' ' + property + ' : ' + obj[property];\n //msg += (typeof obj[property])+' '+property+' : '+lightDebug(obj[property])+' ;\\n';\n //msg +='\\n'+ cad +' ;\\n' + '*** INICIO ' + cad + '****\\n{\\n' + lightDebug(obj[property],true) + '}\\n**** FIN ' + cad + ' *******\\n';\n msg += cad + '{\\n' + lightDebug(obj[property], true) + '\\n}\\n';\n } else {\n msg += (typeof obj[property]) + ' ' + property + ' : ' + obj[property] + ' ;\\n';\n //myAlert (inspeccionar2(obj[property]));\n }\n\n }\n return msg;\n}", "title": "" }, { "docid": "a7cdad4eac91dd807a5d0d310fe4f553", "score": "0.5018826", "text": "function debug(msg){\n\n \t// comment out the below line while debugging\n \t \t//console.log(msg);\n }", "title": "" }, { "docid": "2499599393dbdfc2d4a7d44608e32dbf", "score": "0.5018265", "text": "function drawDebug() {\n ctx.font = \"11px monospace\";\n ctx.fillStyle = \"#777777\";\n //text, x position, y position\n ctx.fillText(\"DEBUG MODE\", 10, 15);\n ctx.fillText(\"upPressed: \"+upPressed, 15, 30);\n ctx.fillText(\"leftPressed: \"+leftPressed, 15, 45);\n ctx.fillText(\"rightPressed: \"+rightPressed, 15, 60);\n ctx.fillText(\"x: \"+x, 15, 75);\n ctx.fillText(\"dx: \"+dx, 15, 90);\n ctx.fillText(\"y: \"+y, 15, 105);\n ctx.fillText(\"dy: \"+dy, 15, 120);\n ctx.fillText(\"fuelout: \"+fuelout, 15, 135);\n ctx.fillText(\"landed: \"+landed, 15, 150);\n ctx.fillText(\"crashed: \"+crashed, 15, 165);\n ctx.fillText(\"landedVelocityY: \"+landedVelocityY, 15, 180);\n ctx.fillText(\"landedVelocityX: \"+landedVelocityX, 15, 195);\n ctx.fillText(\"thrustArrow: \"+thrustArrow, 15, 210);\n if (thrustArrow > gravity){\n ctx.fillText(\"Thrust is greater than gravity\", 15, 225);\n }else{\n ctx.fillText(\"Thrust less than gravity\", 15, 225);\n }\n ctx.fillText(\"MouseX = \" + canvas_x, 15, 240);\n ctx.fillText(\"MouseY = \" + canvas_y, 15, 255);\n ctx.fillText(\"WindowHeight = \" + window.innerHeight, 15, 270);\n ctx.fillText(\"WindowWidth = \" + window.innerWidth, 15, 285);\n ctx.fillText(\"levelnum = \" + levelnum, 15, 300);\n ctx.fillText(\"fuel= \" + fuel, 15, 315);\n ctx.fillText(\"shadowsize= \" + shadowsize, 15, 330);\n}", "title": "" }, { "docid": "98ac8ec4e142f1b9bc4e350c77c555ad", "score": "0.4999773", "text": "traceDebug(message, object) {\n if (this.traceLevel >= 2) {\n let stack = ` len(stack)=${this.stack.length} `;\n if (this.traceLevel >= 3) {\n stack = this.stack.map(n => n.v);\n }\n let registers = `(x:${this.x},y:${this.y})`;\n console.log(registers, stack, message, object);\n }\n }", "title": "" }, { "docid": "e3a4a6a68471dab050140933f9ceb96c", "score": "0.49890858", "text": "display() {\r\n\t\tvar pointA=this.rope.bodyA.position\r\n\t\tvar pointB=this.rope.bodyB.position\r\n\t\t\r\n\t\t\tstrokeWeight(2);\r\n\t\t\t\r\n\t\t\tline(300,100,ball1.position.x,ball1.position.y);\r\n\t\t\tline(350,100,ball2.position.x,ball2.position.y);\r\n\t\t\tline(400,100,ball3.position.x,ball3.position.y);\r\n\t\t\tline(450,100,ball4.position.x,ball4.position.y);\r\n\t\t\tline(500,100,ball5.position.x,ball5.position.y);\r\n\t\t\t}", "title": "" }, { "docid": "58ca1e2fd9bcb83267fa1ba2d6ecca7c", "score": "0.49826038", "text": "function ShowDetectLine() {\n\t//ClearDetectLine()\n\tfor(control of controllist){\n\t\tchartx = chartlist[controllist.indexOf(control)],\n\t\tsbss = 0, aps = 0, hid = 0;\n\t\tfor(var detect of NODE[dest].inter){\n\t\t\tif(showrolelist.indexOf(NODE[detect]['role']) != -1){\n\t\t\t\tvar p = chartx.append(\"path\")\n\t\t\t\t\t.attr(\"d\", line([[NODE[dest].x, NODE[dest].y, NODE[dest].z], [NODE[detect].x, NODE[detect].y, NODE[detect].z]]))\n\t\t\t\t\t.attr(\"class\", \"mouse-line_\" + control + src + '_' + dest)\n\t\t\t\t\t.style(\"stroke-width\", \"1px\")\n\t\t\t\t\t.style(\"opacity\", \"0.5\");\n\t\t\t\tif(NODE[detect].act == 'AP') aps++;\n\t\t\t\tif(NODE[detect].bss == NODE[dest].bss){\t// AP\n\t\t\t\t\tp.style(\"stroke\", \"black\");\n\t\t\t\t\tsbss++;\n\t\t\t\t}else if(NODE[src].inter.indexOf(detect) == -1){\t// Hidden terminal for UL\n\t\t\t\t\tp.style(\"stroke\", \"red\");\n\t\t\t\t\thid++;\n\t\t\t\t}else p.style(\"stroke\", \"black\");\t// other\n\t\t\t}\n\t\t}\n\t}\n\n\tpresource = src\n\tpredestination = dest\n}", "title": "" }, { "docid": "9e87d101c8cc9eda8b38da6fff0209f9", "score": "0.49818355", "text": "function algo(){\n console.log('Mensaje antes del Trace'); //Es como el rastreo\n console.trace();\n}", "title": "" }, { "docid": "bd13c078f1ebfcd838d5cdb88749829a", "score": "0.49794537", "text": "function print(maze) {\n\tfor(var y=0;y<maze.length;y++) {\n\t\tvar str = \" \";\n\t\tfor(var x=0;x<maze.length;x++) {\n\t\t\tstr += maze[x][y] == true ? \"#\" : \" \";\n\t\t}\n\t\tconsole.log(str);\n\t}\n}", "title": "" }, { "docid": "384994c231d9bad62c0a7a44d650e793", "score": "0.49785313", "text": "DrawScore() {\n /// char score[512];\n /// sprintf(score, \"Score: %d, Remaining Oil %d\",\n /// m_listener.GetScore(), m_listener.GetOil());\n /// const char *lines[] = { score, \"Move: a,s,d,w Fracking Fluid: e\" };\n /// for (uint32 i = 0; i < B2_ARRAY_SIZE(lines); ++i)\n /// {\n /// m_debugDraw.DrawString(5, m_textLine, lines[i]);\n /// m_textLine += DRAW_STRING_NEW_LINE;\n /// }\n testbed.g_debugDraw.DrawString(5, this.m_textLine, `Score: ${this.m_listener.GetScore()}, Remaining Oil ${this.m_listener.GetOil()}`);\n this.m_textLine += testbed.DRAW_STRING_NEW_LINE;\n testbed.g_debugDraw.DrawString(5, this.m_textLine, \"Move: a,s,d,w Fracking Fluid: e\");\n this.m_textLine += testbed.DRAW_STRING_NEW_LINE;\n }", "title": "" }, { "docid": "dface6bbc831215f1de2bf58d6569232", "score": "0.49774188", "text": "function je(){return G(\"debugger\"),H(),pt.createDebuggerStatement()}", "title": "" }, { "docid": "990e267b9895b506ba6b61424be983c0", "score": "0.49760222", "text": "function trace(txt) {\r\n\tif (DEBUG_MODE) { \r\n\t\tconsole.log(txt);\r\n\t}\r\n}", "title": "" }, { "docid": "808327a723aec25e5618cc062089a75c", "score": "0.49752653", "text": "function a(condition, color) {\n af($.trace.where(condition), color, condition);\n}", "title": "" }, { "docid": "59b4779a9d3c5f4c4355f14183dea386", "score": "0.49743706", "text": "function drawOutline(x,y)\n\t\t{\n\t\t\toutlines[lowestUnusedOutline].visible = true\n\t\t\toutlines[lowestUnusedOutline].position.set(x,y,0.)\n\t\t\t++lowestUnusedOutline\n\t\t\tconsole.assert( lowestUnusedOutline < outlines.length )\n\t\t}", "title": "" }, { "docid": "653148117886e92d645fddae87c9e459", "score": "0.4971913", "text": "function renderScaffolding() {\n ctx.beginPath();\n for (var i=0; i<spans.length; i++) {\n var s = spans[i];\n if (s.visibility === \"hidden\") {\n ctx.strokeStyle=\"pink\";\n ctx.moveTo(s.p1.cx, s.p1.cy);\n ctx.lineTo(s.p2.cx, s.p2.cy);\n }\n }\n ctx.stroke();\n}", "title": "" }, { "docid": "f1536b17f42f00ce58ceace79f15342d", "score": "0.49697426", "text": "function writeAdvice(context, level) {\n var adviceLine1 = \"\";\n var adviceLine2 = \"\";\n\n if (level == \"red\") {\n adviceLine1 = \"Please consult with your financial\";\n adviceLine2 = \"planner urgently.\";\n } else if (level == \"yellow\") {\n adviceLine1 = \"Please consult your financial planner\";\n adviceLine2 = \"in 6-8 weeks.\";\n } else if (level == \"green\") {\n adviceLine1 = \"You are doing a good job keeping your credit limit.\";\n }\n\n context.fillText(\"Your credit level is \" + level + \".\", 25, 380);\n context.fillText(adviceLine1, 25, 410);\n context.fillText(adviceLine2, 25, 440);\n}", "title": "" }, { "docid": "bddbb49bf3f93a7f4d8a04c5a98c1a22", "score": "0.4969377", "text": "drawResults(poses) {\n for (const pose of poses) {\n this.drawResult(pose);\n\n let leftColor = \"white\"\n let rightColor = \"white\"\n if (window.gameLeftMove()) {\n leftColor = \"red\"\n }\n if (window.gameRightMove()) {\n rightColor = \"red\"\n }\n // horizontal line for reference\n const nose = pose.keypoints[0]\n if (nose.score > scoreThreshold) {\n // path from nose to right end\n this.drawLine(nose, { x: 0, y: nose.y }, rightColor)\n // path from nose to left end \n this.drawLine(nose, { x: this.video.videoWidth, y: nose.y }, leftColor)\n }\n }\n }", "title": "" }, { "docid": "f2d16ad2017bae9730a7656c6d0fd9f9", "score": "0.4961787", "text": "printSolution( color ) {\n\n console.log(\"Solution Exists: Following are the assigned colors\");\n let str = \"\";\n for (let i = 0; i < this.v; i++) {\n str += color[i] + \" \";\n }\n console.log(str);\n }", "title": "" }, { "docid": "2a5152bf457a81f7797ce0f0218cf25d", "score": "0.49534222", "text": "_motd() {\n global.Console.log(this.separator1);\n global.Console.log(global.Console.color(this.GorgonConfig.data.motd, 'yellow'));\n global.Console.log(this.separator1);\n }", "title": "" }, { "docid": "0ca277e449d49b63a665ed9db1964875", "score": "0.49523082", "text": "report() {\n\t\tsuper.report();\n\t\tconsole.log(`there are ${Snake.prototype.count} snakes.`)\n\t}", "title": "" }, { "docid": "a890385378bd720f0264aa1a5870573c", "score": "0.49461895", "text": "function line () {\n var sp1 = document.createElement('br')\n document.getElementById('console').appendChild(sp1)\n}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.49398634", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.49398634", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.49398634", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.49398634", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.49398634", "text": "function Line() {}", "title": "" }, { "docid": "bf22ab8ced774627b14a4230c1edf176", "score": "0.49313295", "text": "function Fa(e){for(var t=e.display,a=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r=t.view[n],f=void 0;if(!r.hidden){if(vo&&wo<8){var o=r.node.offsetTop+r.node.offsetHeight;f=o-a,a=o}else{var i=r.node.getBoundingClientRect();f=i.bottom-i.top}var s=r.line.height-f;if(f<2&&(f=ya(t)),(s>.005||s<-.005)&&(O(r.line,f),Ba(r.line),r.rest))for(var c=0;c<r.rest.length;c++)Ba(r.rest[c])}}}", "title": "" }, { "docid": "ee34be19df50780b42edfd1154226981", "score": "0.49239254", "text": "display(){\n //Sets the fill color to this.color\n ctx.fillStyle = this.color;\n //Starts drawing the border with a line width of 5\n ctx.beginPath();\n ctx.lineWidth = 5;\n //Draws a blue line from the first corner to the last\n ctx.moveTo(this.borders[0],this.borders[1]);\n\n for (var i = 2; i < (this.borders.length); i += 2){\n ctx.lineTo(this.borders[i],this.borders[i+1]);\n }\n //Closes the room by drawing from the last corner to the first\n ctx.lineTo(this.borders[0],this.borders[1]);\n //Sets the line color to blue\n ctx.strokeStyle = \"blue\";\n ctx.stroke();\n //fills in the borders with this.color\n ctx.fill();\n\n }", "title": "" }, { "docid": "c01308b3dca1a2fc53fc633dccbe0595", "score": "0.49235776", "text": "function createGoalLine()\n{\n // lower goal line\n line(0, goalFrequency + goalLineDifference, canvasWidth, goalFrequency + goalLineDifference);\n\n // upper goal line\n line(0, goalFrequency - goalLineDifference, canvasWidth, goalFrequency - goalLineDifference);\n\n // display the current note\n text(goalNote, width / 2.15, goalFrequency - 30);\n\n // display number of the current octave next to the current note\n text(currentOctave, width / 1.85, goalFrequency - 30);\n}", "title": "" }, { "docid": "e87462b1980ed7eb4320b555071c385e", "score": "0.4920878", "text": "function PatchLine() { }", "title": "" }, { "docid": "accdb01a9c1d380e7302782da37b845d", "score": "0.49175408", "text": "show()\n\t{\n\t\tif(mode == 1)\n\t\t{\n\t\t\tif(score >= 105)\n\t\t\t{\n\t\t\t\tstroke(255);\n\n\t\t\t\tif (score >= 120)\n\t\t\t\t{\n\t\t\t\t\tstrokeWeight(1);\n\n\t\t\t\t\tif(score >= 135)\n\t\t\t\t\t{\n\t\t\t\t\t\tstrokeWeight(0.1);\n\t\t\t\t\t\tif(score >= 150)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnoStroke();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(mode == 2)\n\t\t{\n\t\t\tif(score >= 70)\n\t\t\t{\n\t\t\t\tstroke(255);\n\n\t\t\t\tif (score >= 80)\n\t\t\t\t{\n\t\t\t\t\tstrokeWeight(1);\n\n\t\t\t\t\tif(score >= 90)\n\t\t\t\t\t{\n\t\t\t\t\t\tstrokeWeight(0.1);\n\t\t\t\t\t\tif(score >= 100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnoStroke();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(score >= 35)\n\t\t\t{\n\t\t\t\tstroke(255);\n\n\t\t\t\tif (score >= 40)\n\t\t\t\t{\n\t\t\t\t\tstrokeWeight(1);\n\n\t\t\t\t\tif(score >= 45)\n\t\t\t\t\t{\n\t\t\t\t\t\tstrokeWeight(0.1);\n\t\t\t\t\t\tif(score >= 50)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnoStroke();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfill(this.fadeR, this.fadeG, this.fadeB);\n\t\tellipse(this.x, this.y, this.r * 2);\n\t}", "title": "" }, { "docid": "aab7a04821e7217c24343dd408f771d7", "score": "0.4914722", "text": "function generateRules() {\n window.rules.forEach(rule => {\n switch (rule.type) {\n case 'show':\n window.showRule(rule);\n break;\n case 'valid':\n window.validRule(rule);\n break;\n default:\n }\n });\n}", "title": "" }, { "docid": "f10ae199e3ef052ecc676ff6d35c88fd", "score": "0.49127197", "text": "function addLine(){\n\t\t\tvar x = unCheck();\n\t\t\tvar y = check5(num, line, fill);\n\t\t\tswitch (y){\n\t\t\t\tcase \"diagonal1\":\n\t\t\t\t\t$(x + \".TL\").addClass(\"diagonal1\");\n\t\t\t\t\t$(x + \".MM\").addClass(\"diagonal1\");\n\t\t\t\t\t$(x + \".BR\").addClass(\"diagonal1\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"diagonal2\":\n\t\t\t\t\t$(x + \".TR\").addClass(\"diagonal2\");\n\t\t\t\t\t$(x + \".MM\").addClass(\"diagonal2\");\n\t\t\t\t\t$(x + \".BL\").addClass(\"diagonal2\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"horizontal\":\n\t\t\t\t\tif(num%9 < 3){\n\t\t\t\t\t\t$(x + \".TL\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".TM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".TR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(num%9 < 6){\n\t\t\t\t\t\t$(x + \".ML\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".MM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".MR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(x + \".BL\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".BM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".BR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"vertical\":\n\t\t\t\t\tif (num%3 == 0){\n\t\t\t\t\t\t$(x + \".TL\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".ML\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BL\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(num%3 == 1){\n\t\t\t\t\t\t\t$(x + \".TM\").addClass(\"vertical\");\n\t\t\t\t\t\t\t$(x + \".MM\").addClass(\"vertical\");\n\t\t\t\t\t\t\t$(x + \".BM\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(x + \".TR\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".MR\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BR\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "af13388406deaa472b6ffacc90e5f302", "score": "0.49126354", "text": "function printSolution(pstx) {\n var nowX;\n var nowY;\n var nextX;\n var nextY;\n var sol = knightsBoards;\n //tells square number and path debugging purpose\n for (var y = 0; y < grid_N; y++) {\n for (var x = 0; x < grid_N; x++) {\n var z = x + (y * 10);\n //console.log(sol[x][y]);\n //console.log(\"square \" + z);\n }\n }\n // look for path\n for (var i = 0; i < 100; ++i) {\n //current point\n for (var y = 0; y < grid_N; y++) {\n for (var x = 0; x < grid_N; x++) {\n if (sol[x][y] == i) {\n nowX = x;\n nowY = y;\n }\n }\n }\n //next point\n for (var y = 0; y < grid_N; y++) {\n for (var x = 0; x < grid_N; x++) {\n //console.log(sol[x][y])\n if (sol[x][y] == (i + 1)) {\n nextX = x;\n nextY = y;\n }\n }\n }\n // draw lines\n pstx.beginPath();\n pstx.moveTo(nowX * 85 + 43, nowY * 85 + 43);\n pstx.lineTo(nextX * 85 + 43, nextY * 85 + 43);\n pstx.stroke();\n }\n}", "title": "" }, { "docid": "2fa2686530da618578c1eae8c73ffd11", "score": "0.49088103", "text": "function showTrace() {\n function format( e, i ) {\n var f = \"<ul><li><em>name</em>: \";\n if( e[\"name\"] === undefined || e[\"name\"] === null ) f += \"anonymous\";\n else f += e[\"name\"];\n f +=\"</li><li><em>execution time</em>: \";\n if( i < Wrapper.log.length - 1 ) f += Wrapper.log[ i + 1 ][\"time\"] - e[\"time\"] + \" ms\";\n else f += \"N/A\";\n f += \"</li><li><em>arguments</em>: \";\n var args = e[\"args\"];\n for( var a = 0; a < args.length; a += 1 ) {\n f += args[ a ];\n if( a !== args.length ) f += \", \";\n }\n f += \"</li><li><em>return</em>: \";\n if( args[\"return\"] === undefined || args[\"return\"] === null ) f += \"void\";\n else f += args[\"return\"];\n f += \"</li></ul>\";\n return f;\n };\n \n var html = \"<html><head></head><body style='font-family:\\\"Courier new\\\"'><ol>\";\n var entries = Wrapper.log;\n for( var e = 0; e < Wrapper.log.length; e += 1 ) {\n html += \"<li>\" + format( entries[ e ], e ) + \"</li>\";\n }\n html += \"</ol></body></html>\";\n var sw = gui.create( \"WebWindow\" );\n if( Loco.wctx.os() !== \"MAC\") {\n sw.setParentWindow( mainWindow );\n sw.setWindowStyle( [\"dialog\"] );\n } else {\n sw.setParentWindow( mainWindow );\n sw.setWindowStyle( [\"drawer\"] );\n } \n sw.setHtml( html );\n sw.show();\n }", "title": "" } ]
0b8e7a8c6a95bac0684b6871676e36cb
Updates the graphical representations of the input
[ { "docid": "f5d59da5839a5b2da9b81f8c2818a89b", "score": "0.0", "text": "function render(event){\n renderList.update();\n}", "title": "" } ]
[ { "docid": "e0dfba6ace7e9ca61ae638bb6ff39cc8", "score": "0.66196156", "text": "update() {\n TitleRender(\n this.modelRoot.firstElementChild, \n \"uppercase\", \n this.model.getType())\n ControlPanelRender(\n this.modelRoot.firstElementChild.nextElementSibling, \n this.model.isAtStartState(), \n this.model.simulationIsFinished(),\n () => this.model.nextState(),\n () => this.model.previousState())\n StatusContainerRender(\n this.modelRoot.firstElementChild.nextElementSibling.nextElementSibling,\n this.model.getInfoStatusAndText(),\n this.model.input,\n idx => this.model.isCurrentInputIndex(idx))\n ModelRender(\n this.modelRoot.lastElementChild, \n this.model.toDot(), \n this.callbackFunction)\n }", "title": "" }, { "docid": "b597d7ec8277c4b858a45c16f8b12ff1", "score": "0.6582525", "text": "function updateValues(){\n\t\t$('#widthinput').siblings('p').html(getWidthInput());\n\t\t$('#heightinput').siblings('p').html(getHeightInput());\n\t\t$('#mineinput').siblings('p').html(getMineInput());\n\t}", "title": "" }, { "docid": "e28ae442d652a5b9a4f870f823fff515", "score": "0.65429044", "text": "function updGlyphs() { // apply model values to the DOM\n const lc = q.lc.value;\n const l = layouts[lc];\n const m = model[lc];\n if (!l) return;\n q.kbd.className = `lyt_geom_${geom[lc] || geom._}`;\n for (let i = 1; i < NK; i++) {\n const g0 = l[0][i];\n const g1 = m[0][i];\n const g2 = l[1][i];\n const g3 = m[1][i];\n if (g[i][0]) g[i][0].textContent = g0;\n if (g[i][1]) { g[i][1].value = g1; g[i][1].title = tip(g1); }\n if (g[i][2]) g[i][2].textContent = g2;\n if (g[i][3]) { g[i][3].value = g3; g[i][3].title = tip(g3); }\n }\n }", "title": "" }, { "docid": "e529ff399b1a41dd51d258af79732517", "score": "0.65343755", "text": "function update() {\n\n // Get user's drawing and resize it to 28x28 pixels\n var drawing = getDrawing();\n var resizedDrawing = resizeDrawing(drawing);\n\n // Show user how the network sees their drawing\n updateSmallCanvas();\n\n // Get network's prediction\n var pixels = getPixelValues(resizedDrawing);\n var results = network.getPrediction(pixels);\n\n // Show user the results\n updatePrediction(results.confidence, results.digit);\n updateBarChart(results.outputs);\n }", "title": "" }, { "docid": "25fd3020c720d9fbbd00fc16d10893d9", "score": "0.6531612", "text": "function updateGraphics() {\n userInteract({ updateGraphics: self.selectedGraphicsFormatVO().toObject() });\n }", "title": "" }, { "docid": "e952cac297c69fe0ebf7b4b3e0b27bad", "score": "0.6475633", "text": "function updateDisplay()\n{\n\tassert( stateInvariant() );\n\n\tvar text = \"0\";\n\n\t// for each state, we show a different text in the calculators display.\n\tif(STATE_INPUT_NUM1 == state)\n\t{\n\t\t// when inputting the first number, show the first number - if actually something \n\t\t// was inputted.\n\t\tif(inputA.length > 0)\n\t\t\ttext = inputA;\n\t}\n\telse if(STATE_INPUT_NUM2 == state)\n\t{\n\t\t// when inputting the second number, show the second number if actually\n\t\t// something was inputted for the second number. Otherwise, show the first\n\t\t// number.\n\t\tif(inputB.length > 0)\n\t\t\ttext = inputB;\n\t\telse\n\t\t\ttext = inputA;\n\t}\n\telse if(STATE_SHOWRES == state)\n\t{\n\t\t// when showing the result, .... show the result :-).\n\t\ttext = getResult();\n\t}\n\n\tvar numVal = \"\" + text;\n\tif(text.indexOf(\".\") == -1)\n\t\tnumVal = eval(text);\n\n\tvar precision = this.parameters(\"PRECISION\").value;\n\tif(precision > 0)\n\t\tnumVal = numVal.toFixed(precision);\n\n\tthis.layers('display').text = \"\" + numVal;\n\n\tassert( stateInvariant() );\n}", "title": "" }, { "docid": "264285085f9b01e4337d65494b56474a", "score": "0.64541495", "text": "function updateDisplay(){\n updatePointsOnGraph();\n if($('.plot-fit').prop(\"checked\")){\n updateBestFitDisplay(true);\n }\n else if($('.line').hasClass(\"selected-degree\") || $('.horizontal-line').hasClass(\"selected-degree\")){\n displayLine(model.getCoeffs(),false);\n }\n else{\n displayQuad(false);\n }\n //turnErrorDisplayOff();\n if($('.line').hasClass(\"selected-degree\") || $('.horizontal-line').hasClass(\"selected-degree\")){\n turnErrorDisplayOn(false);\n }\n else{\n turnQuadErrorDisplayOn();\n }\n displayErrorInfo();\n updateTable();\n updateEquation();\n graph();\n }", "title": "" }, { "docid": "ae3acd2b48dcaf87d54c27281eb4fa8d", "score": "0.64513075", "text": "function updateInputGraph(inputGraph,layoutGraph){_.each(inputGraph.nodes(),function(v){var inputLabel=inputGraph.node(v),layoutLabel=layoutGraph.node(v);if(inputLabel){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y;if(layoutGraph.children(v).length){inputLabel.width=layoutLabel.width;inputLabel.height=layoutLabel.height;}}});_.each(inputGraph.edges(),function(e){var inputLabel=inputGraph.edge(e),layoutLabel=layoutGraph.edge(e);inputLabel.points=layoutLabel.points;if(_.has(layoutLabel,\"x\")){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y;}});inputGraph.graph().width=layoutGraph.graph().width;inputGraph.graph().height=layoutGraph.graph().height;}", "title": "" }, { "docid": "43ca13c76cae09eceb8dfe861be212a3", "score": "0.6432285", "text": "function update() {\n console.log('update: collect inputs, compute and display results');\n var inputs = collectInputs();\n var outputs = computeOutputs(inputs);\n displayOuputs(outputs, inputs.round);\n updateLocation();\n updateTitle(outputs[\"dpar\"], inputs.round);\n}", "title": "" }, { "docid": "5a828b0010dacefa9b9ae242dfc65970", "score": "0.6321173", "text": "function update() {\n // Canvas update\n width = visWidth - margin.left - margin.right;\n height = visHeight - margin.top - margin.bottom;\n\n visContainer.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n /**\n * Computation.\n */\n // Updates that depend only on data change\n if (dataChanged) {\n }\n\n // brush.extent([[0, 0], [width, height]]);\n // brushContainer.call(brush);\n\n // Updates that depend on both data and display change\n layoutModels();\n\n pv.enterUpdate(modelData, visContainer, enterModels, updateModels, modelId, 'model');\n }", "title": "" }, { "docid": "a85a7ad5a0ca4115abc5e85dab8c31ac", "score": "0.62891686", "text": "update() {\n this.display();\n }", "title": "" }, { "docid": "2fb61dea6f204462418434286c01ac4a", "score": "0.6282294", "text": "update() {\n // Re-draw the SVG:\n var svgDocument = this.generator.parse(this.json);\n\n // Render it in the browser:\n this.document.getElementById('main').innerHTML = svgDocument.render();\n\n }", "title": "" }, { "docid": "0e863352f3d453c274ae12917aaf7b84", "score": "0.62435144", "text": "function updateOutput() {\r\n // Updating inner text of html components\r\n // to updated variables\r\n scoreDisplay.innerHTML = formatMillilitre(score);\r\n clicksDisplay.innerHTML = displayString.clicks + clicks.toString();\r\n multiplierDisplay.innerHTML = displayString.multiplier + multiplier.toString() + \"x\";\r\n scoreGainDisplay.innerHTML = displayString.scoreGain + formatMillilitre(scoreGain);\r\n averageScoreGainDisplay.innerHTML = displayString.averageScoreGain + formatMillilitre(averageScoreGain);\r\n multiplierMainDisplay.innerHTML = multiplier + \"x\";\r\n}", "title": "" }, { "docid": "6d2b2eb6d275d93d4e79313ee1c745ae", "score": "0.6231677", "text": "function updateGraphics() {\n\t\t// $log.log(preDebugMsg + \"updateGraphics()\");\n\t\tif(currentColors === null) {\n\t\t\tvar colors = $scope.gimme(\"GroupColors\");\n\t\t\tif(typeof colors === 'string') {\n\t\t\t\tcolors = JSON.parse(colors);\n\t\t\t}\n\t\t\tcurrentColors = legacyDDSupLib.copyColors(colors);\n\n\t\t\tif(!currentColors) {\n\t\t\t\tcurrentColors = {};\n\t\t\t}\n\t\t}\n\n\t\tif(currentColors.hasOwnProperty(\"skin\") && currentColors.skin.hasOwnProperty(\"text\")) {\n\t\t\ttextColor = currentColors.skin.text;\n\t\t}\n\t\telse {\n\t\t\ttextColor = \"#000000\";\n\t\t}\n\n\t\tif(haveHeatmap) {\n\t\t\tdrawHeatmap();\n\t\t}\n\t\telse {\n\t\t\tdrawCartesianPlot();\n\t\t}\n\t}", "title": "" }, { "docid": "4cd4901557534782d487e901a460c1cb", "score": "0.6223853", "text": "function updateDisplay () {\n var transformedVertices\n var scaledVertices\n var vertices\n\n // Clear the screen and draw initial stuff\n two.clear()\n\n // Draw the grid\n grid.draw(two)\n\n // Draw the untransformed shape\n if (currentShape === 'Triangle') {\n vertices = [new mt.Point(0, 0), new mt.Point(1, 0), new mt.Point(1, 1)]\n } else if (currentShape === 'Square') {\n vertices = [new mt.Point(0, 0), new mt.Point(1, 0), new mt.Point(1, 1), new mt.Point(0, 1)]\n }\n\n // Transform to screen coordinates and draw the untransformed shape\n scaledVertices = grid.scalePoints(vertices)\n mt.drawPath(two, scaledVertices, '#FF9E96', '#F45346')\n\n transformedVertices = []\n\n // Apply transformation matrix to each vertex (in grid space)\n for (var i = 0; i < vertices.length; i++) {\n transformedVertices.push(vertices[i].applyMatrix(matrix))\n }\n\n // Transform to screen coordinates and draw the transformed shape\n scaledVertices = grid.scalePoints(transformedVertices)\n mt.drawPath(two, scaledVertices, '#DAF791', '#A1D916')\n\n // Update screen\n two.update()\n }", "title": "" }, { "docid": "700ef228683da5c38e9c5c7572a2014d", "score": "0.62237793", "text": "function updateInputs() {\n line1Input.value = canvasContent.line1\n line2Input.value = canvasContent.line2\n line3Input.value = canvasContent.line3\n fontColorInput.value = canvasContent.fontColor\n backgroundColorInput.value = canvasContent.backgroundColor\n}", "title": "" }, { "docid": "92d42f5c491da406aef34d97bd33570b", "score": "0.6219499", "text": "function update() {\n // Canvas update\n width = visWidth - margin.left - margin.right;\n height = visHeight - margin.top - margin.bottom;\n\n visContainer.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n /**\n * Computation.\n */\n // Updates that depend only on data change\n if (dataChanged) {\n\n }\n\n // Updates that depend on both data and display change\n computeLayout(data);\n\n /**\n * Draw.\n */\n pv.enterUpdate(data, itemContainer, enterItems, updateItems, id, 'item');\n }", "title": "" }, { "docid": "12f4ab1050f3d7023fb8a25bd589179c", "score": "0.62103593", "text": "function update() {\n /**\n * Display area.\n */\n width = visWidth - margin.left - margin.right;\n height = visHeight - margin.top - margin.bottom;\n visContainer.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n axisScale.domain(colorScale.domain())\n .range([0, width]);\n\n /**\n * Draw.\n */\n visContainer.select('linearGradient').selectAll('stop')\n .data(colorScale.ticks().map((t, i, n) => ({ offset: `${100*i/n.length}%`, color: colorScale(t) })))\n .join('stop')\n .attr('offset', d => d.offset)\n .attr('stop-color', d => d.color);\n \n visContainer.selectAll('rect')\n .data([0])\n .join('rect')\n .attr('width', width)\n .attr('height', height / 2)\n .style('fill', 'url(#linear-gradient)');\n \n xAxisContainer.call(xAxis);\n }", "title": "" }, { "docid": "5e25a6549f3c0839bedb951b15226e9c", "score": "0.6197274", "text": "updateGraphics() {\n this.updateGraphicsCore();\n }", "title": "" }, { "docid": "d23a996660a9432357a281d4acfb149b", "score": "0.6191333", "text": "function redrawInterface() {\n\t\t//context.clear();\n\t\t//context.transform({'translateX':outputOffset.x, 'translateY':outputOffset.y});\n\t\t//context.rect('100%', '100%').fill(settings.backgroundColor);\n\n\t\t/*if (settings.showUi && settings.showGrid) {\n\t\t\trenderGrid(context, settings);\n\t\t}*/\n\n\t\trenderKnotwork(context, settings, cuts);\n\n\t\tif (settings.showUi) {\n\t\t\trenderCuts(context, settings, cuts);\n\t\t\trenderControlNodes(context, settings);\n\t\t}\n\n\n\t\t/*context.save();\n\t\tcontext.clearRect(0, 0, canvas.width(), canvas.height());\n\t\tcontext.translate(outputOffset.x, outputOffset.y);\n\n\t\t//Clear the work area.\n\t\tcontext.fillStyle = settings.backgroundColor;\n\t\tcontext.fillRect(0, 0, settings.cellSize * settings.columns, settings.cellSize * settings.rows);\n\n\t\tif (settings.showUi && settings.showGrid) {\n\t\t\trenderGrid(context, settings);\n\t\t}\n\n\t\trenderKnotwork(context, settings, cuts);\n\n\t\tif (settings.showUi) {\n\t\t\trenderCuts(context, settings, cuts);\n\t\t\trenderControlNodes(context, settings);\n\t\t}\n\n\t\tcontext.restore();*/\n\t}", "title": "" }, { "docid": "21d77e7b61d7535b7cbe81b85573ffef", "score": "0.6183456", "text": "updateExistingGraphics() {\n this.updateLoadIndicator();\n if (!this.hasFetchedTiles()) return;\n this.updateHistograms();\n this.updateScales();\n this.renderTrack();\n }", "title": "" }, { "docid": "f60dbc81afaf7febb0713c1f2dc24eac", "score": "0.61539227", "text": "update() {\n if (this.autoCover) this._updateAttributes();\n if (!this.displayTarget.isDirty) return;\n this.updateFrame(this.getFrames());\n }", "title": "" }, { "docid": "da3085c9bb3482ac860e5e6fb5689ae6", "score": "0.6128284", "text": "function updateInterface() {\n updateCornerColour();\n updateComputerSelection();\n updateScore();\n updateRoundMessage();\n}", "title": "" }, { "docid": "2e112a45f8ec1dfde95ed31e24562ba3", "score": "0.6066342", "text": "update() {\n\n // get new positions\n this.layout.layout(this.vertices, this.edges);\n // svg may have changed sizes\n let width,height;\n if(Object.keys(this.settings).indexOf(\"width\")>-1){\n width =this. settings.width;\n }else{\n width = this.svg.getBoundingClientRect().width;\n }\n if(Object.keys(this.settings).indexOf(\"height\")>-1){\n height =this. settings.height;\n }else{\n height = this.svg.getBoundingClientRect().height;\n }\n\n // update the scales' domains\n this.scales.x.domain(this.layout.horizontalRange).range([this.margins.left, width - this.margins.right]);\n this.scales.y.domain(this.layout.verticalRange).range([this.margins.top + 20, height -this. margins.bottom - 20]);\n this.scales.width=width;\n this.scales.height=height;\n\n // updateAxis.call(this);\n const xAxis = axisBottom(this.scales.x)\n .tickArguments(this.settings.xAxisTickArguments);\n\n this.svgSelection.select(\"#x-axis\")\n .transition()\n .duration(this.settings.transitionDuration)\n .call(xAxis);\n\n\n // call the private methods to create the components of the diagram\n\n if (this.settings.backgroundBorder > 0) {\n updateNodeBackgrounds.call(this);\n }\n\n updateNodes.call(this);\n updateBranches.call(this);\n updateBranches.call(this);\n\n }", "title": "" }, { "docid": "f51171795e2b884ee90a9fc033fe24e0", "score": "0.605778", "text": "function updateInterface(){\n if(selectedItem == \"Cub\"){\n parLabels[0].innerText = 'Indicati latura cubului:';\n \n parLabels[1].setAttribute('hidden', true);\n parInputs[1].setAttribute('hidden', true);\n parLabels[2].setAttribute('hidden', true);\n parInputs[2].setAttribute('hidden', true);\n }else{\n parLabels[0].innerText = 'Indicati baza mica a trapezului';\n\n parLabels[1].removeAttribute('hidden');\n parInputs[1].removeAttribute('hidden');\n parLabels[2].removeAttribute('hidden');\n parInputs[2].removeAttribute('hidden');\n }\n }", "title": "" }, { "docid": "dff70668325c3178aaee482380aa19ce", "score": "0.60510236", "text": "function update(data) {\n input.data = data;\n render(container, input);\n }", "title": "" }, { "docid": "2f4ea353d7f56f44f37ed3673e194629", "score": "0.6048124", "text": "update() {\n const { recomputedProps, padding, plotAreaWidth, plotAreaHeight } = this.props;\n\n // only update if we recomputed props that these rely on\n if (recomputedProps) {\n this.g.attr('transform', `translate(${padding.left} ${padding.top})`);\n this.g.select('rect')\n .attr('width', plotAreaWidth)\n .attr('height', plotAreaHeight);\n\n\n this.updateCircles();\n this.updateVoronoi();\n }\n\n this.updateHighlight();\n }", "title": "" }, { "docid": "437535a0b015beb221cb34c83c35d4da", "score": "0.60407895", "text": "function updateDisplay() {\n output.textContent = displayValue; \n steps.textContent = operationValue; \n}", "title": "" }, { "docid": "04f5c0dd5a105304562ba3a95dc6a01f", "score": "0.6032913", "text": "function update() {\r\n // Wrangle the data to be used.\r\n var filteredData = wrangleData(parameters.data);\r\n\r\n // Update the visualization.\r\n updateVis(filteredData); \r\n}", "title": "" }, { "docid": "ec107d2713f1e34660596e98c31f99e8", "score": "0.6025615", "text": "function updateGraphics() {\n\t\t// $log.log(preDebugMsg + \"updateGraphics()\");\n\t\tif(currentColors === null) {\n\t\t\tvar colors = $scope.gimme(\"ColorScheme\");\n\t\t\tif(typeof colors === 'string') {\n\t\t\t\tcolors = JSON.parse(colors);\n\t\t\t}\n\t\t\tcurrentColors = legacyDDSupLib.copyColors(colors);\n\n\t\t\tif(!currentColors) {\n\t\t\t\tcurrentColors = {};\n\t\t\t}\n\t\t}\n\n\t\tif(currentColors.hasOwnProperty(\"skin\") && currentColors.skin.hasOwnProperty(\"text\")) {\n\t\t\ttextColor = currentColors.skin.text;\n\t\t}\n\t\telse {\n\t\t\ttextColor = \"#000000\";\n\t\t}\n\n\t\tif(myCanvas === null) {\n\t\t\tvar canvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(canvasElement.length > 0) {\n\t\t\t\tmyCanvas = canvasElement[0];\n\t\t\t}\n\t\t}\n\t\tif(myCtx === null) {\n\t\t\tmyCtx = myCanvas.getContext(\"2d\");\n\t\t}\n\t\tmyCtx.clearRect(0,0, myCanvas.width, myCanvas.height);\n\n\t\tif(uCanvas === null) {\n\t\t\tvar canvasElement = $scope.theView.parent().find('#theUnCanvas');\n\t\t\tif(canvasElement.length > 0) {\n\t\t\t\tuCanvas = canvasElement[0];\n\t\t\t}\n\t\t}\n\t\tif(uCtx === null) {\n\t\t\tuCtx = uCanvas.getContext(\"2d\");\n\t\t}\n\t\tuCtx.clearRect(0,0, uCanvas.width, uCanvas.height);\n\t\tdrawData();\n\t}", "title": "" }, { "docid": "6795e71c07c4f403ecc6780cec40c380", "score": "0.60086143", "text": "function updateUI() {\n var modelData = myDiagram.model.modelData;\n changeUnits(modelData.units);\n // update options GUI based on model.modelData.preferences\n var preferences = modelData.preferences;\n document.getElementById(\"showGridCheckbox\").checked = preferences.showGrid;\n document.getElementById(\"gridSnapCheckbox\").checked = preferences.gridSnap;\n document.getElementById(\"wallGuidelinesCheckbox\").checked = preferences.showWallGuidelines;\n document.getElementById(\"wallLengthsCheckbox\").checked = preferences.showWallLengths;\n document.getElementById(\"wallAnglesCheckbox\").checked = preferences.showWallAngles;\n document.getElementById(\"smallWallAnglesCheckbox\").checked = preferences.showOnlySmallWallAngles;\n}", "title": "" }, { "docid": "49f8cd3cc5eb76cda4020e2185817d69", "score": "0.6000925", "text": "function updateAndShow(src,forceFit) {\n draw.wsRoot.removeComputed();\n draw.wsRoot.deepUpdate(om.overrides);\n if (forceFit) draw.mainCanvas.fitContents();\n draw.refresh();\n if (src!=\"tree\") tree.initShapeTreeWidget();\n }", "title": "" }, { "docid": "e2d8ed15ce1693b17e82903e1bb6f2b1", "score": "0.5974616", "text": "updateLineContentsAndFormatting() {\n this.clearDirtyFlag();\n this.updateLineContents();\n this.updateFormatting();\n }", "title": "" }, { "docid": "d25089b78b438b45680bc9a932323af3", "score": "0.5958208", "text": "update() {\n const cacheString = this.node.width +\n this.node.height +\n this.node.fontWeight +\n this.node.fontSize +\n this.node.fontFamily +\n this.node.color +\n this.node.textAlign +\n this.node.textIndent +\n (this.node.text || '');\n\n if (this.currentCache !== cacheString) {\n this.currentCache = cacheString;\n this.el.style.width = `${this.node.width}px`;\n this.el.style.height = this.el.style.lineHeight = `${this.node.height}px`;\n this.el.style.fontWeight = this.node.fontWeight;\n this.el.style.fontSize = this.node.fontSize;\n this.el.style.fontFamily = this.node.fontFamily;\n this.el.style.color = this.node.color;\n this.el.style.textAlign = this.node.textAlign;\n this.el.style.textIndent = `${this.node.textIndent}px`;\n this.el.innerHTML = this.node.text || '';\n }\n }", "title": "" }, { "docid": "06eb5878feee3399e04bd2508e0f0b3f", "score": "0.5938521", "text": "function update(inputs) {\n\t\t// Recalculate calculated values\n\t\tcalc = calculate(inputs);\n\t\t// Regenerate overall result text\n\t\tgen_overall_results(calc);\t\n\t\t// Update dollar to pixel scale, then update axis\n\t\tbarScale.domain([0, (inputs.earned_income + inputs.ltcg) * 1.05]);\t\n\t\tsvg.select(\".yaxis\").transition().call(t).call(yAxis);\n\t\t// Regenerate bars\n\t\tregen_bars();\n\t}", "title": "" }, { "docid": "b0b54a8f8ca013d6b91089e2a1b964e2", "score": "0.5930583", "text": "function redraw() {\n // remove animation\n self.el.container.select('.you-draw').remove();\n // toggle button text\n self.el.button.text('畫好了啦');\n\n // get input position\n var m = d3.mouse(this);\n var x = m[0];\n var y = Math.max(self.size.p, Math.min(m[1], self.size.h - self.size.p));\n\n // find point to modify\n for (var target = 0; x > self.util.axes.x.scale.range()[0] + self.util.axes.x.scale.step() * (target + 0.5); target++);\n if (target < self.rows.user.length && !self.rows.orig[target].fix) {\n self.rows.user[target].y = self.util.axes.y.scale.invert(y);\n self.rows.user[target].show = true;\n self.drawUser();\n }\n }", "title": "" }, { "docid": "690524bd1205d5abb9ccc2b7b8978b81", "score": "0.59263355", "text": "function update() {\n // Canvas update\n width = visWidth - margin.left - margin.right;\n height = visHeight - margin.top - margin.bottom;\n\n visContainer.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n xAxisContainer.attr('transform', 'translate(0,' + height + ')');\n\n xScale.range([ 0, width ]);\n yScale.range([ height, 0 ]);\n\n /**\n * Computation.\n */\n // Updates that depend only on data change\n if (dataChanged) {\n // Domain scale\n xScale.domain(xLabels);\n yScale.domain([ 0, d3.max(data.map(points).map(points => d3.max(points, yDim.value))) ]).nice();\n }\n\n // Updates that depend on both data and display change\n computeLayout(data);\n\n /**\n * Draw.\n */\n // Axes\n xAxisContainer.call(xAxis).call(xLabel);\n yAxisContainer.call(yAxis).call(yLabel);\n\n // Lines\n const lines = lineContainer.selectAll('.line').data(data);\n lines.enter().append('g').attr('class', 'line').call(enterLines)\n .merge(lines).call(updateLines);\n lines.exit().transition().attr('opacity', 0).remove();\n }", "title": "" }, { "docid": "7d6fccca193fe0f333e44fdbbf3fe888", "score": "0.5903529", "text": "updateView() {\n this.updateSpans();\n this.view.setContent(this.model.getContent(), this.model.getIndex(this.model.getCursor()));\n }", "title": "" }, { "docid": "8b853065fae7e2de178e8a04a467d143", "score": "0.58991605", "text": "_updateInternalProperties() {\n this.selection = AutoNumericHelper.getElementSelection(this.domElement);\n this.processed = false;\n this.formatted = false;\n }", "title": "" }, { "docid": "fc3d885464c59d76c77ab75764ed0708", "score": "0.5887679", "text": "update() {\n this._update();\n }", "title": "" }, { "docid": "283f1e219dfc35b7072b7b6b509e7450", "score": "0.5886839", "text": "update() {\n this.render(this.$node.select('canvas').node(), this.data);\n }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.5886046", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.5886046", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.5886046", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.5886046", "text": "update() { }", "title": "" }, { "docid": "a22d22f0180f1a25f6977a29f0f53e64", "score": "0.58803374", "text": "updateDisplay() {\n this.currentOperandElement.value = this.getDisplayValue( this.currentOperand ) ;\n if ( this.operation != null ) {\n this.previousOperandElement.innerText = `${this.getDisplayValue(this.previousOperand)} ${this.operation}` ;\n } else {\n this.previousOperandElement.innerText = '' ;\n }\n }", "title": "" }, { "docid": "125e1e73b0bfb685caab685f7407da2a", "score": "0.5876703", "text": "function updateAndShow(src,forceFit) {\n om.root.removeComputed();\n om.root.deepUpdate(null,null,om.overrides);\n if (forceFit) draw.mainCanvas.fitContents(true);\n draw.refresh();\n if (src!=\"tree\") tree.initShapeTreeWidget();\n }", "title": "" }, { "docid": "d9b8a918593a5d779ed70314532fe5e7", "score": "0.58766747", "text": "function update() {\n //console.info(\"Updating elements\");\n\n //updates variables based on UI \n updateVariables();\n\n //updates UI elements dimensions\n updatePageElements();\n\n //updates tree\n window.updateDendrogram();\n}", "title": "" }, { "docid": "58f884bc2345630872cdb3a18352a293", "score": "0.586637", "text": "updateDisplay(){\n // function utilises currentOperand and previousOperand, which are working values within Calculator class\n \n this.currentOutputText.innerText = \n this.getDisplayNumber(this.currentOperand);\n\n // rmb tt this.operation holds onto /*-+ signs\n if(this.operation != null){\n this.previousOutputText.innerText = \n `${this.getDisplayNumber(this.previousOperand)} ${this.operation}`\n }else{\n this.previousOutputText.innerText = ''\n }\n\n // deal with infinity\n if(this.currentOperand === Infinity || this.previousOperand === Infinity) {\n this.joke();\n }\n }", "title": "" }, { "docid": "092b4c40418a470b3ef3690235897f9e", "score": "0.5865977", "text": "function updateDisplay(values, updateid) {\n // first thing to do is check whether the values here are still relevant\n // to the user, i.e. if the last input matches the values:\n if (newestUpdate != \"\" && updateid != newestUpdate) {\n window.dump(\"Update out of date: \" + newestUpdate + \"/\" + updateid + \"\\n\");\n return;\n }\n\n if (values.hasOwnProperty(\"error\")) {\n setError(values.error);\n return;\n }\n\n // now update display elements with new values:\n setElement('actual_sign', values.actual_sign);\n setElement('actual_exponent', values.actual_exponent);\n setElement('actual_mantissa', values.actual_mantissa);\n \n setElement('sign_value', values.sign_value);\n setElement('exponent_value', values.exponent_value);\n setElement('mantissa_value', values.mantissa_value);\n\n setCheckbox('cbsign', values.sign_bool);\n for (var i = 0; i < 8; i++) {\n setCheckbox('cbexp'+i, values.exponent_array[i]);\n }\n for (var i = 0; i < 23; i++) {\n setCheckbox('cbmant'+i, values.mantisse_array[i]);\n }\n setTextField('binary', values.binaryRepr);\n setTextField('hexadecimal', values.hexadecimalRepr);\n if (values.input_value !== \"\") {\n setTextField('decimal', values.input_value);\n setElement('dec_repr_text', 'You entered');\n } else {\n setTextField('decimal', values.decimalRepr);\n setElement('dec_repr_text', 'Decimal representation');\n }\n setTextField('highprecision_decimal', values.highprecision_decimal);\n setTextField('representation_error', values.representation_error);\n\n setError(values.infomessage);\n}", "title": "" }, { "docid": "dcbcadb5a18bb5698260e6ed782f8e4a", "score": "0.58637357", "text": "update(model) {\r\n this.element.innerHTML = model.number;\r\n this.element.style.backgroundColor = model.color;\r\n }", "title": "" }, { "docid": "59e247f49016775be250e363cef466df", "score": "0.58596414", "text": "function redrawInput() {\n for (var i1 in rawStrokes) {\n ctx.strokeStyle = \"black\";\n ctx.setLineDash([]);\n ctx.lineWidth = strokeWidth;\n ctx.beginPath();\n ctx.moveTo(rawStrokes[i1][0][0], rawStrokes[i1][0][1]);\n var len = rawStrokes[i1].length;\n for (var i2 = 0; i2 < len - 1; i2++) {\n ctx.lineTo(rawStrokes[i1][i2][0], rawStrokes[i1][i2][1]);\n ctx.stroke();\n }\n ctx.lineTo(rawStrokes[i1][len - 1][0], rawStrokes[i1][len - 1][1]);\n ctx.stroke();\n }\n }", "title": "" }, { "docid": "db4d96bfbdf2edf6e40ff2c733baa038", "score": "0.58592594", "text": "function update () {\r\n myData = prevData\r\n redraw();\r\n prevData.shift()\r\n\t }", "title": "" }, { "docid": "46a057dee5f4a376e894b82df19cee8d", "score": "0.5857645", "text": "function update() {\n\tupdateDropdowns();\n\tupdateLabels();\n\tneedsToUpdate = true;\n}", "title": "" }, { "docid": "f580e6607b21ef765422bade4567e24b", "score": "0.5853461", "text": "update() {\n document.getElementById(\"parejas-resueltas\").innerText = this.parejasResueltas;\n document.getElementById(\"intentos-restantes\").innerText = this.intentos;\n }", "title": "" }, { "docid": "c8416d2bc6a80530a92d198305e4c716", "score": "0.5849758", "text": "function updateAll(){refreshSliderDimensions();ngModelRender();}", "title": "" }, { "docid": "f41f3fcdf4dc1d090a9ccfe007952799", "score": "0.58386356", "text": "update () {\n $( this.htmlViewElement() ).css( { backgroundColor : this.color } );\n $( this.htmlEditElement() ).css( { backgroundColor : this.color } );\n this.fitWrapperToView();\n }", "title": "" }, { "docid": "213b5c7e89965c74588f499a5e101385", "score": "0.5833932", "text": "updateDisplay() {\n this.current.innerText = this.getDisplayNumber(this.currentOperand);\n if (this.operation != null) {\n this.previous.innerText = `${this.previousOperand} ${this.operation}`;\n }else{\n this.previous.innerText=\"\";\n }\n }", "title": "" }, { "docid": "a8a00b7ef364879cd14c856dbdceb311", "score": "0.58318233", "text": "function updateInputArea() {\r\n\tinput_line.innerHTML = chunkText(input_box.value, 80, getOffset(), getSelectionStart(input_box), getSelectionEnd(input_box));\r\n\ttoUpdate = false;\r\n\tscrollToBottom(frank_console);\r\n}", "title": "" }, { "docid": "5c45b35382f6b1f0eb458ffc4c2239d4", "score": "0.5829187", "text": "function refresh() {\n userEntry.value = '';\n decInch.innerHTML = \"Conversion\";\n decInchUp.innerHTML = \"+1\";\n decInchDown.innerHTML = \"-1\";\n decMM.innerHTML = \"Conversion\";\n decMMUp.innerHTML = \"+1\";\n decMMDown.innerHTML = \"-1\";\n fracInch.innerHTML = \"Conversion\";\n fracInchUp.innerHTML = \"+1/16\";\n fracInchDown.innerHTML = \"-1/16\";\n}", "title": "" }, { "docid": "dd5e83409474c97767f9206548e4b351", "score": "0.5819207", "text": "updateDisplay(){\n this.currentOperandTextElement.textContent = this.currentOperand\n }", "title": "" }, { "docid": "2f1fcf980194ff4e95fa842b4723f7f0", "score": "0.5808142", "text": "function updateInput(){\n\t\tinputString = inputArr.join(\"\");\n\t\tconsole.log(inputString);\n\t\tif(inputString == \"\"){\n\t\t\tinputDisplay.innerHTML = \"input\"; //shouldn't use innerHTTML\n\t\t}else{ \n\t\t\tinputDisplay.innerHTML = inputString; //shouldn't use innerHTTML according to DOM tutorial\n\t\t}\n\t}", "title": "" }, { "docid": "235659609c96c518653e6b18bae1d0a1", "score": "0.580421", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "235659609c96c518653e6b18bae1d0a1", "score": "0.580421", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "59a071927ccbc0fea4aa96073f34d210", "score": "0.58010244", "text": "updateDisplay() {\n this.currentOperandTextElement.innerText =\n this.getDisplayNumber(this.currentOperand)\n if (this.operation != null) {\n this.previousOperandTextElement.innerText =\n `${this.getDisplayNumber(this.previousOperand)} ${this.operation}`\n } else {\n this.previousOperandTextElement.innerText = ''\n }\n }", "title": "" }, { "docid": "3740409369adcd2117041a8489cbcafa", "score": "0.57925665", "text": "update () {\n super.update();\n }", "title": "" }, { "docid": "17e6ca988229f7c31afffa95a8362404", "score": "0.5788913", "text": "updateDisplay() {\n this.currentOperandEl.innerText = this.getDisplayNumber(this.currentOperand);\n if(this.operation != null) {\n this.previousOperandEl.innerText = `${this.getDisplayNumber(this.previousOperand)} ${this.operation}`\n } else {\n this.previousOperandEl.innerText = ''\n }\n }", "title": "" }, { "docid": "09bf54387c7aaf58e9711b84e641be87", "score": "0.578162", "text": "function updateDisplay() {\n document.getElementById(\"display\").innerHTML = display;\n document.getElementById(\"calculations\").innerHTML = calculations.toString().replace(/,/g, \" \");\n}", "title": "" }, { "docid": "1b6b1fdbccd9011ed3a5861b8cd5e785", "score": "0.5781534", "text": "function update(h) {\n\n //Mitbewegen der Linie\n liner.attr(\"x1\", x(h));\n liner.attr(\"x2\", x(h));\n\n //Mitbewegen der Texte\n label1\n .attr(\"x\", x(h))\n .text(dateFormatter2(h));\n label2\n .attr(\"x\", x(h))\n .text(\"Fallzahl:\"+transformCases().cases);\n\n //Mitbewegen des Positionskreises\n focus\n .attr(\"cx\", x(h))\n .attr(\"cy\", y(transformCases().cases));\n\n quader\n .attr(\"x\", x(h));\n\n currentDate.val = dateFormatter2(h);\n currentDate.val2 = dateFormatter5(h);\n\n //Angabe aktueller Woche\n week = dateFormatter4(h);\n if(week[0] == 0) {\n return week.charAt(1)\n } else {\n return dateFormatter4(h);\n }\n }", "title": "" }, { "docid": "628dadb7c848d1f58c1c68a78985b081", "score": "0.57772547", "text": "function textOutputChange(dxf_v = dxf_slider.value, rho_v = rho_slider.value,\r\n n_of_obs_v = n_of_obs_slider.value, std_v = std_dev_slider.value)\r\n{\r\n ctx.clearRect(X_OFFSET, label_list_y_loc-10, 130, 70);\r\n ctx.fillStyle = \"#00DD00\";\r\n ctx.rect( X_OFFSET, label_list_y_loc-10, 130, 70);\r\n ctx.fill();\r\n labels();\r\n displaySliderValues(dxf_v, rho_v, n_of_obs_v, std_v);\r\n}", "title": "" }, { "docid": "5761e335783b210a5eb628d346c04648", "score": "0.5774747", "text": "redrawNumberDisplay() {\n this.numberDisplay.recomputeText();\n }", "title": "" }, { "docid": "01f50348be702643622ac31c60ba6ffe", "score": "0.57712746", "text": "_refresh() {\n this._updateSizes();\n this._updateKnobPosition();\n }", "title": "" }, { "docid": "09058ba09884f4becd375f9f6c0244e5", "score": "0.5768504", "text": "updateData() {\n\t\tthis.processString(this.texte)\n\t\tthis.count = this.syllableArray.length\n\t\tthis.setSyllableNumber()\n\t\tthis.setLastSyllable()\n\t}", "title": "" }, { "docid": "c0c40c1f14869f8c8b3d3b43dcc0f59b", "score": "0.57677007", "text": "update() {\n this._generateData();\n super.update();\n }", "title": "" }, { "docid": "6f8fa0d6363db2ce6c7b60a0b81fb196", "score": "0.5757483", "text": "function updateAll() {\n\t refreshSliderDimensions();\n\t ngModelRender();\n\t }", "title": "" }, { "docid": "6f8fa0d6363db2ce6c7b60a0b81fb196", "score": "0.5757483", "text": "function updateAll() {\n\t refreshSliderDimensions();\n\t ngModelRender();\n\t }", "title": "" }, { "docid": "d1828aae0cd51984a072acfde5b0af20", "score": "0.57505727", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "d1828aae0cd51984a072acfde5b0af20", "score": "0.57505727", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "d1828aae0cd51984a072acfde5b0af20", "score": "0.57505727", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "fadad90f0d860c089e131d5ba6561264", "score": "0.57408047", "text": "updateGui() {\n this.gui.add(this.scene, 'displayAxis').name('Display Axis');\n this.gui.add(this.scene, 'displayLights').name('Display Lights');\n this.gui.add(this.scene,'currentCameraID',Array.from(this.scene.cameras.keys())).onChange(this.scene.updateCamera.bind(this.scene)).name('Camera');\n this.createLightCheckboxes();\n }", "title": "" }, { "docid": "dff29ff6619e980d2396b800f0c2241d", "score": "0.5735994", "text": "updateDisplay() {\n this.currentOperandTextElement.innerText = this.currentOperand;\n }", "title": "" }, { "docid": "3bb1c2221700a0584a37d41297f60ba8", "score": "0.5732704", "text": "update() {\r\n // go through all cells \r\n for(let i = 0; i < this.cells.length; i++) {\r\n // pick a cell and call its show function\r\n let cell = this.cells[i];\r\n cell.show();\r\n // call the current cell's update function with our classe's cells array\r\n cell.update(this.cells, i);\r\n }\r\n // update the systemObserver\r\n this.systemObserver.update();\r\n }", "title": "" }, { "docid": "79a7a4b4f231cc5ad42a757625b886db", "score": "0.5726528", "text": "repaint() {\n this.isDirty = true;\n }", "title": "" }, { "docid": "45994f850f6dca3ba03a837bb6cf3b72", "score": "0.5721479", "text": "function graphUpdate(data, lay){\n /* Render updated graph */\n layout.build(data, layout.lay);\n}", "title": "" }, { "docid": "333a05bb50138abef1ceab40ed7a24ab", "score": "0.5720877", "text": "function refresh() {\n drawProgram();\n drawTalks();\n addDrag();\n}", "title": "" }, { "docid": "47acabeb9d7bc785fe99bd25ae11c047", "score": "0.5719817", "text": "function update_layers() {\n canvas.width = canvas.width + 0;\n var background_color = document.getElementById('builder_background_color').value;\n var show_delete_icons = document.getElementById('show_delete_icons').checked;\n draw_rectangle(0, 0, canvas.width, canvas.height, background_color, 0, 0, 0);\n\n for (var i = 0; i < layers.length; i++) {\n if (layers[i].type == 'image') {\n draw_image_layer(layers[i]);\n }\n else if (layers[i].type == 'text') {\n draw_text_layer(layers[i]);\n }\n if (show_delete_icons) {\n draw_delete_icon(layers[i]);\n }\n if (i == selected_layer) {\n draw_guideline(layers[selected_layer]);\n }\n }\n\n var layers_input = document.getElementById('sign_builder_layers_input')\n if (layers_input) {\n layers_input.value = parse_layers2();\n }\n\n }", "title": "" }, { "docid": "cee649b332bedbe00d843ddf09e4b298", "score": "0.57163167", "text": "update() {\n this.nextPosition();\n this.draw();\n }", "title": "" }, { "docid": "661a2c03172253edd3ef1bab625791da", "score": "0.57137245", "text": "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }", "title": "" }, { "docid": "661a2c03172253edd3ef1bab625791da", "score": "0.57137245", "text": "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }", "title": "" }, { "docid": "661a2c03172253edd3ef1bab625791da", "score": "0.57137245", "text": "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }", "title": "" }, { "docid": "661a2c03172253edd3ef1bab625791da", "score": "0.57137245", "text": "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }", "title": "" }, { "docid": "67a56e25c07b955cf9692cb15d5eff23", "score": "0.5706147", "text": "function updateInputGraph(inputGraph, layoutGraph) {\n _.each(inputGraph.nodes(), function(v) {\n var inputLabel = inputGraph.node(v),\n layoutLabel = layoutGraph.node(v);\n\n if (inputLabel) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n\n if (layoutGraph.children(v).length) {\n inputLabel.width = layoutLabel.width;\n inputLabel.height = layoutLabel.height;\n }\n }\n });\n\n _.each(inputGraph.edges(), function(e) {\n var inputLabel = inputGraph.edge(e),\n layoutLabel = layoutGraph.edge(e);\n\n inputLabel.points = layoutLabel.points;\n if (_.has(layoutLabel, \"x\")) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n }\n });\n\n inputGraph.graph().width = layoutGraph.graph().width;\n inputGraph.graph().height = layoutGraph.graph().height;\n}", "title": "" }, { "docid": "a1a1c2ac29264cb4392a686a8b18bf36", "score": "0.5701465", "text": "update () {\n $( this.htmlViewElement() ).html( this.innerHTML() );\n this.fitWrapperToView();\n }", "title": "" }, { "docid": "d939c26ef35cce5f25af257c3e4fa5b4", "score": "0.57004696", "text": "function update() {\n\n // Make sure current tree file name is displayed in title\n if (trees.length === 0) {\n document.title = \"IcyTree\";\n } else {\n if (treeFile !== undefined && treeFile !== null)\n document.title = \"IcyTree: \" + treeFile.name;\n else\n document.title = \"IcyTree\";\n }\n\n updateCurrentTreeControl();\n\n updateMenuItems();\n\n if (trees.length === 0) {\n displayStartOutput();\n return;\n } else {\n prepareOutputForTree();\n }\n\n // Tree to draw\n var tree = trees[currentTreeIdx];\n\n // Sort tree nodes\n switch ($(\"#styleSort span\").parent().text()) {\n case \"Sorted (ascending)\":\n TreeStyle.sortNodes = true;\n TreeStyle.sortNodesDescending = false;\n break;\n case \"Sorted (descending)\":\n TreeStyle.sortNodes = true;\n TreeStyle.sortNodesDescending = true;\n break;\n default:\n TreeStyle.sortNodes = false;\n break;\n }\n\n // Non-time trees can only be displayed as cladograms\n if (!tree.isTimeTree) {\n if (!itemToggledOn($(\"#styleLayoutCladogram\"))) {\n selectListItem($(\"#styleLayoutCladogram\"), false, false);\n displayNotification(\"Switching to Cladogram Layout\");\n }\n }\n\n // Update trait selectors:\n updateTraitSelectors();\n\n // Determine whether edge colouring is required:\n TreeStyle.edgeColourTrait = $(\"#styleEdgeColourTrait span\").parent().text();\n if (TreeStyle.edgeColourTrait === \"None\")\n TreeStyle.edgeColourTrait = undefined;\n\n // Determine whether node colouring is required:\n TreeStyle.nodeColourTrait = $(\"#styleNodeColourTrait span\").parent().text();\n if (TreeStyle.nodeColourTrait === \"None\")\n TreeStyle.nodeColourTrait = undefined;\n\n // Determine whether tip labels are required:\n TreeStyle.tipTextTrait = $(\"#styleTipTextTrait span\").parent().text();\n switch (TreeStyle.tipTextTrait) {\n case \"None\":\n TreeStyle.tipTextTrait = undefined;\n break;\n case \"Label\":\n TreeStyle.tipTextTrait = \"label\";\n break;\n default:\n break;\n }\n\n // Determine whether internal node labels are required:\n TreeStyle.nodeTextTrait = $(\"#styleNodeTextTrait span\").parent().text();\n switch (TreeStyle.nodeTextTrait) {\n case \"None\":\n TreeStyle.nodeTextTrait = undefined;\n break;\n case \"Label\":\n TreeStyle.nodeTextTrait = \"label\";\n break;\n default:\n break;\n }\n\n // Determine whether node bars are required:\n TreeStyle.nodeBarTrait = $(\"#styleNodeBarTrait span\").parent().text();\n if (TreeStyle.nodeBarTrait === \"None\" || itemToggledOn($(\"#styleLayoutCladogram\")))\n TreeStyle.nodeBarTrait = undefined;\n\n // Determine whether recombinant edge labels are required:\n TreeStyle.recombTextTrait = $(\"#styleRecombTextTrait span\").parent().text();\n switch (TreeStyle.recombTextTrait) {\n case \"None\":\n TreeStyle.recombTextTrait = undefined;\n break;\n case \"Label\":\n TreeStyle.recombTextTrait = \"label\";\n break;\n default:\n break;\n }\n\n // Determine whether scaled edge widths are required\n TreeStyle.edgeWidthTrait = $(\"#styleEdgeWidthTrait span\").parent().text();\n switch (TreeStyle.edgeWidthTrait) {\n case \"None\":\n TreeStyle.edgeWidthTrait = undefined;\n break;\n default:\n break;\n }\n\n\n // Determine whether scaled recomb edge widths are required\n TreeStyle.recombWidthTrait = $(\"#styleRecombWidthTrait span\").parent().text();\n switch (TreeStyle.recombWidthTrait) {\n case \"None\":\n TreeStyle.recombWidthTrait = undefined;\n break;\n default:\n break;\n }\n\n // Determine numeric label precision\n TreeStyle.labelPrec = $(\"#styleLabelPrec span\").parent().data(\"prec\");\n\n // Determine which kind of axis (if any) should be displayed\n if (itemToggledOn($(\"#styleLayoutCladogram\")))\n TreeStyle.axis = false;\n else {\n switch ($(\"#styleAxis span\").parent().text()) {\n case \"Age\":\n TreeStyle.axis = true;\n TreeStyle.axisForwards = false;\n break;\n case \"Forwards time\":\n TreeStyle.axis = true;\n TreeStyle.axisForwards = true;\n break;\n default:\n TreeStyle.axis = false;\n }\n }\n\n\n // Assign remaining style properties to TreeStyle object\n\n TreeStyle.logScale = !itemToggledOn($(\"#styleLayoutCladogram\")) && itemToggledOn($(\"#styleLogScale\"));\n TreeStyle.inlineRecomb = itemToggledOn($(\"#styleInlineRecomb\"));\n TreeStyle.minRecombEdgeLength = itemToggledOn($(\"#styleMinRecombLength\"));\n TreeStyle.angleText = itemToggledOn($(\"#styleAngleText\"));\n\n TreeStyle.width = Math.max(window.innerWidth-5, 200);\n TreeStyle.height = Math.max(window.innerHeight-5, 200);\n TreeStyle.marginTop = 40;\n TreeStyle.marginBottom = 20;\n TreeStyle.marginLeft = 20;\n TreeStyle.marginRight = 20;\n\n TreeStyle.markSingletonNodes = itemToggledOn($(\"#styleMarkSingletons\"));\n TreeStyle.collapseZeroLengthEdges = itemToggledOn($(\"#styleCollapseZeroLengthEdges\"));\n TreeStyle.displayRecomb = itemToggledOn($(\"#styleDisplayRecomb\"));\n TreeStyle.legend = itemToggledOn($(\"#styleDisplayLegend\"));\n\n // Position internal nodes\n //var layout;\n switch ($(\"#styleLayout span\").parent().text()) {\n case \"Standard Time Tree\":\n layout = new StandardTreeLayout(tree);\n break;\n case \"Transmission Tree\":\n layout = new TransmissionTreeLayout(tree);\n break;\n case \"Cladogram\":\n layout = new CladogramLayout(tree);\n break;\n }\n\n // Display!\n $(\"#output\").html(\"\");\n var svg = Display.createSVG(layout);\n svg.setAttribute(\"id\", \"SVG\");\n if ($(\"#styleAntiAlias > span\").length === 0)\n svg.style.shapeRendering = \"crispEdges\";\n $(\"#output\").append(svg);\n\n // Update bounding box (can only do this once svg is rendered).\n ZoomControl.setBBox();\n\n // Add log scale stretching event handler:\n function logScaleStretchHandler(event) {\n if (!event.altKey || event.shiftKey)\n return;\n\n event.preventDefault();\n\n var dir = (event.wheelDelta || -event.detail);\n if (dir>0)\n TreeStyle.logScaleRelOffset /= 1.5;\n else\n TreeStyle.logScaleRelOffset *= 1.5;\n update();\n }\n svg.addEventListener(\"mousewheel\",\n logScaleStretchHandler); // Chrome\n svg.addEventListener(\"DOMMouseScroll\",\n logScaleStretchHandler); // FF (!!)\n}", "title": "" }, { "docid": "0f8b30f5f8fa132ae73e6cccd75edfbd", "score": "0.56975394", "text": "function updateUI() {\n showBestTravelDistanceCheckBoxElement.hidden = false;\n showWorstTravelDistanceCheckBoxElement.hidden = false;\n pencil.beginPath();\n pencil.clearRect(0, 0, canvasMapElement.width, canvasMapElement.height);\n pencil.fillStyle = \"#181a1b\";\n pencil.fillRect(0, 0, canvasMapElement.width, canvasMapElement.height);\n pencil.closePath();\n drawCities(cities);\n if (showBestTravelDistanceCheckBoxElement.checked) {\n drawRoute(chromosomes[0].completeRoute, \"#2196f3\", 3);\n }\n if (showWorstTravelDistanceCheckBoxElement.checked) {\n drawRoute(chromosomes[chromosomes.length - 1].completeRoute, \"red\", 1);\n }\n bestTravelDistaceElement.innerText = \"Best travel Distance:\" + chromosomes[0].travelDistance;\n worstTravelDistanceElement.innerText = \"Bad travel Distance:\" + chromosomes[chromosomes.length - 1].travelDistance;\n}", "title": "" }, { "docid": "88689e9f731fa3a9360f196c65c8b72d", "score": "0.56972474", "text": "function redraw() {\r\n locate();\r\n // Internet Explorer requires the try catch as hidden\r\n // elements throw errors\r\n try {\r\n var sW = outerWrapper.offsetWidth,\r\n sH = outerWrapper.offsetHeight,\r\n hW = handle.offsetWidth,\r\n hH = handle.offsetHeight,\r\n bH = bar.offsetHeight,\r\n bW = bar.offsetWidth, \r\n mPx = vertical ? sH - hH : sW - hW; \r\n \r\n stepPx = mPx / steps; \r\n rMinPx = Math.max(scale ? percentToPixels(valueToPercent(rMin)) : Math.abs((rMin - min) / step) * stepPx, 0); \r\n rMaxPx = Math.min(scale ? percentToPixels(valueToPercent(rMax)) : Math.abs((rMax - min) / step) * stepPx, Math.floor(vertical ? sH - hH : sW - hW)); \r\n \r\n sliderW = sW;\r\n sliderH = sH; \r\n \r\n // Use the input value\r\n valueToPixels(forceValue ? getWorkingValueFromInput() : (tagName == \"select\" ? inp.selectedIndex : parseFloat(inp.value)), false);\r\n \r\n } catch(err) {};\r\n callback(\"redraw\");\r\n }", "title": "" }, { "docid": "29253bad4784cb4520d8f0cd1dcc2b7c", "score": "0.56953704", "text": "update() {\n let vis = this\n vis.g.append('p').text('Hello from D3')\n }", "title": "" }, { "docid": "d6ac5a35df4b1ce311781dbf28c728d9", "score": "0.56925356", "text": "update(){\r\n this.updatePrice(); //calculate new price\r\n this.updateText(); //update displayed txt\r\n }", "title": "" }, { "docid": "533481341609a8818bd21cf051381264", "score": "0.5677507", "text": "update() {\n\t\t\t\t\tthis.x = canvasWidth / 2;\n\t\t\t\t\tthis.y = canvasHeight * .2;\n\t\t\t\t\tthis.textX = canvasWidth / 2;\n\t\t\t\t\tthis.textY = canvasHeight * .2;\n\t\t\t\t\tthis.titleSize = canvasWidth * .2;\n\t\t\t\t\tthis.optionsSize = canvasWidth * .1;\n\t\t\t\t\tthis.containersX = canvasWidth * .15;\n\t\t\t\t\tthis.containersWidth = canvasWidth * .7;\n\t\t\t\t\tthis.containersHeight = canvasHeight * .08;\n\t\t\t\t\tthis.containersOffsetY = canvasHeight * .05;\n\t\t\t\t\tthis.containers.forEach(\n\t\t\t\t\t\tfunction updateOptions(option, index) {\n\t\t\t\t\t\t\toption.textX = canvasWidth / 2;\n\t\t\t\t\t\t\toption.textY = canvasHeight * ( ( 6 + index ) / 10 );\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}", "title": "" }, { "docid": "c8be781c71fa479d23a9f31e7a94bac0", "score": "0.56768465", "text": "_updateChart() {\n let _rowIdx = this._directedPath[0];\n let _colIdx = this._directedPath[this._directedPath.length - 1];\n if (_rowIdx < 0 || _colIdx < 0) return;\n\n let _rowLabel = this.graphData.data[_rowIdx].label;\n let _colLabel = this.graphData.data[_colIdx].label;\n let cellToUpdate = [_rowLabel, _colLabel];\n log(\"Update Cell: [\" + cellToUpdate + \"]\");\n this._weightedAdjMat.increaseCellWeight(cellToUpdate, 1);\n this._weightedAdjMat.increaseCellColor(cellToUpdate, 1);\n this._weightedAdjMat.redrawMatrix();\n }", "title": "" }, { "docid": "be277a190243bddd7434d7846211e4f2", "score": "0.56755257", "text": "draw() {\n this.command.context.chain.updatePixels();\n }", "title": "" } ]
7ebc3a3c2646181d6d7dcaa0c00c4803
Use the submitted data to set the state
[ { "docid": "a6a197efac610c2d7d38bc4cb41d8ffb", "score": "0.0", "text": "handleChange(event) {\n const { name, value } = event.target\n this.setState({\n [name]: value\n })\n }", "title": "" } ]
[ { "docid": "010f46d98362be60cafbae1d7e2dad5a", "score": "0.67734945", "text": "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "title": "" }, { "docid": "4222a89643cf3158bd7d92986acec969", "score": "0.65199304", "text": "formPostData() {\n\t\tconsole.log(\"calling axios.post from react\");\n\t\tconsole.log(\"adding new metadata to database\");\n\n\t\taxios.post(\"/api/new-metadata\", {\n\t\t\tname: this.state.name,\n\t\t\tsize: this.state.size,\n\t\t\ttype: this.state.type\n\t\t}).then(data => {\n\t\t\tconsole.log(\"metadata saved\");\n\t\t\tconsole.log(data.data);\n\t\t\tthis.setState({\n\t\t\t\tresults: JSON.stringify(data.data, null, 1)\n\t\t\t});\n\t\t}).catch(err =>{\n\t\t\tconsole.log(err);\n\t\t});\n\t}", "title": "" }, { "docid": "716c95570bcdc1944e484c3d9d64c63a", "score": "0.64679575", "text": "changeForm(data) {\n if (!data.errors.length) {\n this.state.formData = data.formData\n }\n }", "title": "" }, { "docid": "a5ddbfb5f2df256e277b506f3a3b7d04", "score": "0.643992", "text": "submit(data) {\n\t\tthis.data = data;\n\t}", "title": "" }, { "docid": "89c525bd2fe16c1729617684996bf173", "score": "0.6389509", "text": "handleSubmit (e) {\n e.preventDefault();\n this.props.submitForm(this.state.currentItem);\n // referencing a function where i'm calling and passing \n this.setState({\n currentItem: {\n marked: \"false\",\n itemText: \"\"\n }\n });\n }", "title": "" }, { "docid": "77214ab21648772dfff28b84bb2b2402", "score": "0.63730216", "text": "constructor(){\n super()\n\n this.state={\n definition:[]\n }\n \n \n \n//Binding the value from the submit event\n this.onSubmit = this.onSubmit.bind(this);\n }", "title": "" }, { "docid": "ad7eadea34dd50e2fe4d50307a7b1d80", "score": "0.6362658", "text": "handleFormSubmit(e) {\n e.preventDefault();\n\n let userData = Object.assign({}, {grossIncome: this.state.grossIncome, tax: this.state.tax});\n this.props.handleFormData(userData);\n }", "title": "" }, { "docid": "eb7aa2dd2946ca117efeff9a81f2697e", "score": "0.63262486", "text": "_setState(data) {\n var updated = false;\n\n for (var prop in this._state) {\n if (data.hasOwnProperty(prop)) {\n this._state[prop] = data[prop];\n updated = true;\n }\n }\n\n if (updated) {\n this._emitter.emit('status:update', this.get());\n }\n }", "title": "" }, { "docid": "c472669ac34f096b05a185a563fcee78", "score": "0.6323784", "text": "SET_FORM (state, data) {\n console.log('requests SET_FORM mutation')\n state.form = data\n }", "title": "" }, { "docid": "b7110c39d27d17b88cf018489123e47c", "score": "0.62851506", "text": "submitHandler(event) {\n // change this.state.formData.email or password to value\n const target = event.target;\n const name = target.id;\n const value = target.value;\n\n // sets the state\n this.setState(prevState => {\n const newFormData = {\n ...prevState.formData, [name]:\n value\n };\n return { formData: newFormData };\n });\n }", "title": "" }, { "docid": "9c9d11b03a88b6dcb7c50a5ac626af30", "score": "0.62820184", "text": "constructor(props) {\n super(props);\n this.state = {data:'',axes:'', ticker1:387,ticker2:898,ticker3:388,ticker:'appl',screen:'WATCHLIST',justBought:false}; \nthis.handleSubmit = this.handleSubmit.bind(this);\n\n }", "title": "" }, { "docid": "f33f5f6231495ac561222b3edc0854f3", "score": "0.6261217", "text": "fillForm(data) {\n\n\t\tthis.titleInput.value = data.title;\n\t\tthis.bodyInput.value = data.body;\n\t\tthis.idInput.value = data.id;\n\n\t\tthis.alterFormState('edit');\n\n\t}", "title": "" }, { "docid": "23411f23a14229e32099856eb6b80659", "score": "0.6234765", "text": "fillForm(data){\n this.bodyInput.value = data.body;\n this.titleInput.value = data.title;\n this.idInput.value = data.id;\n\n if(!document.querySelector('.post-update')){\n this.changeFormState('edit');\n }\n }", "title": "" }, { "docid": "0a3bf2a30ea2ceac2c043f19eba411ef", "score": "0.6231206", "text": "handleSubmit(values) {\n console.log(\"Current state is: \" + JSON.stringify(this.state));\n console.log(\"Current values is: \" + JSON.stringify(values));\n //alert(\"Current State is: \" + JSON.stringify(this.state));\n console.log(\"sizeSelect: \" + this.state.sizeSelect)\n console.log(\"quantitySelect: \" + this.state.quantitySelect);\n this.props.postToCart(\n this.props.itemData,\n this.state.quantitySelect,\n this.state.sizeSelect);\n this.props.resetApparelForm();\n }", "title": "" }, { "docid": "baa846a40a7ded192d1b5cd66894d068", "score": "0.6207724", "text": "function handleNameSubmit(newstate) {\n setGeneralInfo(newstate);\n }", "title": "" }, { "docid": "90505ea711b6bd861a9eda63e4acb7e6", "score": "0.61874485", "text": "handleSubmit(event) {\n event.preventDefault();\n\n // want to pass down onSave() with all the values the form currently has\n this.props.onSave({...this.state});\n\n this.setState({\n\t\t\ttitle: '',\n\t\t\tingredients: [''],\n\t\t\tinstructions: '',\n\t\t\timg: ''\n\t\t});\n }", "title": "" }, { "docid": "48904bc04379afb127558c10071bbed2", "score": "0.618534", "text": "changeSubmitState() {\n this.setState({submitted: true});\n // this.state.updates ensures that we have the ability to reload List component when the input data changes.\n var counter = this.state.updates;\n counter += 1;\n this.setState({updates: counter})\n }", "title": "" }, { "docid": "6a6bbf543b1274660267cd4623a87886", "score": "0.61825377", "text": "submitName(e){\n var set = e.target.value;\n this.setState({\n name: set\n });\n }", "title": "" }, { "docid": "e0f7a167561b098ffb23c1a0aa29587f", "score": "0.6180043", "text": "function handleSubmit() {\n const billData = \n {\n userId: state.user._id,\n name: form.name, \n date: form.date,\n frequency: form.frequency,\n amount: form.amount\n }\n //grab the userID and put in newbill obj\n dispatch({ type: \"setBill\", data: billData });\n handleClose();\n }", "title": "" }, { "docid": "a8f4b82386942f5d9f068ec89f3d548f", "score": "0.61767775", "text": "fillForm(data) {\n this.title.value = data.title;\n this.body.value = data.body;\n this.id.value =data.id;\n this.changeFormState('edit');\n }", "title": "" }, { "docid": "abc09f0d398387beba16ec8120f6f921", "score": "0.61665213", "text": "userFormSubmitHandler(event){\n console.log(\"Clicked to submit!\");\n event.preventDefault();\n var self = this;\n //If the call of the validate method was successful, we can proceed with form submission. Otherwise we do nothing.\n if (self.validate()) {\n const updatedData = {\n name: document.user_form.name.value,\n email: document.user_form.email.value,\n phone: document.user_form.phone.value,\n website: document.user_form.url.value,\n workLocation: {id:self.state.changedCityId,name:document.user_form.cities.value},\n doj: document.user_form.doj.value\n };\n self.setState({formData:updatedData},function(){\n console.log(\"Lets post data!\",self.state.formData);\n });\n }\n self.setState({ isValidated: true });\n }", "title": "" }, { "docid": "77d048f9c8c617df80135de66e4adbbf", "score": "0.61333674", "text": "sendDataToPost(inputKey, value) {\n\t\tthis.props.sendPostState('medicalExam' ,inputKey , value);\n\t}", "title": "" }, { "docid": "a802f3d333ef15aba86ba7e50836b53b", "score": "0.61332196", "text": "submit() {\n if (this.state === 'register') {\n this.storeTransaction();\n } else if (this.state === 'upgrade') {\n this.updateTransaction();\n }else if(this.state === 'closing-box'){\n this.storeClosingBox();\n }\n }", "title": "" }, { "docid": "7a79f6c625aacb19e63b62014649946c", "score": "0.6107407", "text": "setFormData (formDataUpdate) {\n this.setState({\n formData: Object.assign(this.state.formData, formDataUpdate)\n })\n }", "title": "" }, { "docid": "c59e68ef28e49358aa2773d13bc23c27", "score": "0.6097568", "text": "_handleFormChange(e) {\n this.setState({ [e.target.name]: e.target.value }, this._updateLiveResults);\n }", "title": "" }, { "docid": "d53c4b74291f4d618a997e24de77c1eb", "score": "0.60837686", "text": "fillForm(data) {\n this.titleInput.value = data.title;\n this.bodyInput.value = data.body;\n this.idInput.value = data.id;\n\n this.changeFormState('edit');\n }", "title": "" }, { "docid": "29c430cc23f41b63935bc78b3d891cc9", "score": "0.6081638", "text": "function handleSubmittedData(address) {\n console.log(address);\n setAddress(address);\n setFormSubmit(true);\n }", "title": "" }, { "docid": "6a969e6a239c2dace2238212b5fadf11", "score": "0.60711235", "text": "fillForm(data) {\n this.postID.value = data.id;\n this.postTitle.value = data.title;\n this.postDesc.value = data.description;\n\n this.changeFormState('edit')\n }", "title": "" }, { "docid": "19637528712d7bd5c6af79691c2d673b", "score": "0.6062127", "text": "updateInfo(event) {\n //These shoudl all have updated states already updated on any change to specific form feild.\n let { firstNameInput, lastNameInput, emailInput, phoneNumberInput } =\n this.state;\n // series of states updated\n this.setState({ firstName: firstNameInput });\n this.setState({ lastName: lastNameInput });\n this.setState({ email: emailInput });\n this.setState({ phoneNumber: phoneNumberInput });\n // Trying to add a function to render the information now stored in the compoenent\n\n this.setState({ formSubmitted: true });\n event.preventDefault();\n }", "title": "" }, { "docid": "d4654a451351c769a9e94edeca2545d9", "score": "0.6042922", "text": "setData(state, data) {\n state.data = data\n }", "title": "" }, { "docid": "46a939e33f42d06d05fdb3bf4a3891dd", "score": "0.604167", "text": "formDone(context) {\n context.setState({\n formSubmissionState: 2,\n });\n }", "title": "" }, { "docid": "e3a2856d4a451d2ae90f1c6746d91254", "score": "0.6031332", "text": "function setState() {\n let newState = document.getElementById(\"stateText\").value;\n console.log(newState);\n setStateRequest.open(\"POST\", \"Controller\", true);\n setStateRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n let information = \"action=setState&state=\" + encodeURI(newState);\n setStateRequest.send(information);\n getState();\n}", "title": "" }, { "docid": "8dc29511a88eb9932c65f4f925783512", "score": "0.602285", "text": "handleGeneName(event) {\n // Need to reset isSubmitted state before changing geneName to prevent premature API call\n this.setState({\n isSubmitted: false\n })\n\n // Checking that isSubmitted is reset \n if (!this.state.isSubmitted) {\n this.setState({\n geneName: event.target.value\n })\n }\n\n }", "title": "" }, { "docid": "06a8486557f7941d3e7c706d81ac5a2d", "score": "0.6010769", "text": "onSubmit(state) {\n this.status = 'answered';\n var choice = this.opt.choices.where({ value: state.value })[0];\n this.answer = choice.short || choice.name;\n\n // Re-render prompt\n this.render();\n this.screen.done();\n this.done(state.value);\n }", "title": "" }, { "docid": "39b5bf1a4da6e224927c1b9570cbe6ad", "score": "0.60080266", "text": "onSubmit(e) {\n e.preventDefault();\n const newEditedItem = {\n item_name: this.state.item_name,\n item_date: this.state.item_date,\n item_amount: this.state.item_amount,\n item_notes: this.state.item_notes,\n };\n console.log(newEditedItem);\n\n // This will send a post request to update the data in the database.\n axios\n .post(\n \"https://mern-inventory-manager.herokuapp.com/inflow/update/\" + this.props.match.params.id,\n newEditedItem\n )\n .then((res) => console.log(res.data));\n\n // We will empty the state after posting the data to the database\n this.setState({\n item_name: \"\",\n item_date: \"\",\n item_amount: \"\",\n item_notes: \"\",\n });\n\n this.props.history.push(\"/inflow\");\n }", "title": "" }, { "docid": "f18d654f8ae7fa6fd3aa184b2be82a29", "score": "0.6007695", "text": "onSubmit(e){\r\n\t\te.preventDefault()\r\n\r\n\t\t//using destructuring in order to retrieve current user and postId\r\n\t\tconst {user} = this.props.auth\r\n\t\tconst {postId} = this.props\r\n\r\n\t\t//Create a new offer based on the user inputs\r\n\t\tconst newOffer ={\r\n\t\t\tvalue: this.state.value,\r\n\t\t\ttext: this.state.text,\r\n\t\t\tname: user.name,\r\n\t\t}\r\n\t\tthis.props.makeOffer(postId, newOffer)\r\n\t\t//refresh the inputs after the offer was created\r\n\t\tthis.setState({\r\n\t\t\tvalue: '',\r\n\t\t\ttext: ''\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "ebf33cd488896c597413f1d54d6d730a", "score": "0.60068846", "text": "onSubmit(e) {\n this.updatePerson(this.state.person);\n e.preventDefault();\n }", "title": "" }, { "docid": "a8be54fcadc13379875db5990719f081", "score": "0.6006785", "text": "onFormChange(event) {\n const { value, name } = event.target; //map the name of the changed form item to its value\n this.setState({\n ...this.state,\n post: {\n ...this.state.post, //use spread operator to update nested state\n [name]: value\n },\n });\n }", "title": "" }, { "docid": "54babf4ce1ccf45560341576d7bf3c74", "score": "0.60066634", "text": "constructor() {\n super();\n\n //set an initial states for the inputs , blank object and use them in value={this.state.attr}\n this.state = {\n title: \"\",\n jobIdentifier: \"\",\n description: \"\",\n email: \"\",\n location: \"\",\n type: \"\",\n endDate: \"\",\n salary: \"\",\n errors: {},\n };\n\n this.onChange = this.onChange.bind(this); //to link each attribute and take its vakue when change\n this.onSubmit = this.onSubmit.bind(this);\n }", "title": "" }, { "docid": "b23c4d4bc611c704c8947bed34351842", "score": "0.6002065", "text": "handleSubmit(data) {\n this.setState({\n foods: [\n ...this.state.foods,\n {\n name: data.name,\n calories: data.calories,\n image: data.image,\n quantity: 0\n }\n ],\n toggleForm: !this.state.toggleForm\n });\n }", "title": "" }, { "docid": "dd050dc8f7f8d36d6bcc20f2a19fa413", "score": "0.5998089", "text": "handleFormSubmit(e) {\n e.preventDefault();\n const postId = JSON.parse(this.state.postId);\n this.props.updatePost({\n id: postId,\n title: this.state.title,\n body: this.state.body\n });\n this.setState({\n title: \"\",\n body: \"\",\n toggle: !this.state.toggle\n });\n }", "title": "" }, { "docid": "f8eb21063780e6480db20e21ed6ffc2d", "score": "0.5993858", "text": "function _serializeFormState() {\n $(\"#searchGroups\").submit(function () {\n var frm = this;\n var $frm = $(this);\n\n // modify attribute to reflect *current* value of property\n _setAttributesToPropValue($('option', frm), \"selected\");\n _setAttributesToPropValue($('input[type=checkbox]', frm), \"checked\");\n // Note: in theory radio buttons and disabled items need similar\n // treatment, but they aren't used in this form\n\n $(\"input[type=text],input[type=hidden]\", frm).each(function (idx, inputElem) {\n $(inputElem).attr(\"value\", inputElem.value);\n });\n\n //don't persist dom elements created by google map api\n //console.log(\"clearing map information\")\n $('#large-google-map').removeData();\n $('#large-google-map').empty(\"div\");\n console.log($frm.html());\n //copy($frm.html());\n $(\"#autosave\").val($frm.html());\n\n //if doing resource search, clear collection search field so we aren't confused about which tab to display\n $(\"#queryField\").val(\"\");\n });\n }", "title": "" }, { "docid": "e4d08e5402a44b5154dfce30ec26e0a8", "score": "0.5962353", "text": "setFieldData() {\n setTimeout(() => {\n $('#name').val(this.state.name);\n $('#alcoholContent').val(this.state.alcoholContent);\n $('#description').val(this.state.description);\n $('#manufacturer').val(this.state.manufacturer);\n $('#city').val(this.state.city);\n $('#country').val(this.state.country);\n $('#photo').val(this.state.photo);\n $('#type').val(this.state.type);\n $('#style').val(this.state.style);\n }, 250);\n }", "title": "" }, { "docid": "d38f3f8809447a0d8b6c9265c3a03a4a", "score": "0.5962009", "text": "function handleSubmit() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input value from the form\n var inpu = d3.select(\"#selDataset\").node().value;\n //console.log(inpu);\n \n // clear the input value\n d3.select(\"#selDataset\").node().value = \"\";\n \n //call to run the process with the new input\n fill_info_panel(inpu);\n }", "title": "" }, { "docid": "6949157e27ab4dc7d76650bce9bf1436", "score": "0.5933564", "text": "function setData(ev) {\n const name = ev.currentTarget.name;\n const inputValue = ev.currentTarget.value;\n formData[name] = inputValue;\n updateCard();\n}", "title": "" }, { "docid": "bc9636dbaa733f804f6495175ee0e798", "score": "0.5930469", "text": "handleSubmit(e) {\n console.log('You submitted.', e.target.name, 'request', e.target.name === 'request');\n const post = {\n title: this.state.title,\n tags: this.state.tags,\n cover_url: this.state.cover_url,\n content: this.state.content,\n location: this.state.location,\n request: (e.target.name === 'request'),\n id: this.state.id,\n };\n this.props.createPost(post, this.props.history);\n // reset local state\n this.setState({\n title: '',\n tags: '',\n content: '',\n location: '',\n cover_url: '',\n });\n e.preventDefault();\n }", "title": "" }, { "docid": "eb2694d218677360cb86ce69ebb193be", "score": "0.5925591", "text": "handleFormUpdate(data) {\n const program = {\n ...this.state.program,\n ...data\n };\n console.log(program);\n this.setState({\n program: program\n })\n }", "title": "" }, { "docid": "5519d3553655417818a63d2718185b85", "score": "0.59248006", "text": "handleSubmit(e, taskinfo, status) {\n e.preventDefault();\n let mydata = {\n taskName: taskinfo,\n description: taskinfo,\n status: status,\n projectName: this.props.projectname,\n ownerName: this.props.user\n };\n //call backend ot add a task\n wx.request({\n url: \"https://stark-crag-91309.herokuapp.com/api/task\",\n method: \"POST\",\n\n data: JSON.stringify(mydata),\n dataType: \"json\",\n header: {\n \"content-ype\": \"application/x-www-form-urlencoded\"\n },\n success: res => {\n\n //update all the tasks\n switch (status) {\n case \"Todo\":\n this.setState({\n todos: res.data\n });\n break;\n case \"Doing\":\n this.setState({\n doings: res.data\n });\n break;\n case \"Done\":\n this.setState({\n dones: res.data\n });\n break;\n // code block\n }\n //refresh\n this.resetnewtask.current.resettask();\n this.setState({\n clicked: 0\n });\n }\n });\n }", "title": "" }, { "docid": "46c6d53890f2b1d03cda3feba65a6a77", "score": "0.59247243", "text": "function submitData({ value: formContent }) {\n formContent.reefType = reefTypes[formContent.reefType]\n formContent.exposure = reefExposures[formContent.exposure]\n formContent.reefZone = reefZones[formContent.reefZone]\n formContent.country = countries[formContent.country]\n\n console.log('Submit triggered. Data : ', formContent)\n }", "title": "" }, { "docid": "1e9ca74d61e96088811cc127c4eced2b", "score": "0.5919231", "text": "async handleSubmit(event) {\n // Prevents the form from submitting normally\n event.preventDefault();\n\n const { name, address } = this.state.campus;\n\n // Check if name and address are populated\n const allValid = this.isEmptyValidator(name, address);\n\n if (allValid) {\n // Submits the updated student data to our redux thunk for post request\n const { campus } = this.state;\n await this.props.updateCampus({ ...campus });\n\n // Revert editing windows\n this.toggleEditing();\n\n // If successful (not implemented yet), reset our state to be in sync with the database\n this.setState({\n ...this.state,\n campus: { ...campus },\n preValues: { ...campus },\n });\n }\n }", "title": "" }, { "docid": "4892a32a2ae77d09a409b9540362465e", "score": "0.5912912", "text": "submit(model,resetForm,invalidateForm){ \n let that =this;\n this.setState({submitting:true});\n console.log(\"inside submit\",model);\n model.e_limit = parseInt(model.e_limit);\n model.e_price = parseInt(model.e_price);\n model.e_name = model.e_name.trim();\n\n request.post(this.props.serverAddr+'/events')\n .send(model)\n .end(function(err,res){\n that.setState({submitting:false});\n if(err||!res.body.status){\n console.log('Error in posting events==>',res,err);\n that.handleSnackbar(res.body.result);\n }\n else\n {\n console.log('Posted the events',res);\n that.handleSnackbar(res.body.result);\n }\n });\n }", "title": "" }, { "docid": "b4d496255d9d6f3fcf836f7970e2a4a6", "score": "0.5912866", "text": "_submitState(event){\n if(!this._validate()){\n event.preventDefault();\n } else {\n axios.post('https://red-wdp-api.herokuapp.com/api/mars/colonists', {\n colonist: {\n name: this.state.name,\n age: this.state.age,\n job_id: this.state.job_id,\n }\n })\n .then(function (response) {\n var id = response.data.colonist.id;\n sessionStorage.setItem(\"job\", JSON.stringify(id));\n })\n .catch(function (error) {\n console.log(error);\n console.error(error);\n });\n }\n }", "title": "" }, { "docid": "a68a10fb2fb9c9a37d9ca020adcf7afb", "score": "0.5910097", "text": "function submitMod() {\n\n UserRecords.focusRecord.inherit = vm.inheritedTailoring;\n UserRecords.changeRecord(vm.state.id,\n vm.state.status, \n vm.state.guidance,\n vm.state.rationale,\n vm.state.enhanceMeasure);\n\n }", "title": "" }, { "docid": "2a1afda6255a2477e3c98ccee468393c", "score": "0.5902689", "text": "handleSubmit(event){\n if(this.state.company && this.state.role)\n {\n var data = {company:this.state.company,role:this.state.role,status:this.state.status};\n var copy = this.state.applications.slice();\n var object = this.state.stats;\n object[this.state.status]++;\n //if edit is false, it will create a new submission else it will edit and submit\n if(!this.state.edit){\n axios.post('/applications/create',data)\n .then((res) => {\n copy.push(res.data); \n this.setState({\n applications: copy,\n company:'',\n role:'',\n status:'applied',\n stats:object\n });\n })\n .catch(err => {console.log(err);});\n }else{\n axios.post('applications/'+this.state.selectId+'/edit',data)\n .then((res) => {\n copy.push(res.data);\n var idx = -1;\n for(let i=0; i < this.state.applications.length; i++){\n console.log(this.state.applications[i]);\n if(this.state.applications[i]._id === this.state.selectId){\n idx=i;\n object[this.state.applications[i].status]--;\n }\n }\n copy.splice(idx,1);\n this.setState({\n selected:undefined,\n edit:false,\n applications: copy,\n company:'',\n role:'',\n status:'applied',\n stats:object\n });\n })\n .catch(err => {console.log(err);});\n }\n }\n this.state.company ? null : this.setState({errorCompany:'Company cannot be empty'});\n this.state.role ? null : this.setState({errorRole:'Role cannot be empty'});\n event.preventDefault();\n }", "title": "" }, { "docid": "1a3d63cc6606bdceac034e131f5673d6", "score": "0.5897915", "text": "handleSubmit(event) {\n event.preventDefault()\n console.log(this.state.username)\n this.getData(this.state.username)\n \n }", "title": "" }, { "docid": "bc252feeb0ff25e39f12ec1363363ee4", "score": "0.58967566", "text": "proccesingForm(formData) {\n this.props.setProfile(formData);\n }", "title": "" }, { "docid": "c760b97f862841e5005181865f32bfd5", "score": "0.58948994", "text": "submit(values) {\n if (!values) {\n return;\n } else {\n //Set goal to local storage so that you can use it from barCharts.js\n localStorage.setItem(\"goal\", values.number);\n this.setState({\n goal: values.number\n });\n }\n }", "title": "" }, { "docid": "1606a588bc7ab47acb9e1062dd765eeb", "score": "0.5894762", "text": "handleSubmit(e) {\n alert(this.state.Title + \" \" + this.state.Year + \" \" + this.state.Cover + \" \" + this.state.Review + \" \" + this.state.Rating);\n e.preventDefault();\n\n //Create New Game Object\n const newGame = {\n title: this.state.Title,\n year: this.state.Year,\n cover: this.state.Cover,\n review: this.state.Review,\n rating: this.state.Rating\n };\n //Post to Server\n axios.post('http://localhost:4000/api/games', newGame)\n .then()\n .catch(console.log(\"Game Review Could Not Be Uploaded\"));\n\n //Set State Object of Game\n this.setState({\n title: '',\n year: '',\n cover: '',\n review: '',\n rating: ''\n });\n\n }", "title": "" }, { "docid": "c90d9db3a5d97add9b4ed283ce9f6ec5", "score": "0.5894722", "text": "onFormDataChange(fieldId, value) {\n this.state.formData.set(fieldId, value);\n this.setState({\n isCurrentStepCompleted: this.isStepCompleted(this.state.progress)\n });\n }", "title": "" }, { "docid": "a9da79f7ca1f159ddc46aa9769f469a2", "score": "0.5892431", "text": "onSubmit(text){\n //console.log('Text?', text, \"volunteer id\", this.props.volunteer._id);\n this.postRequest(this.props.pickup._id, text);\n this.setState({text:''});\n // this.setState({requests:this.props.volunteer.requests})\n }", "title": "" }, { "docid": "0a62874caf7749d8d368c0c89c7ef1e6", "score": "0.5891355", "text": "onSubmitHandler(event) {\n event.preventDefault();\n this.setState({submitDisabled: true});\n\n create(this.props.params.p_id, this.state.newtask, this.state.newdate, this.state.newlocation, this.onSubmitResponse);\n //console.log(this.state.projectname, this.state.description, this.onSubmitResponse);\n }", "title": "" }, { "docid": "ebd5e3a3d856ae21c45e1e74c025903b", "score": "0.58889717", "text": "changeInput (event, type) {\n let stateItem = {...this.state};\n stateItem.formData[type] = event;\n this.setState(stateItem);\n }", "title": "" }, { "docid": "e6f638354b78b03d64290fba055acb9e", "score": "0.5877705", "text": "function submitData(event){\n\t\t/*!!!CHANGES ARE UNCONTROLLED BY REACT!!!*/\n\t\tconst {innerText, dataset} = event.target\n\t\tconst {index, name} = dataset\n\t\tif(!innerText){\n\t\t\treturn\n\t\t}\n\t\telse if(innerText){\n\t\t\t/* a props function is called with the value, index, and name as parameters */ \n\t\t\tprops.onChange(innerText, index, name)\n\t\t}\n\t}", "title": "" }, { "docid": "5316b44c877cba28f8bac5af5f57a307", "score": "0.5869445", "text": "submitAction(donorData, validName, validMail, validPhone, validBloodGroup) {\n if (!donorData) {\n this.setState({ validPhone, validMail, validName, validBloodGroup });\n return;\n }\n //add current latitude and longotude to donor data\n donorData.lat = this.props.lat;\n donorData.lng = this.props.lng;\n createDonor(donorData, (newDonor) => {\n this.setState({\n validPhone: true,\n validMail: true,\n validName: true,\n validBloodGroup: true,\n newDonorID: newDonor.id\n })\n })\n }", "title": "" }, { "docid": "4651d922b563477abb3b7cb2c23c0b16", "score": "0.58683497", "text": "update_form_selected (state, payload) {\n state.formset[payload.key].selected = payload.value;\n }", "title": "" }, { "docid": "e20e3d493e1583593c0ffc93e4c04053", "score": "0.5867943", "text": "handleSubmit(e) {\n e.preventDefault();\n\n axios\n .post('/tasks', {\n name: this.state.name\n })\n .then(response => {\n console.log('from handle submit', response);\n // set state\n this.setState({\n tasks: [response.data, ...this.state.tasks]\n });\n // then clear the value of textarea\n this.setState({\n name: '',\n completed:false\n });\n });\n }", "title": "" }, { "docid": "67f03b8ecff3267dd78603109b1b2fee", "score": "0.5862573", "text": "handleSubmit(evt) {\n\t\tconst campusObj = this.state;\n\t\t\n\t\t// adds random portal number and random planet img to campus object\n\t\tcampusObj.portal = generateRandomPortal();\n\t\tcampusObj.imgUrl = generateRandomPlanet();\n\n\t\t// sends campus object to db as new campus and reloads page\n\t\taxios.post(`/api/campuses`, campusObj)\n\t\t\t.then(() => store.dispatch(getCampuses()))\n\t\t\t.then(() => window.location.reload())\n\t}", "title": "" }, { "docid": "6481d4b214b66f82f2a7244ee6f0491d", "score": "0.5862372", "text": "function submit(e) {\n e.preventDefault();\n ApiServices.postData({ title: data }).then((res) => {\n const mydata = [...todoList, res.data];\n setTodoList(mydata);\n });\n }", "title": "" }, { "docid": "bd70b0d8eef3b12a10c2181057d8d611", "score": "0.58560354", "text": "async submit() {\n let values = {\n locationCity: this.state.cityName,\n locationId: this.state.locationNumber,\n locationAddress: this.state.locationAddress,\n locationHours: this.state.locationHours,\n locationBiokitNumber: this.state.biokitNumber,\n }\n\n if (this.state.locationNumber === null) {\n this.setState({ pageError: 2 })\n this.selectOfficeError.focus()\n return {}\n } else {\n this.setState({ pageError: 0 })\n await this.props.context.setStore('selectProvince', values)\n await this.props.history.push('/calendar')\n }\n }", "title": "" }, { "docid": "630c8eb8e8457978e07a7910e65f0da2", "score": "0.5854533", "text": "onSubmit(event) {\n event.preventDefault();\n // set variables for each of the values in state\n var newItemName = this.state.nameFieldValue;\n var newQuantity = this.state.quantityFieldValue;\n var newType = this.state.typeFieldValue;\n \n // if a newItemName exists, create a newItem object\n \n if(newItemName) {\n var newItem = {};\n newItem.name = newItemName;\n newItem.quantity = newQuantity;\n newItem.type = newType;\n // call the addItem function with the new item object\n this.props.addItem(this.props.listKey,newItem);\n // clear the value of the form fields\n this.setState({\n nameFieldValue: '',\n quantityFieldValue: '',\n typeFieldValue: ''\n });\n\n // set the focus of the web browser to the name field\n this.state.nameFieldInputRef.focus();\n \n }\n }", "title": "" }, { "docid": "f9147b56869decf359362c231c15fcd7", "score": "0.5854179", "text": "fillFormFields(data) {\n this.titleInput.value = data.title;\n this.bodyInput.value = data.body;\n this.idInput.value = data.id;\n\n this.changeFormState('edit');\n }", "title": "" }, { "docid": "942af3568a0ee9bfa8f2ba66f1274ade", "score": "0.585084", "text": "handleAccept(event) {\n event.preventDefault(); //prevent default form submission\n\n if (!this.isPostValid()){ //check if all fields are filled in the form\n this.setState({err: \"please provide a url and caption!\"});\n return;\n }\n\n let d = new Date();\n let post = this.state.post;\n post.id = d.getTime();\n this.props.addPost(post); //push post to parent state\n\n this.setState({ //clear the form\n isVisible: false, //hide form\n err: \"\",\n post: { \n url: \"\",\n caption: \"\",\n id: \"\"\n }\n });\n }", "title": "" }, { "docid": "59b67d1cce0b6cb466aae45c1855e955", "score": "0.5849527", "text": "handleSubmit () {\n if (this.state.endTime === \"\") this.state.endTime = this.state.startTime;\n\n if (!this.errorsPresent()) {\n this.props.addEvent(this.state)\n\n this.setState({\n title: \"\",\n startTime: \"\",\n endTime: \"\",\n titleEmptyError: false,\n invalidDateError: false\n });\n }\n }", "title": "" }, { "docid": "8e41a0ad279081a796f12bb0d53fa66a", "score": "0.5844555", "text": "handleInputChange(key, e) {\n let newSelected = _.extend({}, this.state.changeRequestObject);\n newSelected[key] = e.target.value;\n\n // Update the state.\n this.setState({ changeRequestObject: newSelected });\n\n // Reset userSubmittedForm.\n this.setState({ userSubmittedForm: false });\n }", "title": "" }, { "docid": "1d019c306adebc89323faa54af683caa", "score": "0.5834447", "text": "_onChange() {\n const data = SuspiciousStore.getData();\n const state = {loading: data.loading};\n\n if (state.loading===false && data.data instanceof Array) {\n state.data = getStateFromData(data);\n state.data.maxNodes = SpotConstants.MAX_SUSPICIOUS_ROWS;\n }\n\n this.replaceState(state);\n }", "title": "" }, { "docid": "6c4d231bfb2baf037d53223afaa0d046", "score": "0.58324444", "text": "inputChangeHandler(name, value) {\n let { form } = this.state;\n form[name] = value;\n this.setState({ form: form });\n\n }", "title": "" }, { "docid": "95dcfb686c645f405e04efe849a4e67c", "score": "0.5830137", "text": "genericSync(event) {\n const { name, value } = event.target;\n this.setState({ [name]: value });\n\n // [name] is the name from the form and the state, then update that with the value being entered\n }", "title": "" }, { "docid": "665491579ef8bde2d15f291dee9f6c4b", "score": "0.5827774", "text": "handleSubmit(event) {\n event.preventDefault();\n const form = event.target;\n this._filter.type = form.elements[\"type\"].value;\n this._filter.query = form.elements[\"query\"].value;\n this.setState({status: \"LOADING\"});\n this.updateDishItems();\n }", "title": "" }, { "docid": "a25716b16dd710d7cad1ab10a473b1fe", "score": "0.58237034", "text": "handleSubmit(event) {\n this.props.fetchData(this.state.value);\n }", "title": "" }, { "docid": "3db89ff495aff1ca9e8f81a2415eb02e", "score": "0.5814496", "text": "handleChange(e) {\r\n // Prevent legacy form post\r\n e.preventDefault();\r\n\r\n // Get field name and value from event\r\n const target = e.target;\r\n let value = target.type === 'checkbox' ? target.checked : target.value;\r\n const name = target.name;\r\n \r\n // Validate\r\n FormValidator.validateForm(e); \r\n\r\n // Set state using function to granularly modify data\r\n this.setState((previousState) => {\r\n return previousState.data = { ...previousState.data, [name]: value };\r\n });\r\n }", "title": "" }, { "docid": "a0291b38e84e58897b8f36748827742d", "score": "0.58134305", "text": "handleSubmit(event) {\n let formData = this.state.formData;\n if (formData.team && formData.msg && formData.title) {\n DataStore.sendNewMessage(formData)\n .then(() => {\n this.setState({ formData: { team: formData.team, msg: \"\", title: \"\" } })\n console.log(this.state.formData)\n this.render();\n })\n }\n else {\n alert(\"Please fill all fields\")\n }\n\n }", "title": "" }, { "docid": "6af5a329ea1ec3c4cdd913e5c0aec798", "score": "0.58126533", "text": "submitPage() {\n\t\tconsole.log(this.dataEntry);\n\t\tthis.dataEntry.date_created = new Date();\n\t\t//Need to set author\n\n\t\tconsole.log(this.dataEntry);\n\t\tfetch('PLACEHOLDER_URL', {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'appication/json'\n\t\t\t},\n\t\t\tbody: this\n\t\t});\n\n\n\t\tif (this.submitCallback) {\n\t\t\tthis.submitCallback(this.dataEntry);\n\t\t}\n\n\t\t// Clear form for future use\n\t\tthis.dataEntry = new DataEntryModel(\"\", \"\", \"\", \"\", \"\");\n\t}", "title": "" }, { "docid": "1ead9fde9b997d215820df2855865f2c", "score": "0.5810388", "text": "constructor(props) {\n super(props);\n this.state = {\n Andrew: false,\n TomD: false,\n TomM: false,\n Matt: false\n }\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleChangeAndrew = this.handleChangeAndrew.bind(this);\n this.handleChangeMatt = this.handleChangeMatt.bind(this);\n this.handleChangeTomD = this.handleChangeTomD.bind(this);\n this.handleChangeTomM = this.handleChangeTomM.bind(this);\n }", "title": "" }, { "docid": "2397cd992e522705b62c1c3f4a4b3380", "score": "0.58092535", "text": "function getState() {\n return {\n data: {},\n formValid: false\n };\n}", "title": "" }, { "docid": "1c722ca5845392024df735e7f2ffd70d", "score": "0.58076155", "text": "onSubmit(event){\n if(event.target.title.value !== \"\") {\n const data = this.state.notes;\n data[event.target.title.value] = {\n title: event.target.title.value,\n };\n this.setState({notes: data});\n this.props.updateStorage();\n }\n event.preventDefault();\n }", "title": "" }, { "docid": "7d2942fdaa79d84cb5540be98a08dd1b", "score": "0.58046997", "text": "submit() {\n this.data.authors = this.finalAuthors;\n //this.data.utility.setSuccess(FieldList.AUTHOR, true);\n //this.data.utility.setFlow(FieldList.ABSTRACT, true);\n this.controller.ok();\n }", "title": "" }, { "docid": "af1ba3c45b871afda131b8bdd9376e82", "score": "0.58044595", "text": "onSubmit(e) {\n e.preventDefault();\n const curUser = store.getState().security.user \n const AdminReq = {\n user: curUser.fullName,\n ...this.state\n };\n this.props.createRequests(AdminReq, this.props.history);\n }", "title": "" }, { "docid": "5140ca76d026a5e81a6b8ab90d7777b7", "score": "0.5798263", "text": "completeSubmit() {\n this.data = {};\n this.resetMaster();\n this.writeDetail();\n this.detailMode();\n }", "title": "" }, { "docid": "7b7387d873d78e83ac0f4787e7b7eae4", "score": "0.57979524", "text": "submit() {\n if (this.validateSubmit()) {\n if (this.mode === 'register') {\n this.__store();\n } else if (this.mode === 'updating') {\n this.__update();\n }\n }\n }", "title": "" }, { "docid": "7b7387d873d78e83ac0f4787e7b7eae4", "score": "0.57979524", "text": "submit() {\n if (this.validateSubmit()) {\n if (this.mode === 'register') {\n this.__store();\n } else if (this.mode === 'updating') {\n this.__update();\n }\n }\n }", "title": "" }, { "docid": "2ca7aee44f062a6d1ceb49d468595193", "score": "0.5790966", "text": "function updateData(data) {\n // data.selected = this.checked;\n data.selectedGen++;\n // model.provider.updateField(data.name, { active: data.selected });\n model.provider.toggleFieldSelection(data.name);\n }", "title": "" }, { "docid": "1b95976814910d4c90e02c10697324a7", "score": "0.57880723", "text": "formLoading() {\n this.setState({\n formSubmissionState: 1,\n });\n }", "title": "" }, { "docid": "b77753b96e7f777ea5e30c125fd2b01c", "score": "0.57789624", "text": "recTaskInfo(event){\n let typeTask = event.currentTarget.dataset.task;\n let field = event.target.name;\n let value = event.target.value;\n if(typeTask !== \"undefined\"){\n this.setState({taskType:typeTask });\n }\n this.setState({taskInfo: {...this.state.taskInfo ,[field]:value} });\n}", "title": "" }, { "docid": "ef049d8e4ea99040569aa2d3dbedddfd", "score": "0.5776864", "text": "function setData (data) {\n state.add.searchResult = data\n state.add.searchQuery = data.id\n\n emitter.emit('render')\n }", "title": "" }, { "docid": "014a67b0c590e39d66a3e93ea7f08e89", "score": "0.57737875", "text": "handleChange(e) {\r\n // Prevent legacy form post\r\n e.preventDefault();\r\n\r\n // Get field name and value from event\r\n const target = e.target;\r\n let value = target.type === 'checkbox' ? target.checked : target.value;\r\n const name = target.name;\r\n\r\n // Set state using function to granularly modify data\r\n this.setState((previousState) => {\r\n return previousState.data = { ...previousState.data, [name]: value };\r\n });\r\n }", "title": "" }, { "docid": "8e31ac1c03f1d1d9f3426508cb163a01", "score": "0.57688993", "text": "constructor(){\n super();\n this.state = {\n currentItem: {\n marked: false,\n itemText: \"\"\n }\n }\n \n this.handleChange = this.handleChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }", "title": "" }, { "docid": "baabc74097b40cd798935c1662560a33", "score": "0.57677305", "text": "onSubmit(){\n console.log(\"SUCCESSFULLY SUBMITTED FORM\")\n console.log(`WO ProjId: ${this.state.w_projectid}`)\n console.log(`WO WOnum: ${this.state.w_WOnum}`)\n console.log(`WO-desc: ${this.state.w_desc}`)\n\n const newWorkorder = {\n \"w_projectid\" : this.state.w_projectid,\n \"w_WOnum\": this.state.w_WOnum,\n \"w_desc\": this.state.w_desc,\n \"w_status\": this.state.w_status,\n \"w_reporteddate\": this.state.w_reporteddate,\n \"w_location\": this.state.w_location,\n \"w_type\": this.state.w_type,\n \"w_TPID\": this.state.w_TPID,\n \"w_PSProject\": this.state.w_PSProject,\n \"w_PSProjDesc\": this.state.w_PSProjDesc,\n \"w_PSActivity\": this.state.w_PSActivity,\n \"w_PSActDesc\": this.state.w_PSActDesc\n }\n\n axios.post('http://localhost:4006/create', newWorkorder)\n .then(res => console.log(res.data))\n\n if(this.state.w_WOnum == 10){\n this.props.history.push('/alertMessage'); \n }\n\n this.setState({\n 'w_projectid' : '',\n 'w_WOnum': 0,\n 'w_desc': '',\n 'w_status': '',\n 'w_reporteddate': '',\n 'w_location': '',\n 'w_type': '',\n 'w_TPID': '',\n 'w_PSProject': '',\n 'w_PSProjDesc': '',\n 'w_PSActivity': '',\n 'w_PSActDesc': ''\n })\n\n \n }", "title": "" }, { "docid": "6964b338b184fdb7acf22219dc092071", "score": "0.57643706", "text": "_submitGroup(state){\n\n if(this.state.typeAction!==''){\n let data = {\n name:state.groupName,\n staff_on:state.selectedUsers\n };\n \n if(this.state.typeAction==='put'){\n data['id'] = state.id\n }\n \n this.moGroupUsers.axios(this.state.typeAction,data,(data)=>{\n if(data.name==='success'){\n this._loadGroupUserRoles();\n this.setState({\n isOpenForm:false\n })\n }\n });\n }\n \n }", "title": "" }, { "docid": "5efc2e68f080a0b4109165d4714d0eb0", "score": "0.57637584", "text": "_onChange() {\n\t\t// console.log(\"Set state..\");\n\t\tthis.setState(getStateFromStores());\n\t}", "title": "" }, { "docid": "ed4b0fff8a1e010b70fc7c921d36fd1e", "score": "0.5763268", "text": "handleSubmit(event){\n event.preventDefault();\n const newBooking = {\n \"date\": this.state.date,\n \"status\": this.state.status,\n \"totalCost\": this.state.totalCost,\n \"remarks\": this.state.remarks,\n \"customer\": event.target.customer.value,\n \"style\": event.target.style.value,\n \"fabrics\": this.state.fabricOptions,\n \"tailor\": event.target.tailor.value,\n \"measurement\": event.target.measurement.value,\n }\n this.props.handleBookingEdit(newBooking);\n }", "title": "" }, { "docid": "c109e410422faa6b7e2b1bb9a0cdc704", "score": "0.5760807", "text": "handleSubmit(values, { setStatus, resetForm }) {\n\n }", "title": "" } ]
ec6c8dba59c27f15ce80eee588a3e542
Where the game play happens after user guesses
[ { "docid": "39b45a6c2a7a02118c55086dad11c3b7", "score": "0.69291663", "text": "function enterGuess() {\n var userGuess = document.getElementById('user-guess').value.toLowerCase();\n\n document.getElementById('user-guess').value = '';\n // Error check user's guess\n if (alreadyGuessedArray.includes(userGuess)) {\n showInputMessage('Already guessed that letter');\n return;\n } else if (userGuess.length > 1) {\n showInputMessage('Please only guess one letter at a time');\n return;\n } else if (userGuess.length == 0) {\n showInputMessage('You gotta type something in the box');\n return;\n } else if (!userGuess.match(/[a-z]/)) {\n showInputMessage('Letters only please');\n return;\n }\n\n // If user's input is valid, remove last invalid input message\n showInputMessage('');\n\n alreadyGuessedArray.push(userGuess);\n alreadyGuessed.innerHTML = alreadyGuessedArray.join(' ');\n\n\n // Create array containing indices of where guess occurs in letter if it's correct\n var indexArray = [];\n if (targetWordList.includes(userGuess)) {\n\n targetWordList.forEach(function(element, index) {\n if (element === userGuess) {\n indexArray.push(index);\n }\n });\n\n // Replace all occurrences of guessed letter into displayed word and redisplay to user\n indexArray.forEach(function(idx) {\n blankWord.splice(idx, 1, targetWordList[idx]);\n });\n\n\n showWord.innerHTML = blankWord.join(' ').replace(/ /g, '&nbsp;');\n\n } else if (targetWordList.includes(userGuess) === false) {\n // decrease number of lives by 1\n lives--;\n livesTag.innerHTML = lives;\n\n // Update the canvas\n // When sceneNumInt exceeds 10, the player has lost\n sceneNumInt += 1;\n sceneNumStr = 'hangman' + sceneNumInt;\n newSource = \"uploads/\" + sceneNumStr + \".png\";\n document.getElementById('scene').src = newSource;\n\n }\n\n // User correctly guesses all letters in word\n if (blankWord.join('') === targetWord) {\n document.getElementById('win-lose').innerHTML = 'Congrats. You won!';\n var newScoreWin = changeScore(true);\n updateUserScore(newScoreWin);\n }\n\n // User runs out of lives\n if (lives == 0) {\n document.getElementById('win-lose').innerHTML = 'Game over. The correct answer was ' + targetWord + '.<br/>But hey - at least you got away :)';\n var newScoreLose = changeScore(false);\n updateUserScore(newScoreLose);\n }\n}", "title": "" } ]
[ { "docid": "1f4c60e3c76a164d4df03481348f6aaa", "score": "0.73511267", "text": "function handlePlayAgain() {\n\tsetupNewGame();\n\tsetGuessInput(\"\");\n}", "title": "" }, { "docid": "c3ca08b398bb707d88f8b83305445bae", "score": "0.7339065", "text": "function playGame() {\n\tinquirer.prompt([\n\t\t\t{\n\t\t\t\ttype: \"input\",\n\t\t\t\tmessage: \"Guess a letter!\",\n\t\t\t\tname: \"userGuess\",\n\n\t\t\t}\n\t\t]).then(function(answer) {\n\t\t\t\n\t\t\tuserGuess = answer.userGuess;\n\n\t\t\tif (guessedLetters.includes(userGuess)) {\n\t\t\t\tconsole.log(\"\\nYou already guessed that letter.\\n\");\n\t\t\t\tdisplayedWord.returnString();\n\t\t\t\tplayGame();\n\n\t\t\t} else {\n\t\t\t\tif (alphabet.includes(userGuess.toUpperCase())) {\n\t\t\t\t\tguessedLetters.push(userGuess);\n\t\t\t\t\tdisplayedWord.guessLetter(userGuess);\n\t\t\t\t\tcheckGuess();\n\t\t\t\t\tdisplayedWord.returnString();\n\t\t\t\t\tcheckWin();\n\n\t\t\t\t\tif (guessesRemaining > 0) {\n\t\t\t\t\t\tplayGame();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"Game over! You ran out of guesses!\\n\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"\\nPlease enter a valid letter.\\n\");\n\t\t\t\t\tdisplayedWord.returnString();\n\t\t\t\t\tplayGame();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n}", "title": "" }, { "docid": "9fa8cfd3947c2b0bd865938fa31fc1b8", "score": "0.7333242", "text": "function checkGuesses(){\n\t\t\tif (guesses < 1){\n\t\t\t\tdocument.getElementById(\"notification\").innerHTML = \"Sorry, you are out of guesses\";\n\t\t\t\trunGame();\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "442b7c59f2200a7fa72648438772f091", "score": "0.7288215", "text": "function handleGuess() {\n // Check if remaining guesses is -1 and setup a new game if so.\n\tif (remainingGuesses == -1) {\n\t\tsetupNewGame();\n\t}\n\n\tif (remainingGuesses == 1) {\n\t\tguessBtn.disabled = true;\n\t}\n\n // Retreive the user's newest guess.\n\tlet newestGuess = getGuessInput();\n\n // Check if the user has won. We should show a message, set remaining guesses to 0, and return from this function.\n \t// Check if the guess is higher or lower and show appropriate message.\n\t// The user has used a guess, decrement remainin guesses and show the new value.\n\n\tif (newestGuess == magicNumber) {\n\t\tshowMessage(\"win-message\");\n\t\tremainingGuesses = 0;\n\t\tshowRemainingGuesses(remainingGuesses);\n\t} else if (newestGuess < magicNumber) {\n\t\tshowMessage(\"higher-message\");\n\t\tremainingGuesses--;\n\t\tshowRemainingGuesses(remainingGuesses);\n\t} else if (newestGuess > magicNumber) {\n\t\tshowMessage(\"lower-message\");\n\t\tremainingGuesses--;\n\t\tshowRemainingGuesses(remainingGuesses);\n\t}\n\n // If the remaining guesses is 0, then the user has lost and that message should be shown.\n\tif ((remainingGuesses === 0) && (newestGuess != magicNumber)) {\n\t\tshowMessage(\"lose-message\");\n\t}\n}", "title": "" }, { "docid": "dc02fc33e3885eeba2f16a7f96843871", "score": "0.72821754", "text": "function checkGuess(){\n\t if (playersGuess === winningNumber){\n\t\t\t$('#remaining').text(\"You Win! Congratulations!\");\n\t\t\t$('#win').css(\"display\", \"block\");\n\t\t\t$('#hintText').text(\"It took you \"+guesses.length+\" guesses\");\n\t\t\tcleanUp();\n\t\t} else {\n\t\t\tlowerOrHigher();\n\t\t}\t\n\t}", "title": "" }, { "docid": "90f33f7bce854f8d61f74688006c4e85", "score": "0.7184256", "text": "function game() {\n\tif (GameState == StateManager.StartGame) {\n\t\t\tstart();\n\t\t} else if (GameState == StateManager.RestartGame) {\n\t\t\trestart();\n\t\t} else if (GameState == StateManager.Playing) {\n\t\t\t// Updating Failed Tries Text\n\t\t\t$('#failedTriesText').html(FAILED_TRIES);\n\n\t\t\tif (getCardsMatched(CARDS_IN_GAME).length == 12) {\n\t\t\t\tGameState = StateManager.Win;\n\t\t\t}\n\n\t\t} else if (GameState == StateManager.Win) {\n\t\t\ttimer('stop');\n\n\t\t\t// Set overlay text\n\t\t\t$('#overlayTimerText').html(parseTime(TIME));\n\t\t\t$('#overlayFailedTriesText').html(FAILED_TRIES);\n\n\t\t\t// Pop up Win overlay\n\t\t\tif (!WIN_OVERLAY_ON) {\n\t\t\t\t$('#winOverlay').modal('toggle');\n\t\t\t\tWIN_OVERLAY_ON = true;\n\t\t\t}\n\t\t} else if (GameState == StateManager.Lose) {\n\t\t\ttimer('stop');\n\t\t\t//console.log('inside lose');\n\t\t}\n}", "title": "" }, { "docid": "a48238073adfd296aa2739f86614b8fe", "score": "0.71713907", "text": "function alreadyGuessed () {\n console.log(\"alreadyGuessed() started\");\n document.getElementById(\"aviso\").textContent = \"You have already guessed \" + guess;\n console.log(\"alreadyGuessed() ended\");\n}", "title": "" }, { "docid": "e17489b164dc436dec72a07a838bc394", "score": "0.71328104", "text": "function guess() {\n\tvar guess = $('#letterModal').val();\n\tif (modalState.game.guesses.includes(guess)) {\n\t\talert('Invalid guess, already guessed');\n\t\treturn;\n\t}\n\t$('#letterModal').remove();\n\t$('#guessBtn').remove();\n\t$.ajax ({\n\t\turl: 'wordgame/api/v3/'+modalState.user._id+'/'+modalState.game._id+'/guesses?guess='+guess,\n\t\tmethod: 'POST',\n\t\theaders : {'X-CSRF' : modalState.csrf},\n\t\tsuccess: (game) => {showModal(game); gameList();},\n\t\terror : () => setUser(null)\n\t});\n}", "title": "" }, { "docid": "c909e2fa596f12b0d493c56019b8caa7", "score": "0.71193326", "text": "function updateGuess() {\n ch_push(state.guess)\n }", "title": "" }, { "docid": "0503a2ea5035afedf578fbb90b8eae68", "score": "0.7111209", "text": "function checkGuess(){\n\tif(gameData.playersGuess === gameData.winningNumber){\n\t\tgameData.gameOver = true;\n\t\t$('h1').text('You won!').addClass('winnerText').animate({'font-size': '9rem'});\n\t\t$('html').addClass('winnerBackground');\n\t\t$('input, p, #makeGuess, #hint').fadeOut();\n\t} else if(gameData.guesses.indexOf(gameData.playersGuess) !== -1){\n\t\t$('#alert').text(\"You've already guessed that number! Try again.\");\n\t} else {\n\t\t$('#alert').text(\"Try again!\");\n\t}\n\n\t//display the alert message paragraph tag if needed\n\tdisplayParagraph('#alert');\n}", "title": "" }, { "docid": "c34508e93947596b805205ee34d7057a", "score": "0.7011216", "text": "function guess(ev) {\n let valid_guess = validateGuess(text);\n setText(\"\");\n if (valid_guess) {\n let ng = guesses.concat(text);\n console.log(\"ng\", ng);\n setLastGuessInvalid(false);\n setGuesses(ng);\n check_game_over(text);\n } else {\n console.log(\"invalid guess\");\n setLastGuessInvalid(true);\n }\n }", "title": "" }, { "docid": "7b3bfefe3eed1643bbd38914d8eab64f", "score": "0.70095366", "text": "function startOver() {\n wrongGuess = [];\n currentBlanks = [];\n playGame()\n\n}", "title": "" }, { "docid": "1d8b82132f8eeddd85537b3964c13d9b", "score": "0.69876665", "text": "function startGame(){\n\n if(lettersGuessed > 0){\n lettersGuessed = [];\n }\n//This section uses the inquirer package to prompt the player with a question and confirm function.\n inquirer.prompt([{\n name: \"play\",\n type: \"confirm\",\n message: \"Do you know your Simpson's characters?\"\n }]).then(function(answer) {\n if(answer.play){\n newGame();\n } else{\n console.log(\"I don't watch the Simpson's, which means I suck!\");\n }\n })}", "title": "" }, { "docid": "f78d7bf41b3b11b550513e40532a4803", "score": "0.69602495", "text": "function handlePlayerInput() {\n var guess = getPlayerGuess();\n\n var message = \"\";\n if (submitGuess(guess)) {\n var difference = getGuessDifference(guess);\n if (difference === 0) {\n message += 'You won!';\n $('body').addClass('win');\n } else if (guesses.length === 5) {\n message += 'You lost!';\n } else if (difference < 0) {\n message += 'Your guess is too low.';\n } else {\n message += 'Your number is too high.';\n } \n\n var absDifference = Math.abs(difference);\n if (absDifference > 0 && guesses.length < 5) {\n if (absDifference <= 5) {\n message += \" You are hot!\";\n } else if (absDifference <= 15) {\n message += \" You are warm.\";\n } else if (absDifference <= 30) {\n message += \" You are cold.\";\n } else {\n message += \" You are freezing!\";\n }\n }\n } else {\n if (guesses.length < 5) {\n message += \"You have already guessed this!\";\n }\n }\n\n showMessage(message);\n}", "title": "" }, { "docid": "c48af5129fa92fd4690d0edb7afdff0d", "score": "0.69581467", "text": "function initGame(){\n selectGameWord();\n //console.log(\"Converted to gameWord: \" + word);\n word.displayWord();\n numGuesses = 10;\n promptGuess();\n}", "title": "" }, { "docid": "f5758f026dc9dd4943fdab3a85d940be", "score": "0.6941443", "text": "function correctGuess() {\n score += wrongAnswersLeft;\n if (score > hScore) {\n hScore = score;\n }\n setCorrectScreen(wrongAnswersLeft);\n }", "title": "" }, { "docid": "959fd93e00770c3f55df13d642c96c25", "score": "0.69332993", "text": "function newGame() {\n // reset values\n currentWord = wordArray[Math.floor(Math.random() * wordArray.length)]\n word = new Word(currentWord)\n guessesRemaining = 10\n lettersGuessed = []\n\n // initial game screen\n console.log('\\n\\n')\n console.log('*******************************')\n console.log(' Hangman: Geography Edition!')\n console.log('*******************************')\n console.log('\\n')\n console.log()\n word.renderWord()\n console.log()\n getUserGuess()\n}", "title": "" }, { "docid": "2d748a5df1979cfdf3c17f9aedf5b087", "score": "0.69303614", "text": "function gameReplay() {\n guessesRemaining = 10;\n lettersGuessed = [];\n computerGuess = options[Math.floor(Math.random() * options.length)];\n}", "title": "" }, { "docid": "a3824800478e44626ac3123b5742b3f4", "score": "0.69251096", "text": "check() {\n if (User.lives == 0) {\n $(\"#plrl\").show().delay(\"3000\").fadeOut();\n $(\"#def\").html(\"You lose.\")\n disableButtons();\n $(\".scoretxt\").html(\"Score:\" + --User.score)\n window.setTimeout(a => {\n this.resetGame()\n }, 2000);\n }\n if (User.guess == currentWord.word) {\n $(\"#plrw\").show().delay(\"3000\").fadeOut();\n User.guess = \"\"\n window.setTimeout(a => {\n this.resetGame()\n }, 2000);\n }\n }", "title": "" }, { "docid": "a937c67969e0a4229ff0f16564f5abb3", "score": "0.6916838", "text": "result(input){\n let h4 = document.querySelector(\"#guessesRemaining\")\n if(this.game.isValidGuess(input.toLowerCase()) && !this.game.computer.word.includes(input.toLowerCase())){\n this.game.guessLetters.push(input.toLowerCase());\n this.game.guessesRemaining -= 1;\n h4.innerText = `Incorrect guess! Guesses remaining: ${this.game.guessesRemaining}`;\n } else if(this.game.isValidGuess(input.toLowerCase())){\n this.game.guessLetters.push(input.toLowerCase());\n this.game.board.addChar(this.game.computer.word, input.toLowerCase());\n h4.innerText = `Correct guess! Guesses remaining: ${this.game.guessesRemaining}`;\n } else {\n h4.innerText = `Please enter valid Guess! Guesses Remaining: ${this.game.guessesRemaining}`;\n }\n this.play();\n }", "title": "" }, { "docid": "104baab04b6db85de1e6bac0c154d347", "score": "0.6916602", "text": "function setupNewGame() {\n\tmagicNumber = getRandomIntInclusive(1, 100);\n\tremainingGuesses = 5;\n\tshowRemainingGuesses(remainingGuesses);\n\thideAllMessages();\n\tguessBtn.disabled = false;\n}", "title": "" }, { "docid": "10f727d630e84fd9e2178de67fe1cc33", "score": "0.69137675", "text": "function playStrategy (guesses, callback) {\n // Timeout makes it look like the AI is \"thinking\"\n setTimeout(function () {\n callback(randomCell(guesses));\n }, 500);\n \n function randomCell (board) {\n return [\n _.random(guesses.length-1),\n _.random(guesses[0].length-1)\n ];\n }\n }", "title": "" }, { "docid": "fbff6c4bac2b4b45f48a26818df21be4", "score": "0.6887005", "text": "function gameLogic() {\n // checks for win\n if( letter == userInput ){\n //console.log(\"its a win\");\n wins++;\n reset();\n } else {\n // operations for guesses-left and concat strings for guesses-so-far\n guessesLeft--;\n //console.log(\"guesses left: \" + guessesLeft);\n if(guessesLeft == 8){\n guesses = userInput;\n //console.log(\"guesses so far: \" + guesses);\n } else {\n str1 = guesses;\n str2 = \", \" + userInput;\n guesses = str1.concat(str2);\n //console.log(\"guesses so far: \" + guesses);\n }\n }\n // checks for loss\n if (guessesLeft < 1){\n //console.log(\"its a loss\");\n loss++;\n reset();\n }\n update();\n}", "title": "" }, { "docid": "c739f8bd442910a7ec573e2d051bb4a2", "score": "0.6865087", "text": "function newGame() {\n\t$('#feedback').text(\"Make your Guess!\");\n\tclearGuess();\n\tguessCount = 0;\n\t$('#count').text(guessCount);\n\t$('#guessList').html(\"\");\n\tsetNumber();\n}", "title": "" }, { "docid": "2c98df760c775540cf152e2e0f54edb8", "score": "0.6856262", "text": "function replayGame() {\n resetGame();\n togglePopup();\n }", "title": "" }, { "docid": "179fcb92f974106680e5e533bf6e31bb", "score": "0.68558586", "text": "function game() {\n updateStats();\n //get secret letter\n secretLetter = generateLetter(letters);\n console.log(\"secret: \" + secretLetter);\n //get user's guess\n document.onkeyup = function (event) {\n userGuess = event.key.toLowerCase();\n console.log(\"user: \" + userGuess);\n //------------------compare guesses-------------------\n //if not correct: decrement guesses left, update stats\n if (userGuess != secretLetter) {\n guessesLeft--;\n guessesSoFar = guessesSoFar + \" \" + userGuess;\n updateStats();\n //if not correct *and* no guesses left: increment losses, reset guesses, update stats, //restart game \n if (guessesLeft === 0) {\n guessesLeft = 7;\n guessesSoFar = \"\";\n secretLetter = \"\";\n losses++;\n updateStats();\n game();\n };\n //if correct: increment wins, reset guesses, update stats, restart game \n } else {\n wins++;\n guessesLeft = 7;\n guessesSoFar = \"\";\n secretLetter = \"\";\n updateStats();\n game();\n };\n\n };\n}", "title": "" }, { "docid": "93f4e151adbd5a0992cd462ba7e41361", "score": "0.68527544", "text": "function playGame() {\n // if there are still guesses left and there are still blanks in the word\n if ((numGuesses > 0) && (!isWon)) {\n\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Guess a letter\",\n name: \"letter\"\n }\n\n ]).then(answers => {\n\n var letterInWord = false;\n //check if the letter is in the word\n for (var i = 0; i < newWord.letterObjArray.length; i++) {\n\n if (newWord.letterObjArray[i].value == answers.letter) {\n\n newWord.letterObjArray[i].guessed = true;\n\n letterInWord = true;\n }\n }\n //after done checking all the letters, display the word\n newWord.showWord();\n\n // if the letter is in the word\n if (letterInWord) {\n console.log(colors.green(\"\\nCORRECT!!!\\n\"));\n }\n\n // if it's not in the word\n else {\n numGuesses--;\n\n // if there are no more guesses left\n if (numGuesses == 0) {\n console.log(colors.red(\"\\nINCORRECT!\") + \" You ran out of guesses!\\n\")\n }\n\n else {\n console.log(colors.red(\"\\nINCORRECT!\") + \" You have \" + numGuesses + \" guesses left\\n\")\n }\n }\n\n //if there are no undercores left in display, the game is won\n if (newWord.display.indexOf(\"_\") == -1) {\n isWon = true;\n console.log(\"\\nYou got it right!\\n\")\n }\n\n // go back to beginnin of playGame() function\n //and check if the playGame conditions are met (to continue)\n playGame();\n\n }); // close.then\n\n }\n // if game over\n else {\n\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"playAgain\",\n message: \"Do you want to play again?\"\n }\n ]).then(function (playMore) {\n // if user said yes\n if (playMore.playAgain) {\n //start a newGame\n initializeGame();\n playGame();\n }\n\n });\n\n }\n\n} //close playGame()", "title": "" }, { "docid": "d778a5497036588a4d7b6b1f2d7d4b02", "score": "0.6852217", "text": "function submitGuess() {\n if (!currentGuess.includes(0)) {\n guesses.push(currentGuess);\n\n $('#row' + guesses.length).find('.col1').html(currentGuess[0]);\n $('#row' + guesses.length).find('.col2').html(currentGuess[1]);\n $('#row' + guesses.length).find('.col3').html(currentGuess[2]);\n $('#row' + guesses.length).find('.col4').html(currentGuess[3]);\n\n result = guessResult();\n\n if (result[0] == 2 && result[1] == 2 && result[2] == 2 && result[3] == 2) {\n $('#result').html(\"YOU WIN\");\n } else {\n $('#row' + guesses.length).find('.result').html(result.toString());\n }\n\n currentGuess = [0, 0, 0, 0];\n updateGuessedDisplay();\n setSelected(0);\n updateDisplay();\n if (guesses.length >= 12) {\n $('#result').html(\"YOU LOSE!\");\n }\n\n }\n }", "title": "" }, { "docid": "e5e1a5d56a5412ceb60b12b70bdfcdc6", "score": "0.685072", "text": "function play() {\n pickedWord = \"\";\n guesses = 15;\n if(pickedWords.length < wordStore.length) {\n pickedWord = getNewWord();\n } else {\n //If the User Wins, Show message\n console.log(\"Yay you win! Looks like you are an astronomy pro!\");\n //Allow user to decide if they want to keep playing the game\n continuePrompt();\n }\n if(pickedWord) {\n word = new Word(pickedWord);\n word.createLetters();\n guess();\n }\n }", "title": "" }, { "docid": "d3ed1db6d92181947cb5fd609fda6a39", "score": "0.68446696", "text": "function playAgain(){\n // add code here\n guesses = []\n hintUsed = false;\n playersGuess = '';\n generateWinningNumber();\n guessesLeft = 5;\n\n $('.helpMessage').html(\"Guess a number between 1 and a 100. We'll tell you if you're getting hotter or warmer!\");\n $('.guessMessage, .guessError, .guessHint').html('');\n $('.colorTransition').css('background-color','none');\n $('.image-container').html('<img src=\"http://s.quickmeme.com/img/04/041a37e80660a87acf2d11d499682114fc9cf58e9c9ddfc4d04887ddf354f85f.jpg\" />')\n $('.guessleft').html(5);\n }", "title": "" }, { "docid": "cfcf34d734eadb9625b68a173cabdc5c", "score": "0.6841212", "text": "function updateGuessNum(){\n\n//if 5 guesses have been used, alert the user that there are no more guesses, end game\n\tif (gameData.guesses.length === 5){\n\t\t$('h1').text('GAME OVER').addClass('gameOver').animate({'font-size': '9rem'});\n\t\tgameData.gameOver = true;\n\t\t$('input, p, #makeGuess, #hint').fadeOut();\n\t} else {\n\t\t$('#tries').html('<span>' + (5 - gameData.guesses.length) + '</span> Guesses Remaining');\n\t}\n}", "title": "" }, { "docid": "cd65c31cd87cf1eec0ebdd9d0dca7e3f", "score": "0.6838181", "text": "function letsPlay(){\n\n currentWord = wordBank[Math.floor(Math.random()* wordBank.length)];\n guessedLetters = [];\n let guesses = 0;\n let guessMe = new Word(currentWord);\n console.log(`*********** NEW GAME ***********`);\n guess(guessMe,guesses); // Starts the game by letting the player guess\n\n}", "title": "" }, { "docid": "f65d94249ba3eb03072559b07b8a59a1", "score": "0.6834138", "text": "startGame() {\n //Creates new instance of a phrase (phrase object)\n game_phrase = new Phrase(game.getRandomPhrase());\n // Displays the hidden phrase to be guessed\n phrase_to_guess.innerHTML = game_phrase.addPhraseToDisplay(game_phrase.phrase);\n }", "title": "" }, { "docid": "ee0d9d32c97dde956ee03af088d50acb", "score": "0.68318564", "text": "function guess() {\n\t\t// Capture the guess value:\n\t\tvar inputValue = document.getElementById(\"input\").value;\n\t\t\n\t\t// Verify the guess is a number using the previously defined function (isNumber()):\n\t\tvar isNum = isNumber(inputValue);\n\t\tif ( isNum === false) {\n\t\t\tguesses += 1;\n\t\t\tdisplay(\"red\", true, \"You must enter a number!\");\n\t\t\tupdateGameGuesses(inputValue, \"Not a number\");\n\n\t\t// Was the guess too low?\n\t\t} else if ( inputValue < ranNum ) {\n\t\t\tguesses += 1;\n\t\t\tdisplay(\"yellow\", true, \"Too low\");\n\t\t\tupdateGameGuesses(inputValue, \"Too low\");\n\n\t\t// Was the guess too high?\n\t\t} else if ( inputValue > ranNum ) {\n\t\t\tguesses += 1;\n\t\t\tdisplay(\"yellow\", true, \"Too high\");\n\t\t\tupdateGameGuesses(inputValue, \"Too high\");\n\n\t\t// Was the guess correct?\n\t\t} else if (ranNum == inputValue) { \n\t\t\tguesses += 1;\n\t\t\t// Display a message if the user guessed correctly on their first try:\n\t\t\tif(guesses === 1) {\n\t\t\t\tdisplay(\"blue\", false, \"You got it! The number was \" + ranNum + \". It only took you one guess!\", \"Start again (it's ready).\");\n\t\t\t// Display a message if the user required 2 or more guesses:\n\t\t\t} else {\n\t\t\t\tdisplay(\"blue\", false, \"You got it! The number was \" + ranNum + \". It took you \" + guesses + \" guesses.\", \"Start again (it's ready).\")\n\t\t\t}\n\t\t\tupdateGameGuesses(inputValue, \"Correct\");\n\n\t\t\t// For this one game, that was guessed correctly, store the game stats:\n\t\t\tvar gameStat = [numRange, ranNum, guesses];\n\t\t\t// Add the game stat to an array that persists for the window session (is emptied after a page refresh):\n\t\t\tvar sessionScore = new Array();\n\t\t\tsessionScore[sessionScore.length] = gameStat;\n\n\t\t\t// Display the Session Scores in a table:\n\t\t\tfor( var i = 0; i < sessionScore.length; i++ ) {\n\t\t\t\tvar gameStat = sessionScore[i],\n\t\t\t\ttr = document.createElement(\"tr\"),\n\t\t\t\ttd0 = document.createElement(\"td\"),\n\t\t\t\ttd1 = document.createElement(\"td\"),\n\t\t\t\ttd2 = document.createElement(\"td\");\n\n\t\t\t\ttd0.appendChild(document.createTextNode(\"1 to \" + gameStat[0]));\n\t\t\t\ttd1.appendChild(document.createTextNode(gameStat[1]));\n\t\t\t\ttd2.appendChild(document.createTextNode(gameStat[2]));\n\t\t\t\ttr.appendChild(td0);\n\t\t\t\ttr.appendChild(td1);\n\t\t\t\ttr.appendChild(td2);\n\t\t\t\tsessionScoreTable.appendChild(tr);\n\t\t\t}\n\n\t\t\t// Reset the game:\n\t\t\tresetGameGuessesTable();\n\t\t\tgameGuesses.length = 0;\n\t\t\tgameStat = 0;\n\t\t\tguesses = 0;\n\t\t\tnewRanNum();\n\t\t}\n\t}", "title": "" }, { "docid": "eb5c93cea9fc6313a2aac2d5cf28c3ef", "score": "0.680068", "text": "function handleInput(inputObj){\n //check if the user has entered a valid letter key, other key presses are\n //passed to the end of the function with an error message to the indicator\n if(inputObj.code.slice(0,3) == \"Key\"){\n //if we have a valid key, get the letter so we can compare to our Alphabet Object\n var key = inputObj.code.slice(3,4).toLowerCase();\n if(alphabetObj[key].guessed === true){\n //key was already guessed\n wrong_audio.play();\n updateIndicator( );\n flashWarn('You Already Guessed That Letter');\n }else{\n //key has not been guessed before, so set it to guessed = true\n alphabetObj[key].guessed = true;\n if(randomWord.indexOf(key) > -1){\n //key is a letter in the word we are guessing\n alphabetObj[key].correct = true;\n right_audio.play();\n updateIndicator( key );\n flashGood('You Were Correct');\n }else{\n //letter was incorrect update numGuesses and alert user\n wrong_audio.play();\n numGuesses--;\n updateIndicator( key );\n flashWarn('Sorry That Letter Is Not Correct');\n }\n }\n //output new board state\n outputToBoard();\n //check if the user has won\n if(checkWin()){\n winScreen.classList.add('frame-down');\n winScreen.innerHTML = '<span class=\"win-msg restart-game\">Great Job!</br>Click or Hit Enter to Restart Game</br>The Word Was: ' + randomWord + '</span><iframe class=\"youtube\" width=\"420\" height=\"315\" src=\"https://www.youtube.com/embed/NubH5BDOaD8?start=115&controls=0&amp;showinfo=0&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>';\n gamesWon += 1;\n updateGames();\n }\n //check if the user has lost\n if(checkLose()){\n loseScreen.classList.add('frame-down');\n loseScreen.innerHTML = '<span class=\"lose-msg restart-game\">Sorry You Didn\\'t Win</br>Please Try Again!</br>Click or Hit Enter to Restart Game</br>The Word Was: ' + randomWord + '</span><iframe class=\"youtube\" width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/TnOdAT6H94s?start=128&controls=0&amp;showinfo=0&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>';\n gamesLost += 1;\n updateGames();\n }\n }else if(event.code == 'Enter'){\n //if the user hits enter, reset to a new game\n getRandomWord();\n }else{\n //flash indicator with warning, user entered a non-letter key\n wrong_audio.play();\n flashWarn('Not A Letter');\n }\n}", "title": "" }, { "docid": "c6de0e6dc59288a47ad7f50098dfdc20", "score": "0.67988986", "text": "function beginGame() {\n console.log(\"Game started\")\n document.querySelector(\"#game-prompts\").innerHTML = \"NEW GAME STARTED\";\n turnCount = 0;\n remainingGuesses = 12;\n userGuesses = [];\n incorrectGuesses = [];\n document.querySelector(\"#wrong-guesses\").innerHTML = incorrectGuesses;\n document.querySelector(\"#guesses-left\").innerHTML = remainingGuesses;\n splitCharWord = [];\n randomWord();\n splitString();\n emptyBlanks();\n guessRepeat();\n\n}", "title": "" }, { "docid": "8f5d97b3a57ef41358b7597c3fbcb28d", "score": "0.6791399", "text": "function startGame() {\n userGuesses = [];\n inquirer.prompt({\n name: 'play',\n type: \"list\",\n message: 'Would you like to play Hangman?',\n choices: ['YES', \"NO\"]\n }).then(res => {\n if (res.play === 'YES') {\n console.clear();\n getWord();\n } else {\n console.log('Okay, perhaps next time!');\n };\n })\n}", "title": "" }, { "docid": "d482e4fd537418840a5be814b0265d9a", "score": "0.6791368", "text": "function gameInit() {\n show('game');\n show('stats');\n hide('start');\n hide('update');\n computerGuessDOM.textContent = '';\n computerGuess = keys[Math.floor(Math.random() * keys.length)];\n round++;\n remaining = 9;\n userGuessArr = [];\n remainingDOM.textContent = remaining;\n userGuessDOM.textContent = '';\n console.log('shhh... the computer guessed ' + computerGuess);\n}", "title": "" }, { "docid": "7d5929bf5582e4c271cf0b9701174b5d", "score": "0.6787753", "text": "submitGuess(player, guess){\n if(!this.round){\n this.broadcast(ADD_MESSAGE,{name: player.user.name, text: guess}, player)\n return;\n }\n var pointsAwarded = this.round.submitGuess(player, guess, this.broadcast);\n if(pointsAwarded > 0){\n player.score += pointsAwarded;\n this.broadcast(UPDATE_SCORES, {guesser: {...player.user, points: pointsAwarded}, drawer: this.round.drawer.user.id});\n } else if(pointsAwarded == 0){\n this.broadcast(ADD_MESSAGE,{name: player.user.name, text: guess}, player)\n }\n }", "title": "" }, { "docid": "6769cb0dc655f351574dad6a1770e6f3", "score": "0.6781492", "text": "function correct() {\n wins++;\n restartGame();\n }", "title": "" }, { "docid": "e6afe6a675e8297d2ca5faa20eb3d23d", "score": "0.6777844", "text": "function checkCompletion() {\n // if they have guessed every letter, the game is over\n if (word.isSolved()) {\n console.log('You win! \\n')\n playAgain()\n } else if (guessesRemaining === 0) {\n // the user runs out of guesses\n console.log('You lose :( \\n\\nThe word was ' + currentWord + '\\n')\n playAgain()\n } else {\n // if the game isn't over, they guess again\n getUserGuess()\n }\n}", "title": "" }, { "docid": "50532d8a8e10faf4692c7a5c38529e07", "score": "0.67770326", "text": "function displayBadGuess(){\n\t\tvar guess = $(\"#guess-input\").val();\n\t\t$(\".bad-guesses\").append(guess, \", \");\n\t\t$(\".guess-count-number\").html(badGuesses -=1);\n\t\t$(\".bad-guesses, .guess-count\").show();\n\t\t$(\".modal-trump\").show();\n\t\t setTimeout(function(){\n\t\t $(\".modal-trump\").hide();\n\t\t }, 1500);\n\t\tif(badGuesses ==0){\n\t\t\t$(\".gameover, .play-again\").show();\n\t\t\t$(\".play-again\").on(\"click\", (startGame));\n\t\t}\n\t}", "title": "" }, { "docid": "fe133fd7f1bbdcce8486dd89d1f2f7e1", "score": "0.67741764", "text": "startGame () {\n this.currentWord.solved = false\n this.progress = []\n this.letters = []\n this.numberOfGuesses = 0\n console.log('\\n')\n\n console.log('Welcome to the game of Hangman! Start by guessing a letter')\n this.setWord()\n this.guess()\n }", "title": "" }, { "docid": "b0744d57afcc60912db61d2c0fff2546", "score": "0.6764051", "text": "function checkGuess(guess) {\n\n // Make guess Uppercase.\n guess = guess.toUpperCase();\n\n var isGuessFound = false;\n // No more guesses remain.\n // console.log(COUNTER.guessesLeft);\n if (COUNTER.guessesLeft === 0) {\n triggerLoss();\n return;// exit function\n }\n COUNTER.guesses.push(guess);\n WORD.forEach(function(char, idx){\n if (char === guess) {\n WORD_PLACEHOLDER[idx] = guess;\n isGuessFound = true;\n }\n });\n\n // Update placeholder html:\n triggerPlaceholder();\n\n // Make placeholder and word strings and see if they're equal:\n if (WORD_PLACEHOLDER.join('') === WORD.join('')) {\n triggerWin();\n }\n\n // If guess found.\n if (isGuessFound) {\n\n } else {\n // Decremint remaining guesses by 1.\n COUNTER.guessesLeft--;\n COUNTER.guessesWrong.push(guess);\n\n }\n // Update guess html.\n triggerGuess();\n\n}", "title": "" }, { "docid": "268dd1aef04d0d3d29dc9af8892dcde0", "score": "0.67526954", "text": "function playGame() {\n\n // Initial game status\n console.log(ChalkPipe('cyan.bold')(`\\nYour word:\\n${guessMe.printWord()}`));\n console.log(ChalkPipe('yellow')(`\\nGuesses Remaining: ${guessesRemaining}`));\n\n console.log(ChalkPipe('yellow.bold')('Guessed Letters:\\n') + ChalkPipe('bgBlackBright.green.bold')(\" \" + guessedLetters.reduce((output, letter) => (output + letter + ' '), \"\")));\n\n // Check for end of game conditions (word guessed or out of guesses)\n if (!guessMe.wordGuessed() && (guessesRemaining > 0)) { // End of game not reached\n // Get user guess\n Inquire\n .prompt([\n {\n type: \"input\",\n name: \"guess\",\n message: \"Please guess a letter or number: \"\n }\n \n // Do something with the guess\n ]).then(function (answer) {\n console.clear();\n\n // Ensure only one character is passed\n if (answer.guess.length > 1) {\n console.log(ChalkPipe('red.bold')(\"Please enter a single character.\".toUpperCase()));\n }\n // Check for repeated letters against \n else if (guessedLetters.some(letter => letter === answer.guess.toUpperCase())) {\n console.log(ChalkPipe('red.bold')(`${answer.guess} has been guessed already, please select a new character.`));\n }\n // Valid guess\n else {\n // function checks each letter object in the Word.letters array, and return Boolean informing success\n let letterInWord = guessMe.guessLetter(answer.guess.toUpperCase());\n\n // Letter was in word\n if (letterInWord) { \n console.log(ChalkPipe(\"green.bold\")(\"Correct!\"))\n }\n // Letter was not in word\n else {\n console.log(ChalkPipe(\"red.bold\")(\"Incorrect!\"))\n // Reduce the guesses remaining (exit condition)\n guessesRemaining--;\n }\n\n // Update the guessed letter array. Force input to upper case to ease input validation\n guessedLetters.push(answer.guess.toUpperCase());\n }\n\n // Recursive call to playGame() function to continue game loop\n playGame();\n\n }); // End valid guess logic\n }\n // End conditions reached\n else {\n if (guessMe.wordGuessed()) { // Word was guessed\n console.log(ChalkPipe('green.bold.bgBlackBright')(\"\\n---GAME OVER---\\n You won! \"))\n }\n else { // Uers ran out of guesses\n console.log(ChalkPipe('red.bold.bgBlackBright')(\"\\n---GAME OVER---\\n You lost... \"))\n }\n \n // Get user input to play again\n Inquire\n .prompt([\n {\n type: \"confirm\", // Yes / no, returns boolean\n name: \"newGame\",\n message: \"Would you like to play again?\\n\"\n }\n\n // Do something with user input\n ]).then(function (response) {\n\n if (response.newGame) { // play again\n // Resset the game state\n index = Math.floor(Math.random() * list.movies.length);\n guessMe.reset();\n guessMe.addWord(list.movies[index].toUpperCase());\n guessedLetters = [];\n guessesRemaining = 10;\n\n console.clear();\n // Recursive call to playGame() to restart game loop \n playGame();\n }\n else { // end the game\n console.log(ChalkPipe('orange.bold')(\"Thanks for playing, see ya!\"));\n }\n });\n } // End of end condition check logic\n}", "title": "" }, { "docid": "d9959ce604a2726041c0f446bea66c53", "score": "0.6751191", "text": "function newGame() {\n\n $guessRemain = 10;\n usedLetters = [];\n correctGuess = [];\n placeholders = [];\n\n document.getElementById(\"gameAlerts\").innerHTML = (\"Let's get mixing! Add a letter to get started.\");\n document.getElementById(\"guessRemain\").innerHTML = (\"Ingredients left: \" + $guessRemain); document.getElementById(\"userGuesses\").innerHTML = (\"Wrong Ingredients:\" + usedLetters);\n\n console.log('newGame start')\n}", "title": "" }, { "docid": "291f7de2984a06faee33461a39d666a9", "score": "0.6745427", "text": "function newgame() {\n wordSelect = 0;\n wordArray = [];\n wordHidden = [];\n wrongGuessedLetters = [];\n NumberOfGuesses = 10;\n selectword();\n writeToScreen();\n}", "title": "" }, { "docid": "42911ba7bfe35b5255ed6eb95151335f", "score": "0.6737052", "text": "function matchLogic() {\n var inArray = letters.includes(userGuess);\n if (inArray === false) {\n notVowel();\n } else if (guessesLeft > 0 && userGuess === computerPick) {\n win();\n } else if (guessesLeft > 1 && userGuess !== computerPick) {\n pickedEffect();\n wrongGuess();\n } else if (guessesLeft === 1 && userGuess !== computerPick) {\n loss();\n }\n}", "title": "" }, { "docid": "c542a786e6b40402db2e6065fe58cfd4", "score": "0.673659", "text": "checkNextGame (){\n\n }", "title": "" }, { "docid": "b60e9544c8ab25d54097b30e91b18a8a", "score": "0.67281616", "text": "function roundComplete() {\n\tconsole.log(\n\t\t\"Win Count: \" + winCount + \n\t\t\" | Loss Count: \" + lossCount + \n\t\t\" | Guesses Left: \" + guessesLeft);\n\n\t// Update HTML each round:\n\tdocument.getElementById(\"guessesLeft\").innerHTML = guessesLeft;\n\tdocument.getElementById(\"wordToGuess\").innerHTML = blanksAndSuccesses.join(\" \");\n\tdocument.getElementById(\"wrongGuesses\").innerHTML = wrongLetters.join(\" \");\n\n\t// Check if user won:\n\tif (lettersInWord.toString() == blanksAndSuccesses.toString()) {\n\t\t// Update win counter:\n\t\twinCount++;\n\t\t// Push win counter to HTML:\n\t\tdocument.getElementById(\"winCounter\").innerHTML = winCount;\n\t\t// Congratulate player and offer new game:\n\t\tconfirm(\"You Won! Would you like to play again?\");\n\n\t\t// FIX THIS TO start new game ONLY if they click OK. \n\t\t// Not if they click Cancel.\n\t\tstartGame();\n\t}\n\t// Check if user lost:\n\telse if (guessesLeft == 0) {\n\t\t// Update loss counter:\n\t\tlossCount++;\n\t\t// Push loss counter to HTML:\n\t\tdocument.getElementById(\"lossCounter\").innerHTML = lossCount;\n\t\t// Offer player a new game:\n\t\tconfirm(\"Sorry, you've used up all your guesses. Would you like to start a new game?\");\n\t\t// FIX THIS TO start new game ONLY if they click OK. Not if they click Cancel.\n\t\tstartGame();\n\t}\n}", "title": "" }, { "docid": "c32d4bb9af9ec8ed827f577aef8ad572", "score": "0.672605", "text": "function updatePage(){\n //update clue straing such as \"h _ l l _\"\n var clueString = \"\";\n for(var i = 0; i < word.length; i++){\n var letter = word.charAt(i);\n if(guress.indexOf(letter) >= 0){\n clueString += letter + \"\";\n }else{\n clueString += \"_\";\n }\n }\n var clue = document.getElementById(\"clue\");\n clue.innerHTML = clueString;\n\n //show the guesses the plays has made\nvar guessArea = document.getElementById(\"gresses\");\nif(guessCount == 0){\n guessArea.innerHTML = \"You lost.\";\n}else if(clueString.indexOf(\"_\") < 0){\n guessArea.innerHTML = \"You win!!!\";\n}else{\n guessArea.innerHTML = \"Guesses\" + guesses;\n}\n\n//update hangman image\nvar image = document.getElementById(\"hangmanpic\");\nimage.src = \"img/hangman\" + guessCount + \".gif\";\n}", "title": "" }, { "docid": "d40a1aa8c66906737a43d4f5a87f4e4e", "score": "0.67223173", "text": "function newGame(){\n var randomIndex = parseInt(Math.random()*POSSIBLE_WORDS.length);\n word = POSSIBLE_WORDS[randomIndex];\n guessesCount = MAX_GUESSES;\n guesses = \"\";\n updatePage();\n}", "title": "" }, { "docid": "d0109dcd8ed50f4e3fd552049b0c1142", "score": "0.6720158", "text": "function gamePlaying(){\n //displayReset();\n textSize(35);\n text(\"SCORE = \" + score, 100, 60);\n time();\n displayBow();\n flyingBalloon();\n fireArrow();\n arrowTouchesballoon();\n dead();\n }", "title": "" }, { "docid": "d273d4c4a71647a7443376bd91f5f242", "score": "0.6714465", "text": "function play() {\n drawFrame();\n updateLives();\n createSpaces();\n\n $(\"#submit\").click(function() {\n guess = document.getElementById(\"userInput\").value;\n if (guess === \"\") {\n alert(\"Please enter a value!\");\n }\n else if (history.includes(guess)) {\n alert(\"You've already guessed that!\");\n document.getElementById(\"userInput\").value = \"\";\n }\n else {\n document.getElementById(\"userInput\").value = \"\";\n updateHistory(guess);\n checkGuess(guess);\n }\n });\n }", "title": "" }, { "docid": "bb08937b3d1ac71d85677ed06e289d42", "score": "0.6709896", "text": "function playAgain(){\n\t$('html').removeClass();\n\t$('h1').text('Guess a Number').removeClass().animate({'font-size': '5rem'});\n\t$('input, p, #makeGuess, #hint').fadeIn();\n\t$('#guessMessage').addClass('hidden');\n\t$('#alert').addClass('hidden');\n\tgameData.gameOver = false;\n\tgameData.guesses = [];\n\tgameData.winningNumber = generateWinningNumber();\n\tupdateGuessNum();\n}", "title": "" }, { "docid": "adbe2036c720934ffbf727e2c6425a3a", "score": "0.67069185", "text": "function handleGameStart() {}", "title": "" }, { "docid": "1505bdd12069fec70433acec5b000e05", "score": "0.67021793", "text": "function playGame(){\r\n //getting number from textFiels\r\n let numberGuess = document.getElementById('number-guess').value;\r\n\r\n //To display our result....\r\n displayResult(numberGuess);\r\n\r\n saveGuessHistory(numberGuess);\r\n displayHistory();\r\n }", "title": "" }, { "docid": "ea8912ab2a8e75cba55f74bb097a6d25", "score": "0.6700902", "text": "function gameStart() {\n\tguessed = [];\n\twordGuessed = \"\";\n\tcurrentWord = randomWord(dictionary);\n\tfillWordWithDashes(currentWord.length);\n\t$(\"#currentWord\").html(\"Word: \" + wordGuessed);\n\tguessesLeft = 6;\n\t$(\"#guessesLeft\").html(\"Guesses Left: \" + guessesLeft);\n}", "title": "" }, { "docid": "15288d4a1518aafe13c56f637a3d2813", "score": "0.6698849", "text": "function initVariables () {\n round++;\n guessesCount = 0;\n guessesSoFar = \"\"; \n gameOver = false;\n}", "title": "" }, { "docid": "5485b4915ff1b7ac427a412d1b1cf182", "score": "0.6698395", "text": "startGame() {\n $('#overlay').hide();\n this.getRandomPhrase();\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "4ee7d4ff7004c38c3c9bea22328266eb", "score": "0.6698351", "text": "function startGuessing() {\n wordToGuess = new Word(randomWords());\n remainingGuesses = 10;\n //calls the function to start the game\n playGame();\n}", "title": "" }, { "docid": "bdb17bb697f669cb9e993a2c0042ead7", "score": "0.6697076", "text": "function newGame() {\n // reset all game info\n gameRunning = true; // don't want game logic to run if game is not running; don't want it to run against user; only true when we hit New Game\n guessesLeft = 7;\n guessedLetterBank = [];\n incorrectLetterBank = [];\n pickedWordPlaceholderArr = [];\n\n // pick a new word\n pickedWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n\n // create placeholders out of new pickedWord\n for (var i = 0; i < pickedWord.length; i++) {\n // check to see what it is\n if (pickedWord[i] === ' ') {\n pickedWordPlaceholderArr.push(' ');\n } else {\n pickedWordPlaceholderArr.push('_');\n }\n }\n // write all new game info to DOM... resetting guesses left, new place holders show to diff words; so that person knows that's what the word they're trying to get; clearing our the bank with incorrect guesses\n $guessesLeft.textContent = guessesLeft; // reset my guesses left; want to show 7 at the new game; not what previous game had\n $placeholders.textContent = pickedWordPlaceholderArr.join(''); // turn it back into a string, that way it doesn't print out with all of the comas; new place holder with NEW word\n $guessedLetters.textContent = incorrectLetterBank; // more just if i'm playing multiple games in a row, to clear that bank\n}", "title": "" }, { "docid": "fc4136ea7143ac0e1674110ef48caf64", "score": "0.6695756", "text": "function guess(btn){\n console.log(\"user guessed: \" + btn);\n if(!gamePlaying){\n return;\n }\n\n // is guess correct? \n // check if the button number corresponds to the correct\n // elelement in the pattern set\n if (pattern[guessCounter] == btn) {\n \n // if yes, is turn over?\n // check if buttons in the given sequence (e.g., length 5) \n // were pressed correctly\n \n if (guessCounter == progress) {\n \n // if yes, is this the last turn? \n // check if the sequence has reached length = 8\n if (progress == pattern.length - 1) {\n winGame();\n }\n \n // increment progress (expand the sequence to guess by 1) \n // play next clue sequence\n else {\n progress += 1;\n playClueSequence();\n }\n }\n \n // increment guessCounter, continue playing clues\n else {guessCounter += 1;}\n \n }\n \n // if a mistake is made\n else{\n \n // decrease the number of mistakes left\n strikes -= 1;\n showAttempts();\n console.log(\"Available strikes: \" + strikes)\n \n // check if there are any strikes left\n // if none, end the game\n if(strikes == 0){loseGame();}\n \n }\n \n}", "title": "" }, { "docid": "79572dc40659a6ecf84336de43224fda", "score": "0.6695617", "text": "function startGame() {\n const guessInputSet = parseInt(guessInput.value);\n if (isNaN(guessInputSet) || guessInputSet < min || guessInputSet > max) {\n gameMessage(`Please enter a number between ${min} and ${max}`);\n } else {\n if (guessInputSet === winningNumber) {\n //game over - win\n gameOver(`Yes you Guess it ${winningNumber} is the correct Number`, 'green' );\n } else {\n numberOfGuesses -= 1;\n if (numberOfGuesses === 0) {\n //game over - loss\n gameOver(`You loss the correct number was ${winningNumber}`, 'red');\n } else {\n //game continue\n gameContinue(`No... that was not the correct number, you have ${numberOfGuesses} more guesses Try Again!`, 'orange');\n };\n };\n };\n}", "title": "" }, { "docid": "c1a47f8e510257fdb46a6b43f5ab5966", "score": "0.66879326", "text": "function hangmanRound() {\n\t\t// Load Random Poster from Poster Array and load into posterArea\n\t\tvar randomPoster = posterArray[Math.floor(Math.random() * posterArray.length)];\n\t\t$('#displayPoster').attr(\"src\", randomPoster);\n\t\t// resets value of guesses allowed\n\t\tguessesRemaining = 6;\n\t\t$('#guessLeft').text(guessesRemaining);\n\t\t// Select random Movie from Movie array, create new array with each individual character as own var, set as solution, create underscores equal to number of letters in solutionArea\n\t\trandomMovie = movieArray[Math.floor(Math.random() * movieArray.length)];\n\t\tgetSolutionArray();\n\t\tplaySpace();\n\t\tgetUniqueSolutionArray();\n\t\tconsole.log(randomMovie);\n\t\tconsole.log(solutionArray);\n\t\tconsole.log(solutionAreaCurrent);\n\t}", "title": "" }, { "docid": "157a4bc995fe01758984c9b5f25fd7db", "score": "0.6680883", "text": "function makeGuess() {\r\n let checker = [];\r\n inquirer.prompt([\r\n {\r\n name: \"guessedLetter\",\r\n message: word.update() +\r\n \"\\n====================================\" +\r\n \"\\nGuess a letter!\" +\r\n \"\\nGuesses Left: \" + guessLeft +\r\n \"\\n====================================\"\r\n }\r\n ])\r\n //We need to check all the letters in the word\r\n //and determing if the letter guesses matches\r\n .then(data => {\r\n word.letters.forEach(letter => {\r\n letter.checkLetter(data.guessedLetter);\r\n checker.push(letter.getCharacter());\r\n });\r\n \r\n if(guessLeft > 0 && checker.indexOf(\"_\") !== -1) {\r\n guessLeft--;\r\n //If user has no more guesses left prompt gameover\r\n if(guessLeft === 0) {\r\n console.log(\"GAME OVER\");\r\n continuePrompt();\r\n } else {\r\n makeGuess();\r\n }\r\n //If user guesses the word correctly prompt \"guessed the word\"\r\n } else {\r\n console.log(\"YOU GUESSED THE WORD!\");\r\n console.log(word.update());\r\n //Call start game function again\r\n playGame();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "683b8a41b3363f60b7f0d070806046aa", "score": "0.6678721", "text": "function makeGuess() {\n ch_push_guess(guess);\n setGuess(\"\");\n }", "title": "" }, { "docid": "0110ad859bc3c3b1d59c2650dfe1573e", "score": "0.66785294", "text": "function setUpGame(){\n\n\tanswer = getRandomWord().split('');\t\t//Choose a new word.\n\tnWrong = 0;\t\t\t\t\t\t\t\t//Reset the total of wrong guesses.\n\tpastGuesses = []; \t\t\t\t\t\t//Empty our array of previously guessed letters.\n\tguessesRemaining = 6;\t\t\t\t\t//Reset number of guesses remaining.\n\trightGuesses = 0;\t\t\t\t\t\t//Right guesses.\n\ttotalHealth1 = 100;\t\t\t\t\t\t//Reset health bar 1.\n\ttotalHealth2 = 100;\t\t\t\t\t\t//Reset health bar 2.\n\n\t//Make startGame fields appear\n\t$('#continueprompts').css('display','none');\n\t$('#prompts').css('display','block')\n\t\n\t\n\t$('#continuebutton').css('display','none');\n\t$('#guess').css('display','block');\n\t\n\t$('#userinput').css('display','block');\n\t$('#continueinput').css('display','none');\n\n\t//Reset images\n\t$('.kenIdle').attr('src','./Images/Ken-idle.webp');\n\t$('.ryuIdle').attr('src','./Images/Ryu-idle.gif');\n\t$('#health1').attr('value',totalHealth1);\n\t$('#health2').attr('value',totalHealth2);\n\n\t//This line stops the click event handler from creating\n\t//a new one and returning empty guesses from the \n\t//stack (from what I can tell).\n\t$('#guess').off('click');\n\n} //setupGame", "title": "" }, { "docid": "8fd1c0d3e1e75a25190deb215eefee87", "score": "0.66758895", "text": "function start() {\n wins = 0;\n losses = 0;\n guessesLeft = 6;\n updateData();\n getSecretWord();\n}", "title": "" }, { "docid": "649d9ec51e21bd393e4ced8c22e7cecd", "score": "0.6674175", "text": "function initializeGame(myPic) {\n// number of guesses left\nnumGuessesLeft = 14;\n\n\n// set up current word\n// set up array to hold letters that are guessed and in current word\n\n// randomly choose a word from the guessWords array\n// create a holder with the number of letters for guessing letters in random word\n indexPicWord = Math.floor(Math.random() * guessWords.length);\n currentWord = guessWords[indexPicWord];\n numLetFind = currentWord.length;\n \n// initialize number of underscores in hidden word\n var tempHang = []\n for (var i=0; i<numLetFind; i++) {\n tempHang.push (\"_ \");\n }\n hideHangmanWord = tempHang;\n\n// set array of letters guessed back to empty\n//set up/initialize array with letters that were guessed and counter numLG; maximum number of guesses is 14\n for (i=0; i<14; i++) {\n lettersGuessed.pop ();\n }\n numLG = 0;\n\n for (var i=0; i<14; i++) {\n lettersGuessed.push (\"_ \");\n }\n //put picture on screen\n changePicture(myPic);\n updateScreen(screenHtml);\n }", "title": "" }, { "docid": "1c15e18c667c1d70fc36f497d0d8b1e7", "score": "0.6672894", "text": "function startGame() {\n // Update display elements\n setGameElements();\n hideHangmanParts();\n // Reset after game is won\n if ($(\".keyboard-container\").hasClass(\"hide\")) {\n resetDisplayAfterWin();\n }\n // Reset after game is over\n if ($(\".flex-container\").hasClass(\"hide\")) {\n resetDisplayAfterGameOver();\n }\n // Set timer\n timer = 120;\n setTimer(timer);\n // Update variables\n level = $(\".btn-level.active\").text();\n category = $(\".btn-category.active\").text();\n countCorrect = 0;\n countIncorrect = 0;\n countStreak = 0;\n // Create random word\n generateRandomWord(category, level);\n //Local storage\n setLocalStorage();\n }", "title": "" }, { "docid": "886498c82cc84c735dd65eec01b958b7", "score": "0.66598094", "text": "function keyDown(event){\n // 1) check if it is an active game\n if (!activeGame) return;\n // 2) check if the letter is valid\n if (event.keyCode < 65 || event.keyCode > 90) return;\n // console.log(event.keyCode); // the number!\n // console.log(event.key); // the lower case letter\n // 3) Get the user's guess\n var userGuess = event.key.toUpperCase();\n // console.log(userGuess);\n // 4) check if letter is in the Country\n if (answerCountryArray.indexOf(userGuess) != -1){\n // 4a) if letter is in country -- > Right Guess\n //i) update view\n console.log('Found!');\n updateUserWord(userGuess);\n displayWord(); // updates the view\n //ii) check if the user has won\n if (hasWon()){\n countdown.clear(); // turns off the timer\n activeGame = false; // turns off the keydown event listeners\n alert(\"You've won!\");\n // CALL THE NEXT THING!\n }\n\n } else {\n // 3b) if letter is not in country --> wrong Guess\n console.log(\"Sorry, no \" + userGuess);\n return;\n }\n\n\n} // closes keyDown function", "title": "" }, { "docid": "6b807f2e16c3ea6be729742e9ac0ab6a", "score": "0.66582805", "text": "function newGame() {\n $(\"#guessed\").text(\"\");\n placeholder = [];\n index = Math.round(Math.random() * wordList.length);\n guesses = 12;\n $(\"#gusses\").html('<h2>Gusses left: 12</h2>'); \n randomWord(placeholder);\n }", "title": "" }, { "docid": "d32cd3b0372a9a1fd7ad17bb935ead07", "score": "0.6649013", "text": "function startGame() {\n playcount = 0;\n wronganswers = 0;\n userguesses = [];\n\n inquirer\n .prompt([{\n type: \"confirm\",\n name: \"start\",\n message: \"Ready to play hangman with dog breeds?\",\n\n }]).then(function(data) {\n if (data.start === true) {\n wordInPlay();\n guessALetter(0);\n\n\n } else {\n console.log(\"K, Bye!\");\n }\n\n });\n}", "title": "" }, { "docid": "80e7df00a6e7c1851903d3b1ba249af6", "score": "0.66471493", "text": "function CheckGameOver(guessedLetter) {\n if (displayWord.indexOf(\"_\") === -1) {\n gamesWon += 1;\n document.getElementById(\"games-won\").innerHTML = gamesWon;\n alert(\"Congrats!!! Now for a new challenge\");\n pageLoad();\n return;\n }\n\n /* If user guesses wrong display error alert - This will be replaced later on by applying a section of the hanged man via css. \n in the meantime - simply track if the game is over according to the maxFailedGuesses variable created. 5 chances = head, arm, arm, leg, leg = death. \n Clear guess field after the guess. If too many wrong guesses move to Game Over screen. */\n if (secretWord.indexOf(guessedLetter) === -1) { //in other words if the user's guess does not line up - remove 1 from max guesses.\n maxFailedGuesses -= 1; //remove 1 from max guesses until it hits 0\n if (maxFailedGuesses < 1) { // in here is where a portion of the hanged man will appear. <<=====\n alert(\"You have run out of guesses, a good man has been hung.\");\n gamesLost += 1;\n pageLoad();\n //not sure why but the new word being loaded is seen at first.\n return;\n }\n }\n}", "title": "" }, { "docid": "9b68ded956865ff73bea0a129ce8ff7e", "score": "0.6636379", "text": "function runGame() {\ndocument.onkeyup = function (event){\n\tuserGuess=event.key;\n\tuserGuessCaps=userGuess.toUpperCase();\n\tusedLetters.push(userGuessCaps);\n\tdocument.getElementById(\"dislayUsedLetters\").innerHTML=usedLetters;\n\tdocument.getElementById(\"guessesNumber\").innerHTML=guessesRemaining;\n\tvar wordConstruction;\n\tguessCounter=0;\n\t\t\n\t\tfor (j=0; j<randomWord.length; j++){\n\t\t\t\n\t\t\tif (userGuessCaps===randomWord[j]){\n\t\t\t\tblankWord[j]=randomWord[j]\n\t\t\t\tdocument.getElementById(\"currentWord\").innerHTML=blankWord;\n\t\t\t\twordConstruction = blankWord.join(\"\");\n\t\t\t\tpreviousIterationOfWord=blankWord.join(\"\");\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\n\t\t// On wrong guess remove one remaining\n\t\tfor (k=0; k<randomWord.length; k++){\n\t\t\tif (userGuessCaps==blankWord[k]){\n\t\t\t\tguessCounter+=1;\n\t\t\t}\n\t\t}\n\t\tif(guessCounter===0){\n\t\t\t\t\tguessesRemaining-=1;\n\t\t\t\t\tdocument.getElementById(\"guessesNumber\").innerHTML=guessesRemaining;\n\t\t\t\t}\n\n\t\t// determine game over\n\t\tif (guessesRemaining<1){\n\t\t\tdocument.getElementById(\"gameOver\").innerHTML=\"GAME OVER!\";\n\t\t\t alert(\"GAMEOVER!\");\n\t\t\t location.reload();\n\t\t}\n\t\t// win condition\n\t\t if (wordConstruction===randomWord){\n\t\t\tnumberOfWins+=1;\n\t\t\t\n\t\t\t// changes attributes of left content box to match conpleted puzzle\n\t\t\tif (songSelection==0){\n\t\t\t\tdocument.getElementById(\"songTitle\").innerHTML=\"Tom Sawyer\";\n\t\t\t\tdocument.getElementById(\"album\").innerHTML=\"Moving Pictures\";\n\t\t\t\tdocument.getElementById(\"myAudio\"); myAudio.src='assets/music/tomsawyer.mp3'; myAudio.load(); playAudio();\n\t\t\t\tdocument.getElementById(\"albumArt\").src='assets/images/movingpictures.jpg';\n\t\t\t}\n\t\t\telse if (songSelection==1){\n\t\t\t\tdocument.getElementById(\"myAudio\"); myAudio.src='assets/music/redbarchetta.mp3'; myAudio.load(); playAudio();\n\t\t\t\tdocument.getElementById(\"songTitle\").innerHTML=\"Red Barchetta\";\n\t\t\t\tdocument.getElementById(\"album\").innerHTML=\"Moving Pictures\";\n\t\t\t\tdocument.getElementById(\"albumArt\").src='assets/images/movingpictures.jpg';\n\t\t\t}\n\t\t\telse if (songSelection==2){\n\t\t\t\tdocument.getElementById(\"myAudio\"); myAudio.src='assets/music/thetwilighzone.mp3'; myAudio.load(); playAudio();\n\t\t\t\tdocument.getElementById(\"songTitle\").innerHTML=\"The Twilight Zone\";\n\t\t\t\tdocument.getElementById(\"album\").innerHTML=\"2112\";\n\t\t\t\tdocument.getElementById(\"albumArt\").src='assets/images/2112.png';\n\t\t\t}\n\t\t\telse if (songSelection==3){\n\t\t\t\tdocument.getElementById(\"myAudio\"); myAudio.src='assets/music/yyz.mp3'; myAudio.load(); playAudio();\n\t\t\t\tdocument.getElementById(\"songTitle\").innerHTML=\"YYZ\";\n\t\t\t\tdocument.getElementById(\"album\").innerHTML=\"Moving Pictures\";\n\t\t\t\tdocument.getElementById(\"albumArt\").src='assets/images/movingpictures.jpg';\n\t\t\t}\n\t\t\telse if (songSelection==4){\n\t\t\t\tdocument.getElementById(\"myAudio\"); myAudio.src='assets/music/limelight.mp3'; myAudio.load(); playAudio();\n\t\t\t\tdocument.getElementById(\"songTitle\").innerHTML=\"Limelight\";\n\t\t\t\tdocument.getElementById(\"album\").innerHTML=\"Moving Pictures\";\n\t\t\t\tdocument.getElementById(\"albumArt\").src='assets/images/movingpictures.jpg';\n\t\t\t}\n\t\t\telse if (songSelection==5){\n\t\t\t\tdocument.getElementById(\"myAudio\"); myAudio.src='assets/music/makingmemories.mp3'; myAudio.load(); playAudio();\n\t\t\t\tdocument.getElementById(\"songTitle\").innerHTML=\"Making Memories\";\n\t\t\t\tdocument.getElementById(\"album\").innerHTML=\"Fly By Night\";\n\t\t\t\tdocument.getElementById(\"albumArt\").src='assets/images/flybynight.jpg';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdocument.getElementById(\"myAudio\"); myAudio.src='assets/music/crossroads.mp3'; myAudio.load(); playAudio();\n\t\t\t\tdocument.getElementById(\"songTitle\").innerHTML=\"Crossroads\";\n\t\t\t\tdocument.getElementById(\"album\").innerHTML=\"Feedback\";\n\t\t\t\tdocument.getElementById(\"albumArt\").src='assets/images/feedback.jpg';\n\t\t\t}\t\n\n\t\t\t// start next work\n\t\t\tdocument.getElementById(\"winsNumber\").innerHTML=numberOfWins;\n\n\t\t\tclearVar();\n\t\t\tsetUp();\n\t\t\t\n\t\t\trunGame();\n\n\t\t\t\n\n\t\t}\n\n}\n}", "title": "" }, { "docid": "0e3cf3bb32e411f042990c1b2910c7e5", "score": "0.66330683", "text": "function startGame(){\n\tlet openingScreen = document.querySelector('.opening-screen').className = 'opening-screen hidden';\n\tlet gameScreen = document.querySelector('.hider').className = 'hider';\n\tdisplayBoard();\n\tlet takeAGuess = document.querySelector('#take-a-guess');\n\ttakeAGuess.addEventListener('submit', (e) => {\n\t\te.preventDefault();\n\t\tlet value = document.querySelector('#guesser');\n\t\tlet userGuess = value.value.trim().toLowerCase();\n\t\tif(userGuess.split('').length > 1){\n\t\t\tdocument.querySelector('#bad-input').innerText = 'You input too many letters!! please only guess 1 letter'\n \t\tvalue.value = '';\n \t\t}\n \t\telse if(wordsUsed.indexOf(userGuess) !== -1){\n \t\t\tdocument.querySelector('#bad-input').innerText = 'You already used that letter! Pick another one!';\n \t\tvalue.value = '';\n \t\t}\n \t\telse{\n \t\t\twordsUsed.push(userGuess);\n \t\t\tvalue.value = '';\n \t\t\tdocument.querySelector('#bad-input').innerText = '';\n \t\t\tlet inWord = word.indexOf(userGuess);\n \t\t\tlet allOccurrences = [];\n \t\t\tconsole.log(document.querySelector('.game-state').src);\n \t\t\tif(inWord === -1){\n \t\t\t\twrongInput();\n \t\t\t\tswitch(livesLeft){\n \t\t\t\t\tcase 5: document.querySelector('.game-state').src = './hangman2.png';\n \t\t\t\t\tbreak\n \t\t\t\t\tcase 4: document.querySelector('.game-state').src = './hangman3.png';\n \t\t\t\t\tbreak\n \t\t\t\t\tcase 3: document.querySelector('.game-state').src = './hangman4.png';\n \t\t\t\t\tbreak\n \t\t\t\t\tcase 2: document.querySelector('.game-state').src = './hangman5.png';\n \t\t\t\t\tbreak\n \t\t\t\t\tcase 1: document.querySelector('.game-state').src = './hangman6.png';\n \t\t\t\t\tbreak\n \t\t\t\t\tcase 0: document.querySelector('.game-state').src = './hangman7.png';\n \t\t\t\t\tbreak\n \t\t\t\t}\n \t\t\t\tdisplayBoard();\n \t\t\t}\n \t\t\telse{\n \t\t\t\tfor(let i = 0; i < word.length; i++){\n \t\t\t\t\tif(userGuess === word[i]){\n \t\t\t\t\t\tallOccurrences.push(i);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tfor(let i = 0; i < allOccurrences.length; i++){\n \t\t\t\t\tspacesForWord[allOccurrences[i]] = word[allOccurrences[i]];\n \t\t\t\t}\n \t\t\t\tdisplayBoard();\n \t\t\t}\n\n \t\t}\n\n\t})\n}", "title": "" }, { "docid": "fcdd2ca461ae0efbf9db4653cf7403d1", "score": "0.66325927", "text": "function guess(btn){\n console.log(\"user guessed: \" + btn);\n if(!gamePlaying){ // Checks if the user pressed Start\n return;\n }\n if(pattern[guessCounter] == btn){ // If the pattern given is equal to the buttons pressed,\n // then the guess was correct!\n if(guessCounter == progress){\n if(progress == pattern.length - 1){\n // The game over is over. You win!\n winGame();\n }else{\n // The pattern was correct, so add a segment.\n progress++;\n playClueSequence();\n }\n }else{\n // Correct so far. Check the next guess.\n guessCounter++;\n }\n }else{\n // The guess was incorrect. GAME OVER, you LOSE!\n loseGame();\n }\n}", "title": "" }, { "docid": "20f80250ed122d04a4e6bd4228e5dd2d", "score": "0.66319656", "text": "function checkInput() {\n\n \n document.onkeyup = function(event) {\n\n setTimeout(function() {\n if (!userWon && !userLost) {\n document.getElementById('fightImg').setAttribute('src', 'assets/images/static.JPG')\n }\n }, 1000)\n\n // the users guess is converted into uppercase\n guess = event.key.toUpperCase();\n guesskey = event.keyCode\n missedArr = [];\n\n // the users guess is added on to the board if correct\n for (i = 0; i < currentWord.length; i++) {\n\n if (guess === currentWord[i]) {\n \n \n if (guess != found[i]) {\n found.push(guess);\n punchSound.play();\n document.getElementById('fightImg').setAttribute('src', 'assets/images/win1.JPG')\n }\n \n board[i] = guess;\n document.getElementById(\"currentWord\").innerHTML = board.join(\" \");\n\n\n } else if (guesskey < 65 || guesskey > 90 || guess === wrongLetters[i]) {\n return null;\n \n } else {\n\n // every guess will return \"missed\" for the other letters.\n missedArr.push(guess);\n\n }\n\n\n // each guess is checked and inc letters are always added to the missedArr\n // if the missedArr returns the same number as the currentWord then that's a TRUE miss\n if (missedArr.length >= currentWord.length) {\n \n wrongLetters.push(guess);\n document.getElementById(\"wrongLetters\").innerHTML = wrongLetters.join(\" \");\n lives--;\n document.getElementById(\"lives\").innerHTML = lives;\n document.getElementById('fightImg').setAttribute('src', 'assets/images/lose1.JPG')\n loseSound.play();\n missedArr = [];\n \n }\n\n }\n \n \n // if the points variable = however long the word is. User gets 1 SCORE point and goes to next round.\n if (board.join(\"\") === currentWord) {\n\n userWon = true\n score++;\n oneUpSound.play();\n document.getElementById(\"score\").innerHTML = score;\n document.getElementById('fightImg').setAttribute('src', 'assets/images/win2.JPG')\n document.getElementById('nextRoundBanner').style.display = 'block';\n document.getElementById('score').style.animation = 'blink 0.5s linear';\n document.getElementById('score').style.animationIterationCount = '3';\n\n setTimeout( function() {\n document.getElementById('lives').style.animation = 'none';\n document.getElementById('nextRoundBanner').style.display = 'none';\n document.getElementById('fightImg').setAttribute('src', 'assets/images/static.JPG')\n board = [];\n found = [];\n let blanks = \"\"\n lives = lives + 2;\n points = 0;\n document.getElementById(\"lives\").innerHTML = lives;\n currentWord = gameWords[Math.floor(Math.random() * gameWords.length)].toUpperCase();\n for (let i = 0; i < currentWord.length; i++) {\n console.log(currentWord)\n board[i] = \" _ \";\n }\n blanks = board.join(\" \");\n document.getElementById(\"currentWord\").innerHTML = blanks\n wrongLetters = []\n document.getElementById(\"wrongLetters\").innerHTML = wrongLetters\n userWon = false\n }, 2500)\n }\n\n\n\n // gameover - resets page\n if (lives == 0) {\n userLost = true;\n mainTheme.pause()\n gameOverSound.play()\n document.getElementById('gameOverBanner').style.display = \"block\";\n document.getElementById('fightImg').setAttribute('src', 'assets/images/lose2.JPG')\n console.log(currentWord)\n document.getElementById('currentWord').innerHTML = currentWord.split('').join(\" \");\n\n setTimeout( function() {\n document.getElementById('gameOverBanner').style.display = \"none\";\n resetGame()\n\n }, 4000)\n }\n\n\n }\n}", "title": "" }, { "docid": "7c3a6849f71c52f86e4393ba921333b7", "score": "0.6626521", "text": "async gameLoop(){\n \n \n document.getElementById(\"playerGuess\").innerText=\"\"\n for (let index = 0; index < this.players.length; index++) {\n console.log(this.numberOfGuesse)\n this.currentPlayer=this.players[index]\n this.test()\n this.timer()\n await this.pause()\n\n if (this.playerName!==this.players[index])\n\n {\n\n if (this.players[index]==\"Smart\") {\n\n \n let playerGuess=this.smartBot.guess(this.highestLowNumber, this.lowestHighNumber)\n document.getElementById(\"smartBotOutput\").innerHTML=playerGuess\n\n this.playerGuess=playerGuess\n console.log(this.currentPlayer)\n\n\n\n\n\n }else{\n\n \n let playerGuess = this.dumbBot.guess()\n document.getElementById(\"dumbBotOutput\").innerText=playerGuess\n this.playerGuess=playerGuess\n console.log(this.currentPlayer)\n document.getElementById(\"player1\").style.border=\"none\"\n\n }\n\n }else{\n\n \n let playerGuess=this.getGuess(\"input-number\")\n document.getElementById(\"player-bubble\").innerText=playerGuess\n this.playerGuess=playerGuess\n this.numberOfGuesse++\n console.log(this.currentPlayer)\n\n\n }\n\n\n let win = this.guessCheck(this.playerGuess, this.correctNumb)\n if (win==1) {\n this.stats()\n localStorage.setItem(\"test\", JSON.stringify( {\n name:this.currentPlayer,\n guesses:this.numberOfGuesse,\n number:this.correctNumb,\n wins: this.currentWins\n }))\n \n window.location.href=\"/win.html\"\n \n \n this.winner=this.players[index]\n let winner = this.winner\n console.log(this.winner)\n console.log(this.players[index]+\" Have guessed \" + this.numberOfGuesse + \" times to win!\")\n return\n }\n await sleep(2000)\n\n console.log(this.playerGuess)\n if (this.playerGuess>this.correctNumb && this.playerGuess<this.lowestHighNumber)\n {\n this.lowestHighNumber=Number(this.playerGuess)\n }if (this.playerGuess<this.correctNumb && this.playerGuess>this.highestLowNumber) {\n this.highestLowNumber = Number(this.playerGuess)\n }\n console.log(this.highestLowNumber, this.lowestHighNumber)\n\n\n }\n this.gameLoop()\n\n }", "title": "" }, { "docid": "fb2bcd2365f194c11a30482bd5b94773", "score": "0.6624918", "text": "function startGame() {\n picked = 0;\n wrongAnswers = 0;\n zeroArray();\n showTiles();\n setPattern();\n showPattern();\n window.setTimeout(continueGame, 1000);\n}", "title": "" }, { "docid": "a445ba45745b43d4875299b25f574717", "score": "0.6624249", "text": "function endGame() {\n //user reached the last question of the game\n if (questionIndex === worldToGuess.length) {\n //in case the word is complete\n if (hiddenWordMatch.indexOf(\"_\") === -1 && countClicks === 10) {\n buttonRestartFunction(); // adding restart button\n //shownig the right word\n document.getElementById(\"description\").innerHTML =\n \"<h3>That's right! \" + worldToGuess[questionIndex - 1].word_to_guess.toUpperCase() + \"</h3>\";\n //showing image\n document.getElementById(\"image\").src = \"./assets/images/\" + worldToGuess[questionIndex - 1].imgURL;\n waitToStartGame = true; // preventing keys other than enter\n }\n //in case the word is uncomlete\n else if (hiddenWordMatch.indexOf(\"_\") !== -1 && countClicks === 10) {\n\n waitToStartGame = true; // preventing keys other than enter\n buttonRestartFunction(); // adding restart button\n console.log(\"i dont think its ever triggered\")\n }\n }\n\n //user got the word right, continue to the next word\n else if (hiddenWordMatch.indexOf(\"_\") === -1 && questionIndex !== worldToGuess.length) {\n document.getElementById(\"image\").src = \"./assets/images/\" + worldToGuess[questionIndex].imgURL; //showing image\n stopCount = countClicks; //saving used guesses\n countClicks = 10; // setting guesses to 10\n wins++; //increasing score\n document.getElementById(\"wins\").innerHTML = wins; //printing score\n questionIndex += 1; //increasing the word index in order to go to the next word\n playWonSound(); // playing victory sound\n document.getElementById(\"guesses_used\").innerHTML = stopCount; //printing out used guesses\n document.getElementById(\"description\").innerHTML =\n \"<h3>That's right! \" + worldToGuess[questionIndex - 1].word_to_guess.toUpperCase() + \"!</h3>\"; //printing the whole word\n pressEnter()\n waitToStartGame = true; // preventing keys other than enter\n startGame(); //moving to the next question using startGame() function\n return; // just to make sure i am exiting this\n\n }\n //used all of my guesses\n else if (countClicks === 10) {\n if (questionIndex !== worldToGuess.length) {\n //printing out the word\n document.getElementById(\"description\").innerHTML = worldToGuess[questionIndex].didntGuess;\n pressEnter();\n playOverSound(); // sad sound\n //showing image\n document.getElementById(\"image\").src = \"./assets/images/\" + worldToGuess[questionIndex].imgURL;\n questionIndex += 1; // increasing word's index\n waitToStartGame = true; // preventing keys other than enter\n startGame(); //moving to the next question using startGame() function\n }\n }\n}", "title": "" }, { "docid": "9f8cbe4c3615f2bfde7cee8753f6a4e7", "score": "0.6620655", "text": "function playGame () {\n\n\tvar guessedNumber = $(\"#userGuess\").val();\n\n\tvar guessCompare = (Math.abs(guessedNumber - selectedAnswer);\n\n\n\tif (guessCompare === 0) {\n\t\t$(\"#feedback\").text(\"Congrats! You guessed correctly. Click on New Game to start over\");\n\t}\n\n\telse if (guessCompare >= 41) {\n\t\t$(\"#feedback\").text(\"You're ice cold!\");\n\n\t}\n\n\telse if (guessCompare >=25 && <=40) {\n\t\t$(\"#feedback\").text(\"You're cold! Try again\");\n\t}\n\n\telse if (guessCompare >=15 && <=24) {\n\t\t$(\"#feedback\").text(\"You're getting warmer!\");\n\t}\n\n\telse if (guessCompare >=1 && <=14) {\n\t\t$(\"#feedback\").text(\"Burning up!\");\n\t}\n\n\n}", "title": "" }, { "docid": "ef9ee5efab982d1b77d9ac653d9f46cc", "score": "0.66205454", "text": "function startGame() { \n \n gameOver = false;\n\n // clears the hint\n document.getElementById(\"hints\").innerHTML = \"\";\n\n //clears win timeout\n clearTimeout(winTimeout);\n\n // pick a random title \n currentTitle = titles[Math.floor(Math.random()*titles.length)];\n\n //reset answerArray to empty\n answerArray = [];\n \n // fills answer array with underscores \n answerBlank(answerArray);\n\n // print answer array to html\n document.getElementById(\"answerArray\").innerHTML = answerArray.join(\"\");\n\n // reset guesses\n guessCounter = 20;\n\n guessedLetters = [];\n\n // Prints the blanks at the beginning of each round in the HTML.\n document.getElementById(\"guesses\").innerHTML = guessedLetters.join(\" \");\n}", "title": "" }, { "docid": "5471e855fafb888103ee37435f6f4f72", "score": "0.6617334", "text": "function runGame() {\n AUDIO_BACKGROUND_MUSIC.play();\n AUDIO_CHICKEN.play();\n calculateDrawingDetails();\n createGallinitasList();\n createPollintosList();\n if (!gameFinished) {\n listenForKeys();\n checkForCollision();\n checkForGallinitas();\n checkForPollintos();\n }\n}", "title": "" }, { "docid": "55d74b14abfdcf644ee8668587e34430", "score": "0.66165817", "text": "function checkGuess(guess) {\n if (guess === word) {\n didWin = true;\n gameOver();\n }\n else if (word.indexOf(guess) > -1) {\n createSpaces();\n }\n else {\n lives--;\n drawings[lives]();\n updateLives();\n }\n }", "title": "" }, { "docid": "1f334250daa29c3934bc9fb899728ffa", "score": "0.6615036", "text": "function startGame () {\n\t\tremainingGuesses = 15;\n\t\tcurrentWord = gameWords[Math.floor(Math.random() * gameWords.length)];\n\t\tcurrentWordLetters = currentWord.split (\"\");\n\t\tfor (let i = 0; i < currentWordLetters.length; i++) {\n\t\t\tunderscoreArray.push(\"_\");\n\t\t}\n\t\t// html\n\t\tdocument.querySelector(\"#wins\").innerHTML = wins;\n\t\tdocument.querySelector(\"#losses\").innerHTML = losses;\n\t\tdocument.querySelector(\"#current-word\").innerHTML = underscoreArray;\n\t\tdocument.querySelector(\"#remaining-guesses\").innerHTML = remainingGuesses;\n\t\tdocument.querySelector(\"#wrong-letters\").innerHTML = wrongLetters;\n\t}", "title": "" }, { "docid": "6808f628842d7e92d54608d7df16f420", "score": "0.6613866", "text": "async resetGame() {\n this.targetNumber = this.getRandomInteger(this.range.min, this.range.max)\n this.feedback = 'Make a guess...'\n this.guesses = []\n }", "title": "" }, { "docid": "8c1d28687529e6d42d6eeb41b158c594", "score": "0.66103256", "text": "function keyEventAndGameLogic() {\n \n document.onkeyup = function (event) {\n usersKey = event.key;\n userLetterPicks += usersKey + \", \";\n inputText.textContent = userLetterPicks;\n guessLeft = guessLeft - 1;\n\n if (guessLeft <= 0){\n losses = losses + 1;\n userLetterPicks =\"\";\n guessLeft = 9;\n ComputerGuess();\n }\n \n if (usersKey === randomLetter){\n wins = wins + 1;\n userLetterPicks = \"\"; \n guessLeft = 9;\n ComputerGuess();\n }\n updateUI();\n };\n}", "title": "" }, { "docid": "c6d11c99cc69288950f9d96b552f21d9", "score": "0.66097903", "text": "function checkGuess(playersGuess){\n\tvar advice = '';\n\tvar countdown = '';\n\n\t//check for invaid & duplicate guesses\t\n\tvar invalidGuess = checkInvalid(playersGuess);\n\tvar duplicateGuess = checkDuplicate(playersGuess);\n\n\tif(invalidGuess){\n\t\tadvice = 'Please guess a number between 1 and 100!'\n\t\tcountdown = 'You have ' + remainingGuesses + ' guesses remaining.';\n\t}else if(duplicateGuess){\n\t\tadvice = 'You already guessed ' + playersGuess + '! Guess something else!';\n\t\tcountdown = 'You have ' + remainingGuesses + ' guesses remaining.';\n\t\t\t\n\t}else{\n\t\t//get advice message\n\t\tadvice = guessMessage(playersGuess);\n\t\tif(playersGuess===winningNumber){\n\t\t\tgameWon = true;\n\t\t\tcountdown = '';\n\t\t\t$('#hint').text('');\n\t\t\tbeanPile(); //call fun stuff\n\t\t}else{\n\t\t\t//countdown remaining guesses\n\t\t\tremainingGuesses -= 1;\n\t\t\tallPlayersGuesses.push(playersGuess);\n\t\t\tcountdown = 'You have ' + remainingGuesses + ' guesses remaining.';\n\t\t}\n\t}\n\n\t$('#advice').text(advice);\n\t$('#countdown').text(countdown);\n}", "title": "" }, { "docid": "c23a2085e319626b70807c80689c7ab2", "score": "0.66087675", "text": "function roundComplete() {\n /*\n 1. Update the HTML with the letters that are in the word\n 2. Update the HTML with guesses we have left\n 3. Update the HTML to show the wrong guesses\n 4. Determine whether the user has won the game or not\n */\n document.getElementById('word-blank').innerHTML = blanksAndSuccesses.join(\" \");\n document.getElementById('guesses-left').innerHTML = numGuesses;\n document.getElementById('wrong-guesses').innerHTML = wrongGuesses.join(\" \");\n\n\n\n // console.log(lettersInChosenWord);\n // console.log(blanksAndSuccesses);\n if (lettersInChosenWord.join(\" \") === blanksAndSuccesses.join(\" \")) {\n winCounter++;\n alert(\"You win! The answer was \" + chosenWord);\n document.getElementById('win-counter').innerHTML = winCounter;\n document.getElementById('audiotag1').play();\n document.getElementById('audiotag2').pause();\n document.getElementById('audiotag2').load();\n startGame(); // If the letters chosen joined match the underscored random letters joined, increment winCounter, alert the user, play audio, and start a new game\n\n } else if (numGuesses === 0) {\n document.getElementById('loss-counter').innerHTML = lossCounter++;\n document.getElementById('wrong-guesses').innerHTML = \" \";\n alert(\"You lost! The answer was \" + chosenWord);\n document.getElementById('audiotag2').play();\n document.getElementById('audiotag1').pause();\n document.getElementById('audiotag1').load();\n startGame(); // If the letters chosen do not match the underscored random letters, increment lossCounter, alert the user, play audio, and start a new game\n\n }\n\n\n\n\n }", "title": "" }, { "docid": "62254a40f77a733d2791ffbe2bcaf172", "score": "0.6605908", "text": "startGame() {\n $(\"#overlay\").hide();\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "bab8f9fc919142d9971fc2d17e53274b", "score": "0.66026217", "text": "function checkGuess() {\n var userGuess = Number(guessField.value);\n if (guessCount === 1) {\n guesses.textContent = 'Previous guesses: ';\n }\n // Esto va impimiendo las entradas del usuario\n guesses.textContent += userGuess + ' ';\n // Si el usuario la pega se imprime un mensaje,\n if (userGuess === randomNumber) {\n lastResult.textContent = 'Congratulations! You got it right!';\n // Se cambia el color de la barra\n lastResult.style.backgroundColor = 'green';\n lastResult.style.color = 'white';\n lastResult.style.padding = '5px';\n \n lowOrHi.textContent = '';\n // Se termina el juego\n setGameOver();\n //Termina el juego si ya tiene 10 turnos\n } else if (guessCount === 10) {\n lastResult.textContent = '!!!GAME OVER!!!';\n setGameOver();\n // Si no la pega, imprime.\n } else {\n lastResult.textContent = 'Wrong!';\n lastResult.style.backgroundColor = 'red';\n lastResult.style.color = 'white';\n lastResult.style.padding = '5px'; \n // Si la entrada del usuario esta debajo del randomNumber generado le dice:\n if(userGuess < randomNumber) {\n lowOrHi.textContent = 'Last guess was too low!';\n } else if(userGuess > randomNumber) {\n lowOrHi.textContent = 'Last guess was too high!';\n }\n }\n \n guessCount++; // Despues de cada turno se incrementa en 1.\n guessField.value = ''; // Se reinicia el input/\n guessField.focus();\n}", "title": "" }, { "docid": "f2655e051fb1f198ef8f2c51bfbeaad5", "score": "0.6596428", "text": "function newGame() {\n //Your code here\n play = true;\n //Reset randomNumber\n randomNumber = Math.floor(Math.random() * 100 + 1);\n //Reset users input field\n guess = document.querySelector(\".inputs-Values\").value = \" \";\n document.getElementById(\"final-output\").style.visibility = \"visible\";\n document.getElementById(\"final-output\").innerHTML = \"Guess a number between 1 and 100\"\n //Reset tries, and triesTaken by the user\n counter = 6;\n triesTaken = 0;\n document.getElementById(\"Tries-output\").innerHTML = `Number of tries: ${counter}`\n}", "title": "" }, { "docid": "8d466d9912572ffc3064117c0889391c", "score": "0.6596098", "text": "function startGame() {\n\n guessesLeft = 4;\n userGuessed = [];\n\n winScore.textContent = \"Wins: \" + winCount;\n lossScore.textContent = \"Losses: \" + lossCount;\n guessesRemain.textContent = \"Guesses Left: \" + guessesLeft;\n lettersGuessed.textContent = \"Cookies Already Guessed: \" + userGuessed;\n}", "title": "" }, { "docid": "72a31cacd4f38f5b4a73feaf09b39b45", "score": "0.65930325", "text": "function correct_guess(user_guess) {\n let current_score = document.getElementById(\"score\");\n let points = get_points_list();\n\n for (let i = 0; i < points.length; i++) {\n if (points[i].includes(user_guess)) {\n let count = count_letter(user_guess);\n score_tracker += points[i][0] * count;\n total_correct += count;\n current_score.innerHTML = \"SCORE: \" + score_tracker;\n break;\n }\n }\n\n if (total_correct == word.length) {\n // WIN FUNCTION --> SAVE TO LEADERBOARD\n document.getElementById(\"win_score\").innerHTML += score_tracker\n score_form(\"win_screen\");\n }\n}", "title": "" }, { "docid": "54d233c65f00772de8071f9738be1b93", "score": "0.6591116", "text": "function start () {\n game.passes = 0\n game.points = 0\n game.strikes = 0\n game.maxStrikes = 3\n game.maxPasses = 3\n game.status = true\n game.wordList = shuffle(words)\n game.currentWord = game.wordList[0]\n game.currentScrambledWord = shuffle(game.currentWord)\n return `Guess Word: ${game.currentScrambledWord}`\n}", "title": "" }, { "docid": "5a342ef3e898e865813a8dd4b2514421", "score": "0.6590847", "text": "function guessCheck() {\n\n // if guesses left are greater than 0 then...\n if (guessesLeft > 0) { \n // if guess has already been used (Guesses so far array INCLUDES User Guess), end the function\n if (guessesSoFar.includes(userGuess)){\n return;\n }\n //if userGuess is exactly equal to the answer...\n if(userGuess === answer){\n // wins gets 1 point and game resets\n wins++\n resetGame()\n } else {\n // otherwise your guesses left goes down and guessesSoFar array gets updated with your guess\n guessesLeft--;\n guessesSoFar.push(userGuess);\n };\n //runs the update display function to update the new conditions\n updateDisplay();\n // if your guesses drop below zero, your losses integer goes up and the game resets\n } else{\n losses++\n resetGame()\n };\n }", "title": "" }, { "docid": "3cf7dc2b6c62695d6909a4c8c0539c87", "score": "0.65848345", "text": "function evalGuess() {\n totalGuesses += 1 \n gamerGuess = document.querySelector('#guess').value\n //console.log(totalGuesses, gamerGuess)\n\n const feedback = document.querySelector('#feedback')\n if (gamerGuess == correctNumber) {\n console.log(`gamerGuess is equal to correctNumber`)\n feedback.innerText = 'You are correct! \\n You win!'\n giveAward()\n } else if (gamerGuess > correctNumber && gamerGuess < 16) {\n feedback.innerText = 'Your Guess was Too High,\\n try again'\n } else if (gamerGuess < correctNumber && gamerGuess > 0) {\n feedback.innerText = 'Your Guess was Too Low,\\n try again'\n } else {\n feedback.innerText = 'Please choose a number\\n between 1 and 15 \\n and try again!'\n totalGuesses -= 1\n }\n document.querySelector('#attempts').innerText = totalGuesses \n}", "title": "" }, { "docid": "3d00e42a37991383afca2f30ee65d8fb", "score": "0.65844876", "text": "function playGame(){\n let numberGuess = document.getElementById('number-guess').value;\n displayResult(numberGuess)\n saveGuessHistory(numberGuess)\n displayHistory()\n}", "title": "" } ]
0cc0456ca737e83c78c4de05958336a8
(public) this^e % m, 0 <= e < 2^32
[ { "docid": "87fcdf10555c5c6fd59c14653b2b842d", "score": "0.7545855", "text": "function bnModPowInt(e, m) {\n var z\n if (e < 256 || m.isEven()) z = new Classic(m)\n else z = new Montgomery(m)\n return this.exp(e, z)\n}", "title": "" } ]
[ { "docid": "bf77a900b0b15e4f12ef5d24390b574b", "score": "0.764227", "text": "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = new BigInteger();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = new BigInteger();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = new BigInteger(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n }", "title": "" }, { "docid": "58fa83a8b38d55f702a939b691f03c7f", "score": "0.7633096", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n }", "title": "" }, { "docid": "6cc4476ef8072b1c0b5bef714e4bc634", "score": "0.7612987", "text": "function bnModPowInt(e, m) {\r\n var z;\r\n if (e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\r\n return this.exp(e, z);\r\n}", "title": "" }, { "docid": "124fadbb4cb4bb790810fc410b5f5a2a", "score": "0.7592798", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);\n else z = new Montgomery(m);\n return this.exp(e, z);\n }", "title": "" }, { "docid": "0713fd9990ecd9d8def2a8609fa4cd5a", "score": "0.75917083", "text": "function bnModPowInt(e, m)\n{\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);\n else z = new Montgomery(m);\n return this.exp(e, z);\n}", "title": "" }, { "docid": "e4380a70db135c186383c4dfc801e3b1", "score": "0.75859135", "text": "function bnModPowInt(e,m) {\r\n var z;\r\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\r\n return this.exp(e,z);\r\n }", "title": "" }, { "docid": "15f8912b9cfe34fd5354c82955550e3c", "score": "0.75774515", "text": "function bnModPow(e, m) {\n\t var i = e.bitLength(),\n\t k, r = nbv(1),\n\t z\n\t if (i <= 0) return r\n\t else if (i < 18) k = 1\n\t else if (i < 48) k = 3\n\t else if (i < 144) k = 4\n\t else if (i < 768) k = 5\n\t else k = 6\n\t if (i < 8)\n\t z = new Classic(m)\n\t else if (m.isEven())\n\t z = new Barrett(m)\n\t else\n\t z = new Montgomery(m)\n\t\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1\n\t g[1] = z.convert(this)\n\t if (k > 1) {\n\t var g2 = new BigInteger()\n\t z.sqrTo(g[1], g2)\n\t while (n <= km) {\n\t g[n] = new BigInteger()\n\t z.mulTo(g2, g[n - 2], g[n])\n\t n += 2\n\t }\n\t }\n\t\n\t var j = e.t - 1,\n\t w, is1 = true,\n\t r2 = new BigInteger(),\n\t t\n\t i = nbits(e[j]) - 1\n\t while (j >= 0) {\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km\n\t else {\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n\t }\n\t\n\t n = k\n\t while ((w & 1) == 0) {\n\t w >>= 1\n\t --n\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB\n\t --j\n\t }\n\t if (is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r)\n\t is1 = false\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2)\n\t z.sqrTo(r2, r)\n\t n -= 2\n\t }\n\t if (n > 0) z.sqrTo(r, r2)\n\t else {\n\t t = r\n\t r = r2\n\t r2 = t\n\t }\n\t z.mulTo(r2, g[w], r)\n\t }\n\t\n\t while (j >= 0 && (e[j] & (1 << i)) == 0) {\n\t z.sqrTo(r, r2)\n\t t = r\n\t r = r2\n\t r2 = t\n\t if (--i < 0) {\n\t i = this.DB - 1\n\t --j\n\t }\n\t }\n\t }\n\t return z.revert(r)\n\t}", "title": "" }, { "docid": "c7a9c8e69218ecbcfcd651d737892ed6", "score": "0.75746596", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n }", "title": "" }, { "docid": "363bf3f81fc39d869f33c1b864c6a6bb", "score": "0.7574003", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e, z);\n }", "title": "" }, { "docid": "7a7f8f2f0b218e4221c507cb72c0f6b6", "score": "0.75733", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e, z);\n}", "title": "" }, { "docid": "7a7f8f2f0b218e4221c507cb72c0f6b6", "score": "0.75733", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e, z);\n}", "title": "" }, { "docid": "5f6adbbcf56e39e6c0e8b8394ddbcf93", "score": "0.7558576", "text": "function powMod(n, e, m) {\n\tvar product = 1;\n\tfor(var i = 0; i < e; i++) {\n\t\tproduct = product * n % m;\n\t}\n\treturn product;\n}", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "4baedf73c4451beb5855acd24a08093b", "score": "0.7558328", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "e591e8b237f58abc6baa99c572726a58", "score": "0.7553821", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "title": "" }, { "docid": "88351fcdbbabf283decead09f3f89586", "score": "0.7552876", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "779ffd503a8d28e620616cfecab7f62e", "score": "0.75258404", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n}", "title": "" }, { "docid": "779ffd503a8d28e620616cfecab7f62e", "score": "0.75258404", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n}", "title": "" }, { "docid": "779ffd503a8d28e620616cfecab7f62e", "score": "0.75258404", "text": "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "ac471ec45acbc750ff60f61cdd2ce16c", "score": "0.7506115", "text": "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "title": "" }, { "docid": "22ee5bc8ca210c93c1b5b4cd74296980", "score": "0.7497254", "text": "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "title": "" }, { "docid": "22ee5bc8ca210c93c1b5b4cd74296980", "score": "0.7497254", "text": "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "title": "" }, { "docid": "22ee5bc8ca210c93c1b5b4cd74296980", "score": "0.7497254", "text": "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "title": "" }, { "docid": "22ee5bc8ca210c93c1b5b4cd74296980", "score": "0.7497254", "text": "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "title": "" }, { "docid": "ec8b9f8c902d71d6f18cc811a8d939d9", "score": "0.7489764", "text": "function bnModPow(e,m) {\r\n var i = e.bitLength(), k, r = nbv(1), z;\r\n if(i <= 0) return r;\r\n else if(i < 18) k = 1;\r\n else if(i < 48) k = 3;\r\n else if(i < 144) k = 4;\r\n else if(i < 768) k = 5;\r\n else k = 6;\r\n if(i < 8)\r\n z = new Classic(m);\r\n else if(m.isEven())\r\n z = new Barrett(m);\r\n else\r\n z = new Montgomery(m);\r\n\r\n // precomputation\r\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\r\n g[1] = z.convert(this);\r\n if(k > 1) {\r\n var g2 = nbi();\r\n z.sqrTo(g[1],g2);\r\n while(n <= km) {\r\n g[n] = nbi();\r\n z.mulTo(g2,g[n-2],g[n]);\r\n n += 2;\r\n }\r\n }\r\n\r\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\r\n i = nbits(e[j])-1;\r\n while(j >= 0) {\r\n if(i >= k1) w = (e[j]>>(i-k1))&km;\r\n else {\r\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\r\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\r\n }\r\n\r\n n = k;\r\n while((w&1) == 0) { w >>= 1; --n; }\r\n if((i -= n) < 0) { i += this.DB; --j; }\r\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\r\n g[w].copyTo(r);\r\n is1 = false;\r\n }\r\n else {\r\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\r\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\r\n z.mulTo(r2,g[w],r);\r\n }\r\n\r\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\r\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\r\n if(--i < 0) { i = this.DB-1; --j; }\r\n }\r\n }\r\n return z.revert(r);\r\n }", "title": "" }, { "docid": "b1faf10e32cf285cec7b35113326ff4d", "score": "0.7481128", "text": "function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }", "title": "" }, { "docid": "b1faf10e32cf285cec7b35113326ff4d", "score": "0.7481128", "text": "function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }", "title": "" }, { "docid": "b1faf10e32cf285cec7b35113326ff4d", "score": "0.7481128", "text": "function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }", "title": "" }, { "docid": "b1faf10e32cf285cec7b35113326ff4d", "score": "0.7481128", "text": "function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }", "title": "" }, { "docid": "b1faf10e32cf285cec7b35113326ff4d", "score": "0.7481128", "text": "function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }", "title": "" }, { "docid": "b1faf10e32cf285cec7b35113326ff4d", "score": "0.7481128", "text": "function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }", "title": "" }, { "docid": "d782755d3f6691fc939c088ca760eed5", "score": "0.7471393", "text": "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\t\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\t\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\t\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\t\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "title": "" }, { "docid": "d782755d3f6691fc939c088ca760eed5", "score": "0.7471393", "text": "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\t\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\t\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\t\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\t\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "title": "" }, { "docid": "74081345bf3a45ee86e3730c97e52a89", "score": "0.747055", "text": "function bnModPowInt(e, m) {\n\tvar z;\n\tif (e < 256 || m.isEven())\n\t\tz = new Classic(m);\n\telse\n\t\tz = new Montgomery(m);\n\treturn this.exp(e, z);\n}", "title": "" } ]
0ab2b79c0abc22a3012f0d1a0e60ddf4
Changes section style, type is sectionTypes ENUM.
[ { "docid": "88b88be550421f6ae8f7c39ed0e4e5b8", "score": "0.0", "text": "function questionTypeSelected(num) {\n questionType = num;\n questionTypeTable.style.display = \"none\";\n }", "title": "" } ]
[ { "docid": "739da1eb58fe5b8a7c6c3514d54bbfe3", "score": "0.5491717", "text": "function switchSection(whichSection) {\r\n\r\n whichSection = whichSection - 1;\r\n\r\n console.log(whichSection);\r\n\r\n /*-------------------------------------\r\n | Sections\r\n -------------------------------------*/\r\n //hide them all\r\n for(var i = 0; i < theSections.length; i++) {\r\n theSections[i].style.display = 'none';\r\n }\r\n\r\n //show the chosen one\r\n theSections[whichSection].style.display = 'block';\r\n\r\n /*-------------------------------------\r\n | Links\r\n -------------------------------------*/\r\n tabLinks.forEach(function(theLink){\r\n theLink.classList.remove('chosen');\r\n });\r\n\r\n tabLinks[whichSection].classList.add('chosen');\r\n}", "title": "" }, { "docid": "f263f0c5ce75439001282c32dac8facd", "score": "0.543954", "text": "function sectionOn() { }", "title": "" }, { "docid": "61be68a8ee80c7b3e254be1e7ad126c3", "score": "0.54145354", "text": "changeStyle(style){\n\t\t\tvar currentLayer = this.shared.currentLayer;\n\t\t\tvar layers = this.shared.layers;\n\t\t\t// si se selecciona el estilo que ya esta\n\t\t\t// seleccionado, no se hace nada\n\t\t\tif(currentLayer.currentStyle == style){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// se cambia el estilo de la capa actual\n\t\t\tcurrentLayer.currentStyle = style;\n\t\t\tthis.$forceUpdate();\n\t\t\t// se notifica a los otros componentes\n\t\t\tthis.$root.$emit(\"update_style\");\n\t\t}", "title": "" }, { "docid": "8062ec69ff4b242aa9ed10323019acae", "score": "0.5327945", "text": "setSections(state, section){\n state.allSections = section\n }", "title": "" }, { "docid": "ef1a7bc4b396655f45998d9483c1ea32", "score": "0.53229207", "text": "function icinga_changed_filter_coloring(section) {\n\n\tvar set_color = false;\n\n\tif (section == \"host_status_types\" )\n\t\tset_color = (host_status_types != org_host_status_types) ? true : false;\n\n\tif (section == \"host_properties\" )\n\t\tset_color = (host_properties != org_host_properties) ? true : false;\n\n\tif (section == \"service_status_types\" )\n\t\tset_color = (service_status_types != org_service_status_types) ? true : false;\n\n\tif (section == \"service_properties\" )\n\t\tset_color = (service_properties != org_service_properties) ? true : false;\n\n\tif (set_color == true) {\n\t\t$('#' + section + \"_text_cell\").css(\"background-color\", fade_color_from);\n\t\t$('#' + section + \"_text_cell\").stop(true, true).delay(300).animate({ backgroundColor: fade_color_to }, 2000 );\n\t} else {\n\t\t$('#' + section + \"_text_cell\").animate({ backgroundColor: \"white\" }, 1000 );\n\t\t$('#' + section + \"_text_cell\").css(\"background-color\", \"\");\n\t}\n\n\treturn;\n}", "title": "" }, { "docid": "2ca1148bafd6b3cf39c91e57186e55ca", "score": "0.52995235", "text": "function changeSection(sec,tab){\n\t//set background color\n\tlet allTabs = document.getElementsByClassName(\"tabs\");\n\tfor(let t=0;t<allTabs.length;t++){\n\t\tallTabs[t].style.backgroundColor = \"#dedede\";\n\t}\n\ttab.style.backgroundColor = \"#ECCE0E\";\n\n\tdocument.getElementById(\"build_opt\").style.display = \"none\";\n\tdocument.getElementById(\"order_opt\").style.display = \"none\";\n\tdocument.getElementById(\"minimapCanvas\").style.display = \"none\";\n\tdocument.getElementById(\"user_settings\").style.display = \"none\";\n\tdocument.getElementById(\"text_log\").style.display = \"none\";\n\tdocument.getElementById(\"obj_list\").style.display = \"none\";\n\n\tdocument.getElementById(\"tutorial\").style.display = \"none\";\n\tdocument.getElementById(\"stats\").style.display = \"block\";\n\tobjDivShown = false;\n\n\tif(sec == \"minimap\"){\n\t\tdocument.getElementById(\"minimapCanvas\").style.display = \"block\";\n\t}else if(sec == \"build\"){\n\t\tdocument.getElementById(\"build_opt\").style.display = \"block\";\n }else if(sec == \"order\"){\n document.getElementById(\"order_opt\").style.display = \"block\";\n\t}else if(sec == \"settings\"){\n\t\tdocument.getElementById(\"user_settings\").style.display = \"block\";\n\t}else if(sec == \"log\"){\n\t\tdocument.getElementById(\"text_log\").style.display = \"block\";\n\t}else if(sec == \"obj\"){\n\t\tsetObjsDiv();\n\t\tdocument.getElementById(\"obj_list\").style.display = \"block\";\n\t\tobjDivShown = true;\n\n\t\tdocument.getElementById(\"stats\").style.display = \"none\";\n\t\tdocument.getElementById(\"tutorial\").style.display = \"block\";\n\n\t\tcancelObjTab();\n\t}\n\n}", "title": "" }, { "docid": "90428fe6d4225ffd55360621406f8252", "score": "0.5297619", "text": "function activeSection(section){ \r\n if(currSection !== section){ //check selected section is not already active\r\n //remove current underline\r\n if(currSection === 0){\r\n titleSection.classList.remove(\"selected\"); \r\n }\r\n if(currSection === 1){\r\n aboutSection.classList.remove(\"selected\");\r\n }\r\n if(currSection === 2){\r\n engineerSection.classList.remove(\"selected\");\r\n }\r\n if(currSection === 3){\r\n gamingSection.classList.remove(\"selected\");\r\n }\r\n if(currSection === 4){\r\n mediaSection.classList.remove(\"selected\");\r\n }\r\n \r\n //add new underline\r\n if(section === 1){\r\n aboutSection.classList.add(\"selected\");\r\n }\r\n if(section === 2){\r\n engineerSection.classList.add(\"selected\");\r\n }\r\n if(section === 3){\r\n gamingSection.classList.add(\"selected\");\r\n }\r\n if(section === 4){\r\n mediaSection.classList.add(\"selected\");\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a161c4bb015b5599348a941316ff8b2f", "score": "0.5287294", "text": "function setTypeOverride(sectionTypes, types) {\n types.forEach(type => {\n const override = Object.keys(sectionTypes).find(aliased => type.eq(aliased));\n\n if (override) {\n type.setOverride(sectionTypes[override]);\n } else {\n // FIXME: NOT happy with this approach, but gets over the initial hump cased by (Vec<Announcement>,BalanceOf)\n const orig = type.toString();\n const alias = Object.entries(sectionTypes).reduce((result, [from, to]) => BOXES.reduce((result, [one, two]) => result.replace(`${one}${from}${two}`, `${one}${to}${two}`), result), orig);\n\n if (orig !== alias) {\n type.setOverride(alias);\n }\n }\n });\n }", "title": "" }, { "docid": "fc782edd7f5ad9e9772e87b9856c0492", "score": "0.52733654", "text": "function setBlockForStyleEditing(block) {\n if(_styleEditorBlock) { //clear the previous selection\n $(_styleEditorBlock).removeClass(\"selected\");\n _styleEditorFormatObject = null;\n _styleEditorFormatColumns = null;\n _styleEditorFormatColumn = null;\n }\n _styleEditorBlock = block;\n if(block) {\n var path = [];\n findLayoutTargetPath(path, document.getElementById(\"LayoutEditor\"), block);\n _styleEditorFormatObject = _problemFormat.order\n for(var p = 0; p < path.length; p++) {\n _styleEditorFormatObject = _styleEditorFormatObject[path[p]];\n if(typeof _styleEditorFormatObject == \"object\" && _styleEditorFormatObject.width) {\n _styleEditorFormatColumns = _styleEditorFormatObject;\n _styleEditorFormatColumn = path[p+1]; //should be \"left\" or \"right\"\n }\n }\n if(!_problemFormat[_styleEditorFormatObject]) { //if we haven't yet defined style for this\n _problemFormat[_styleEditorFormatObject] = {};\n }\n _styleEditorFormatObject = _problemFormat[_styleEditorFormatObject];\n $(block).addClass(\"selected\");\n }\n rebuildStyleEditor();\n}", "title": "" }, { "docid": "0600357d5387bf19b85e81200e26266f", "score": "0.52671885", "text": "changeSection (section) {\n _this.activeItemById(section)\n _this.setState({\n section: section\n })\n _this.hideMenu()\n }", "title": "" }, { "docid": "0600357d5387bf19b85e81200e26266f", "score": "0.52671885", "text": "changeSection (section) {\n _this.activeItemById(section)\n _this.setState({\n section: section\n })\n _this.hideMenu()\n }", "title": "" }, { "docid": "fb50d56b471c9722d3bfb33fbdb40590", "score": "0.5256034", "text": "_toggleStyle(type) {\n switch (type) {\n case 'desaturate':\n case 'contrast':\n case 'zoom':\n this._toggleStyleByType(type);\n break;\n case 'keyboard':\n this._toggleKeyboard();\n break;\n case 'cursor':\n case 'font':\n case 'links':\n this._toggleOnceOnly(type)\n break;\n case 'reset':\n this._resetAll()\n break;\n default:\n break;\n }\n this._saveToStorage();\n }", "title": "" }, { "docid": "e4bea6b1a36fe764b3881d52e2ebedf0", "score": "0.5247036", "text": "function getidsection(id){\n if(id==\"section1\"){\n style(0);\n }\n else if(id==\"section2\"){\n style(1);\n }\n else if(id==\"section3\"){\n style(2);\n }\n else if(id==\"section4\"){\n style(3);\n };\n}", "title": "" }, { "docid": "dd5155f6293d547ac1b624ce5b5e501a", "score": "0.52470326", "text": "function styleMenu(section, index){\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if(hasClass(section, ACTIVE)){\n activateMenuAndNav(options.anchors[index], index);\n }\n }\n\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n if(options.menu && options.css3 && closest($(options.menu)[0], WRAPPER_SEL) != null){\n $body.appendChild($(options.menu)[0]);\n }\n }", "title": "" }, { "docid": "4b30fba32110cf36fd058fcace077f37", "score": "0.5246684", "text": "function sectionsChange(val) {\n //updating state\n state.sectionInput = val;\n state.kitsCalc = calcKitsBySections();\n updateDom(kitsCalcDisplay, state.kitsCalc, 'text');\n // calcKitsBySections(sections);\n }", "title": "" }, { "docid": "eac7d0adc1d4d99b95976aa95a6b38ae", "score": "0.5227126", "text": "function styleMenu(section, index){\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if(hasClass(section, ACTIVE)){\n activateMenuAndNav(options.anchors[index], index);\n }\n }\n\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n if(options.menu && options.css3 && closest($(options.menu)[0], WRAPPER_SEL) != null){\n $(options.menu).forEach(function(menu) {\n $body.appendChild(menu);\n });\n }\n }", "title": "" }, { "docid": "71c72283a5c7bdb7f190d3917365178b", "score": "0.5170687", "text": "function styleMenu(section, index){\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if(hasClass(section, ACTIVE)){\n activateMenuAndNav(options.anchors[index], index);\n }\n }\n\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n if(options.menu && options.css3 && closest($(options.menu)[0], WRAPPER_SEL) != null){\n $(options.menu).forEach(function(menu) {\n $body.appendChild(menu);\n });\n }\n }", "title": "" }, { "docid": "9660fb84b3d0d295931df83af6a9cc50", "score": "0.5159153", "text": "function styleMenu(section, index) {\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if (section.hasClass(ACTIVE)) {\n activateMenuAndNav(options.anchors[index], index);\n }\n } //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n\n\n if (options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length) {\n $(options.menu).appendTo($body);\n }\n }", "title": "" }, { "docid": "e754cf986a919a968ba7f042f4221cfe", "score": "0.51421434", "text": "function set_section ( section, callback ) {\n\t\t\n\t\tvar hadPreviousSection = false,\n\t\t\tnewSectionCallback = function () {\n\t\t\t\t\n\t\t\t\tif ( typeof previousSection !== 'undefined' ) {\n\t\t\t\t\t\n\t\t\t\t\tpreviousSection.remove();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsection.resize(shared.gameWidth, shared.gameHeight);\n\t\t\t\t\n section.show();\n\t\t\t\t\n currentSection = section;\n\t\t\t\t\n\t\t\t\t// hide blocker\n\t\t\t\t\n\t\t\t\tmain.dom_fade( {\n\t\t\t\t\telement: shared.domElements.$uiBlocker\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\tresume();\n\t\t\t\t\n\t\t\t\tif ( typeof callback !== 'undefined' ) {\n\t\t\t\t\t\n\t\t\t\t\tcallback.call();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t};\n\t\t\n\t\t// pause game while changing sections\n\t\t\n\t\tpause( true );\n\t\t\n // hide current section\n if (typeof currentSection !== 'undefined') {\n\t\t\t\n\t\t\thadPreviousSection = true;\n \n previousSection = currentSection;\n \n previousSection.hide();\n\t\t\t\n\t\t\t// block ui\n \n\t\t\tmain.dom_fade( {\n\t\t\t\telement: shared.domElements.$uiBlocker,\n\t\t\t\topacity: 1\n\t\t\t} );\n \n }\n\t\t\n // no current section\n\t\t\n currentSection = undefined;\n\t\t\n\t\t// set started\n\t\t\n\t\tif ( typeof startedValue !== 'undefined' ) {\n\t\t\n\t\t\tstarted = startedValue;\n\t\t\t\n\t\t}\n \n // start and show new section\n if (typeof section !== 'undefined') {\n\t\t\t\n // wait for blocker to finish fading in\n\t\t\t\n\t\t\tif ( hadPreviousSection === true ) {\n\t\t\t\t\n\t\t\t\twindow.requestTimeout( function () {\n\t\t\t\t\t\n\t\t\t\t\tnewSectionCallback();\n\t\t\t\t\t\n\t\t\t\t}, transitionTime );\n\t\t\t\n\t\t\t}\n\t\t\t// no previous section, create new immediately\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tnewSectionCallback();\n\t\t\t\t\n\t\t\t}\n \n }\n\t\t\n }", "title": "" }, { "docid": "a9609a5c08a3b32ad7c26f8bafd7fbee", "score": "0.51309735", "text": "setCurrObjSection( section_number )\n {\n const fname = 'PanelSectionsList.setCurrObjSection():'\n \n\n if ( ! this.sections.has( section_number ) )\n {\n ErrorBeep()\n throw new Error(`the sections list has not this section number ${section_number}`)\n }\n let section = this.sections.get( section_number )\n Log(`${fname} name click on obj section, name == '${section.name}', num == ${section.number}`)\n \n if ( this.curr_section != null )\n this.curr_section.root_elem.style.backgroundColor = 'rgb(20%,20%,20%)'\n this.curr_section = section \n this.curr_section.root_elem.style.backgroundColor = 'rgb(30%,30%,30%)'\n\n canvas.drawFrame()\n }", "title": "" }, { "docid": "cc66a8b132eb644b1b88fa618b6a6ff1", "score": "0.5105673", "text": "set type (newType) {\n\t\tif(this.strongness != 1) this.rootElement.style.backgroundColor = CandyColors[newType];\t\n\t\tthis.rootElement.style.borderColor = CandyColors[newType];\n\t\tthis._type = newType;\n\t}", "title": "" }, { "docid": "1c3649b75fcb39f7087a5ccd6f900387", "score": "0.5099563", "text": "function toggleSection(oldSection, newSection) {\r\n oldSection.css({\r\n position: \"absolute\",\r\n opacity: \"0\",\r\n zIndex: \"-99\",\r\n });\r\n\r\n newSection.css({\r\n position: \"relative\",\r\n opacity: \"1\",\r\n zIndex: \"99\",\r\n });\r\n }", "title": "" }, { "docid": "78481888bcce39d067b2e5498071e725", "score": "0.5099545", "text": "function styleMenu(section, index){\r\n if (typeof options.anchors[index] !== 'undefined') {\r\n //activating the menu / nav element on load\r\n if(section.hasClass(ACTIVE)){\r\n activateMenuAndNav(options.anchors[index], index);\r\n }\r\n }\r\n\r\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\r\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\r\n $(options.menu).appendTo($body);\r\n }\r\n }", "title": "" }, { "docid": "78481888bcce39d067b2e5498071e725", "score": "0.5099545", "text": "function styleMenu(section, index){\r\n if (typeof options.anchors[index] !== 'undefined') {\r\n //activating the menu / nav element on load\r\n if(section.hasClass(ACTIVE)){\r\n activateMenuAndNav(options.anchors[index], index);\r\n }\r\n }\r\n\r\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\r\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\r\n $(options.menu).appendTo($body);\r\n }\r\n }", "title": "" }, { "docid": "78481888bcce39d067b2e5498071e725", "score": "0.5099545", "text": "function styleMenu(section, index){\r\n if (typeof options.anchors[index] !== 'undefined') {\r\n //activating the menu / nav element on load\r\n if(section.hasClass(ACTIVE)){\r\n activateMenuAndNav(options.anchors[index], index);\r\n }\r\n }\r\n\r\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\r\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\r\n $(options.menu).appendTo($body);\r\n }\r\n }", "title": "" }, { "docid": "78481888bcce39d067b2e5498071e725", "score": "0.5099545", "text": "function styleMenu(section, index){\r\n if (typeof options.anchors[index] !== 'undefined') {\r\n //activating the menu / nav element on load\r\n if(section.hasClass(ACTIVE)){\r\n activateMenuAndNav(options.anchors[index], index);\r\n }\r\n }\r\n\r\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\r\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\r\n $(options.menu).appendTo($body);\r\n }\r\n }", "title": "" }, { "docid": "78481888bcce39d067b2e5498071e725", "score": "0.5099545", "text": "function styleMenu(section, index){\r\n if (typeof options.anchors[index] !== 'undefined') {\r\n //activating the menu / nav element on load\r\n if(section.hasClass(ACTIVE)){\r\n activateMenuAndNav(options.anchors[index], index);\r\n }\r\n }\r\n\r\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\r\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\r\n $(options.menu).appendTo($body);\r\n }\r\n }", "title": "" }, { "docid": "38804bd0f5d1b905f44e0ce7b3372bef", "score": "0.50969017", "text": "function styleMenu(section, index){\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if(section.hasClass(ACTIVE)){\n activateMenuAndNav(options.anchors[index], index);\n }\n }\n\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\n $(options.menu).appendTo($body);\n }\n }", "title": "" }, { "docid": "38804bd0f5d1b905f44e0ce7b3372bef", "score": "0.50969017", "text": "function styleMenu(section, index){\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if(section.hasClass(ACTIVE)){\n activateMenuAndNav(options.anchors[index], index);\n }\n }\n\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\n $(options.menu).appendTo($body);\n }\n }", "title": "" }, { "docid": "38804bd0f5d1b905f44e0ce7b3372bef", "score": "0.50969017", "text": "function styleMenu(section, index){\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if(section.hasClass(ACTIVE)){\n activateMenuAndNav(options.anchors[index], index);\n }\n }\n\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\n $(options.menu).appendTo($body);\n }\n }", "title": "" }, { "docid": "38804bd0f5d1b905f44e0ce7b3372bef", "score": "0.50969017", "text": "function styleMenu(section, index){\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if(section.hasClass(ACTIVE)){\n activateMenuAndNav(options.anchors[index], index);\n }\n }\n\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\n $(options.menu).appendTo($body);\n }\n }", "title": "" }, { "docid": "38804bd0f5d1b905f44e0ce7b3372bef", "score": "0.50969017", "text": "function styleMenu(section, index){\n if (typeof options.anchors[index] !== 'undefined') {\n //activating the menu / nav element on load\n if(section.hasClass(ACTIVE)){\n activateMenuAndNav(options.anchors[index], index);\n }\n }\n\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\n if(options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length){\n $(options.menu).appendTo($body);\n }\n }", "title": "" }, { "docid": "fcb2a17159a2231e19341b40d4b0b9bd", "score": "0.5094995", "text": "function ManageSection(){}", "title": "" }, { "docid": "2566dfb0b5d7ba270eb0ce3528acf16a", "score": "0.5029493", "text": "function setSections() {\n var section = $('#nuniverse').find('.section:first');\n $('#nuniverse').data('current_section',section);\n $('.section').movable();\n }", "title": "" }, { "docid": "e44e8de1982c89bea41edc433aee02fb", "score": "0.50240207", "text": "changeStyle(stylePot) {\n const radius = this.getStyle(stylePot)\n this.geometry.dispose()\n this.geometry = new CylinderGeometry(radius[0], radius[1], 2, 10)\n }", "title": "" }, { "docid": "d3d63b5808c8921126d49dbaf64fc369", "score": "0.49910104", "text": "function toggleSection(sec){\n //Select or deselect all seats in the section...\n //Clicked on a section...\n showInfo(\"Picked section \"+sec.sectionno);\n var filled=0, empty=0, seatoff=0;\n for(ssi=0; ssi<sec.rows.length; ssi++){\n for(rri=0; rri<sec.rows[ssi]; rri++){\n if(seats[sec.startseat+seatoff]==1){\n filled++;\n }else{\n empty++;\n }\n seatoff++;\n }\n }\n var fillval=1;\n if(filled > empty){\n fillval=0;\n }\n var allModified=[];\n for(sso=0; sso<seatoff; sso++){\n var seatno = sec.startseat + sso;\n if(seats[seatno] != fillval){\n seats[seatno] = fillval;\n allModified[allModified.length] = {id: (seatno+1), state: seats[seatno]};\n }\n }\n if(allModified.length > 0){\n redraw();\n postMultipleSeats(allModified);\n }\n}", "title": "" }, { "docid": "6ffe5789b0175768afb99184b36e3da9", "score": "0.4980753", "text": "function setJobSectionMode(mode, section) {\n\tlet hoursQuestion = section.querySelector('.job-input-section-question-hours');\n\tlet wageQuestion = section.querySelector('.job-input-section-question-wage');\n\tlet wageQuestionModeText = wageQuestion.querySelector('.job-input-section-mode');\n\tswitch (mode) {\n\tcase 'hourly':\n\t\thoursQuestion.classList.remove('disabled');\n\t\twageQuestionModeText.innerText = 'hour';\n\t\tbreak;\n\tcase 'weekly':\n\t\thoursQuestion.classList.add('disabled');\n\t\twageQuestionModeText.innerText = 'week';\n\t\tbreak;\n\tcase 'monthly':\n\t\thoursQuestion.classList.add('disabled');\n\t\twageQuestionModeText.innerText = 'month';\n\t\tbreak;\n\tcase 'yearly':\n\t\thoursQuestion.classList.add('disabled');\n\t\twageQuestionModeText.innerText = 'year';\n\t\tbreak;\n\tdefault:\n\t\t// The mode should always be set, but if something goes wrong, default to yearly salary mode\n\t\thoursQuestion.classList.add('disabled');\n\t\twageQuestionModeText.innerText = 'year';\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "316b85124ea528ba31a960e8f9acdcf1", "score": "0.49795535", "text": "function resetSections() {\r\n sections.forEach(function(sect) {\r\n sect.classList.remove('active');\r\n });\r\n }", "title": "" }, { "docid": "bfeefb634dadd2465437f47a9ba9eca0", "score": "0.49718976", "text": "function set_section ( section, callback ) {\n\t\t\n\t\tvar fadeBetweenSections = shared.fadeBetweenSections,\n\t\t\thadPreviousSection = false,\n\t\t\tnewSectionCallback = function () {\n\t\t\t\t\n\t\t\t\tif ( typeof shared.sectionLast !== 'undefined' ) {\n\t\t\t\t\t\n\t\t\t\t\tshared.sectionLast.remove();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n section.show();\n\t\t\t\t\n shared.section = section;\n\t\t\t\t\n\t\t\t\t// hide blocker\n\t\t\t\t\n\t\t\t\tif ( fadeBetweenSections !== false ) {\n\t\t\t\t\t\n\t\t\t\t\tmain.dom_fade( {\n\t\t\t\t\t\telement: shared.domElements.$uiBlocker\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\tresume();\n\t\t\t\t\n\t\t\t\tif ( typeof callback !== 'undefined' ) {\n\t\t\t\t\t\n\t\t\t\t\tcallback.call();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t};\n\t\t\n\t\t// pause game while changing sections\n\t\t\n\t\tpause( true );\n\t\t\n // hide current section\n if (typeof shared.section !== 'undefined') {\n\t\t\t\n\t\t\thadPreviousSection = true;\n \n shared.sectionLast = shared.section;\n \n shared.sectionLast.hide();\n\t\t\t\n\t\t\t// block ui\n \n\t\t\tif ( fadeBetweenSections !== false ) {\n\t\t\t\t\n\t\t\t\tmain.dom_fade( {\n\t\t\t\t\telement: shared.domElements.$uiBlocker,\n\t\t\t\t\topacity: 1\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t}\n \n }\n\t\t\n // no current section\n\t\t\n shared.section = undefined;\n\t\t\n\t\t// set started\n\t\t\n\t\tif ( typeof startedValue !== 'undefined' ) {\n\t\t\n\t\t\tstarted = startedValue;\n\t\t\t\n\t\t}\n \n // start and show new section\n if ( typeof section !== 'undefined' ) {\n\t\t\t\n // wait for blocker to finish fading in\n\t\t\t\n\t\t\tif ( fadeBetweenSections !== false && hadPreviousSection === true ) {\n\t\t\t\t\n\t\t\t\twindow.requestTimeout( function () {\n\t\t\t\t\t\n\t\t\t\t\tnewSectionCallback();\n\t\t\t\t\t\n\t\t\t\t}, transitionTime );\n\t\t\t\n\t\t\t}\n\t\t\t// no previous section, create new immediately\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tnewSectionCallback();\n\t\t\t\t\n\t\t\t}\n \n }\n\t\t\n }", "title": "" }, { "docid": "ca4b6cfc096defccd585640ca12f4e7e", "score": "0.49637666", "text": "function editSection(index)\r\n{\r\n // Change the attribute of the section header to be editable\r\n var section_header_index = 'section_header'.concat(index);\r\n var edit_section_header = document.getElementById(section_header_index);\r\n edit_section_header.contentEditable = \"true\";\r\n\r\n // Change the attribute of the section to be editable\r\n var section_index = 'p'.concat(index);\r\n var edit_section = document.getElementById(section_index);\r\n edit_section.contentEditable = \"true\";\r\n\r\n // Show the image upload button\r\n var upload_image_index = 'upload_image'.concat(index);\r\n document.getElementById(upload_image_index).style.display = \"inline-block\";\r\n\r\n // Show the Save button\r\n document.getElementById(\"save_button\").style.display = \"inline-block\";\r\n // Show the Save message\r\n document.getElementById(\"update\").style.display = \"inline-block\";\r\n\r\n // Show the Delete Section button\r\n document.getElementById(\"remove_section_button\").style.display = \"inline-block\";\r\n // Set the Delete button to delete the section where the edit button was clicked\r\n // Change onclick to delete_section(index)\r\n var remove_button = document.getElementById(\"remove_section_button\");\r\n var index_section_to_delete = 'delete_section('.concat(index,')');\r\n remove_button.setAttribute(\"onclick\", index_section_to_delete);\r\n}", "title": "" }, { "docid": "5327e95b784fb6e406941ac0fe781b41", "score": "0.4954718", "text": "set style(style) {\n this._style = style;\n }", "title": "" }, { "docid": "92de3ed98855d48b6fa58f5b7457811a", "score": "0.49361762", "text": "function addSection() {\n currentGlobalSectionIndex = currentGlobalSectionIndex + 1;\n}", "title": "" }, { "docid": "ebb320c43da8f91fd565a2f821815112", "score": "0.49329525", "text": "function ScreedSection() {\n}", "title": "" }, { "docid": "f5127a2da464a823511a3dccffc03f22", "score": "0.49328393", "text": "function drawSection(section, context, seatno, colorfunc, sectioncolor){\n section.startseat=seatno;\n var filled=0;\n var empty=0;\n\n //Points are used to keep track of the outer bounding hull of a section,\n //which allows you to click anywhere on a section in the overview\n var points=[];\n var points2=[];\n \n points2[points2.length] = {\n x: section.rowoffsets[0]*perseat + section.rows[0]*perseat,\n y: 0\n };\n for(ro=0; ro<section.rows.length; ro++){\n //for each seat in the row...\n for(i=0; i<section.rows[ro]; i++){\n var radius=section.rowoffsets[ro]*(dims.width+spacing) + i*(dims.width+spacing);\n context.fillStyle = colorfunc(seatno);\n if(seats[seatno] == 0){empty++;}\n else{ filled++; }\n context.fillRect(radius, ro*perseat, dims.width,dims.height);\n seatno++;\n }\n points[points.length] = {x: section.rowoffsets[ro]*perseat, y:(ro)*perseat};\n points2[points2.length] = {\n x: section.rowoffsets[ro]*perseat + section.rows[ro]*perseat,\n y:(ro+1)*perseat\n };\n }\n //Add the filled seats for this section\n numFilled = numFilled + filled;\n points[points.length] = {\n x: section.rowoffsets[section.rowoffsets.length-1]*perseat,\n y: (section.rows.length)*perseat\n };\n \n points = points.concat(points2.reverse());\n\n var sectionCol=1;\n if(filled > empty){\n sectionCol=0;\n }\n\n //currentSection == undefined means we're in overview mode\n if(currentSection == undefined){\n drawSectionHull(context, section, points, sectioncolor, sectionCol);\n \n }else{\n drawSectionToggle(context, section, sectioncolor, sectionCol);\n //drawSectionExit(context, section, sectioncolor, sectionCol);\n }\n\n return seatno;\n}", "title": "" }, { "docid": "23a130458399e4529abd9286c4833c68", "score": "0.4932205", "text": "function styleChange() {\n\t\tdocument.getElementById(\"style\").style.fontSize = \"35px\";\n\t\tdocument.getElementById(\"style\").style.color = \"red\";\n}", "title": "" }, { "docid": "24327a7341dde12d2c41d95d0c1a9d94", "score": "0.49193564", "text": "function update_sections() {\n page_state.sections_count[page_state.section] -= 1;\n document.querySelector('#sections').innerHTML = '';\n for (number=0; number<json_data.sections.length; number++){\n document.querySelector('#sections').innerHTML +=\n render_sections(number, json_data.sections[number].name);\n }\n}", "title": "" }, { "docid": "a5e0af21d59442b26b0291c5a06f0cc1", "score": "0.4910222", "text": "function setMenuActiveState(section) {\n switch (section) {\n case \"restaurants\":\n $('#restaurants-menu-item').addClass('active');\n $('#about-menu-item').removeClass('active');\n $('#chart-menu-item').removeClass('active');\n break;\n case \"about\":\n $('#about-menu-item').addClass('active');\n $('#restaurants-menu-item').removeClass('active');\n $('#chart-menu-item').removeClass('active');\n break;\n case \"chart\":\n $('#chart-menu-item').addClass('active');\n $('#restaurants-menu-item').removeClass('active');\n $('#about-menu-item').removeClass('active');\n break;\n }\n}", "title": "" }, { "docid": "76052f8c58e2b7b53133306bc47e6dcd", "score": "0.48701927", "text": "function setSection(section, dots) {\r\n clearPages();\r\n \r\n activeSection(section);\r\n currSection = section;\r\n \r\n displayPage1();\r\n numOfPages(dots);\r\n \r\n var background = document.getElementsByTagName(\"BODY\")[0];\r\n var landingVid = document.getElementById(\"landingVid\");\r\n \r\n if (section !== 0) {\r\n landingVid.style.visibility = \"hidden\";\r\n return background.style.backgroundImage = \"url(_assets/img/background/background\" + currSection + \".jpg)\";\r\n }\r\n \r\n landingVid.style.visibility = \"visible\";\r\n \r\n }", "title": "" }, { "docid": "03026fcbc67544c7543f77303a73d763", "score": "0.48653892", "text": "function onSectionChange() {\n sections = document.querySelectorAll('section');\n buildNav();\n}", "title": "" }, { "docid": "f76f56a299f4b8cf2182d74c3337c0cc", "score": "0.48157328", "text": "function setSelectionUnformatted(editor, style) {\n var sel = editor.getSelection();\n var path = editor.elementPath();\n // Find the elements for this style\n for (var i = 0; path && i < path.elements.length; i++) {\n var styleElement = path.elements[i];\n var $styleElement = $(styleElement.$);\n if ($styleElement.css('display') !== 'inline') // CKE only supports these styles as inline styles\n break;\n\n if (!style.checkElementRemovable(styleElement))\n continue;\n\n // Find unsplittable elements within the style element; we have to move the formats around if we find them\n\n var $unsplittables = $styleElement.find(getUnsplittablesSelector());\n if ($unsplittables.length) {\n var bms = sel.createBookmarks();\n\n // The formatting element is currently an ancestor of the unsplittable. Move the\n // formatting into and around the unsplittable:\n for (var j = 0; j < $unsplittables.length; j++) {\n var unsplittable = CKEDITOR.dom.element.get($unsplittables[j]);\n\n // Unformat the format element, then format the left portion and right portion\n\n // Add a class so the CKE doesn't remove the element\n styleElement.addClass('cke-unformat-tmp');\n removeStyleFromElement(editor, styleElement, style);\n\n // Re-format stuff preceding the unsplittable\n var leftRange = editor.createRange();\n leftRange.setStartAt(styleElement, CKEDITOR.POSITION_AFTER_START);\n leftRange.setEndBefore(unsplittable);\n style.applyToRange(leftRange);\n // Re-format stuff following the unsplittable\n var rightRange = editor.createRange();\n rightRange.setStartAfter(unsplittable);\n rightRange.setEndAt(styleElement, CKEDITOR.POSITION_BEFORE_END);\n style.applyToRange(rightRange);\n\n // Style inside the unsplittable, but split at the selection\n styleAroundBookmark(editor, unsplittable, style, bms[0]);\n\n styleElement.removeClass('cke-unformat-tmp');\n }\n\n sel.selectBookmarks(bms);\n return true;\n }\n else {\n var range = sel.getRanges()[0];\n if (!range)\n return false;\n\n var bms = sel.createBookmarks();\n\n styleElement.addClass('cke-unformat-tmp');\n removeStyleFromElement(editor, styleElement, style);\n styleAroundBookmark(editor, styleElement, style, bms[0]);\n styleElement.removeClass('cke-unformat-tmp');\n\n sel.selectBookmarks(bms);\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "0551cbc4b60aec4ca2a3123a7817b46e", "score": "0.4772827", "text": "function _updateSection(id) {\n\n var sectionData;\n\n if (_lastId !== id) {\n _lastId = id;\n\n // Set/remove active class \n _menuItems\n .parent().removeClass(\"active\")\n .end().filter(\"[scroll-to=\" + id + \"]\").parent().addClass(\"active\");\n _menuItems\n .removeClass(\"active\")\n .filter(\"[scroll-to=\" + id + \"]\").addClass(\"active\");\n\n sectionData = appData.get(id);\n if (sectionData) {\n\n $scope.selectedSection.data = sectionData;\n $scope.selectedSection.name = sectionData['display-name'];\n $scope.$apply();\n }\n }\n }", "title": "" }, { "docid": "5b43602de17e52a285163193096fea5b", "score": "0.47614455", "text": "onStyleSettingsChange() {\n this.sendAction('change', this.get('styleSettings'));\n }", "title": "" }, { "docid": "44ade09508678ecb085e700a1490c888", "score": "0.4750083", "text": "function changeStyle(style)\n{\n\tswitch(style)\n\t{\n\tcase 'winter':\n\t $(\"#inhoud\").css(\"background-color\", \"#E0ECF8\");\n\t $(\"h1\").css(\"color\", \"#0B3861\");\n\t\t\t$(\"#Weather\").css(\"background-color\",\"#A4C0CA\");\n\t\t\t$(\"#WeatherTomorrow\").css(\"background-color\",\"#A4C0CA\");\n\t\t\t$(\"#GeoLocation\").css(\"background-color\",\"#A4C0CA\");\n\t\t\t$(\"#inhoud\").css(\"box-shadow\",\"0px 0px 15px rgba(59, 50, 50, 1)\");\n\t\t\t$(\"#weather\").css(\"box-shadow\",\"8px 6px 15px rgba(59, 50, 50, 0.63)\");\n\t\t\t$(\"#GeoLocation\").css(\"box-shadow\",\"8px 6px 15px rgba(59, 50, 50, 0.63)\");\n\t\tbreak;\n\tcase 'summer':\n\t\t\t$(\"#inhoud\").css(\"background-color\", \"#FFF39B\");\n\t\t\t$(\"h1\").css(\"color\",\"#FF3B0E\");\n\t\t\t$(\"#Weather\").css(\"background-color\",\"#FFD255\");\n\t\t\t$(\"#WeatherTomorrow\").css(\"background-color\",\"#FFD255\");\n\t\t\t$(\"#GeoLocation\").css(\"background-color\",\"#FFD255\");\n\t\t\t$(\"#inhoud\").css(\"box-shadow\",\"0px 0px 15px rgba(59, 50, 50, 1)\");\n\t\t\t$(\"#weather\").css(\"box-shadow\",\"8px 6px 15px rgba(59, 50, 50, 0.63)\");\n\t\t\t$(\"#GeoLocation\").css(\"box-shadow\",\"8px 6px 15px rgba(59, 50, 50, 0.63)\");\n\t\tbreak;\n\tcase 'spring':\n\t\t\t$(\"#inhoud\").css(\"background-color\", \"#CEFF9B\");\n\t\t\t$(\"h1\").css(\"color\",\"#418300\");\n\t\t\t$(\"#Weather\").css(\"background-color\",\"#9AF243\");\n\t\t\t$(\"#WeatherTomorrow\").css(\"background-color\",\"#9AF243\");\n\t\t\t$(\"#GeoLocation\").css(\"background-color\",\"#9AF243\");\n\t\t\t$(\"#inhoud\").css(\"box-shadow\",\"0px 0px 15px rgba(59, 50, 50, 1)\");\n\t\t\t$(\"#weather\").css(\"box-shadow\",\"8px 6px 15px rgba(59, 50, 50, 0.63)\");\n\t\t\t$(\"#GeoLocation\").css(\"box-shadow\",\"8px 6px 15px rgba(59, 50, 50, 0.63)\");\n\t\tbreak;\n\tcase 'fall':\n\t\t\t$(\"#inhoud\").css(\"background-color\", \"#E6D3A5\");\n\t\t\t$(\"h1\").css(\"color\",\"#564316\");\n\t\t\t$(\"#Weather\").css(\"background-color\",\"#BB953E\");\n\t\t\t$(\"#WeatherTomorrow\").css(\"background-color\",\"#BB953E\");\n\t\t\t$(\"#GeoLocation\").css(\"background-color\",\"#BB953E\");\n\t\t\t$(\"#inhoud\").css(\"box-shadow\",\"0px 0px 15px rgba(59, 50, 50, 1)\");\n\t\t\t$(\"#weather\").css(\"box-shadow\",\"8px 6px 15px rgba(59, 50, 50, 0.63)\");\n\t\t\t$(\"#GeoLocation\").css(\"box-shadow\",\"8px 6px 15px rgba(59, 50, 50, 0.63)\");\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "494edc54079d02bd93cd5c5eec4ecdcf", "score": "0.47460282", "text": "function setActiveSection() {\n if (sections.length) {\n\n const currentActive = activeSection || sections[0];\n\n const newActive = [...sections].reduce(closerToTop, currentActive);\n\n if (currentActive.id !== newActive.id) {\n currentActive.classList.remove('your-active-class');\n newActive.classList.add('your-active-class');\n activeSection = newActive;\n }\n }\n}", "title": "" }, { "docid": "bdb2ebae3b55ceb3c8a0a1da4dbad7b9", "score": "0.4738345", "text": "function moveEditSection(){\n\tif (window.oldEditsectionLinks) return;\n\tfor (var i=1;i<7;i++){\n\t\tfor (var j=0,hs=document.getElementsByTagName('h'+i.toString());j<hs.length;j++){\n\t\t\tvar ss=$UT.getElementsByClassName('editsection', 'span', hs[j]);\n\t\t\tif (ss.length !== 0){\n\t\t\t\tss[0].className+=' editsection-nf';\n\t\t\t\tss[0].removeAttribute('style'); // BigButton fix\n\t\t\t\ths[j].appendChild(ss[0]);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bdb2ebae3b55ceb3c8a0a1da4dbad7b9", "score": "0.4738345", "text": "function moveEditSection(){\n\tif (window.oldEditsectionLinks) return;\n\tfor (var i=1;i<7;i++){\n\t\tfor (var j=0,hs=document.getElementsByTagName('h'+i.toString());j<hs.length;j++){\n\t\t\tvar ss=$UT.getElementsByClassName('editsection', 'span', hs[j]);\n\t\t\tif (ss.length !== 0){\n\t\t\t\tss[0].className+=' editsection-nf';\n\t\t\t\tss[0].removeAttribute('style'); // BigButton fix\n\t\t\t\ths[j].appendChild(ss[0]);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b08d19ca2932fc3c6de7d90dc156cf7e", "score": "0.47341365", "text": "function changeStyle() {\r\n document.getElementById(\"introParagraph\").style.fontFamily = \"courier\";\r\n}", "title": "" }, { "docid": "361bde8a067c9328620e00c21024a81c", "score": "0.47181413", "text": "updateScores(section) {\n if (section === 'score') {\n this._ui.scoreValue.text(this._game.right);\n } else if (section === 'time') {\n let time = this._game.secondsLeft >= 0 ? this._game.secondsLeft : 0;\n this._ui.timeLeft.text(time);\n }\n }", "title": "" }, { "docid": "b3a9a74f7bf1284671a4b55d1edfeb4f", "score": "0.47115126", "text": "function changeAppearanceByClass(className) {\n let elementClass = getByClass(className);\n let elementClassArray = Array.from(elementClass);\n\n function changeAppearance(item) {\n if (className === \"tocStandby\") {\n item.style.backgroundColor = tocBackgroundColor;\n } else if (className === \"style-two\") {\n item.style.backgroundImage = hrGradient;\n } else if (className === \"enlargeIcon\") {\n item.src = \"https://www.ndhfilms.com/assets/\" +\n \"images/enlargeicon_\" + typefaceColor + \".svg\";\n } else {\n item.style.color = typefaceColor;\n }\n if (className === \"illustrationDiv\") {\n item.style.backgroundColor = backgroundColor;\n }\n }\n elementClassArray.forEach(changeAppearance);\n }", "title": "" }, { "docid": "5d6e41c290a05279bd6a29a8b11c1a75", "score": "0.46912146", "text": "function styleSheetHandler(oneDevlang)\n{\n var devlang = (oneDevlang != \"\") ? oneDevlang : GetDevlangPreference();\n\n var sd = getStyleDictionary();\n\n // Ignore if not found (Help Viewer 2)\n if(typeof(sd['span.cs']) == \"undefined\")\n return;\n\n if (devlang == 'cs') {\n sd['span.cs'].display = 'inline';\n sd['span.vb'].display = 'none';\n sd['span.cpp'].display = 'none';\n sd['span.nu'].display = 'none';\n sd['span.fs'].display = 'none';\n } else if (devlang == 'vb') {\n sd['span.cs'].display = 'none';\n sd['span.vb'].display = 'inline';\n sd['span.cpp'].display = 'none';\n sd['span.nu'].display = 'none';\n sd['span.fs'].display = 'none';\n } else if (devlang == 'cpp') {\n sd['span.cs'].display = 'none';\n sd['span.vb'].display = 'none';\n sd['span.cpp'].display = 'inline';\n sd['span.nu'].display = 'none';\n sd['span.fs'].display = 'none';\n } else if (devlang == 'nu') {\n sd['span.cs'].display = 'none';\n sd['span.vb'].display = 'none';\n sd['span.cpp'].display = 'none';\n sd['span.nu'].display = 'inline';\n sd['span.fs'].display = 'none';\n } else if (devlang == 'fs') {\n sd['span.cs'].display = 'none';\n sd['span.vb'].display = 'none';\n sd['span.cpp'].display = 'none';\n sd['span.nu'].display = 'none';\n sd['span.fs'].display = 'inline';\n }\n}", "title": "" }, { "docid": "521ad4f430920be975c7b7376b3dffc9", "score": "0.4689966", "text": "function drawFavoritosHTMLSection() {\n sectionTop.className = \"sectionHidden\";\n sectionSearch.className = \"sectionHidden\";\n sectionTrendingTerms.className = \"sectionHidden\";\n myGifosSection.className = \"sectionHidden\";\n favoritesSection.className = \"favoritesSectionDisplayed\";\n linkFavoritos.style.color = \"#9CAFC3\";\n linkMyGifos.style.color = \"#572EE5\";\n\n}", "title": "" }, { "docid": "2cc523ee472ad77dbab956125f2ccccd", "score": "0.46874803", "text": "function setActiveClass(section){\n sections = getSections();\n for (let i = 0; i < sections.length; i++){\n if (sections[i] == section){\n if(sections[i].classList.contains(\"your-active-class\")==false){\n sections[i].classList.add(\"your-active-class\");\n }\n }\n else{\n if (sections[i].classList.contains(\"your-active-class\")){\n sections[i].classList.remove(\"your-active-class\");\n }\n }\n }\n}", "title": "" }, { "docid": "3d0de6eb61d16d6a3f7e0e4599fec053", "score": "0.4678497", "text": "function chooseSection(event) {\n var section = event.currentTarget;\n var sectionName = section.attributes[1].value;\n\n section.classList.add('active');\n\n for(var i = 0; i < sectionsAll.length; i++) {\n if(sectionsAll[i] != section) {\n sectionsAll[i].classList.remove('active');\n }\n }\n\n //choose whether on paintings/prints/shop content\n var contentItems = document.querySelectorAll('.content-item');\n var selector = \".content-item\" + \".\" + sectionName;\n var contentItem = document.querySelector(selector);\n\n for(var i = 0; i<contentItems.length; i++){\n contentItems[i].classList.remove('active');\n }\n contentItem.classList.add('active');\n\n}", "title": "" }, { "docid": "7b40e934991c0b30b6d70e5ab83a821f", "score": "0.46692947", "text": "function configureStyle(selector, splitLine) {\n\n //will need to parse out !important\n var isImportant = false;\n\n //as not to change the main variable\n var localSplit = splitLine[1];\n\n if (localSplit.indexOf('!important') !== -1) {\n isImportant = true;\n localSplit = localSplit.replace('!important', '');\n }\n\n //if it does not have a lessen or greaten indicator\n if (localSplit.indexOf('<') === -1 && localSplit.indexOf('>') === -1 && localSplit.indexOf('~') === -1) {\n var varDefProp = getVarDefProp(localSplit);\n //make sure this isn't an image we are changing the color of.\n if (!colorChangePerformed(selector, splitLine[0], varDefProp)) {\n //make the change & add back in !important if needed.\n getElementPerformFunction(selector, function (slctr) {\n slctr.setStyle(splitLine[0], varDefProp + ((isImportant) ? ' !important' : ''));\n });\n }\n }\n else {\n //color stuff\n if (localSplit.indexOf('<') !== -1) {\n var varDefProp = configureForHSL(localSplit, '<');\n //make sure this isn't an image we are changing the color of.\n if (!colorChangePerformed(selector, splitLine[0], varDefProp)) {\n //make the change & add back in !important if needed.\n getElementPerformFunction(selector, function (slctr) {\n slctr.setStyle(splitLine[0], varDefProp + ((isImportant) ? ' !important' : ''));\n });\n }\n }\n else if (localSplit.indexOf('>') !== -1) {\n var varDefProp = configureForHSL(localSplit, '>');\n //make sure this isn't an image we are changing the color of.\n if (!colorChangePerformed(selector, splitLine[0], varDefProp)) {\n //make the change & add back in !important if needed.\n getElementPerformFunction(selector, function (slctr) {\n slctr.setStyle(splitLine[0], varDefProp + ((isImportant) ? ' !important' : ''));\n });\n }\n }\n else if (localSplit.indexOf('~') !== -1) {\n var varDefProp = configureForHSL(localSplit, '~');\n //make sure this isn't an image we are changing the color of.\n if (!colorChangePerformed(selector, splitLine[0], varDefProp)) {\n //make the change & add back in !important if needed.\n getElementPerformFunction(selector, function (slctr) {\n slctr.setStyle(splitLine[0], varDefProp + ((isImportant) ? ' !important' : ''));\n });\n }\n }\n }\n}", "title": "" }, { "docid": "6ee3c8cd93e96a980628fa28a64dbb01", "score": "0.4652083", "text": "function handleStyle() {\n if (!active) {\n return themeContext.theme.background_primary;\n }\n if (type === \"add\") {\n return themeContext.theme.primary + 30;\n }\n if (type === \"delete\") {\n return themeContext.palette.secondary.main + 30;\n }\n }", "title": "" }, { "docid": "f73c06f8b9781e04352a0cc0b2c02e10", "score": "0.46350342", "text": "function changeContentArea(colour, isReadO, index) {\n titleArea[index].readOnly = isReadO;\n textArea[index].readOnly = isReadO; \n \n titleArea[index].style.backgroundColor = colour;\n textArea[index].style.backgroundColor = colour;\n}", "title": "" }, { "docid": "36b8e0ab65776d225c69c0357f730e44", "score": "0.46274853", "text": "addNewSection() {\n const prevSchedule = this.props.currentSchedule.slice();\n const titles = prevSchedule.map(e => ClassUtils.formatSectionNum(e));\n for (let Class of this.props.classData) {\n const classTitle = ClassUtils.formatClassTitle(Class.title);\n if (!titles.includes(classTitle)) {\n for (let section of Class.sections) {\n prevSchedule.push(section.sectionNum);\n break;\n }\n }\n }\n this.props.setCurrentSchedule(prevSchedule);\n }", "title": "" }, { "docid": "a425f5852fdd7fcd5ac59a67704edcca", "score": "0.46231738", "text": "function updatePageSection(){\n let sectionSizePercentage = 100 / NUMBER_OF_PAGE_SECTIONS;\n // Note: the *0.999 below is so we never get a value == NUMBER_OF_PAGE_SECTIONS. Hacky? Sure.\n var newSection = Math.floor(calculateScrollPercentage() / sectionSizePercentage * 0.999);\n \n if(newSection != gl_currentSection){\n gl_prevSection = gl_currentSection;\n gl_currentSection = newSection;\n onSectionTransition();\n }\n\n return newSection;\n}", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.4610279", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.4610279", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "483b964a5cc00aeba6b6ca4bc7808438", "score": "0.4603392", "text": "function changeColor() {\n switch(snakeExtraSegments / 10) {\n case 1: accentColor = '#99ff99'; break;\n case 2: accentColor = '#99ffff'; break;\n case 3: accentColor = '#00e6e6'; break;\n case 4: accentColor = '#0000e6'; break;\n case 5: accentColor = '#e6e600'; break;\n case 6: accentColor = '#e600e6'; break;\n case 7: accentColor = '#ff99ff'; break;\n case 9: accentColor = '#e60000'; break;\n case 8: accentColor = '#ff6666'; break;\n case 10:\n accentColor = '#ffc700';\n document.body.style.backgroundImage = 'url(\"Images/bg.jpg\")';\n break;\n }\n }", "title": "" }, { "docid": "930579e2247af0d3bc43ac79b8d50ac9", "score": "0.4600368", "text": "function _setStyleType(node) {\n\n //add our basic styles then do vendor prefixes\n _applyStyleModern(node);\n\n if (browser === 'msie') {\n if (browserVersion === 8) {\n _applyStyleIE8(node);\n } else if ((browserVersion === 9) || (browserVersion === 10)) {\n _applyStyleMs(node);\n }\n } else if (browser === 'chrome' || browser === 'opera' ) {\n _applyStyleWebkit(node);\n } else if (browser === 'safari') {\n _applyStyleSafari(node);\n\t\t} else if (browser === 'IE11' || browser === 'edge') {\n _applyStyleMs(node);\n } else if (browser === 'firefox') {\n //New download manager with arrow introducted in version 20\n if (browserVersion >= 20) {\n _applyStyleMoz(node);\n }\n }\n }", "title": "" }, { "docid": "26e3a58aeb6214839d7a13bc98237c57", "score": "0.45998913", "text": "function spreadjs_setdefaultstyle( sheet, color, linestyle){\n var defaultStyle = new GC.Spread.Sheets.Style();\n\t\tdefaultStyle.backColor = \"LemonChiffon\";\n\t\tdefaultStyle.hAlign = GC.Spread.Sheets.HorizontalAlign.center;\n defaultStyle.borderLeft = new GC.Spread.Sheets.LineBorder(color,linestyle);\n defaultStyle.borderTop = new GC.Spread.Sheets.LineBorder(color,linestyle);\n defaultStyle.borderRight = new GC.Spread.Sheets.LineBorder(color,linestyle);\n defaultStyle.borderBottom = new GC.Spread.Sheets.LineBorder(color,linestyle);\n sheet.setDefaultStyle(defaultStyle, GC.Spread.Sheets.SheetArea.viewport);\n}", "title": "" }, { "docid": "f29482e9f57e71c20a8422092d10e836", "score": "0.4587643", "text": "function changementDeStyle()\n{\n let p = document.querySelector(\"p\");\n p.style.backgroundColor = \"red\";\n p.style.color = \"white\";\n}", "title": "" }, { "docid": "acd894bd6dbe4e562639ba431813c817", "score": "0.45833576", "text": "function chSection(counter, moveRight, chSec) { \n const section_number = counter + (moveRight ? 1 : 0)\n console.log(`The section number is: ${section_number}.`);\n console.log(moveRight ? `Rolled down / clicked right.` : `Rolled Up / clicked left.`);\n document.querySelector(`.section-${counter}`).style.left = chSec;\n progressCounter(section_number);\n}", "title": "" }, { "docid": "ed9b7c3cfda8542f7fb4c62fe3fab0d4", "score": "0.4565334", "text": "function clsPfSection()\r\n{\r\n key = 0;\r\n \r\n ax = 0; //.. member's cross sectional area ..\r\n iz = 0; //.. member's second moment of area ..\r\n \r\n //Dependent on Material Properties\r\n t_len = 0; //.. TOTAL length of this section ..\r\n t_mass = 0; //.. TOTAL mass of this section ..\r\n mat = 0; //.. material of section ..\r\n \r\n Descr = \"\"; //.. section description string ..\r\n}", "title": "" }, { "docid": "7df6418cf3b510ed59a2bf69519c4385", "score": "0.45602348", "text": "function injectColor (sections) {\n\t\tfor (var i = sections.length - 1; i >= 0; i--) {\n\t\t\tvar this_section = sections[i];\n\t\t\tthis_section['color'] = colorDictionary[this_section['courseTitle']];\n\t\t}\n\t}", "title": "" }, { "docid": "a066d0ec4f7c0ba8a087b7ef33776857", "score": "0.455972", "text": "function changePlatoon() {\n setSections(vm.modifiedUser.platoon.id);\n vm.modifiedUser.section = {};\n }", "title": "" }, { "docid": "9a7b4948477f390cf5b8fc6ded85b038", "score": "0.4549623", "text": "function changeColorLogoWithViewPort(sectionAffected, colorDefinition, scrollTop) {\n // Jika 1 maka definisi colornya adalah default, sedangkan 0 maka warna biru \n if (colorDefinition) {\n changeColorLogoWithViewPortCondition(scrollTop, sectionAffected, 'rgb(62, 74, 110)');\n } else {\n changeColorLogoWithViewPortCondition(scrollTop, sectionAffected, 'rgb(0, 102, 255)');\n }\n }", "title": "" }, { "docid": "1bddb349c8a1f44adfa752750faa0610", "score": "0.45485893", "text": "function changeSectionTitleSize() {\n var sectionTitleSize = (getRandomRangeInt(220, 276) / 100).toFixed(3);\n root.style.setProperty(\"--section-title-size\", sectionTitleSize + \"em\");\n }", "title": "" }, { "docid": "32618af6752967654df344604efc9626", "score": "0.45336252", "text": "function configureStyles(){\n scope.options['styles'] = scope.options['styles'] || {};\n\n angular.forEach(defaultStyles(), function(value, key){\n if (scope.options['styles'][key] === undefined || scope.options['styles'][key] === null) scope.options['styles'][key] = value;\n });\n\n angular.forEach(scope.options['styles'].classes, function(value, key){\n value ? element.addClass(key) : element.removeClass(key);\n });\n\n element.removeAttr('style').css(scope.options['styles'].css);\n }", "title": "" }, { "docid": "ccda0ce82042557b2244f4369d4db11c", "score": "0.4530164", "text": "function changeColor(color) {\n header.style.backgroundColor = color;\n for(var i = 0; i < squares.length; i++)\n squares[i].style.backgroundColor = color;\n}", "title": "" }, { "docid": "49b692776f5ed973f80b17c77e7d367b", "score": "0.4528184", "text": "set defaultStyle(style) {\n this._defaultStyle = style;\n }", "title": "" }, { "docid": "875e9d226cd53e18cf0c9157e1676350", "score": "0.4513594", "text": "function changeSectionText(mode){\n let chm1 = document.getElementById(\"change-mode1\");\n let chm2 = document.getElementById(\"change-mode2\");\n let fav = document.getElementById(\"favoritos\");\n let misg = document.getElementById(\"mis-gifos\");\n let create = document.getElementById(\"create-button\");\n console.log(mode)\n //let gifosResults = document.getElementsByClassName(\"gifos-results\");\n if(mode === \"desktop\"){\n console.log(\"sections to uppercase\")\n chm1.style.textTransform = 'uppercase';\n chm2.style.textTransform = 'uppercase';\n fav.style.textTransform = 'uppercase';\n misg.style.textTransform = 'uppercase'; \n if(!modoNoc){\n fav.style.color = '#572EE5';\n misg.style.color = '#572EE5';\n create.src = \"images/button-crear-gifo.svg\";\n }\n } else{\n console.log(\"sections to initial\")\n chm1.style.textTransform = 'initial';\n chm2.style.textTransform = 'initial';\n fav.style.textTransform = 'initial';\n misg.style.textTransform = 'initial';\n // verifico el estado del menu tras volver de un resizing de modo\n let menu = document.getElementById(\"menu-options\"); \n if (!menu.classList.contains(\"disabled\")){\n menu.classList.add(\"disabled\");\n btn_close.classList.add(\"disabled\");\n btn_hamburger.classList.remove(\"disabled\");\n }\n fav.style.color = '#FFFFFF';\n misg.style.color = '#FFFFFF'; \n }\n switchingAmpliarGif();\n}", "title": "" }, { "docid": "c0da9a9474fe1253a198cb7454990291", "score": "0.4513448", "text": "function setActiveSection(){\n visibleSectionIndex = getVisibleSectionIndex();\n\n // If visibleSection exists\n if(visibleSectionIndex != -1){\n // create a list of Atags from navigation menu\n let navATags = document.querySelectorAll('.menu__link');\n\n // Loop through all section\n for (let i = 0; i < sections.length; i++) {\n //Add active state to the section and navigation\n if (i == visibleSectionIndex){\n sections[i].classList.add('your-active-class');\n navATags[i].classList.add('your-active-class');\n }\n // Remove active state from the section and navigation\n else{\n sections[i].classList.remove('your-active-class');\n navATags[i].classList.remove('your-active-class');\n }\n }; \n };\n}", "title": "" }, { "docid": "e009fdd5635802c4caf359d3b9d6fdbc", "score": "0.45131597", "text": "function setStyle(func) {\n self.arealayer.setStyle(func);\n }", "title": "" }, { "docid": "cda3d923eb8525a7ef5d9b4a48a8b32f", "score": "0.45102397", "text": "setStyle(style) {\n super.setStyle(style);\n this.note_heads.forEach(notehead => notehead.setStyle(style));\n this.stem.setStyle(style);\n }", "title": "" }, { "docid": "b382fa2eb4689680c088fff6a2740aac", "score": "0.45066246", "text": "function limpiaSection(section){\n $(section).find('input').not(':button, :submit, :reset').val('');\n if (section == \"#direccionDatos\"){\n $('#estado')[0].selectedIndex = 0;\n traerMunicipios();\n traerLocalidades();\n } else if (section == \"#registroTelefonos\"){\n $('#tipoTelefono').prop('value','casa');\n $('#registroTelefonos #contTelefono').html('<div class=\"form-group col-md-12 col-sm-12\"><input type=\"text\" id=\"numTelefono\" class=\"form-control solo-numero\" placeholder=\"Número:\" maxlength=\"10\" onpaste=\"soloNumeros()\"/></div>');\n }\n $('select')[0].selectedIndex = 0;\n $(section).find('.btnChk').removeClass('active');\n $(section).find(':radio').prop('checked',false);\n $(section).find('.borrar').prop('disabled', true);\n $(section).find('.btnAñade').html('Añadir');\n $(section).find('input:visible:first').focus();\n $(section).find('.btnClean').removeClass('active');\n}", "title": "" }, { "docid": "a97c403fc03c86cdba01d686306855da", "score": "0.4504402", "text": "function toggleElement(id) { //id = id of section that the button should trigger\n\tvar idIn = document.getElementById(id);\n\tidIn.style.visibility = idIn.style.visibility == \"visible\" ? \"hidden\" : \"visible\"; // logic statement\n\n\tif (idIn.style.visibility == \"visible\") { // changing margin of section that suppose to be shown\n\t\tidIn.style.marginTop = \"30px\";\n\t}\n\tif (idIn.style.visibility == \"hidden\") { // changing maring of sections that suppose to be hiddent.\n\t\t// Not all sections are equal therefore there is a difference in maring size\n\t\tswitch (id) { // Switch to find correct length of margin\n\t\t\tcase id = \"section-selection-1\":\n\t\t\t\tidIn.style.marginTop = \"-65px\";\n\t\t\t\tbreak;\n\t\t\tcase id = \"section-selection-2\":\n\t\t\t\tidIn.style.marginTop = \"-65px\";\n\t\t\t\tbreak;\n\t\t\tcase id = \"section-selection-3\":\n\t\t\t\tidIn.style.marginTop = \"-40px\";\n\t\t\t\tbreak;\n\t\t\tcase id = \"section-selection-4\":\n\t\t\t\tidIn.style.marginTop = \"-40px\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "f7a39edae29fc3adb19c48683317d817", "score": "0.44979587", "text": "function add_section_to_calendar(section) {\n\tfor(var t = 0; t < section.times.length; t++) {\n\t\tvar time = section.times[t];\n\n\t\tfor(var d = 0; d < time.days.length; d++) {\n\t\t\tvar day = time.days[d];\n\n\t\t\tif(day == \"M\") day = \"mon\"\n\t\t\tif(day == \"T\") day = \"tue\"\n\t\t\tif(day == \"W\") day = \"wed\"\n\t\t\tif(day == \"R\") day = \"thu\"\n\t\t\tif(day == \"F\") day = \"fri\"\n\n\t\t\t$(\"#calendar\").append(\"<div style='display: none' rel='\" + section.crn + \"' class='course \" + section.crn + \" \" + day + \"'></div>\")\n\n\t\t\t$(\"#calendar div.course.\" + section.crn).fadeIn();\n\t\t}\n\t}\n\t\n\t$(\"#calendar .\" + section.crn).append(section.title).css(\"height\", time.endPixel-time.startPixel).css(\"top\", time.startPixel + \"px\");\n}", "title": "" }, { "docid": "2832466c614ef5a03cbd9fbbae1a9c2b", "score": "0.4481621", "text": "function updateStyle (filename, style, value) {\n\n\t\tvar file = info.files[filename];\n\t\tfile.styles[style] = value;\n\t\tsyncInfo();\n\n\t}", "title": "" }, { "docid": "d578cb511417e1a576d9ecb106c926bb", "score": "0.447907", "text": "function changeStyle(){\n var parTag = document.getElementsByTagName(\"p\"); //Get all <p> tag in html document\n\n //parTag[0].style.background =\"red\";\n //var changeParText = parTag[1].style.fontStyle = \"italic\";\n //parTag[3].style.fontStyle = \"italic\";\n for(var i = 1; i<parTag.length; i+=2){\n parTag[i].style.background =\"red\";\n parTag[i].style.fontStyle = \"italic\";\n parTag[i-1].style.background =\"blue\";\n parTag[i-1].style.fontWeight= \"bold\";\n }\n}", "title": "" }, { "docid": "68ffbbc4421d168a2b17a232f12aae58", "score": "0.44758388", "text": "function finalStyle() {\n if (styleChange === 1) {\n return {\n fontSize: pixelChange,\n backgroundColor: \"#ee82ee\",\n fontFamily: \"Fredoka One, cursive\"\n };\n }\n if (styleChange === 2) {\n return {\n fontSize: pixelChange,\n backgroundColor: \"#70ed84\",\n fontFamily: \"Lexend Mega, sans-serif\"\n };\n }\n if (styleChange === 3) {\n return {\n fontSize: pixelChange,\n backgroundColor: \"#41a3f2\",\n fontFamily: \"Shadows Into Light, cursive\"\n };\n }if(styleChange === 4) \n {\n return {\n fontSize:pixelChange,\n BackGroundColor:'white',\n fontFamily:'sans-serif'\n }\n }else {\n return {\n fontSize: pixelChange,\n backgroundColor:'none'\n };\n }\n }", "title": "" }, { "docid": "8302c6117e8511c7c3683b0e778da3ce", "score": "0.44758278", "text": "function jsonSection(menu, theme, setting, mapping){\n var headerFont = theme.headerFontColor;\n var json = new StringBuilder();\n json.append('\"section\" : [');\n // Create Section from breakingNews\n json.append(jsonBreakingNews(setting.breakingNews, mapping.setting.breakingNews));\n json.append(\",\");\n // Create Section from Menu\n json.append(jsonMenu(menu, mapping));\n json.append(\"]\")\n return json.toString();\n}", "title": "" }, { "docid": "835b0a26dccfd4c4adf06222b13a24d1", "score": "0.4468886", "text": "function addNewSection() {\n section.addNewSection();\n menu.buildMenu();\n}", "title": "" }, { "docid": "0a830e1407249071036b93d08a9d67ec", "score": "0.4468736", "text": "function SectionToggle(props) {\n const selectedLabel = props.selectedLabel || 'Selected';\n const recentLabel = props.selectedLabel || 'Since 2018';\n const invitedLabel = props.selectedLabel || 'Invited';\n const buttonStyle = { borderColor: ColorCode[props.selectColor] };\n const selectedStyle = { ...buttonStyle, fontWeight: 'bold', backgroundColor: ColorCode[props.selectColor] };\n const deselectedStyle = {\n ...buttonStyle,\n fontWeight: 'normal',\n color: ColorCode[props.selectColor],\n backgroundColor: ColorCode.background,\n };\n const [selectStyle, setSelectStyle] =\n useState((props.toggleSetting === 'all') ? deselectedStyle : selectedStyle);\n const [recentStyle, setRecentStyle] =\n useState((props.toggleSetting === 'recent') ? selectedStyle : deselectedStyle);\n const [invitedStyle, setInvitedStyle] =\n useState((props.toggleSetting === 'invited') ? selectedStyle : deselectedStyle);\n const [allStyle, setAllStyle] =\n useState((props.toggleSetting === 'all') ? selectedStyle : deselectedStyle);\n\n const onClick = (buttonName) => {\n if (buttonName === 'selected') {\n setSelectStyle(selectedStyle);\n setRecentStyle(deselectedStyle);\n setInvitedStyle(deselectedStyle);\n setAllStyle(deselectedStyle);\n props.onClick('selected');\n } else\n if (buttonName === 'recent') {\n setSelectStyle(deselectedStyle);\n setRecentStyle(selectedStyle);\n setInvitedStyle(deselectedStyle);\n setAllStyle(deselectedStyle);\n props.onClick('recent');\n } else\n if (buttonName === 'invited') {\n setSelectStyle(deselectedStyle);\n setRecentStyle(deselectedStyle);\n setInvitedStyle(selectedStyle);\n setAllStyle(deselectedStyle);\n props.onClick('invited');\n } else\n if (buttonName === 'all') {\n setSelectStyle(deselectedStyle);\n setRecentStyle(deselectedStyle);\n setInvitedStyle(deselectedStyle);\n setAllStyle(selectedStyle);\n props.onClick('all');\n }\n };\n\n return (\n <Row style={{ marginBottom: '1em' }} className=\"justify-content-center\">\n <ButtonGroup aria-label=\"Basic example\">\n <Button onClick={() => onClick('selected')} style={selectStyle}>{selectedLabel}</Button>\n <Button onClick={() => onClick('recent')} style={recentStyle}>{recentLabel} ({props.recentCount})</Button>\n <Button onClick={() => onClick('invited')} style={invitedStyle}>{invitedLabel} ({props.invitedCount})</Button>\n <Button onClick={() => onClick('all')} style={allStyle}>All ({props.total})</Button>\n </ButtonGroup>\n </Row>\n );\n}", "title": "" }, { "docid": "5ed11403d39d60dc2a160f309b7a707f", "score": "0.44574386", "text": "function changeStyle(style){\n\tvar file = tmplurl+'/css/style'+style+'.css';\n\tnew Asset.css(file);\n\tnew Cookie.set('gk45_style',style,{duration: 200,path: \"/\"});\n\t(function(){if(CufonCheck()) Cufon.refresh();}).delay(500);\n}", "title": "" }, { "docid": "4ab0046bb605b9c5a84c26f8e052b73c", "score": "0.44560948", "text": "function setStatusStyle(status) {\n switch (status) {\n case 'Publicado':\n return 'published'\n case 'Agendado':\n return 'scheduled'\n case 'Arquivado':\n return 'archived'\n }\n}", "title": "" }, { "docid": "a6eeb20cfa8609b3b29c1b4a119c94bf", "score": "0.44410452", "text": "function updateConfig( section ) {\n\n\t\tvar sectionvalues = section.find( \"input\" );\n\n\t\tvar update = [ section.attr( \"id\" ) ];\n\n\t\tfor ( var i = 0; i < sectionvalues.length; i++ ) {\n\n\t\t\tupdate.push( $( sectionvalues[i] ).val() );\n\t\t};\n\n\t\tvar updatejson = JSON.stringify( update );\n\n\t\t$.post( \"/updateconfig\", updatejson, function( response ) {\n\n\t\t\tpopulateTable( section, response );\n\n\t\t}, \"json\" );\n\t}", "title": "" }, { "docid": "62b8bf468e2d840691204b1823cb41d0", "score": "0.44389758", "text": "function addSection( section, left, title ){\n var s1 = UT.newRel(\"100%\", \"150px\");\n s1.style.overflow = \"hidden\";\n section.appendChild( s1 ); \n UT.setBG(s1, GREY_1 );\n var t1 = document.createElement(\"p\");\n t1.style.margin = \"0\";\n t1.style.border = \"0\";\n t1.style.padding = \"0\";\n t1.style.fontSize = \"30px\";\n t1.innerHTML = title;\n t1.style.fontWeight = \"600\";\n t1.style.display = \"block\"; //UT.setBor(t1, \"1px solid black\");\n t1.style.textAlign = \"center\";\n UT.setBG(t1, GREY_1 );\n s1.appendChild( t1 ); \n w = left;\n var s1A = UT.newAbs((w)+\"%\", \"100%\");\n s1A.style.display = \"inline-block\";\n UT.setT( s1A , \"40px\"); \n UT.setBG(s1A, GREY_2 );\n var v1_button = UT.quickBtn(); \n v1_button.style.borderRadius = \"20px\";\n v1_button.style.border = \"7px solid \" + GREY_1;\n UT.setT( v1_button , \"calc(50% - 50px)\"); \n UT.setL( v1_button , \"calc(50% - 30px)\"); \n UT.setPos( v1_button , \"absolute\"); \n UT.setBG( v1_button , \"transparent\"); \n v1_button.style.cursor = \"\";\n s1A.appendChild( v1_button ); \n s1.appendChild( s1A );\n w2 = 100 - w;\n var s1B = UT.newAbs((w2)+\"%\", \"100%\");\n s1B.style.left = w+\"%\";\n s1B.style.display = \"inline-block\";\n UT.setBG(s1B, \"silver\" );\n UT.setT( s1B , \"40px\"); \n var t2 = document.createElement(\"p\");\n t2.style.fontSize = \"16px\";\n t2.innerHTML = \"sdf\";\n t2.style.margin = \"0\";\n t2.style.verticalAlign = \"top\";\n t2.style.border = \"0\";\n t2.style.paddingLeft = \"15px\";\n t2.style.paddingTop = \"15px\";\n t2.style.display = \"block\";\n t2.style.height = \"100%\";\n //t2.style.textAlign = \"center\"; \n s1B.appendChild( t2 ); \n s1.appendChild( s1B );\n return [s1A, s1B, v1_button, t2];\n \n }", "title": "" }, { "docid": "5e0fc986614d53e534f9e5bb03e30407", "score": "0.4437959", "text": "function GEN_change_layer_style_externally(input_layer,style_obj){\nvar obj=input_layer[\"_layers\"];\nfor(var key in obj) {\n \n obj[key].setStyle(style_obj);\n}\n}", "title": "" } ]
3abc0aeae1447bad31024bcc54980c6d
Wraps fromDotSeparatedString with an error message about the method that was thrown.
[ { "docid": "f102c5893f20ece2607139eea6eb160e", "score": "0.54048425", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\n try {\n return fromDotSeparatedString(path)._internalPath;\n } catch (e) {\n var message = errorMessage(e);\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\n }\n}", "title": "" } ]
[ { "docid": "99bd5888ae7c430313b0bf3c5cd3740b", "score": "0.5779567", "text": "errorMessageModifier(value, errors) { }", "title": "" }, { "docid": "1a352ad4a4fb4e23623f813bd1eabc84", "score": "0.5632988", "text": "error(message, options = {}) {\n var first_column, first_line, location, ref, ref1;\n location = 'first_line' in options ? options : ([first_line, first_column] = this.getLineAndColumnFromChunk((ref = options.offset) != null ? ref : 0), {\n first_line,\n first_column,\n last_column: first_column + ((ref1 = options.length) != null ? ref1 : 1) - 1\n });\n return throwSyntaxError(message, location);\n }", "title": "" }, { "docid": "2848b7a50b202d7a3cf3f0206f34f08e", "score": "0.55212015", "text": "function eatDottedName(errorMessage) {\n\t\t\t\tif (!errorMessage) {\n\t\t\t\t\terrorMessage = 'not expected token';\n\t\t\t\t}\n\t\t\t\tvar result = [];\n\t\t\t\tvar name = nextToken();\n\t\t\t\tif (!isKind(name,tokenKinds.IDENTIFIER)) {\n\t\t\t\t\tthrow {'msg':errorMessage,'start':name.start};\n\t\t\t\t}\n\t\t\t\tresult.push(name);\n\t\t\t\twhile (peekToken(tokenKinds.DOT)) {\n\t\t\t\t\tif (!isNextTokenAdjacent()) {\n\t\t\t\t\t\tthrow {'msg':'no whitespace in dotted name','start':name.start};\n\t\t\t\t\t}\n\t\t\t\t\tresult.push(nextToken()); // consume dot\n\t\t\t\t\tif (peekToken(tokenKinds.IDENTIFIER) && !isNextTokenAdjacent()) {\n\t\t\t\t\t\tthrow {'msg':'no whitespace in dotted name','start':name.start};\n\t\t\t\t\t}\n\t\t\t\t\tresult.push(eatToken(tokenKinds.IDENTIFIER));\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}", "title": "" }, { "docid": "9a5aeba60c70e21400e37ab7849e6d59", "score": "0.5453266", "text": "function error() {\n return when.reject(util.format.apply(util, arguments));\n}", "title": "" }, { "docid": "6ec9e477cbf78c5c2f4f475e184a9025", "score": "0.5436987", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\n try {\n return fromDotSeparatedString(path)._internalPath;\n }\n catch (e) {\n var message = errorMessage(e);\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\n }\n}", "title": "" }, { "docid": "6ec9e477cbf78c5c2f4f475e184a9025", "score": "0.5436987", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\n try {\n return fromDotSeparatedString(path)._internalPath;\n }\n catch (e) {\n var message = errorMessage(e);\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\n }\n}", "title": "" }, { "docid": "6ec9e477cbf78c5c2f4f475e184a9025", "score": "0.5436987", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\n try {\n return fromDotSeparatedString(path)._internalPath;\n }\n catch (e) {\n var message = errorMessage(e);\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\n }\n}", "title": "" }, { "docid": "2ce0fe01dab18821981b8ecb15590e56", "score": "0.54048157", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\r\n try {\r\n return fromDotSeparatedString(path)._internalPath;\r\n }\r\n catch (e) {\r\n var message = errorMessage(e);\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\r\n }\r\n}", "title": "" }, { "docid": "2ce0fe01dab18821981b8ecb15590e56", "score": "0.54048157", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\r\n try {\r\n return fromDotSeparatedString(path)._internalPath;\r\n }\r\n catch (e) {\r\n var message = errorMessage(e);\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\r\n }\r\n}", "title": "" }, { "docid": "2ce0fe01dab18821981b8ecb15590e56", "score": "0.54048157", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\r\n try {\r\n return fromDotSeparatedString(path)._internalPath;\r\n }\r\n catch (e) {\r\n var message = errorMessage(e);\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\r\n }\r\n}", "title": "" }, { "docid": "2ce0fe01dab18821981b8ecb15590e56", "score": "0.54048157", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\r\n try {\r\n return fromDotSeparatedString(path)._internalPath;\r\n }\r\n catch (e) {\r\n var message = errorMessage(e);\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\r\n }\r\n}", "title": "" }, { "docid": "2df1e8431ecef3ad7b724efde2e94f7a", "score": "0.53940016", "text": "function fieldPathFromDotSeparatedString(methodName, path) {\n try {\n return (0, _field_path.fromDotSeparatedString)(path)._internalPath;\n } catch (e) {\n var message = errorMessage(e);\n throw new _error.FirestoreError(_error.Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\n }\n}", "title": "" }, { "docid": "90b680099ca252daea25dacd8498b422", "score": "0.5359278", "text": "function normalizeErrorMessage(message) {\n if (newErrorFormat) {\n const match = message.match(regex);\n if (match) {\n return `Cannot read properties of ${match[2]} (reading '${match[1]}')`;\n }\n }\n\n return message;\n}", "title": "" }, { "docid": "9a33feaa1a501443637a4a22e6994ac4", "score": "0.53489625", "text": "function throwError(string) {\n switch (string) {\n case 'command':\n throw new Error(\"Unrecognized command.\");\n case 'args':\n throw new Error(\"Too many arguments.\");\n case 'no address':\n throw new Error(\"Must assign an address if you use the -p command.\");\n case 'port_table':\n throw new Error(\"This address does not exist in the port table.\");\n case 'folder':\n throw new Error(\"This file is not in an appropriate peerX-Y folder.\");\n }\n}", "title": "" }, { "docid": "266012df28379f504a432fa830f512b2", "score": "0.5320698", "text": "throwInformativeError(prependedMessage, err) {\n if (typeof err === 'string') {\n err = new Error(err);\n }\n err.message = `[${prependedMessage}] ${err.message}`;\n throw err;\n }", "title": "" }, { "docid": "8a0bd9e8f087a233738e2e040b6e7be0", "score": "0.52733576", "text": "error(message, options) {\n if (options == null) { options = {}; }\n const location = (() => {\n if ('first_line' in options) {\n return options;\n }\n const [first_line, first_column] = this.getLineAndColumnFromChunk(options.offset != null ? options.offset : 0);\n return { first_line, first_column, last_column: (first_column + (options.length != null ? options.length : 1)) - 1 };\n })();\n return throwSyntaxError(message, location);\n }", "title": "" }, { "docid": "9e4e637c86399e5015fdb4bdea872520", "score": "0.5256948", "text": "function throwWhenStringWithLength(variable, message, errorConstructor = Error) {\n if (isFunctions_1.isStringWithLength(variable)) {\n throwException(message, errorConstructor);\n }\n return variable;\n}", "title": "" }, { "docid": "768c9b8d3033cc946eb4baa40fdb6819", "score": "0.52378416", "text": "function error(msg) {\r\n throw \"Parse error\" + (line || line === 0 ? \" on line \" + (line + 1) : \"\") + \": \" + msg; \r\n }", "title": "" }, { "docid": "35614d28a73dcdf221c31540e1d1c094", "score": "0.52346396", "text": "function errorSelector(message) {\n return throwingSelector(message);\n}", "title": "" }, { "docid": "c858e5d68bcc6ea0d31ebcb426caad32", "score": "0.52190006", "text": "function CustomError() {}", "title": "" }, { "docid": "bf36d039fd9bf1572c9b31ef7d97b99c", "score": "0.5208619", "text": "function throwWhenString(variable, message, errorConstructor = Error) {\n if (isFunctions_1.isString(variable)) {\n throwException(message, errorConstructor);\n }\n return variable;\n}", "title": "" }, { "docid": "74379fbf923230404f767b633bdf36c6", "score": "0.5170414", "text": "function pError(str) {\r\n\t\t\tthrow new dError('Parser error: ' + str);\r\n\t\t}", "title": "" }, { "docid": "16adef95c738771f7a63804d592b0089", "score": "0.5130185", "text": "error(message, ...args) { }", "title": "" }, { "docid": "16adef95c738771f7a63804d592b0089", "score": "0.5130185", "text": "error(message, ...args) { }", "title": "" }, { "docid": "0e270eada65bf270c580c6f850bdbcac", "score": "0.5129157", "text": "function error(message) {\n throw {\n name: 'SyntaxError',\n message: message,\n at: at,\n text: text\n };\n}", "title": "" }, { "docid": "5af6f1005509513b9fea45c5f2ee6888", "score": "0.5125961", "text": "function errorParamMessage(funcName, paramName, type, expected) {\n return 'In function '+funcName+': '+paramName+' of type \\''+type+\n '\\'\\nExpected: '+expected;\n }", "title": "" }, { "docid": "4bedb8a5ce16919ab010c15931980b56", "score": "0.51089245", "text": "function raise(token) {\n var message = sprintf.apply(null, slice.call(arguments, 1))\n , error, col;\n\n if (token === null || typeof token.line === 'undefined') {\n col = index - lineStart + 1;\n error = fixupError(new SyntaxError(sprintf('[%1:%2] %3', line, col, message)));\n error.index = index;\n error.line = line;\n error.column = col;\n } else {\n col = token.range[0] - token.lineStart;\n error = fixupError(new SyntaxError(sprintf('[%1:%2] %3', token.line, col, message)));\n error.line = token.line;\n error.index = token.range[0];\n error.column = col;\n }\n throw error;\n }", "title": "" }, { "docid": "ee9f5cef9046fe1c094a8b67b781ebe4", "score": "0.51012695", "text": "function err(string, params, code) {\n // Allow callng as err(string, code)\n if (typeof params === 'number') {\n code = params;\n params = undefined;\n }\n var error = new LogoError('ERROR', undefined, format(__(string), params));\n if (code !== undefined)\n error.code = code;\n return error;\n }", "title": "" }, { "docid": "e23bc0d28e4ea826eb3b37dc15d8408b", "score": "0.50788736", "text": "function ParseError(message, start, end, next) {\n\t\tthis.message = message;\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.next = next;\n\t}", "title": "" }, { "docid": "6c22dd6efedef663959116f6bdf1802a", "score": "0.50479126", "text": "function composeLabel() {\n\t\t\t// Is the error anonimized by the browser because of CORS?\n\t\t\tif (message.indexOf('Script error.') > -1) {\n\t\t\t\treturn \"Error in external script. CORS prevents more info.\";\n\t\t\t}\n\n\t\t\t// Does the browser support the extended ErrorEvent interface?\n\t\t\tif (errorObject && errorObject.stack) {\n\t\t\t\treturn errorObject.stack;\n\t\t\t}\n\n\t\t\t// Create the full location of the error\n\t\t\tvar location = url + ':' + line;\n\t\t\tif (column){\n\t\t\t\tlocation += ':' + column;\n\t\t\t}\n\n\t\t\t// Strip off the 'Uncaught' part of the message if it's there\n\t\t\t// to make the message resemble a stack trace\n\t\t\tvar prefix = 'Uncaught ';\n\t\t\tif (message.indexOf(prefix) === 0) {\n\t\t\t\tmessage = message.substr(prefix.length);\n\t\t\t}\n\n\t\t\t// Combine with a line break and a tab to resemble a stack trace\n\t\t\treturn message + \"\\n\\tat \" + location;\n\t\t}", "title": "" }, { "docid": "d239c27e9807f2890a55db3a6298b7f0", "score": "0.5034197", "text": "function OptError(msg) {\n return new function() {\n this.msg = msg;\n this.toString = function() {\n return this.msg;\n }\n }\n}", "title": "" }, { "docid": "005404415ec25e137465b73cead8015b", "score": "0.50082475", "text": "function caml_raise_with_string (tag, msg) {\n caml_raise_with_arg (tag, caml_new_string (msg));\n}", "title": "" }, { "docid": "005404415ec25e137465b73cead8015b", "score": "0.50082475", "text": "function caml_raise_with_string (tag, msg) {\n caml_raise_with_arg (tag, caml_new_string (msg));\n}", "title": "" }, { "docid": "58cd929dcc131c2843db13e8c03fdca5", "score": "0.49734932", "text": "function formatError() {\r\n\t\terror(format.apply(this, arguments));\r\n\t}", "title": "" }, { "docid": "2cdb0c7edaf6a9d04a4c17b91d4d8ae0", "score": "0.49330068", "text": "function formatError(errorType, message, method) {\n if (typeof(message) == \"object\" && message.errorType) return message;\n return {errorType: errorType, message: message, method: method}\n}", "title": "" }, { "docid": "c96eba5f57624bb9a20c59420b3f2584", "score": "0.4926908", "text": "function error(desc) {\n\n}", "title": "" }, { "docid": "c5340491fbe299ccca0db3fe0c794a04", "score": "0.49220675", "text": "getErrorMessage() {}", "title": "" }, { "docid": "e04758405467caca28756ee825b8562a", "score": "0.4902252", "text": "function formatErrorMessage(message)\n{\n var msg = '';\n\n for (i = 0; i < message.length; i++)\n msg += '&middot;&nbsp;' + ucFirst(message[i]) + \"<br/>\";\n\n return msg;\n}", "title": "" }, { "docid": "bb1f411b7a78594369b79aba5d1848b3", "score": "0.48927948", "text": "error(message, index = null) {\n this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location));\n this.skip();\n }", "title": "" }, { "docid": "ced208ded1c7730f7ee2c13e72311c57", "score": "0.486096", "text": "function throwE(token,...msgs){\n let s = msgs.join(\"\");\n throw Error(!token ? `${s} near EOF` : `${s} near line: ${token.line}`) }", "title": "" }, { "docid": "b4a3641f07cedaddb34665230ccb819d", "score": "0.485003", "text": "error(message, index = null) {\n this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location));\n this.skip();\n }", "title": "" }, { "docid": "bc6c3a398867287f2b4e2b1a4e9ec53a", "score": "0.48451793", "text": "[custom]() {\n return `RestError: ${this.message} \\n ${errorSanitizer.sanitize(this)}`;\n }", "title": "" }, { "docid": "bc6c3a398867287f2b4e2b1a4e9ec53a", "score": "0.48451793", "text": "[custom]() {\n return `RestError: ${this.message} \\n ${errorSanitizer.sanitize(this)}`;\n }", "title": "" }, { "docid": "f6505a96bf631db445853d750e6341d5", "score": "0.48419026", "text": "function formatMessage(message) {\n let lines = message.split('\\n');\n\n // Strip Webpack-added headers off errors/warnings\n // https://github.com/webpack/webpack/blob/master/lib/ModuleError.js\n lines = lines.filter(line => !/Module [A-z ]+\\(from/.test(line));\n\n // Transform parsing error into syntax error\n // TODO: move this to our ESLint formatter?\n lines = lines.map(line => {\n const parsingError = /Line (\\d+):(?:(\\d+):)?\\s*Parsing error: (.+)$/.exec(\n line\n );\n if (!parsingError) {\n return line;\n }\n const [, errorLine, errorColumn, errorMessage] = parsingError;\n return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;\n });\n\n message = lines.join('\\n');\n // Smoosh syntax errors (commonly found in CSS)\n message = message.replace(\n /SyntaxError\\s+\\((\\d+):(\\d+)\\)\\s*(.+?)\\n/g,\n `${friendlySyntaxErrorLabel} $3 ($1:$2)\\n`\n );\n // Remove columns from ESLint formatter output (we added these for more\n // accurate syntax errors)\n message = message.replace(/Line (\\d+):\\d+:/g, 'Line $1:');\n // Clean up export errors\n message = message.replace(\n /^.*export '(.+?)' was not found in '(.+?)'.*$/gm,\n `Attempted import error: '$1' is not exported from '$2'.`\n );\n message = message.replace(\n /^.*export 'default' \\(imported as '(.+?)'\\) was not found in '(.+?)'.*$/gm,\n `Attempted import error: '$2' does not contain a default export (imported as '$1').`\n );\n message = message.replace(\n /^.*export '(.+?)' \\(imported as '(.+?)'\\) was not found in '(.+?)'.*$/gm,\n `Attempted import error: '$1' is not exported from '$3' (imported as '$2').`\n );\n lines = message.split('\\n');\n\n // Remove leading newline\n if (lines.length > 2 && lines[1].trim() === '') {\n lines.splice(1, 1);\n }\n // Clean up file name\n lines[0] = lines[0].replace(/^(.*) \\d+:\\d+-\\d+$/, '$1');\n\n // Cleans up verbose \"module not found\" messages for files and packages.\n if (lines[1] && lines[1].indexOf('Module not found: ') === 0) {\n lines = [\n lines[0],\n lines[1]\n .replace('Error: ', '')\n .replace('Module not found: Cannot find file:', 'Cannot find file:'),\n ];\n }\n\n // Add helpful message for users trying to use Sass for the first time\n if (lines[1] && lines[1].match(/Cannot find module.+node-sass/)) {\n lines[1] = 'To import Sass files, you first need to install node-sass.\\n';\n lines[1] +=\n 'Run `npm install node-sass` or `yarn add node-sass` inside your workspace.';\n }\n\n lines[0] = chalk.inverse(lines[0]);\n\n message = lines.join('\\n');\n // Internal stacks are generally useless so we strip them... with the\n // exception of stacks containing `webpack:` because they're normally\n // from user code generated by Webpack. For more information see\n // https://github.com/facebook/create-react-app/pull/1050\n message = message.replace(\n /^\\s*at\\s((?!webpack:).)*:\\d+:\\d+[\\s)]*(\\n|$)/gm,\n ''\n ); // at ... ...:x:y\n message = message.replace(/^\\s*at\\s<anonymous>(\\n|$)/gm, ''); // at <anonymous>\n lines = message.split('\\n');\n\n // Remove duplicated newlines\n lines = lines.filter(\n (line, index, arr) =>\n index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim()\n );\n\n // Reassemble the message\n message = lines.join('\\n');\n return message.trim();\n}", "title": "" }, { "docid": "208884b9c540461b5caba6e07e57876c", "score": "0.4830757", "text": "function wrapErrors(){\n\tvar err = new Error('One or more errors thrown by '+throwErrors.caller+\": \");\n\terr.errors = []\n\tfor(var i=0; i<arguments.length; i++){\n\t\tif(arguments[i]){\n\t\t\terr.message += '\\n\\t'+arguments[i].message;\n\t\t\terr.errors.push(arguments[i]);\n\t\t}\n\t}\n\treturn err;\n}", "title": "" }, { "docid": "0d849f8ce18af8b4425891307090a634", "score": "0.4821141", "text": "function addError() {}", "title": "" }, { "docid": "1908b9406b8a682033f073edfa76b157", "score": "0.48122966", "text": "error() {\n var msg = util.format.apply(msg, arguments);\n this.log.error(this.namePrefix + msg);\n }", "title": "" }, { "docid": "3538475e338e8d2b35d420cda5fd12af", "score": "0.47985056", "text": "function pythonize_exceptions(object, exception_constructor) {}", "title": "" }, { "docid": "729277ac889cd51e3fd8eed62a5aa60c", "score": "0.4791339", "text": "function throwWhenSymbol(variable, message, errorConstructor = Error) {\n if (isFunctions_1.isSymbol(variable)) {\n throwException(message, errorConstructor);\n }\n return variable;\n}", "title": "" }, { "docid": "26af42978d2f6df8d87f46fafe7a6959", "score": "0.4765455", "text": "error(message) {\n this.loggerInvoke(message);\n }", "title": "" }, { "docid": "134f687c1006ef008235573ad1ca5800", "score": "0.47606888", "text": "function errorPrefix(fnName, argName) {\n return fnName + \" failed: \" + argName + \" argument \";\n}", "title": "" }, { "docid": "134f687c1006ef008235573ad1ca5800", "score": "0.47606888", "text": "function errorPrefix(fnName, argName) {\n return fnName + \" failed: \" + argName + \" argument \";\n}", "title": "" }, { "docid": "6241fc5947a9587947e27720f079e5c5", "score": "0.47545183", "text": "function _error (msg) {\n throw new Error('leps sldier - ' + msg);\n }", "title": "" }, { "docid": "0c6a3ec655438572dabc6096aa1344b2", "score": "0.47506678", "text": "lexError(format) {\n console.warn([this.currentLine, 'Error', format]);\n }", "title": "" }, { "docid": "5689e3c82398a7397b04a3b1aabaf381", "score": "0.4745279", "text": "fail() {\n let token = this.state.stack.pop();\n if (token) {\n const match = token && token.match;\n const value = match ? match[0] : token[this.options.value || 'value'];\n throw new Error(`unclosed: \"${value}\"`);\n }\n if (this.state.string) {\n throw new Error(`unmatched input: \"${this.state.string.slice(0, 10)}\"`);\n }\n }", "title": "" }, { "docid": "77d24bdb1acc464e0baefff65b3eb4e3", "score": "0.4740149", "text": "function ParseError(message, hash) {\n _.extend(this, hash);\n\n this.name = 'ParseError';\n this.message = (message || '');\n}", "title": "" }, { "docid": "e31ebaf1e2c3f0272473276f8a4efd76", "score": "0.47340852", "text": "function errorPrefix(fnName, argName) {\r\n return fnName + \" failed: \" + argName + \" argument \";\r\n}", "title": "" }, { "docid": "e31ebaf1e2c3f0272473276f8a4efd76", "score": "0.47340852", "text": "function errorPrefix(fnName, argName) {\r\n return fnName + \" failed: \" + argName + \" argument \";\r\n}", "title": "" }, { "docid": "9068a819b9f721ee5af7c6725f87e438", "score": "0.47291762", "text": "\n () { return '...but was a method all along!'; }", "title": "" }, { "docid": "9068a819b9f721ee5af7c6725f87e438", "score": "0.47291762", "text": "\n () { return '...but was a method all along!'; }", "title": "" }, { "docid": "60267c51d1b93762107c00369b3dd0f6", "score": "0.47223628", "text": "function MODIFIER_ERROR$static_(){IconWithTextBEMEntities.MODIFIER_ERROR=( IconWithTextBEMEntities.BLOCK.createModifier(\"error\"));}", "title": "" }, { "docid": "c5785461bbe0315a7d59a912b54ab5de", "score": "0.47109908", "text": "function logE(a) {\n console.error(new Error(`WORD-TO-NUMBERS: \"${a}\" is an invalid input. Expected string.`));\n return a;\n}", "title": "" }, { "docid": "29e3d26e6cb7f28cf9a0bdbc806007d1", "score": "0.4694247", "text": "function caml_string_bound_error () {\n caml_invalid_argument (\"index out of bounds\");\n}", "title": "" }, { "docid": "3bdc87d85aa964c2cd9879841e11182c", "score": "0.46938542", "text": "function error(message) {\n\t\tthrow new $views.sub.Error(message);\n\t}", "title": "" }, { "docid": "d1a3a57ce0ad7b538c941ce98652db8c", "score": "0.4693845", "text": "static stackWithMessage(error, newMessage) {\n const stack = error.stack || \"\";\n const match = error.message.match(EndOfLineRegex);\n const lines = match ? match.length + 1 : 1;\n return newMessage + os_1.EOL\n + stack.split(EndOfLineRegex).slice(lines).join(os_1.EOL);\n }", "title": "" }, { "docid": "f9e8bb77028406f635ed1a9f043a263a", "score": "0.46936893", "text": "function reportFailure (msg)\n{\n var lines = msg.split (\"\\n\");\n var l;\n var funcName = currentFunc();\n var prefix = (funcName) ? \"[reported from \" + funcName + \"] \": \"\";\n \n for (var i=0; i<lines.length; i++)\n print (FAILED + prefix + lines[i]);\n}", "title": "" }, { "docid": "bf185db2f70238acad8126fc494973e6", "score": "0.4685983", "text": "function throwStyledComponentsError(code) {\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (false) {} else {\n throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());\n }\n}", "title": "" }, { "docid": "bf185db2f70238acad8126fc494973e6", "score": "0.4685983", "text": "function throwStyledComponentsError(code) {\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (false) {} else {\n throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());\n }\n}", "title": "" }, { "docid": "bf185db2f70238acad8126fc494973e6", "score": "0.4685983", "text": "function throwStyledComponentsError(code) {\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (false) {} else {\n throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());\n }\n}", "title": "" }, { "docid": "bf185db2f70238acad8126fc494973e6", "score": "0.4685983", "text": "function throwStyledComponentsError(code) {\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (false) {} else {\n throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());\n }\n}", "title": "" }, { "docid": "bf185db2f70238acad8126fc494973e6", "score": "0.4685983", "text": "function throwStyledComponentsError(code) {\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (false) {} else {\n throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());\n }\n}", "title": "" }, { "docid": "bf185db2f70238acad8126fc494973e6", "score": "0.4685983", "text": "function throwStyledComponentsError(code) {\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (false) {} else {\n throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());\n }\n}", "title": "" }, { "docid": "bf185db2f70238acad8126fc494973e6", "score": "0.4685983", "text": "function throwStyledComponentsError(code) {\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (false) {} else {\n throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());\n }\n}", "title": "" }, { "docid": "bf185db2f70238acad8126fc494973e6", "score": "0.4685983", "text": "function throwStyledComponentsError(code) {\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (false) {} else {\n throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());\n }\n}", "title": "" }, { "docid": "7c34be19c74646b418660b22dc99fd9e", "score": "0.46857446", "text": "function ParseError(title, msg) {\n this.title = title;\n this.msg = msg;\n}", "title": "" }, { "docid": "09d8f1e9cf9ef3f4703910852820be25", "score": "0.4683391", "text": "function errorPrefix(fnName, argName) {\r\n return fnName + \" failed: \" + argName + \" argument \";\r\n }", "title": "" }, { "docid": "fe5934f5d4e21ac0c58be50f95d88972", "score": "0.46773434", "text": "function InvalidCharacterError(message) {\n this.message = message;\n}", "title": "" }, { "docid": "e994db6f9a8152d571464684eb7b73c9", "score": "0.4671705", "text": "function FailedCallback(error, userContext, methodName) {\n if (error !== null) {\n //var RsltElem = document.getElementById(\"dxlblquote\");\n //RsltElem.innerHTML = \"An error occurred: \" +\n // error.get_message();\n return error.get_message();\n }\n}", "title": "" }, { "docid": "0974a25f6879c834ecb42ec559915796", "score": "0.46696514", "text": "function error(msg) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \">> Oops!\";\n\n return Array.isArray(msg) ? msg.join(_chalk2.default.red('\\n' + prefix) + ' ' + msg) : _chalk2.default.red('' + prefix) + ' ' + msg;\n}", "title": "" }, { "docid": "51139f78424cb2b62670c14d8f1f8b1c", "score": "0.4669123", "text": "function SignatureError(msg, pos) {\n \"use strict\";\n /**\n * This member carries a human readable message as to what type of error\n * occurred while parsing.\n * @public\n * @instance\n * @type {string}\n */\n this.message = msg;\n /**\n * This member carries the character position of where the error occurred.\n * @public\n * @instance\n * @type {number}\n */\n this.position = pos;\n}", "title": "" }, { "docid": "625a24909adc3431c59d0f780697c8c6", "score": "0.46632394", "text": "_parseError (err) {\n if (err && err.errorMessage) { return JSON.parse(err.errorMessage).message }\n else if (typeof(err) === 'string') { return JSON.parse(err) }\n else { return err }\n }", "title": "" }, { "docid": "444576ce20a3c4271530860b3df37061", "score": "0.46524262", "text": "failed(field, value) {\n throw new Error(\"This method requires implementation before use\")\n }", "title": "" }, { "docid": "1b44b2d90fc22c76ebeaa0486cc2bb1c", "score": "0.46435964", "text": "function throw_string() {\n throw \"use wasm;\";\n }", "title": "" }, { "docid": "472f74f76ad3c3111fc34ebddaa18a2d", "score": "0.46338543", "text": "function errorMessage(message) {\n if (typeof message == 'string') return [{\n description: $sce.trustAsHtml('<i>' + message + '</i>'),\n error: true\n }]\n }", "title": "" }, { "docid": "39eb83e62e817a8bd844153249c2dbb3", "score": "0.46337813", "text": "static error(message) {\n this.write('ERROR', message instanceof Error ? `${message.message} ${message.stack}` : message);\n }", "title": "" }, { "docid": "bcfab4cb6cfa385052833cd2722f5685", "score": "0.46301436", "text": "function Dl(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "title": "" }, { "docid": "bcfab4cb6cfa385052833cd2722f5685", "score": "0.46301436", "text": "function Dl(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "title": "" }, { "docid": "157aa3df96d129300c278d65858e9dc2", "score": "0.4629389", "text": "function parseError(data: { message: string, success: boolean }) {\n let error = ['messageInternalError'];\n if (data.message.indexOf('already exists') > -1) {\n error = ['messageFailedExist'];\n } else if (data.message.indexOf('wrong auth details')) {\n error = ['wrongOldPassword'];\n }\n return new Error(error);\n}", "title": "" }, { "docid": "0151cbeb35e017fdb56d2bfd7c4752a9", "score": "0.46283284", "text": "constructor(paramName, message, innerException, beforeSealing) {\n let pn = paramName ? ('{' + paramName + '} ') : '';\n super(trim(pn + (message || '')), innerException, (_) => {\n _.paramName = paramName;\n if (beforeSealing)\n beforeSealing(_);\n });\n }", "title": "" }, { "docid": "fdc38d1f3f23cdf8d7cc83b4d2b29071", "score": "0.46245065", "text": "function checkFuncStr(o, pars) {\n\t// Check that the element to remove the class from is definitely there.\n\tlet checkFuncEl = _initTest('checkFunc');\n\tif (!checkFuncEl) return;\n\n\tif (pars[0] !== \"test string\") _fail(checkFuncEl, 'Did not receive the string \"test string\" in checkFuncStr().');\n}", "title": "" }, { "docid": "d8c40e3c60bc226e9d1eccf6daec2772", "score": "0.46115407", "text": "_parseError(msg) {\n const m = 'ParseError line: '+this.parseLineNo+'; msg: ' + msg\n let errbuf = m\n errbuf += \"\\n buf: \", this.buf.substr(0, 100) // show current buffer (trimmed down a bit)\n\n if (this.maxBufHistoryLen > 0) {\n let i = this.bufHistoryIdx\n let seq = 0\n while (true) {\n i = (i==0) ? this.bufHistory.length - 1 : i - 1\n if (i==this.bufHistoryIdx) break\n --seq\n errbuf += \"\\n buf(\"+seq+\"): \" + this.bufHistory[i]\n }\n errbuf += \"\\n parse state: \" + JSON.stringify(this.state)\n }\n this.logger(errbuf)\n throw m\n }", "title": "" }, { "docid": "a2d2c1e42d04337ed5912dded47b33ed", "score": "0.4609794", "text": "function makeGenericError() {\n return \"ERROR: Summoner not found. Hopefully it was deleted to make room for someone who can play.\";\n}", "title": "" }, { "docid": "d1bfebecc6a772979b99a6318656b8e1", "score": "0.46043772", "text": "function parseError(input, contents, err) {\n var lines = contents.split(\"\\n\");\n return {\n message: err.description,\n severity: \"error\",\n lineNumber: parseInt(err.lineNumber),\n characterOffset: err.column,\n lineContent: (err.lineNumber > 0 && lines.length >= err.lineNumber? lines[err.lineNumber - 1] : \"Unknown line\"),\n source: input\n };\n}", "title": "" }, { "docid": "20c4b379a0ffd837e0fd49a35558c74a", "score": "0.45957708", "text": "function myGetErrorString(errorNumber)\n{\n var errorStrings = new Array();\n errorStrings['0'] = 'No Error';\n errorStrings['101'] = 'General exception';\n errorStrings['201'] = 'Invalid argument error';\n errorStrings['202'] = 'Element cannot have children';\n errorStrings['203'] = 'Element not an array - cannot have count';\n errorStrings['301'] = 'Not initialized';\n errorStrings['401'] = 'Not implemented error';\n errorStrings['402'] = 'Invalid set value, element is a keyword';\n errorStrings['403'] = 'Element is read only';\n errorStrings['404'] = 'Element is write only';\n errorStrings['405'] = 'Incorrect Data Type';\n\n if (errorNumber == '') { //No arguments were given, so no error is reported (this is basically to comply with the case where the function is called before LMSInitialize())\n return '';\n } else if ((typeof errorStrings[errorNumber]) == 'undefined') { //If the error code is not valid, do nothing really\n return errorStrings[0];\n } else {\n return errorStrings[errorNumber];\n }\n\n}", "title": "" }, { "docid": "65c2dcab3663be473c120a66698e3ac3", "score": "0.45946756", "text": "function makeCustomErrors(error){\n if (error.includes(\"instance.email\")) return \"You didn't enter a valid email\";\n if (error.includes(\"instance.password\")) return \"You didn't enter a valid password\";\n }", "title": "" }, { "docid": "770aff49d3a0211c63729e80d0b0d9a2", "score": "0.45944658", "text": "function OnFailed(error, userContext, methodName) \n{\n if(error !== null) \n {\n displayElement.innerHTML = \"An error occurred: \" + \n error.get_message();\n }\n}", "title": "" }, { "docid": "5b309a0a6d3f556f109e4c8dc4eba178", "score": "0.4593911", "text": "function fromDotSeparatedString(path) {\n var found = path.search(RESERVED);\n if (found >= 0) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not contain \" +\n \"'~', '*', '/', '[', or ']'\");\n }\n try {\n return new (FieldPath$1.bind.apply(FieldPath$1, tslib.__spreadArrays([void 0], path.split('.'))))();\n }\n catch (e) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not be empty, \" +\n \"begin with '.', end with '.', or contain '..'\");\n }\n}", "title": "" }, { "docid": "6e7fc407fc87b7049535053a18931f36", "score": "0.45848545", "text": "function l(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "title": "" }, { "docid": "a2e503f205af2f82f528bb0e1914ecb3", "score": "0.45814714", "text": "function prettifySyncErrors(fn, update) {\n try {\n return fn();\n }\n catch (error) {\n error.message = update(error.message);\n throw error;\n }\n}", "title": "" }, { "docid": "578d51b853c3000a16110835f8891930", "score": "0.45770985", "text": "function fromDotSeparatedString(path) {\n var found = path.search(RESERVED);\n if (found >= 0) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not contain \" +\n \"'~', '*', '/', '[', or ']'\");\n }\n try {\n return new (FieldPath$1.bind.apply(FieldPath$1, [void 0].concat(path.split('.'))))();\n }\n catch (e) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not be empty, \" +\n \"begin with '.', end with '.', or contain '..'\");\n }\n}", "title": "" } ]
3a40aca0f3c1eb3987fbc98e5b33221f
insert method insert new node in the specified index
[ { "docid": "2c9deba77dbba0a2b34e60b5faf03e1f", "score": "0.755", "text": "insert(index, val) {\n //create a new node with the given value\n let newnode = new Node(val);\n //if index > length or smaller then zero then return false\n if (index > this.length || index < 0) {\n return false;\n }\n //if index is equal to 0 then add a new element in front {use unshifting method}\n if (index === 0) {\n this.unshifting(val);\n return true\n } else\n //if index is equal to length then add a new element in last {use push method }\n if (this.length === index) {\n this.push(val);\n return true\n }\n //get method return the specified indexed node \n //store the index -1 node in previous\n let previousnode = this.get(index - 1);\n //store index node in next node\n let nextnode = previousnode.next;\n //point the previous node --> to the new node and point new node ----> to the next node\n previousnode.next = newnode;\n newnode.next = nextnode;\n //increament the length\n this.length++;\n return true;\n }", "title": "" } ]
[ { "docid": "e6b33f0e0806e49b0ddb7582e40e0d10", "score": "0.8020795", "text": "insertAt(data, index) {\n // if index is out of range\n if (index < 0 || index >= this.size) {\n return;\n }\n // If first index\n if (index === 0) {\n this.head = new Node(data, this.head);\n return;\n }\n\n const node = new Node(data);\n let current, previous;\n\n // set current to first \n current = this.head\n let count = 0;\n\n while(count < index) {\n previous = current; // Node before index we want to insert\n count++;\n current = current.next; // Node after index\n }\n\n node.next = current;\n previous.next = node;\n\n this.size\n }", "title": "" }, { "docid": "fcf04111dd941d868106ab09cf32db05", "score": "0.8015464", "text": "insertAt(data, index) {\n\n if (!this.head) {\n this.head = new _Node(data, null)\n return\n }\n\n if (index === 0) {\n this.head = new _Node(data, this.head)\n return\n }\n\n const previous = this.getAt(index - 1)\n let newNode = new _Node(data, previous.next)\n previous.next = newNode\n return\n }", "title": "" }, { "docid": "5ad0e705fb2a31524ea1a909e63d4c97", "score": "0.79811186", "text": "insertAt(data, index) {\n // Verify list is not empty or if index is out of bounds\n if (!this.head) {\n this.head = new Node(data);\n return;\n } \n // Handle case when inserting in the 0th index\n if (index === 0) {\n this.head = new Node(data, this.head);\n return;\n }\n // Insert in a middle or the last position (when index is out of bounds)\n const previous = this.getAt(index - 1) || this.getLast();\n const node = new Node(data, previous.next);\n previous.next = node;\n }", "title": "" }, { "docid": "8e92cc9ed9e614f60761debce40206da", "score": "0.7979952", "text": "insert(index, value) {\n const newNode = new Node(value);\n const leader = this.traverseToIndex(index);\n const holdingPointer = leader.next;\n leader.next = newNode;\n newNode.next = holdingPointer;\n this.length++;\n \n }", "title": "" }, { "docid": "fab0c2082523a712682aed187d12bf89", "score": "0.796407", "text": "insert(index, value) {\n\t\tif (index < 0) {\n\t\t\treturn false\n\t\t}\n\t\tif (index > this.length) {\n\t\t\treturn false\n\t\t}\n\t\tif (index === 0) {\n\t\t\tthis.prepend(value)\n\t\t} else {\n\t\t\t//we create the node to be added\n\t\t\tconst newNode = new Node(value)\n\n\t\t\t//we want to get the index subtract by one because we are inserting before\n\t\t\t//the index since the new node becomes the new index.\n\t\t\t//Example: [0,1,2,3] When index = 2, it means we're inserting between the 1 and 2.\n\t\t\t//In other words, we are inserting one before the index of 2 in the array.\n\t\t\t//We create a pointer called currentNode that now points to the object in the before the index.\n\t\t\tconst currentNode = this.getIndex(index - 1)\n\n\t\t\t//We create another pointer called holdPtr that points to currentNode.next's object, so that we do not lose\n\t\t\t//the singly linked list\n\t\t\tconst holdPtr = currentNode.next\n\t\t\tcurrentNode.next = newNode\n\t\t\tnewNode.next = holdPtr\n\t\t\tthis.length++\n\t\t\treturn this\n\t\t}\n\t}", "title": "" }, { "docid": "6e0e3b762497fec3f0744aeefb84adc8", "score": "0.7790912", "text": "insertAt(element,index)\r\n {\r\n if( index > 0 && index > this.size)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n //create a new node\r\n var node = new Node(element);\r\n var curr, prev;\r\n curr = this.head;\r\n\r\n //if index=0 add at first index\r\n if(index === 0)\r\n {\r\n node.next = head;\r\n this.head = node;\r\n }\r\n\r\n else\r\n {\r\n curr = this.head;\r\n var it =0;\r\n //iterate over the list to find the postion to insert\r\n while(it < index)\r\n {\r\n it++;\r\n prev = curr;\r\n curr = curr.next;\r\n }\r\n\r\n //add an element\r\n node.next = curr;\r\n prev.next = node;\r\n }\r\n this.size++;\r\n }\r\n }", "title": "" }, { "docid": "fb46bd5338e2dbe85f72914e95ebbfca", "score": "0.77634454", "text": "insertAt(idx, val) {\n \n // check if index is valid.\n if (idx < 0 || idx > this.length) {\n throw new Error(\"Invalid Index.\");\n }\n \n if (idx === 0) return this.unshift(val);\n if (idx === this.length) return this.push(val);\n \n // create new node.\n let newNode = new Node(val);\n let prevNode = this._get(idx - 1);\n newNode.next = prevNode.next; \n prevNode.next = newNode;\n\n ++this.length; // increment the list by 1.\n \n }", "title": "" }, { "docid": "7d614415c772c3b90d4eeba84d4ba688", "score": "0.7762718", "text": "insert(index, value) {\n //si el valor del indice es mayor a la longitud lo agrega de último\n if (index >= this.length) {\n return this.append(value);\n }\n\n const newNode = new Node(value);\n //primer pointer guarda el pointer del elemento anterior a donde vamos a insertar\n const firstPointer = this.getTheIndex(index - 1);\n //es el segundo pointer, el nodo que va después del que vamos a agregar\n const holdingPointer = firstPointer.next;\n //unimos el first pointer con el nuevo nodo\n firstPointer.next = newNode;\n //unimos el nuevo nodo con el segundo pointer\n newNode.next = holdingPointer;\n\n this.length++;\n return this;\n }", "title": "" }, { "docid": "d39246c52e3d575ab0d40e8ead8d0046", "score": "0.77455264", "text": "insertAt(element, index) {\r\n\t\tif (index < 0 || index > this.size) return console.log(\"Please use a valid index.\");\r\n\t\telse {\r\n\t\t\tlet node = new Node(element);\r\n\t\t\tlet curr, prev;\r\n\r\n\t\t\tcurr = this.head;\r\n\r\n\t\t\tif (index == 0) {\r\n\t\t\t\tnode.next = this.head;\r\n\t\t\t\tthis.head = node;\r\n\t\t\t} else {\r\n\t\t\t\tcurr = this.head;\r\n\t\t\t\tlet i = 0;\r\n\r\n\t\t\t\twhile (i < index) {\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tprev = curr;\r\n\t\t\t\t\tcurr = curr.next;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnode.next = curr;\r\n\t\t\t\tprev.next = node;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t}", "title": "" }, { "docid": "129479bc15376a083fceb47e031b98e2", "score": "0.77400076", "text": "insertAt(data, index) {\n if (index > 0 && index > this.size) {\n return;\n }\n\n //Kapag walang data insertFirst\n if (index === 0) {\n this.insertFirst(data);\n return;\n }\n\n const node = new Node(data);\n let current, previous;\n\n current = this.head;\n let count = 0;\n\n while (count < index) {\n previous = current;\n\n current = current.next;\n\n count++;\n }\n\n node.next = current;\n previous.next = node;\n\n this.size++;\n }", "title": "" }, { "docid": "01d42f4301774cbb65bc044d695dbc4a", "score": "0.76753426", "text": "insertAt(index, data) {}", "title": "" }, { "docid": "6bed38ff409cf4a104be6586927deb88", "score": "0.7656386", "text": "insert(index, value) {\n if (index < 0 || index > this.length) {\n return false;\n } else if (index === 0) {\n return this.unshift(value);\n } else if (index === this.length) {\n return this.push(value);\n } else {\n const newNode = new Node(value);\n let prev = this.get(index - 1);\n let curr = prev.next;\n prev.next = newNode;\n newNode.next = curr;\n this.length++;\n return this;\n }\n }", "title": "" }, { "docid": "004a215288843714b07cf358426b621f", "score": "0.76513135", "text": "insertAt(index, data) {\n if (index < 0 || index > this.size) {\n console.log(\"Please enter a valid index\");\n } else {\n let newNode = new Node(data);\n let current = this.head;\n let position = 0;\n\n if (index === 0) {\n newNode.next = current;\n this.head = newNode;\n } else {\n while (position < index - 1) {\n position++;\n current = current.next;\n }\n newNode.next = current.next;\n current.next = newNode;\n }\n }\n this.size++;\n }", "title": "" }, { "docid": "3305ebc720f105660e365345256eb6fc", "score": "0.7619471", "text": "insert(index,value){\n // check params\n if(index>=this.length){\n return this.append(value);\n }\n\n const newNode = new Node(value);\n const leader = this.traverseToIndex(index-1);\n newNode.next = leader.next;\n leader.next = newNode;\n this.length++;\n\n}", "title": "" }, { "docid": "8d6096719ba6211ab5d649c31e93050f", "score": "0.7553872", "text": "insertAt(element, index){\n // fail safe to prevent adding element where\n // specified index is greater than size of list\n if (index > 0 && index > this.size){\n return false;\n } \n else {\n // creates a new node\n var node = new Node(element)\n var curr, prev;\n\n //whatever list head is at this moment\n curr = this.head;\n\n // add the element to the first index\n if (index == 0){\n\n //create pointer to next node which is null\n node.next = null;\n\n //head of node is specified element\n this.head = node;\n\n } else {\n \n curr = this.head;\n var iterate = 0;\n\n // iterate over list to find\n // the position to insert\n\n while (iterate < index){\n iterate++;\n prev = curr;\n curr = curr.next;\n }\n // adding an element\n node.next = curr;\n prev.next = node;\n }\n this.size++;\n }\n }", "title": "" }, { "docid": "7965ae9c7581845c4c1c71d3ee580d3c", "score": "0.7547182", "text": "insert(index, val) {\n // check if the index less than zero ang greater than the length.\n if(index < 0 || index > this.length) {\n return false;\n }\n // if the index is the same as length use push.\n if(index === this.length){\n this.push(val);\n return true;\n }\n // if the index is zero use unshift. \n if(index === 0) {\n this.unshift(val);\n return true;\n }\n // get the node at the target position\n let targetNode = this.get(index);\n // find the node before the target index.\n let beforeTargetNode = this.get(index - 1);\n // Create new Node with val. \n let newNode = new Node(val);\n // set the next prop on the node be the new node. \n newNode.next = targetNode;\n // set the before target node next prop to the new Node. \n beforeTargetNode.next = newNode;\n // increment the length\n this.length++;\n\n // return true.\n return true;\n }", "title": "" }, { "docid": "7e81d891b8fc35e46e380c96eb7799ce", "score": "0.7538065", "text": "insertAt(idx, val) {\n if (idx > this.length || idx < 0) {\n throw new Error(\"Invalid index.\");\n }\n\n if(idx === 0) return this.unshift(val);\n if(idx === this.length) return this.push(val);\n\n let previous = this._get(idx - 1);\n\n let newNode = new Node(val);\n newNode.next =previous.next;\n previous.next = newNode;\n\n this.length += 1;\n }", "title": "" }, { "docid": "8aa5af4e379e702a3867ef9e3de33027", "score": "0.75368726", "text": "insertAtIndex(element, index) \n { \n if (index > 0 && index > this.size) \n return false; \n else {\n var node = new Node(element); \n var current, prev; \n\n current = this.head; \n if (index == 0) { \n node.next = this.head; \n this.head = node; \n } else { \n current = this.head; \n var iterator = 0;\n while (iterator < index) { \n iterator++; \n prev = current; \n current = current.next; \n }\n node.next = current; \n prev.next = node; \n } \n this.size++; \n } \n }", "title": "" }, { "docid": "af9c78053874b7d1bf7e7216c28a8f21", "score": "0.7533288", "text": "insertAt(element, index) { \n if (index > 0 && index > this.size) \n return false; \n else { \n // creates a new node \n var node = new LinkedNode(element); \n var curr, prev; \n \n curr = this.head; \n \n // add the element to the \n // first index \n if (index == 0) { \n node.next = this.head; \n this.head = node; \n } \n else { \n curr = this.head; \n var it = 0; \n \n // iterate over the list to find \n // the position to insert \n while (it < index) { \n it++; \n prev = curr; \n curr = curr.next; \n } \n \n // adding an element \n node.next = curr; \n prev.next = node; \n } \n this.size++; \n } \n }", "title": "" }, { "docid": "5862dd430bd1d4189d27ff3020e8e5e4", "score": "0.75323284", "text": "insert(index, value) {\n if (index >= this.length) {\n return this.append(value);\n }\n\n const node = new Node(value);\n const leader = this.traverseToIndex(index - 1);\n const holdingPointer = leader.next;\n leader.next = node;\n node.next = holdingPointer;\n this.length++;\n return this.printList();\n }", "title": "" }, { "docid": "7a779855875c31cde44c4a50d6c3d54b", "score": "0.7508995", "text": "insertAt(element, index) {\n if (index > 0 && index > this.size) return false;\n else {\n let node = new Node(element);\n\n if (index == 0) {\n node.next = head;\n this.head = node;\n } else {\n let curr = this.head;\n let i;\n for (i = 0; i < index - 1; i++) {\n curr = curr.next;\n }\n node.next = curr.next;\n curr.next = node;\n }\n }\n }", "title": "" }, { "docid": "2acbefc7e875b66166c19d5d5e82e083", "score": "0.75041777", "text": "insert(index, value) {\n if(index > this.length) {\n console.log(`add to the end`)\n return this.append(value);\n } else if (index === 0) {\n console.log(`Invalid`)\n return undefined;\n }\n\n const newNode = new Node(value);\n const previusPointer = this.getTheIndex(index - 1);\n const holdingPointer = previusPointer.next;\n newNode.prev = previusPointer\n newNode.next = holdingPointer;\n previusPointer.next = newNode;\n holdingPointer.prev = newNode;\n this.length++;\n return this;\n }", "title": "" }, { "docid": "700e2e96e17bd7d547cd70f5908f6830", "score": "0.74991584", "text": "insertAt(data, index) {\n //if the index is out of range\n if (index > 0 && index > this.size) {\n return;\n }\n //if it's the first index\n if (index === 0) {\n this.head = new Node(data, this.head);\n return;\n }\n const node = new Node(data);\n let current, previous;\n\n //set current to first\n current = this.head;\n let count = 0;\n\n while (count < index) {\n previous = current; //The node before the index\n count++;\n current = current.next; //The node after teh index\n }\n\n node.next = current;\n previous.next = node;\n this.size++;\n }", "title": "" }, { "docid": "24d13e97c11716be6b30bf540d9f5de4", "score": "0.74890184", "text": "insertAtInd(data, index){\n if(index > 0 && index > this.size){\n return\n }\n if(index === 0){\n this.head = new Node(data, this.head)\n return\n\n }\n const node = new Node(data);\n let current,previous;\n current = this.head;\n let count = 0;\n while(count < index){\n previous = current;\n current = current.next;\n count++;\n\n }\n node.next = current;\n previous.next = node\n this.size++\n }", "title": "" }, { "docid": "b0a949ae020d651bd14ecd6dc2501aff", "score": "0.74865663", "text": "insert(index, value) {\n if (index >= this.length) {\n return this.append(value);\n }\n let newNode = { value: value, next: null, prev: null };\n let currentNode = this.getNode(index);\n let previousNode = this.getNode(index - 1);\n newNode.next = currentNode;\n newNode.prev = currentNode.prev;\n previousNode.next = newNode;\n currentNode.prev = newNode;\n this.length += 1;\n return this.printList();\n }", "title": "" }, { "docid": "69e13039bba4a0d082969b6627aba1c0", "score": "0.7484685", "text": "insertAt(data,index){\n // primero validamos que el indice sea un numero valido dentro de la lista\n if(index < 0 || index > this.size){\n return null;\n }\n // creamos el nuevo nodo llamando a la clase node\n const newNode = new node(data);\n // guardamos los datos de la cabeza en current y inicializamos previous\n let current = this.head;\n let previous;\n // si el indice es igual a 0 significa que el nuevo nodo debe estar al principio de todo\n if(index === 0){\n newNode.next = current;\n this.head = newNode;\n }else{\n // el siguiente siclo hace avanzar al nodo indicado dependiendo el indice escrito\n for(let i = 0;i < index; i++){\n previous = current;\n current = current.next;\n }\n newNode.next = current;\n previous.next = newNode;\n }\n this.size++;\n }", "title": "" }, { "docid": "eb020e4607340c4de42d19a09d71cab6", "score": "0.7458137", "text": "insert(index, val) {\n if (index > this.length - 1) {\n return false;\n }\n if( index === 0 ){\n this.addToHead(val)\n return true\n }\n this.length++\n let node = this.get(index - 1);\n node.next = new Node(val, node.next)\n return true\n }", "title": "" }, { "docid": "a4119fdaf8ada112179282aee9b6d2b9", "score": "0.74540734", "text": "insertAt(idx, val) {\n const newN = new Node(val);\n if (!this.head) {\n this.head = newN;\n this.tail = newN;\n };\n if (idx === 0) {\n const oldHead = this.head;\n this.head = newN;\n this.head.next = oldHead;\n } else {\n let i = 1;\n let current = this.head;\n while (i !== idx) {\n i ++;\n current = current.next;\n };\n if (this.tail === current) {\n current.next = newN;\n this.tail = newN;\n } else {\n const oldNext = current.next;\n current.next = newN;\n newN.next = oldNext;\n };\n };\n this.length ++;\n }", "title": "" }, { "docid": "fb6875155d4fc66f74ad72dba6a16d5d", "score": "0.74513245", "text": "insert(index, val) {\n if (index < 0 || index > this.length) return false\n if (index === this.length) return this.push(val)\n if (index === 0) return this.unshift(val);\n\n let node = new Node(val)\n let beforeNode = this.get(index - 1);\n node.next = beforeNode.next;\n beforeNode.next = node\n this.length++\n return true\n }", "title": "" }, { "docid": "f409292af616e6af932534110507e05f", "score": "0.74271643", "text": "insert(index, val){\n if(index < 0 || index > this.length) return undefined;\n if(index === 0) return !!this.unshifting(val);\n if(index === this.length) return !!this.push(val);\n \n let newNode = new Node(val);\n let beforeNode = this.get(index-1);\n let afterNode = beforeNode.next;\n\n beforeNode.next = newNode;\n newNode.prev = beforeNode;\n afterNode.prev = newNode;\n newNode.next = afterNode;\n\n this.length++;\n console.log(true);\n }", "title": "" }, { "docid": "9bd2bee47225952346e5407d160d69ef", "score": "0.74197227", "text": "insert(index, value) { // adding a node by a certain position\n if (index < 0 || index > this.length) return false\n if (index === 0) this.unshift(value)\n if (index === this.length) this.push(value)\n\n let node = new Node(value)\n let prevNode = this.get(index - 1)\n let nextNode = prevNode.next\n\n prevNode.next = node\n node.prev = prevNode\n node.next = nextNode\n nextNode.prev = node\n\n this.length++\n return true\n }", "title": "" }, { "docid": "ab1304d212732b9c7555c6267088d37f", "score": "0.74115324", "text": "insert(index, value) {\n if (index < 0 || index > this.length) return false;\n if (index == this.length) return !!this.push(value);\n if (index == 0) return !!this.unshift(value);\n let newNode = new Node(value);\n let prevNode = this.get(index - 1);\n newNode.next = prevNode.next;\n prevNode.next = newNode;\n this.length++;\n return true;\n }", "title": "" }, { "docid": "78a61a9897f85382cacd4e483b55be60", "score": "0.7402572", "text": "insert(index, value) {\n\t\t// todo validate the param\n\t\t\n\t\tif (index ===0) {\n\t\t\tthis.prepend(value);\n\t\t\treturn this.printListValues();\n\t\t}\n\t\t\n\t\tconst leader = this.traverseToIndex(index - 1);\n\t\tconst follower = leader.next;\n\t\tconst newNode = new Node(value);\n\t\tnewNode.next = follower;\n\t\tnewNode.prev = leader;\n\t\tleader.next = newNode;\n\t\tfollower.prev = newNode;\n\t\t\n\t\tthis.length++;\n\t\tconsole.log(this);\n\t\treturn this.printListValues();\n\t}", "title": "" }, { "docid": "42440aaea85a23b06f39d7435e54962d", "score": "0.7398603", "text": "insertAt(idx, val) {\n if (idx < 0 || idx > this.length) {\n throw new Error(\"Invalid Index\");\n }\n\n const node = new Node(val);\n\n if (this.length === 0) {\n this.head = node;\n this.tail = node;\n this.length = 1;\n\n return;\n }\n\n if (idx === this.length) {\n this.tail.next = node;\n this.tail = node;\n\n this.length++;\n }\n\n let currentNode = this.head;\n let i = 0;\n\n while (i < idx - 1) {\n currentNode = currentNode.next;\n i++;\n }\n\n node.next = currentNode.next;\n currentNode.next = node;\n\n this.length++;\n }", "title": "" }, { "docid": "772958af1789d0e80a6da3cbde0bb8dd", "score": "0.73939145", "text": "InsertAtIndex(value, index) {\n if(index > 0 && index > this.size) { \n return;\n } \n\n if(index == 0) { \n InsertFirst(value);\n return;\n }\n\n const node = new Node(value);\n let current, previous;\n\n current = this.head;\n let count = 0;\n\n while(count < index) { \n previous = current;\n count++;\n current = current.next;\n }\n\n node.next = current;\n previous.next = node; \n this.size++; \n }", "title": "" }, { "docid": "c563a6f8b144363ad829edf65434ab41", "score": "0.73789257", "text": "insert(index, val){\n // handling the edge case of an index smaller than 0\n if (index < 0) return undefined;\n // simply prepending if the index is 0\n if (index === 0) return this.prepend(val);\n // simply appending if the index is the size\n if (index === this.size) return this.append(val);\n // getting the previous node befoore the postion we want to\n // insert in\n index = index -1;\n let count, current;\n // transversing either from the head or tail depending the closeness of \n // of the index\n if(index <= this.length/2){\n count = 0;\n current = this.head;\n while(count !== index){\n current = current.next;\n count++;\n }\n } else {\n count = this.length - 1;\n current = this.tail;\n while(count !== index){\n current = current.prev;\n count--;\n }\n }\n\n // chaining the nodes together\n\n let newNode = new Node(val);\n let NextNode = current.next;\n current.next = newNode;\n newNode.pre = current;\n newNode.next = NextNode;\n NextNode.pre = newNode;\n this.size++;\n }", "title": "" }, { "docid": "8ff7b931937131ce1a599ab3e871d84f", "score": "0.7357227", "text": "insert(data, index) {\n // If index is out of range\n if (index > 0 && index > this.size) return;\n let node = new Node(data);\n\n // If index = 0: insert at head\n if (index === 0) {\n if (!this.head) {\n this.head = node;\n this.tail = node;\n this.size++;\n } else {\n let current = this.head;\n node.next = current;\n current.prev = node;\n this.head = node;\n this.size++;\n }\n } else if (index === this.size) {\n let current = this.tail;\n node.prev = current;\n current.next = node;\n this.tail = node;\n this.size++;\n } else {\n // Insert at given index k\n let counter = 0;\n let current = this.head;\n while (counter < index) {\n current = current.next;\n counter++;\n }\n node.next = current;\n current.prev.next = node;\n node.prev = current.prev;\n this.size++;\n }\n }", "title": "" }, { "docid": "e259c80eec410a8227e82e9789a5e3ae", "score": "0.7329705", "text": "insert(index, val){\n if(index < 0 || index > this.length){\n return false;\n }\n if(index === this.length){\n // !! convert it to boolean\n return !!this.push(val);\n }\n if(index === 0){\n return !!this.unshift(val);\n }\n \n let newNode = new Node(val);\n let foundNode = this.getByIndex(index - 1);\n let temp = foundNode.next;\n foundNode.next = newNode;\n newNode.next = temp;\n this.length++;\n return true;\n }", "title": "" }, { "docid": "38d835355440f8cc4e5414b61520655f", "score": "0.7329633", "text": "insertAt(element, index){\n // Index is at the end of the list\n if(index > this.size)\n return -1;\n\n let node = new Node(element);\n\n // Replacing the head\n if(index === 0){\n node.next = this.head;\n this.head = node;\n }\n else{\n let current = this.head;\n let previous = null;\n let i = 0;\n // Get to the index we are inserting at\n while(i < index){\n i++;\n previous = current;\n current = current.next;\n }\n node.next = current;\n previous.next = node;\n }\n this.size++;\n return index;\n }", "title": "" }, { "docid": "1e6da122dee642683eb978d0ea3d8806", "score": "0.7316444", "text": "insert(index, value) {\n if (index < 0 || index > this.length) return false;\n if (index === this.length) return !!this.push(value);\n if (index === 0) return !!this.unshift(value);\n let newNode = new Node(value);\n let prev = this.get(index - 1);\n const temp = prev.next;\n prev.next = newNode;\n newNode.next = temp;\n this.length++;\n return true;\n }", "title": "" }, { "docid": "0cb987c275bddddfca7e7049c77f81ca", "score": "0.73137254", "text": "insert(ind, val) {\n let nodeAtIndex = this.get(ind);\n let nodeAtPriorIndex = this.get(ind - 1);\n let newNode = new Node(val);\n\n if (ind > length || ind < 0 || this.length === 0) return;\n if (nodeAtIndex && nodeAtPriorIndex) {\n nodeAtPriorIndex.next = newNode;\n newNode.next = nodeAtIndex;\n this.length += 1;\n return true;\n } else if (!nodeAtIndex && nodeAtPriorIndex) {\n !!this.push(val);\n } else if (nodeAtIndex && !nodeAtPriorIndex) {\n !!this.unshift(val);\n }\n }", "title": "" }, { "docid": "6cf3aa13901d2ef2ce5b3b460dc7c0bd", "score": "0.72933835", "text": "insert(index, value) {\n //if index is less than zero or greater than the length of the list, return false\n if (index < 0 || index > this.length) return false;\n //if the index is the same as the length of the list, use push method to add a new node to the end of the list\n // double bang (double negation)\n if (index === this.length) return !!this.push(value);\n //if the index is 0, use the unshift method to add a new node to the beginning of the list\n if (index === 0) return !!this.unshift(value);\n //otherwise, using the get method, access the node at (index - 1) meaning we are getting the index\n //at the position left of where we are adding the new node\n const previousNode = this.get(index - 1);\n //instanstiate a new Node\n const newNode = new Node(value);\n //set that new Node's next property to the old node that previousNode was pointing to\n //(can also create intermediate variable that holds the value of previousNode.next and set newNode.next to it)\n newNode.next = previousNode.next\n //then set previousNode's next property to the new Node\n previousNode.next = newNode;\n //increment the length of the list\n this.length++\n //return true\n return true;\n }", "title": "" }, { "docid": "23b8103a845feec146185874905501e0", "score": "0.7289661", "text": "insert(index, val) {\n // if the index is not in the list\n if (index < 0 || index > this.length) return false;\n // if the index is at the beginning add it to the front\n if (index === 0) return !!this.unshift(val);\n // if the index is at the end add it to the end\n if (index === this.length) return !!this.push(val);\n\n // create the newNode\n const newNode = new Node(val);\n // find the node before the given index\n const prevNode = this.get(index - 1);\n // set the next index on the newNode to the next node on the prevNode\n newNode.next = prevNode.next;\n // set the prev node on the newNode to the prevNode\n newNode.prev = prevNode;\n // set the next node on the prevNode to the newNode\n prevNode.next = newNode;\n // increase the length\n this.length++;\n return true;\n }", "title": "" }, { "docid": "993eab217210b0ce93b46b67ca6b7ac1", "score": "0.72840446", "text": "insert(index, val) {\n let newNode = new Node(val);\n if (index < 0 || index > this.length) return false;\n if (index === this.length) this.push(newNode);\n if (index === 0) this.unshift(newNode);\n\n let prev = this.get(index - 1);\n let temp = prev.next;\n prev.next = newNode;\n newNode.next = temp;\n this.length++;\n return true;\n }", "title": "" }, { "docid": "f1bd17f703a44d1ce08929fa37d18599", "score": "0.7268132", "text": "insert(index, val) {\n\n //if index is less than zero or greater than the length return false;\n if (index < 0 || index > this.length) return false;\n //if index is equal to the length of the list call push(val)\n if (index === this.length) {\n this.push(val);\n return true;\n }\n //if index is equal to zero call unshift(val)\n else if (index === 0) {\n this.unshift(val);\n return true;\n }\n else {\n //creating new node with the value\n let node = new Node(val);\n let pre = this.get(index - 1); // getting previous elemnt \n node.next = pre.next;// setting new node next property to the previous element next property\n pre.next = node; //setting previous element next property to new node\n this.length++; //incrementing the length by 1\n return true;\n }\n\n }", "title": "" }, { "docid": "31a80846c8268e6478f0b83ff7209a30", "score": "0.72414476", "text": "insertAt(idx, val) {\n\n }", "title": "" }, { "docid": "f85e611969b1facbac27e2c7f804e3c4", "score": "0.7238417", "text": "insert(index, val) {\n if (index < 0 || index > this.length) return false;\n\n if (index === 0) this.unshift(val);\n else if (index === this.length) this.push(val);\n else {\n let beforeNode = this.get(index - 1);\n let newNode = new Node(val);\n let afterNode = beforeNode.next;\n\n beforeNode.next = newNode;\n newNode.previous = beforeNode;\n newNode.next = afterNode;\n afterNode.previous = newNode;\n this.length++;\n }\n\n return true;\n }", "title": "" }, { "docid": "59e27057dbd65f922fa51308e346606e", "score": "0.7228244", "text": "insertAt(element, index) {\n if (index > 0 && index > this.count)\n return false;\n else {\n // creates a new node\n let node = new TrieNode(element);\n let current, prev;\n\n current = this.head;\n\n // add the element to the\n // first index\n if (index === 0) {\n node.next = this.head;\n this.head = node;\n } else {\n current = this.head;\n let counter = 0;\n\n // iterate over the trie to find\n // the position to insert\n while (counter < index) {\n counter++;\n prev = current;\n current = current.next;\n }\n\n // adding an element\n node.next = current;\n prev.next = node;\n }\n this.count++;\n return node;\n }\n }", "title": "" }, { "docid": "bd6aaf75a392bb4c614f57c2498f22cb", "score": "0.7209107", "text": "insert(index, val) {\n if (index < 0 || index > this.length) return false\n if (index === this.length) return !!this.push(val)\n if (index === 0) return !!this.unshift(val)\n\n let newNode = new Node(val)\n let prevNode = this.get(index - 1)\n let nextNode = prevNode.next\n prevNode.next = newNode\n newNode.prev = prevNode\n newNode.next = nextNode\n nextNode.prev = newNode\n this.length++\n return true\n }", "title": "" }, { "docid": "cf99c5ee49f7d48ca66be3722b08070b", "score": "0.71974903", "text": "insert(index, value) {\n if (index < 0 || index > this.length) {\n return false;\n }\n if (index === this.length) {\n return !!this.push(value);\n }\n else if (index === 0) {\n return !!this.unshift(value);\n } else {\n let prev = this.get(index - 1);\n let newNode = new Node(value);\n newNode.next = prev.next;\n prev.next = newNode;\n }\n this.length++;\n return true;\n }", "title": "" }, { "docid": "7ec38eecef4a4f1735e11d57b9c08067", "score": "0.7191129", "text": "insert(index, value) {\n\t\tif (index < 0 || index > this.length) return false;\n\t\tif (index === this.length) {\n\t\t\tthis.push(value);\n\t\t\treturn true;\n\t\t}\n\t\tif (index === 0) {\n\t\t\tthis.unshift(value);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst newNode = new Node(value);\n\t\tconst prev = this.get(index - 1);\n\t\tconst curr = this.get(index);\n\t\tnewNode.next = curr;\n\t\tprev.next = newNode;\n\t\tthis.length++;\n\t\treturn true;\n\t}", "title": "" }, { "docid": "0d812396a9d8dca2f007b484d6dd5bb0", "score": "0.7186846", "text": "insert(index, val) {\n if (index > this.length || index < 0) {\n return false;\n }\n\n if (index === this.length) {\n return this.push(val);\n }\n\n if (index === 0) {\n return this.unshift(val);\n }\n\n const newNode = new Node(val);\n const prev = this.get(index - 1);\n const temp = prev.next;\n prev.next = newNode;\n newNode.next = temp;\n return true;\n }", "title": "" }, { "docid": "952a2e4f6576e37e091e33abf8a104c3", "score": "0.71796215", "text": "insert(val, idx) {\n\n }", "title": "" }, { "docid": "ac279e5f8c51b4b70a4b1b50e40d7ef9", "score": "0.71708965", "text": "insert(index, val) {\n if (index < 0 || index > this.length) return false;\n if (index === this.length) return !!this.push(val);\n if (index === 0) return !!this.unshift(val);\n\n var newNode = new Node(val);\n var prev = this.get(index - 1);\n var temp = prev.next;\n prev.next = newNode;\n newNode.next = -temp;\n this.length++;\n return true;\n }", "title": "" }, { "docid": "005f3ec73714c05c00690d9dd80cec46", "score": "0.7170093", "text": "insert(index, val) {\n if(index < 0 || index > this.length) return false\n if(index === 0) {\n if(this.addToHead(val)) return true\n }\n let newNode = new Node(val)\n let prevNode = this.get(index - 1)\n let oldNext = prevNode.next\n prevNode.next = newNode\n newNode.next = oldNext\n this.length++\n return true \n }", "title": "" }, { "docid": "6ae381b5f7f1bc9a471d94eb0521e2c1", "score": "0.71147037", "text": "inserst(element, index) {\n if (index == 0) {\n this.inserstionfirst(element)\n return;\n\n }\n if (this.head == null) {\n return;\n }\n else {\n var n = new Node(element);\n var t = 0;\n var prev = this.head;\n var current = this.head;\n while (current) {\n if (t == index - 1) {\n prev.next = n;\n n.next = current;\n this.size++;\n return;\n }\n t++;\n prev = current;\n current = current.next;\n }\n return false;\n\n }\n\n }", "title": "" }, { "docid": "2a735bcd8843abc21c5fc1b9a963084f", "score": "0.71072364", "text": "function InsertNode() {}", "title": "" }, { "docid": "1f2c1e0284a98dbe3c19fc43ecbc9c40", "score": "0.7095419", "text": "insert(val,idx){\n if(idx < 0 || idx > this.length) return false;\n if(index === this.length) return !!this.push(val);\n if(index === 0) return !!this.unshift(val);\n\n var newNode = new Node(val);\n var nodeFound = this.get(idx);\n if(nodeFound){\n var pNode = this.get(idx - 1);\n pNode.next = newNode;\n newNode.next = nodeFound\n this.length++\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "3728111c2ce734e5848bdf06c1e835b5", "score": "0.7092111", "text": "insertAt(idx, val) {\n if(!this.head) return this.push(val);\n let curr = this.head;\n let newNode = new Node(val);\n\n let i = 0;\n while(i < idx - 1){\n if(curr){\n curr = curr.next;\n i ++\n } else {\n throw new Error(\"invalid index\");\n }\n }\n\n if(curr.next){\n newNode.next = curr.next;\n }else {\n this.tail = newNode;\n }\n\n curr.next = newNode;\n this.length++;\n\n return undefined;\n }", "title": "" }, { "docid": "c48e1a0be757a4f9c0c4462ec8e8975b", "score": "0.70910746", "text": "insert(val, idx) {\n // Accept val and idx\n // Check if the idx is valid: less than zero or greater than or eqaul to this.length\n // return false. \n if(idx < 0 || idx > this.length) return false;\n // if the index is 0.\n if(idx === 0) {\n // call unshift.\n this.unshift(val);\n // return true.\n return true;\n }\n // if index is the same as the length -1 push. \n if(idx === this.length ) {\n this.push(val);\n return true;\n }\n // Create a newNode with val. \n let newNode = new Node(val);\n // Create a foundNode call get with idx.\n let foundNode = this.get(idx - 1);\n // Set newNode next to foundNode\n newNode.next = foundNode.next;\n // Set foundNode.next to newNode. \n foundNode.next = newNode;\n // Set NewNode.prev to foundNode\n newNode.prev = foundNode;\n // Set NowNOde.next.prev to newNode.\n newNode.next.prev = newNode;\n // increment length\n this.length++;\n // return true.\n return true;\n }", "title": "" }, { "docid": "a656b6268b127c26b37caba2afd3dc2f", "score": "0.7082861", "text": "insert(index, val) {\n if (index >= this.length) return false;\n\n let node = this.head;\n let newNode = new Node(val, null);\n let nextNode;\n for (let i = 0; i < this.length; i++) {\n if (i === index - 1 || index === 0) {\n this.length += 1;\n nextNode = node.next;\n node.next = newNode;\n newNode.next = nextNode;\n return true;\n }\n node = node.next;\n }\n }", "title": "" }, { "docid": "ba94fb3777a9ef97b52f7fe6e2225238", "score": "0.7051359", "text": "insert(index, value) {\n const newNode = new Node(value);\n\n if (index < 0 || index > this.length) {\n return false;\n }\n if (index === this.length) {\n this.tail.next = newNode;\n this.tail = newNode;\n this.length++;\n return true;\n }\n if (index === 0) {\n if (!this.head) {\n this.head = newNode;\n this.tail = this.head;\n } else {\n newNode.next = this.head;\n this.head = newNode;\n }\n this.length++;\n return true;\n }\n\n let current = this.head;\n let count = 0;\n // get to the variable before the given index. You can use a .get here as well\n while (count < index - 1) {\n current = current.next;\n count++;\n }\n // don't forget to increment length!!\n let after = current.next;\n current.next = newNode;\n newNode.next = after;\n this.length++;\n\n return true;\n }", "title": "" }, { "docid": "06df86e2588ec0e53535bd077d73593e", "score": "0.7050674", "text": "insertAt(data, index){\n // check if index is out of range\n if(index > 0 && index > this.size){\n // return false\n return;\n }\n // create a new node\n const node = new Node(data);\n // we need two variables to hold the current and previous node\n let current; \n let previous;\n\n // assign head to current variable\n current = this.head;\n\n // check if index is 0 \n if(index === 0){\n // if so then the existing head should be next to the node\n node.next = this.head;\n // if so then add created node as the head of the linked list\n this.head = node;\n }\n else {\n // set current to head\n current = this.head;\n // create a variable to count\n let count = 0;\n\n // iterate to the right position\n while(count < index){\n // increase the count\n count++;\n previous = current;\n current = current.next;\n }\n // when you find right position add the new node there between previous and current\n node.next = current;\n previous.next = node;\n }\n // increase the linked list size\n this.size++;\n }", "title": "" }, { "docid": "c53120eb4e47fa9d46ad4f40a819fb3b", "score": "0.70449775", "text": "insert(index_num, value){\n if(index_num<0 || index_num>this.length){\n console.log(\"INSERT - false\");\n return false;\n }\n if(index_num===0){\n this.unshift(value);\n console.log(\"INSERT using UNSHIFT - true\");\n return true;\n } \n if(index_num===this.length){\n this.push(value);\n console.log(\"INSERT using PUSH - true\");\n return true;\n } \n let newNode = new Node(value);\n let before_position = this.get(index_num-1); // 1. we neet to find item at the position one before!!\n let needed_position = before_position.next;\n before_position.next = newNode;\n newNode.next = needed_position;\n this.length +=1;\n console.log(\"INSERT - true\");\n return true;\n }", "title": "" }, { "docid": "d4f50a8b1b3a066fe638e49bc5afb894", "score": "0.70155126", "text": "insert(index, element) {\n if (index < 0 || index > this.count) return false;\n if (index === this.count) return !!this.push(element);\n if (index === 0) return !!this.unshift(element);\n\n const node = new Node(element);\n let prevNode = this.get(index - 1);\n let nextNode = prevNode.next;\n\n prevNode.next = node, node.prev = prevNode;\n node.next = nextNode, nextNode.prev = node;\n\n this.count++;\n\n return true;\n }", "title": "" }, { "docid": "83de5e4d5fb80365d9ad2f8410ad376f", "score": "0.70146275", "text": "insertIndexedNode(data, index){\n //edge cases when index = 0, when index = last index,\n //when index is out of range\n if (index === 0){\n //insert node at head\n this.insertHeadNode(data);\n \n } else if (index === this.size - 1){\n //insert node at tail\n this.insertTailNode(data);\n }else if (index < 0 || index >= this.size){\n console.log('error: index is out of range');\n return;\n } else {\n //if no edge cases...\n //find index where node will be inserted\n let current = this.head;\n let previous = null;\n let count = 0;\n while(count < index){\n previous = current;\n current = current.next;\n count++; //increments count until count == index which stops loop\n }\n //create the node to insert\n let babyNode = new Node(data, current);\n previous.next = babyNode;\n this.size++;\n}\n}", "title": "" }, { "docid": "49daa7c076e15c645766fb18a982340b", "score": "0.6999746", "text": "insert(index, val) {\n if(index < 0 || index > this.length) return false;\n if (index === this.length) return !!this.push(val); //returns true\n if(index === 0) return !!this.unshift(val); //returns true\n \n var newNode = new Node(val);\n var prev = this.get(index - 1);\n var temp = prev.next; //temp is used to store prev.next because if \n //we dont and change prev.next, \n //the value will be deleted\n prev.next = newNode;\n newNode.next = temp;\n this.length++;\n return true;\n\n }", "title": "" }, { "docid": "7c113fff2f9c8b504afad9ed4a8a9226", "score": "0.6965347", "text": "addAt(index, data) {\n var node = new Node(data);\n\n if (index < 0 || index > this.size) {\n console.log(\"this index \" + index + \"th position is not from current list position 0 to \" + this. size);\n this.size--;\n }else if (index == 0) {\n this.addStart(data);\n this.size--;\n }else if (index == this.size) {\n this.add(data);\n this.size--;\n }else {\n var temp = this.head;\n for (var i = 0; i < index - 1; i++) {\n temp = temp.next;\n }\n\n //updating new nodes pointer to next node\n node.next = temp.next;\n //updating previous node's pointer to new node\n temp.next = node;\n }\n this.size++;\n }", "title": "" }, { "docid": "174d193cc0215cf6969731e70de6d66c", "score": "0.69309825", "text": "function insertAt(value, index) {\n let starter = SLL.head\n let counter = 0\n while (starter) {\n counter++\n if (counter === index) {\n let next = starter.next\n starter.next = { value, next }\n return\n }\n starter = starter.next\n }\n}", "title": "" }, { "docid": "a67f90b80ceea278d40913f6f781b5a3", "score": "0.6914044", "text": "addNodeAtIndex(index, data) {\n let node = new Node(data);\n if (!this.head) {\n this.head = node;\n return;\n } else if (index === 0) {\n node.next = this.head;\n this.head = node;\n return;\n }\n let next = this.getNodeAt(index - 1);\n if (next) {\n node.next = next.next;\n next.next = node;\n }\n }", "title": "" }, { "docid": "0cc3b95ecd0b4e44058faf7a0a19ce99", "score": "0.69137335", "text": "insert(index, val) {\n if (index < 0 || index > this.length - 1) return false;\n if (index === 0) this.addToHead(val);\n if (index === this.length) this.addToTail(val);\n\n let targetNode = this.get(index - 1);\n if (targetNode === null) {\n return false;\n } else {\n let newNode = new Node(val);\n let originalNext = targetNode.next;\n targetNode.next = newNode;\n newNode.next = originalNext;\n\n this.length += 1;\n return true;\n }\n }", "title": "" }, { "docid": "e7932b6f29e3811ff2555c9824ce2c31", "score": "0.69060457", "text": "insert(idx, value) {\n // Check if maxSize has been reached\n if (this.size === this.maxSize) {\n return -1;\n }\n\n // If idx <= 0, unshift\n if (idx <= 0) {\n return this.unshift(value);\n }\n\n // If idx >= this.size, push\n if (idx >= this.size) {\n return this.push(value);\n }\n\n // Otherwise, insert in the middle\n // Instantiate a new node\n const newNode = new Node(value);\n\n // set a pointer (prevNode) to the result of findByIdx(idx-1)\n const prevNode = this.findByIdx(idx - 1);\n\n // set a pointer (nextNode) to prevNode.next\n const nextNode = prevNode.next;\n\n // set next pointer of prevNode to newNode\n prevNode.next = newNode;\n\n // set prev pointer of newNode to prevNode\n newNode.prev = prevNode;\n\n // set next pointer of newNode to nextNode\n newNode.next = nextNode;\n\n // set prev pointer of nextNode to newNode\n nextNode.prev = newNode;\n\n // Increment the size\n this.size++;\n\n // return the linked list\n return this;\n }", "title": "" }, { "docid": "7985dc60997aff8ae6c7edae3b48e8b4", "score": "0.6891696", "text": "insertAt(idx, val) {\n if(idx > this.length) {\n return undefined;\n }\n\n const newNode = new Node(val);\n this.length ++;\n\n if(this.head === null){\n this.head = newNode;\n this.tail = newNode;\n return undefined;\n }\n\n if(idx === 0){\n newNode.next = this.head;\n this.head = newNode;\n\n return undefined;\n }\n\n if(idx === this.length - 1){\n this.tail.next = newNode;\n this.tail = newNode;\n\n return undefined;\n }\n\n let currNode = this.head;\n\n for(let i = 0; i < idx - 1; i++){\n currNode = currNode.next;\n }\n\n newNode.next = currNode.next;\n currNode.next = newNode;\n }", "title": "" }, { "docid": "24db396810431676d87c3862ba9c156c", "score": "0.68780965", "text": "insertAt(position,item){\n \n if(this.head === null){\n this.insertFirst(item);\n }\n \n let ticker = 0;\n let currNode = this.head;\n let nextNode = this.head;\n \n while ((nextNode !== null) && (ticker !== position)) {\n //save the previous node \n currNode = nextNode;\n nextNode = currNode.next;\n ticker++;\n }\n \n currNode.next = new _Node(item,nextNode);\n \n }", "title": "" }, { "docid": "16e861d1ae92e898dc43f7e7bfe73f7f", "score": "0.686643", "text": "insertAt(item, position) {\n if(this.head === null) {\n this.head = new _Node(item, this.head)\n }\n let currNode = this.head\n let count = 0\n while(count < position - 1) {\n currNode = currNode.next\n count++\n }\n currNode.next = new _Node(item, currNode.next)\n }", "title": "" }, { "docid": "acf41fc00d1cdf67d577e4f82c7aad90", "score": "0.6814649", "text": "function setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n var insertBeforeIndex = tNode.insertBeforeIndex;\n\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex = [null\n /* may be updated to number later */\n , index];\n } else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n }", "title": "" }, { "docid": "b22a8a4bbf5826f95779d2a263f221fc", "score": "0.6797416", "text": "insertAt(element, pos) {\n let nodeToInsert = new Node(element);\n let count = 0;\n let current = this.head;\n let previous;\n if (pos === 0) {\n nodeToInsert.next = this.head;\n this.head = nodeToInsert;\n } else if (pos == this.size) {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n previous.next = nodeToInsert;\n }\n else {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n nodeToInsert.next = previous.next;\n previous.next = nodeToInsert;\n this.size++;\n }\n }", "title": "" }, { "docid": "54daf5da12878829a2d74c9b7bdc7f45", "score": "0.67813444", "text": "function push( n, index ){\n\t\t\tn = n ? n : 0;\n\t\t\tindex = (typeof index != \"undefined\")? index : cStack.find(\"tr\").length - 1;\n\t\t\tif(index == -1){\n\t\t\t\tcStack.append(com.stack.newItem(n));\n\t\t\t} else {\n\t\t\t\tcom.stack.newItem(n).insertBefore(get(index));\n\t\t\t}\n\t\t\t\n\t\t}", "title": "" }, { "docid": "b2ffe6ae74e26bce39c295d56c1db830", "score": "0.67545617", "text": "function setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex =\n [null /* may be updated to number later */, index];\n }\n else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}", "title": "" }, { "docid": "b2ffe6ae74e26bce39c295d56c1db830", "score": "0.67545617", "text": "function setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex =\n [null /* may be updated to number later */, index];\n }\n else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}", "title": "" }, { "docid": "b2ffe6ae74e26bce39c295d56c1db830", "score": "0.67545617", "text": "function setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex =\n [null /* may be updated to number later */, index];\n }\n else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}", "title": "" }, { "docid": "b2ffe6ae74e26bce39c295d56c1db830", "score": "0.67545617", "text": "function setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex =\n [null /* may be updated to number later */, index];\n }\n else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}", "title": "" }, { "docid": "b2ffe6ae74e26bce39c295d56c1db830", "score": "0.67545617", "text": "function setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex =\n [null /* may be updated to number later */, index];\n }\n else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}", "title": "" }, { "docid": "b2ffe6ae74e26bce39c295d56c1db830", "score": "0.67545617", "text": "function setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex =\n [null /* may be updated to number later */, index];\n }\n else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}", "title": "" }, { "docid": "0b2b7e2ac64298f41ed426c66d4cad5f", "score": "0.6742952", "text": "insert(value) {\n this.head = new Node(value, this.head);\n }", "title": "" }, { "docid": "20ce53a2cb7e8f93f0ab6921e662d0e5", "score": "0.6718971", "text": "function setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n var insertBeforeIndex = tNode.insertBeforeIndex;\n\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex = [null\n /* may be updated to number later */\n , index];\n } else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}", "title": "" }, { "docid": "8c298b1319156537ec1fa9b77cf85174", "score": "0.6713193", "text": "function insert(index, value) {\n this.splice(index, 0, value);\n return this;\n}", "title": "" }, { "docid": "eadd0f0b1603e63c13c7f90882f9256d", "score": "0.6691758", "text": "insert(item, index){\n let id;\n if (!item) throw new Error(\"item is not defined\");\n if (index < 0) throw new Error(\"index should be a positive int\");\n\n if (typeof index === \"undefined\" || index > this._items.length) {\n id = this._items.length;\n } else { \n id = index;\n }\n\n item.id = id;\n this._items.splice(id, 0, item);\n this.length = this._items.length;\n\n for (let i = id + 1; i < this._items.length; i++){\n this._items[i].id = i;\n }\n }", "title": "" }, { "docid": "af922378a4c73083be54a1c6e58a4fbf", "score": "0.6671204", "text": "insert(data) {\n const node = new Node(data, this.head);\n this.head = node;\n }", "title": "" }, { "docid": "69b4aeb2f0d1ec45eafb5b6d4df5a285", "score": "0.6648249", "text": "addAt(index) {\n var node = new Node(element);\n var currentNode = this.head;\n var previousNode;\n var currentIndex = 0;\n\n if(index > this.length){\n return false;\n }\n\n if(index === 0){\n node.next = currentNode;\n this.head = node;\n } else {\n while(currentIndex < index){\n currentIndex++;\n previousNode = currentNode;\n currentNode = currentNode.next;\n }\n node.next = currentNode;\n previousNode.next = node;\n }\n this.length++;\n }", "title": "" }, { "docid": "1cc7945541ff1cae3c327a15ee050321", "score": "0.6646024", "text": "insert(index,value) {\n if (index < 0 || index>this.length){\n throw new Error('Index error')\n }\n if (this.length >= this._capacity){\n \n this._resize((this.length + 1)*Array.SIZE_RATIO)\n \n }\n Memory.copy(this.ptr+index+1,this.ptr+index,this.length-index)\n this.length ++\n this.set(index,value)\n \n }", "title": "" }, { "docid": "0ad02689311baaa4e3e5d57d04aa4838", "score": "0.65895975", "text": "insertAt(element, position){\n var head = this.head;\n var node = new Node(element);\n if(position <=0 || position>this.size+1)\n return;\n else if(position == 1){\n node.next = head;\n this.head = node;\n }\n else if(position == this.size+1){\n var current = this.head;\n while(current.next){\n current = current.next;\n }\n current.next = node;\n }\n else{\n var current = this.head;\n for(var i=1; i<position-1; i++){\n current = current.next;\n }\n var nextNode = current.next;\n node.next = current.next;\n current.next = node;\n\n }\n this.size++;\n\n }", "title": "" }, { "docid": "db4b3482ea232689b6c115254c832b1a", "score": "0.6574065", "text": "insert(i, item) {\n }", "title": "" }, { "docid": "13f044b90f61c065f85150e7b349265d", "score": "0.6572731", "text": "addNode(index, value) {\n if (index < 0 || index > this.length) {\n // nah\n throw new RangeError(`Cannot insert node at index ${index}`);\n } else if (index === 0) {\n // new head\n return this.addNodeFront(value);\n } else if (index === this.length) {\n // new tail\n return this.addNodeBack(value);\n } else {\n // node before\n const prevNode = this.findNode(index - 1);\n // node that will be pushed rightwards\n const nextNode = this.findNode(index);\n // new node\n const node = new DoublyNode(value, prevNode, nextNode);\n // connect\n prevNode.next = node;\n nextNode.prev = node;\n // that's it\n this.length += 1;\n return node;\n }\n }", "title": "" }, { "docid": "3dbcbe59aecd3d43916926d21f3490ec", "score": "0.65616906", "text": "insert(index,value){\n//check parameters\nif(index >= this.length){\n return this.append(value)\n}\nconst newNode ={\n value:value,\n next:null\n}\nconst leader =this.tracerseToIndex(index-1)\nconst holdingPointer = leader.next\nleader.next =newNode\nnewNode.next =holdingPointer\nthis.length++;\nreturn this.printList\n}", "title": "" }, { "docid": "0171e54fe3c04bc49c2f0b3fa6c75805", "score": "0.6550752", "text": "insert(element, position) {\n // check for out-of-bounds values\n if(index >= 0 && index <= this.count) { \n const node = new Node(element);\n // change the head reference to node and add a new element to the list\n if(index === 0) { \n node.next = current; \n this.head = node;\n // to loop through the list until the desired position\n } else {\n const previous = this.getElementAt(index - 1);\n node.next = previous.next; // to link the new node and the current\n previous.next = node; \n }\n this.count++;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "280e8cbc73ed68de4f29671c51cdd437", "score": "0.6538673", "text": "insertAt(newItem, pos) {\n let stepper = 0;\n let currNode = this.head;\n while (stepper !== pos) {\n stepper++;\n currNode = this.head.next;\n }\n if (currNode === null) {\n return console.log(\"Item not found\");\n }\n if (stepper === pos) {\n this.insertAfter(newItem, currNode.value);\n return;\n }\n }", "title": "" }, { "docid": "dcd3ac03d55ca06774b51bbe36285522", "score": "0.65106076", "text": "insert(index, value) {\n if (index < 0 || index >= this.length) {\n throw new Error(\"Index error\");\n }\n if (this.length >= this._capacity) {\n this._resize((this.length + 1) * Array.SIZE_RATIO);\n }\n memory.copy(this.ptr + index + 1, this.ptr + index, this.length - index);\n memory.set(this.ptr + index, value);\n this.length++;\n }", "title": "" }, { "docid": "3922ea3ef44b9716df1cc16967367db5", "score": "0.64970547", "text": "addAt(index,data){\n if(index === 0) return this.addFirst(data);\n if(index === this.size-1) return this.addLast(data);\n if(index < 0 || index > this.size) throw new RangeError(\"Index is out of bounds.\");\n let current = this.head;\n for(let i = 0; i < index-1; i++){\n current = current.next;\n }\n let node = new SinglyNode(data);\n let next = current.next;\n current.next = node;\n node.next = next;\n this.size++;\n }", "title": "" }, { "docid": "0785f90901dbd4e3d0f21164d0be7940", "score": "0.6494871", "text": "insertAtPosition(position, nodeToInsert) {\n if(position > this.length + 1 || !position || !nodeToInsert)\n return\n\n if(position === 1) {\n this.setHead(nodeToInsert)\n return\n }\n\n let curr = this.head, currPost = 1\n while(curr && currPost++ < position)\n curr = curr.next\n\n if(curr) this.insertBefore(curr, nodeToInsert)\n else this.setTail(nodeToInsert)\n\n }", "title": "" } ]
11a845b6bc2bfa4174ab865be9a9259e
Returns a function, that, as long as it continues to be invoked, will not be triggered. The function will be called after it stops being called for N milliseconds.
[ { "docid": "b732c925dfc32c3f7ee2c4f2b5e1b29a", "score": "0.0", "text": "function debounce(func, wait) {\n var timeoutId;\n var args;\n var context;\n var timestamp; // of most recent call\n var later = function () {\n var last = +new Date() - timestamp;\n if (last < wait && last > 0) {\n timeoutId = setTimeout(later, wait - last);\n }\n else {\n timeoutId = null;\n func.apply(context, args);\n if (!timeoutId) {\n context = args = null;\n }\n }\n };\n\n return function () {\n context = this;\n args = arguments;\n timestamp = +new Date();\n if (!timeoutId) {\n timeoutId = setTimeout(later, wait);\n }\n };\n }", "title": "" } ]
[ { "docid": "8b857f16596c805872d7e33c2be9df9b", "score": "0.6124475", "text": "function decoratedFunc() {\n try {\n delete sc.timers[timeout.$$timeoutId];\n return func();\n } catch (e) {\n console.info(e);\n }\n }", "title": "" }, { "docid": "b17e38685feff83411e8887d38e1c610", "score": "0.60686374", "text": "static infinityLooper(Function, delay, ...funcArgs) {\n return new TimerInfinityReapeter(Function, delay, ...funcArgs)\n }", "title": "" }, { "docid": "ef459c42086e15695ada9135c37db50c", "score": "0.60452515", "text": "function myFunction(e){time_out = 1;}", "title": "" }, { "docid": "bbeee6ea9d1b735cce9e359caf419b0d", "score": "0.5938094", "text": "sleep() {\n // Useless in this case => do nothing\n }", "title": "" }, { "docid": "1f38720edb67c88aa587a3f9c48f3e2a", "score": "0.5921443", "text": "function stopWatch(){\n let count = 0;\n return function(){\n count++;\n return count;\n }\n}", "title": "" }, { "docid": "8a37965191d01fc1e7d3f42f616515f4", "score": "0.58975095", "text": "skipDelay(){return this.handleDelayElapsed();}", "title": "" }, { "docid": "466878a91dc85fd8c07fb61f9577fd47", "score": "0.5874014", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function() {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "7f28cf298879a019ba24bba25b9d464c", "score": "0.5867548", "text": "function debounce(f, n){\n setTimeout(() => {\n f()\n }, n)\n}", "title": "" }, { "docid": "cd94e5df1feb7499bb4c94ac1207d302", "score": "0.5860573", "text": "function debounce(quietMillis, fn, ctx) {\r\n ctx = ctx || undefined;\r\n var timeout;\r\n return function () {\r\n var args = arguments;\r\n window.clearTimeout(timeout);\r\n timeout = window.setTimeout(function () {\r\n fn.apply(ctx, args);\r\n }, quietMillis);\r\n };\r\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "b6d4d583ae3f058f7961c4aba82551ce", "score": "0.5859501", "text": "function debounce(quietMillis, fn, ctx) {\n ctx = ctx || undefined;\n var timeout;\n return function () {\n var args = arguments;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n fn.apply(ctx, args);\n }, quietMillis);\n };\n }", "title": "" }, { "docid": "78aaf742b380549101ffe391e99565a7", "score": "0.5854488", "text": "function limitedRepeat() {\n // ADD CODE HERE\n const intervalID = setInterval(sayHiNow, 1000);\n setTimeout(clearFun, 5000, intervalID);\n\n // another approach\n // const intervalId = setInterval(() => console.log('hi for now'), 1000);\n // setTimeout(intervalId => clearInterval(intervalId), 5000, intervalId);\n\n // third approach\n // let counter = 0;\n // const intervalId = setInterval(() => {\n // console.log('hi for now');\n // counter++;\n // if (counter > 4) {\n // clearInterval(intervalId);\n // }\n // },1000)\n}", "title": "" }, { "docid": "a176208f6ffeb191ae8e7fbbfa1f9451", "score": "0.58377475", "text": "function throttle(delay){\n let lastTime = 0;\n return function(){\n let curTime = new Date().getTime()\n if(curTime - lastTime < delay){\n return;\n }\n lastTime = curTime;\n setTimeout(()=>{\n console.log(9999)\n },delay)\n }\n}", "title": "" }, { "docid": "fe17d161d3665a8ed3502237c5103573", "score": "0.5802438", "text": "static infinityLooperInstant(Function, delay, ...funcArgs) {\n return new TimerInfinityReapeterInstant(Function, delay, ...funcArgs)\n }", "title": "" }, { "docid": "25a49dbb370813e9d236bde84c5927a3", "score": "0.5755781", "text": "function debounce(quietMillis, fn, ctx) {\n\t ctx = ctx || undefined;\n\t var timeout;\n\t return function () {\n\t var args = arguments;\n\t window.clearTimeout(timeout);\n\t timeout = window.setTimeout(function () {\n\t fn.apply(ctx, args);\n\t }, quietMillis);\n\t };\n\t }", "title": "" }, { "docid": "c836a2bcbd09eceb4f466e5adc2562ef", "score": "0.57376087", "text": "think(){\n if(this.actionStillRunning){\n return\n }\n }", "title": "" }, { "docid": "f69652c2e5f9725c6e3b6fa3c7b7f5e6", "score": "0.57334536", "text": "function fireEvery() {\n var currentCount = 0;\n return function(steps) {\n if (currentCount >= steps) {\n currentCount = 0;\n return true;\n } else {\n currentCount++;\n return false;\n }\n };\n}", "title": "" }, { "docid": "6a48f37d81de789907f3d92bdab49d27", "score": "0.5702032", "text": "function myFunction(){\n // this code will be called in 5 seconds' time\n}", "title": "" }, { "docid": "a9366c759c3f1a1e618bb4f26f13d37b", "score": "0.5655726", "text": "function createDelayMethod(number) {\n return function() {\n // do something...\n };\n}", "title": "" }, { "docid": "7e4aa3da1c227ebd9d16d5f38be62463", "score": "0.5650816", "text": "function start(f, callback, timeout) {\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\n // type instead of a bunch of functions with state shared in the closure)\n var waitSeconds = 1;\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\n var timeoutId = null;\n var hitTimeout = false;\n var cancelState = 0;\n function canceled() {\n return cancelState === 2;\n }\n var triggeredCallback = false;\n function triggerCallback() {\n if (!triggeredCallback) {\n triggeredCallback = true;\n callback.apply(null, arguments);\n }\n }\n function callWithDelay(millis) {\n timeoutId = setTimeout(function () {\n timeoutId = null;\n f(handler, canceled());\n }, millis);\n }\n function handler(success) {\n var var_args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n var_args[_i - 1] = arguments[_i];\n }\n if (triggeredCallback) {\n return;\n }\n if (success) {\n triggerCallback.apply(null, arguments);\n return;\n }\n var mustStop = canceled() || hitTimeout;\n if (mustStop) {\n triggerCallback.apply(null, arguments);\n return;\n }\n if (waitSeconds < 64) {\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\n waitSeconds *= 2;\n }\n var waitMillis;\n if (cancelState === 1) {\n cancelState = 2;\n waitMillis = 0;\n }\n else {\n waitMillis = (waitSeconds + Math.random()) * 1000;\n }\n callWithDelay(waitMillis);\n }\n var stopped = false;\n function stop(wasTimeout) {\n if (stopped) {\n return;\n }\n stopped = true;\n if (triggeredCallback) {\n return;\n }\n if (timeoutId !== null) {\n if (!wasTimeout) {\n cancelState = 2;\n }\n clearTimeout(timeoutId);\n callWithDelay(0);\n }\n else {\n if (!wasTimeout) {\n cancelState = 1;\n }\n }\n }\n callWithDelay(0);\n setTimeout(function () {\n hitTimeout = true;\n stop(true);\n }, timeout);\n return stop;\n}", "title": "" }, { "docid": "7e4aa3da1c227ebd9d16d5f38be62463", "score": "0.5650816", "text": "function start(f, callback, timeout) {\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\n // type instead of a bunch of functions with state shared in the closure)\n var waitSeconds = 1;\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\n var timeoutId = null;\n var hitTimeout = false;\n var cancelState = 0;\n function canceled() {\n return cancelState === 2;\n }\n var triggeredCallback = false;\n function triggerCallback() {\n if (!triggeredCallback) {\n triggeredCallback = true;\n callback.apply(null, arguments);\n }\n }\n function callWithDelay(millis) {\n timeoutId = setTimeout(function () {\n timeoutId = null;\n f(handler, canceled());\n }, millis);\n }\n function handler(success) {\n var var_args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n var_args[_i - 1] = arguments[_i];\n }\n if (triggeredCallback) {\n return;\n }\n if (success) {\n triggerCallback.apply(null, arguments);\n return;\n }\n var mustStop = canceled() || hitTimeout;\n if (mustStop) {\n triggerCallback.apply(null, arguments);\n return;\n }\n if (waitSeconds < 64) {\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\n waitSeconds *= 2;\n }\n var waitMillis;\n if (cancelState === 1) {\n cancelState = 2;\n waitMillis = 0;\n }\n else {\n waitMillis = (waitSeconds + Math.random()) * 1000;\n }\n callWithDelay(waitMillis);\n }\n var stopped = false;\n function stop(wasTimeout) {\n if (stopped) {\n return;\n }\n stopped = true;\n if (triggeredCallback) {\n return;\n }\n if (timeoutId !== null) {\n if (!wasTimeout) {\n cancelState = 2;\n }\n clearTimeout(timeoutId);\n callWithDelay(0);\n }\n else {\n if (!wasTimeout) {\n cancelState = 1;\n }\n }\n }\n callWithDelay(0);\n setTimeout(function () {\n hitTimeout = true;\n stop(true);\n }, timeout);\n return stop;\n}", "title": "" }, { "docid": "7e4aa3da1c227ebd9d16d5f38be62463", "score": "0.5650816", "text": "function start(f, callback, timeout) {\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\n // type instead of a bunch of functions with state shared in the closure)\n var waitSeconds = 1;\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\n var timeoutId = null;\n var hitTimeout = false;\n var cancelState = 0;\n function canceled() {\n return cancelState === 2;\n }\n var triggeredCallback = false;\n function triggerCallback() {\n if (!triggeredCallback) {\n triggeredCallback = true;\n callback.apply(null, arguments);\n }\n }\n function callWithDelay(millis) {\n timeoutId = setTimeout(function () {\n timeoutId = null;\n f(handler, canceled());\n }, millis);\n }\n function handler(success) {\n var var_args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n var_args[_i - 1] = arguments[_i];\n }\n if (triggeredCallback) {\n return;\n }\n if (success) {\n triggerCallback.apply(null, arguments);\n return;\n }\n var mustStop = canceled() || hitTimeout;\n if (mustStop) {\n triggerCallback.apply(null, arguments);\n return;\n }\n if (waitSeconds < 64) {\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\n waitSeconds *= 2;\n }\n var waitMillis;\n if (cancelState === 1) {\n cancelState = 2;\n waitMillis = 0;\n }\n else {\n waitMillis = (waitSeconds + Math.random()) * 1000;\n }\n callWithDelay(waitMillis);\n }\n var stopped = false;\n function stop(wasTimeout) {\n if (stopped) {\n return;\n }\n stopped = true;\n if (triggeredCallback) {\n return;\n }\n if (timeoutId !== null) {\n if (!wasTimeout) {\n cancelState = 2;\n }\n clearTimeout(timeoutId);\n callWithDelay(0);\n }\n else {\n if (!wasTimeout) {\n cancelState = 1;\n }\n }\n }\n callWithDelay(0);\n setTimeout(function () {\n hitTimeout = true;\n stop(true);\n }, timeout);\n return stop;\n}", "title": "" }, { "docid": "7e4aa3da1c227ebd9d16d5f38be62463", "score": "0.5650816", "text": "function start(f, callback, timeout) {\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\n // type instead of a bunch of functions with state shared in the closure)\n var waitSeconds = 1;\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\n var timeoutId = null;\n var hitTimeout = false;\n var cancelState = 0;\n function canceled() {\n return cancelState === 2;\n }\n var triggeredCallback = false;\n function triggerCallback() {\n if (!triggeredCallback) {\n triggeredCallback = true;\n callback.apply(null, arguments);\n }\n }\n function callWithDelay(millis) {\n timeoutId = setTimeout(function () {\n timeoutId = null;\n f(handler, canceled());\n }, millis);\n }\n function handler(success) {\n var var_args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n var_args[_i - 1] = arguments[_i];\n }\n if (triggeredCallback) {\n return;\n }\n if (success) {\n triggerCallback.apply(null, arguments);\n return;\n }\n var mustStop = canceled() || hitTimeout;\n if (mustStop) {\n triggerCallback.apply(null, arguments);\n return;\n }\n if (waitSeconds < 64) {\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\n waitSeconds *= 2;\n }\n var waitMillis;\n if (cancelState === 1) {\n cancelState = 2;\n waitMillis = 0;\n }\n else {\n waitMillis = (waitSeconds + Math.random()) * 1000;\n }\n callWithDelay(waitMillis);\n }\n var stopped = false;\n function stop(wasTimeout) {\n if (stopped) {\n return;\n }\n stopped = true;\n if (triggeredCallback) {\n return;\n }\n if (timeoutId !== null) {\n if (!wasTimeout) {\n cancelState = 2;\n }\n clearTimeout(timeoutId);\n callWithDelay(0);\n }\n else {\n if (!wasTimeout) {\n cancelState = 1;\n }\n }\n }\n callWithDelay(0);\n setTimeout(function () {\n hitTimeout = true;\n stop(true);\n }, timeout);\n return stop;\n}", "title": "" }, { "docid": "7e4aa3da1c227ebd9d16d5f38be62463", "score": "0.5650816", "text": "function start(f, callback, timeout) {\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\n // type instead of a bunch of functions with state shared in the closure)\n var waitSeconds = 1;\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\n var timeoutId = null;\n var hitTimeout = false;\n var cancelState = 0;\n function canceled() {\n return cancelState === 2;\n }\n var triggeredCallback = false;\n function triggerCallback() {\n if (!triggeredCallback) {\n triggeredCallback = true;\n callback.apply(null, arguments);\n }\n }\n function callWithDelay(millis) {\n timeoutId = setTimeout(function () {\n timeoutId = null;\n f(handler, canceled());\n }, millis);\n }\n function handler(success) {\n var var_args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n var_args[_i - 1] = arguments[_i];\n }\n if (triggeredCallback) {\n return;\n }\n if (success) {\n triggerCallback.apply(null, arguments);\n return;\n }\n var mustStop = canceled() || hitTimeout;\n if (mustStop) {\n triggerCallback.apply(null, arguments);\n return;\n }\n if (waitSeconds < 64) {\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\n waitSeconds *= 2;\n }\n var waitMillis;\n if (cancelState === 1) {\n cancelState = 2;\n waitMillis = 0;\n }\n else {\n waitMillis = (waitSeconds + Math.random()) * 1000;\n }\n callWithDelay(waitMillis);\n }\n var stopped = false;\n function stop(wasTimeout) {\n if (stopped) {\n return;\n }\n stopped = true;\n if (triggeredCallback) {\n return;\n }\n if (timeoutId !== null) {\n if (!wasTimeout) {\n cancelState = 2;\n }\n clearTimeout(timeoutId);\n callWithDelay(0);\n }\n else {\n if (!wasTimeout) {\n cancelState = 1;\n }\n }\n }\n callWithDelay(0);\n setTimeout(function () {\n hitTimeout = true;\n stop(true);\n }, timeout);\n return stop;\n}", "title": "" }, { "docid": "7e4aa3da1c227ebd9d16d5f38be62463", "score": "0.5650816", "text": "function start(f, callback, timeout) {\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\n // type instead of a bunch of functions with state shared in the closure)\n var waitSeconds = 1;\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\n var timeoutId = null;\n var hitTimeout = false;\n var cancelState = 0;\n function canceled() {\n return cancelState === 2;\n }\n var triggeredCallback = false;\n function triggerCallback() {\n if (!triggeredCallback) {\n triggeredCallback = true;\n callback.apply(null, arguments);\n }\n }\n function callWithDelay(millis) {\n timeoutId = setTimeout(function () {\n timeoutId = null;\n f(handler, canceled());\n }, millis);\n }\n function handler(success) {\n var var_args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n var_args[_i - 1] = arguments[_i];\n }\n if (triggeredCallback) {\n return;\n }\n if (success) {\n triggerCallback.apply(null, arguments);\n return;\n }\n var mustStop = canceled() || hitTimeout;\n if (mustStop) {\n triggerCallback.apply(null, arguments);\n return;\n }\n if (waitSeconds < 64) {\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\n waitSeconds *= 2;\n }\n var waitMillis;\n if (cancelState === 1) {\n cancelState = 2;\n waitMillis = 0;\n }\n else {\n waitMillis = (waitSeconds + Math.random()) * 1000;\n }\n callWithDelay(waitMillis);\n }\n var stopped = false;\n function stop(wasTimeout) {\n if (stopped) {\n return;\n }\n stopped = true;\n if (triggeredCallback) {\n return;\n }\n if (timeoutId !== null) {\n if (!wasTimeout) {\n cancelState = 2;\n }\n clearTimeout(timeoutId);\n callWithDelay(0);\n }\n else {\n if (!wasTimeout) {\n cancelState = 1;\n }\n }\n }\n callWithDelay(0);\n setTimeout(function () {\n hitTimeout = true;\n stop(true);\n }, timeout);\n return stop;\n}", "title": "" }, { "docid": "7e4aa3da1c227ebd9d16d5f38be62463", "score": "0.5650816", "text": "function start(f, callback, timeout) {\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\n // type instead of a bunch of functions with state shared in the closure)\n var waitSeconds = 1;\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\n var timeoutId = null;\n var hitTimeout = false;\n var cancelState = 0;\n function canceled() {\n return cancelState === 2;\n }\n var triggeredCallback = false;\n function triggerCallback() {\n if (!triggeredCallback) {\n triggeredCallback = true;\n callback.apply(null, arguments);\n }\n }\n function callWithDelay(millis) {\n timeoutId = setTimeout(function () {\n timeoutId = null;\n f(handler, canceled());\n }, millis);\n }\n function handler(success) {\n var var_args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n var_args[_i - 1] = arguments[_i];\n }\n if (triggeredCallback) {\n return;\n }\n if (success) {\n triggerCallback.apply(null, arguments);\n return;\n }\n var mustStop = canceled() || hitTimeout;\n if (mustStop) {\n triggerCallback.apply(null, arguments);\n return;\n }\n if (waitSeconds < 64) {\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\n waitSeconds *= 2;\n }\n var waitMillis;\n if (cancelState === 1) {\n cancelState = 2;\n waitMillis = 0;\n }\n else {\n waitMillis = (waitSeconds + Math.random()) * 1000;\n }\n callWithDelay(waitMillis);\n }\n var stopped = false;\n function stop(wasTimeout) {\n if (stopped) {\n return;\n }\n stopped = true;\n if (triggeredCallback) {\n return;\n }\n if (timeoutId !== null) {\n if (!wasTimeout) {\n cancelState = 2;\n }\n clearTimeout(timeoutId);\n callWithDelay(0);\n }\n else {\n if (!wasTimeout) {\n cancelState = 1;\n }\n }\n }\n callWithDelay(0);\n setTimeout(function () {\n hitTimeout = true;\n stop(true);\n }, timeout);\n return stop;\n}", "title": "" }, { "docid": "8b0d8967d3e10f6f72927725d021baa0", "score": "0.56474996", "text": "function debounce(fn) {\n var lastCallTime = -Infinity;\n var lastResult;\n\n return function() {\n if (Date.now() - lastCallTime < debounce.MEMOIZE_PERIOD_MS) {\n return lastResult;\n } else {\n lastCallTime = Date.now();\n lastResult = fn.apply(this, arguments);\n return lastResult;\n }\n };\n}", "title": "" }, { "docid": "6f1a524e704f693351ab9789f4d059ba", "score": "0.56459486", "text": "function delayed() {\n // if we're executing at the end of the detection period\n if (!execAsap) {\n // execute now\n func.apply(obj, args);\n }\n // clear timeout handle\n timeout = null;\n }", "title": "" }, { "docid": "7f3b5472777b2cfef5347e8e36f36b77", "score": "0.5638973", "text": "function burnout(func) {\n\t\tvar burnedOut = false;\n\t\treturn function(evt) {\n\t\t\tif(burnedOut) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tburnedOut = true;\n\t\t\twindow.setTimeout(function() {burnedOut = false;}, 40);\n\t\t\treturn func.apply(this, evt);\n\t\t}\n\t}", "title": "" }, { "docid": "bb1c475ba340615051ad83f5ca63adb6", "score": "0.56358945", "text": "function waitFunction (waitTime){\n clearTimeout();\n setTimeout( function(){}, waitTime * 1000);\n}", "title": "" }, { "docid": "3c3e2a5abc2efd39881b4e7e9f5da1c2", "score": "0.5626413", "text": "function sayHiLater(anyFunctionReference){\n //simulate code running\n //take some time...\n //and mor time...\n anyFunctionReference();\n}", "title": "" }, { "docid": "70fdb85837046c35be5d52c6e775115f", "score": "0.5618566", "text": "function runSoon(f) {\n setTimeout(f, 0);\n}", "title": "" }, { "docid": "e327fc34d6214ae56bef0277582caa96", "score": "0.56088537", "text": "timeoutCallback() {\n removeCallback();\n }", "title": "" }, { "docid": "1b265ac30c9a8672182159572af541cc", "score": "0.55970794", "text": "function wrapper(fn, time, cb) {\n\treturn function() {\n\t\tif (time-- < 0) return\n\t\tfn.apply(this, arguments)\n\t\tif (time <= 0) cb && cb.apply(this, arguments)\n\t}\n}", "title": "" }, { "docid": "3a556e5c92367e9e5c73ba2e4c73c7c7", "score": "0.5577997", "text": "function debounce(fn) {\n let timer,\n ab = \"\";\n return function () {\n ab += arguments[0];\n clearTimeout(timer);\n timer = setTimeout(() => fn.apply(this, [ab]), 2000);\n };\n}", "title": "" }, { "docid": "8350d60e0d4eb2bd31e48e2820c08222", "score": "0.557133", "text": "function debounceSimple(callback, timeToWait) {\n var currentTimeoutRuning;\n\n return function() {\n clearTimeout(currentTimeoutRuning);\n currentTimeoutRuning = setTimeout(callback, timeToWait || 0);\n }\n}", "title": "" }, { "docid": "686768026134e3e85e861b9faab2ced6", "score": "0.5564257", "text": "onTimer_() {\n this.timer_ = null;\n\n if (this.shouldFire_ && !this.pauseCount_) {\n this.shouldFire_ = false;\n this.doAction_();\n }\n }", "title": "" }, { "docid": "884374330a9826697def429ac7a42261", "score": "0.55601037", "text": "function debounce() {\n var date = Date.now();\n return function(timeToPass) {\n var dateTest = Date.now();\n var timePassed = dateTest-date;\n\n if (timePassed > timeToPass) {\n date = Date.now();\n return true; \n }\n else {\n return false; \n } \n }; \n}", "title": "" }, { "docid": "5d8183303f1177ced470ff19d5d024cf", "score": "0.5558252", "text": "function fn4() {\n console.log('timeout da fn4')\n}", "title": "" }, { "docid": "3a580d7a272f0132ad2a055dd3000ec4", "score": "0.55538595", "text": "function throttle(fn, wait) {\n var time = Date.now();\n return function () {\n if ((time + wait - Date.now()) < 0) {\n fn();\n time = Date.now();\n }\n }\n }", "title": "" }, { "docid": "5cd4473a48295031314901021c6081d2", "score": "0.5552665", "text": "function wrapper(fn, time, cb) {\n\treturn function () {\n\t\tfn.apply(this, arguments);\n\t\tif (time-- <= 0) {\n\t\t\tcb.apply(this, arguments);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "27bd9d00b6bf008549152bd7bfbcbca2", "score": "0.55488753", "text": "onTimeOut() {\n if (this.exhausted) {\n this.stop();\n return;\n }\n\n this.roll();\n }", "title": "" }, { "docid": "8a9c08e975196f3d96713b311ebc2845", "score": "0.55469775", "text": "function a(){o&&clearTimeout(o)}", "title": "" }, { "docid": "b1aa5e5243ae3f788ad1b98b20bca0b7", "score": "0.5535832", "text": "function retryUntil(f, __trace) {\n return self => retryUntil_(self, f, __trace);\n}", "title": "" }, { "docid": "166b1dc442deefe2a03a8ea0d4d16575", "score": "0.55354977", "text": "function scheduleDeferredCallback(fn) {\n setTimeout(fn, 0, { timeRemaining: function timeRemaining() {\n return Infinity;\n } });\n}", "title": "" }, { "docid": "e69793adf095f4dbc92e4858d81f39c7", "score": "0.5527801", "text": "function delayer (fn, varTimer, ifNaN = 100) {\n function toInt (el) { return /^[0-9]+$/.test(el) ? Number(el) || 1 : null }\n var timerId\n return function (...args) {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n fn.apply(this, args)\n }, toInt(varTimer) || toInt(this[varTimer]) || ifNaN)\n }\n}", "title": "" }, { "docid": "bb3895ea994ce0c6797d202516bd62a5", "score": "0.5518189", "text": "skipDelay() {\n return this.handleDelayElapsed();\n }", "title": "" }, { "docid": "33da9adba590327727f7b70f41cd0226", "score": "0.5506122", "text": "function start(f, callback, timeout) {\r\n // TODO(andysoto): make this code cleaner (probably refactor into an actual\r\n // type instead of a bunch of functions with state shared in the closure)\r\n var waitSeconds = 1;\r\n // Would type this as \"number\" but that doesn't work for Node so ¯\\_(ツ)_/¯\r\n var timeoutId = null;\r\n var hitTimeout = false;\r\n var cancelState = 0;\r\n function canceled() {\r\n return cancelState === 2;\r\n }\r\n var triggeredCallback = false;\r\n function triggerCallback() {\r\n if (!triggeredCallback) {\r\n triggeredCallback = true;\r\n callback.apply(null, arguments);\r\n }\r\n }\r\n function callWithDelay(millis) {\r\n timeoutId = setTimeout(function () {\r\n timeoutId = null;\r\n f(handler, canceled());\r\n }, millis);\r\n }\r\n function handler(success) {\r\n var var_args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n var_args[_i - 1] = arguments[_i];\r\n }\r\n if (triggeredCallback) {\r\n return;\r\n }\r\n if (success) {\r\n triggerCallback.apply(null, arguments);\r\n return;\r\n }\r\n var mustStop = canceled() || hitTimeout;\r\n if (mustStop) {\r\n triggerCallback.apply(null, arguments);\r\n return;\r\n }\r\n if (waitSeconds < 64) {\r\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\r\n waitSeconds *= 2;\r\n }\r\n var waitMillis;\r\n if (cancelState === 1) {\r\n cancelState = 2;\r\n waitMillis = 0;\r\n }\r\n else {\r\n waitMillis = (waitSeconds + Math.random()) * 1000;\r\n }\r\n callWithDelay(waitMillis);\r\n }\r\n var stopped = false;\r\n function stop(wasTimeout) {\r\n if (stopped) {\r\n return;\r\n }\r\n stopped = true;\r\n if (triggeredCallback) {\r\n return;\r\n }\r\n if (timeoutId !== null) {\r\n if (!wasTimeout) {\r\n cancelState = 2;\r\n }\r\n clearTimeout(timeoutId);\r\n callWithDelay(0);\r\n }\r\n else {\r\n if (!wasTimeout) {\r\n cancelState = 1;\r\n }\r\n }\r\n }\r\n callWithDelay(0);\r\n setTimeout(function () {\r\n hitTimeout = true;\r\n stop(true);\r\n }, timeout);\r\n return stop;\r\n}", "title": "" }, { "docid": "454433a4ce7307eea9d4eeb8e5c61f41", "score": "0.5500156", "text": "function debounce(func, wait = 20) {\r\n var timeout;\r\n return function() {\r\n // console.log('----- START -----');\r\n var context = this, args = arguments;\r\n var later = function() {\r\n // console.log(`RAZ du timeout (${timeout})`);\r\n timeout = null;\r\n };\r\n var callNow = !timeout;\r\n // console.log('clear timeout: ', timeout);\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n // console.log('set timeout: ', timeout);\r\n if (callNow) {\r\n func.apply(context, args);\r\n }\r\n // console.log('----- STOP -----');\r\n };\r\n}", "title": "" }, { "docid": "f588a6d9d09b943f051f15cac5cc8ebe", "score": "0.5495722", "text": "function countDownNoLoop(time) {\n if (time > 0) {\n setTimeout(function(){\n console.log(time)\n time--\n countDownNoLoop(time)\n }, 1000);\n } else {\n setTimeout(function(){\n console.log(\"Lift-Off!\")\n }, 1000);\n }\n}", "title": "" }, { "docid": "6f3e3eed70357735e89139e97f879a46", "score": "0.54934", "text": "function throttle(fn) {\r\n let scheduled = false;\r\n return () => {\r\n if (!scheduled) {\r\n scheduled = true;\r\n requestAnimationFrame(() => {\r\n scheduled = false;\r\n fn();\r\n });\r\n }\r\n };\r\n}", "title": "" }, { "docid": "c402aa0186d5ada38ef4b784f525ee40", "score": "0.5487175", "text": "static looper(Function, delay, numberOfLoop, ...funcArgs) {\n return new TimerReapeter(Function, delay, numberOfLoop, ...funcArgs)\n }", "title": "" }, { "docid": "ce801158e69d295db1eb212beafa6018", "score": "0.5486566", "text": "function myTimeoutFunction()\n{\n doStuff();\n}", "title": "" }, { "docid": "622994eb8a1c9871195e67957bb37a3d", "score": "0.5464336", "text": "function $o(f,t,i){return i?setInterval(f,t):((T(t,3))?setTimeout(f,t):(t?clearInterval(f):clearTimeout(f)))}", "title": "" }, { "docid": "817158bbf083659f9112af1cd935ee62", "score": "0.54517823", "text": "function funWithCallback(callback) {\n return setTimeout(callback,0);\n}", "title": "" }, { "docid": "280897922838e744202d873667e87895", "score": "0.54382074", "text": "function delayEvent(func, threshold) {\n\t\tvar timeout;\n\t\tthreshold = threshold || 100;\n\n\t\treturn function() {\n\t\t\tvar obj = this, args = arguments;\n\n\t\t\tif (timeout) clearTimeout(timeout);\n\n\t\t\ttimeout = setTimeout(function() {\n\t\t\t\tfunc.apply(obj, args);\n\t\t\t\ttimeout = null;\n\t\t\t}, threshold);\n\t\t};\n\t}", "title": "" }, { "docid": "44af4501a9595d05b3d170cfd9564ea1", "score": "0.54195374", "text": "function onTimerEvent() {\n\t\tif(!options.currentlyExecuting) {\n\t\t\ttry {\n\t\t\t\toptions.currentlyExecuting = true;\n\t\t\t\toptions.callback();\n\t\t\t\toptions.currentlyExecuting = false;\n\t\t\t} catch(e) {\n\t\t\t\toptions.currentlyExecuting = false;\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c6593481b2bb6562bc3555a23762a25f", "score": "0.5418135", "text": "static Debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "title": "" }, { "docid": "855923f5af190c9ed3f9b253dd87b98d", "score": "0.54144824", "text": "static looperInstantRunAfter(Function, delay, numberOfLoop, ...funcArgs) {\n return new TimerReapeaterInstantWithFunctionAfter(Function, delay, numberOfLoop, ...funcArgs)\n }", "title": "" }, { "docid": "79d86484516c5e39427d832715d79e67", "score": "0.5409102", "text": "debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n }\n }", "title": "" }, { "docid": "3474e5281b6e4e4428db1bacc4e5c58a", "score": "0.5403046", "text": "static looperRunAfter(Function, delay, numberOfLoop, ...funcArgs) {\n return new TimerReapeaterWithFunctionAfter(Function, delay, numberOfLoop, ...funcArgs)\n }", "title": "" }, { "docid": "cc20c33c7b8d3ce24114b4934f30338a", "score": "0.5395911", "text": "debounce(func, wait, immediate) {\n var timeout;\n return () => {\n var context = this,\n args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }", "title": "" }, { "docid": "9c657427ef500c4e4b2a62f0127a11ce", "score": "0.5388932", "text": "delay (n) {\n return delay(n, this)\n }", "title": "" }, { "docid": "bcd1ef34eb801887620bee227fc46419", "score": "0.537447", "text": "function dont_wait_anymore() {\n\t\t\tstop_waiting();\n\t\t}", "title": "" }, { "docid": "26add9e8c9935db52aaea92c89ba3adc", "score": "0.5368746", "text": "function protectAgainstInfiniteLoops(func) {\n\tvar counter = 0;\n\treturn function() {\n\t\tcounter += 1;\n\t\tif (counter > 10) {\n\t\t\tthrow new Error(\"Infinite loop\");\n\t\t}\n\t\treturn func.apply(null, arguments);\n\t};\n}", "title": "" }, { "docid": "4519b20287a2a5a46c65cce84262e293", "score": "0.5360723", "text": "function once(fn){\n\n var innerResult;\n var shouldRun = true;\n \n\treturn function () {\n \t\n \tif (shouldRun) {\n \tshouldRun = false;\n innerResult = fn.apply(null, arguments);\n }\n \n \treturn innerResult \n }\n}", "title": "" }, { "docid": "1565049bd26228ab1abf1b9c7913ce91", "score": "0.5353701", "text": "function clearTimeout(t)\n{\n}", "title": "" }, { "docid": "e2858ccfc54b98eb650ac867ab58aeca", "score": "0.5351733", "text": "function retryUntil_(self, f, __trace) {\n return retryUntilM_(self, a => core.succeed(f(a)), __trace);\n}", "title": "" }, { "docid": "f329be7f151f709ab87be4bcd5d6398c", "score": "0.53516895", "text": "sleep() {}", "title": "" }, { "docid": "f329be7f151f709ab87be4bcd5d6398c", "score": "0.53516895", "text": "sleep() {}", "title": "" }, { "docid": "700f945c4fdaf9e8bc11f200fa1f5bc0", "score": "0.5346528", "text": "async function foreverNative(targetFunction) {\n let i = true;\n while (i) {\n (async function f() {\n try {\n const result = await targetFunction();\n } catch (error) {\n i = false;\n console.log(error.message);\n }\n })();\n }\n setTimeout(() => {\n targetFunction();\n }, 10 * 1000);\n }", "title": "" }, { "docid": "cc2ef4269f5d4e16a8b60bbf2ff72cab", "score": "0.5344851", "text": "function debounce(func){\n var queued = false;\n return function () {\n if(!queued){\n queued = true;\n setTimeout(function () {\n queued = false;\n func();\n }, 0);\n }\n };\n }", "title": "" }, { "docid": "44c848a00a55a0ebb887dc8b7fe84218", "score": "0.5334417", "text": "function l(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var p=this,f=Date.now()-s;// Execute `callback` and update the `lastExec` timestamp.\nfunction h(){s=Date.now(),r.apply(p,c)}\n/*\n\t * If `debounceMode` is true (at begin) this is used to clear the flag\n\t * to allow future `callback` executions.\n\t */function d(){o=void 0}n||(i&&!o&&\n/*\n\t * Since `wrapper` is being called for the first time and\n\t * `debounceMode` is true (at begin), execute `callback`.\n\t */\nh(),a(),void 0===i&&f>e?\n/*\n\t * In throttle mode, if `delay` time has been exceeded, execute\n\t * `callback`.\n\t */\nh():!0!==t&&(\n/*\n\t * In trailing throttle mode, since `delay` time has not been\n\t * exceeded, schedule `callback` to execute `delay` ms after most\n\t * recent execution.\n\t *\n\t * If `debounceMode` is true (at begin), schedule `clear` to execute\n\t * after `delay` ms.\n\t *\n\t * If `debounceMode` is false (at end), schedule `callback` to\n\t * execute after `delay` ms.\n\t */\no=setTimeout(i?d:h,void 0===i?e-f:e)))}// Return the wrapper function.", "title": "" }, { "docid": "62d0055839267988cbbbcd2fa92ad462", "score": "0.5333435", "text": "function delay(fn, ms){\n let timer = 0\n return function(...args) {\n clearTimeout(timer)\n timer = setTimeout(fn.bind(this, ...args), ms || 0)\n }\n}", "title": "" }, { "docid": "8241257c11b8d71458529f213fe581f0", "score": "0.53285277", "text": "function cancelize(fn) {\n return function cancelized() {\n if (!arguments.length) {\n throw new Error('cancelized: expected at least one argument');\n }\n var args = Array.prototype.slice.call(arguments, 0);\n var done = args[args.length - 1] = once(args[args.length - 1]);\n\n function cancel() {\n done.apply(null, arguments);\n }\n\n fn.apply(null, args);\n\n return cancel;\n };\n}", "title": "" }, { "docid": "8241257c11b8d71458529f213fe581f0", "score": "0.53285277", "text": "function cancelize(fn) {\n return function cancelized() {\n if (!arguments.length) {\n throw new Error('cancelized: expected at least one argument');\n }\n var args = Array.prototype.slice.call(arguments, 0);\n var done = args[args.length - 1] = once(args[args.length - 1]);\n\n function cancel() {\n done.apply(null, arguments);\n }\n\n fn.apply(null, args);\n\n return cancel;\n };\n}", "title": "" }, { "docid": "49c074773e5d77b64a8bac846d847fe5", "score": "0.53254783", "text": "function StopWatch () {\n}", "title": "" }, { "docid": "b959da2ebcf60458e34b58443b5e98ef", "score": "0.532441", "text": "function debounce( fn, threshold ) {\nvar timeout;\nreturn function debounced() {\n if ( timeout ) {\n clearTimeout( timeout );\n }\n function delayed() {\n fn();\n timeout = null;\n }\n timeout = setTimeout( delayed, threshold || 100 );\n}\n}", "title": "" }, { "docid": "61b0cc413d542c329762435d39f74613", "score": "0.53242284", "text": "function checkTime(func) {\n var timer;\n return function(event) {\n if (timer) clearTimeout(timer);\n timer = setTimeout(func, 100, event);\n };\n}", "title": "" }, { "docid": "89bd74be152c1b44b5aaa86e7bad6349", "score": "0.5323374", "text": "function retryUntilM(f, __trace) {\n return self => retryUntilM_(self, f);\n}", "title": "" }, { "docid": "35f2c9aeb4c0f9734b49a927b2476e4b", "score": "0.53201735", "text": "function debouncer( func , timeout ) {\n var timeoutID;\n var timeoutVAR;\n\n if (timeout) {\n timeoutVAR = timeout;\n } else {\n timeoutVAR = 200;\n }\n\n return function() {\n var scope = this , args = arguments;\n clearTimeout( timeoutID );\n timeoutID = setTimeout( function () {\n func.apply( scope , Array.prototype.slice.call( args ) );\n }, timeoutVAR );\n };\n\n}", "title": "" }, { "docid": "35f2c9aeb4c0f9734b49a927b2476e4b", "score": "0.53201735", "text": "function debouncer( func , timeout ) {\n var timeoutID;\n var timeoutVAR;\n\n if (timeout) {\n timeoutVAR = timeout;\n } else {\n timeoutVAR = 200;\n }\n\n return function() {\n var scope = this , args = arguments;\n clearTimeout( timeoutID );\n timeoutID = setTimeout( function () {\n func.apply( scope , Array.prototype.slice.call( args ) );\n }, timeoutVAR );\n };\n\n}", "title": "" }, { "docid": "d13866a2c946a65e11897815c8498554", "score": "0.53197294", "text": "function delayer(fn, varTimer) {\n var ifNaN = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;\n\n function toInt(el) {\n return (/^[0-9]+$/.test(el) ? Number(el) || 1 : null\n );\n }\n var timerId;\n return function () {\n var _this = this;\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (timerId) clearTimeout(timerId);\n timerId = setTimeout(function () {\n fn.apply(_this, args);\n }, toInt(varTimer) || toInt(this[varTimer]) || ifNaN);\n };\n}", "title": "" }, { "docid": "84f3c2351f97c6e32e0d031363ed7ab1", "score": "0.5319552", "text": "function handler(success) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (triggeredCallback) {\n return;\n }\n if (success) {\n triggerCallback.call.apply(triggerCallback, [null, success].concat(args));\n return;\n }\n var mustStop = canceled() || hitTimeout;\n if (mustStop) {\n triggerCallback.call.apply(triggerCallback, [null, success].concat(args));\n return;\n }\n if (waitSeconds < 64) {\n /* TODO(andysoto): don't back off so quickly if we know we're offline. */\n waitSeconds *= 2;\n }\n var waitMillis;\n if (cancelState === 1) {\n cancelState = 2;\n waitMillis = 0;\n }\n else {\n waitMillis = (waitSeconds + Math.random()) * 1000;\n }\n callWithDelay(waitMillis);\n }", "title": "" }, { "docid": "976c0a0075513fde0f5da5550fe987ff", "score": "0.5315158", "text": "function debounce(fn, ms) {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n var timeout;\n return function (arg) {\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n fn(arg);\n }, ms);\n };\n}", "title": "" }, { "docid": "976c0a0075513fde0f5da5550fe987ff", "score": "0.5315158", "text": "function debounce(fn, ms) {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n var timeout;\n return function (arg) {\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n fn(arg);\n }, ms);\n };\n}", "title": "" }, { "docid": "2d919fe86bffdbc1fd4d4d5301b5b315", "score": "0.53146577", "text": "debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate)\r\n func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow)\r\n func.apply(context, args);\n };\n }", "title": "" }, { "docid": "99492cefa611d7c9e9fa6f974172ff60", "score": "0.5310022", "text": "static looperInstant(Function, delay, numberOfLoop, ...funcArgs) {\n return new TimerReapeterInstant(Function, delay, numberOfLoop, ...funcArgs)\n }", "title": "" }, { "docid": "14e8bfb360df2d9bfd81a1af52f46260", "score": "0.5307594", "text": "function delay(func, wait) {\n let countdownStarted = false\n return function(phrase){\n if(!countdownStarted){\n countdownStarted = true\n setTimeout(() => func(phrase), wait)\n } \n } \n}", "title": "" }, { "docid": "62feaa85e86fbe98438a4b35513d2826", "score": "0.5303782", "text": "function debounceFunction(fn, delay) {\n let timeoutID;\n\n return function(...args){\n if (timeoutID) {\n clearTimeout(timeoutID)\n }\n timeoutID = setTimeout(() => fn(...args), delay)\n }\n}", "title": "" }, { "docid": "ee0b41bb92b821d04743f28e734e8f6e", "score": "0.53020775", "text": "function debounce( func, wait, immediate ){\n var timeout\n return function(){\n var context = this,\n args = arguments\n clearTimeout( timeout )\n timeout = setTimeout( function(){\n timeout = null\n if( ! immediate ) func.apply( context, args )\n }, wait )\n if( immediate && ! timeout ) func.apply( context, args )\n }\n}", "title": "" }, { "docid": "ba4110bafc686689178a9a319b543930", "score": "0.52963513", "text": "function delay(callback, delayMillis) {\n var timerAlive = true\n var timer = new Timer()\n timer.interval = delayMillis\n timer.repeat = false\n timer.triggered.connect(function () {\n callback()\n if (timerAlive) {\n timerAlive = false\n timer.destroy()\n }\n })\n timer.start()\n\n return {\n stop: function () {\n if (timerAlive) {\n timerAlive = false\n timer.stop()\n timer.destroy()\n }\n }\n }\n}", "title": "" }, { "docid": "e4999e8624113e1c91fbec9bfec26b51", "score": "0.5286318", "text": "function keepAlive(timeout, onTimeout) {\n\tvar count = 0;\n\tvar thisTimeToken = new Date().getTime().toString().slice(0, -3);\n\tfunction check() {\n\t\tvar countCopy = count;\n\t\tsetTimeout(function() {\n\t\t\tif(countCopy == count) {\n\t\t\t\tlastTimeToken = thisTimeToken;\n\t\t\t\tonTimeout();\n\t\t\t} else {\n\t\t\t\tcheck();\n\t\t\t}\n\t\t}, timeout)\n\t} check();\n\treturn function() {\n\t\tcount+=1;\n\t}\n}", "title": "" } ]
4f382ec478751b80003e3f183ba4b8f5
Build and check if the start and end dates valid
[ { "docid": "f3bbaa20d9f19b34386742b50ea67079", "score": "0.71275675", "text": "function check_dates_valid()\r\n\t{\r\n\t\tvar is_date_valid = true;\r\n\t\tstart_date_hours= create_date($(\"#start_date\").val() + \"-\" + $(\"#start_time\").val());\r\n\t\tend_date_hours= create_date($(\"#end_date\").val() + \"-\" + $(\"#end_time\").val());\r\n\t\tend_date_hours = end_date_hours -1;\r\n\t\t\r\n\t\tif(start_date_hours >= end_date_hours)\r\n\t\t{\r\n\t\t\tis_date_valid = false;\r\n\t\t\talert(\"Your start date can't be greater than or equal to your end date!\");\r\n\t\t}\r\n\t\t\r\n\t\tvar today_date = new Date();\r\n\t\ttoday_date.setHours(today_date.getHours(), 0, 0, 0);\r\n\t\ttoday_date = today_date.getTime();\r\n\t\t\r\n\t\tif(start_date_hours< today_date)\r\n\t\t{\r\n\t\t\tis_date_valid = false;\r\n\t\t\talert(\"Start date must be in the future! Time Machines haven't been built yet\")\r\n\t\t}\r\n\t\t\r\n\t\treturn is_date_valid;\r\n\t\t\r\n\t}", "title": "" } ]
[ { "docid": "736454128c056fa8992f17e0d43c8f43", "score": "0.78171074", "text": "function verifyDates(start,end){\r\n\tvar startDate = start.value;\r\n\tvar endDate = end.value;\r\n\t\r\n\tvar arrSD = new Array();\r\n\tvar arrED = new Array();\r\n\r\n\tarrSD = startDate.split(\"/\");\r\n\tarrED = endDate.split(\"/\");\r\n\tvar endYear;\r\n\tvar endMonth;\r\n\tvar endDay;\r\n\tvar startYear;\r\n\tvar startMonth;\r\n\tvar startDay;\r\n\t\r\n\tif (DATE_FORMAT) {\r\n\t\tvar dateElems = (DATE_FORMAT.toLowerCase()).split(\"/\");\r\n\t\tendYear = arrED[dateElems.indexOf('y')];\r\n\t\tendMonth =arrED[dateElems.indexOf('m')];\r\n\t\tendDay = arrED[dateElems.indexOf('d')];\r\n\t\tstartYear = arrSD[dateElems.indexOf('y')];\r\n\t\tstartMonth = arrSD[dateElems.indexOf('m')];\r\n\t\tstartDay = arrSD[dateElems.indexOf('d')];\r\n\t} else {\r\n\t\tendYear = arrED[2];\r\n\t\tendMonth =arrED[1];\r\n\t\tendDay = arrED[0];\r\n\t\tstartYear = arrSD[2];\r\n\t\tstartMonth = arrSD[1];\r\n\t\tstartDay = arrSD[0];\r\n\t}\r\n\t\r\n\tif (endYear < startYear){\r\n\t\treturn false;\r\n\t} else if (endYear == startYear && endMonth < startMonth){\r\n\t\treturn false;\r\n\t} else if (endYear == startYear && endMonth == startMonth && endDay < startDay){ \r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "8fbdb59e13829752704787a0f694c016", "score": "0.7400202", "text": "function validateDateTimes(data) {\n\n // Object containing final results\n const results = {\n start: {\n valid: true\n },\n end: {\n valid: true\n }\n }\n\n // Check to make certain the dates are valid\n Object.keys(data).forEach(key => {\n date = new Date(data[key].date);\n if (!date.getTime()) {\n results[key].valid = false;\n showWarning('*Invalid Date', `${data[key].dateId}-area`, `${data[key].dateId}-warning`);\n return results;\n } else {\n hideWarning(`${data[key].dateId}-area`, `${data[key].dateId}-warning`);\n }\n });\n\n let startDate = new Date(data.start.date);\n let endDate = new Date(data.end.date);\n\n let startTime = data.start.time.split(':');\n let endTime = data.end.time.split(':');\n\n if (data.start.time === '' || data.end.time === '') {\n if (data.start.time === '') {\n results.start.valid = false;\n showWarning('*Invalid Time', `${data.start.timeId}-area`, `${data.start.timeId}-warning`);\n } else {\n hideWarning(`${data.start.timeId}-area`, `${data.start.timeId}-warning`);\n }\n if (data.end.time === '') {\n results.end.valid = false;\n showWarning('*Invalid Time', `${data.end.timeId}-area`, `${data.end.timeId}-warning`);\n } else {\n hideWarning(`${data.end.timeId}-area`, `${data.end.timeId}-warning`);\n }\n return results;\n }\n\n startDate.setTime(startDate.getTime() + (parseInt(startTime[0], 10) + 60 * 60 * 1000) + (parseInt(startTime[1], 10) + 60 * 1000));\n endDate.setTime(endDate.getTime() + (parseInt(endTime[0], 10) + 60 * 60 * 1000) + (parseInt(endTime[1], 10) + 60 * 1000));\n\n if (startDate.getTime() > endDate.getTime()) {\n showWarning('*Ends before start', `${data.end.dateId}-area`, `${data.end.dateId}-warning`);\n showWarning('*Ends before start', `${data.end.timeId}-area`, `${data.end.timeId}-warning`);\n results.end.valid = false;\n } else {\n hideWarning(`${data.end.dateId}-area`, `${data.end.dateId}-warning`);\n hideWarning(`${data.end.timeId}-area`, `${data.end.timeId}-warning`);\n }\n return results;\n }", "title": "" }, { "docid": "9fe72f40d70bdc74e981d465c491916a", "score": "0.7327682", "text": "function checkDate(form) {\n\t\t\t\t// store the values of the inputs in local variables, create\n\t\t\t\t// new date objects from them for safety, and run getTime\n\t\t\t\t// to convert them to a numerical value for comparison\n\t\t\t\tlet startVal = new Date($('#start').val()).getTime();\n\t\t\t\tlet endVal = new Date($('#end').val()).getTime();\n\t\t\t\tlet now = new Date().getTime();\n\t\t\t\tconsole.log(now);\n\t\t\t\tconsole.log(startVal);\n\n\t\t\t\t// If the end date's value is less than the start date's value,\n\t\t\t\tif (endVal < startVal) {\n\t\t\t\t\t// set the end input to invalid\n\t\t\t\t\tform.end.$setValidity('endDateBefore', false);\n\t\t\t\t// or if the end time is the same as the start time \n\t\t\t\t} else if (endVal === startVal) {\n\t\t\t\t\t// set the end input to invalid\n\t\t\t\t\tform.end.$setValidity('endDateSame', false);\n\t\t\t\t// or if the start time is before the current time\n\t\t\t\t// (25,200,000 is the number of ms in 7 hours)\n\t\t\t\t// new Date().getTime() is converting the start\n\t\t\t\t// input's value incorrectly, and this makes up for the error\n\t\t\t\t} else if (startVal + 25200000 < now) {\n\t\t\t\t\t// set the start input to invalid\n\t\t\t\t\tform.start.$setValidity('startDatePast', false);\n\t\t\t\t// if all is well,\n\t\t\t\t} else {\n\t\t\t\t\t// ensure all input error cases are now valid\n\t\t\t\t\tform.end.$setValidity('endDate', true);\n\t\t\t\t\tform.end.$setValidity('endDateSame', false);\n\t\t\t\t\tform.start.$setValidity('startDatePast', true);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "1e5c895f77e7bc6959134e9852c2f75d", "score": "0.7137616", "text": "function isValid(start, end){\n\tif (isNaN(start)) return false;\n\tif (isNaN(end)) return false;\n\n\tif(end < start) return false;\n\n\tif(start < 1960) return false;\n\n\tif(end > 2014) return false;\n\n\treturn true;\n\n}", "title": "" }, { "docid": "bf57ca5424addac70dd43d46191af73a", "score": "0.69605786", "text": "function validateStartEnd(start, end) {\n return !!start && !!end && start.isValid && end.isValid && start <= end;\n}", "title": "" }, { "docid": "c67d9ba574986a4309e63ee7b1e6a6a8", "score": "0.6921863", "text": "function validateStartEndDateTime(inStartYear,inStartMonth,inStartDay,inEndYear,inEndMonth,inEndDay,startTime,endTime)\n{\n var inStartHour = 0;\n var inStartMinute = 0;\n var inStartSecond = 0;\n\n var inEndHour = 0;\n var inEndMinute = 0;\n var inEndSecond = 0;\n\n // parse the hours and minutes from the startTime\n if (startTime != null) {\n inStartHour = startTime.substring(0,startTime.indexOf(\":\"));\n inStartMinute = startTime.substring(startTime.indexOf(\":\") + 1);\n }\n\n // parse the hours and minutes from the endTime\n if (endTime != null) {\n inEndHour = endTime.substring(0,endTime.indexOf(\":\"));\n inEndMinute = endTime.substring(endTime.indexOf(\":\") + 1);\n }\n\n // alert('START\\nY='+inStartYear+'\\nM='+inStartMonth+'\\nD='+inStartDay+'\\nh='+inStartHour+'\\nm='+inStartMinute+'\\ns='+inStartSecond);\n // alert('END\\nY='+inEndYear+'\\nM='+inEndMonth+'\\nD='+inEndDay+'\\nh='+inEndHour+'\\nm='+inEndMinute+'\\ns='+inEndSecond);\n\n // create a date object for the startdate\n var sDate = new Date(inStartYear,\n inStartMonth-1,\n inStartDay,\n inStartHour,\n inStartMinute,\n inStartSecond);\n\n // create a date object for the enddate\n var eDate = new Date(inEndYear,\n inEndMonth-1,\n inEndDay,\n inEndHour,\n inEndMinute,\n inEndSecond);\n\n // generate millisecond internal representations of the start/end dates\n var startMilliTime = sDate.getTime();\n var endMilliTime = eDate.getTime();\n\n // alert ('start='+startMilliTime+' end='+endMilliTime);\n\n // if startMilliTime is greater than endMillTime return false.\n // otherwise return true.\n // note: startdate = enddate returns true!\n if (startMilliTime == endMilliTime)\n {\n return -1;\n }\n else if (startMilliTime > endMilliTime)\n {\n return false;\n }\n else if (startMilliTime < endMilliTime)\n {\n return true;\n }\n}", "title": "" }, { "docid": "4f61521ae1b279a5a3284d65915fae9c", "score": "0.69134736", "text": "function validDateRange(startDate,returnDate){\n\n if(!validDate(startDate) || !validDate(returnDate))\n return false;\n\n //fetch current date\n var today = new Date();\n var todayDay = today.getDate();\n var todayMonth = today.getMonth()+1;\n var todayYear = today.getFullYear();\n today = todayMonth+'/'+todayDay+'/'+todayYear;\n\n // Parse the startDate\n var sParts = startDate.split(\"/\");\n var sDay = parseInt(parts[1], 10);\n var sMonth = parseInt(parts[0], 10);\n var sYear = parseInt(parts[2], 10);\n\n // Parse the returnDate\n var rParts = returnDate.split(\"/\");\n var rDay = parseInt(parts[1], 10);\n var rMonth = parseInt(parts[0], 10);\n var rYear = parseInt(parts[2], 10);\n\n //make sure start date is today or in future\n if(sYear<todayYear || sMonth<todayMonth || sDay<todayDay)\n return false;\n\n //make sure returnDate is after startDate\n if(rYear<sYear || rMonth<sMonth || rDay<sDay)\n return false;\n\n return true;\n}", "title": "" }, { "docid": "c6622766912c1d5da2d8674cf68f8d05", "score": "0.6864443", "text": "function checkDates(startdata, enddate) {\n if (startdata != \"\" && enddate != \"\") {\n\n //Checke valid From date --------------------\n if (startdata.val() != \"\") {\n var validDate = startdata.val().split('/');\n if (parseInt(validDate[2], 10) < 1900) {\n startdata.val('');\n startdata.focus();\n jAlert(CommanMessage.InvalidDate);\n return false;\n }\n var dt = new Date(parseInt(validDate[2], 10), parseInt(validDate[0], 10) - 1, parseInt(validDate[1], 10));\n if (dt.getDate() != parseInt(validDate[1], 10) || dt.getMonth() != (parseInt(validDate[0], 10) - 1) || dt.getFullYear() != parseInt(validDate[2], 10)) {\n startdata.val('');\n startdata.focus();\n jAlert(CommanMessage.InvalidDate);\n return false;\n }\n }\n //------------------------------------------\n //Checke valid end date --------------------\n if (enddate.val() != \"\") {\n var validDate = enddate.val().split('/');\n if (parseInt(validDate[2], 10) < 1900) {\n enddate.val('');\n enddate.focus();\n jAlert(CommanMessage.InvalidDate);\n return false;\n }\n var dt = new Date(parseInt(validDate[2], 10), parseInt(validDate[0], 10) - 1, parseInt(validDate[1], 10));\n if (dt.getDate() != parseInt(validDate[1], 10) || dt.getMonth() != (parseInt(validDate[0], 10) - 1) || dt.getFullYear() != parseInt(validDate[2], 10)) {\n enddate.val('');\n enddate.focus();\n jAlert(CommanMessage.InvalidDate);\n return false;\n }\n }\n //------------------------------------------\n\n var srdate = new Date(startdata.val());\n var eddate = new Date(enddate.val());\n if (srdate > eddate) {\n enddate.val(\"\");\n jAlert(CommanMessage.StartDateVsEndDate);\n enddate.focus();\n return false;\n }\n else {\n return true;\n }\n }\n}", "title": "" }, { "docid": "f02747d50ae4b8e68476146300b60c2c", "score": "0.6705433", "text": "compareDates() {\n let startMonth = parseInt(this.state.startyear.slice(0,2),10),\n startDay = parseInt(this.state.startyear.slice(3,5),10),\n startYear = parseInt(this.state.startyear.slice(6,10),10),\n endMonth = parseInt(this.state.endyear.slice(0,2),10),\n endDay = parseInt(this.state.endyear.slice(3,5),10),\n endYear = parseInt(this.state.endyear.slice(6,10),10),\n dateError = false;\n\n\n if (endYear < startYear) {\n dateError = true;\n \n }\n else if (startYear === endYear) {\n \n if (endMonth < startMonth) {\n dateError = true;\n }\n else if (startMonth === endMonth) {\n if (endDay < startDay) {\n dateError = true;\n }\n }\n }\n if (dateError) {\n return 'Start date must be before end date'\n }\n else {\n\n return '';\n }\n\n \n }", "title": "" }, { "docid": "d3bd653413facac0aad5ed43a851e46d", "score": "0.66991186", "text": "validateDateAndTime(fromDate, toDate){\n if ( (fromDate === undefined)\n || !(fromDate instanceof Date)){\n return false\n\n } else return !((toDate === undefined)\n || !(toDate instanceof Date));\n }", "title": "" }, { "docid": "96d9992a57cd6d5a7a937fcddc005110", "score": "0.6696364", "text": "isValid() {\n const { start, end } = this.selection;\n // Empty ranges are valid.\n if (start == null && end == null) {\n return true;\n }\n // Complete ranges are only valid if both dates are valid and the start is before the end.\n if (start != null && end != null) {\n return this._isValidDateInstance(start) && this._isValidDateInstance(end) &&\n this._adapter.compareDate(start, end) <= 0;\n }\n // Partial ranges are valid if the start/end is valid.\n return (start == null || this._isValidDateInstance(start)) &&\n (end == null || this._isValidDateInstance(end));\n }", "title": "" }, { "docid": "96d9992a57cd6d5a7a937fcddc005110", "score": "0.6696364", "text": "isValid() {\n const { start, end } = this.selection;\n // Empty ranges are valid.\n if (start == null && end == null) {\n return true;\n }\n // Complete ranges are only valid if both dates are valid and the start is before the end.\n if (start != null && end != null) {\n return this._isValidDateInstance(start) && this._isValidDateInstance(end) &&\n this._adapter.compareDate(start, end) <= 0;\n }\n // Partial ranges are valid if the start/end is valid.\n return (start == null || this._isValidDateInstance(start)) &&\n (end == null || this._isValidDateInstance(end));\n }", "title": "" }, { "docid": "96d9992a57cd6d5a7a937fcddc005110", "score": "0.6696364", "text": "isValid() {\n const { start, end } = this.selection;\n // Empty ranges are valid.\n if (start == null && end == null) {\n return true;\n }\n // Complete ranges are only valid if both dates are valid and the start is before the end.\n if (start != null && end != null) {\n return this._isValidDateInstance(start) && this._isValidDateInstance(end) &&\n this._adapter.compareDate(start, end) <= 0;\n }\n // Partial ranges are valid if the start/end is valid.\n return (start == null || this._isValidDateInstance(start)) &&\n (end == null || this._isValidDateInstance(end));\n }", "title": "" }, { "docid": "96d9992a57cd6d5a7a937fcddc005110", "score": "0.6696364", "text": "isValid() {\n const { start, end } = this.selection;\n // Empty ranges are valid.\n if (start == null && end == null) {\n return true;\n }\n // Complete ranges are only valid if both dates are valid and the start is before the end.\n if (start != null && end != null) {\n return this._isValidDateInstance(start) && this._isValidDateInstance(end) &&\n this._adapter.compareDate(start, end) <= 0;\n }\n // Partial ranges are valid if the start/end is valid.\n return (start == null || this._isValidDateInstance(start)) &&\n (end == null || this._isValidDateInstance(end));\n }", "title": "" }, { "docid": "96d9992a57cd6d5a7a937fcddc005110", "score": "0.6696364", "text": "isValid() {\n const { start, end } = this.selection;\n // Empty ranges are valid.\n if (start == null && end == null) {\n return true;\n }\n // Complete ranges are only valid if both dates are valid and the start is before the end.\n if (start != null && end != null) {\n return this._isValidDateInstance(start) && this._isValidDateInstance(end) &&\n this._adapter.compareDate(start, end) <= 0;\n }\n // Partial ranges are valid if the start/end is valid.\n return (start == null || this._isValidDateInstance(start)) &&\n (end == null || this._isValidDateInstance(end));\n }", "title": "" }, { "docid": "76a776f9ac9929b5b1b12e88b4c98186", "score": "0.6651166", "text": "function validateReBlockingDate(lastDate, unBlockingDate) {\n\n\n var startDate = Date.parse(unBlockingDate);\n // console.log(\"Testing Days AAAAA ========= \", startDate);\n var endDate = Date.parse(lastDate);\n // console.log(\"Testing Days BBBB ========= \", endDate);\n var timeDiff = startDate - endDate;\n daysDiff = Math.floor(timeDiff / (1000 * 60 * 60 * 24));\n // console.log(\"Testing Days ========= \", daysDiff);\n // LicenseStartDate = lastDate;\n // LicenseEndDate = unBlockingDate;\n // console.log(LicenseStartDate);\n // console.log(LicenseEndDate);\n // let nDays = diffDays(new Date, LicenseStartDate);\n // console.log(\"License remaining dates \" + nDays);\n // if(Date.parse(LicenseStartDate) <= Date.parse(LicenseEndDate) && nDays > 0){\n // console.log(\"License remaining dates \" + nDays);\n // return true;\n // }\n // else if(Date.parse(LicenseStartDate) >= Date.parse(LicenseEndDate) && nDays < 0){\n // console.log(\"License have expired.....\");\n // return false;\n // }\n return daysDiff\n\n}", "title": "" }, { "docid": "58ebcc771c2e5a1bbbc15ce5177b09af", "score": "0.65890044", "text": "function rangeCheck(date) {\n if (date < obj.startDate) {\n //console.log(\"Reconstruindo calculadora de feriados pois dia ${date} eh menor que ${startDate}\");\n build(date, endDate, holidays);\n }\n else if (date > obj.endDate) {\n var newEndDate = moment(date).add(100, 'days').format('YYYY-MM-DD');\n //console.log(\"Reconstruindo calculadora de feriados pois dia \" + date + \" eh maior que \" + obj.endDate + \", ate \" + newEndDate);\n build(obj.startDate, newEndDate, obj.holidays);\n }\n }", "title": "" }, { "docid": "4f847d41d2c69e920d5e1c1f433cb383", "score": "0.6587412", "text": "function isBeginAllowed(){\n var thisDate = new Date(), start_date = getValue(\"start_date\");\n var isAllowed = true, startdate = new Date();\n if(typeof(start_date)!='undefined'){\n var splitDate = start_date.split(\"/\");\n var mm = splitDate[0] - 1, dd = splitDate[1], yyyy = splitDate[2];\n startdate.setFullYear(yyyy,mm,dd);\n } else {\n setError(\"start date error in isBeginAllowed()!\")\n }\n thisDate.setHours(0,0,0,0);\n startdate.setHours(0,0,0,0);\n if(startdate.getTime() > thisDate.getTime()){\n isAllowed = false;\n }\n return(isAllowed);\n}", "title": "" }, { "docid": "f891c59c7e8c9a776703521c4ba965ce", "score": "0.65501505", "text": "validate(travel) {\n var errors = {}\n if (!travel.startDate) errors.startDate = 'Please enter a start date.'\n if (!travel.endDate) errors.endDate = 'Please enter an end date.'\n if (travel.startDate && travel.endDate &&\n zeroTime(travel.endDate) < zeroTime(travel.startDate)) {\n errors.endDate = 'End date must not be earlier than start date.'\n }\n if (!travel.origin) errors.origin = 'Please enter an origin.'\n if (!travel.destination) errors.destination = 'Please enter a destination.'\n return errors\n }", "title": "" }, { "docid": "7d2bdf259ba07a953ef4bf6a525e8cad", "score": "0.6547564", "text": "function publicationDateValidation(){\n let startYear = parseInt($(\"#starting_year\").val());\n let endYear = parseInt($(\"#ending_year\").val());\n let isValid = false;\n if (startYear > endYear) {\n $(\"#starting_year\")[0].setCustomValidity(\"Starting year should be earlier than the ending year.\");\n }\n else if (startYear < \"1994\") {\n $(\"#starting_year\")[0].setCustomValidity(\"Sorry, this tool only contains SORNs starting from 1994. Please enter a later starting year\");\n }\n else {\n $(\"#starting_year\")[0].setCustomValidity('');\n // If dates are valid, create badge\n createDatesFilter(startYear, endYear);\n isValid = true;\n }\n return isValid;\n}", "title": "" }, { "docid": "a303e458936407b3e042cae9b616c707", "score": "0.65313286", "text": "function checkDateRelations() {\n let firstDate = new Date(firstAppointmentDate.value);\n let lastDate = new Date(lastAppointmentDate.value);\n let endDate = new Date(pollEndDate.value);\n dateRelationsError.textContent = \"\";\n //Proceed only if all of the dates are valid\n if(!(isValidDate(firstDate) && isValidDate(lastDate) &&\n isValidDate(endDate))) {\n return false;\n }\n //Convert to milliseconds since epoch\n firstDate = firstDate.getTime();\n lastDate = lastDate.getTime();\n endDate = endDate.getTime();\n if(firstDate > lastDate) {\n let tmp = \"Ensimmäisen varauspäivän tulee olla ennen viimeistä varauspäivää\";\n dateRelationsError.textContent = tmp;\n return false;\n }\n let pollDays = (lastDate-firstDate)/1000/60/60/24 + 1;\n if(pollDays > 31) {\n let tmp = \"Kyselyssä voi olla korkeintaan 31 varauspäivää\";\n dateRelationsError.textContent = tmp;\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "d188f3a656c9303dc217c79e2200cfff", "score": "0.65253264", "text": "function dateRelationCheck(start, end) {\n var fullDate = CONFIG.JS_DATE_FORMAT_URL + CONFIG.JS_TIME_FORMAT;\n return moment(start, fullDate) < moment(end, fullDate);\n }", "title": "" }, { "docid": "0c6831c7fe04899ff4c6a5991ea1f9fc", "score": "0.6495498", "text": "function checkEnteredDestAndDates(dest,stdateval,endateval){\n if(dest.length<3) {\n alert(\"Destination must be at least 3 characters long\");\n return false;\n }\n \n \n if(endateval == null || stdateval== null){\n alert('Please fill in the date field')\n return false;\n }\n\n var datediffval = (endateval - stdateval)/864e5;\n if(datediffval < 0){\n alert(\"Start date must be prior to end date\");\n return false;\n }\n return true;\n \n}", "title": "" }, { "docid": "1e16627cfe97e0c302653ddb0fe5140d", "score": "0.6493142", "text": "function date_validation(from,to)\n{\n var is_different = false;\n if($('#'+from).val() != \"\" || $('#'+to).val() != \"\") {\n\n var frm_check_index = $('#'+from).val().indexOf(\"/\");\n if(frm_check_index != -1) {\n var frm_date = $('#'+from).val().split(\"/\");\n// converted_frm_date = new Date (frm_date[0],frm_date[1],frm_date[2]);\n }\n else {\n var frm_date = $('#'+from).val().split(\"-\");\n// converted_frm_date = new Date (frm_date[2],frm_date[1],frm_date[0]);\n is_different = true;\n }\n\n converted_frm_date = new Date (frm_date[0],frm_date[1],frm_date[2]);\n\n var to_check_index = $('#'+to).val().indexOf(\"/\");\n if(to_check_index != -1) {\n var id_closure_date = $('#'+to).val().split(\"/\");\n converted_id_closure_date = new Date (id_closure_date[0],id_closure_date[1],id_closure_date[2]);\n }\n else {\n var id_closure_date = $('#'+to).val().split(\"-\");\n converted_id_closure_date = new Date (id_closure_date[0],id_closure_date[1],id_closure_date[2]);\n }\n if(converted_frm_date > converted_id_closure_date) {\n alert(\"From date Cannot Be Greater Than To Date \");\n return false\n }\n var from_date = $('#'+from).val() ;\n var to_date = $('#'+to).val()\n\n if(is_different) {\n from_date = $('#'+from).val().split('-');\n from_date = from_date[2]+'/'+from_date[1]+'/'+from_date[0];\n to_date = $('#'+to).val().split('-');\n to_date = to_date[2]+'/'+to_date[1]+'/'+to_date[0];\n }\n\n if (isDate(from_date) == false || isDate(to_date) == false ){\n alert(\"Please Enter The Valid Date \");\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "a41f2728ef852983070c7f148746f706", "score": "0.6489438", "text": "isDateInRange(dateStr) {\n if (this.recurringFlag) {\n return true;\n } else if (_.isNil(dateStr)) {\n return false;\n } else {\n let start = dateUtils.format(this.startDate, null, ISOFORMAT);\n let end = dateUtils.format(this.endDate, null, ISOFORMAT);\n return dateUtils.isBetween(dateStr, start, end, 'day', '[]');\n }\n }", "title": "" }, { "docid": "dba86212c54638d53037f7dcb58ac31b", "score": "0.6484615", "text": "function validateDate(){\n var f = new Date();\n var year = f.getFullYear();\n var month = f.getMonth() < 10 ? \"0\" + (f.getMonth() + 1):(f.getMonth() + 1);\n var day = f.getDate() <10 ? \"0\" + f.getDate():f.getDate();\n var f3 = year +\"-\"+ month +\"-\"+ day;\n var f2 = f.getHours() + \":\" + f.getMinutes();\n if (($('#start_date').val() === $('#end_date').val())\n && ($('#start_time').val() > $('#end_time').val())) {\n alert(\"The end time cannot be less than the start time\");\n } else if ($('#start_date').val() > $('#end_date').val()) {\n alert(\"The end date cannot be less than the start date\");\n } else if ($('#start_time').val() < f2 && $('#start_date').val() === f3) {\n alert(\"The start time cannot be less than the current time\");\n }else {\n return true;\n }\n\n }", "title": "" }, { "docid": "d313f692adf6bf0f78b7156105915217", "score": "0.6476809", "text": "function between(date, start, end) {\n return (start === undefined || date >= start) && (end === undefined || date <= end);\n}", "title": "" }, { "docid": "f45962d26987b5d2fcfe0155b510f419", "score": "0.6458876", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return new Invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return new Invalid(\"missing or invalid end\");\n } else if (end < start) {\n return new Invalid(\"end before start\", \"The end of an interval must be after its start, but you had start=\" + start.toISO() + \" and end=\" + end.toISO());\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "fccec436bf7a7242eb5460d194340ae1", "score": "0.6450845", "text": "checkDate() {\n\t\tvar dateAttributes = [];\n\t\tvar minDate = null;\n\t\tvar maxDate = null;\n\t\tthis.attributeTypeList.forEach(function (attribute) {\n\t\t\tif(attribute.dataType === \"DATE\") {\n\t\t\t\tdateAttributes.push(attribute.name);\n\t\t\t}\n\t\t});\n\t\tif(dateAttributes.length > 0) {\n\t\t\tthis.vertexList.forEach(function (vertex) {\n\t\t\t\tvertex.attributes.forEach(function (a) {\n\t\t\t\t\tvar index = dateAttributes.indexOf(a[0]);\n\t\t\t\t\tif(index > -1) {\n\t\t\t\t\t\tvar date = Date.parse(a[1]);\n\t\t\t\t\t\tif(isNaN(date)) {\n\t\t\t\t\t\t\tdate = new Date(Number(a[1]));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(date !== 'Invalid Date') {\n\t\t\t\t\t\t\tif(minDate === null || date < minDate) {\n\t\t\t\t\t\t\t\tminDate = date;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(maxDate === null || date > maxDate) {\n\t\t\t\t\t\t\t\tmaxDate = date;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\tthis.filterModalWindowComponent.setDateBounds(minDate, maxDate);\n\t}", "title": "" }, { "docid": "b5e37ac7cfd68f1738488653f7787182", "score": "0.641283", "text": "function validDate(){\n\n\n\n }", "title": "" }, { "docid": "f694b58937d98508e7ba1081e12fdc98", "score": "0.6411684", "text": "function validateDateRange(targetDate, startDate, endDate) {\n if (!targetDate) {\n console.log(\n 'Function validateDateRange requires targetDate parameter.'\n );\n return null;\n }\n\n const range = moment.range(\n startDate\n ? moment(startDate).startOf('day')\n : moment()\n .startOf('day')\n .subtract(7, 'days'),\n endDate ? moment(endDate).endOf('day') : moment().endOf('day')\n );\n return range.contains(moment(targetDate));\n}", "title": "" }, { "docid": "74457aa6bf52a13d0f7068cf2f16de06", "score": "0.6401138", "text": "_rangeValidation(initialDate) {\n const that = this;\n\n if (initialDate.compare(that.min) === -1) {\n return that.min.clone();\n }\n else if (initialDate.compare(that.max) === 1) {\n return that.max.clone();\n }\n else {\n return initialDate;\n }\n }", "title": "" }, { "docid": "ebfcc56d1a10c607ca3dbcd84629e5c1", "score": "0.6364129", "text": "function addValidate_DateRangeNotEmpty(msgEmpty, msgFormat, format) {\n format = format == null || format == undefined || format + \"\" == \"\" ? ValidateProp.DateFormat_DDMMYYYY : format\n return {\n validators: {\n notEmpty: {\n message: msgEmpty\n },\n callback: {\n message: msgFormat == \"\" ? 'The date is not a valid' : msgFormat,\n callback: function (value, validator, $field) {\n var arrValue = (value + \"\").split('-');\n if (arrValue.length == 2) {\n var start = arrValue[0].replace(/ /g, '');\n var end = arrValue[1].replace(/ /g, '');\n var c1 = moment(start, format, true).isValid();\n var c2 = moment(end, format, true).isValid();\n if (Boolean(c1) && Boolean(c2)) {\n if (moment(start, format, true).valueOf() > moment(end, format, true).valueOf()) {\n return false;\n }\n else {\n return true;\n }\n }\n else {\n return false;\n }\n }\n else {\n return false;\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "b4c40e4de31be1dab7432b707d12b4ef", "score": "0.63572466", "text": "function validateTimelineData(start, end, title) {\r\n var isValid = (start !== false) && (end !== false);\r\n isValid = isValid && CZ.Authoring.isNotEmpty(title);\r\n isValid = isValid && CZ.Authoring.isIntervalPositive(start, end);\r\n return isValid;\r\n }", "title": "" }, { "docid": "dd5a4a8c3a9b811fe4e071e177f1420c", "score": "0.6354728", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`);\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "dd5a4a8c3a9b811fe4e071e177f1420c", "score": "0.6354728", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`);\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "288d3e2825f3572bae2b8393e600f407", "score": "0.6345071", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "382bfdba4c3c41faebe32d168c5b5f9e", "score": "0.6332644", "text": "function isEndDateOneYearBeyond() {\n\tvar serviceStartDt = $('#internalStartDate').val();\n\tvar serviceEndDt = $('#internalEndDate').val();\n\tvar oneYearEndDate = \"\";\n\tvar splitStartDate=serviceStartDt.split(\"10\");\n\tvar splitEndDate=serviceEndDt.split(\"10\");\n\tif (serviceStartDt.length != 0 && !isValidDate(serviceStartDt) && serviceEndDt.length != 0 && !isValidDate(serviceEndDt)) {\n\t\tif (new Date(serviceStartDt) > new Date(serviceEndDt)) return false;\t\t\t\t// End Date should be greater than Start Date\n\t\toneYearEndDate = getDefaultOneYearEndDate(); \t\t\t\t\t\t\t\t\t\t\t\t// End Date should not beyond 1 Year\n\t\tif (new Date(serviceEndDt) > new Date (oneYearEndDate)) return false;\t\t\n\t\treturn true;\n\t}\n\telse \t\t\n\t\treturn false;\t\n}", "title": "" }, { "docid": "4eb1a27d905c560c8cdc08fab1cb9bbd", "score": "0.6320529", "text": "function validate() {\n var startTimeObject = new Date();\n var splitTime1 = $startTime.val().split(\":\");\n var hour1 = splitTime1[0];\n var minute1 = splitTime1[1];\n\n startTimeObject.setHours(hour1, minute1, 0);\n\n var endTimeObject = new Date();\n var splitTime2 = $endTime.val().split(\":\");\n var hour2 = splitTime2[0];\n var minute2 = splitTime2[1];\n\n endTimeObject.setHours(hour2, minute2, 0);\n\n if(startTimeObject >= endTimeObject) {\n alert('End time should be after start time.');\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "95a99d902e017d674e723f4b922fa389", "score": "0.6319771", "text": "function ValidateDate(tmp){ \n tmp = '#' + tmp;\n var startDate = tmp + ' #StartDate';\n var dueDate = tmp + ' #DueDate';\n var str1 = $(startDate).val(); \n var str2 = $(dueDate).val();\n var dt1 = parseInt(str1.substring(0,2),10); \n var mon1 = getMonthFromString(str1.substring(str1.indexOf('-')+1,str1.lastIndexOf('-'))); \n var yr1 = parseInt(str1.substring(str1.lastIndexOf('-') + 1,str1.length),10);\n var dt2 = parseInt(str2.substring(0,2),10); \n var mon2 = getMonthFromString(str2.substring(str1.indexOf('-')+1,str2.lastIndexOf('-'))); \n var yr2 = parseInt(str2.substring(str2.lastIndexOf('-') + 1,str2.length),10);\n\n if(new Date(Date.parse(mon1 + ' ' + dt1 + ', ' + yr1))>\n new Date(Date.parse(mon2 + ' ' + dt2 + ', ' + yr2))){\n var due_error = tmp + ' #due_error';\n var startDate_error = tmp + ' #startDate_error';\n $(due_error).text('Due Date should not be less than Start Date');\n $(startDate_error).text('');\n return false;\n }\n else{\n return true;\n }\n\n}", "title": "" }, { "docid": "b9ec858fb95ae1b777455649b76e3b12", "score": "0.6312556", "text": "function dateCheck(date){\n let localDate = new Date(date);\n let dateToCheck = localDate.getTime();\n if(data.start_date<=dateToCheck&&dateToCheck<=data.end_date) return true; \n }", "title": "" }, { "docid": "88db0a9d87645f0c320ef8029e066e05", "score": "0.6308251", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", \"The end of an interval must be after its start, but you had start=\" + start.toISO() + \" and end=\" + end.toISO());\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "88db0a9d87645f0c320ef8029e066e05", "score": "0.6308251", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", \"The end of an interval must be after its start, but you had start=\" + start.toISO() + \" and end=\" + end.toISO());\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "88db0a9d87645f0c320ef8029e066e05", "score": "0.6308251", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", \"The end of an interval must be after its start, but you had start=\" + start.toISO() + \" and end=\" + end.toISO());\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "88db0a9d87645f0c320ef8029e066e05", "score": "0.6308251", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", \"The end of an interval must be after its start, but you had start=\" + start.toISO() + \" and end=\" + end.toISO());\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "88db0a9d87645f0c320ef8029e066e05", "score": "0.6308251", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", \"The end of an interval must be after its start, but you had start=\" + start.toISO() + \" and end=\" + end.toISO());\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "88db0a9d87645f0c320ef8029e066e05", "score": "0.6308251", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", \"The end of an interval must be after its start, but you had start=\" + start.toISO() + \" and end=\" + end.toISO());\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "88db0a9d87645f0c320ef8029e066e05", "score": "0.6308251", "text": "function validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\"end before start\", \"The end of an interval must be after its start, but you had start=\" + start.toISO() + \" and end=\" + end.toISO());\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "58134cffc260666e31640a2906b2fb38", "score": "0.6302139", "text": "constructor(date, start, end) {\n this.date = date;\n this.start = start;\n this.end = end;\n }", "title": "" }, { "docid": "92173875b6879b953fd9c67db6828c97", "score": "0.62912494", "text": "rangeShallowIntersectingRange(date1, date2) {\n date1 = this.toDateInfo(date1);\n date2 = this.toDateInfo(date2);\n\n if (!this.dateShallowIntersectsDate(date1, date2)) {\n return null;\n }\n\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the latest start date\n start = thisRange.start > otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // This end date exists\n\n\n if (thisRange.end) {\n // Use this definite end date if other end date is infinite\n if (!otherRange.end) {\n end = thisRange.end;\n } else {\n // Otherwise, use the earliest end date\n end = thisRange.end < otherRange.end ? thisRange.end : otherRange.end;\n } // Other end date exists\n\n } else if (otherRange.end) {\n // Use other definite end date as this one is infinite\n end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "title": "" }, { "docid": "655a45ea32498323046d300a58ae2172", "score": "0.6259759", "text": "isStartOfRange(date) {\n return (!!this.startDate &&\n !sameDate(this.startDate, this.endDate) &&\n sameDate(this.startDate, date) &&\n !this.isEndOfRange(date));\n }", "title": "" }, { "docid": "114f8915bad2d1d69aa4679347f1d829", "score": "0.6221837", "text": "function detectDateChange() {\n let currentStartDate = parseInt($(\"#starting_year\").val());\n let currentEndDate = parseInt($(\"#ending_year\").val());\n\n if(publicationDateValidation()) {\n if (isNaN(currentStartDate) && isNaN(currentEndDate)) {\n clearDatesFilter();\n }\n }\n setActiveFilters();\n}", "title": "" }, { "docid": "ed52302002107f4d8898a7ed5bd884de", "score": "0.62158704", "text": "function checkDates() {\r\n if ($(\"#departDatepicker\").datepicker('getDate') < $(\"#arriveDatepicker\").datepicker('getDate')) {\r\n $(\"#dateErrors\").append(\"<p>You must pickup before you dropoff</p>\");\r\n }\r\n if ($(\"#departDatepicker\").val() === \"\" || $(\"#arriveDatepicker\").val() === \"\") {\r\n $(\"#dateErrors\").append(\"<p>You must select both pickup and dropoff dates</p>\");\r\n }\r\n if ($(\"#arriveDatepicker\").datepicker('getDate') < new Date()) {\r\n $(\"#dateErrors\").append(\"<p>We only accept bookings in the future</p>\");\r\n }\r\n }", "title": "" }, { "docid": "631bbbfb7c8e3ff98968c077ecaef4b7", "score": "0.6213702", "text": "function validateVacationDates( panelIndex, optionName ) {\n \n var vacationResponseOn = $(panelIndex + \"_vrOn\").checked;\n if ( !vacationResponseOn )\n return true; /* bypass validation of turning off VR */\n \n // get values from GUI for start date....\n var startYear = $( panelIndex + \"_vrStartDate_year\").value;\n var startMonth = $( panelIndex + \"_vrStartDate_month\").value;\n var startDay = $( panelIndex + \"_vrStartDate_day\").value;\n\n // get values from GUI for end date...\n var endYear = $( panelIndex + \"_vrEndDate_year\").value;\n var endMonth = $( panelIndex + \"_vrEndDate_month\").value;\n var endDay = $( panelIndex + \"_vrEndDate_day\").value;\n \n var todayRaw = new Date();\n var today = new Date( todayRaw.getFullYear(), todayRaw.getMonth(), todayRaw.getDate() );\n var startDate = new Date( startYear, startMonth-1, startDay );\n var endDate = new Date( endYear, endMonth-1, endDay );\n\n var isValid = false;\n if ( startDate.getTime() < today.getTime() && endDate.getTime() < today.getTime() )\n alert( mailoptions_strings.invalid_date_msg3 );\n else if ( startDate.getTime() < today.getTime() )\n alert( mailoptions_strings.invalid_date_msg2 );\n else if ( endDate.getTime() < startDate.getTime() )\n alert( mailoptions_strings.invalid_date_msg1 );\n else\n isValid = true;\n\n return isValid;\n}", "title": "" }, { "docid": "39a44afb4e352480be69cee3c94d1552", "score": "0.62081724", "text": "isValidDate(currentDate, id) {\n const { startDate, endDate } = this.state;\n if (id === 'startDate') {\n return (\n moment(currentDate).isBefore(moment(endDate), 'year') &&\n moment(currentDate).isSameOrBefore(new Date(), 'year')\n );\n }\n return (\n moment(currentDate).isAfter(moment(startDate), 'year') &&\n moment(currentDate).isSameOrBefore(new Date(), 'year')\n );\n }", "title": "" }, { "docid": "4633b638dca49f293949f2bf9e687784", "score": "0.6206774", "text": "function validateDate(fromDate, toDate)\n{\n\tvar ret = 0;\n\n\tvar year = parseInt(toDate.substring(6, 10));\n\tvar month = parseInt(stripInitZeroSpace(toDate.substring(0, 2)));\n\tvar day = parseInt(stripInitZeroSpace(toDate.substring(3, 5)));\n\tvar to = new Date(year, month - 1, day);\n\n\tyear = parseInt(fromDate.substring(6, 10));\n\tmonth = parseInt(stripInitZeroSpace(fromDate.substring(0, 2)));\n\tday = parseInt(stripInitZeroSpace(fromDate.substring(3, 5)));\n\tvar from = new Date(year, month - 1, day);\n\n\tif (month > 2)\n\t\tyear++;\n\n\tvar temp = makeLastDay(month - 1, year);\n\tif (temp == 29)\n\t\ttemp = 366;\n\telse\n\t\ttemp = 365;\n\n\tvar diff = (Date.parse(to.toGMTString()) - Date.parse(from.toGMTString())) / 86400000;\n\n\tif (diff < 0 )\n\t\tret = -1;\n\telse if (diff >= temp)\n\t\tret = -2;\n\telse\n\t\tret = diff;\n\n\treturn ret;\n}", "title": "" }, { "docid": "314ae5354eaf9766af64bf196005837b", "score": "0.6199193", "text": "function compareDates () {\n\tvar startDate = new Date(document.querySelector('#event-start').value);\n\tvar errorMessage = 'date2';\n\tvar endDate = new Date(document.querySelector('#event-end').value);\n\t\tif (startDate >= endDate) {\n\t\t\teventEnd.tooltip('show');\n\t\t\taddError(errorMessage);\n\t\t} else {\n\t\t\teventEnd.tooltip('hide');\n\t\t\tremoveError(errorMessage);\n\t\t}\n}", "title": "" }, { "docid": "f5631631cab35fc51f5b946909587667", "score": "0.61764336", "text": "function validateVee(){\n var sDate = new Date(vm.Vee.fromDate);\n var eDate = new Date(vm.Vee.toDate);\n if(sDate == \"Invalid Date\" || eDate == \"Invalid Date\")\n {\n vm.errorToast(\"Please Select both From Date and To Date.\");\n return false;\n }\n if(eDate < sDate){\n vm.errorToast(\"To Date Can not be Less than Start Date.\");\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "0a6c4989dff5e3cad5b76a7d572d59e7", "score": "0.617338", "text": "inRange(year, month, day) {\n var range = this.state.dateRange;\n\n if (range[0] && range[1]) {\n var start = new Date(range[0].year, range[0].month, range[0].day);\n var end = new Date(range[1].year, range[1].month, range[1].day);\n var target = new Date(year, month, day);\n\n if (\n start.getTime() < target.getTime() &&\n target.getTime() < end.getTime()\n ) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "79050821c07f71609f864418e14b98e4", "score": "0.61643434", "text": "function dateInputEnd(dateIdStart, dateIdEnd) {\n var $inputStart = $('#' + dateIdStart);\n var $inputEnd = $('#' + dateIdEnd);\n date = new Date();\n var year1920 = date.getFullYear() - 1920;\n var currentyear = date.getFullYear();\n date.setDate(date.getDate());\n date.setMonth(0);\n date.setFullYear(currentyear - year1920);\n var specificField = $($inputStart).parsley();\n var startDateValue = $inputStart.val();\n window.ParsleyUI.removeError(specificField, \"startDateEmpty\");\n if ($inputStart.val() == \"\") {\n window.ParsleyUI.addError(specificField, \"startDateEmpty\", 'Debe Colocar una fecha de inicio');\n } else {\n $(\"#\" + dateIdEnd).datepicker({\n dateFormat: \"dd/mm/yy\",\n changeMonth: true,\n changeYear: true,\n minDate: startDateValue\n\n });\n }\n}", "title": "" }, { "docid": "c5b2525e71d2330c5bd8b5e371041631", "score": "0.6153368", "text": "function checkDateFromTo(obj) {\n\tvar dateFrom \t=\tobj.find('.date-from').val();\n\tvar dateTo \t\t=\tobj.find('.date-to').val();\n\n\ttry {\n var isCheck = true;\n var message = _text['E014'];\n\n if(!_validateFromToDate(dateFrom, dateTo)) {\n isCheck = false;\n obj.find('.date-from').errorStyle(message);\n obj.find('.date-to').errorStyle(message);\n } else {\n _removeErrorStyle(obj.find('.date-from'));\n _removeErrorStyle(obj.find('.date-to'));\n }\n //return error check\n return isCheck;\n } catch(e) {\n console.log('checkDateFromTo: ' + e.message);\n }\n}", "title": "" }, { "docid": "0029fa38a12ecde6daed3caaa5381a34", "score": "0.61479425", "text": "function checkDateRange(date1,date2,range)\r\n{\r\n if(trim(date1) == \"\")\r\n\t{\r\n\t\talert(\"Please select From Date...\");\r\n\t\treturn false;\r\n\t}\r\n\telse if(trim(date2) == \"\")\r\n\t{\r\n\t\talert(\"Please select To Date...\");\r\n\t\treturn false;\r\n\t}\r\n \r\n var one_day = 1000*60*60*24;\r\n \r\n //date1 01/12/2009 \r\n var dateObj1 = new Date();\r\n dateObj1.setMilliseconds(0);\r\n dateObj1.setSeconds(0);\r\n dateObj1.setFullYear(date1.substring(6,10));\r\n\tdateObj1.setMonth(parseInt(date1.substring(3,5),10)-1);\r\n\tdateObj1.setDate(date1.substring(0,2));\r\n\t \r\n //date2 31/12/2010\r\n var dateObj2 = new Date();\r\n dateObj2.setMilliseconds(0);\r\n dateObj2.setSeconds(0);\r\n dateObj2.setFullYear(date2.substring(6,10));\r\n\tdateObj2.setMonth(parseInt(date2.substring(3,5),10)-1);\r\n\tdateObj2.setDate(date2.substring(0,2));\r\n\t\r\n\t//alert(\"1-->\"+dateObj1);\r\n\t//alert(\"2-->\"+dateObj2);\r\n\t\r\n\tvar dayDiff = Math.ceil((dateObj2.getTime()-dateObj1.getTime())/(one_day));\r\n\t//alert(dayDiff);\r\n\t\r\n\tif(dayDiff < 0)\r\n\t{\r\n\t\talert(\"From date is greater than To date......\")\r\n\t\treturn false;\r\n\t}\r\n\telse if(dayDiff == 0)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse if( (dayDiff+1) > range)\r\n\t{\r\n\t\talert(\"Date range is exceeding limit of \"+range+\" days...\");\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "cf745469595d7a0a0d87b4bf41fb8e1c", "score": "0.61435604", "text": "function validate_date(date) {\n var regex = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4}$/;\n if (date.match(regex) === null) {\n return {pass: false, message: \"Wrong format\"};\n }\n\n\n // Validates if month is between 1 and 12 months inclusive\n var dateSplit = date.split('/');\n if (parseInt(dateSplit[0]) <= 0 || parseInt(dateSplit[0]) > 12) {\n return {pass: false, message: \"Month not in range\"};\n }\n\n // Validates if there are correct amount of days in months\n // Takes into account leap years for February\n var longMonths = [\"01\", \"03\", \"05\", \"07\", \"08\", \"10\", \"12\"];\n if (dateSplit[0] === \"02\") {\n if ((parseInt(dateSplit[2]) % 4 === 0) &&\n ((parseInt(dateSplit[1]) > 29) ||\n (parseInt(dateSplit[1]) <= 0))) {\n return {pass: false, message: \"Day not in range\"};\n } else if (parseInt(dateSplit[1]) > 28 || parseInt(dateSplit[1] <= 0)) {\n return {pass: false, message: \"Day not in range\"};\n }\n } else if (longMonths.includes(dateSplit[0])) {\n if (parseInt(dateSplit[1]) > 31 || parseInt(dateSplit[1]) < 0) {\n return {pass: false, message: \"Day not in range\"};\n }\n } else {\n if (parseInt(dateSplit[1]) > 30 || parseInt(dateSplit[1]) < 0) {\n return {pass: false, message: \"Day not in range\"};\n }\n }\n\n // Validates if the year is now or in the future\n var now = new Date();\n if (dateSplit[2] < now.getFullYear()) {\n return {pass: false, message: \"Year not in range\"};\n }\n\n return {pass: true, message: \"Success!\"};\n}", "title": "" }, { "docid": "6205fabaf7ebc358c671c0d79fe14180", "score": "0.61428314", "text": "validateDates(date) {\n if (!date) {\n return false;\n }\n if (!isNaN(date) && parseInt(date, 10) && 0 < date < 2017 ) { //Integer which is a year\n return true;\n }\n const regMonthYear = /(0[1-9]|[12][0-9]|3[01])[- -.]\\d\\d/; //Month and a year with - as a seperator\n if (date.match(regMonthYear)) {\n return true;\n } \n const regFull = /(0[1-9]|[12][0-9]|3[01])[- -.](0[1-9]|1[012])[- -.](19|20)\\d\\d/; //Year month and day with - as a seperator\n if (date.match(regFull)) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "f5d0e2e066416dcaeddd5101d50f3383", "score": "0.61418134", "text": "allowedDates(day) {\n return !isWithinAnyInterval(day, this.plannedDates)\n }", "title": "" }, { "docid": "1b0d8083c322eb3f412f319f33653d0c", "score": "0.61395013", "text": "function needDataFromServer() {\n var oldStartDate = moment(rC.oldStartDateString, rC.momentFormat).subtract(1, \"millisecond\");\n var oldEndDate = moment(rC.oldEndDateString, rC.momentFormat).add(1, \"millisecond\");\n\n var newStartDate = moment(rC.StartDateString, rC.momentFormat);\n var newEndDate = moment(rC.EndDateString, rC.momentFormat);\n\n if (newStartDate.isBetween(oldStartDate, oldEndDate) && newEndDate.isBetween(oldStartDate, oldEndDate)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "269c3e65266f124ca16b7082c70bc451", "score": "0.6129455", "text": "function formatDateTimeRangeInput(start, end) {\n start = moment(Number(start));\n end = moment(Number(end));\n return (start.hour() == 0 && start.minute() == 0 && start.second() == 0\n && end.hour() == 23 && end.minute() == 59 && end.second() == 59)\n ? {allDay: true, start: start.format('MMMM DD YYYY'), end: end.format('MMMM DD YYYY')}\n : {allDay: false, start: start.format('HH:mm, MMMM DD YYYY'), end: end.format('HH:mm, MMMM DD YYYY')};\n}", "title": "" }, { "docid": "ff731924d4c079407f2bfa6240cdd8fd", "score": "0.6114851", "text": "function eventDateTimeValidation() {\n //getting the start of event\n var sDate = $(\"#datepicker1\").prop('value');\n var sTime = $(\"#timepicker1\").prop('value');\n\n var startString = sDate + \" \" + sTime;\n var sDT = new Date(startString);\n var startYear = sDT.getFullYear();\n\n var startMonth = sDT.getMonth() + 1;\n if (startMonth < 10) startMonth = \"0\" + startMonth;\n\n var startDate = sDT.getDate();\n if (startDate < 10) startDate = \"0\" + startDate;\n\n var startDateTime = startYear + \"/\" + startMonth + \"/\" + startDate + \" \" + sTime;\n\n if ($(\"#all-day\").prop('checked')) {\n startDateTime = startYear + \"/\" + startMonth + \"/\" + startDate;\n }\n\n $(\"#datetimepicker1\").prop('value', startDateTime);\n\n\n//getting the end of the event\n var eDate = $(\"#datepicker2\").prop('value');\n var eTime = $(\"#timepicker2\").prop('value');\n\n var endString = eDate + \" \" + eTime;\n var eDT = new Date(endString);\n\n var endYear = eDT.getFullYear();\n var endMonth = eDT.getMonth() +1;\n if (endMonth < 10) endMonth = \"0\" + endMonth;\n\n var endDate = eDT.getDate();\n if (endDate < 10) endDate = \"0\" + endDate;\n\n endDateTime = endYear + \"/\" + endMonth + \"/\" + endDate + \" \" + eTime;\n\n if ($(\"#all-day\").prop('checked')) {\n var endDateTime = endYear + \"/\" + endMonth + \"/\" + endDate;\n }\n\n $(\"#datetimepicker2\").prop('value', endDateTime);\n\n if (eDT < sDT) {\n $(\"#datepicker2, #timepicker2\").css(\"color\", \"red\");\n alert(\"The end date should be after the start date. Please choose a valid end date\");\n }\n\n console.log( $(\"#datetimepicker1\").prop('value'));\n console.log( $(\"#datetimepicker2\").prop('value'));\n}", "title": "" }, { "docid": "dcd3fef116ae58601011e16d31bc5e30", "score": "0.609057", "text": "function CP_addDisabledDates(start, end) {\n\tif (arguments.length==1) { end=start; }\n\tif (start==null && end==null) { return; }\n\tif (this.disabledDatesExpression!=\"\") { this.disabledDatesExpression+= \"||\"; }\n\tif (start!=null) { start = parseDate(start); start=\"\"+start.getFullYear()+LZ(start.getMonth()+1)+LZ(start.getDate());}\n\tif (end!=null) { end=parseDate(end); end=\"\"+end.getFullYear()+LZ(end.getMonth()+1)+LZ(end.getDate());}\n\tif (start==null) { this.disabledDatesExpression+=\"(ds<=\"+end+\")\"; }\n\telse if (end ==null) { this.disabledDatesExpression+=\"(ds>=\"+start+\")\"; }\n\telse { this.disabledDatesExpression+=\"(ds>=\"+start+\"&&ds<=\"+end+\")\"; }\n\t}", "title": "" }, { "docid": "cfda653c727d0a219eaf64cc1e806fb9", "score": "0.60795134", "text": "function dateValidator(endDate){\n\t// `this` is the mongoose document\n\treturn this.startDate < endDate;\n}", "title": "" }, { "docid": "c155ef753cdd17ab451853dfc602783c", "score": "0.60788584", "text": "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "e7e87cbf67e05b0f00aaa7eaa7fc5271", "score": "0.60778886", "text": "function equalsDates(date1,date2){\r\n\tvar d1 = date1.value;\r\n\tvar d2 = date2.value;\r\n\t\r\n\tvar arrSD = new Array();\r\n\tvar arrED = new Array();\r\n\r\n\tarrSD = d1.split(\"/\");\r\n\tarrED = d2.split(\"/\");\r\n\tvar endYear = arrED[2];\r\n\tvar endMonth =arrED[1];\r\n\tvar endDay = arrED[0];\r\n\tvar startYear = arrSD[2];\r\n\tvar startMonth = arrSD[1];\r\n\tvar startDay = arrSD[0];\r\n\t\r\n\treturn (endYear == startYear && endMonth == startMonth && endDay == startDay);\r\n}", "title": "" }, { "docid": "1ab19b50e7787d1ed2f717a4dbdafb53", "score": "0.6070576", "text": "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "e925d6e05788cba2f8b2b2e739cd1715", "score": "0.6068154", "text": "isValidDate(date) {\n // TODO: This method is SUPER slow because it gets called for every single date.\n const {\n minDate,\n maxDate,\n shouldValidate\n } = this.props\n\n // If validation is set to false, avoid checking validations\n if (!shouldValidate) return true\n\n // If a validation callback was provided, execute it\n if (typeof isValidDate === 'function') return this.isValidDate(date)\n\n // Handle disabled dates\n if (!date.isBetween(minDate, maxDate)) return false\n\n // Show the date\n return true\n }", "title": "" }, { "docid": "62da75f19c07040d9ef28d467736666e", "score": "0.60658", "text": "function startDateIsValid(willShowErrorMessage) {\n if (!/(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\\d\\d/.test(String(startDate))) {\n if (willShowErrorMessage) {\n data = {\n message: \"The start date should be in form MM/DD/YYYY.\",\n timeout: 8000,\n actionHandler: hideSnackbar,\n actionText: \"Dismiss\"\n };\n showSnackbarMessage(data);\n }\n\n hideResults();\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "329eb44111255c59bf60b84d4b42c7a9", "score": "0.60603684", "text": "function isPartOfRange(rangeStart, rangeEnd, date) {\r\n var rangeStartYear = rangeStart.getFullYear();\r\n var rangeStartMonth = rangeStart.getMonth();\r\n var rangeStartDate = rangeStart.getDate();\r\n var rangeEndYear = rangeEnd.getFullYear();\r\n var rangeEndMonth = rangeEnd.getMonth();\r\n var rangeEndDate = rangeEnd.getDate();\r\n var dateYear = date.getFullYear();\r\n var dateMonth = date.getMonth();\r\n var dateDate = date.getDate();\r\n // if date lies in between the year\r\n if (rangeStartYear <= dateYear && dateYear <= rangeEndYear) {\r\n // if year is in-between range year start and year end\r\n if (rangeStartYear < dateYear && dateYear < rangeEndYear) {\r\n return true;\r\n }\r\n // if start year and end year are same\r\n if (rangeStartYear === rangeEndYear) {\r\n if (rangeStartMonth <= dateMonth && dateMonth <= rangeEndMonth) {\r\n // if month is in-between month start and and moth end\r\n if (rangeStartMonth < dateMonth && dateMonth < rangeEndMonth) {\r\n return true;\r\n }\r\n // if month start and month end are same\r\n if (rangeStartMonth === rangeEndMonth) {\r\n if (rangeStartDate <= dateDate && dateDate <= rangeEndDate && dateMonth === rangeEndMonth) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // if date is in start month\r\n if (rangeStartMonth === dateMonth) {\r\n if (rangeStartDate <= dateDate) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // if date is in end month\r\n if (rangeEndMonth === dateMonth) {\r\n if (dateDate <= rangeEndDate) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n // if year is same as start year\r\n if (rangeStartYear === dateYear) {\r\n // if month is greater than start month\r\n if (dateMonth > rangeStartMonth) {\r\n return true;\r\n }\r\n // if month is same as start month\r\n if (dateMonth === rangeStartMonth) {\r\n // if date is greater than range start date\r\n if (dateDate >= rangeStartDate) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n // if year is same as end year\r\n if (rangeEndYear === dateYear) {\r\n // if month is smaller than end month\r\n if (dateMonth < rangeEndMonth) {\r\n return true;\r\n }\r\n // if month is same as end month\r\n if (dateMonth === rangeEndMonth) {\r\n // if date is smaller than range end date\r\n if (dateDate <= rangeEndDate) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "91984343b8dc377f76d65f1a67dfaadf", "score": "0.6047338", "text": "function checkDate () {\n\tvar startField = document.querySelector('#event-start').value;\n\tvar errorMessage = 'date1';\n\tvar startDate = new Date(startField);\n\tvar localTime = startDate.getTimezoneOffset() * 60000;\n\tvar startDate = Date.parse(startDate) + localTime;\n\tvar now = Date.now();\n\tif(now >= startDate) {\n\t\teventStart.tooltip('show');\n\t\taddError(errorMessage);\n\t} else {\n\t\teventStart.tooltip('hide');\n\t\tremoveError(errorMessage);\n\t}\n}", "title": "" }, { "docid": "947a8cc10d6ab3607a9fdbbd3f588844", "score": "0.60262316", "text": "function CP_addDisabledDates(start, end) {\r\n\tif (arguments.length == 1) { end = start; }\r\n\tif (start == null && end == null) { return; }\r\n\tif (this.disabledDatesExpression != \"\") { this.disabledDatesExpression += \"||\"; }\r\n\tif (start != null) {\r\n\t\tstart = parseDate(start);\r\n\t\tstart = \"\" + start.getFullYear() + LZ(start.getMonth() + 1) + LZ(start.getDate());\r\n\t}\r\n\tif (end != null) {\r\n\t\tend = parseDate(end);\r\n\t\tend = \"\" + end.getFullYear() + LZ(end.getMonth() + 1) + LZ(end.getDate());\r\n\t}\r\n\tif (start == null) { this.disabledDatesExpression += \"(ds<=\" + end + \")\"; }\r\n\telse if (end == null) { this.disabledDatesExpression += \"(ds>=\" + start + \")\"; }\r\n\telse { this.disabledDatesExpression += \"(ds>=\" + start + \"&&ds<=\" + end + \")\"; }\r\n}", "title": "" }, { "docid": "f1b3ea6f7b2fc96aa1b3141c26f9eb19", "score": "0.60022277", "text": "function checkDates() {\n //Si tiene valor el dataTable no tiene paginacion\n if ($(\"#dateInit\").val() != \"\" && $(\"#dateEnd\").val() != \"\") {\n optionsDataTable.paging = false;\n }\n }", "title": "" }, { "docid": "6be5eedcc079df191f7d50c78251fad8", "score": "0.6000377", "text": "function checkDateValidity(endDate) {\n var currDate = new Date();\n currDate.setHours(0);\n currDate.setMinutes(0);\n currDate.setSeconds(0);\n currDate.setMilliseconds(0);\n\n if (currDate > new Date(endDate)) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "519445133846ec12059680a1f4cee46b", "score": "0.5998157", "text": "function isDateInRange(dateStr, startDate, endDate) {\n let date = dateUtils.format(dateStr, null, ISOFORMAT);\n let start = dateUtils.format(startDate, null, ISOFORMAT);\n let end = dateUtils.format(endDate, null, ISOFORMAT);\n return dateUtils.isBetween(date, start, end, 'day', '[]');\n}", "title": "" }, { "docid": "3ed39d4943b7f94e86fdfa109e90e0ad", "score": "0.5994256", "text": "function set_date_ranges(start_date, end_date) {\n $(\"#date_start\").val(start_date);\n $(\"#date_end\").val(end_date);\n }", "title": "" }, { "docid": "db1c35c012bbf3f7eec37e0d380f2ae4", "score": "0.5980592", "text": "function validateTwoDates() {\n var $dateStartTask = $(\"#timeStartTask\").val();\n var $dateFinishTask = $(\"#timeFinishTask\").val();\n if($dateFinishTask > $dateStartTask){\n return true;\n } else {\n Materialize.toast('Date finish must to be greater date start', 4000);\n return false;\n }\n }", "title": "" }, { "docid": "a09d70e0a2f5ac42eea9effc4ba9e613", "score": "0.5976226", "text": "function validDateTime(dateBgn, dateEnd, condition, op) {\n var nRes = 0, ndateBgn = 0, ndateEnd = 0;\n ndateBgn = stringToDateTime(dateBgn, op);\n ndateEnd = stringToDateTime(dateEnd, op);\n if (eval(ndateBgn + condition + ndateEnd)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "120bc96f18fb4872c94e9c644d13b859", "score": "0.5973619", "text": "function checkDates() {\n if (!villaChecked) {\n alert('Please choose a Villa');\n validGood = false;\n } else if (arrDateFilled == \"\" || arrDateFilled == null) {\n alert('Please enter your arrival date');\n $('#from').focus();\n validGood = false;\n } else if (depDateFilled == \"\" || depDateFilled == null) {\n alert('Please enter your departure date');\n $('#to').focus();\n validGood = false;\n } else if (days == 0) {\n alert('You must select at least 1 night');\n // $('#numOfDays').css('border', '3px solid red');\n validGood = false;\n } else {\n validGood = true;\n }\n }", "title": "" }, { "docid": "8e7e8b3fd6b1f614074cc3405deeae34", "score": "0.59723073", "text": "function _dateChecker (test) {\n const formats = [\n 'DD/MM/YYYY',\n 'DD/M/YYYY',\n 'D/MM/YYYY',\n 'D/M/YYYY',\n 'MM/DD/YYYY',\n 'YYYY/DD/MM',\n 'YYYY/MM/DD',\n 'DD-MM-YYYY',\n 'DD-M-YYYY',\n 'D-MM-YYYY',\n 'D-M-YYYY',\n 'MM-DD-YYYY',\n 'YYYY-DD-MM',\n 'YYYY-MM-DD'\n ]\n var date = false, elementReturn\n _.forEach(formats, function (format, key) {\n // Test first for dd-mm-yyyy format but will search past if necessary\n if (moment(test, format, true).isValid() && date == false) {\n elementReturn = moment(test, format).format('YYYY-MM-DD')\n date = true\n }\n })\n return {\n date: date, // bolean, is Date?\n elementReturnDate: elementReturn // date formatted as dd-mm-yyyy\n }\n}", "title": "" }, { "docid": "8757f70c7426ba5227b21d5aa7b41f01", "score": "0.5968096", "text": "function checkDateFromTo(fromDateVar,toDateVar,fromHours,fromMinutes,toHours,toMinutes,notcheckFromDate,dateName){\r\n\ttry{\r\n\t\tif(toDateVar==null || fromDateVar==null || toDateVar.type!='text' || fromDateVar.type!='text'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar tmp=toDateVar.value;\r\n\t\ttmp=fromDateVar.value;\r\n\t}catch(e){\r\n\t\treturn true;\r\n\t}\r\n\tif(toDateVar.value==\"\"){\r\n\t\treturn true;\r\n\t}\r\n\tvar fromDateStr=fromDateVar.value;\r\n\tvar toDateStr=toDateVar.value;\r\n\tvar result=true;\r\n\tvar fArr=fromDateStr.split(\"/\");\r\n\tvar fYear,fMonth,fDay;\r\n\tif(fArr.length>0){\r\n\t\tfMonth=fArr[0]-1;\r\n\t}\r\n\tif(fArr.length>1){\r\n\t\tfDay=fArr[1];\r\n\t}\r\n\tif(fArr.length>2){\r\n\t\tfYear=fArr[2];\r\n\t}\r\n\tif(!fromHours){\r\n\t\tfromHours=0;\r\n\t}\r\n\tif(!fromMinutes){\r\n\t\tfromMinutes=0;\r\n\t}\r\n\tvar fromDate=new Date(fYear,fMonth,fDay,fromHours,fromMinutes,0);\r\n\t\r\n\tvar tArr=toDateStr.split(\"/\");\r\n\tvar tYear,tMonth,tDay;\r\n\tif(tArr.length>0){\r\n\t\ttMonth=tArr[0]-1;\r\n\t}\r\n\tif(tArr.length>1){\r\n\t\ttDay=tArr[1];\r\n\t}\r\n\tif(tArr.length>2){\r\n\t\ttYear=tArr[2];\r\n\t}\r\n\tif(!toHours){\r\n\t\ttoHours=0;\r\n\t}\r\n\tif(!toMinutes){\r\n\t\ttoMinutes=0;\r\n\t}\r\n\tvar toDate=new Date(tYear,tMonth,tDay,toHours,toMinutes,59);\r\n\t\r\n\tvar now=new Date();\r\n\t//less now and form < to\r\n\t//alert(now.getTime()+\" \"+fromDate.getTime()+\" \"+toDate.getTime()+\"\\n\"\r\n\t//\t+now.toString()+\" \"+fromDate.toString()+\" \"+toDate.toString());\r\n\t\r\n\tif(!notcheckFromDate){\t\r\n\t\tresult= fromDate.getTime()<=now.getTime();\r\n\t\tif(!result){\r\n\t\t\tif(!dateName){\r\n\t\t\t\talert(\"'From' date must be equal to or less than now.\");\r\n\t\t \t}else{\r\n\t\t \t\talert(dateName+\" 'from' date must be equal to or less than now.\");\r\n\t\t \t}\r\n\t\t\tfromDateVar.focus();\r\n\t\t}\r\n\t}\r\n\tif(result){\r\n\t\tresult=fromDate.getTime()<=toDate.getTime();\r\n\t\tif(!result){\r\n\t\t\tif(!dateName){\r\n\t\t\t\talert(\"'To' date must be equal to or later than 'from' date.\" );\r\n\t\t\t}else{\r\n\t\t\t\talert(dateName+\" 'to' date must be equal to or later than 'from' date.\" );\r\n\t\t\t}\r\n\t\t\tfromDateVar.focus();\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn result;\r\n}", "title": "" }, { "docid": "b1e31352b7cad667282b098738101cf0", "score": "0.59648", "text": "function checkStartDate(firstDate, secondDate) {\r\n\r\n $(firstDate).datepicker({\r\n dateFormat: \"mm/dd/yy\",\r\n onClose: function (firstDate) {\r\n $(secondDate).datepicker(\"option\", \"minDate\", firstDate), $(this).valid();\r\n }\r\n })\r\n }", "title": "" }, { "docid": "4eeebb41c2c47a68472b967962520db8", "score": "0.59553164", "text": "join_date(obj) {\n if ($('#date2').val() === \"\" || $('#date2').val().length !== 10 ) {\n vm.errorMessage('#date2','Invalid Date')\n return false\n }\n else {\n vm.removeError('#date2')\n return true\n };\n }", "title": "" }, { "docid": "de2735125118803a4bf852aece16bb2e", "score": "0.59525055", "text": "function travelDateValidation() {\r\n var blankSpace = /^\\s*$/;\r\n\r\n $(\"input[type='date']\").each(function() {\r\n var id = $(this).attr(\"id\");\r\n var date = $(\"#\" + id).val().split(\"-\"); // Stores date components in an array.\r\n var year = date[0];\r\n var month = date[1];\r\n var day = date[2];\r\n var currentDate = new Date();\r\n var currentYear = currentDate.getFullYear();\r\n var currentMonth = currentDate.getMonth() + 1;\r\n var currentDay = currentDate.getDay() + 1;\r\n if(((year < currentYear || (year == currentYear && month < currentMonth) || (year == currentYear && month == currentMonth && day < currentDay)) && !blankSpace.test(year))) {\r\n $(this).addClass(\"notValid\");\r\n errorDisplayShow(id, \"travelDate\");\r\n pageValid = false;\r\n } else {\r\n $(this).removeClass(\"notValid\");\r\n errorDisplayHide(id);\r\n pageValid = true;\r\n }\r\n });\r\n}", "title": "" }, { "docid": "0b2acf90b7d7ab06ae02d34c52e81f93", "score": "0.5945272", "text": "function validate(){\n\n //check valid input\n var startDay = $('#start').val();\n var endDay =$('#end').val();\n\n // window.alert(\"line108\");\n checkInputValidation(startDay, endDay);\n}", "title": "" }, { "docid": "816b02b7f8a6a1780082d827f80cf8a0", "score": "0.59324986", "text": "getForDate(begin, end) {\n\t\tif(begin instanceof Date) begin=begin.getTime();\n\t\tif(end instanceof Date) end=end.getTime();\n\t\treturn this.events.filter(a => {\n\t\t\tif(!a.start) return false;\n\t\t\tlet time=a.start.getTime();\n\t\t\treturn time>=begin && time<=end;\n\t\t});\n\t}", "title": "" }, { "docid": "dee97502cace45aa36a9cb088f3617b9", "score": "0.59295726", "text": "function cal_enable_state(startStr, endStr, startTime, endTime) {\n if (startStr == \"\" || endStr == \"\") {\n return false;\n }\n else if (startTime >= endTime) {\n return false;\n }\n else if( (endTime.getTime() - startTime.getTime()) > 6000000 ) {\n return false;\n }\n else {\n return true;\n } \n }", "title": "" }, { "docid": "753af82a513f82e69855539f82b496a7", "score": "0.5926407", "text": "function validate_fechaMayorQue(fechaInicial,fechaFinal){\n valuesStart=fechaInicial.split(\"-\");\n valuesEnd=fechaFinal.split(\"-\");\n\n // Verificamos que la fecha no sea posterior a la actual\n var dateStart=new Date(valuesStart[2],(valuesStart[1]-1),valuesStart[0]);\n var dateEnd=new Date(valuesEnd[2],(valuesEnd[1]-1),valuesEnd[0]);\n if(dateStart>=dateEnd)\n {\n return 0;\n }\n return 1;\n}", "title": "" }, { "docid": "86172a2b84a2506669ba473faf631d57", "score": "0.592041", "text": "function checkDate(date){\n\n if(date.value === \"\" ){\n document.getElementById(\"errormsg10\").style.display = \"block\";\n }\n var flag = true;\n var dateStr = date.value;\n splitedDateArray = dateStr.split(\"-\");\n \n for (var i of splitedDateArray){\n if(isNaN(i)){\n flag = false;\n }\n if((i.length > 4)){\n flag = false;\n }\n }\n\n var maxDate=31;\n var m = splitedDateArray[1];\n if(m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12){\n maxDate=31;\n }\n else if(m == 4 || m == 6 || m == 9 || m == 11){\n maxDate=30;\n }\n else if(m == 2){\n if((splitedDateArray[2] % 4 == 0 && splitedDateArray[2] % 100 != 0) || (splitedDateArray[2] % 400 == 0)){\n maxDate = 29;\n }\n else{\n maxDate = 28;\n }\n }\n if( splitedDateArray[0] > maxDate){\n flag = false;\n }\n\n if(splitedDateArray.length > 3){\n flag = false;\n }\n \n if(splitedDateArray[0].length > 2 || splitedDateArray[1].length > 2){\n flag = false;\n }\n if(splitedDateArray[0] < 1 || splitedDateArray[0] > 31){\n flag = false;\n }\n if(splitedDateArray[1] < 1 || splitedDateArray[1] > 12){\n flag = false;\n }\n\n if( flag == true){\n document.getElementById(\"dateAns\").innerHTML = \"Date is valid...\";\n document.getElementById(\"dateAns\").style.display = \"block\";\n document.getElementById(\"errormsg10\").style.display = \"none\";\n }\n else{\n document.getElementById(\"errormsg10\").innerHTML = \"Date is not valid...\";\n document.getElementById(\"errormsg10\").style.display = \"block\";\n document.getElementById(\"dateAns\").style.display = \"none\";\n }\n \n \n \n // switch(splitedDateArray[1]){\n // case 0:\n // maxDate = 31;\n // break;\n\n // }\n // if(isNaN(dateStr)){\n // document.getElementById(\"dateAns\").innerHTML = \"Not valid date\";\n // }\n}", "title": "" }, { "docid": "0b5eadb333286e9de537337644512d12", "score": "0.5905411", "text": "handleStartDate(date) {\n if (this.state.endDate > moment(date)) {\n this.setState({startDate: moment(date)});\n } else {\n toast.warn(\"Start date must be earlier than the end date!\"); // Fire a warning toast (react-toastify)\n }\n }", "title": "" }, { "docid": "474909d5eabe29b3d48b93250c686c02", "score": "0.5898942", "text": "function ValidDate(optionFrom, optionTo) {\n var dateFrom = document.getElementById(optionFrom);\n var dateTo = document.getElementById(optionTo);\n if (dateFrom.value == \"\" || dateTo.value == \"\") {\n alert('Date cannot be blank');\n return false;\n }\n if (CheckValidDate(dateFrom, dateTo)) {\n return true;\n }\n else\n return false;\n\n\n}", "title": "" }, { "docid": "2597bc7ca26b2cf395de4e07dba4195b", "score": "0.58980244", "text": "function dateCheck() {\r\n const startDate = document.getElementById('start');\r\n const endDate = document.getElementById('end').value.split('-');\r\n\r\n startDate.setAttribute(\"max\", endDate[0] + \"-\" + endDate[1] + \"-\" + (endDate[2] - 1));\r\n}", "title": "" }, { "docid": "b7139c71ca13da5ae0504ec951976869", "score": "0.58806574", "text": "function checkDates(el, no_empty) {\n\tif (el.form.orig_onsubmit == undefined) {\n\t\tel.form.orig_onsubmit = null;\n\t}\n\tif (el.form.invalid_dates == undefined) {\n\t\tel.form.invalid_dates = new Array();\n\t}\n\n\tvar isValid;\n\tif (no_empty) {\n\t\tisValid = isValidDate(el);\n\t} else {\n\t\tisValid = isValidDateOrEmpty(el);\n\t}\n\tif (!isValid) {\n\t\tif (!el.form.invalid_dates[el.id]) {\n\t\t\tel.form.invalid_dates[el.id] = 1;\n\t\t\tif (el.form.orig_onsubmit === null) {\n\t\t\t\tif (el.form.onsubmit == undefined) {\n\t\t\t\t\tel.form.orig_onsubmit = \"\";\n\t\t\t\t} else {\n\t\t\t\t\tel.form.orig_onsubmit = el.form.onsubmit;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tel.form.onsubmit = function test() { alert('Error: Please make sure that all dates are valid.'); return false; }\n\t\t\tel.style.backgroundColor = \"#FF3333\";\n\t\t}\n\t} else {\n\t\tif (el.form.invalid_dates[el.id]) {\n\t\t\tvar all_ok = 1;\n\t\t\tel.form.invalid_dates[el.id] = 0;\n\t\t\tfor (var i in el.form.invalid_dates) {\n\t\t\t\tif (el.form.invalid_dates[i]) { all_ok = 0; break; }\n\t\t\t}\n\n\t\t\tif (all_ok && el.form.orig_onsubmit !== null) {\n\t\t\t\tel.form.onsubmit = el.form.orig_onsubmit;\n\t\t\t\tel.form.orig_onsubmit = null;\n\t\t\t}\n\n\t\t\tel.style.backgroundColor = \"white\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fdcd7aabf41ff210095b8509c2db15bd", "score": "0.5875279", "text": "function find_date_range(start, end){\n // This function retrieves all the entries within specified date range\n var start_date = Date.parse(start);\n var end_date = Date.parse(end);\n var dates_in_range = [];\n if(end != \"\"){\n for(let d of filtered){\n if(Date.parse(d[\"event-start-date\"]) >= start_date && Date.parse(d[\"event-end-date\"]) <= end_date){\n dates_in_range.push(d);\n }\n }\n }\n else{\n for(let d of filtered){\n if(Date.parse(d[\"event-start-date\"]) >= start_date){\n dates_in_range.push(d);\n }\n }\n }\n dates_in_range\n populateTable(dates_in_range);\n}", "title": "" } ]
22b3c5c487bd5b992ad8214a58c0beb1
get options for the marker ids
[ { "docid": "28315ada1cc3d867adf7ac86608886f8", "score": "0.55735606", "text": "function getMarkerDrawOptions(ids, group, whitelist) {\r\n\t\tlet {range, offset} = group\r\n\t\t// unsnapped options\r\n\t\tif (!ids.snap) {\r\n\t\t\tlet elements = whitelist ? filter(ids.data, whitelist) : ids.elements;\r\n\r\n\t\t\treturn [extend({}, group, {\r\n\t\t\t\telements: elements,\r\n\t\t\t\toffset: 0,\r\n\t\t\t\tcount: whitelist ? elements.length : ids.length,\r\n\t\t\t\tmarker: markerTextures[ids.id]\r\n\t\t\t})]\r\n\t\t}\r\n\r\n\t\t// scales batch\r\n\t\tlet batch = []\r\n\t\tlet {lod, x, id} = ids\r\n\r\n\t\tlet pixelSize = Math.min((range[2] - range[0]) / group.viewport.width, (range[3] - range[1]) / group.viewport.height)\r\n\r\n\t\tfor (let scaleNum = lod.length; scaleNum--;) {\r\n\t\t\tlet level = lod[scaleNum]\r\n\r\n\t\t\t// FIXME: use minSize-adaptive coeff here, if makes sense, mb we need dist tho\r\n\t\t\tif (level.pixelSize && level.pixelSize < pixelSize && scaleNum > 1) {\r\n\t\t\t\tcontinue\r\n\t\t\t}\r\n\r\n\t\t\tlet intervalStart = level.offset\r\n\t\t\tlet intervalEnd = level.count + intervalStart\r\n\r\n\t\t\tlet startOffset = search.ge(x, range[0], intervalStart, intervalEnd - 1)\r\n\t\t\tlet endOffset = search.lt(x, range[2], startOffset, intervalEnd - 1) + 1\r\n\r\n\t\t\tif (endOffset <= startOffset) continue\r\n\r\n\t\t\t// whitelisted level requires subelements from the range\r\n\t\t\tif (whitelist) {\r\n\t\t\t\tlet elements = filter(ids.data.subarray(startOffset, endOffset), whitelist)\r\n\r\n\t\t\t\tbatch.push(extend({}, group, {\r\n\t\t\t\t\telements: elements,\r\n\t\t\t\t\tmarker: markerTextures[id],\r\n\t\t\t\t\toffset: 0,\r\n\t\t\t\t\tcount: elements.length\r\n\t\t\t\t}))\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbatch.push(extend({}, group, {\r\n\t\t\t\t\telements: ids.elements,\r\n\t\t\t\t\tmarker: markerTextures[id],\r\n\t\t\t\t\toffset: startOffset,\r\n\t\t\t\t\tcount: endOffset - startOffset\r\n\t\t\t\t}))\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction filter(offsets, whitelist) {\r\n\t\t\tlet subEls = []\r\n\t\t\tfor (let i = 0, l = offsets.length; i < l; i++) {\r\n\t\t\t\tlet el = offsets[i]\r\n\t\t\t\tlet id = el - offset\r\n\t\t\t\tif (whitelist[id]) {\r\n\t\t\t\t\tsubEls.push(el)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn subEls\r\n\t\t}\r\n\r\n\t\treturn batch\r\n\t}", "title": "" } ]
[ { "docid": "01ff55cc4e20035b1c2d3bba0b15c2c8", "score": "0.64444506", "text": "function getOptions(mapId) {\n return mapDefaults[mapId];\n }", "title": "" }, { "docid": "0366312e4a6d3915aff38189114be3d9", "score": "0.60043067", "text": "getId() {\n return this.markerId;\n }", "title": "" }, { "docid": "c42ae7948a4bc3cfc4f9aed7d23cf505", "score": "0.59565926", "text": "function getIdOfAllMarkers() {\n const idOfAllMarkers = Array.from(markers.keys());\n return idOfAllMarkers;\n}", "title": "" }, { "docid": "6c397c98053c586e6bb306524b7c8774", "score": "0.5837854", "text": "static get markerSize() {\n return 2 * SelectionMarker.markerOffset;\n }", "title": "" }, { "docid": "875112d21f28ee8ca0adab8a7e160e4e", "score": "0.58295", "text": "getMarker(id, lat, lon) {\n return {\n iconPath: \"../../images/marker/marker.png\", \n id: id,\n latitude: lat,\n longitude: lon,\n width: 40,\n height: 40\n }\n }", "title": "" }, { "docid": "54de47934264e88c9f2ddf0510995c5e", "score": "0.578557", "text": "function IconOptions() { }", "title": "" }, { "docid": "fa9502b2b2a87bf58cc8aebec8d981e2", "score": "0.5715518", "text": "function generateMapOptions() {\r\n\t\r\n\t var options = {\r\n\t\t maxScale: 500,\r\n\t\t minScale: 20000000,\r\n\t\t numZoomLevels: 12,\r\n\t\t minResolution: \"auto\",\r\n\t\t minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),\r\n\t\t maxResolution: \"auto\",\r\n\t\t maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),\r\n\t\t tileSize: new OpenLayers.Size(400,400),\r\n\t\t controls: [\r\n\t\t new OpenLayers.Control.Navigation(),\r\n\t\t new OpenLayers.Control.ArgParser(),\r\n\t\t new OpenLayers.Control.Attribution()\r\n\t\t \t]\r\n\t\t };\r\n\t \r\n\t return options;\r\n\t\r\n}", "title": "" }, { "docid": "b8c19afd9cf9a01c0a096ffc80a2380e", "score": "0.5614983", "text": "function setMarkersGE() {\n markers =[\n ['Nukriani', 41.6091781,45.8947416],\n ['Kazbegi', 42.657029,44.6308047],\n ];\n \n }", "title": "" }, { "docid": "bb980a6462424e8dc88ac458544b2c35", "score": "0.5602449", "text": "get options() {\n return this.m_optionsMap;\n }", "title": "" }, { "docid": "0053baa14d48ee08d92b13fb36ea7f47", "score": "0.55347025", "text": "getQueryParameters () {\n\t\t// we'll restrict to a few of the IDs\n\t\tconst queryParameters = super.getQueryParameters();\n\t\tthis.expectedMarkers = [\n\t\t\tthis.markers[0],\n\t\t\tthis.markers[2],\n\t\t\tthis.markers[3]\n\t\t];\n\t\tqueryParameters.ids = this.expectedMarkers.map(marker => marker.id);\n\t\treturn queryParameters;\n\t}", "title": "" }, { "docid": "56f250dd4ace14447eadcc8bb0f9797b", "score": "0.5518459", "text": "processIdentifyId(layerIds) {\n return this.getIdentifyOption() + ':' + (Array.isArray(layerIds) ? layerIds.join(\",\") : layerIds);\n }", "title": "" }, { "docid": "2debea43aa219818c7651735bf0d0eb4", "score": "0.54633707", "text": "function getOptions() {\n\tvar options = [];\n\toptions.push(document.getElementById(\"includeSymbols\").checked);\n\toptions.push(document.getElementById(\"lengthRange\").value);\n\toptions.push(document.getElementById(\"mixedCase\").checked);\n\n\treturn options;\n}", "title": "" }, { "docid": "4a09edfb15a75154a42bc87cc9a5e469", "score": "0.54591745", "text": "function get_markers() {\n\t\t$('div.meal').each(function() {\n\t\t\t$(this).children('input').each(function() {\n\t\t\t\tif($(this).attr('title') == 'lat') lat = $(this).val();\n\t\t\t\tif($(this).attr('title') == 'lon') lon = $(this).val();\n\n\t\t\t\t// meal hidden, shown at markerclick\n\t\t\t\t//info = '#'+$(this).parent('div').attr('id');\n\t\t\t})\n\t\t\tmarkers.push({'latitude': lat,\n\t\t\t\t\t\t 'longitude': lon,\n\t\t\t\t\t\t 'draggable': false,\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t shadow: 'http://chart.apis.google.com/chart?chst=d_map_pin_shadow',\n\t\t\t\t\t\t\t shadowSize: '22, 20'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t 'dragend' : 'getAddress'\t\n\t\t\t\t\t\t});\n\t\t})\n\t\t\n\t\tif($('.display_meal').length > 0) {\n\t\t\tloc = $('.country').text()+\" \"+$('.zip').text()+\" \"+$('.city').text()+\" \"+$('.street').text()+\" \"+$('.street_number').text();\n\t\t\tloc = loc.split(\" \");\n\t\t}\n\n\t\treturn markers;\n\n\t}", "title": "" }, { "docid": "62fb2434ae22c8cda754a6d85265e7f9", "score": "0.54509306", "text": "function geojsonMarkerOptions(feature) {\n \n return {\n // radius of circle = magnitude, color = depth\n radius: feature.properties.mag * 2,\n fillColor:GetColor(feature.geometry.coordinates[2]),\n color: \"#000000\",\n weight: 1,\n opacity: 1,\n fillOpacity: 0.8\n };\n}", "title": "" }, { "docid": "050add536f325da41297d063d19f143c", "score": "0.5423186", "text": "getCordsFromMarkers(markerList) {\r\n let polycords = [];\r\n markerList.map(marker => {\r\n if (!marker.isAssets)\r\n polycords.push({ lat: marker.cord.lat, lng: marker.cord.lng });\r\n });\r\n return polycords;\r\n }", "title": "" }, { "docid": "56457dc6d9490e2887bcb1a7c0aa1dad", "score": "0.5411315", "text": "static get markerOffset() {\n return 3;\n }", "title": "" }, { "docid": "c98d75adf673bf57ac51af1c085c63aa", "score": "0.5395872", "text": "function getIconsId(map){\n\t\t\n\t\tvar iconIds = new Array();\n\t\tfor (var i = 0; i < map.markers.length; i++){\n\t\t var icon = [];\n\t\t\ticon.url = map.markers[i].icon.url;\n\t\t\ticon.visible = map.markers[i].getVisible();\n\t\t\tvar l = iconIds.length;\n\t\t\tvar solo = true;\n\t\t\tfor (var n = 0; n < l; n++){\n\t\t\t\tif (iconIds[n].url == icon.url){\n\t\t\t\t\tsolo = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (solo)\n\t\t\t\ticonIds.push(icon);\n\t\t}\n\t\treturn iconIds\n\t}", "title": "" }, { "docid": "d4378c3a8ed942f25eefeaa0c0f07ac3", "score": "0.5393716", "text": "static getOptions (props) {\n return _.omit(_.pick(props, _.keys(MapOptions.propTypes)), [\n 'showTileBoundaries',\n 'showCollisionBoxes',\n 'repaint',\n 'rtlTextPlugin'\n ])\n }", "title": "" }, { "docid": "e9d4a311d6bfa98e1fff99150e12242e", "score": "0.53755397", "text": "getInfoBuyOptions() {\n let options = {};\n for (let key in this.customOptions) {\n let option = this.customOptions[key];\n let value = '';\n if (\n option.option_type === OptionConstant.TYPE_CHECK_BOX\n || option.option_type === OptionConstant.TYPE_MULTIPLE\n ) {\n value = option.option_value.split(',');\n } else {\n value = option.option_value\n }\n options[option.option_id] = value;\n }\n return options;\n }", "title": "" }, { "docid": "dd01406d813c21c09763e9024c7ec2fa", "score": "0.5348242", "text": "function getOptions() {\r\n gvar.mnu_Value[0] = getValue('KEY_FIXED_MNU');\r\n gvar.mnu_Value[1] = getValue('KEY_TCKILL_MNU');\r\n gvar.paused = getValue('KEY_PAUSED');\t\r\n }", "title": "" }, { "docid": "9d809d0c728dd43db380e100375f197d", "score": "0.5341589", "text": "function getCoords(name) {\n var lngLat = markerList[name].getLngLat();\n return [lngLat.lng, lngLat.lat];\n}", "title": "" }, { "docid": "4aac355a208214d9c721e7d1f4a05bfe", "score": "0.53073245", "text": "function getOptions() {\n\t// Create the required options object\n\tvar options = new ExportOptionsPNG24();\n\t// See ExportOptionsPNG24 in the JavaScript Reference for available options\n\n\tvar rgb_color = new RGBColor();\n\trgb_color.red = 255;\n\trgb_color.green = 255;\n\trgb_color.blue = 255;\n\n\t// Set the options you want below:\n\toptions.antiAliasing = true;\n\toptions.artBoardClipping = true;\n\toptions.horizontalScale = 100.0;\n\toptions.verticalScale = 100.0;\n\toptions.matte = true;\n\toptions.matteColor = rgb_color;\n\toptions.saveAsHTML = false;\n\toptions.transparency = true;\n\n\treturn options;\n}", "title": "" }, { "docid": "9967d455c22f97db8ca26bb02a63c0f9", "score": "0.5300216", "text": "generateOptions(mKey,separator,isOnlyOptions) {\n let options = [];\n console.log(\"mapKey is :\" + mKey);\n let values = this.configMapData[mKey];\n console.log(\"map values are: \" + values);\n\n //isOnlyOptions is true, it generated optiond based on string \n if(isOnlyOptions){\n let vals = mKey.split(separator);\n console.log('vals if isOnlyOptions is true'+JSON.stringify(vals));\n vals.forEach(ele=>{\n options = [...options, { label: ele, value: ele }];\n })\n console.log('options are if isOnlyOptions is true: '+ JSON.stringify(options));\n \n /*it generates options if values found \n in configMap with MapKey */\n }else if (values) {\n values = values.split(separator);\n values.forEach(ele=>{\n options = [...options, { label: ele, value: ele }];\n })\n } else {\n options = [{ label: \"System Error\", value: \"System Error\" }];\n }\n return options;\n }", "title": "" }, { "docid": "80c35f9b0bfa9855c56e8d8c7418db77", "score": "0.52996653", "text": "function getOptions() {\n\t\tmodel.getSnapShot()\n\t\t.then(function(snapShot) {\n\t\t\tlet artists = [],\n\t\t\t albums = [];\n\t\t\tfor (let key in snapShot.val()) {\n\t\t\t\tartists.push(snapShot.val()[key].artist);\n\t\t\t\talbums.push(snapShot.val()[key].album);\n\t\t\t}\n\t\t\t// uses underscore to find unique values\n\t\t\t// and sort had to use lowercase to sort\n\t\t\t// alphabetically properly\n\t\t\tartists = _.uniq(artists).sort();\n\t\t\talbums = _.uniq(albums).sort();\n\t\t\t// displays the filter form\n\t\t\trender.filter(albums, artists);\n\t\t});\n\t}", "title": "" }, { "docid": "f802fda249286995bf077064e8253598", "score": "0.5282395", "text": "function createMarkerIcons() {\r\n\t\tvar markerIconDot = {\r\n\t\t\turl: '/assets/images/1x1-pixel.png',\r\n\t\t\tsize: new google.maps.Size(1, 1),\r\n\t\t\torigin: new google.maps.Point(0, 0),\r\n\t\t\tanchor: new google.maps.Point(4, 4),\r\n\t\t\tscaledSize: null\r\n\t\t};\r\n\r\n\t\tvar markerIconSmallRed = {\r\n\t\t\turl: '/assets/images/markers4.png',\r\n\t\t\tsize: new google.maps.Size(16, 16),\r\n\t\t\torigin: new google.maps.Point(8, 85),\r\n\t\t\tanchor: new google.maps.Point(8, 12),\r\n\t\t\tscaledSize: null\r\n\t\t};\r\n\r\n\t\tvar markerIconLargeRed = {\r\n\t\t\turl: '/assets/images/markers4.png',\r\n\t\t\tsize: new google.maps.Size(20, 28),\r\n\t\t\torigin: new google.maps.Point(0, 0),\r\n\t\t\tanchor: new google.maps.Point(10, 24),\r\n\t\t\tscaledSize: new google.maps.Size(100, 66)\r\n\t\t};\r\n\r\n\t\tvar markerIconInvisRed = {\r\n\t\t\turl: '/assets/images/picture1.png',\r\n\t\t\tsize: new google.maps.Size(220, 230),\r\n\t\t\torigin: new google.maps.Point(0, 0),\r\n\t\t\tanchor: new google.maps.Point(3, 158)\r\n\t\t};\r\n\r\n\t\tvar markerIconLargeRedMain = {\r\n\t\t\turl: '/assets/images/markers4.png',\r\n\t\t\tsize: new google.maps.Size(20, 28),\r\n\t\t\torigin: new google.maps.Point(0, 0),\r\n\t\t\tanchor: new google.maps.Point(10, 24),\r\n\t\t\tscaledSize: new google.maps.Size(100, 66)\r\n\t\t};\r\n\r\n\t\tvar markerIconSmallBlue = {\r\n\t\t\turl: '/assets/images/markers4.png',\r\n\t\t\tsize: new google.maps.Size(16, 16),\r\n\t\t\torigin: new google.maps.Point(47, 85),\r\n\t\t\tanchor: new google.maps.Point(8, 12),\r\n\t\t\tscaledSize: null\r\n\t\t};\r\n\r\n\t\tvar markerIconLargeBlue = {\r\n\t\t\turl: '/assets/images/markers4.png',\r\n\t\t\tsize: new google.maps.Size(20, 28),\r\n\t\t\torigin: new google.maps.Point(27, 0),\r\n\t\t\tanchor: new google.maps.Point(9, 24),\r\n\t\t\tscaledSize: new google.maps.Size(100, 66)\r\n\t\t};\r\n\r\n\t\tvar markerIconSmallGreen = {\r\n\r\n\t\t};\r\n\r\n\t\tvar markerIconLargeGreen = {\r\n\t\t\turl: '/assets/images/markers4.png',\r\n\t\t\tsize: new google.maps.Size(20, 28),\r\n\t\t\torigin: new google.maps.Point(54, 0),\r\n\t\t\tanchor: new google.maps.Point(8, 24),\r\n\t\t\tscaledSize: new google.maps.Size(100, 66)\r\n\t\t};\r\n\r\n\t\tvar markerIconSmallOrange = {\r\n\t\t\turl: '/assets/images/markers4.png',\r\n\t\t\tsize: new google.maps.Size(16, 16),\r\n\t\t\torigin: new google.maps.Point(126, 85),\r\n\t\t\tanchor: new google.maps.Point(8, 12),\r\n\t\t\tscaledSize: null\r\n\t\t};\r\n\r\n\t\tvar markerIconLargeOrange = {\r\n\t\t\turl: '/assets/images/markers4.png',\r\n\t\t\tsize: new google.maps.Size(20, 28),\r\n\t\t\torigin: new google.maps.Point(81, 0),\r\n\t\t\tanchor: new google.maps.Point(8, 24),\r\n\t\t\tscaledSize: new google.maps.Size(100, 66)\r\n\t\t};\r\n\r\n\t\treturn {\r\n\t\t\tdot: markerIconDot,\r\n\t\t\tsmallRed: markerIconSmallRed,\r\n\t\t\tinvisRed: markerIconInvisRed,\r\n\t\t\tsmallBlue: markerIconSmallBlue,\r\n\t\t\tsmallGreen: markerIconSmallGreen,\r\n\t\t\tsmallOrange: markerIconSmallOrange,\r\n\t\t\tlargeRed: markerIconLargeRed,\r\n\t\t\tlargeRedMain: markerIconLargeRedMain,\r\n\t\t\tlargeBlue: markerIconLargeBlue,\r\n\t\t\tlargeGreen: markerIconLargeGreen,\r\n\t\t\tlargeOrange: markerIconLargeOrange,\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "1d45153df6403bf441801902e33fe97b", "score": "0.5270011", "text": "function mapOptions() {\n return {\n element: element[0],\n scope: 'usa',\n height: scope.height,\n width: scope.width,\n fills: { defaultFill: '#b9b9b9' },\n data: {},\n done: function (datamap) {\n function redraw() {\n datamap.svg.selectAll('g').attr('transform', 'translate(' + d3.event.translate + ')scale(' + d3.event.scale + ')');\n }\n if (angular.isDefined(attrs.onClick)) {\n datamap.svg.selectAll('.datamaps-subunit').on('click', function (geography) {\n scope.onClick()(geography);\n });\n }\n if (angular.isDefined(attrs.zoomable)) {\n datamap.svg.call(d3.behavior.zoom().on('zoom', redraw));\n }\n }\n };\n }", "title": "" }, { "docid": "b835f20c5dcf45c22c80ff5385accffb", "score": "0.52661055", "text": "function getOptions() {\r\n\treturn defaultOptions;\r\n}", "title": "" }, { "docid": "55479723057d99daf9e63c04388283e3", "score": "0.52644897", "text": "getMarkerEl() {\n return this._$marker\n }", "title": "" }, { "docid": "a7519fa6bad56b5875ff906cc01b7da8", "score": "0.52454984", "text": "getInfoBuyOptions() {\n let options = {};\n if (!this.customOptions) {\n return options;\n }\n for (let key in this.customOptions) {\n let option = this.customOptions[key];\n let value = '';\n if (\n option.option_type === OptionConstant.TYPE_CHECK_BOX\n || option.option_type === OptionConstant.TYPE_MULTIPLE\n ) {\n value = option.option_value.split(',');\n } else {\n value = option.option_value\n }\n options[option.option_id] = value;\n }\n return options;\n }", "title": "" }, { "docid": "ce6efce17db00fd50e3d89d790c82c0b", "score": "0.52012646", "text": "_toTextMarkerOptions(style) {\n let r = parseInt(style.color.slice(1, 3), 16);\n let g = parseInt(style.color.slice(3, 5), 16);\n let b = parseInt(style.color.slice(5, 7), 16);\n let css = `background-color: rgba( ${r}, ${g}, ${b}, 0.15)`;\n return {\n className: style.className,\n title: style.displayName,\n css\n };\n }", "title": "" }, { "docid": "d0207acef59c2ece7310cc02d6d47729", "score": "0.5176548", "text": "function setMarkerListeners(id, marker) {\n let currentPosition;\n let newPosition;\n\n // Click listener\n google.maps.event.addListener(marker, 'rightclick', (e) => { // sets listener for context menu on marker\n resetMarkerColor(CurrentSelectedMarker);\n CurrentSelectedMarker = `${marker.id}`;\n setColorBlue(CurrentSelectedMarker);\n\n if (menuDisplayed === true) {\n hideAllMenus();\n }\n // eslint-disable-next-line no-restricted-syntax\n for (prop in e) {\n if (e[prop] instanceof MouseEvent) {\n mouseEvt = e[prop];\n const left = mouseEvt.clientX;\n const top = mouseEvt.clientY;\n\n markerMenu.style.left = `${left}px`;\n markerMenu.style.top = `${top}px`;\n markerMenu.style.display = 'block';\n markerMenuOptions.style.display = 'block';\n setMarkerMenuOptions(marker.id);\n\n // Function to show available operations\n\n mouseEvt.preventDefault();\n\n menuDisplayed = true;\n break;\n }\n }\n });\n\n // Mouse over listener\n google.maps.event.addListener(marker, 'mouseover', () => {\n // changeMarkerColor(id);\n });\n\n // Mouse out listener\n google.maps.event.addListener(marker, 'mouseout', () => {\n // resetMarkerColor(id);\n });\n\n // Drag start listener\n google.maps.event.addListener(marker, 'dragstart', () => {\n currentPosition = marker.getPosition();\n });\n\n // Drag end listener\n google.maps.event.addListener(marker, 'dragend', () => {\n newPosition = marker.getPosition();\n moveMarker(id, newPosition.lat(), newPosition.lng(), currentPosition);\n });\n}", "title": "" }, { "docid": "66928e498e366d63725ba8b77f98a114", "score": "0.5173962", "text": "function getOptions() {\n\treturn defaultOptions;\n}", "title": "" }, { "docid": "66928e498e366d63725ba8b77f98a114", "score": "0.5173962", "text": "function getOptions() {\n\treturn defaultOptions;\n}", "title": "" }, { "docid": "677de2588e827d10f3fbd0748716c16c", "score": "0.5168283", "text": "function getFeatures(options) {\n let selectedId = 0\n options.forEach(element => {\n element.selected === true ? selectedId = Number(element.value) : ''\n })\n return selectedId\n}", "title": "" }, { "docid": "d72d4e50b9ba96719490fabf60d27ddb", "score": "0.5168208", "text": "function getOptions(info) {\n const options = { ...info };\n\n // latitude -> shape geometry\n if (!info.position) {\n options.primaryShape = 'knot'; // no position data\n } else if (info.position.latitude > 30) {\n options.primaryShape = 'dodecahedron'; // north of Mexico\n } else if (info.position.latitude > -30) {\n options.primaryShape = 'box'; // betw. Brazil and Mexico\n } else {\n options.primaryShape = 'pyramid'; // South America, parts of Oceania, and Antarctica\n }\n\n // color -> hue saturation lightness w/ hue being ms % 255\n options.primaryColor = `hsl(${info.datetime.getMilliseconds() %\n 255}, 50%, 50%)`;\n\n // by viewport width -> translation type (vert. on mobile, horiz. on desktop)\n options.primaryTranslation =\n info.width < info.height\n ? TRANSLATION_TYPES.vertical\n : TRANSLATION_TYPES.horizontal;\n\n // current hour -> rotation type\n const hour = info.datetime.getHours();\n if (hour < 10) {\n options.primaryRotation = ROTATION_TYPES.none; // no rotation early morning, too much fuss\n } else if (hour < 17) {\n options.primaryRotation = ROTATION_TYPES.constant; // afternoon\n } else {\n options.primaryRotation = ROTATION_TYPES.oscillate; // evening\n }\n\n // longitude -> rotation axis\n if (!info.position) {\n options.primaryAxis = 'x'; // no position data\n } else if (info.position.longitude < 0) {\n options.primaryAxis = 'y'; // west of prime meridian\n } else {\n options.primaryAxis = 'z'; // east of prime meridian\n }\n\n // browser name -> translation speed\n options.browser = info.useragent[0].ua.family;\n if (options.browser.includes('Chrome')) {\n options.primaryTranslationSpeed = 0.05;\n } else if (options.browser.includes('Safari')) {\n options.primaryTranslationSpeed = 0.07;\n } else if (options.browser.includes('IE')) {\n options.primaryTranslationSpeed = 0.01;\n } else {\n options.primaryTranslationSpeed = 0.03;\n }\n\n // os name -> rotation speed\n options.os = info.useragent[0].os.family;\n options.primaryRotationSpeed = options.os.length / 150; // Fedora => 0.04, Mac OS X => 0.053\n\n return options;\n}", "title": "" }, { "docid": "8cea57a4df1b7cec67ddb240623fe334", "score": "0.51418626", "text": "get markerSize() {\r\n return this.i.bd;\r\n }", "title": "" }, { "docid": "4ac2352ad64ed10226958d672c35d0f8", "score": "0.51403767", "text": "static get aotOptions() {}", "title": "" }, { "docid": "1d5b5440badbbbdd9141555ba0b98d75", "score": "0.5137056", "text": "function getOptions() {\n\t\treturn defaultOptions;\n\t}", "title": "" }, { "docid": "283cf0a5a871ce8bbee4559da0747c57", "score": "0.51204586", "text": "function getOptions(){\n let html = ``\n for (let layer in layers){\n html += `<option value=\"${layer}\">${layers[layer].title}</option>`; \n }\n return html;\n }", "title": "" }, { "docid": "dfe92fcbfea5f435b16cd865579ed80f", "score": "0.510225", "text": "function getMarkers() {\n let markers = {};\n return self.db.iterate(function(value,key,index) {\n markers[key] = value;\n }).then(() => markers);\n }", "title": "" }, { "docid": "a31c9b2d3cdabf4207d1e41e86738b90", "score": "0.50839823", "text": "function getOptions(tempTable, data) {\n // Set up the options\n var options = {};\n // Scatter chart\n options.cht = 's';\n // Image size\n options.chs = '500x200';\n // X-axis (0) and Y-axis (1) labels\n options.chxl = '0:|' + getXAxisLabels(tempTable) + '|1:|' + getYAxisLabels(tempTable);\n // Adjust the X & Y axis with -1 so that dots line up correctly.\n // The last two numbers indicate the scaling range.\n // Supply the lowest and highest value in the dataset to get automatic dot scaling.\n var valueColumn = 2;\n var maxValue = getMaxColumnValue(data, 2)\n\n options.chds = '-1,24,-1,7,0,' + maxValue;\n\n // Shape marker: o = circle, 333333 = black, 1 = data series, -1 = allpoints, 20 = max size in pts.\n var maxSpotSize = 20;\n var defaultMarker = 'o,459E00,1,-1,' + maxSpotSize;\n\n options.chm = defaultMarker + getHighlightMarkers(data, maxValue, maxSpotSize);\n options.enableEvents = true;\n\n return options;\n}", "title": "" }, { "docid": "bc1dfdc2368d6d4ec51ca17df196d7ff", "score": "0.5082631", "text": "get markerSize() {\n return this.i.bd;\n }", "title": "" }, { "docid": "44546d85cb8b123fbf9d2ed3eea8beed", "score": "0.5081632", "text": "getSelectedValues() {\n return this.selectable.getSelection().map(item => item.id);\n }", "title": "" }, { "docid": "bb7bbfec5bee92d0cf593e7b1794ae3a", "score": "0.5075492", "text": "show_markers() {\n\t\tMAP.removeAnnotations(MAP.annotations)\n\t\tlet lls = []\n\t\tfor (let ll of this.geolocations) {\n\t\t\tif (ll != null) {\n\t\t\t\tlet coordinate = new mapkit.Coordinate(ll.lat, ll.lng)\n\t\t\t\tlls.push(new mapkit.MarkerAnnotation(coordinate, { color: \"#f4a56d\", glyphText: \"\" + ll.count }))\n\t\t\t}\n\t\t}\n\t\tMAP.showItems(lls);\n\t}", "title": "" }, { "docid": "5f8e02a818feb900bd6f499fdbb48284", "score": "0.5074428", "text": "function getOpts(status) {\n status = JSON.parse(atob(status));\n var ret = {\n zoom: status.zoo,\n center: status.cen\n };\n delete status.zoo;\n delete status.cen;\n ret.status = status;\n return ret;\n}", "title": "" }, { "docid": "9e94ae7a1b06807297146ca31cf6ce46", "score": "0.5072711", "text": "get options() {\n return this._items;\n }", "title": "" }, { "docid": "5fae93c8817e5b450b87e2052c7c42fd", "score": "0.50631577", "text": "function getOptions() {\n return defaultOptions;\n }", "title": "" }, { "docid": "38dd891b1220fe57231f8d5058207e90", "score": "0.5058566", "text": "getMarker() {\n return this.marker;\n }", "title": "" }, { "docid": "bb6d4150e6b00229f494fba0220a61e8", "score": "0.5047932", "text": "function getMarkers(theMarkers) {\n markers = theMarkers;\n}", "title": "" }, { "docid": "59a3e14fde57d59d29cb494507943eb7", "score": "0.5039617", "text": "getOptions() {\n return options;\n }", "title": "" }, { "docid": "0459286d460f2c4904d94435eadc6974", "score": "0.5038701", "text": "getMarker(id){\n let filteredMarkers = Data.markers.filter((marker) => {\n return marker.id === Number(id);\n });\n\n return (filteredMarkers === undefined || filteredMarkers.length === 0 ? undefined : filteredMarkers[0]);\n }", "title": "" }, { "docid": "19e75bcb47ebf344aba0ff5bc096d9f8", "score": "0.503602", "text": "static get paramIds () { return [] }", "title": "" }, { "docid": "1d6044607d2dadc0a36885c5e0fef8df", "score": "0.5016073", "text": "function ic_soa_svg_getMarkers() {\n\tvar ret = \"\";\n\tret += '<marker id=\"triangle\" ';\n\tret += 'viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" ';\n\tret += 'markerUnits=\"strokeWidth\" ';\n\tret += 'markerWidth=\"4\" markerHeight=\"4\" ';\n\tret += 'orient=\"auto\"> ';\n\tret += '<path d=\"M 0 0 L 10 5 L 0 10 z\" /> ';\n\tret += '</marker> ';\n\tret += '<marker id=\"triangleR\" ';\n\tret += 'viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" ';\n\tret += 'markerUnits=\"strokeWidth\" ';\n\tret += 'markerWidth=\"4\" markerHeight=\"4\" ';\n\tret += 'orient=\"auto-start-reverse\"> ';\n\tret += '<path d=\"M 0 0 L 10 5 L 0 10 z\" /> ';\n\tret += '</marker> ';\n\treturn ret;\n}", "title": "" }, { "docid": "378a928d8cd11be051c7483123d9407e", "score": "0.50145614", "text": "function getValues(e) {\n\tif (curr == 0) { // for source\n\t\tsourceLat = Number((e.latlng.lat).toFixed(4));\n\t\tsourceLong = Number((e.latlng.lng).toFixed(4));\n\n\t\tL.marker([sourceLat, sourceLong], { icon: sourceIcon }).addTo(map); // \n\t}\n\telse if (curr == 1) { // for destination\n\t\tdestinationLat = Number((e.latlng.lat).toFixed(4));\n\t\tdestinationLong = Number((e.latlng.lng).toFixed(4));\n\n\t\tL.marker([destinationLat, destinationLong], { icon: destinationIcon }).addTo(map); //\n\t}\n\n}", "title": "" }, { "docid": "d63be44c930408c61573fdf1dec4f8e0", "score": "0.5005708", "text": "getOptions() { return this._options; }", "title": "" }, { "docid": "9f0e099f84d12a65309c767763c5d7eb", "score": "0.49981055", "text": "async getOptions(filter = {}) {\n return this.locatorForAll(MatOptionHarness.with(filter))();\n }", "title": "" }, { "docid": "bb3a12b25e5bf6183f7115182b8b16ed", "score": "0.4997363", "text": "function _getIds() {\n return ids;\n }", "title": "" }, { "docid": "1c014e91271249f4825204dd07a23b26", "score": "0.49949992", "text": "function getOptions() {\n if (uploadedFiles.length === 0) {\n return [];\n } else {\n var options = [];\n var i;\n for (i = 0; i < uploadedFiles.length; i++) {\n options.push({value: i, label: uploadedFiles[i].name});\n }\n return options;\n }\n }", "title": "" }, { "docid": "a9c4ec3950a104d9a4f6f10ce56acf51", "score": "0.49911055", "text": "function _marker(opts) {\n // TODO: select proper ICON\n var img = new google.maps.MarkerImage(sandbox.config.staticUrl + 'img-1.3/markers/iconset-1.png', new google.maps.Size(17, 22), new google.maps.Point(684, 0), new google.maps.Point(3, 20));\n var defaults = {\n map: map,\n draggable: true,\n icon: img,\n title: 'Kliknij, aby usunąć'\n };\n\n $.extend(defaults, opts);\n var marker = new google.maps.Marker(defaults);\n marker.id = markerId++;\n\n google.maps.event.addListener(marker, 'dragend', function(event) {\n updateDragened(marker);\n modified = true;\n });\n\n google.maps.event.addListener(marker, 'click', function(event) {\n removeMarker(marker);\n modified = true;\n });\n\n google.maps.event.addListener(marker, 'mouseover', function(event) {\n showIndirectMarkers(marker);\n });\n\n return marker;\n }", "title": "" }, { "docid": "eeaa042d34525f7be796403311189c53", "score": "0.49886477", "text": "async getProductOptions(id) {\n return await request(`${config.serverAPIurl}/${this.pathName}/${id}/options`);\n }", "title": "" }, { "docid": "f008698d37ed2fca1c34e56e266d91fa", "score": "0.49885482", "text": "function showMarkers(e) {\r\n if (e === null || typeof e === \"undefined\") {\r\n $(\"#legend table tr input:checkbox\").each(function() {\r\n var id = $(this).attr(\"id\");\r\n var checked = $(this).prop(\"checked\");\r\n switch (id) {\r\n case \"tw\":\r\n twLayer.setMap(checked ? map : null);\r\n break;\r\n case \"CLECShowHideMap\":\r\n for (var i = clecMarkers.length - 1; i >= 0; i--)\r\n clecMarkers[i].setMap(checked ? map : null);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n } else {\r\n var id = $(e).attr(\"id\");\r\n var removal = 0;\r\n switch (id) {\r\n case \"NNIShowHideMap\":\r\n removal += 4; // equals 8 when cascaded\r\n case \"ILECShowHideMap\":\r\n removal += 2; // equals 4 when cascaded\r\n case \"LOWShowHideMap\":\r\n removal += 1; // equals 2 when cascaded\r\n case \"HIGHShowHideMap\":\r\n removal += 1;\r\n for (var i = assetLocations.length - 1; i >= 0; i--) {\r\n assetLocations[i].marker.setMap(null);\r\n assetLocations[i].attributes = (assetLocations[i].attributes ^ removal) & assetLocations[i].modAttributes; // XOR the attribute EX. 1011 XOR 1000 = 0011\r\n assetLocations[i].marker.icon = locationIcons[assetLocations[i].attributes - 1];\r\n assetLocations[i].marker.setMap(assetLocations[i].attributes <= 0 ? null : map);\r\n }\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "e1e6f628f7df49241d706d2a8d49cc09", "score": "0.4988451", "text": "createMarkedOptions() {\n var _a, _b, _c, _d;\n const markedOptions = ((_a = this.application.options.getValue(\"markedOptions\")) !== null && _a !== void 0 ? _a : {});\n if (typeof markedOptions === \"object\" &&\n !Array.isArray(markedOptions)) {\n // Set some default values if they are not specified via the TypeDoc option\n (_b = markedOptions.highlight) !== null && _b !== void 0 ? _b : (markedOptions.highlight = (text, lang) => this.getHighlighted(text, lang));\n (_c = markedOptions.renderer) !== null && _c !== void 0 ? _c : (markedOptions.renderer = customMarkedRenderer);\n (_d = markedOptions.mangle) !== null && _d !== void 0 ? _d : (markedOptions.mangle = false); // See https://github.com/TypeStrong/typedoc/issues/1395\n return markedOptions;\n }\n throw new Error(\"The value provided via the 'markedOptions' option must be a non-array object.\");\n }", "title": "" }, { "docid": "4ec6303e3cfbdff88bf01a201a9871e5", "score": "0.49849403", "text": "function customiseMarkers () {\n $('.northMark').hide();\n $('.southMark').hide();\n }", "title": "" }, { "docid": "e584041d1f74c8498546b0b90b887e0f", "score": "0.49804065", "text": "function setMarkersTUR() {\n markers =[\n ['Istambul', 41.0055005,28.7319924],\n ['Ankara', 39.9035557,32.62268],\n ];\n \n }", "title": "" }, { "docid": "ac814d3f75f7fa74cc1ae05826ab35b3", "score": "0.49791098", "text": "function setMarker(data) {\n\t\tfor (var i = 0; i < data.coords.length; i++) {\n\t\t\tvar marker = L.marker([data.coords[i].lat, data.coords[i].lng], { icon: yellowIcon }).addTo(map);\n\t\t\tmarker.bindPopup('<p>' + data.id + ' is here!</p>');\n\t\t\tmarkers[data.id] = marker;\n\t\t}\n\t}", "title": "" }, { "docid": "1436130a5d0456777248209d6ecc5bc7", "score": "0.4977723", "text": "getIds() {\n\t\tthrow new Error(\"Not yet implemented\");\n\t}", "title": "" }, { "docid": "54c489291ed6b1ff3bde4098958e590c", "score": "0.4968824", "text": "get gatheredOptions() {\n let options = {};\n\n for (let o of this.previewOptions) {\n let value = this.args[o] || this[o];\n\n if (value !== undefined) {\n options[o] = value;\n }\n }\n\n return options;\n }", "title": "" }, { "docid": "fb2bd0d964a6dcb40321a31cc20483c2", "score": "0.49630696", "text": "function placeMarkers() {\n\t var image = {\n\t\turl: \"site_includes/marker2.png\", \n\t\tsize: new google.maps.Size(25, 45),\n\t\torigin: new google.maps.Point(0,0),\n\t\tanchor: new google.maps.Point(13,45)\n\t }; \n\t for (x = 0; x < Markets.length; x++) {\n\t $('.selector2').append($('<option />').val(Markets[x].table_name).text(Markets[x].name));\n\t var marker = new google.maps.Marker({\n\t position: {lat: Number(Markets[x].lat), lng: Number(Markets[x].lng)},\n\t animation: google.maps.Animation.DROP,\n\t map: map,\n\t icon: image,\n\t title: Markets[x].name\n\t });\n\t marker.value = Markets[x].table_name;\n\t Markets[x].marker = marker;\n\t markers.push(marker);\n\t\tvar infoWindow = new google.maps.InfoWindow({\n\t\t\tcontent: ''\n\t\t});\n\t\tMarkets[x].infoWindow = infoWindow;\n\t }\n\t getWalmarts();\n\t}", "title": "" }, { "docid": "b0209e70928457b6ae6318e1fab599f5", "score": "0.4961378", "text": "get options() {\n return [\n { label: 'Program 1', value: 'program' },\n { label: 'Program 2', value: 'program2' },\n { label: 'Program 3', value: 'program3' },\n ];\n }", "title": "" }, { "docid": "1972e627c94e12b8e5a371f0dc8f66d4", "score": "0.49396953", "text": "function showMarkers() {\n setAllMap(mapAux);\n}", "title": "" }, { "docid": "d59cc98c50140cfcdeddc64f9e2a825d", "score": "0.4939298", "text": "async getOptions() {\n const data = await (\n await axios.get(\n \"http://localhost:9090/CovidTracker.com/patients/allpatients\"\n )\n ).data;\n this.setState({ ...this.state, patients: data });\n const options = data.map((d, index) => ({\n value: d.patientId,\n label: d.patientId + \":\" + d.patientFirstName + \" \" + d.patientLastName,\n id: index,\n }));\n\n this.setState({ selectOptions: options });\n }", "title": "" }, { "docid": "aac57092b17d0cf08244701bf0de4db8", "score": "0.49390584", "text": "toString() {\n return this.marker;\n }", "title": "" }, { "docid": "89cbc19aecd6c23855aabbb842a8747f", "score": "0.4935161", "text": "function createMarker(map, options) {\n var defaults = {\n clearMarkers: false,\n openMarker: false,\n latlng: null,\n icon: null,\n data: $.extend({}, APP_PARAMS.defaultMarkerData)\n };\n options = $.extend(defaults, options);\n if (options.clearMarkers == true) {\n clearMapMarkers(map);\n }\n\n var iconObj = {};\n if (options.icon) {\n iconObj = {icon: options.icon};\n }\n // var marker = L.marker([options.latlng.lat, options.latlng.lng], {icon: greenIcon}).addTo(map);\n var marker = L.marker([options.latlng.lat, options.latlng.lng], iconObj).addTo(map);\n marker.bindPopup(setMarkerContent(options.data, MARKER_COORDINATES_TEMPLATE));\n if (options.openMarker) {\n marker.openPopup();\n }\n}", "title": "" }, { "docid": "4ca018cc6285681f445238bf1abec049", "score": "0.49351373", "text": "_getMarkers() {\n $.ajax(this.markersUrl).done(function(response) {\n if (this.options.markersKey) {\n response = GetObjectValue(response, this.options.markersKey);\n }\n\n this._addMarkers(response);\n }.bind(this));\n }", "title": "" }, { "docid": "7c58fc70e7f56efe727a6ac25f67f28c", "score": "0.49139762", "text": "renderMarker(map) {\n // set label number to match ID in database\n let number = function() {return this.id}\n\n // set marker color by category\n let iconColor = function() {\n if (this.category_id === 1) {\n return 'http://maps.google.com/mapfiles/ms/icons/red.png'\n } else if (this.category_id === 2) {\n return 'http://maps.google.com/mapfiles/ms/icons/green.png'\n } else if (this.category_id === 3) {\n return 'http://maps.google.com/mapfiles/ms/icons/yellow.png'\n }\n }\n \n // using information fetched from database to create google maps marker object\n let obsMarker = new google.maps.Marker({\n position: {lat: this.latitude, lng: this.longitude},\n map: map,\n label: {\n text: number.call(this),\n fontSize: \"8px\"\n },\n icon: iconColor.call(this)\n })\n\n this.attachMarkerInfoWindow(obsMarker)\n }", "title": "" }, { "docid": "672aeb589f03ecc3355b46355605da7c", "score": "0.49060047", "text": "function assignContextMenuCoordinates(map) {\n // These are the centre/zoom coordinates we received from the main\n // map controller\n const defaultCoordinates = {\n latitude: map.center.latitude,\n longitude: map.center.longitude,\n };\n // Look for and clear coordinates stored by the context menu service\n const contextMenuCoordinates = editSiteService.getContextMenuCoordinates();\n // If they exist, then return them\n if (contextMenuCoordinates !== undefined) {\n return contextMenuCoordinates;\n }\n\n // Otherwise, just return the defaults\n return defaultCoordinates;\n }", "title": "" }, { "docid": "2a44986d5fb398592516112e237c15b1", "score": "0.4904902", "text": "function genMarkers(){\n\t\tvar ret = []\n\t\tfor(var i = 0; i < props.markerData.length; i++){\n\t\t\tvar data_t = JSON.parse(props.markerData[i])\n\t\t\tif(!data_t.latitude || ! data_t.longitude){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//console.log(data_t.latitude + \" \" + data_t.longitude)\n\t\t\tret.push(\n\t\t\t\t<Marker\n\t\t\t\t key={\"marker\" + i + props.markerData[i].latitude}\n\t\t\t position={{\n\t\t\t lat: parseFloat(data_t.latitude),\n\t\t\t lng: parseFloat(data_t.longitude)\n\t\t\t }}\n\t\t\t />)\n\t }\n\t return ret;\n\t}", "title": "" }, { "docid": "fd1d1e7a9832bbfc0ae5ab64dc2e39eb", "score": "0.4904226", "text": "function showMarkers() {\n setAllMap(map);\n }", "title": "" }, { "docid": "7df8d00361744ed5020f7f9d725de3f1", "score": "0.4901557", "text": "function showMarkers() {\n setAllMap(myMap);\n }", "title": "" }, { "docid": "577ad19c8fead333da85e6f44b866218", "score": "0.48993745", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "f2f37342048dd3088b54e6fd2ad5d726", "score": "0.4893527", "text": "function showMarkers() {\r\n setAllMap(map);\r\n}", "title": "" }, { "docid": "0483d0bd2a215d6b19f0e208dd856f06", "score": "0.48917606", "text": "function showfood_outletsMarkers() {\n setfood_outletsMap(map);\n}", "title": "" }, { "docid": "2bfb3deaba366fa74740d64f6c9bf1c2", "score": "0.4888873", "text": "get options() {\n\t\treturn this._options;\n\t}", "title": "" }, { "docid": "6bca3e8ba65acbc0e400da21a42882bc", "score": "0.48820177", "text": "options() {\n return algorithm_1.iter(this._options);\n }", "title": "" }, { "docid": "6e8485c9f4b139ec7a3e118c296b5706", "score": "0.48815712", "text": "function updateMarkers() {\n var pointIds = idGrouping.all();\n for (var i = 0; i < pointIds.length; i++) {\n var pointId = pointIds[i];\n markers[pointId.key].setVisible(pointId.value > 0);\n }\n}", "title": "" }, { "docid": "100a53c78dc1fe2409853e3d8f99313f", "score": "0.48769557", "text": "\n (\n id_s\n )\n {\n return (\n this\n .map_o\n [id_s]\n .legend_a\n )\n }", "title": "" }, { "docid": "476080433584edd2f8abf4317df0f6a4", "score": "0.48736203", "text": "function export_options() {\r\n return { \r\n crs:\"EPSG:26910\",\r\n crs_transform:[30,0,596898,0,-30,4276385],\r\n dimensions:'1995x3793',\r\n driveFolder:'EarthEngine'\r\n };\r\n }", "title": "" }, { "docid": "e807b634bb5b6166fbe73dd5ae67d83b", "score": "0.4872691", "text": "function reviewMap() {\n removePath();\n var select = document.getElementById(\"listaPuntosRuta\");\n \n for (var i = 0; i < select.options.length; i++) {\n var infoPunto = select.options[i].value;\n var nom = infoPunto.split(\",\")[2];\n var lat = infoPunto.split(\",\")[3];\n var lon = infoPunto.split(\",\")[4];\n \n addNewMarkExternMult(nom, lat, lon);\n } \n disableDrag();\n}", "title": "" }, { "docid": "9fda266d3c6144e18ec0fd0887d70c98", "score": "0.4870446", "text": "function prepareSelectedDatapoints() {\n var measurementIdentifiers = [];\n selectedDatapoints.each(function (d) {\n measurementIdentifiers.push(d.m);\n });\n return measurementIdentifiers;\n }", "title": "" }, { "docid": "a120175cb3760a09687d167e2e55fb89", "score": "0.48699954", "text": "function genOptions() {\n if ((layerControl._map)) {\n layerControl.remove(map);\n }\n document.getElementById(\"compare\").checked = false;\n map.removeControl(legendG)\n\n map.removeLayer(dataLayer);\n map.removeLayer(afghanistanS6)\n map.removeLayer(afghanistanT7)\n map.removeLayer(westafricaS2)\n map.removeLayer(westafricaT3)\n map.removeLayer(southafricaS4)\n map.removeLayer(southafricaT5)\n map.removeLayer(eastafricaS0)\n map.removeLayer(eastafricaT1)\n\n var msg = document.getElementById('message');\n msg.style.display = 'none';\n var opc = document.getElementById('selOpacity');\n opc.style.display = 'none';\n var cmp = document.getElementById('comp_checkbox');\n cmp.style.display = 'none';\n var exp = document.getElementById('exportdiv');\n exp.style.display = 'none';\n\n // Layer control /////////////////////////////\n layerControl.removeLayer(afghanistanS6)\n layerControl.removeLayer(afghanistanT7)\n layerControl.removeLayer(westafricaS2)\n layerControl.removeLayer(westafricaT3)\n layerControl.removeLayer(southafricaS4)\n layerControl.removeLayer(southafricaT5)\n layerControl.removeLayer(eastafricaS0)\n layerControl.removeLayer(eastafricaT1)\n\n // Selections from user\n var region = document.getElementById(\"region\");\n var model = document.getElementById(\"model\");\n var forcing = document.getElementById(\"forcing\");\n var dataset = document.getElementById(\"dataset\");\n var temporal = document.getElementById(\"temporal\");\n\n // set map view\n if (region.value == 'centralasia') {\n map.setView(new L.LatLng(40.6, 66.7), 4);\n\n } else if (region.value == 'eastafrica') {\n map.setView(new L.LatLng(5.70, 32.61), 4);\n\n } else if (region.value == 'southernafrica') {\n map.setView(new L.LatLng(-15.0, 25.61), 4);\n\n } else if (region.value == 'westafrica') {\n map.setView(new L.LatLng(11.2, 7.0), 5);\n }\n\n // Generate model options\n for (i = 1; i < model.options.length; i++) {\n model.options[i] = null;\n }\n for (i = 1; i < forcing.options.length; i++) {\n forcing.options[i] = null;\n }\n for (i = 1; i < dataset.options.length; i++) {\n dataset.options[i] = null;\n }\n if (region.value == 'centralasia') {\n\n model.options[1] = new Option(\"NOAH36\", \"noah\");\n //model.options[2] = new Option(\"CLM2\", \"clm\");\n\n forcing.options[1] = new Option(\"GDAS\", \"gdas\");\n\n for (i = 1; i < dataset.options.length; i++) {\n dataset.options[i] = null;\n }\n dataset.options[1] = new Option(\"SWE\", \"swe\");\n dataset.options[2] = new Option(\"Temperature\", \"temperature\")\n //dataset.options[3] = new Option(\"Precipitation\", \"precipitation\");\n\n //default options\n model.value = \"noah\";\n forcing.value = \"gdas\";\n dataset.value = \"swe\";\n } else if (region.value == 'eastafrica' || region.value == 'southernafrica' || region.value == 'westafrica') {\n\n model.options[1] = new Option(\"NOAH33\", \"noah\");\n model.options[2] = new Option(\"VIC412\", \"vic\");\n\n forcing.options[1] = new Option(\"RFE+GDAS\", \"rg\");\n forcing.options[2] = new Option(\"CHIRPS+MERRA2\", \"cm\");\n\n dataset.options[1] = new Option(\"Soil Moisture\", \"soilmoisture\");\n dataset.options[2] = new Option(\"Temperature\", \"temperature\")\n dataset.options[3] = new Option(\"Temperature Anomaly\", \"temperature_anomaly\")\n dataset.options[4] = new Option(\"Precipitation\", \"precipitation\");\n dataset.options[5] = new Option(\"Evapotranspiration\", \"evapotranspiration\");\n dataset.options[6] = new Option(\"Runoff (Timeseries only)\", \"runoff\");\n\n //default options\n model.value = \"noah\";\n forcing.value = \"rg\";\n dataset.value = \"soilmoisture\";\n }\n temporal.value = \"daily\";\n handleDate();\n mapInit();\n\n}", "title": "" }, { "docid": "1f0fe4d6d80870069e918054ca15f336", "score": "0.48660302", "text": "function populateOptions(id) {\n\tvar output = \"<img src='./images/add.gif' class='add' /> <span onclick='addLocation(\\\"\" + id + \"\\\")'>Add to My Locations</span> | \";\n\toutput += \"<span onclick='addTags(\\\"\" + id + \"\\\");'>Add Tags</span>\";\n\t$(\"#optionsDiv\").html(output);\n}", "title": "" }, { "docid": "43368b51bdabf94639ff73f4895c126a", "score": "0.486268", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "43368b51bdabf94639ff73f4895c126a", "score": "0.486268", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "43368b51bdabf94639ff73f4895c126a", "score": "0.486268", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "43368b51bdabf94639ff73f4895c126a", "score": "0.486268", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "e35f75a7b37fdd4c33a90d7beadfefa6", "score": "0.4858344", "text": "createMarkedOptions() {\n const markedOptions = (this.application.options.getValue(\"markedOptions\") ?? {});\n // Set some default values if they are not specified via the TypeDoc option\n markedOptions.highlight ?? (markedOptions.highlight = (text, lang) => this.getHighlighted(text, lang));\n if (!markedOptions.renderer) {\n markedOptions.renderer = new Marked.Renderer();\n markedOptions.renderer.heading = (text, level, _, slugger) => {\n const slug = slugger.slug(text);\n // Prefix the slug with an extra `md:` to prevent conflicts with TypeDoc's anchors.\n this.page.pageHeadings.push({\n link: `#md:${slug}`,\n text: (0, html_1.getTextContent)(text),\n level,\n });\n return `<a id=\"md:${slug}\" class=\"tsd-anchor\"></a><h${level}><a href=\"#md:${slug}\">${text}</a></h${level}>`;\n };\n markedOptions.renderer.code = renderCode;\n }\n markedOptions.mangle ?? (markedOptions.mangle = false); // See https://github.com/TypeStrong/typedoc/issues/1395\n return markedOptions;\n }", "title": "" }, { "docid": "2fe9b69bb97558414eedd1f77ced3d18", "score": "0.48581007", "text": "get markerTemplate() {\r\n return this.i.nq;\r\n }", "title": "" }, { "docid": "3af07f250a397631e6fc157cebb209cb", "score": "0.48572072", "text": "function initMap() {\n\n var gmarkers1 = [];\n var markers1 = markers_lg_lt;\n\n var infowindow = new google.maps.InfoWindow({\n content: ''\n });\n\n var iconBase = 'https://dev-rugbyjapan.timeout.jp/wp-content/uploads/2019/05/';\n// console.log(markers_lg_lt);\n // markers1 = [\n // ['1', 'Nissan Stadium', 35.510250, 139.606361, ['things'],'things.png'],\n // ['2', 'Oriental Table ', 35.508861, 139.615139, ['cafe'],'cafe.png'],\n // ['3', 'Montbell', 35.441444, 139.661167, ['shopping'],'shopping.png'],\n // ['4', 'YCAT ', 35.464333, 139.625139, ['things'],'things.png'],\n // ['5', 'Cupnoodles Museum', 35.455500, 139.638917, ['things'],'things.png'],\n // ['6', 'Hard Rock ', 35.455806, 139.633083, ['cafe'],'cafe.png'],\n // ['7', 'Osanbashi Terminal', 35.451194, 139.647417, ['things'],'things.png'],\n // ['8', 'Yokohama Museum', 35.457056, 139.630972, ['culture'],'culture.png'],\n // ['9', 'Rugby Diner 7 oath', 35.447556, 139.638944, ['nightlife'],'night_life.png'],\n // ['10', 'Hamagyu', 35.447944, 139.629917, ['cafe'],'cafe.png'],\n // ['11', 'Orbi', 35.457250, 139.632222, ['things'],'things.png'],\n // ['12', 'Hakkeijima', 35.337389, 139.645889, ['things'],'things.png'],\n // ['13', 'Mirai Yokocho', 35.454972, 139.631250, ['cafe'],'cafe.png'],\n // ['14', 'Bennys place', 35.437833, 139.645361, ['nightlife'],'night_life.png'],\n // ['15', 'Hotel New Grand', 35.444833, 139.649639, ['cafe'],'cafe.png'],\n // ['16', 'Sojiji Temple', 35.506861, 139.670833, ['culture'],'culture.png'],\n // ['17', 'Sheraton Hotel', 35.466750, 139.620194, ['cafe'],'cafe.png'],\n // ['18', 'Kinpira Kitchen', 35.447611, 139.629833, ['cafe'],'cafe.png'],\n // ['19', 'Sainkeien Garden', 35.417972, 139.661306, ['culture'],'culture.png'],\n // ['20', 'Stove’s', 35.463722, 139.619278, ['cafe'],'cafe.png'],\n // ['21', 'Yokohama Cosmoworld', 35.455222, 139.636889, ['things'],'things.png'],\n // ['22', 'Yokohama Sky Cruise', 35.463111, 139.637583, ['things'],'things.png'],\n // ['23', 'InterCon Hotel', 35.457611, 139.637222, ['things'],'things.png'],\n // ['24', 'Noh Theatre', 35.452556, 139.625250, ['culture'],'culture.png'],\n // ['25', 'Bay Hotel Tokyu', 35.456861, 139.635167, ['things'],'things.png'],\n // ['26', 'Full Monty', 35.445583, 139.629083, ['nightlife'],'night_life.png'],\n // ['27', 'Green Sheep', 35.463056, 139.617444, ['nightlife'],'night_life.png'],\n // ['28', 'Marine & walk Yokohama', 35.454611, 139.642139, ['shopping'],'shopping.png'],\n // ['29', 'Stadium', 35.443333, 139.640083, ['things'],'things.png'],\n // ['30', 'The Space', 35.447361, 139.639306, ['things'],'things.png'],\n // ['31', 'Motion Blue', 35.452694, 139.643333, ['nightlife'],'night_life.png'],\n // ['32', 'Sake Bar', 35.463694, 139.615500, ['nightlife'],'night_life.png'],\n // ['33', 'Mirai Manyo Club', 35.456000, 139.638250, ['things'],'things.png'],\n // ['34', 'Ramen Museum', 35.509861, 139.614556, ['things'],'things.png'],\n // ['35', 'Sky Duck Counter', 35.452750, 139.632500, ['things'],'things.png'],\n // ['36', 'Kirin Brewery', 35.490750, 139.665778, ['things'],'things.png'],\n // ['37', 'Yakatabune', 35.450611, 139.633167, ['things'],'things.png'],\n // ['38', 'Gimme Gimme', 35.448028, 139.630194, ['nightlife'],'night_life.png'],\n // ['39', 'Edosei', 35.442306, 139.645806, ['cafe'],'cafe.png'],\n // ['40', 'Yamashita Park', 35.445750, 139.649583, ['things'],'things.png'],\n // ['41', 'Yokohama Seryna-Romanjaya', 35.446750, 139.636361, ['cafe'],'cafe.png'],\n // ['42', 'Haikara', 35.446639, 139.639083, ['culture'],'culture.png'],\n // ['43', 'Imai Dojo', 35.442667, 139.641361, ['culture'],'culture.png'],\n // ['44', 'Red Brick', 35.452639, 139.642806, ['culture'],'culture.png'],\n // ['45', 'Cafe Giang', 35.443861, 139.647278, ['cafe'],'cafe.png'],\n // ['46', 'Sea Bass', 35.445972, 139.651167, ['things'],'things.png'],\n // ['47', 'Tinys ', 35.443278, 139.626556, ['things'],'things.png'],\n // ];\n\n\n var markerCount = markers1.length\n\n\n\n var styledMapType = new google.maps.StyledMapType(\n [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f5f5f5\"\n }]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#616161\"\n }]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#f5f5f5\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#bdbdbd\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#eeeeee\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#757575\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e5e5e5\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#9e9e9e\"\n }]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#ffffff\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#757575\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dadada\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#616161\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#9e9e9e\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e5e5e5\"\n }]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#eeeeee\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#c9c9c9\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#9e9e9e\"\n }]\n }\n ], {\n name: 'Styled Map'\n });\n\n\n\n\n// var yokohama_map = { lat: 35.509999,lng: 139.606394};\n\n\n var map = new google.maps.Map(document.getElementById('map'), {\n center:map_lng_lt,\n zoom: 12,\n mapTypeControl: false,\n });\n\n\n // var contentString = '<div class=\"contentyoko\">' +\n // '<div class=\"marker_img\"><img src=\"'+yokohama_stadium+'\" alt=\"\"/></div>' +\n // '<div><h2>International Stadium Yokohama</h2><a class=\"mark_offical_btn\" href=\"https://www.nissan-stadium.jp/\" target=\"_blank\">offical Website</a></div>'+\n // '</div>';\n\n\n\n var infowindowyoko = new google.maps.InfoWindow({\n content: contentString\n });\n\n var city_marker = new google.maps.Marker({\n position: map_lng_lt,\n icon:iconBase + pin ,\n map: map\n });\n\n\n city_marker.addListener('click', function() {\n infowindowyoko.open(map, city_marker);\n\n });\n\n for (i = 0; i < markerCount; i++) {\n addMarker(markers1[i]);\n }\n\n // Function to add marker to map\n function addMarker(marker) {\n var category = marker[4];\n var title = marker[1];\n var pos = new google.maps.LatLng(marker[2], marker[3]);\n var content = marker[1];\n var ictype= marker[5];\n\n marker1 = new google.maps.Marker({\n title: title,\n position: pos,\n icon: iconBase + ictype,\n category: category,\n map: map\n });\n\n gmarkers1.push(marker1);\n\n // Marker click listener\ngoogle.maps.event.addListener(marker1, 'click', (function(marker1, content) {\n return function() {\n console.log('Gmarker 1 gets pushed');\n infowindow.setContent(content);\n infowindow.open(map, marker1);\n // map.panTo(this.getPosition());\n // map.setZoom(15);\n }\n})(marker1, content));\n\n\n\n}\n\n// Function on Change of checkbox\nupdateView = function(element) {\n if (element) {\n //Get array with names of the checked boxes\n checkedBoxes = ([...document.querySelectorAll('input[name=map_marker]:checked')]).map(function(o) {\n return o.id;\n });\n console.log(checkedBoxes);\n for (i = 0; i < markerCount; i++) {\n marker = gmarkers1[i];\n console.log(marker.category)\n //Filter to show any markets containing ALL of the selected options\n if(typeof marker.category == 'object' && marker.category.length === checkedBoxes.length && checkedBoxes.reduce((a, b) => a && marker.category.includes(b), true)){\n marker.setVisible(true);\n } else {\n marker.setVisible(false);\n }\n }\n } else {\n console.log('No param given');\n }\n}\n map.mapTypes.set('styled_map', styledMapType);\n map.setMapTypeId('styled_map');\n\n}", "title": "" }, { "docid": "8245cda237d09b00b994b9d35bef0395", "score": "0.48564", "text": "function getOverlaySpecification(id){\n if (id === \"routeWithOverlaysWithPreferredLinks\"){\n return '[{\"op\":\"restrict\",\"shape\":[[53.547416,9.997037],[53.547455,9.997646],[53.547506,9.998244],[53.547555,9.999262],[53.547573,9.999883],[53.547369,10.002239],[53.547382,10.004171],[53.547598,10.005475],[53.547761,10.006004]], \"type\":\"preferred\", \"data\":{\"VEHICLE_TYPES\":\"145\",\"PREFERRED_ROUTE_TYPE\":\"201\",\"ENTRY_PENALTY\":-10,\"DRIVE_PENALTY\":-0.2}}]';\n } else if (id === \"routeWithOverlaysWithAvoidLinks\"){\n return '[{\"op\":\"restrict\",\"shape\":[[51.50974,-0.08718],[51.5098,-0.08758],[51.50985,-0.0879],[51.5099,-0.08824],[51.51007,-0.08896],[51.51027,-0.08961],[51.51039,-0.09016],[51.51048,-0.09064],[51.51058,-0.09125],[51.51071,-0.09202],[51.51083,-0.09271]], \"type\":\"preferred\", \"data\":{\"VEHICLE_TYPES\":\"145\",\"PREFERRED_ROUTE_TYPE\":\"201\",\"ENTRY_PENALTY\":10,\"DRIVE_PENALTY\":1.6}}]';\n }\n }", "title": "" }, { "docid": "38c3d10eebd8c91b088f32da24772159", "score": "0.48539856", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" } ]
5a72989d802086d5b0428e3e751e2cc8
function that calls the function PartialBoard inside of the Minesweeper controller
[ { "docid": "76b2a0066ca355f43cdc4a72e04d0d50", "score": "0.6191747", "text": "function doBoardUpdate(location)\n{\n $.ajax(\n {\n datatype: 'json',\n method: 'POST',\n url: '/Minesweeper/PartialBoard',\n data:\n {\n \"location\": location\n },\n success: function (data)\n {\n console.log(data)\n $('#board').html(data)\n }\n });\n}", "title": "" } ]
[ { "docid": "09134682a666fa0391905c088a2c08f4", "score": "0.6226758", "text": "function minesweeper(minefield) {\n\n}", "title": "" }, { "docid": "164249d1efb9f36233433ce60bea6b0f", "score": "0.61146134", "text": "function renderBoard(board,items){\n\t\tITEM_SCALE = parseFloat(board.itemScale);\n\t\tITEM_FONTSCALE = parseFloat(board.itemFontScale);\n\t\tsetWIP(parseInt(board.WIPWindowDays));\n\t\tif (board.viewConfig.laneboxRightWidth) LANE_LABELBOX_RIGHT_WIDTH = parseInt(board.viewConfig.laneboxRightWidth);\n\t\tif (board.viewConfig.offsetTop) BOARD_OFFSET_TOP = parseInt(board.viewConfig.offsetTop);\n\t\tKANBAN_START= new Date(board.startDate);\n\t\tKANBAN_END= new Date(board.endDate);\n\n\t\t// dynamic height\n\t\tboard.height=300+(board.itemScale*board.itemFontScale*4)*items.length;\n\n\t\tCONTEXT = board.name;\n\t\t/*\n\t\tinitiativeData = _.filter(initiativeData,function(item){\n\t\t\tif(!item.Status || item.Status==\"On hold\" || item.Status==\"Cancelled\") return false;\n\t\t\treturn true;\n\t\t})\n\t\t*/\n\t\t// we have to now join boardData and initiative Data\n\t\tvar _items=[];\n\n\t\t// 20160503 - just found out what the intentaion of this code was ;-) the orginal idea was that a board can hold\n\t\t// just a list of items with only a reference ID - but this was never really implemented => instead we built on top of\n\t\t// a not wll thought idea something else ;-)\n\t\tfor (var i in items){\n\t\t\tvar _i = items[i];\n\t\t\t//console.log(\"+ _item before createItem: \"+JSON.stringify(_i));\n\t\t\tvar _item = _createItem(_i,board.groupby.split(\",\"),board.name);\n\t\t\t//console.log(\"* _createItem: \"+JSON.stringify(_item));\n\t\t\t_items.push(_item);\n\t\t}\n\t\t// simulated EpicRef and EpicView item structure\n\t\tboard.items =_items\n\n\t\t// repopulating and mapping to internal kanban domain\n\t\tboard.items =joinBoard2Items(board,items);\n\n\n\n\t\t// with drawAll() refresh without postback possible ;-)\n\t\tdisableAllMetrics();\n\t\tconsole.log(\"---- lets draw ALL\");\n\t\t//q1_2014_reviewMetrics();\n\t\tconsole.log(\"======= initiatives.length: \"+items.length);\n\n\t\tdrawAll(board);\n\n\t\t//drawCustomPostits();\n\t\t//initHandlers();\n\t\tif (AUTH==\"bpty\") hideNGR();\n\t\tBOARD = board;\n}", "title": "" }, { "docid": "cae38cdad162e4e1c267fed34213ea57", "score": "0.6052925", "text": "createGameBoard() {\n $('#color').css(\"background-color\", `${this.getColor()}`);\n this.createTiles();\n }", "title": "" }, { "docid": "539c362f0502fc8b36d6b246c1095f26", "score": "0.6035096", "text": "renderLocalBoard() {\n if(data.victory) {\n for(let i=0;i<9;i++) localBoardPops[i].visible = false;\n return;\n }\n \n if(data.currentBoard == -1) {\n localBoard.setTexture(resources[\"res/BoardGray.svg\"].texture);\n for(let i=0;i<9;i++) {\n localBoardPops[i].renderable = false;\n localBoardPops[i].interactive = false;\n localBoardPops[i].buttonMode = false;\n }\n return;\n }\n \n localBoard.setTexture(resources[\"res/Board.svg\"].texture);\n \n for(let i=0;i<9;i++) {\n switch(data.getState(data.currentBoard, i)) {\n case X:\n localBoardPops[i].setTexture(resources[\"res/X.svg\"].texture);\n localBoardPops[i].visible = true;\n localBoardPops[i].renderable = true;\n localBoardPops[i].interactive = false;\n localBoardPops[i].buttonMode = false;\n break;\n case O:\n localBoardPops[i].setTexture(resources[\"res/O.svg\"].texture);\n localBoardPops[i].visible = true;\n localBoardPops[i].renderable = true;\n localBoardPops[i].interactive = false;\n localBoardPops[i].buttonMode = false;\n break;\n default:\n localBoardPops[i].visible = true;\n localBoardPops[i].renderable = false;\n localBoardPops[i].interactive = true;\n localBoardPops[i].buttonMode = true;\n }\n }\n }", "title": "" }, { "docid": "23683f24df98e34f482fa82224c17182", "score": "0.60240734", "text": "function checkBoard() {\n\t\tfillBoard();\n\t}", "title": "" }, { "docid": "4ac75b5d96f852853869f776181020d3", "score": "0.59647566", "text": "function main(){\n boardDisplay();\n}", "title": "" }, { "docid": "a0a4b942393f036b111564578df8cbda", "score": "0.59147686", "text": "function renderBoard(board) {\n // loop through every element in the given 2D-array board\n for (let i = 0; i < 9; i++) {\n for (let j = 0; j < 9; j++) {\n\n // get value from the given board on position (i, j)\n const id = ref[i + 1] + '-' + ref[j + 1];\n const val = board[i][j];\n\n // if value on board isn't 0, then draws the correct number onto the web page\n if (val !== 0) {\n const cell = $('#' + id);\n cell.html(num_ref[ref[val]][0]);\n\n // remove onclick attribute to prevent user from changing base puzzle\n cell.removeAttr('onclick');\n\n // call function to add number in back-end board\n // addMove(id, val)\n }\n }\n }\n}", "title": "" }, { "docid": "e39d578319cbbb08a36705186591806f", "score": "0.5886301", "text": "function reveal(rx,ry) {\n\t\t\n\t\tvar canvas = document.getElementById(\"minesweeper\");\n\t\tvar context = canvas.getContext(\"2d\");\n\t\t\t\n\t\t\t\n\t\t\tif(structure[ry][rx][\"around\"] == 0) { // empty square\n\t\t\t\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.fillStyle = \"#E9E9E9\";\n\t\t\t\tcontext.fillRect((structure[ry][rx][\"x1\"]+1),(structure[ry][rx][\"y1\"]+1),(BLOCK_SIZE-2),(BLOCK_SIZE-2));\n\t\t\t\tcontext.closePath();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse if(structure[ry][rx][\"around\"] > 0) { // number\n\t\t\t\t\t\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.fillStyle = \"#000000\";\n\t\t\t\tcontext.textAlign = \"left\";\n\t\t\t\tcontext.textBaseline = \"top\";\n\t\t\t\tcontext.font = (BLOCK_SIZE) + \"px sans-serif\";\n\t\t\t\tcontext.fillText((structure[ry][rx][\"around\"]+\"\"),structure[ry][rx][\"x1\"]+(BLOCK_SIZE/5),structure[ry][rx][\"y1\"]);\t\t\t\t\t\t\n\t\t\t\tcontext.closePath();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse { // mine\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tcontext.beginPath();\t\t\t\t\n\t\t\t\tcontext.drawImage(imgM,(structure[ry][rx][\"x1\"]+1),(structure[ry][rx][\"y1\"]+1),(BLOCK_SIZE-2),(BLOCK_SIZE-2));\n\t\t\t\tcontext.closePath();\n\t\t\t\t\n\t\t\t}\t\t\n\t}", "title": "" }, { "docid": "16d87ebc960b844e03243be5af7dcd80", "score": "0.5883987", "text": "renderGlobalBoard() {\n for(let i=0;i<9;i++) {\n if(data.isSelectable(i)) {\n backgroundBoardSprites[i].setTexture(resources[\"res/smallBoard.svg\"].texture);\n } else {\n backgroundBoardSprites[i].setTexture(resources[\"res/smallBoardGray.svg\"].texture);\n }\n \n for(let j=0;j<9;j++) {\n switch(data.getState(i, j)) {\n case X:\n globalBoardPops[i][j].setTexture(resources[\"res/smallX.svg\"].texture);\n globalBoardPops[i][j].renderable = true;\n break;\n case O:\n globalBoardPops[i][j].setTexture(resources[\"res/smallO.svg\"].texture);\n globalBoardPops[i][j].renderable = true;\n break;\n default:\n globalBoardPops[i][j].renderable = false;\n globalBoardPops[i][j].interactive = true;\n globalBoardPops[i][j].buttonMode = true;\n }\n }\n \n if(data.getState(i) == C) {\n globalBoardVictorySprites[i].visible = true;\n globalBoardVictorySprites[i].setTexture(resources[\"res/cats.svg\"].texture);\n } else if(data.getState(i) != E) {\n globalBoardVictorySprites[i].visible = true;\n globalBoardVictorySprites[i].setTexture(resources[\"res/Victory\"+data.getState(i)+\".svg\"].texture);\n }\n }\n }", "title": "" }, { "docid": "1b0338d2513365342492583d91626091", "score": "0.58531094", "text": "function renderBoard(){\n context.save();\n //draw things\n //drawTestGrid(testGridColor);\n gameGridArray = startingGameGridArray.slice();\n drawGame(gameGridArray);\n maxDots = dotsRemaining;\n context.restore();\n}", "title": "" }, { "docid": "e6e6ccb905a41ad4f40d3efc3e534398", "score": "0.58517647", "text": "function rePaintBoard(){\r\n paintBoard();\r\n \r\n // draw existing stones\r\n for(row = 0; row < grids; row++){\r\n\t\tfor(col = 0; col < grids; col++){\r\n\t\t\tswitch(position[row][col].occupant){\r\n\t\t\t\tcase black_here:// paint black stone\r\n\t\t\t\t\tdrawBlackStone(position[row][col].x, position[row][col].y);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase white_here:// paint white stone\r\n\t\t\t\t\tdrawWhiteStone(position[row][col].x, position[row][col].y);\r\n\t\t\t\t\tbreak;\r\n default:\r\n break;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "b257985f194c5c05a767a90070201cbf", "score": "0.5848798", "text": "function createBoard() {\n let rndBtnClassArr = [\"fa-trash\", \"fa-pencil-alt\", \"fa-cog\"];\n let rndBtnFnClassArr = [\"boardDelete\", \"boardEdit\", \"boardSettings\"];\n let nameOfTheBoard = document.getElementById(\"boardName\").value;\n setId();\n let Create = {\n render: () => {\n let view = /*html*/ `\n \n <div class=\"board-wrapper\" id=\"board${idCounter}\">\n <div class=\"board\">\n <h3 class=\"board-title\">${nameOfTheBoard}</h3>\n <a href=\"/views/board.html\" class=\"desk\"\n ><img src=\"/img/board.png\" alt=\"board\"\n /></a>\n <div class=\"btn-round-container\">\n <button onclick='deletion(board${idCounter})' class=\"round btn\">\n <i class=\"fas fa-trash boardDelete\"></i>\n </button>\n <button onclick='changeName(board${idCounter})' class=\"round btn\">\n <i class=\"fas fa-pencil-alt boardEdit\"></i>\n </button>\n <button onclick='getIntoBoard()' class=\"round btn\"><i class=\"fas fa-cog boardSettings\"></i></button>\n </div>\n </div>\n </div>\n\n `;\n return view;\n }\n };\n\n document.getElementById([\"wall-of-boards\"]).innerHTML =\n Create.render() + document.getElementById([\"wall-of-boards\"]).innerHTML;\n\n // Close modal, clear it's input and runs essential functions\n closeModal();\n clearInput();\n animateBoard();\n}", "title": "" }, { "docid": "843c0877b90d228b9c0e9dfa1b98cb66", "score": "0.5837522", "text": "_setupBoard() {\n // Set mines\n this._setMines()\n // Set numbers\n this._setNumbers()\n }", "title": "" }, { "docid": "2fc6a0dd9cbc86fe4d3fcc3297956790", "score": "0.58192176", "text": "populateBoard(config){\n\n }", "title": "" }, { "docid": "d1b64d76aca01e42c5f816a8d83d707e", "score": "0.58147705", "text": "function createBoard() {\n board = new Board((numDiscs + 3) * 120, 20, (numDiscs + 3) * 40, '../img/wood.jpg', scene);\n }", "title": "" }, { "docid": "acbe951c4fa6700c9e4ac031dbcb38ed", "score": "0.58052856", "text": "function drawBoard() {\n\trectMode(CENTER);\n\tnoStroke();\n\t\n\tfill(LIGHT_COLOR);\n\trect(4*GRID_SIZE, 4*GRID_SIZE, 8*GRID_SIZE, 8*GRID_SIZE);\n\t\n\tfill(DARK_COLOR);\n\t\n\tfor (let rank=0; rank<8; ++rank) {\n\t\tfor (let file=0; file<8; ++file) {\n\t\t\tif (isDarkSquare(file, rank)) {\n\t\t\t\tlet screenPos = getGridScreenPosition(file, rank);\n\t\t\t\trect(screenPos.x, screenPos.y, GRID_SIZE, GRID_SIZE);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfill(0,255,0,128);\n\tfor (let debugMove of debugMoves) {\n\t\tlet screenPos = getGridScreenPosition(debugMove.file, debugMove.rank);\n\t\trect(screenPos.x, screenPos.y, GRID_SIZE, GRID_SIZE);\n\t}\n\tnoFill();\n\tstroke(0,255,0,128);\n\tstrokeWeight(10);\n\tif (debugPiecePos != null) {\n\t\tlet screenPos = getGridScreenPosition(debugPiecePos.file, debugPiecePos.rank);\n\t\trect(screenPos.x, screenPos.y, GRID_SIZE, GRID_SIZE);\n\t}\n}", "title": "" }, { "docid": "29e4bd3e8a06c489d56e66872da3112b", "score": "0.58004576", "text": "function renderBoard() {\n\tvar image_name = \"\", image = null, i = 0;\n\n\tfor (i = 0; i < board.length; i++) {\n\n\t\tswitch(board[i]) {\n\t\t\tcase HIDDEN_BLANK_SQUARE:\n\t\t\t\t// hidden square\n\t\t\t\timage_name = \"hidden\";\n\t\t\t\tbreak;\n\t\t\tcase FLAGGED_BLANK_SQUARE:\n\t\t\t\t// exposed blank square\n\t\t\t\timage_name = \"flagged\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_BLANK_SQUARE:\n\t\t\t\t// exposed bomb\n\t\t\t\timage_name = \"exposedBlank\";\n\t\t\t\tbreak;\n\t\t\tcase HIDDEN_BOMB_SQUARE:\n\t\t\t\t// flagged square\n\t\t\t\timage_name = \"hidden\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_BOMB_SQUARE:\n\t\t\t\t// exposed one\n\t\t\t\timage_name = \"exposedBomb\";\n\t\t\t\tbreak;\n\t\t\tcase FLAGGED_BOMB_SQUARE:\n\t\t\t\t// exposed two\n\t\t\t\timage_name = \"flagged\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_NUMBER_ONE:\n\t\t\t\t// exposed three\n\t\t\t\timage_name = \"exposedOne\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_NUMBER_TWO:\n\t\t\t\t// exposed four\n\t\t\t\timage_name = \"exposedTwo\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_NUMBER_THREE:\n\t\t\t\t// exposed four\n\t\t\t\timage_name = \"exposedThree\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_NUMBER_FOUR:\n\t\t\t\t// exposed four\n\t\t\t\timage_name = \"exposedFour\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_NUMBER_FIVE:\n\t\t\t\t// exposed four\n\t\t\t\timage_name = \"exposedFive\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_NUMBER_SIX:\n\t\t\t\t// exposed four\n\t\t\t\timage_name = \"exposedSix\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_NUMBER_SEVEN:\n\t\t\t\t// exposed four\n\t\t\t\timage_name = \"exposedSeven\";\n\t\t\t\tbreak;\n\t\t\tcase EXPOSED_NUMBER_EIGHT:\n\t\t\t\t// exposed four\n\t\t\t\timage_name = \"exposedEight\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\timage_name = \"hidden\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tvar row = Math.floor(i / boardWidth),\n\t\t\tcolumn = i - (row*boardWidth);\n\n\t\timage = document.getElementById(image_name);\n\t\tcontext.drawImage(image, column*30, row*30);\n\t}\n}", "title": "" }, { "docid": "b4981fb85b5a04d0fa8e7a3397792499", "score": "0.5789582", "text": "updateBoard(newBoard){\n\t\tif(arguments.length == 1){\n\t\t\tthis.board = newBoard;\n\t\t}\n\n\t\tvar board = this.board;\n\n\t\tfor(var i = 0; i < 8; i++){\n\t\t\tfor(var j = 0; j < 8; j++){\n\n\t\t\t\tvar cell = this.cells[i][j];\n\t\t\t\tvar p = board.at(cell.get(0).position);\n\t\t\t\tvar html = p === null? '&nbsp;' : ('<div>' + PeiceText[p.color][p.type] + '</div>');\n\n\t\t\t\tcell.html(html);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "e9ea87a6dadc7e3ee96c8ff492b01638", "score": "0.5765285", "text": "displayBoard() {\n this.board.display();\n }", "title": "" }, { "docid": "4202634570e741544386d885556e1b83", "score": "0.57629865", "text": "function initMineSweeper() {\n}", "title": "" }, { "docid": "2132836cd3119d24694c607711cd00c0", "score": "0.57581687", "text": "function buildBoard(){\n\t//Build our board! //0 or 1 based?\n\tfor(var w = 1; w <= board.width; w++){\n\t\tboard.tiles[w] = [];\n\t\tfor(var h = 1; h <= board.height; h++){\n\n\t\t\tvar tmpTile = _.clone(tile);\n\n\t\t\ttmpTile.id = ++tmpTile.id;\n\n\t\t\t//Clone our default HTML element\n\t\t\ttmpTile.element = tileTpl.cloneNode(true);\n\t\t\ttmpTile.element.x = w;\n\t\t\ttmpTile.element.y = h;\n\t\t\t\n\t\t\t//Give it a unique ID\n\t\t\ttmpTile.element.setAttribute(\"id\", 'tile-'+w+'-'+h);\n\t\t\t\n\t\t\ttmpTile.element.type = tmpTile.type;\n\t\t\ttmpTile.element.background = tmpTile.background;\n\t\t\t//tile.element.setAttribute('data-background', tile.background);\n\n\t\t\t//Setup a click listener on this tile\n\t\t\t//tile.element.addEventListener('click', colorTile);\n\t\t\ttmpTile.element.onmousedown = function(e){\n\t\t\t\t\n\t\t\t\tswitch($activeTool){\n\t\t\t\t\tcase $paintTool:\n\t\t\t\t\t\tthrottlePaint(this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $fillTool:\n\t\t\t\t\t\tdebounceFill(this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $eraseTool:\n\t\t\t\t\t\tthrottleErase(this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $highlightTool:\n\t\t\t\t\t\tthrottleHighlight(this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $sampleTool:\n\t\t\t\t\t\tsampleTile(this);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t//Some tools need to function while moving over\n\t\t\ttmpTile.element.onmousemove = function(e){\n\t\t\t\tif(board.painting){\n\t\t\t\t\tswitch($activeTool){\n\t\t\t\t\t\tcase $paintTool:\n\t\t\t\t\t\t\tthrottlePaint(this);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase $fillTool:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase $eraseTool:\n\t\t\t\t\t\t\tthrottleErase(this);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase $highlightTool:\n\t\t\t\t\t\t\tthrottleHighlight(this);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase $sampleTool:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t//Put our tile into our state board\n\t\t\tboard.tiles[w][h] = tmpTile;\n\n\t\t\t\n\t\t\t\n\t\t\t//tileHolder.appendChild(board.tiles[w][h].element);\n\t\t}\n\t}\n\n\tdisplayBoard(board);\n\n}", "title": "" }, { "docid": "d769c951b476b52d26bd408972f92daa", "score": "0.5747578", "text": "function buildBoard() {\n let resetContainer = document.querySelector('.reset');\n resetContainer.classList.remove('reset-hidden');\n\n resizeGrid();\n addClickListener();\n changeNameOfCurrentPlayer();\n}", "title": "" }, { "docid": "420f3431c4166af89fce8bb837db1544", "score": "0.5733745", "text": "buildBoard() {\n // initialize the entire board.\n // never ever use a for loop -- no need!\n this.board = _.times(this.rows).map(() => {\n // Create one row\n return _.times(this.cols).map(() => {\n return ' ';\n });\n });\n }", "title": "" }, { "docid": "c9f54635e57ab4772227f7f859d4425a", "score": "0.57306665", "text": "function resetBoard() {\n\t// TO BE DONE\n}", "title": "" }, { "docid": "8601ba2cb6e3f3eab32f8ec9d9de8f65", "score": "0.57276446", "text": "function drawBoard() {\n strokeWeight(1);\n stroke(0);\n const m = (1 / 8) * minDim;\n for (let col = 0; col < 8; col++) {\n for (let row = 0; row < 8; row++) {\n fill(squares[row][col].color);\n rect(row * m, col * m, (row + 1) * m, (col + 1) * m);\n squares[row][col].position = [row * m, col * m,\n (row + 1) * m, (col + 1) * m\n ];\n }\n }\n line(minDim, 0, minDim, minDim);\n line(0, minDim, minDim, minDim);\n}", "title": "" }, { "docid": "703175bd5d3b762ff506cee3630b26c0", "score": "0.5722943", "text": "function clearBoard() {\r\n \r\n }", "title": "" }, { "docid": "0f4cd25fbf6164fd6fe9c61af8cf98cc", "score": "0.5719322", "text": "function createBoard() {\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n var levelDifficulty = 4\r\n var cell = {\r\n minesAroundCount: 4,\r\n isShown: true,\r\n isMine: false,\r\n isMarked: true,\r\n cellImg : '',\r\n i:i,\r\n j:j,\r\n }\r\n \r\n var board = [];\r\n\r\n for (var i = 0; i < levelDifficulty; i++) {\r\n board[i] = []\r\n \r\n for (var j = 0; j < levelDifficulty; j++) {\r\n\r\n var cell = { \r\n minesAroundCount: 4,\r\n isShown: true,\r\n isMine: false,\r\n isMarked: true,\r\n cellImg : '',\r\n i:i,\r\n j:j, };\r\n board[i][j] = cell\r\n \r\n // if(i ===0 && j === 1){gBoard.isMine = true}\r\n }\r\n }\r\n \r\n \r\n \r\n \r\n \r\n board[1][1].isMine = true\r\n // if (board.isMine = true) {gBoard.cellImg === '%%'}\r\n \r\n return board;\r\n \r\n board[gMinePosition.i][gMinePosition.j] =mine\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "3cb754553376deb053a313b1e338a179", "score": "0.5718227", "text": "createGameBoard() {\n function tileClickHandler() {\n const row = parseInt(this.id.split('_')[1][0], 10)\n const col = parseInt(this.id.split('_')[1][1], 10)\n if (!player.getCurrentTurn() || !game) {\n alert('Its not your turn!')\n return\n }\n\n if ($(this).prop('disabled')) {\n alert('This tile has already been played on!')\n return\n }\n\n // Update board after your turn.\n game.playTurn(this)\n game.updateBoard(player.getPlayerType(), row, col, this.id)\n\n player.setCurrentTurn(false)\n player.updatePlaysArr(1 << (row * 3 + col))\n\n game.checkWinner()\n }\n\n for (let i = 0; i < 3; i++) {\n this.board.push(['', '', ''])\n for (let j = 0; j < 3; j++) {\n $(`#button_${i}${j}`).on('click', tileClickHandler)\n }\n }\n }", "title": "" }, { "docid": "51d02780bff5090833c5d9d5a519bc1d", "score": "0.5705331", "text": "function setupBoard (self){\n board = [\n [emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,],\n [emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,],\n [emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,],\n [emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,],\n [emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,],\n [emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,],\n [emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,],\n [emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,emptyPiece,]\n ];\n for(var y = 0; y < 8; y++){\n for(var x = 0; x < 8; x++){\n var pieceType = startBoard[y][x];\n if(pieceType != ''){\n placePiece({x: x, y: y}, pieceType);\n }\n }\n }\n}", "title": "" }, { "docid": "d7b51cf84027f2a3a38b641cf931db0e", "score": "0.5686494", "text": "function generateBlankBoard() {\n const widthOfBoard = 100;\n let board = qs(\"#play-view #board\");\n let sideSize = Math.sqrt(selectedSize);\n let squareWidth = Math.floor(widthOfBoard / sideSize);\n for (let i = 0; i < selectedSize; i++) {\n let square = gen(\"div\");\n square.classList.add(\"square\");\n let scenario = gen(\"p\");\n scenario.classList.add(\"scenario\");\n square.style.width = squareWidth + \"vh\";\n square.appendChild(scenario);\n board.appendChild(square);\n }\n }", "title": "" }, { "docid": "5234b2da73235ea0cfd9d80d112630df", "score": "0.5681191", "text": "function drawBoard() {\n\tfor (let i = 0; i < 14; i++) {\n\t\tfor (let j = 0; j < board[i].length; j++) {\n\t\t\tif (board[i][j] == \"red\" || board[i][j] == \"green\" || board[i][j] == \"blue\" || board[i][j] == \"yellow\") {\n\t\t\t\tdocument.getElementById(\"\" + i + \".\" + j).style.backgroundImage = \"url('\" + board[i][j] + \"_stone.png')\";\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(\"\" + i + \".\" + j).style.backgroundImage = \"url()\";\n\t\t\t}\n\t\t\tdocument.getElementById(\"\" + i + \".\" + j).style.transform = \"\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "63e27025b8ecccc95efefb7944e46cf5", "score": "0.56749827", "text": "function draw() {\n\t\t\n\t\tvar canvas = document.getElementById(\"minesweeper\");\n\t\t\t\t\n\t\tcanvas.width = gridSize * BLOCK_SIZE;\n\t\tcanvas.height = canvas.width;\n\t\t\t\n\t\t\n\t\tvar context = canvas.getContext(\"2d\");\n\t\tcontext.globalAlpha = 1;\t\t\n\t\tcontext.strokeStyle = \"#000000\";\n\t\tcontext.fillStyle = \"#000000\";\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tfor (var r = 0; r <= gridSize; r++) { // draws the rows of the grid\n\t\t\t\t\n\t\t\t\tcontext.beginPath()\n\t\t\t\tcontext.moveTo(0,r*BLOCK_SIZE);\n\t\t\t\tcontext.lineTo(canvas.width,r*BLOCK_SIZE);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (var c = 0; c <= gridSize; c++) { // draws the columns of the grid\n\t\t\t\tcontext.beginPath()\n\t\t\t\tcontext.moveTo(c*BLOCK_SIZE,0);\n\t\t\t\tcontext.lineTo(c*BLOCK_SIZE,canvas.height);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t/* Measures the buttons to the top of the canvas\n\t\tdepending on the size of the grid */\t\t\n\t\tdocument.getElementById(\"container\").style.width = (canvas.width + 100) + \"px\";\n\t\tdocument.getElementById(\"flags_left\").style.width = ((canvas.width/3)-(32)) + \"px\";\n\t\tdocument.getElementById(\"countup\").style.width = document.getElementById(\"flags_left\").style.width;\n\t\tdocument.getElementById(\"settings\").style.width = document.getElementById(\"flags_left\").style.width;\n\t\n\t\t\n\t}", "title": "" }, { "docid": "15dd3fcc314fef4dbc87de2f4baacc5a", "score": "0.5671855", "text": "function initialize(){\r\n /*initialize turn to White*/\r\n setPlayer(WHITE);\r\n displayPlayer();\r\n\r\n /*Create a 8 x 2 board for pieces captured by white*/\r\n capturedByWhite = new Array(2);\r\n for (var i = 0; i < capturedByWhite.length; i++){\r\n\t capturedByWhite[i] = new Array(8);\r\n }\r\n\r\n\tfor (var i = 0; i < capturedByWhite.length; i++){\r\n\t\tfor (var j = 0; j < capturedByWhite[i].length; j++){\r\n\t\t\tcapturedByWhite[i][j] = \"images/sprites/r.png\";\r\n\t\t}\r\n\t}\r\n\r\n /*Create a 8 x 2 board for pieces captured by black*/\r\n capturedByBlack = new Array(2);\r\n for (var i = 0; i < capturedByBlack.length; i++){\r\n\t capturedByBlack[i] = new Array(8);\r\n }\r\n\r\n for (var i = 0; i < capturedByBlack.length; i++){\r\n for (var j = 0; j < capturedByBlack[i].length; j++){\r\n capturedByBlack[i][j] = \"images/sprites/r.png\";\r\n }\r\n }\r\n\r\n /*Create array, first val = r second = c third = block lifespan*/\r\n blockedTiles = new Array(maxNumOfBlocked);\r\n for(var i = 0; i < blockedTiles.length; i++){\r\n\t blockedTiles[i] = \"empty\";\r\n }\r\n\r\n /*Create a 10 x 10 board*/\r\n board = new Array(10);\r\n for(var i = 0; i < board.length; i++){\r\n board[i] = new Array(10);\r\n }\r\n\r\n /*Set up a 10 x 10 board*/\r\n\r\n /*Set up Rooks*/\r\n board[0][1] = \"images/sprites/dob.png\";\r\n board[0][8] = \"images/sprites/lob.png\";\r\n board[9][1] = \"images/sprites/low.png\";\r\n board[9][8] = \"images/sprites/dow.png\";\r\n\r\n /*Set up Knights*/\r\n board[0][2] = \"images/sprites/lkb.png\";\r\n board[0][7] = \"images/sprites/dkb.png\";\r\n board[9][2] = \"images/sprites/dkw.png\";\r\n board[9][7] = \"images/sprites/lkw.png\";\r\n\r\n /*Set up Bishops*/\r\n board[0][3] = \"images/sprites/dhb.png\";\r\n board[0][6] = \"images/sprites/lhb.png\";\r\n board[9][3] = \"images/sprites/lhw.png\";\r\n board[9][6] = \"images/sprites/dhw.png\";\r\n\r\n /*Set up Kings*/\r\n board[0][5] = \"images/sprites/dgb.png\";\r\n board[9][5] = \"images/sprites/lgw.png\";\r\n\r\n /*Set up Queens*/\r\n board[0][4] = \"images/sprites/lqb.png\";\r\n board[9][4] = \"images/sprites/dqw.png\";\r\n\r\n /*Set up Empty Tiles*/\r\n for(var i = 0; i < board.length; i++){\r\n for(var j = 0; j < board[i].length; j++){\r\n if(i % 2 == 0 && j == 0 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/l.png\";\r\n }\r\n else if (i % 2 == 1 && j == 0 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/d.png\";\r\n }\r\n\r\n if(i % 2 == 0 && j == 9 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/d.png\";\r\n }\r\n else if (i % 2 == 1 && j == 9 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/l.png\";\r\n }\r\n\r\n if(i >= 2 && i <= 7){\r\n if(i % 2 == 0 && j % 2 == 0 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/l.png\";\r\n }\r\n else if (i % 2 == 0 && j % 2 == 1 && board[i][j] == null) {\r\n board[i][j] = \"images/sprites/d.png\";\r\n }\r\n if(i % 2 == 1 && j % 2 == 0 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/d.png\";\r\n }\r\n else if (i % 2 == 1 && j % 2 == 1 && board[i][j] == null) {\r\n board[i][j] = \"images/sprites/l.png\";\r\n }\r\n }\r\n\r\n /*Set up Pawns*/\r\n if (i == 1) {\r\n if(j % 2 == 0 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/dpb.png\";\r\n }\r\n else if (j % 2 == 1 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/lpb.png\";\r\n }\r\n }\r\n else if (i == 8) {\r\n if(j % 2 == 0 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/lpw.png\";\r\n }\r\n else if (j % 2 == 1 && board[i][j] == null){\r\n board[i][j] = \"images/sprites/dpw.png\";\r\n }\r\n }\r\n }\r\n }\r\n\r\n board[6][0] = \"images/sprites/lx1.png\";\r\n\r\n /*Display board*/\r\n populate();\r\n}", "title": "" }, { "docid": "d1082cb78ead4c121fca6133c447b605", "score": "0.56709796", "text": "function drawBoard (self){\n //first, clears all current piece images\n while(pieceImages.length != 0){\n var clr = pieceImages.pop();\n clr.destroy();\n }\n\n //loop through board\n for(var y = 0; y < 8; y++){\n for(var x = 0; x < 8; x++){\n if(board[y][x].pieceType != ''){\n //rotate image position by 180 degrees for the black player (shows black pieces on the bottom)\n let actualPos = (self.color == 'white')? {x: x, y:y} : {x: 7-x, y:7-y};\n\n if(board[y][x].selected){ //show outline around selected piece\n pieceImages.push(self.add.image(actualPos.x * 75 + 38, actualPos.y * 75 + 38, 'select').setDisplaySize(75,75));\n }\n //create piece image, as well as health bar based on current piece health\n pieceImages.push(self.add.image(actualPos.x * 75 + 38, actualPos.y * 75 + 38, board[y][x].pieceImg).setDisplaySize(70,70));\n pieceImages.push(self.add.image(actualPos.x * 75 + 38, actualPos.y * 75 + 38, 'health').setDisplaySize(70 * (board[y][x].hp / board[y][x].maxHp),70));\n }\n }\n }\n //show win messages depending on game state\n if(gameState == 'whitewin'){\n pieceImages.push(self.add.image(300, 300, 'winW').setDisplaySize(400,200));\n }\n if(gameState == 'blackwin'){\n pieceImages.push(self.add.image(300, 300, 'winB').setDisplaySize(400,200));\n }\n}", "title": "" }, { "docid": "1baaee022f830114e9f36a4686368816", "score": "0.56648093", "text": "function create_board_html(divID, dim, emptyBoard, start_square) {\n $(divID).empty();\n var current_wall = 0;\n var current_square = 0;\n var id_prefix = (emptyBoard)? \"o\": \"s\";\n var wall_id_prefix = (emptyBoard)? \"w\": \"\";\n maze_size = dim;\n var i;\n\n // if (!start_square) start_square = 0;\n\n for(i = 0; i < dim; i++) {\n var j, wall, square;\n // This is the div to hold the row of spacers and walls\n var wall_row = $(\"<div>\", {class: \"row row-walls\"});\n\n for (j = 0; j < dim; j++) {\n if (i === 0) {\n // if it's the very first row, then these need to be all red\n $(wall_row).append($(\"<div>\", {class: \"spacer\"}), $(\"<div>\", {class: \"wall wall-horizontal red\"}));\n } else {\n // otherwise the walls are grey, are assigned an ID, and get the function attached if they are clicked\n wall = $(\"<div>\", {class: \"wall wall-horizontal\", id: wall_id_prefix+current_wall}).click(toggle);\n $(wall_row).append($(\"<div>\", {class: \"spacer\"}), wall);\n current_wall++;\n }\n }\n // final spacer is added\n $(wall_row).append($(\"<div>\", {class: \"spacer\"}));\n\n // This is the div to hold the row of walls and squares\n var wall_square = $(\"<div>\", {class: \"row row-squares\"});\n\n for (j = 0; j <dim; j++) {\n // Determine the wall properties\n if (j === 0) {\n $(wall_square).append($(\"<div>\", {class: \"wall wall-vertical red\"}));\n } else {\n $(wall_square).append($(\"<div>\", {class: \"wall wall-vertical\", id: wall_id_prefix+current_wall}).click(toggle));\n current_wall++;\n }\n\n // Determine the square properties\n if (current_square === start_square) {\n $(wall_square).append($(\"<div>\", {class: \"square start\", id: id_prefix+current_square}).click(toggle));\n } else if (j === dim - 1 && i === dim - 1 && !emptyBoard) {\n $(wall_square).append($(\"<div>\", {class: \"square end\", id: id_prefix+current_square}).click(toggle));\n } else {\n $(wall_square).append($(\"<div>\", {class: \"square\", id: id_prefix+current_square}).click(toggle));\n }\n current_square++;\n }\n \n // final wall, it's perma red and non-clickable\n $(wall_square).append($(\"<div>\", {class: \"wall wall-vertical red\"}));\n\n // add the two rows to the board\n $(divID).append(wall_row, wall_square);\n }\n\n // final row of spacers and walls here, identical to the very first row\n var final_row = $(\"<div>\", {class: \"row row-walls\"});\n for(i = 0; i < dim; i++) {\n $(final_row).append($(\"<div>\", {class: \"spacer\"}), $(\"<div>\", {class: \"wall wall-horizontal red\"}));\n }\n $(final_row).append($(\"<div>\", {class: \"spacer\"}));\n $(divID).append(final_row);\n}", "title": "" }, { "docid": "0dd7fb0b88e036c13c4419954af6d0e1", "score": "0.565866", "text": "function Board() {\n var self = this;\n\n return {\n draw: drawBoard,\n create: createBoard,\n scanForWin: scanBoardForWin,\n reveal: revealEntireBoard,\n checkNeighbors: checkNeighbors,\n countAdjacentBombs: countAdjacentBombs\n };\n\n function createBoard(dimension, difficulty) {\n self.dimension = dimension;\n self.difficulty = difficulty;\n\n var i, j,\n totalBombs,\n bombLocale,\n bombsPlaced = 0;\n\n totalBombs = Math.floor(self.dimension * self.dimension / self.difficulty);\n\n // initialize board\n for (i = 0; i < self.dimension; i++) {\n board[i] = [];\n }\n for (i = 0; i < self.dimension; i++) {\n for (j = 0; j < self.dimension; j++) {\n board[i][j] = new BoardSquare(i, j);\n }\n }\n\n // place bombs\n while (bombsPlaced < totalBombs) {\n bombLocale = Math.floor(Math.random() * self.dimension * self.dimension);\n var x = bombLocale % self.dimension;\n var y = Math.floor(bombLocale / self.dimension);\n console.log(\"Bomb placed at \", x, \",\", y);\n if (board[y][x].isBomb === false) {\n board[y][x].isBomb = true;\n bombsPlaced++;\n }\n }\n drawBoard();\n }\n\n function drawBoard() {\n document.body.innerHTML = '';\n\n var i,\n j,\n boardSquare;\n for (i = 0; i < self.dimension; i++) {\n for (j = 0; j < self.dimension; j++) {\n boardSquare = board[i][j];\n boardSquare.draw();\n if (j === self.dimension - 1) {\n document.body.appendChild(document.createElement('br'));\n }\n }\n }\n }\n\n function scanBoardForWin() {\n var i, j,\n boardSquare;\n for (i = 0; i < self.dimension; i++) {\n for (j = 0; j < self.dimension; j++) {\n boardSquare = board[i][j];\n if (boardSquare.flagged ||\n (!boardSquare.opened && !boardSquare.isBomb)) {\n return false;\n }\n }\n }\n return true;\n }\n\n function revealEntireBoard() {\n var i, j,\n boardSquare;\n for (i = 0; i < self.dimension; i++) {\n for (j = 0; j < self.dimension; j++) {\n boardSquare = board[i][j];\n boardSquare.opened = true;\n boardSquare.flagged = false;\n if (!boardSquare.isBomb) {\n boardSquare.adjacentBombs =\n countAdjacentBombs(boardSquare.y, boardSquare.x);\n }\n }\n }\n drawBoard();\n }\n\n /* Next two functions operate on BoardSquares, but takes coords as args?\n * Maybe refactor these */\n function checkNeighbors(y, x) {\n var i, j,\n adjacentX, adjacentY,\n adjacentBombs,\n boardSquare;\n\n adjacentBombs = countAdjacentBombs(y, x);\n board[y][x].adjacentBombs = adjacentBombs;\n board[y][x].opened = true;\n\n if (adjacentBombs == 0) {\n for (i = -1; i <= 1; i++) {\n for (j = -1; j <= 1; j++) {\n adjacentX = x + i;\n adjacentY = y + j;\n if ((adjacentX) > -1 && (adjacentX) < self.dimension\n && (adjacentY) > -1 && (adjacentY) < self.dimension\n && !(adjacentX === x && adjacentY === y)) {\n boardSquare = board[adjacentY][adjacentX];\n if (boardSquare.opened || boardSquare.flagged) {\n continue;\n }\n else {\n checkNeighbors(adjacentY, adjacentX);\n }\n }\n }\n }\n }\n }\n\n function countAdjacentBombs(y, x) {\n var numBombs = 0;\n var i, j,\n adjacentX, adjacentY,\n boardSquare;\n for (i = -1; i <= 1; i++) {\n for (j = -1; j <= 1; j++) {\n adjacentX = x + i;\n adjacentY = y + j;\n if ((adjacentX) > -1 && (adjacentX) < self.dimension\n && (adjacentY) > -1 && (adjacentY) < self.dimension\n && !(adjacentX === x && adjacentY === y)) {\n boardSquare = board[adjacentY][adjacentX];\n numBombs += boardSquare.isBomb && !boardSquare.flagged\n }\n }\n }\n return numBombs;\n }\n }", "title": "" }, { "docid": "fd7cd6b32eda46815a1cda192b3baa0d", "score": "0.56565803", "text": "function renderBoards(usersBoards) {\n if (usersBoards[0] === undefined) {\n $boards = `\n <div class=\"create\">\n <h2>You have no walls!</h2>\n <a class=\"button primary\" href=\"/boards/create\">Create New Wall</a>\n </div>`;\n return $(\"#boards-container\").prepend($boards);\n }\n\n $boards = `\n <div class=\"boards\">\n <h2>My Walls</h2>\n </div>`;\n $(\"#account-nav\").prepend($boards);\n\n for (let i = 0; i < usersBoards.length; i++) {\n $(\"#boards-container\").prepend(createBoards(usersBoards[i], 975 + i));\n }\n\n let $grid = $(\"#boards-container\").imagesLoaded(function() {\n $grid.masonry({\n itemSelector: \".boards\",\n columnWidth: 200,\n horizontalOrder: true,\n percentPosition: true\n });\n });\n }", "title": "" }, { "docid": "f2cc5c0857f8680bed2e96f0dc284479", "score": "0.5656225", "text": "function resetBoard(){\n const url='api/createBoard';\n clearTimeout(t);\n t = setTimeout(add, 1000);\n\n time.innerHTML = \"00:00:00\";\n seconds = 0; minutes = 0; hours = 0;\n rows = $_id(\"rows\").value;\n cols = $_id(\"cols\").value;\n mines = $_id('mines').value;\n userID = $_id(\"userID\").value;\n ended = 0;\n\n message = $_id(\"message\");\n message.innerHTML=\"&nbsp\";\n if(rows < 2 || cols < 2){\n message.innerHTML='The board must have at least 2 rows and 2 columns.';\n message.style.color=\"red\";\n return;\n }\n\n if (mines < 1) {\n message.innerHTML='The board must have at least one mine!';\n message.style.color=\"red\";\n return;\n }\n\n if(mines >= (rows*cols)){\n message.innerHTML=\"Too many mines!!! The maximum number of mines for this board is \"+(rows*cols-1);\n message.style.color=\"red\";\n return;\n }\n\n $.post(url, {\n json_string: JSON.stringify({rows: rows, cols: cols, mines: mines, userID: userID})\n });\n createBoard(rows, cols);\n}", "title": "" }, { "docid": "697547878d0baee25b643d65dcb53dce", "score": "0.56524837", "text": "board() {}", "title": "" }, { "docid": "b0fb7756d5ada80e88df5a1dff1f46a8", "score": "0.56507736", "text": "function createBlankTile () {\n $('.wordarea').append(boardSquareEmpty.clone())\n}", "title": "" }, { "docid": "5affab31078804d6d7d84e451d720903", "score": "0.5650299", "text": "function render(board){\n // Wipe board clean\n DOMBoard.children().remove()\n for (var x = 0; x < board.length; x++){\n for (var y = 0; y < board[x].length; y++){\n // If there is a snake piece to draw, draw it.\n drawSquare(board, x, y);\n }\n }\n }", "title": "" }, { "docid": "282a1fef5077ac57d3fdfb818710e7b1", "score": "0.5646408", "text": "function fullBoard() {\r\n\tfor(var i = 1; i <= 5; i++) // Row\r\n\t\tfor(var j = 1; j <= 6; j++) // Column\r\n\t\t{\r\n\t\t\tboard[i][j].orb = activeColor;\t\r\n\t\t}\r\n\t\trefresh();\r\n}", "title": "" }, { "docid": "b3e1681fafad7af460cf44c1acf49462", "score": "0.56401", "text": "function setBoard()\n{\n\t$(\"#board\").css({\"width\":((190*(rowCards)+10)+\"px\"),\"z-index\":\"0\",\"height\":(90*(rowCards+perfectSquare)+10)+\"px\",\"background-color\":\"rgb(194, 194, 208)\",\"padding\":\"5px\"});\n\tfor(var j=0;j<numCards;j++)\n\t{\n\t\tcardList[j].placeCard();\n\t\tcardList[j].setHist(chosenGraph[j]+1,sampleSize,j, masterParms);\n\t}\n}", "title": "" }, { "docid": "0ecbb02a2d9cb28746ad7604b485deb9", "score": "0.56389153", "text": "updateBoard(snakePosition,fruitPosition){\n this.board.updateBoard(snakePosition,fruitPosition);\n }", "title": "" }, { "docid": "7bd779150eda2d385c8cc8e600052828", "score": "0.5638097", "text": "function updateBoard() {\n // Update text\n signalSnakeIndex(pastSnakes.length, snakeData.length)\n signalTime(timeStep)\n map.clear(pastSnakes.length)\n \n SnakeHeadPosition = activeSnake.getPositionAtTime(timeStep)[0];\n var toCallExit = map.isExit(SnakeHeadPosition[0], SnakeHeadPosition[1])\n var collCoord1 = updateSnakes(4,[activeSnake])\n var collCoord2 = updateSnakes(3,pastSnakes)\n\n if (!(collCoord1 == null && collCoord2 == null)) {\n //game over\n signalEvent(\"You bumped into something else!\")\n lockKeyboard()\n \n // if (collCoord1 != null) {\n // console.log(\"collision1!\",collCoord1[0],collCoord1[1]);\n // var collisionSquare = new Phaser.Rectangle(collCoord1[0] * 100 + 2, collCoord1[1] * 100 + 2, 96, 96);\n // game.debug.renderRectangle(collisionSquare,'#000');\n // } \n\n // if (collCoord2 != null) {\n // console.log(\"collision2!\",collCoord2[0],collCoord2[1]);\n // var collisionSquare = new Phaser.Rectangle(collCoord2[0] * 100 + 2, collCoord2[1] * 100 + 2, 96, 96);\n // game.debug.renderRectangle(collisionSquare,'#000');\n // }\n \n setTimeout(collision, 2050)\n }\n if (toCallExit) {\n lockKeyboard()\n signalEvent(\"You reached an exit!\")\n exitBoard();\n }\n}", "title": "" }, { "docid": "6633fc7f3394aeaebe2c212da137c332", "score": "0.563732", "text": "function drawBoard(boardState){\n //i honestly cant understand my own code anymore. im going to leave this one alone...\n //grab display board\n var displayBoard = $(\"#board\")\n //empty display Board\n displayBoard.empty()\n for(var i=11;i>=0;i--){\n //make rows\n var row = document.createElement(\"tr\")\n for(var j=0;j<6;j++){\n var jTop = ((j+boardState.topPlace)%6);\n var jBottom = ((j+boardState.bottomPlace)%6);\n //make cols (aka cells)\n var cell = document.createElement(\"td\")\n $(cell).css({\n height: 30,\n width: 30,\n \"text-align\": \"center\",\n backgroundColor: \"orange\",\n })\n\n //top board\n if(i>5){\n $(cell).text(boardState.top[jTop][i-6])\n $(cell).css({\n backgroundColor: colorList[boardState.top[jTop][i-6]],\n })\n }\n //bottom board\n else{\n $(cell).text(boardState.bottom[jBottom][5-i])\n $(cell).css({\n backgroundColor: colorList[boardState.bottom[jBottom][5-i]],\n })\n }\n\n $(row).append(cell)\n //add col to row\n }\n displayBoard.append(row)\n //add row to display\n }\n return 0;\n}", "title": "" }, { "docid": "a65a342f471672a14f4c542e18959690", "score": "0.5635072", "text": "emptyBoardAddPieces() {\n // empty board i.e. clear columns\n const cols = [...this.DOMBoard.firstElementChild.children].slice(\n 0,\n this._cols\n );\n cols.forEach(col => (col.innerHTML = ''));\n // add pieces\n cols.forEach((col, i) => {\n col.innerHTML = this.pieceFactory(i);\n fadePieceIn(i);\n });\n }", "title": "" }, { "docid": "84f2faa79f8c29c83b7d4d3df537971a", "score": "0.5626965", "text": "large() {\n //return this.validatedBoard(9, 6);\n return this.validatedBoard(9, 6);\n }", "title": "" }, { "docid": "827dfb25c92f67bc40a50a8ea933017f", "score": "0.562131", "text": "function Board(player_color, next_color, game, boards, onClick, onDismiss) {\n const white_id = game[\"white\"][0];\n const black_id = game[\"black\"][0];\n const white_player = game[\"white\"][1];\n const black_player = game[\"black\"][1];\n const dimension = game.dimension.toNumber();\n const last = boards.length > 1 ? boards[0].board : null;\n const board = boards.length > 1 ? boards[1].board : boards[0].board;\n const animate_list = [];\n console.log(\"Redraw board \" + boards.length);\n\n const dot_start = \"white\" in next_color ? boardLength - 90 : 10;\n const dot_color = \"white\" in next_color ? \"#fff\" : \"#000\";\n let dots = [];\n let dotsHeight = 20;\n\n // Only draw dots if result is not out yet\n if (game[\"result\"].length == 0) {\n for (var i = 0; i < 5; i++) {\n dots.push(\n m(\n \"circle.dot\",\n {\n cx: dot_start + i * 20,\n cy: dotsHeight / 2,\n r: 6,\n fill: dot_color\n },\n m(\"animate\", {\n attributeName: \"opacity\",\n dur: \"2s\",\n values: \"0;1;0\",\n repeatCount: \"indefinite\",\n begin: 0.3 + i * 0.3,\n restart: \"whenNotActive\",\n id: \"dot-\" + i\n })\n )\n );\n }\n }\n\n const cellSize = Math.floor(boardLength / dimension);\n let cells = [];\n cells.push(\n m(\"defs\", [\n m(\"filter\", { id: \"shadow-0\" }, [\n m(\"feDropShadow\", { dx: 2, dy: 4, stdDeviation: 0.5 })\n ]),\n m(\"filter\", { id: \"shadow-45\" }, [\n m(\"feDropShadow\", { dx: 4.22, dy: 1.46, stdDeviation: 0.5 })\n ]),\n m(\"filter\", { id: \"shadow-90\" }, [\n m(\"feDropShadow\", { dx: 4, dy: -2, stdDeviation: 0.5 })\n ]),\n m(\"filter\", { id: \"shadow-135\" }, [\n m(\"feDropShadow\", { dx: 1.46, dy: -4.22, stdDeviation: 0.5 })\n ])\n ])\n );\n\n const my_piece = \"black\" in player_color ? \"*\" : \"O\";\n let hintColor = my_piece == \"O\" ? \"#ddd\" : \"#000\";\n let hintOn = same_color(player_color, next_color);\n let hintStrokeWidth = my_piece == \"O\" ? 1 : 2;\n for (var row = 0; row < dimension; row++) {\n for (var col = 0; col < dimension; col++) {\n const idx = row * dimension + col;\n const value = board[idx];\n const nextMove =\n hintOn && validMove(dimension, board, my_piece, row, col);\n let attrs = {\n x: col * cellSize,\n y: row * cellSize,\n width: cellSize,\n height: cellSize,\n style: {\n fill: \"#060\",\n stroke: \"#000\",\n strokeWidth: 1\n },\n id: idx\n };\n if (value == \".\" && nextMove) {\n attrs[\"onclick\"] = onClick;\n }\n cells.push(m(\"rect\", attrs));\n\n if (value == \".\") {\n // if valid move is possible at (row, col), draw dotted circle.\n if (nextMove) {\n cells.push(\n m(\"circle\", {\n cx: col * cellSize + cellSize * 0.5,\n cy: row * cellSize + cellSize * 0.5,\n r: cellSize * 0.4,\n stroke: hintColor,\n \"stroke-dasharray\": 4,\n \"stroke-width\": hintStrokeWidth,\n \"stroke-opacity\": 0.6,\n fill: \"none\"\n })\n );\n }\n } else {\n let pieceColor = value == \"O\" ? \"#fff\" : \"#000\";\n let opponentColor = value == \"O\" ? \"#000\" : \"#fff\";\n let strokeColor = value == \"O\" ? \"#333\" : \"#888\";\n let elems = [];\n let radius = cellSize * 0.4;\n let degree = 0;\n if (last != null && last[idx] != value) {\n //console.log([row, col, last[idx], value]);\n if (last[idx] == \".\") {\n elems.push(\n m(\"animate\", {\n attributeName: \"rx\",\n begin: \"indefinite\",\n dur: \"0.2s\",\n repeatCount: \"1\",\n from: cellSize * 0.1,\n to: radius,\n fill: \"freeze\"\n })\n );\n elems.push(\n m(\"animate\", {\n attributeName: \"ry\",\n begin: \"indefinite\",\n dur: \"0.2s\",\n repeatCount: \"1\",\n from: cellSize * 0.1,\n to: radius,\n fill: \"freeze\"\n })\n );\n radius = cellSize * 0.1;\n animate_list.push(\"animate-\" + idx);\n } else {\n elems.push(\n m(\"animate\", {\n attributeName: \"rx\",\n begin: \"indefinite\",\n dur: \"0.4s\",\n repeatCount: \"1\",\n values: [radius, radius, \"0\", radius].join(\";\"),\n fill: \"freeze\"\n })\n );\n elems.push(\n m(\"animate\", {\n attributeName: \"fill\",\n begin: \"indefinite\",\n dur: \"0.4s\",\n repeatCount: \"1\",\n values: [opponentColor, opponentColor, \"#888\", pieceColor].join(\n \";\"\n ),\n fill: \"freeze\"\n })\n );\n pieceColor = opponentColor;\n let dy = boards[1].row - row;\n let dx = boards[1].col - col;\n if (dx == 0) {\n degree = 90;\n } else if (dy == 0) {\n degree = 0;\n } else if (dx < 0) {\n degree = dy > 0 ? 135 : 45;\n } else {\n degree = dy > 0 ? 45 : 135;\n }\n }\n }\n const cx = col * cellSize + cellSize * 0.5;\n const cy = row * cellSize + cellSize * 0.5;\n cells.push(\n m(\n \"ellipse.no-flicker\",\n {\n cx: cx,\n cy: cy,\n rx: radius,\n ry: radius,\n stroke: strokeColor,\n \"stroke-width\": 2,\n \"stroke-opacity\": 0.4,\n fill: pieceColor,\n filter: \"url(#shadow-\" + degree + \")\",\n transform: \"rotate(\" + degree + \" \" + cx + \" \" + cy + \")\"\n },\n elems\n )\n );\n }\n }\n }\n\n // Show game result if it has ended\n if (game[\"result\"].length != 0) {\n cells.push(\n m(\"rect\", {\n x: boardLength / 8,\n y: boardLength / 4,\n width: (boardLength * 3) / 4,\n height: boardLength / 2,\n style: {\n fill: \"#685\",\n stroke: \"#000\",\n strokeWidth: 3\n },\n onclick: onDismiss\n })\n );\n cells.push(\n m(\n \"text.score\",\n {\n x: \"50%\",\n y: \"50%\",\n \"dominant-baseline\": \"middle\",\n \"text-anchor\": \"middle\"\n },\n [\n m(\"tspan\", { fill: \"black\" }, game.result[0][\"black\"].toNumber()),\n \" : \",\n m(\"tspan\", { fill: \"white\" }, game.result[0][\"white\"].toNumber())\n ]\n )\n );\n }\n\n // Need to kick start animate element for svg, otherwise animation\n // will only show once and then stop running, even when new animate\n // elements are created. This is likely due to mithril caching, not\n // sure if there is an alternative work-around.\n clearTimeout(animateTimeout);\n if (animate_list) {\n animateTimeout = setTimeout(function() {\n document.querySelectorAll(\"animate\").forEach(function(animate) {\n if (!animate.id.startsWith(\"dot\")) {\n animate.beginElement();\n }\n });\n setTimeout(function() {\n if (boards.length > 1) {\n boards.shift();\n if (boards.length > 1) {\n m.redraw();\n }\n }\n }, 300);\n }, 0);\n } else {\n if (boards.length > 1) {\n boards.shift();\n if (boards.length > 1) {\n m.redraw();\n }\n }\n }\n\n return [\n m(\"div.players\", { style: { width: boardLength + \"px\" } }, [\n m(\"span.black-player\", black_player),\n m(\"span.white-player\", white_player)\n ]),\n m(\"svg.dots\", { width: boardLength, height: dotsHeight }, dots),\n m(\"svg.board\", { width: boardLength, height: boardLength }, cells),\n m(\"h1.dimension\", dimension + \" × \" + dimension)\n ];\n}", "title": "" }, { "docid": "78b2033d659afd3795305608115f40b3", "score": "0.56206244", "text": "function placeFlag(location)\n{\n$.ajax(\n {\n //json data being sent\n datatype: 'json',\n method: 'POST',\n //using the method on right button click inside the minesweeper controller \"On right button click\"\n url: '/Minesweeper/OnRightButtonClick',\n data:\n {\n //sending the location of the button\n \"location\": location\n },\n //if successful data will be logged\n success: function (data) {\n console.log(data)\n $('#board').html(data)\n }\n });\n}", "title": "" }, { "docid": "cb64e875f38d923b34278afa372a7708", "score": "0.5620184", "text": "function gol_drawEmptyBoard(){\n gol_drawBackground();\n gol_drawEmptyLife();\n }", "title": "" }, { "docid": "519bfacbb6253a864c3e045b0d5129e7", "score": "0.56149274", "text": "function make_tileboard_html() {\n $.ajax({\n dataType: 'json',\n mimeType: 'application/json',\n url: `geometry/${board_layout.boardtype}`,\n success: make_tileboard_segment_html,\n error: make_tileboard_default_html,\n });\n}", "title": "" }, { "docid": "67ec23c055c0a01475b6390a4c2ac326", "score": "0.5611035", "text": "function clearBoard() {\n \t\t\tself.game[0].turn = 0\n \t\t\tself.game[0].message = \"\";\n \t\t\tself.game[0].winner = false;\n \t\t\tself.game.$save(self.game[0]);\n \t\tfor(var i =0; i<9; i++) {\n \t\t\tself.grid[i].select = \"empty\";\n \t\t\tself.grid.$save(i);\n\n\t\t}\n \t}", "title": "" }, { "docid": "38ebc04793860f03a630db3163616174", "score": "0.5602059", "text": "function play(px,py) {\n\t\n\t\tif((px >= 0 && py >= 0) && (px < gridSize && py < gridSize)) { // if the square asked for exists\n\t\n\t\t\tif(structure[py][px][\"state\"] == \"hidden\") { // and it is not yet unearthed nor flaged…\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(structure[py][px][\"around\"] == 0) { // in case it is an empty cell\n\t\t\t\t\t\n\t\t\t\t\t\treveal(px,py); // reveal it\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tstructure[py][px][\"state\"] = \"unearthed\";\t// mark it as unearthed\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tsquaresToWin--; // (one less hidden square)\n\t\t\t\t\t\t\n\t\t\t\t\t\t//and reveal the contiguous squares\n\t\t\t\t\t\tplay(px-1,py-1);\n\t\t\t\t\t\tplay(px,py-1);\n\t\t\t\t\t\tplay(px+1,py-1);\n\t\t\t\t\t\tplay(px-1,py);\n\t\t\t\t\t\tplay(px+1,py);\n\t\t\t\t\t\tplay(px-1,py+1);\n\t\t\t\t\t\tplay(px,py+1);\n\t\t\t\t\t\tplay(px+1,py+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\t\n\t\t\t\t\telse if(structure[py][px][\"around\"] > 0) { // in case it has one or more mines around\n\t\t\t\t\t\t\n\t\t\t\t\t\treveal(px,py);\n\t\t\t\t\t\t\n\t\t\t\t\t\tstructure[py][px][\"state\"] = \"unearthed\";\n\t\t\t\t\t\tsquaresToWin--;\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\telse { // in case it is mined\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar canvas = document.getElementById(\"minesweeper\");\n\t\t\t\t\t\tvar context = canvas.getContext(\"2d\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Mark the one that has blown up with a red backgorund */\n\t\t\t\t\t\tcontext.beginPath();\n\t\t\t\t\t\tcontext.fillStyle = \"#FF0000\";\n\t\t\t\t\t\tcontext.fillRect((structure[py][px][\"x1\"]+1),(structure[py][px][\"y1\"]+1),(BLOCK_SIZE-2),(BLOCK_SIZE-2));\n\t\t\t\t\t\tcontext.closePath();\t\t\t\t\t\t\n\t\t\t\t\t\tcontext.globalAlpha = 0.8;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\treveal(px,py);\n\t\t\t\t\t\tcontext.globalAlpha = 0.6;\n\t\t\t\t\t\t\n\t\t\t\t\t\tstructure[py][px][\"state\"] = \"blown\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tend(\"lost\"); // you have stepped on a mine and therefore the game is over\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\n\t\t\t\ttrackProgress(); // check if this movement is the one that makes you win\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t}", "title": "" }, { "docid": "11b261fe51f0796988c7597c304ac494", "score": "0.5599562", "text": "function getBoard() {\n console.log(\"getBoard was called\");\n return board;\n}", "title": "" }, { "docid": "bf22074e712434fef176bce2e9666f37", "score": "0.5599051", "text": "function revealBoard(board) {\r\n for (var i = 0; i < gLevel.SIZE; i++) {\r\n for (var j = 0; j < gLevel.SIZE; j++) {\r\n board[i][j].isRevealed = true;\r\n renderCell(null, i, j);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "be96bb77ef997be1d570016361e5b15d", "score": "0.5589236", "text": "function updateBoard() {\n\t\tif (running) {\n\t\t\tnewStatus = [];\n\t\t\tfor (var i = 0; i < BOARD_SIZE; i++) {\n\t\t\t\tnewStatus[i] = [];\n\t\t\t\tfor (var j = 0; j < BOARD_SIZE; j++) {\n\t\t\t\t\tnewStatus[i][j] = 0;\n\t\t\t\t\tupdateCell($(\"#\" + i + \"_\" + j));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$(\"#generation\").text(++generation);\n\t\t\tboardStatus = newStatus.slice(0);\n\t\t}\n\t}", "title": "" }, { "docid": "24df700516fbd6353f04e6e153724213", "score": "0.5586647", "text": "emptyBoard() {\n this.pieces = []\n }", "title": "" }, { "docid": "bebb9dfe0277f1587861947c60cf6371", "score": "0.55857795", "text": "tick() {\n const newBoard = this.makeBoard();\n\n for(let r=0; r<this.height; r++){\n for(let c=0; c<this.width; c++){\n newBoard[r][c] = this.getCell(r, c);\n if(this.getCell(r, c) === 0){\n if(this.livingNeighbors(r, c) === 3) {\n newBoard[r][c]=1;\n }\n }\n else{\n if(this.livingNeighbors(r, c)<2 || this.livingNeighbors(r, c)>3) {\n newBoard[r][c]=0;\n }\n }\n }\n }\n this.board = newBoard;\n }", "title": "" }, { "docid": "0cd768a56825545a38c698b3e8c5b55e", "score": "0.5581998", "text": "function main(){\n chessBoard();\n lastRow();\n}", "title": "" }, { "docid": "8f4ca09a992e3f72dbac27733f331a31", "score": "0.5578545", "text": "function clearBoard(){\n changeBoardSize();\n drawMap();\n}", "title": "" }, { "docid": "7ab30a309ed80178355e27cf6dfeb94c", "score": "0.5568516", "text": "function Board() {\n}", "title": "" }, { "docid": "3aebf0c4b70f41a35c8f128cdbda641f", "score": "0.5566412", "text": "function constructBoard(board) {\n var output = \"\" +\n \"<thead>\" +\n \"<tr><th><th>0<th>1<th>2<th>3<th>4<th>5<th>6<th>7\" +\n \"<tbody>\";\n var nbLigne = 0;\n\n board.forEach(function (ligne) {\n output += \"<tr class='row'><th>\" + nbLigne;\n\n var nbColumn = 0;\n ligne.forEach(function (element) {\n\n //Noir\n if (element == 2) {\n //&#9823;\n output += \"<td class='tile' align='center' id='\" + nbColumn + \"_\" + nbLigne + \"'><img src='img/noirPion.png' class='piece blackPawn'/></td>\";\n }\n //Blanc\n else if (element == 1) {\n //&#9817;\n output += \"<td class='tile' align='center' id='\" + nbColumn + \"_\" + nbLigne + \"'><img src='img/blancPion.png' class='piece whitePawn'/></td>\";\n }\n //Blanc Reine\n else if (element == 3) {\n //&#9817;\n output += \"<td class='tile' align='center' id='\" + nbColumn + \"_\" + nbLigne + \"'><img src='img/blancQueen.png' class='piece whitePawn'/></td>\";\n }\n //Noir Reine\n else if (element == 4) {\n //&#9817;\n output += \"<td class='tile' align='center' id='\" + nbColumn + \"_\" + nbLigne + \"'><img src='img/noirQueen.png' class='piece whitePawn'/></td>\";\n }\n else {\n output += \"<td class='tile' align='center' id='\" + nbColumn + \"_\" + nbLigne + \"'></td>\";\n }\n nbColumn++;\n\n });\n nbLigne++;\n });\n $('#board').children('table').html(output);\n}", "title": "" }, { "docid": "99c87e53d4713bcb753ccf225167df63", "score": "0.5563783", "text": "function setUpWalls() {\r\n var x = Math.random();\r\n if(x <= 0.33)\r\n map1(board, dark_side_board);\r\n else if (x <= 0.66)\r\n map2(board, dark_side_board);\r\n else\r\n map3(board, dark_side_board);\r\n}", "title": "" }, { "docid": "bf28ac70858617355b575ecb8f30c269", "score": "0.5562875", "text": "function verifyBoard( mbrd ) {\n\tif ( !mbrd ) { mbrd = board; }\n\tfor ( var i = 0; i < height; i++ ) {\n\t\tfor ( var j = 0; j < width; j++ ) {\n\t\t\tif ( !mbrd[i][j].revealed ) { continue; }\n\t\t\tvar sm = mbrd[i][j].surroundingMines;\n\t\t\tvar gac = getAdjacentCondition( i, j, function(a,b){return mbrd[a][b].isMine;}, mbrd).length;\n\t\t\tif ( mbrd[i][j].surroundingMines == getAdjacentCondition( i, j, \n\t\t\t\tfunction(a,b){return mbrd[a][b].isMine;}, mbrd ).length ) { \n\t\t\t\tcontinue; }\n\t\t\t// if something still is out of place, call reshuff\n\t\t\treturn mbrd[i][j];\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "36beaefe71e4e5d47952f93f0f192e9b", "score": "0.5548182", "text": "function createBoard(){\n // Tile loop\n\n // for the color change on the 3x3 Blocks\n let threePartSectionx = 0;\n let threePartSectiony = 0;\n\n for (let x = lineBetweenx; x <= width - tileWidth; x += tileWidth + lineBetween){\n\n for (let y = lineBetweeny; y <= height - tileHeight; y += tileHeight + lineBetween){\n\n // Tilecreation\n if (threePartSectionx > 2 && threePartSectionx < 6 && (threePartSectiony < 3 || threePartSectiony > 5) || ((threePartSectionx < 3 || threePartSectionx > 5) && threePartSectiony > 2 && threePartSectiony < 6)) {\n chessTiles(TileColorbrighter, x, y, tileWidth, tileHeight);\n }else {\n chessTiles(TileColordarker, x, y, tileWidth, tileHeight);\n }\n\n threePartSectiony++;\n }\n threePartSectiony = 0;\n threePartSectionx++;\n }\n}", "title": "" }, { "docid": "d2fdd65e3fc94760226a428ac9a5d807", "score": "0.554807", "text": "function check_board_full() {\n let flag = true;\n board.forEach(e => {if (e==\"\") {flag = false}});\n is_board_full = flag;\n}", "title": "" }, { "docid": "df6c8bfbd0af053b4c60020bbbdfe334", "score": "0.5547402", "text": "function startBoard(){\n\n for (let y = 0; y < NUM_ROWS; y++){\n for (let x = 0; x < NUM_COLS; x++){\n let bOrW = int(random(2));\n if (bOrW === 1){\n gridData[y][x] = 255;\n }\n else{\n gridData[y][x] = 0;\n }\n }\n }\n}", "title": "" }, { "docid": "a4ed28d8789fabd76455fd9c1c485389", "score": "0.5528804", "text": "function makeBoard(){\r\n var b = [\r\n ['wall','wall','wall','wall','wall','wall'],\r\n ['wall',null,null,null,null,'wall'],\r\n ['wall',null,null,null,null,'wall'],\r\n ['wall',null,null,null,null,'wall'],\r\n ['wall',null,null,null,null,'wall'],\r\n ['wall','wall','wall','wall','wall','wall']\r\n ];\r\n addItem(b);\r\n addItem(b);\r\n return b;\r\n}", "title": "" }, { "docid": "a5ea5f8aa397d88c573221c08e0e228d", "score": "0.5524475", "text": "function placeHolesBoard($level) {\n $(\"#board\").empty();\n for ($i = 0; $i < Math.pow($level, 2); $i++) {\n $div = $(\"<div></div>\");//attr(\"id\",`mole_${$i+1}`);\n $img = $(\"<img>\").attr({ \"src\": `img/${$imgsTheme.default}`, \"id\": `mole_${$i + 1}` });\n $($img).click(function () { updateScore(this) });\n $($div).append($img);\n $(\"#board\").append($div);\n }\n}", "title": "" }, { "docid": "be7711e30b3038498b2b5411abb1ae6a", "score": "0.55236465", "text": "function BoardList(params) {\n /*Assign external parameter to private variable*/\n for (var item in params) {\n if (typeof (_private[item]) != typeof (undefined)) {\n _private[item] = params[item];\n }\n }\n _model.ShowMore = ShowMore;\n /*Data binding*/\n ApplyBinding();\n // RetrieveMyBoard(null);\n /*Init jquery control*/\n // InitControl();\n }", "title": "" }, { "docid": "f3331044992c13678a30f0608c027a00", "score": "0.5519368", "text": "function newBoard() {\n\tfor (var i = 0; i < 9; i++) {\n\t\tgameData.boardData[i] = \" \";\n\t}\n}", "title": "" }, { "docid": "d0aa7de9ecfdad6b619b3c34a851c72b", "score": "0.5517071", "text": "function updateBoard(playerSide, userTiles, computerSide, computerTiles, availableTiles){\r\n for (let userTileIndex = 0; userTileIndex < userTiles.length; userTileIndex++){\r\n let tileID = \"tile\" + userTiles[userTileIndex];\r\n document.getElementById(tileID).textContent = playerSide;\r\n }\r\n for (let computerTileIndex = 0; computerTileIndex < computerTiles.length; computerTileIndex++){\r\n let tileID = \"tile\" + computerTiles[computerTileIndex];\r\n document.getElementById(tileID).textContent = computerSide;\r\n }\r\n for (let availableTileIndex = 0; availableTileIndex < availableTiles.length; availableTileIndex++){\r\n let tileID = \"tile\" + availableTiles[availableTileIndex];\r\n document.getElementById(tileID).textContent = \"\";\r\n }\r\n}", "title": "" }, { "docid": "676f3d7af55ddbe717be827f00222c83", "score": "0.5516739", "text": "small() {\n return this.validatedBoard(4, 4);\n }", "title": "" }, { "docid": "32fba0549f43c45ab4521b000a6ee39e", "score": "0.55156666", "text": "function drawBoard(columns, rows, board) {\n\n for (var i = 0; i < columns; i++) {\n for (var j = 0; j < rows; j++) {\n var x = i * gridResolution;\n var y = j * gridResolution;\n if (board[i][j]==true) {\n ctx.fillStyle= \"black\";\n ctx.fillRect(x, y, gridResolution, gridResolution);\n\n }\n else{\n ctx.fillStyle= \"white\";\n ctx.fillRect(x, y, gridResolution, gridResolution);\n }\n }\n }\n\n }", "title": "" }, { "docid": "a8914a567a597536dd6af4d271cacfa8", "score": "0.5513452", "text": "function changeBoardSize(){\n level.board = generateBoard($(\"#sldRows\").val(), $(\"#sldCols\").val());\n displaySliderValues();\n addCanvas();\n}", "title": "" }, { "docid": "661d632a2c5413321630636cf7d1e18d", "score": "0.55125", "text": "function getNextGeneration() {\n $(document).ready(function() {\n $.ajax({\n url: \"http://localhost:8090/backend/next-generation/\" + boardSize,\n type: \"POST\",\n data: JSON.stringify(actualCells),\n contentType: 'application/json',\n success: function(data) {\n paintCanvas(actualCells, \"white\");\n paintCanvas(data, \"black\");\n }\n })\n });\n}", "title": "" }, { "docid": "686051ca98fb348ca258446f443f08bf", "score": "0.5512267", "text": "function checkForBoard() {\n // If the page has columns, we can generate points\n if ($(columnContainerSelector).length) {\n // Trigger the generation of points\n generatePoints();\n }\n }", "title": "" }, { "docid": "3845f0d67b358a8394ec2a45fd431234", "score": "0.55095285", "text": "function placeWumpus() {\n tempX = Math.floor(Math.random() * (board.length));\n tempY = Math.floor(Math.random() * (board[0].length));\n board[tempX][tempY] = 9;\n board[rowEdge(tempX + 1)][tempY] = 7;\n board[rowEdge(tempX - 1)][tempY] = 7;\n board[tempX][colEdge(tempY + 1)] = 7;\n board[tempX][colEdge(tempY - 1)] = 7;\n}", "title": "" }, { "docid": "33ab559785f41e8612ebda09ff81fac7", "score": "0.55053675", "text": "function displaySetupBoard(board, boardShipsPlaced) {\n // Creates the board div\n document.body.innerHTML = ''\n let boardDiv = document.createElement('div')\n boardDiv.id = 'board'\n document.body.append(boardDiv)\n\n // Creates the banner displaying which player's turn it is\n makeElement('div', 'board', { id: 'player', innerHTML: 'PLAYER ' + currentPlayer})\n\n // Creates a div for whenever whitespace is required\n makeElement('div', 'board', { className: 'blank'} )\n\n for (let i = 1; i < 11; i++) {\n makeElement('div', 'board', { className: 'blank', innerHTML: i })\n }\n\n // Initialises the letter used for the ID's of each grid item\n letter = 'a'\n\n // Iterates through the rows from A to J\n for (let i = 0; i < 10; i++) {\n makeElement('div', 'board', { className: 'blank', innerHTML: letter.toUpperCase() })\n\n // Iterates through the elements of the row from 1 to 10\n for (let j = 1; j < 11; j++) {\n // If there is no ship on the board at this location, the div ID\n // is created with the appropriate letter+number combination\n if (board[letter][j] === ' ') {\n id = letter + j\n makeElement('div', 'board', { id: id, className: id, onclick: (item) => clickBoardClear(item, board, boardShipsPlaced) })\n }\n // If the board contains a ship at the location, the ID is set as 'ship'\n // and the CSS makes the square black\n else if (board[letter][j] === 'S') {\n id = letter + j\n makeElement('div', 'board', { id: 'ship', className: id, onclick: (item) => clickBoardShip(item, board, boardShipsPlaced) })\n }\n }\n\n // This changes the letter to the next letter of the alphabet\n letter = String.fromCharCode(letter.charCodeAt(0) + 1)\n }\n\n // This displays the sidebar containing the ships to be placed\n displayAvailableShips(boardShipsPlaced)\n}", "title": "" }, { "docid": "f69ea033e486c04f0383c3b0584dc673", "score": "0.55050594", "text": "function draw_board(){\r\n for(r = 0; r < ROW; r++){\r\n for(c = 0; c < COL; c++){\r\n draw_square(c,r,board[r][c]);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "16fc4e5d4df076968b251fe5ade8fdc3", "score": "0.5503494", "text": "function load_obstacles() {\n var i;\n switch (scope.stage % 8) {\n case 2:\n for (i = Math.round(dimension[0] / 4); i < Math.round(dimension[0] - dimension[0] / 4); i++) {\n playing_field.add(new Wall(i, Math.round(dimension[1] / 2)));\n }\n break;\n case 3:\n for (i = Math.round(dimension[1] / 4); i < Math.round(dimension[1] - dimension[1] / 4); i++) {\n playing_field.add(new Wall(Math.round(dimension[0] / 4), i));\n playing_field.add(new Wall(Math.round(dimension[0] - dimension[0] / 4), i));\n }\n break;\n case 4:\n for (i = 0; i < Math.round(dimension[0] / 3); i++) {\n playing_field.add(new Wall(i, Math.round(dimension[1] / 3)));\n playing_field.add(new Wall(dimension[0] - i, Math.round(2 * dimension[1] / 3)));\n }\n for (i = 0; i < Math.round(dimension[1] / 3); i++) {\n playing_field.add(new Wall(Math.round(dimension[0] / 3), dimension[1] - i));\n playing_field.add(new Wall(Math.round(2 * dimension[0] / 3), i));\n }\n break;\n case 5:\n for (i = 0; i < Math.round(4 * dimension[0] / 9); i++) {\n playing_field.add(new Wall(i, Math.round(dimension[1] / 2)));\n playing_field.add(new Wall(dimension[0] - i, Math.round(dimension[1] / 2)));\n }\n break;\n case 6:\n for (i = Math.round(dimension[1] / 5); i < Math.round(4 * dimension[1] / 5); i++) {\n playing_field.add(new Wall(Math.round(4 * dimension[0] / 5), i));\n playing_field.add(new Wall(Math.round(3 * dimension[0] / 5), i));\n playing_field.add(new Wall(Math.round(2 * dimension[0] / 5), i));\n playing_field.add(new Wall(Math.round(dimension[0] / 5), i));\n }\n break;\n case 7:\n for (i = Math.round(dimension[1] / 8); i < Math.round(3 * dimension[1] / 5); i++) {\n playing_field.add(new Wall(Math.round(dimension[0] / 3), dimension[1] - i));\n playing_field.add(new Wall(Math.round(2 * dimension[0] / 3), i));\n }\n for (i = Math.round(dimension[0] / 8); i < Math.round(3 * dimension[0] / 5); i++) {\n playing_field.add(new Wall(i, Math.round(dimension[1] / 3)));\n playing_field.add(new Wall(dimension[0] - i, Math.round(2 * dimension[1] / 3)));\n }\n break;\n case 0:\n for (i = 0; i < Math.round(dimension[1]); i += 2) {\n playing_field.add(new Wall(Math.round(dimension[0] / 2), i));\n }\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "15acb0e5a38d0eff6c5ed18f37bdd9a4", "score": "0.5502979", "text": "constructor(turn, wai, bai) {\n this._turn = turn;\n this._winner = null;\n this._piecelocations = []; \n this._check = false; \n this._wai = wai; \n this._bai = bai; \n /* Creating 2 dimentional Array **/\n this._board = new Array(8);\n for (let i = 0; i < 8; i++) {\n this._board[i] = new Array(8);\n }\n for (let i = 0; i < 8; i++) {\n for (let j = 0; j < 8; j++) {\n var bumpy = i + 1; \n var bumpx = j + 1; \n var piece = document.getElementById(bumpx.toString() + bumpy.toString()).innerHTML;\n this._board[i][j] = new Place(piece);\n if (piece != \"\") {\n this._piecelocations.push(j.toString() + i.toString());\n } \n } \n }\n this._blackmoves = this.blackmoves(); \n this._whitemoves = this.whitemoves();\n this._undostack = []; \n\n }", "title": "" }, { "docid": "49aae206309dd01efbd3c1fbe69fadea", "score": "0.55020046", "text": "function replaceBoard() {\n let n = document.querySelector('#board-size').value;\n if (n === '') return window.alert('Board inválido!');\n deleteBoard();\n n = cropBoardSize(Number(n));\n createBoard(n);\n}", "title": "" }, { "docid": "0a8bb6b12ffad1e34e1de56f144a7081", "score": "0.5491623", "text": "function resetBoard (board) {\n for (row=0; row<HEIGHT; ++row){\n for (col=0; col<WIDTH; ++col) {\n // Reset cell data\n board.boardData[row][col].mine = 0;\n board.boardData[row][col].neighbors = 0;\n board.boardData[row][col].clicked = 0;\n board.boardData[row][col].flag = 0;\n\n // Reset display\n board.boardDisplay.rows[row].cells.item(col).innerHTML = UNCLICKED;\n board.boardDisplay.rows[row].cells.item(col).style.backgroundColor = \"#b3d1ff\";\n }\n }\n setMines(board);\n}", "title": "" }, { "docid": "bce4b2bec567bb912f0e38ba9d8167f7", "score": "0.54809695", "text": "board(){\n for(var i = 0; i<9; i++){ this.grid[i] = i; }\n var posX = 225, posY = 50;\n this.grid.sort(function() { return Math.random() - 0.1})\n for(var i=0;i<this.grid.length;i++){\n if((this.grid[i] + 1) != 9){\n this.aux = this.add.image(posX,posY,'p'+(this.grid[i]+1)).setOrigin(0,0).setDepth(2).setInteractive();\n this.input.setDraggable(this.aux);\n this.aux.name = this.grid[i] + 1;\n this.grid[i] = this.aux.name;\n this.pieces[i] = this.aux;\n }else{\n this.black = this.add.image(posX,posY,'space').setOrigin(0,0).setDepth(2).setInteractive();\n this.black.input.dropZone = true;\n this.black.name = this.grid[i] + 1;\n this.grid[i] = this.black.name;\n this.pieces[i] = this.black;\n }\n posX += 200;\n if((i+1)%3 == 0){ posY += 100; posX = 225; } \n }\n }", "title": "" }, { "docid": "7432f959a55b3944a7280f88c27e07cc", "score": "0.5479185", "text": "function displayBoard() {\n console.log(`Board is now: ${traverseAndStringifyTiles(board.left)}`.trim());\n}", "title": "" }, { "docid": "757d533771b6f0270b2b8bb3cec6f3bb", "score": "0.54779375", "text": "function setBoard(sudokuBoard) {\r\n return setBoardVeryDifficult(sudokuBoard);\r\n}", "title": "" }, { "docid": "557b549657b2ff1fc1317007871dc759", "score": "0.5476117", "text": "function createBoard() {\n\t\tfor(let i = 0; i < 15; i++) { // 15 squares needs to be created\n\t\t\tlet puzzlePiece = document.createElement(\"div\");\n\t\t\tlet pieceNumber = document.createTextNode(i + 1);\n\t\t\tpuzzlePiece.className = \"pieces\";\n\t\t puzzlePiece.style.backgroundImage = \"url(background.JPG)\";\n\t\t\tpuzzlePiece.style.top = \n\t\t\t\t(i - (Math.floor(i / 4) * 4)) * 100 + \"px\"; \n\t\t\t\t// 4 is length& width of board\n\t\t\tpuzzlePiece.style.left = \n\t\t\t\t(Math.floor(i / 4) * 100) + \"px\"; \n\t\t\t\t// 100 is size of each puzzle piece\n\t\t\tlet position = (-puzzlePiece.style.top) + \n\t\t\t\t(-puzzlePiece.style.left); \n\t\t\tpuzzlePiece.style.backgroundPosition = position;\n\t\t\t$(\"puzzle-area\").appendChild(puzzlePiece).\n\t\t\t\tappendChild(pieceNumber);\n\t\t\tpuzzlePiece.onclick = function() {\n\t\t\t\tmovePuzzlePiece(puzzlePiece);\n\t\t\t};\n\t\t\tpuzzlePiece.onmouseover = highlightMouseHover; \n\t\t\tpuzzlePiece.onmouseout = backToBlack; \n\t\t\t$(\"shuffle-button\").onclick = shuffle;\n\t\t}\n }", "title": "" }, { "docid": "d53cb165806e26780bee0b29fa89a514", "score": "0.54719764", "text": "function displayBoard(newBoard){\n\ttileHolder = document.createDocumentFragment();\n\n\tfor(var w = 1; w <= newBoard.width; w++){\n\t\tfor(var h = 1; h <= newBoard.height; h++){\n\t\t\t//build our pure JS object before sticking it on the board\n\t\t\ttileHolder.appendChild(newBoard.tiles[w][h].element);\n\t\t}\n\t}\n\n\t//Set our tiles into our map\n\t//Put our tile on the screen\n\t$map.appendChild(tileHolder);\n}", "title": "" }, { "docid": "671fe7e0333e3314bcf413791f9c6ce2", "score": "0.5460155", "text": "function load_obstacles() {\n var i;\n switch (scope.stage%8) {\n case 2:\n for ( i = Math.round(dimension[0]/4); i < Math.round(dimension[0]-dimension[0]/4); i++) {\n playing_field.add(new Wall(i,Math.round(dimension[1]/2)));\n } \n break;\n case 3:\n for ( i = Math.round(dimension[1]/4); i < Math.round(dimension[1]-dimension[1]/4); i++ ) {\n playing_field.add(new Wall(Math.round(dimension[0]/4),i));\n playing_field.add(new Wall(Math.round(dimension[0]-dimension[0]/4),i)); \n }\n break;\n case 4:\n for ( i = 0; i < Math.round(dimension[0]/3); i++ ) {\n playing_field.add(new Wall(i,Math.round(dimension[1]/3)));\n playing_field.add(new Wall(dimension[0]-i,Math.round(2*dimension[1]/3))); \n }\n for ( i = 0; i < Math.round(dimension[1]/3); i++ ) {\n playing_field.add(new Wall(Math.round(dimension[0]/3),dimension[1]-i));\n playing_field.add(new Wall(Math.round(2*dimension[0]/3),i)); \n } \n break;\n case 5:\n for ( i = 0; i < Math.round(4*dimension[0]/9); i++ ) {\n playing_field.add(new Wall(i,Math.round(dimension[1]/2)));\n playing_field.add(new Wall(dimension[0]-i,Math.round(dimension[1]/2))); \n }\n break;\n case 6:\n for ( i = Math.round(dimension[1]/5); i < Math.round(4*dimension[1]/5); i++ ) {\n playing_field.add(new Wall(Math.round(4*dimension[0]/5),i));\n playing_field.add(new Wall(Math.round(3*dimension[0]/5),i)); \n playing_field.add(new Wall(Math.round(2*dimension[0]/5),i));\n playing_field.add(new Wall(Math.round(dimension[0]/5),i)); \n } \n break;\n case 7:\n for ( i = Math.round(dimension[1]/8); i < Math.round(3*dimension[1]/5); i++ ) {\n playing_field.add(new Wall(Math.round(dimension[0]/3),dimension[1]-i));\n playing_field.add(new Wall(Math.round(2*dimension[0]/3),i)); \n } \n for ( i = Math.round(dimension[0]/8); i < Math.round(3*dimension[0]/5); i++ ) {\n playing_field.add(new Wall(i,Math.round(dimension[1]/3)));\n playing_field.add(new Wall(dimension[0]-i,Math.round(2*dimension[1]/3))); \n } \n break; \n case 0:\n for ( i = 0; i < Math.round(dimension[1]); i+=2) {\n playing_field.add(new Wall(Math.round(dimension[0]/2),i));\n } \n break; \n default:\n break; \n }\n }", "title": "" }, { "docid": "cf995b089f1f40c59a01ec80946253b4", "score": "0.5456884", "text": "function draw_board()\n{\n console.log( 'Draw board.' );\n \n // Iterate through the board\n for( var y = 0; y < BOARD_HEIGHT; y++ )\n {\n for( var x = 0; x < board_width; x++ )\n {\n // Clear cells where needed\n // Add class name for styling if filled\n if( lookup[y][x].getAttribute( 'data-fill' ) == BLANK ) \n {\n lookup[y][x].className = 'none'; \n } else {\n lookup[y][x].className = lookup[y][x].getAttribute( 'data-fill' ); \n }\n }\n }\n}", "title": "" }, { "docid": "15f00c720342cb28997e30976513ce68", "score": "0.54534334", "text": "function renderShipBoard(shipBoard, color, opacity, board) {\n shipBoard.forEach(ship => {\n renderShip(ship, color, opacity, board);\n });\n}", "title": "" }, { "docid": "cf259fc34e0a01012c2a4958dab8e453", "score": "0.5451851", "text": "function breadboard() {\n var x = document.getElementById(\"board\");\n x.style.visibility = \"visible\";\n\n var instance = new BoardController();\n\n instance.setJsPlumbInstance(jsPlumb);\n instance.initDefault();\n instance.setCircuitContainer('mid');\n\n //breadboard definition \n {\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r1', [0, 0, 0, -1, 55, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r2', [0, 0, 0, -1, 68.5, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r4', [0, 0, 0, -1, 95.5, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r5', [0, 0, 0, -1, 109, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r3', [0, 0, 0, -1, 82, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r9', [0, 0, 0, -1, 176.5,22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r11', [0, 0, 0, -1, 217, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r8', [0, 0, 0, -1, 163, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r6', [0, 0, 0, -1, 136, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r10', [0, 0, 0, -1, 190, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r14', [0, 0, 0, -1, 257.5,22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r15', [0, 0, 0, -1, 271, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r7', [0, 0, 0, -1, 149.5,22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r16', [0, 0, 0, -1, 298, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r12', [0, 0, 0, -1, 230.5,22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r19', [0, 0, 0, -1, 338.5,22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r20', [0, 0, 0, -1, 352, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r18', [0, 0, 0, -1, 325, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r21', [0, 0, 0, -1, 379, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r17', [0, 0, 0, -1, 311.5,22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r13', [0, 0, 0, -1, 244, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r22', [0, 0, 0, -1, 392.5,22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r23', [0, 0, 0, -1, 406, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r24', [0, 0, 0, -1, 419.5,22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row1', 'r25', [0, 0, 0, -1, 433, 22], 'black');\n\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r27', [0, 0, 0, 1, 68.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r26', [0, 0, 0, 1, 55, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r30', [0, 0, 0, 1, 109, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r28', [0, 0, 0, 1, 82, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r32', [0, 0, 0, 1, 149.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r31', [0, 0, 0, 1, 136, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r29', [0, 0, 0, 1, 95.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r35', [0, 0, 0, 1, 190, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r34', [0, 0, 0, 1, 176.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r36', [0, 0, 0, 1, 217, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r33', [0, 0, 0, 1, 163.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r37', [0, 0, 0, 1, 230.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r38', [0, 0, 0, 1, 244, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r39', [0, 0, 0, 1, 257.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r41', [0, 0, 0, 1, 298, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r40', [0, 0, 0, 1, 271, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r42', [0, 0, 0, 1, 311.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r43', [0, 0, 0, 1, 325, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r45', [0, 0, 0, 1, 352, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r44', [0, 0, 0, 1, 338.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r46', [0, 0, 0, 1, 379, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r47', [0, 0, 0, 1, 392.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r49', [0, 0, 0, 1, 419.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r50', [0, 0, 0, 1, 433, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row2', 'r48', [0, 0, 0, 1, 406, 38], 'black');\n\n\n\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r51', [0, 0, 0, -1, 474, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r52', [0, 0, 0, -1, 487.5, 22],'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r55', [0, 0, 0, -1, 528, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r54', [0, 0, 0, -1, 514.5, 22],'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r53', [0, 0, 0, -1, 501, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r56', [0, 0, 0, -1, 555, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r57', [0, 0, 0, -1, 568.5, 22],'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r58', [0, 0, 0, -1, 582, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r59', [0, 0, 0, -1, 595.5, 22],'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r61', [0, 0, 0, -1, 636, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r62', [0, 0, 0, -1, 649.5, 22],'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r60', [0, 0, 0, -1, 609, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r63', [0, 0, 0, -1, 663, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r64', [0, 0, 0, -1, 676.5, 22],'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r66', [0, 0, 0, -1, 717, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r67', [0, 0, 0, -1, 730.5, 22],'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r65', [0, 0, 0, -1, 690, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r68', [0, 0, 0, -1, 744, 22], 'black');\n instance.addEndPoint('black',4, 1,'board', 'row3', 'r69', [0, 0, 0, -1, 757.5, 22],'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r72', [0, 0, 0, -1, 811.5, 22],'black');\n instance.addEndPoint('black',4, 1,'board', 'row3', 'r71', [0, 0, 0, -1, 798, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r70', [0, 0, 0, -1, 771, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r73', [0, 0, 0, -1, 825, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r75', [0, 0, 0, -1, 852, 22], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row3', 'r74', [0, 0, 0, -1, 838.5, 22],'black');\n\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r77', [0, 0, 0, 1, 487.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r78', [0, 0, 0, 1, 501, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r81', [0, 0, 0, 1, 555, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r76', [0, 0, 0, 0, 474, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r82', [0, 0, 0, 1, 568.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r79', [0, 0, 0, 1, 514.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r80', [0, 0, 0, 1, 528, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r84', [0, 0, 0, 1, 595.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r86', [0, 0, 0, 1, 636, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r85', [0, 0, 0, 1, 609, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r87', [0, 0, 0, 1, 649.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r89', [0, 0, 0, 1, 676.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r88', [0, 0, 0, 1, 663, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r91', [0, 0, 0, 1, 717, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r83', [0, 0, 0, 1, 582, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r90', [0, 0, 0, 1, 690, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r92', [0, 0, 0, 1, 730.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r96', [0, 0, 0, 1, 798, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r95', [0, 0, 0, 1, 771, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r94', [0, 0, 0, 1, 757.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r93', [0, 0, 0, 1, 744, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r97', [0, 0, 0, 1, 811.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r99', [0, 0, 0, 1, 838.5, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r98', [0, 0, 0, 1, 825, 38], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row4', 'r100', [0, 0, 0, 1, 852, 38], 'black');\n\n\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r101', [0, 0, 0, -1, 55.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r102', [0, 0, 0, -1, 69, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r103', [0, 0, 0, -1, 82.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r104', [0, 0, 0, -1, 96, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r105', [0, 0, 0, -1, 109.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r106', [0, 0, 0, -1, 136.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r108', [0, 0, 0, -1, 163.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r110', [0, 0, 0, -1, 190.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r107', [0, 0, 0, -1, 150, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r109', [0, 0, 0, -1, 177, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r111', [0, 0, 0, -1, 217.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r112', [0, 0, 0, -1, 231, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r113', [0, 0, 0, -1, 244.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r115', [0, 0, 0, -1, 271.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r114', [0, 0, 0, -1, 258, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r117', [0, 0, 0, -1, 312, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r118', [0, 0, 0, -1, 325.5, 265],'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r116', [0, 0, 0, -1, 298.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r119', [0, 0, 0, -1, 339, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r120', [0, 0, 0, -1, 352.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r121', [0, 0, 0, -1, 379.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r122', [0, 0, 0, -1, 393, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r124', [0, 0, 0, -1, 420, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r123', [0, 0, 0, -1, 406.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row5', 'r125', [0, 0, 0, -1, 433.5, 265], 'black');\n\n\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r127', [0, 0, 0, 1, 69, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r126', [0, 0, 0, 1, 55.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r129', [0, 0, 0, 1, 96, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r128', [0, 0, 0, 1, 82.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r130', [0, 0, 0, 1, 109.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r131', [0, 0, 0, 1, 136.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r132', [0, 0, 0, 1, 150, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r133', [0, 0, 0, 1, 163.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r134', [0, 0, 0, 1, 177, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r136', [0, 0, 0, 1, 217.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r135', [0, 0, 0, 1, 190.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r137', [0, 0, 0, 1, 231, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r138', [0, 0, 0, 1, 244.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r140', [0, 0, 0, 1, 271.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r142', [0, 0, 0, 1, 312, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r139', [0, 0, 0, 1, 258, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r141', [0, 0, 0, 1, 298.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r143', [0, 0, 0, 1, 325.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r145', [0, 0, 0, 1, 352.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r144', [0, 0, 0, 1, 339, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r147', [0, 0, 0, 1, 393, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r146', [0, 0, 0, 1, 379.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r148', [0, 0, 0, 1, 406.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r149', [0, 0, 0, 1, 420, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row6', 'r150', [0, 0, 0, 1, 433.5, 281], 'black');\n \n\n\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r151', [0, 0, 0, -1, 474, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r152', [0, 0, 0, -1, 487.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r155', [0, 0, 0, -1, 528, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r153', [0, 0, 0, -1, 501, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r157', [0, 0, 0, -1, 568.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r156', [0, 0, 0, -1, 555, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r154', [0, 0, 0, -1, 514.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r160', [0, 0, 0, -1, 609, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r162', [0, 0, 0, -1, 649.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r161', [0, 0, 0, -1, 636, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r159', [0, 0, 0, -1, 595.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r158', [0, 0, 0, -1, 582, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r163', [0, 0, 0, -1, 663, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r164', [0, 0, 0, -1, 676.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r165', [0, 0, 0, -1, 690, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r166', [0, 0, 0, -1, 717, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r168', [0, 0, 0, -1, 744, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r167', [0, 0, 0, -1, 730.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r169', [0, 0, 0, -1, 757.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r170', [0, 0, 0, -1, 771, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r171', [0, 0, 0, -1, 798, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r172', [0, 0, 0, -1, 811.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r174', [0, 0, 0, -1, 838.5, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r173', [0, 0, 0, -1, 825, 265], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row7', 'r175', [0, 0, 0, -1, 852, 265], 'black');\n\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r176', [0, 0, 0, 0, 474, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r177', [0, 0, 0, -1, 487.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r180', [0, 0, 0, -1, 528, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r178', [0, 0, 0, -1, 501, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r182', [0, 0, 0, -1, 568.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r181', [0, 0, 0, -1, 555, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r179', [0, 0, 0, -1, 514.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r187', [0, 0, 0, -1, 649.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r183', [0, 0, 0, -1, 582, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r186', [0, 0, 0, -1, 636, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r185', [0, 0, 0, -1, 609, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r184', [0, 0, 0, -1, 595.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r188', [0, 0, 0, -1, 663, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r189', [0, 0, 0, -1, 676.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r191', [0, 0, 0, -1, 717, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r190', [0, 0, 0, -1, 690, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r192', [0, 0, 0, -1, 730.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r193', [0, 0, 0, -1, 744, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r194', [0, 0, 0, -1, 757.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r196', [0, 0, 0, -1, 798, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r195', [0, 0, 0, -1, 771, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r197', [0, 0, 0, -1, 811.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r198', [0, 0, 0, -1, 825, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r199', [0, 0, 0, -1, 838.5, 281], 'black');\n instance.addEndPoint('black',4,1, 'board', 'row8', 'r200', [0, 0, 0, -1, 852, 281], 'black');\n\n \n }\n}", "title": "" }, { "docid": "516eaa2dcc89173f074e5ed39eb5cd9f", "score": "0.54501337", "text": "function paintBoard(){\r\n \r\n\t// paint bg color\r\n\tcontext.clearRect(0, 0, canvasWidth, canvasHeight);\r\n\tcontext.fillStyle = boardColor;\r\n\tcontext.fillRect(0, 0, canvasWidth, canvasHeight);\r\n\t\r\n\t// draw border\r\n\tvar borderWidth = 10;\r\n\tvar borderOffset = borderWidth / 2;\r\n context.lineWidth = borderWidth;\r\n\t\r\n\tcontext.beginPath();\r\n\tcontext.moveTo(borderOffset, borderOffset);\r\n\tcontext.lineTo(canvasWidth - borderOffset, borderOffset);\r\n\t\r\n\tcontext.lineTo(canvasWidth - borderOffset, canvasHeight - borderOffset);\r\n\t\r\n\tcontext.lineTo(borderOffset, canvasHeight - borderOffset);\r\n\t\r\n\tcontext.closePath();\r\n\tcontext.stroke();\r\n\t\r\n\t// draw grids\r\n\tvar gridLineWidth = 2;\r\n\tcontext.lineWidth = gridLineWidth;\r\n\tfor(row = 1; row <= grids; row++){\r\n\t\tcontext.moveTo(gridSpace, gridSpace * row);\r\n\t\tcontext.lineTo(canvasWidth - gridSpace, gridSpace * row);\r\n\t\tcontext.moveTo(gridSpace * row, gridSpace);\r\n\t\tcontext.lineTo(gridSpace * row, canvasHeight - gridSpace);\r\n\t}\r\n\tcontext.stroke();\r\n}", "title": "" }, { "docid": "7372623a81692a12f9696e071042f9cb", "score": "0.54483944", "text": "function checkBoardFull() {\n for (var col = 0; col < COLS; col++) {\n if (!checkColFull(col)) return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "8ece03dcca3d80712431c6753377c6cb", "score": "0.5444087", "text": "start(){\n this.board = [\"\", \"\", \"\",\n \"\", \"\", \"\",\n \"\", \"\", \"\"];\n this.drawBoard(); \n \n }", "title": "" }, { "docid": "0608cf614e7a079b654be35634ce15f2", "score": "0.5443903", "text": "function update() {\n updateBoard()\n drawUpdatedBoard();\n}", "title": "" }, { "docid": "9378f952d1e2624ee3be0ac002862e66", "score": "0.5443419", "text": "function indexToBePopulated(currentBoard) {\n var toBeFilled = {\n rowIndex: -1,\n columnIndex: -1\n };\n for (var row = 0; row < currentBoard.BOARD_SIZE; row++) {\n for (var column = 0; column < currentBoard.BOARD_SIZE; column++) {\n if (currentBoard.generatedBoard[row][column] == 0) {\n toBeFilled = {\n rowIndex: row,\n columnIndex: column\n };\n return toBeFilled;\n }\n }\n }\n return toBeFilled;\n}", "title": "" }, { "docid": "ae41632b19c97f5e644877174325b527", "score": "0.54391724", "text": "drawBoard() {\n // for every element in the game board, draw a square\n for(var i = 0; i < this.height; i++) {\n for(var j = 0; j < this.width; j++) {\n if(this.board[i][j]) {\n context.fillStyle = this.alivecolor\n } else {\n context.fillStyle = this.deadcolor\n }\n\n context.fillRect(j * this.size, i * this.size, this.size, this.size)\n }\n }\n }", "title": "" } ]
57aff20013035f61b2f39040c9632611
Function that returns the number of valid data points for feature
[ { "docid": "caab2e6ce6c41e52e0880d699cc9f9c0", "score": "0.76076514", "text": "getValidDataLength(feature) {\n return this.getValidData(feature).length;\n }", "title": "" } ]
[ { "docid": "01602775fbacfa1184212c539f6f7408", "score": "0.63089263", "text": "featureNumInstanceCount(cxt, feature) {\n return cxt.groupAll().reduceSum(function (fact) { return fact[feature]; }).value();\n }", "title": "" }, { "docid": "f4a8c683b0a9eb4a578d231106863ed9", "score": "0.5874574", "text": "function getTotalPoints() {\n\treturn num_points;\n}", "title": "" }, { "docid": "f19586d112f02fa8fbea847e60c3ebef", "score": "0.5814144", "text": "getDataSize () {\n\n let size = 0\n\n for (let f=0; f<this.filters.length; f++) {\n\n const filter = this.filters[f]\n\n for (let c=0; c<filter.weights.length; c++) {\n for (let r=0; r<filter.weights[c].length; r++) {\n size += filter.weights[c][r].length\n }\n }\n\n size += 1\n }\n\n return size\n }", "title": "" }, { "docid": "ddcc2ebb8fb0a9b62b5ecde8e5d7bb6f", "score": "0.57335484", "text": "function getTotalNumBef(data, x){\r\n var totalNum = 0;\r\n for(var i = 0; i<x; i++){\r\n totalNum += data[i].groupRows.length;\r\n }\r\n return totalNum;\r\n}", "title": "" }, { "docid": "29c1c3dcbf1b7ed0fcb72b2ed5ce6b7d", "score": "0.5726998", "text": "function AreNewPointsNeeded() : boolean {\n\treturn missingPointsCount == batchPointsCount;\n}", "title": "" }, { "docid": "8ab7d1e13402d7237f6abe0cb1eadd86", "score": "0.568865", "text": "numAnswers() {\n return this.expectedSet.reduce((cnt, row) => row.length + cnt, 0);\n }", "title": "" }, { "docid": "d5f6808c880be99953a3f9836bb10bc9", "score": "0.56341404", "text": "errorCount() {\n return Object.keys(this.errors).length;\n }", "title": "" }, { "docid": "84e2f64bd715063815b867274b01d9c6", "score": "0.56281674", "text": "count() {\n\t\treturn this.data.length\n\t}", "title": "" }, { "docid": "7a5e04e7f37806995f4dba8477ca23c9", "score": "0.5558025", "text": "function get_inputs_length (node_id) {\t\n\treturn dataset.steps[node_id].inputs.length;\n}", "title": "" }, { "docid": "a3cf80b9453798932765d29cb4d13728", "score": "0.5550902", "text": "getNumOfFeatures() {\n return this.numOfFeatures;\n }", "title": "" }, { "docid": "1d92ef7c7246372e11ea7d371da093f7", "score": "0.5545112", "text": "function featureGroupSize(featureGroup) {\n return featureGroup.numFeatures;\n }", "title": "" }, { "docid": "c5c1d7b287feeb4887db6ce08a3ebd56", "score": "0.5508005", "text": "function countMissingValueEC(attributes_CSV){\n var numberMissingValueEC=0\n for(i=0;i<attributes_CSV.length;i++){\n numberMissingValueEC = attributes_CSV[i][\"missingValuesCount\"] + numberMissingValueEC\n }\n return numberMissingValueEC\n}", "title": "" }, { "docid": "48da2e70b53f7fffe2844e4e4a3cdd23", "score": "0.54959446", "text": "function dataLength(source) {\n if (source instanceof G3) {\n return 3;\n }\n else if (source instanceof R3) {\n if (source.length !== 3) {\n throw new Error(\"source.length is expected to be 3\");\n }\n return 3;\n }\n else if (source instanceof R2) {\n if (source.length !== 2) {\n throw new Error(\"source.length is expected to be 2\");\n }\n return 2;\n }\n else {\n // console.warn(\"dataLength(source: VectorN<number>): number[], source.length => \" + source.length)\n return source.length;\n }\n }", "title": "" }, { "docid": "087d357b103a488c71c2aae882baff77", "score": "0.5493521", "text": "function countInstancesWithMissingValuesEC(rows){\n var numberInstancesWithMissingValuesEC=0\n for(i=0;i<rows.length;i++){\n // console.log(countMissingValue(rows[i]))\n if (rows[i].indexOf(\"\") != -1){\n numberInstancesWithMissingValuesEC = numberInstancesWithMissingValuesEC + 1\n }\n }\n return numberInstancesWithMissingValuesEC\n}", "title": "" }, { "docid": "f68e99c018b3ad1edf2a6084f14846f5", "score": "0.54760057", "text": "validate() {\n\t\tlet features = this.validationSet.features;\n\t\tlet labels = this.validationSet.labels;\n\t\tlet SSE = 0;\n\t\tfor (let f = 0; f < features; f++) {\n\t\t\tthis.getModelOutput(features[f]);\n\t\t\tSSE += this.calculateError(labels[f], false);\n\t\t}\n\t\treturn SSE;\n\t}", "title": "" }, { "docid": "941430459bc8c49d2f94881d22fb9a89", "score": "0.5462957", "text": "function getFeatureDataSize(featureData) {\n let numBytes = MINIMUM_OBJECT_SIZE_ESTIMATION;\n if (featureData.ids !== undefined) {\n numBytes += featureData.ids.length * 8;\n }\n if (featureData.starts !== undefined) {\n numBytes += featureData.starts.length * 8;\n }\n if (featureData.objInfos !== undefined) {\n // 16 (estimated) bytes per objInfos\n numBytes += featureData.objInfos.length * MINIMUM_SMALL_OBJECT_SIZE_ESTIMATION;\n }\n return numBytes;\n}", "title": "" }, { "docid": "6e12ec728b7909f012111dd322139799", "score": "0.5462068", "text": "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "6e12ec728b7909f012111dd322139799", "score": "0.5462068", "text": "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "a1048822fef67130f8858afa392571d6", "score": "0.54208916", "text": "GetStuckCandidateCount() {\n ///return m_stuckParticleBuffer.GetCount();\n return this.m_stuckParticleBuffer.GetCount();\n }", "title": "" }, { "docid": "bc30e24592bd8c553c05cd53c82eaa0a", "score": "0.5407354", "text": "function WFF_preconditionArray_length()\r\n{\r\n var count=0;\r\n for(var i in WFF_preconditionArray) count++;\r\n return count;\r\n}", "title": "" }, { "docid": "95bea9b80a8503ac133016202f7a0ae1", "score": "0.5381421", "text": "function getStepsCount() {\n\tvar length = 0;\n\tvar svg = d3.select(\"#eventSliderPanel\").select(\"svg\");\n\tvar circles = svg.selectAll(\".tsDot\")[\"_groups\"];\n\tif (circles != null && circles.length > 0)\n\t\tlength = circles[0].length;\n\treturn length;\n}", "title": "" }, { "docid": "0c86fab0e8dd2bc9d0aebc637db1737c", "score": "0.53685075", "text": "function breakPointCountConstraints(symbologyNode, featureShape) {\r\n return ((featureShape.pointCount > symbologyNode.maximumPointCount && symbologyNode.maximumPointCount !== -1) ||\r\n (featureShape.pointCount < symbologyNode.minimumPointCount && symbologyNode.minimumPointCount !== -1));\r\n }", "title": "" }, { "docid": "7b1dfbcc02c927d1bb5c2a6c1e15f9f9", "score": "0.5362356", "text": "len() {\n\t\t\treturn Math.sqrt( this.x * this.x + this.y * this.y );\n\t\t}", "title": "" }, { "docid": "8ca808d444b1311fa4f61717b946ef0f", "score": "0.53525925", "text": "function numberOfEqivalentPoints(points) {\n var result = 0;\n points.forEach(function(point1) {\n points.forEach(function(point2) {\n if(point1.equivalent(point2)) {\n result++;\n }\n })\n })\n return result;\n}", "title": "" }, { "docid": "df9ba62eb5084a7b6940b9ce4ef2d36d", "score": "0.5335688", "text": "function isValidFeature(feature) {\n // ensure all of the geometry's coordinates are numbers.\n const coords = feature.getGeometry().flatCoordinates;\n for (let i = 0, ii = coords.length; i < ii; i++) {\n if (isNaN(coords[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "c344da99bf90125e212d80585176643f", "score": "0.5323656", "text": "size() {\n return get_distance(this.point1[0], this.point2[0], this.point1[1], this.point2[1]);\n }", "title": "" }, { "docid": "5bbd5e7084000f2ee43a696c4bdfc6a5", "score": "0.5321235", "text": "get numberOfInputs() {\n if (Object(_util_TypeCheck__WEBPACK_IMPORTED_MODULE_1__[\"isDefined\"])(this.input)) {\n if (Object(_util_AdvancedTypeCheck__WEBPACK_IMPORTED_MODULE_0__[\"isAudioParam\"])(this.input) || this.input instanceof _Param__WEBPACK_IMPORTED_MODULE_2__[\"Param\"]) {\n return 1;\n }\n else {\n return this.input.numberOfInputs;\n }\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "744bdc1abb61404279cb7c329a6b4ce9", "score": "0.53116304", "text": "static count(data) {\n return data.length;\n }", "title": "" }, { "docid": "f26b2b5404cc0fdfb8c56bfee693f83f", "score": "0.5298786", "text": "function getCount(data, columnName) {\n var arr = [];\n // create an array containging only values within 'columnName'\n d3.map(data, function(d) {\n arr.push(d[columnName]);\n });\n // filter the array for empty or null values\n var filtered = arr.filter(notEmpty);\n\n return filtered.length;\n}", "title": "" }, { "docid": "a1d519dd62d39596a51deb67ee7454e2", "score": "0.5272368", "text": "function getTotalPassengers(data) {\n\t\treturn data.length\n\t}", "title": "" }, { "docid": "e358d56a4173a3570727bbbb4c59c566", "score": "0.5266117", "text": "function x(d) { return d.len }", "title": "" }, { "docid": "f2dcd361fc4f6cf30a320a5c3f969315", "score": "0.5242813", "text": "dataCheck () {\n if (this.x.length !== this.y.length || this.x.length === 0 || this.y.length === 0) {\n this.isValidated = false\n }\n }", "title": "" }, { "docid": "5a19428cdc3d2ccdf42f7e55b73f4f44", "score": "0.5235395", "text": "getNumOfData() {\n return this.numOfData;\n }", "title": "" }, { "docid": "a8c13ffe014532cc1851f277cdd2c8f9", "score": "0.5232974", "text": "getNumberOfCorrectAnswers() {\n const answerArray = this.getCheckedAnswers();\n let numberOfCorrectAnswers = 0;\n\n answerArray.forEach(element => {\n if (element.correct) {\n numberOfCorrectAnswers++;\n }\n })\n\n return numberOfCorrectAnswers;\n }", "title": "" }, { "docid": "0e7c5e11b18c9005e2d75c5155ace59f", "score": "0.5231451", "text": "function count(input) {\n return input.length;\n}", "title": "" }, { "docid": "d1151a6b35758944804e28949f1d4a9c", "score": "0.5223969", "text": "function count(featureData, tagCountObject, requestedTag) {\n\n // Counting number of scenarios.\n var numScenarios = 0;\n featureData.scenarioDefinitions.forEach(function(scenario) {\n if (scenario.type === 'Scenario') {\n numScenarios++;\n }\n if (scenario.type === 'ScenarioOutline') {\n var examples = scenario.examples;\n examples.forEach(function(example) {\n numScenarios += example.tableBody.length || 0;\n });\n }\n });\n\n // Counting feature tags.\n addTags(tagCountObject, featureData, numScenarios, requestedTag);\n\n // Counting tags on scenario and scenario outlines.\n if (featureData.scenarioDefinitions.length) {\n featureData.scenarioDefinitions.forEach(function(scenario) {\n\n // Tags on scenarios.\n if (scenario.type === 'Scenario') {\n addTags(tagCountObject, scenario, 1, requestedTag);\n }\n\n // Tags on scenario outlines.\n if (scenario.type === 'ScenarioOutline') {\n var examples = scenario.examples;\n var numExampleRows = 0;\n examples.forEach(function(example) {\n numExampleRows += example.tableBody.length || 0;\n });\n addTags(tagCountObject, scenario, numExampleRows, requestedTag);\n\n // Tags on examples within scenario outlines.\n examples.forEach(function(example) {\n var numRows = example.tableBody.length || 0;\n addTags(tagCountObject, example, numRows, requestedTag);\n });\n }\n });\n }\n\n return tagCountObject;\n}", "title": "" }, { "docid": "bb26761ebae630f8edbcb7f5909cba81", "score": "0.52206457", "text": "function getCount(objects) {\n let counter = 0;\n for (let i = 0; i < objects.length; ++i) {\n if (objects[i].x * objects.length === objects[i].y * objects.length) {\n counter++;\n }\n }\n\n return counter;\n}", "title": "" }, { "docid": "5be9eb90d9e27022be145d9e55713571", "score": "0.52176124", "text": "function getTotalFieldCount(data) {\n if (filteredData[data]) return filteredData[data].length;\n else return 0;\n }", "title": "" }, { "docid": "15b0e7c2611b1a98d4007676db875209", "score": "0.52150494", "text": "get numberOfInputs() {\n if (Object(_util_TypeCheck__WEBPACK_IMPORTED_MODULE_1__[\"isDefined\"])(this.input)) {\n if (Object(_util_AdvancedTypeCheck__WEBPACK_IMPORTED_MODULE_0__[\"isAudioParam\"])(this.input) || this.input instanceof _Param__WEBPACK_IMPORTED_MODULE_2__[\"Param\"]) {\n return 1;\n } else {\n return this.input.numberOfInputs;\n }\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "b9e873d03cb820ad85ef82c669e11786", "score": "0.5195428", "text": "function emptyCounter() {\n var count = 0;\n for (var i = 0; i < 81; i++) {\n if (inputs[i].disabled == false) {\n count++;\n }\n }\n return count;\n }", "title": "" }, { "docid": "1cd70a313e202b0a05e360d9adc1cd65", "score": "0.5177392", "text": "function countCohorts(data) {\n\n return data.length;\n}", "title": "" }, { "docid": "8127151a20a2683344c186d3bfe49e09", "score": "0.51724666", "text": "function get_input_conns_length (node_id) {\t\n\treturn d3.values(dataset.steps[node_id].input_connections).length;\n}", "title": "" }, { "docid": "2d5a44bd32c6db5b195d81b0d277a159", "score": "0.5169593", "text": "getRegularPoints(n) {return null;}", "title": "" }, { "docid": "9f1193c7b5584ba5245bd5142524bbf9", "score": "0.5169152", "text": "function bordaCount(questionNumber, dataSet) {\n\n}", "title": "" }, { "docid": "69f735e4df35d189c02a5aa3ab6a074c", "score": "0.5161549", "text": "coordAvailable() {\n return this.coords.length;\n }", "title": "" }, { "docid": "75c465d9cc61003bea3c746ba223c9ff", "score": "0.5146121", "text": "getNumberOfVisibleColumns() {\n const nrVisible = 0\n for (let i = 0; i < this.dataSupplier.getNumberOfColumns(); i++) {\n const col = this.dataSupplier.getColumnData()\n if (col.visible) {\n nrVisible++\n }\n }\n return nrVisible\n }", "title": "" }, { "docid": "712f773e6d60a14f3c710aac318be7fd", "score": "0.51417285", "text": "visitFeature(featureId, handler) {\n let numFeaturesFound = 0;\n const numPointFeatures = this.tileInfo.pointGroup.numFeatures;\n const pointFeatures = this.tileInfo.pointGroup.featureIds;\n for (let i = 0; i < numPointFeatures; i++) {\n if (pointFeatures[i] === featureId) {\n numFeaturesFound++;\n this.visitPointFeature(i, handler);\n }\n }\n const numLineFeatures = this.tileInfo.lineGroup.numFeatures;\n const lineFeatures = this.tileInfo.lineGroup.featureIds;\n for (let i = 0; i < numLineFeatures; i++) {\n if (lineFeatures[i] === featureId) {\n numFeaturesFound++;\n this.visitLineFeature(i, handler);\n }\n }\n const numPolygonFeatures = this.tileInfo.polygonGroup.numFeatures;\n const polygonsFeatures = this.tileInfo.polygonGroup.featureIds;\n for (let i = 0; i < numPolygonFeatures; i++) {\n if (polygonsFeatures[i] === featureId) {\n numFeaturesFound++;\n this.visitPolygonFeature(i, handler);\n }\n }\n return numFeaturesFound;\n }", "title": "" }, { "docid": "329704feaf65e2fd094f36da39b4e09e", "score": "0.5139381", "text": "function getNumLabels () {\n var labels = svl.labelContainer.getCanvasLabels();\n var len = labels.length;\n var i, total = 0;\n for (i =0; i < len; i++) {\n if (!labels[i].isDeleted() && labels[i].isVisible()) {\n total++;\n }\n }\n return total;\n }", "title": "" }, { "docid": "dacb27d2fe4f677cbfd0fc498f89b365", "score": "0.5125173", "text": "getNumberOfYAxes() {\n return (this.isYAxisShared()) ? 1 : this.getYAxisColumns().length;\n }", "title": "" }, { "docid": "fcbb2a78845ef60233cb6ceb67098ebb", "score": "0.51165265", "text": "function getMinesCount() { \n let count = 0;\n for (let i = 0; i < ROWS; i++)\n for (let j = 0; j < COLS; j++) \n if(isMine(i, j)) count++;\n return count;\n }", "title": "" }, { "docid": "8bf59d5f9510570c974a6b31f77fb0b6", "score": "0.5115913", "text": "function getNumGrades(distribution) {\n return distribution.length;\n}", "title": "" }, { "docid": "f2f60180166d00ed1da1fbfc00147e4f", "score": "0.5110871", "text": "function N(state) {\n\tvar count = trained_counts[state];\n\tif(count == undefined)\n\t\treturn 0;\n\treturn count;\n}", "title": "" }, { "docid": "be7e8e9a691641a56776cd318528fbf4", "score": "0.51072884", "text": "function countFacts() {\n num = facts.groupAll().reduceCount().value();\n\tconsole.log('aaa'+num);\n return num;\n }", "title": "" }, { "docid": "519ef90c3b3c48fa79aeb4237e368473", "score": "0.5098103", "text": "function countOccurrences(layer,token) {\n\treturn Array.from(layer).filter(x => x==token).length\n}", "title": "" }, { "docid": "6a39ef3ca9aca3b4a53e6df273fc0950", "score": "0.508995", "text": "function getYears(data) {\n var countYears=0;\n $.each(data.features[0].properties, function(k, v){\n if(k[0]==\"y\") {\n countYears += 1;\n }\n })\n return countYears;\n}", "title": "" }, { "docid": "8f8ee2d1cb8a7c41569e12fe69995483", "score": "0.5088162", "text": "function validCount(value){\r\n var str=value.replace(/-/g,'');\r\n return str.length\r\n }", "title": "" }, { "docid": "5acd8b287e40bc879f888f1fdb64512d", "score": "0.50853246", "text": "function getDimCount(source,sysDims,dimsDef,optDimCount){\n// Note that the result dimCount should not small than columns count\n// of data, otherwise `dataDimNameMap` checking will be incorrect.\nvar dimCount=Math.max(\nsource.dimensionsDetectCount||1,\nsysDims.length,\ndimsDef.length,\noptDimCount||0);\n\neach$1(sysDims,function(sysDimItem){\nvar sysDimItemDimsDef=sysDimItem.dimsDef;\nsysDimItemDimsDef&&(dimCount=Math.max(dimCount,sysDimItemDimsDef.length));\n});\nreturn dimCount;\n}", "title": "" }, { "docid": "e0a533f1620f1b48473cac4adc35ed4a", "score": "0.50761396", "text": "getCount() {\n return this.indices.length;\n }", "title": "" }, { "docid": "ea5c7b78f7b9f0eadf08aa4be33ee19c", "score": "0.50728893", "text": "function denseCount(arr) {\n var c = 0;\n\n for (var i = 0; i < arr.length; i++) {\n if (i in arr) {\n c++;\n }\n }\n\n return c;\n}", "title": "" }, { "docid": "476000ca3a33a89f95d91fffb79ed5cb", "score": "0.5062382", "text": "calculateFP3() {\n let nodeCount = 0,\n countedNodes = [];\n /**\n * Process only cluster heads\n */\n this.genes.forEach((geneValue, index) => {\n if (geneValue) {\n // Find number of nodes in the vicinity of corresponding node to this gene value.\n this.network.distanceMatrix[index].forEach((d, d_index) => {\n if (d < VICINITY && !countedNodes.includes(d_index)) {\n nodeCount++;\n countedNodes.push(d_index);\n }\n });\n }\n });\n return nodeCount;\n }", "title": "" }, { "docid": "b9f9a519401aa8ac5e9a36d56ab13fe1", "score": "0.5053442", "text": "function checkSuccess(batchSize) {\n const TOF = [...document.getElementsByTagName(\"circle\")].map(c => {\n const C = {\n x: parseFloat(c.getAttribute(\"cx\")),\n y: parseFloat(c.getAttribute(\"cy\"))\n };\n const CORR_COL = correctAnswer(C) === 1 ? COLOURS.errorcol : COLOURS.maincol;\n return CORR_COL === c.getAttribute(\"fill\");\n });\n const FALSIES = TOF.filter(point => point === false).length,\n PERCENT_SUCCESS = 100 - ((FALSIES/batchSize) * 100);\n return {\n iteration: iterationCount,\n score: PERCENT_SUCCESS,\n fails: FALSIES,\n batchSize: parseInt(batchSize),\n totalPoints: batchSize*iterationCount\n };\n}", "title": "" }, { "docid": "02e67a8da5c7d484c46737ab5bbc0040", "score": "0.5050865", "text": "function checkFlaggedMatrix(x, y) {\n let count = 0;\n\n for(let i = x-1; i <= x+1; i++) {\n for(let j = y-1; j <= y+1; j++) {\n if((i!=x) || (j!=y)) { // Don't check center point\n count += checkFlagged(i, j);\n }\n }\n }\n\n return count;\n}", "title": "" }, { "docid": "0b2f49d05d385884852afcb01041b3ec", "score": "0.5044039", "text": "countEvens() {\n return this.sumValues(0, \"node.val%2===0\");\n }", "title": "" }, { "docid": "248f4e99bcaf51b71c97f132c481d474", "score": "0.5042909", "text": "getNumberOfColumns() {\n return this.dataSupplier.getNumberOfColumns()\n }", "title": "" }, { "docid": "46d50777a8978552b5a0878796c9d3ac", "score": "0.50354177", "text": "getneighcount(arr, x, y) {\n let nc = 0;\n for (let nn = 0; nn < this.neighbourhood.length; nn++) {\n const dx = this.neighbourhood[nn][0];\n const dy = this.neighbourhood[nn][1];\n if (\n arr[this.pbcz(x + dx, arr.length)][this.pbcz(y + dy, arr[x].length)] ===\n this.ALIVE\n ) {\n nc++;\n }\n }\n return nc;\n }", "title": "" }, { "docid": "a75968c21cb914f2a261afe99a8e417a", "score": "0.5029701", "text": "length() {\r\n return this._trytes.length;\r\n }", "title": "" }, { "docid": "ffe834d1632cc3aafbb5222f20164b57", "score": "0.5025026", "text": "function getPopulationFactor() {\n var rows = data.v.split(\";\")\n return rows[0].split(\",\").length/numTraits\n }", "title": "" }, { "docid": "42d239465925d802109703d5d7678859", "score": "0.50206715", "text": "function count(arr) {\n return arr.length;\n}", "title": "" }, { "docid": "2daa1478f6bea72f25ffaa4d22dc8b56", "score": "0.5017969", "text": "function isValid(clusterData) {\n if(clusterData.length > 0)\n return true;\n else return false;\n}", "title": "" }, { "docid": "2433338217df4e54dae31240a6378fdc", "score": "0.50164634", "text": "function internal_isDatasetCore(input) {\n return typeof input === \"object\" && input !== null && typeof input.size === \"number\" && typeof input.add === \"function\" && typeof input.delete === \"function\" && typeof input.has === \"function\" && typeof input.match === \"function\" && Array.from(input).length === input.size;\n}", "title": "" }, { "docid": "22fa2415cceac0d7ccbbbb413eafedc6", "score": "0.49945477", "text": "function countFields(grid) {\n // split letters in each row b/c strings are immutable in JS\n for (let k = 0; k < grid.length; k++) {\n grid[k] = grid[k].split('');\n }\n let fieldCount = 0;\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[i].length; j++) {\n if (grid[i][j] === 'Y') {\n fieldCount++;\n checkCell(grid, i, j);\n }\n }\n }\n return fieldCount;\n}", "title": "" }, { "docid": "7676a631256ec467f8858c684b0277ed", "score": "0.49872372", "text": "function arrayLength(x) {\n return x.length\n}", "title": "" }, { "docid": "145dcf1877f225d058dd9996f9714dd3", "score": "0.49848437", "text": "function count_valid_entries(){\r var valid_odds_num=0;\r for(i = 1; i <= 5; i++){\r document.getElementById(\"stake_\" + i).innerHTML=\"0.00\"; // Resets\r document.getElementById(\"returns_\" + i).innerHTML=\"0.00\"; // Resets\r if (document.getElementById(\"odds_\" + i).value != ''){\r valid_odds_num++; // This odds value is a valid entry\r }\r }\r return valid_odds_num;\r}", "title": "" }, { "docid": "5776c98bceb15f6d46ca3b9225833eb9", "score": "0.49824136", "text": "@computed get getDataLength() {\n console.log(this.data.length);\n return this.data.length\n }", "title": "" }, { "docid": "7a6d0d2ecf238626ba3c399a68392a5f", "score": "0.4969468", "text": "function taskCount() {\n const localData = getLocalData();\n const obj = localData['todo_data'];\n let objLen = Object.keys(obj).length;\n return objLen;\n}", "title": "" }, { "docid": "8d5ac7c49c37772ea0b63b73eba1d31a", "score": "0.49654612", "text": "getLayerCount() {\n return this.layers.length;\n }", "title": "" }, { "docid": "601c8047a930c5f25991cd7ea56c785f", "score": "0.49652344", "text": "getNumberOfRows() {\n return this.dataSupplier.getNumberOfRows()\n }", "title": "" }, { "docid": "bd915ae979ed36430d798a44a45b9bf8", "score": "0.49646717", "text": "getNeighborhoodData(feature) {\n const count = this.props.data.filter(n => n.neighborhood === feature.properties.name)\n return (count.length > 0) ? count[0].count: undefined\n }", "title": "" }, { "docid": "e58d5ff0b0102ddb742ce5acd4e00b71", "score": "0.49537554", "text": "function stu_value_length(student){\n return Object.values(student).length\n}", "title": "" }, { "docid": "56e0b3035cfb77dd69d8c3ffebd1b9ae", "score": "0.4950647", "text": "cardinality() {\n if (this.isEmpty) {\n return 0;\n }\n const data = this.data;\n const length = data.length;\n let result = 0;\n for (let i = 0; i < length; i++) {\n result += POP_CNT[data[i]];\n }\n return result;\n }", "title": "" }, { "docid": "dcb40eabcdb00a2ed3ab8a54074c7dec", "score": "0.49487606", "text": "function numPrimeFactors(num) {\n return primeFactors(num).length;\n}", "title": "" }, { "docid": "8e8de9f5d6e4ac2737f1bb77bc971b74", "score": "0.4945896", "text": "_optimalCountWith(f) {\n var filterer;\n filterer = function(x) {\n return x.projectionBy(f);\n };\n return this._unsafeIterator().filter(filterer).length;\n }", "title": "" }, { "docid": "c3abe17a73990ec6fdcf441b0a084088", "score": "0.49443966", "text": "getAnnotationCount() {\n return this.annotations.length;\n }", "title": "" }, { "docid": "d97a472644b287feb225c47dd2c54f8b", "score": "0.49370643", "text": "function getNumberOfEmptyCells() {\n var count = 0;\n for ( var i = 0; i < rows; i++ ) {\n for ( var j = 0; j < cols; j++ ) {\n if ( this.gameField[i][j] == 0 ) {\n count++;\n }\n }\n }\n return count;\n}", "title": "" }, { "docid": "3e949f0bc6f2f6d31be1357dbf08a8ab", "score": "0.49344447", "text": "size() {\n return this.tensorMap.size;\n }", "title": "" }, { "docid": "3e949f0bc6f2f6d31be1357dbf08a8ab", "score": "0.49344447", "text": "size() {\n return this.tensorMap.size;\n }", "title": "" }, { "docid": "90275ea59d6809691454a73e5ae72f12", "score": "0.4932517", "text": "function countFlags(x, y){\n var count = 0;\n\n if (boardArray[y][x].isFlagged) {\n count++;\n }\n\n return count;\n}", "title": "" }, { "docid": "fc743a4595aab358fe2938a33e9cd253", "score": "0.49300835", "text": "function countMissingValue(column){\n var numberMissing=0\n for (i=0;i<column.length;i++) {\n if(column[i]==\"\"){\n numberMissing = numberMissing+1\n }\n }\n return numberMissing\n}", "title": "" }, { "docid": "73c16290bcc80c864148918cd0a59a6d", "score": "0.49295378", "text": "function count_successful_students(grades, min_grade) {\n\n var n = grades.length, passed = 0;\n for (var i = 0; i < n; i++) {\n if (grades[i] >= min_grade) {\n passed++;\n }\n }\n console.log(passed);\n}", "title": "" }, { "docid": "8b77288793ca5e89b59a9206f3452e53", "score": "0.4929297", "text": "function getNumAvailableSeatsInSofa(seat) {\n var i,\n seatsAvailable = 0;\n\n for (i = 0; i < seat.SeatsInGroup.length; i++) {\n var sofaSeat = getSeat(seat.area.AreaNumber, seat.SeatsInGroup[i].RowIndex, seat.SeatsInGroup[i].ColumnIndex);\n\n if (seatAvailable(seat)) {\n seatsAvailable++;\n }\n }\n\n return seatsAvailable;\n}", "title": "" }, { "docid": "6c7cd95fd8a1f5a7c612a58133dfcd1f", "score": "0.49260288", "text": "function noOfTilesLoaded() {\n return G_tileData.size;\n}", "title": "" }, { "docid": "4645fed96a3085c0d99fa52bbb4d3637", "score": "0.492417", "text": "function countTransicoes(x, y, imgData){\n\t\t\t\tvar count = 0;\n\t\t\t\tfor (var i = 0; i < nbrs.length - 1; i++){\n\t\t\t\t\t// Pn\n\t\t\t\t\tvar Pnx = x + nbrs[i][1];\n\t\t\t\t\tvar Pny = y + nbrs[i][0];\n\t\t\t\t\tvar PnPixel = _this.getPixelData(Pnx, Pny, imgData);\n\n\t\t\t\t\tif(PnPixel[0] === 255){\n\t\t\t\t\t\t// Pn + 1\n\t\t\t\t\t\tvar Pn1x = x + nbrs[i + 1][1];\n\t\t\t\t\t\tvar Pn1y = y + nbrs[i + 1][0];\n\t\t\t\t\t\tvar Pn1Pixel = _this.getPixelData(Pn1x, Pn1y, imgData);\n\n\t\t\t\t\t\tif(Pn1Pixel[0] !== 255){\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t}", "title": "" }, { "docid": "0b3a7bebbb940c33a3913031a8962a15", "score": "0.4922351", "text": "hasInputs() {\n\t\treturn this.features.some(feature=>feature.hasInputs())\n\t}", "title": "" }, { "docid": "da493d0d09d4155418141ee78eae63c6", "score": "0.49146152", "text": "function featureCountForPropertyAndCellCount(propertyCount, cellCount) {\n return Math.floor(cellCount / propertyCount);\n}", "title": "" }, { "docid": "dd4b53e41ef9e7f4d6257f107e236f8b", "score": "0.49120393", "text": "findEmpty() {\n\t\tlet a = 0;\n\t\tthis.p12.forEach((point) => {\n\t\t\ta += point.x + point.y;\n\t\t});\n\t\treturn a > 0;\n\t}", "title": "" }, { "docid": "113c64ca559a557f85f9e942bdd6fba3", "score": "0.4910421", "text": "length() {\n if (!this.data.length) {\n return 0;\n }\n return this.previousSetBit(unIndex(this.data.length) - 1) + 1;\n }", "title": "" }, { "docid": "10c5b8c0043b38b3615981492809573b", "score": "0.49091342", "text": "function getDataFieldCount() {\r\n\treturn $('#fieldDataHolder .card-panel').length;\r\n}", "title": "" }, { "docid": "a07f3877d54c595cb22d320f2046b86c", "score": "0.49035007", "text": "getNumberOfTransformations() {\n return this.transformationList.length;\n }", "title": "" }, { "docid": "e38bbe32c58f0d8f74e2caad611ceec8", "score": "0.49011886", "text": "function isValidNumOpt() {\n \n const totalOpt = 4;\n\n const atLeast = 2;\n\n let container = [ANSWER_A.value, ANSWER_B.value, ANSWER_C.value, ANSWER_D.value];\n\n let counter = 0;\n\n for(let i = 0; i < totalOpt; ++i) {\n if(container[i]) \n counter++;\n }\n\n return counter >= atLeast;\n\n}", "title": "" }, { "docid": "79b134a283452d389fe5212e0fcb4fd9", "score": "0.48936394", "text": "function skill_len(student){\n let skill_set = student.skills\n return Object.keys(skill_set).length\n}", "title": "" } ]
8ecfc0edc4e3f6ed84eff7a621494363
Adds an frame to the AnimatedDrawable with the given filename. A length of time (in milliseconds) can be supplied for how long the particular image is shown. By default, the length is 1000 milliseconds. parameters: filename: string time (optional): number
[ { "docid": "9e2437818e7b54a53d6099e487c694d0", "score": "0.68175215", "text": "addFrame(filename, time) {\n var time = time || 1000;\n this.frames.push(filename)\n this.timings.push(time);\n }", "title": "" } ]
[ { "docid": "8f2d50ec1bf7598a9be1333256743cdb", "score": "0.6202898", "text": "addFrames(filenames, timings) {\n if (!Array.isArray(timings)) {\n timings = new Array();\n }\n for (var i = 0; i < filenames.length; i++) {\n this.addFrame(filenames[i], timings[i]);\n }\n }", "title": "" }, { "docid": "f349a71edf90a36dcc6d982eb6d697da", "score": "0.53051656", "text": "function framesLoad() {\n // Upload the frames from local file\n for (let i = 0; i < NUM_FRAMES; i++) {\n let frame = (`<img class=\"frames\" id='frame${i}' src=\"assets/images/video_frames/Alpha_Eclipse_0${i}.jpg\">`);\n animationFrames.push(frame);\n // Since there is a delay, check when its loaded\n if (animationFrames.length === NUM_FRAMES) {\n animationFramesLoaded = true;\n }\n }\n}", "title": "" }, { "docid": "991957f6db812147a2d6e53f7e54c0a5", "score": "0.5186687", "text": "createAnimation(name, frames, frameRate, repeat)\n {\n this.scene.anims.create({\n key: name,\n frames: this.scene.anims.generateFrameNumbers(this.spritesheet, { frames: frames }),\n frameRate: frameRate,\n repeat: repeat\n });\n }", "title": "" }, { "docid": "e933840db8372539b25c3512994c2a2f", "score": "0.5143824", "text": "add(options) {\n options.texture.repeat.set(\n // 1 / options.tilesHorizontal,\n // 1 / options.tilesVertical\n 1 / 2,\n 1\n );\n const animation = {\n fps: 60,\n duration: Infinity,\n repeat: Infinity,\n startFrame: 0,\n numberOfTiles: options.tilesHorizontal * options.tilesVertical,\n ...options,\n };\n\n animation.currentTile = animation.startFrame;\n animation.looped = 0;\n this.animations.push(animation);\n return animation;\n }", "title": "" }, { "docid": "e19e5fb087a6fc39c719615ca4389d15", "score": "0.5022432", "text": "constructor(spritesheet, xStart, yStart, width, height, frameCount, frameDuration, framePadding, reverse, loop) {\n Object.assign(this, { spritesheet, xStart, yStart, height, width, frameCount, frameDuration, framePadding,\n reverse, loop });\n\n this.elapsedTime = 0;\n this.totalTime = this.frameCount * this.frameDuration;\n }", "title": "" }, { "docid": "be594b1f7942ff0f3d5bffb67141f8d0", "score": "0.50119", "text": "draw(framesCounter) {\n \n this.ctx.drawImage(\n\n this.playerImage,\n this.playerImage.framesIndex * Math.floor(this.playerImage.width / this.playerImage.frames),\n 0,\n Math.floor(this.playerImage.width / this.playerImage.frames),\n this.playerImage.height,\n this.playerPos.x,\n this.playerPos.y,\n this.width,\n this.height,\n this.updatePosition()\n );\n\n this.animate(framesCounter);\n }", "title": "" }, { "docid": "5d08e167f01ef379e65f7cafbffba5cb", "score": "0.49559438", "text": "animate(framesCounter) {\n\n if (framesCounter % 3 == 0) {\n this.playerImage.framesIndex++;\n }\n \n if (this.playerImage.framesIndex > this.playerImage.frames - 1) {\n this.playerImage.framesIndex = 0;\n\n }\n }", "title": "" }, { "docid": "b0984304e3d7891f5fff91239697647f", "score": "0.49453396", "text": "function animate() {\n ctx2.save();\n ctx2.clearRect(25, 25, 360, 360);\n createText();\n loadButton();\n //draw each frame + place them in the middle\n ctx2.drawImage(myImage, shift, 0, frameWidth, frameHeight,\n 25, 25, frameWidth, frameHeight);\n shift += frameWidth;\n if (currentFrame == totalFrames) {\n shift = 0;\n currentFrame = 0;\n }\n currentFrame++; \n requestAnimationFrame(animate);\n}", "title": "" }, { "docid": "23bba6e9c5d5a7b5ad47049e515270b4", "score": "0.4936737", "text": "function Animation(sprite, width, height, frame_count){\n var image_object = assetManager.getAsset(sprite);\n\n this.image = image_object;\n this.image_width = width;\n this.image_height = height;\n this.frame_count = frame_count;\n}", "title": "" }, { "docid": "cc0702bfa29e46d1ba005c8fc1485989", "score": "0.49312094", "text": "function animate(timestamp) {\n let canvas = initFullScreenCanvas(\"mainCanvas\");\n let ctx = canvas.getContext(\"2d\");\n\n let now = timestamp || new Date().getTime();\n let passed = now - frameStart;\n let timePassed = (now - animationStartTime)%duration;\n let fraction = timePassed/duration;\n let currentFrame = Math.abs(Math.floor(fraction*numFrames));\n \n ctx.fillStyle = '#fff';\n ctx.fillRect(0,0, 500, 500);\n spriteSheet.drawFrame(ctx, currentFrame, 200, 200);\n requestAnimationFrame(arguments.callee);\n}", "title": "" }, { "docid": "37628e2be7e6251599bb35039a789b55", "score": "0.48868895", "text": "function changeImage() {\n //debugger;\n var imageSrc = document.getElementById(\"image\").getAttribute(\"src\");\n var currentImageNumber = imageSrc.substring(imageSrc.lastIndexOf(\"/\") + 1, imageSrc.lastIndexOf(\".\"));\n if (currentImageNumber >= 239) {\n currentImageNumber = 0;\n }\n var newImage = \"/frames/\" + (Number(currentImageNumber) + 1) + \".gif\";\n document.getElementById(\"image\").setAttribute(\"src\", newImage);\n document.getElementById(\"result\").innerHTML = newImage;\n}", "title": "" }, { "docid": "af7eb1e4d4a34de1ff7bd91d84f69d7e", "score": "0.48658866", "text": "function draw_image_animation(img_src,sx,sy,swidth,sheight,x,y,width, height) {\n var img=new Image();\n\n img.src = img_src;\n ctx.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);\n}", "title": "" }, { "docid": "fb97475c75e4e0da7749170d1d86d2bf", "score": "0.48218188", "text": "function drawImage(array, loopTimes)\n{\n\t \tbase_image = new Image();\n\t \tbase_image.src = 'assets/img/' + array[loopTimes];\n\t \tbase_image.setAtX = loopTimes * 60;\n\t \tbase_image.onload = function(){\n\t\t\tctx.drawImage(this, this.setAtX, 50);\n\t\t}\n}", "title": "" }, { "docid": "01c36ac993fea537e426cbd6016464bd", "score": "0.48001006", "text": "function Animation(objectId, frames, repeat) {\n this.objectId = objectId;\n this.frames = frames || [];\n this.repeat = repeat || false;\n\n this.currentFrame = -1;\n}", "title": "" }, { "docid": "ae8e8abd1fb378758e53ceb61e355cde", "score": "0.47969344", "text": "function Animation(spriteSheet, frameWidth, frameHeight, frameDuration, frames, loop, reverse, type) {\r\n this.spriteSheet = spriteSheet;\r\n this.frameWidth = frameWidth;\r\n this.frameDuration = frameDuration;\r\n this.frameHeight = frameHeight;\r\n this.frames = frames;\r\n this.totalTime = frameDuration * frames;\r\n this.elapsedTime = 0;\r\n this.loop = loop;\r\n this.reverse = reverse;\r\n this.type = type;\r\n this.timesLooped = 0;\r\n}", "title": "" }, { "docid": "b08d9f8c95f268d06cc545d768625814", "score": "0.47953415", "text": "function Animation(spriteSheet, startX, startY, frameWidth, frameHeight, frameDuration, frames, loop, reverse) {\n this.spriteSheet = spriteSheet;\n this.startX = startX;\n this.startY = startY;\n this.frameWidth = frameWidth;\n this.frameDuration = frameDuration;\n this.frameHeight = frameHeight;\n this.frames = frames;\n this.totalTime = frameDuration * frames;\n this.elapsedTime = 0;\n this.loop = loop;\n this.reverse = reverse;\n this.completed = false;\n\n\n}", "title": "" }, { "docid": "0dbdd95f40c651d18671d72c460eb19c", "score": "0.47924826", "text": "function Frames (count) {\n this.count = count\n this.frame = 0\n }", "title": "" }, { "docid": "2ab47384c753676ae9b67a2265b5644b", "score": "0.47742537", "text": "function SpriteSheet(path, frameWidth, frameHeight, frameSpeed, endFrame) {\n let image = new Image();\n let framesPerRow;\n\n //calculate number of frames per framesPerRow\n let self = this;\n image.onload = function() {\n framesPerRow = Math.floor(image.width / frameWidth);\n };\n\n image.src = path;\n //frames to draw\n let currentFrame = 0;\n //frame rate\n let counter = 0;\n\n //animation update\n this.update = function() {\n\n // Draw the current frame\n this.draw = function(x, y) {\n // get the row and col of the frame\n var row = Math.floor(currentFrame / framesPerRow);\n var col = Math.floor(currentFrame % framesPerRow);\n\n ctx.drawImage(\n image,\n col * frameWidth, row * frameHeight,\n frameWidth, frameHeight,\n x, y,\n frameWidth, frameHeight);\n };\n }\n }", "title": "" }, { "docid": "c633596508730e3048058c99ba9aec59", "score": "0.4769888", "text": "loadImage(filename){\n\t\tvar t = this;\n\t\tthis.displayImage = new Image();\n \t\tthis.displayImage.onload = function(){\n \t\t\tt.loaded = true;\n \t\t\tt.w = this.width;\n \t\t\tt.h = this.height;\n \t\t};\n \t\tthis.displayImage.src = 'resources/' + filename;\n\t}", "title": "" }, { "docid": "888fb1db5393ec7daa38481f571bcc5c", "score": "0.4749955", "text": "function loadImage(e) {\n animate();\n}", "title": "" }, { "docid": "e246bcff90120aaff2a52bb496db2962", "score": "0.47409916", "text": "set AddFrame(value) {\n this._paths.push(value);\n }", "title": "" }, { "docid": "fe3f3ebc8a7cf1e7e717d4109cad5d5d", "score": "0.4734016", "text": "draw() {\n if (this.imgloaded) {\n if (this.waitFrames > 0) {\n this.waitFrames -= this.frameSpeed;\n } else {\n this.waitFrames = this.maxWaitFrames;\n \n // Dont animate if the animation is supposed to be stopped\n if (!this.isStopped) {\n this.isFrame1 = !this.isFrame1;\n }\n }\n \n if (this.isFrame1) {\n engine.gfxController.drawSprite(\n this.img,\n 0,\n 0, \n 164,\n 72,\n this.x,\n this.y,\n this.spriteWidth,\n this.spriteHeight\n );\n } else {\n engine.gfxController.drawSprite(\n this.img,\n 164,\n 0,\n 164,\n 72,\n this.x,\n this.y,\n this.spriteWidth,\n this.spriteHeight\n );\n }\n }\n }", "title": "" }, { "docid": "542b35040ebe4d8c9b2c8723f56b834b", "score": "0.47317028", "text": "fileComplete (progress, cacheKey, success, totalLoaded, totalFiles) {\n this.text.setText('File Complete: ' + progress + '% - ' + totalLoaded + ' out of ' + totalFiles);\n\n var newImage = this.add.image(this.x, this.y, cacheKey);\n\n newImage.scale.set(0.3);\n\n this.x += newImage.width + 20;\n\n if (this.x > 700) {\n this.x = 32;\n this.y += 332;\n }\n }", "title": "" }, { "docid": "542b35040ebe4d8c9b2c8723f56b834b", "score": "0.47317028", "text": "fileComplete (progress, cacheKey, success, totalLoaded, totalFiles) {\n this.text.setText('File Complete: ' + progress + '% - ' + totalLoaded + ' out of ' + totalFiles);\n\n var newImage = this.add.image(this.x, this.y, cacheKey);\n\n newImage.scale.set(0.3);\n\n this.x += newImage.width + 20;\n\n if (this.x > 700) {\n this.x = 32;\n this.y += 332;\n }\n }", "title": "" }, { "docid": "dcdb6f86e1ca05f735878e738c193af8", "score": "0.47248214", "text": "function addNewFrame(i) {\n const addFrame = document.getElementById('addFrame');\n const frames = document.getElementById('frames');\n const current = document.getElementById('current');\n if (current !== null) {\n current.removeAttribute('id');\n }\n\n // add frame div\n const frame = document.createElement('div');\n frame.className = 'frame';\n frame.id = framesKeysArray[i];\n frames.insertBefore(frame, addFrame);\n\n // add canvas\n const canv = document.createElement('canvas');\n canv.className = `canvas canvas_${+framesKeysArray[i].match(/\\d+/)}`;\n canv.width = 128;\n canv.height = 128;\n canv.id = 'current';\n frame.appendChild(canv);\n const ctx = canv.getContext('2d');\n // eslint-disable-next-line max-len\n refresh(framesValuesArray[i], ctx, canv.width / framesValuesArray[i].length, framesValuesArray[i].length);\n instrument.array = JSON.parse(JSON.stringify(framesValuesArray[i]));\n\n\n // add copy div\n const copy = document.createElement('div');\n copy.className = 'framesFunctions copy';\n frame.appendChild(copy);\n\n // add delete div\n const del = document.createElement('div');\n del.className = 'framesFunctions delete';\n frame.appendChild(del);\n\n // add move div\n const move = document.createElement('div');\n move.className = 'framesFunctions move';\n frame.appendChild(move);\n\n // add number div\n const num = document.createElement('div');\n num.className = 'framesFunctions number';\n num.innerHTML = `${+framesKeysArray[i].match(/\\d+/)}`;\n frame.appendChild(num);\n }", "title": "" }, { "docid": "c33781974ac0605cc7965ffd0ca1eac8", "score": "0.4720641", "text": "constructor(x,y,width,height,imgName) {\n this.x = x\n this.y = y\n this.width = width\n this.height = height\n this.yDiff = 0\n // this.img.src = 'file extension'+ imgName +'rest of files extension'\n }", "title": "" }, { "docid": "35825d7cde2bf1c243167e70a0e6098a", "score": "0.4711463", "text": "function Animation(spriteSheet, startX, startY, frameWidth, frameHeight, frameDuration, frames, loop, reverse) {\n this.spriteSheet = spriteSheet;\n this.startX = startX;\n this.startY = startY;\n this.frameWidth = frameWidth;\n this.frameDuration = frameDuration;\n this.frameHeight = frameHeight;\n this.frames = frames;\n this.totalTime = frameDuration * frames;\n this.elapsedTime = 0;\n this.loop = loop;\n this.reverse = reverse;\n}", "title": "" }, { "docid": "939ffcf2bbc2c9315e32ba84cd04a4aa", "score": "0.47095767", "text": "function makeGif(images, name) {\n var gif = new GIF({\n workers: 1,\n quality: 10,\n width: lsize,\n height: lsize,\n });\n\n for (var y = 0; y < images.length; y++) {\n gif.addFrame(images[y]);\n }\n\n gif.on('finished', function(blob) {\n saveAs(blob, name+\".gif\");\n });\n\n gif.render();\n}", "title": "" }, { "docid": "2d97a95e2be403c338abbf55d04e8828", "score": "0.47091398", "text": "addFrame() {\r\n if (!this.isRecording) {\r\n this._addFrame();\r\n } else {\r\n throw P5GIFError(\"cannot add frame when recording has started.\");\r\n }\r\n return this;\r\n }", "title": "" }, { "docid": "5e44ba8722e077b06a2a6e982d7aea5a", "score": "0.47078657", "text": "makeFrames(img, width, height)\n {\n let frameCount = Math.floor(this.image.width/this.width);\n for (let i = 0; i < frameCount; i++)\n {\n let frame = document.createElement(\"canvas\");\n let ctx = frame.getContext(\"2d\");\n frame.width = this.width;\n frame.height = this.height;\n ctx.drawImage(this.image, i*this.width, 0, this.width, this.height, 0, 0, this.width, this.height);\n this.frames.push(frame);\n }\n }", "title": "" }, { "docid": "dd3adabd99230b88c723e8f47a46ab32", "score": "0.47070011", "text": "function AnimatedImage(frameWidth, frameHeight, frameCount, imgurl, frameDelay) {\n\tthis.frameCount \t\t= frameCount;\n\tthis.bUseFrameDelay\t\t= false;\n\tif (frameDelay > 0) {\n\t\tthis.bUseFrameDelay = true;\n\t\tthis.frameDelay \t\t= frameDelay;\n\t\tthis.frameDelayCount \t= 0;\n\t}\n\tthis.frame\t\t\t\t= 0;\n\tthis.x\t\t\t\t\t= 0;\n\tthis.frameHeight \t\t= frameHeight;\n\tthis.frameWidth \t\t= frameWidth;\n\tthis.img\t\t\t\t= new Image();\n\tthis.img.src\t\t\t= imgurl;\n\tthis.canvas\t\t\t\t= document.createElement(\"canvas\"); \n\tthis.canvas.width\t\t= frameWidth;\n\tthis.canvas.height\t\t= frameHeight;\n\tdocument.body.insertBefore(this.canvas, document.body.childNodes[0]);\n\t\n\tthis.Update = function() {\n\t\tvar ctx \t= this.canvas.getContext(\"2d\");\n\t\tif (this.bUseFrameDelay == true) {\n\t\t\tif (((this.frameDelayCount++) % this.frameDelay) == 0) {\n\t\t\t\tthis.frame \t= (this.frame + 1) % this.frameCount;\n\t\t\t\tthis.x \t\t= this.frame * this.frameWidth;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.frame \t= (this.frame + 1) % this.frameCount;\n\t\t\tthis.x \t\t= this.frame * this.frameWidth;\n\t\t}\n\t\t// draw a selected potion of the image on the canvas - the arguments are not in a logical order\n\t\t// first argument is the image object itself\n\t\t// second and third argument are the x,y start position in the IMAGE\n\t\t// fourth and fifth are the width and height of the CANVAS to use\n\t\t// sixth and seventh is the position relative to the CANVAS to place the image\n\t\t// eigth and ninth are the size of the box in the IMAGE to draw\n\t\tctx.drawImage(this.img, this.x, 0, frameWidth, frameHeight, 0, 0, frameWidth, frameHeight);\n\t}\n}", "title": "" }, { "docid": "2d539a40ed5964c740306fcfae824a57", "score": "0.4671904", "text": "addSprite(path, type, container, length) {\n let newString = '';\n let img = new Image();\n for (let i = 1; i <= length; i++) {\n newString = (i < 10) ? '0' + i : String(i);\n newString = path + newString + type;\n img = new Image();\n img.src = newString;\n container.push(img);\n }\n }", "title": "" }, { "docid": "58195d7c17960859969035b134fe0d87", "score": "0.46650082", "text": "_onImagesLoaded() {\n // calculate how long each frame should be displayed\n this._frameDuration = this._options.get('duration') / this._images.length;\n //console.log(`Frame duration = ${this._frameDuration}`)\n //this._contentBuffer.clear()\n this._contentBuffer.context.drawImage(this._images[this._frameIndex], 0, 0, this.width, this.height);\n this._layerUpdated();\n if (this._options.get('autoplay')) {\n this.play();\n }\n }", "title": "" }, { "docid": "36014ed0c5045ae5cc979e6395a92a5d", "score": "0.4639685", "text": "function sprite(target, framewidth, totalframe, property, time, loop) {\n var currentframe, temp = {};\n totalframe--;\n\n function onupdate(e) {\n var frame = Math.round(totalframe * e.v);\n if (currentframe != frame) {\n style.set(target, property, -framewidth * frame);\n currentframe = frame;\n }\n }\n\n function play() {\n stop();\n animate(temp, {\n v: 1\n }, {\n time: time,\n loop: loop,\n rounding: false,\n easing: 'linear',\n onupdate: onupdate\n });\n }\n\n function stop() {\n stopanimate(temp);\n currentframe = -1;\n temp.v = 0;\n }\n return {\n play: play,\n stop: stop\n }\n }", "title": "" }, { "docid": "41528fc357ab3bfb87e81e827cb35288", "score": "0.4631568", "text": "function drawThatFrame(direction) {\n var animationStatus = applicationTime - animationStartTime;\n var whichFrame = Math.floor(animationStatus / frameDuration);\n whichFrame %= currentAnimation.length;\n //var tCoord = textureCoords[currentAnimation[whichFrame]];\n\tvar curBird;\n\tif(currentBird == \"noimg\"){\n\t\tcurrentBird = parseInt(0, 10);\n\t}\n\telse if(direction == \"left\" && parseInt(currentBird, 10) == 0){\n\t\tcurrentBird = myBird.length;\n\t}else if(direction == \"left\"){\n\t\tcurrentBird = parseInt(currentBird, 10) - 1;\n\t}else if(direction == \"right\" && parseInt(currentBird, 10) == myBird.length){\n\t\tcurrentBird = parseInt(0, 10);\n\t}else{\n\t\tcurrentBird = parseInt(currentBird, 10) + 1;\t\n\t}\n\t//curBird = parseInt(currentBird, 10);\n context.drawImage(myBird[currentBird], -120, -20);\n}", "title": "" }, { "docid": "e0c8ee5e7788ffc88002ef69520f4589", "score": "0.46016413", "text": "function ZombieAnimation(spriteSheet, frameWidth, frameHeight, frameDuration, frames, loop, reverse) {\n this.spriteSheet = spriteSheet;\n this.frameWidth = frameWidth;\n this.frameDuration = frameDuration;\n this.frameHeight = frameHeight;\n this.frames = frames;\n this.totalTime = frameDuration * frames;\n this.elapsedTime = 0;\n this.loop = loop;\n this.reverse = reverse;\n}", "title": "" }, { "docid": "a3f84c1a126537ccb3d060876c0fbc38", "score": "0.4594961", "text": "function BowserFireAnimation(spriteSheet, frameWidth, frameHeight, frameDuration, frames, loop, reverse) {\n this.spriteSheet = spriteSheet;\n this.frameWidth = frameWidth;\n this.frameDuration = frameDuration;\n this.frameHeight = frameHeight;\n this.frames = frames;\n this.totalTime = frameDuration * frames;\n this.elapsedTime = 0;\n this.loop = loop;\n this.reverse = reverse;\n}", "title": "" }, { "docid": "ca0ce9ff41bfdad63da38e7759cff42c", "score": "0.4590194", "text": "function imageConstructor(imageID, filePath){\r\n this.imageID = imageID;\r\n this.filePath = filePath;\r\n this.timesClicked = 0;\r\n this.timesShown = 0;\r\n}", "title": "" }, { "docid": "6e7a0d51cc1c519f4d7d43dfdc81c613", "score": "0.45826247", "text": "async function loadImage(filename, index, onLoad) {\n\t\t\t\t\n\t\t\t\tvar newImg = document.createElement('img');\n\n\t\t\t\tnewImg.src = 'graphics/'+ filename + '.png';\n\n\t\t\t\tfunction loaded() {\n\n\t\t\t\t\tvar newCanvas = document.createElement('canvas');\n\t\t\t\t\tnewCanvas.width = this.width;\n\t\t\t\t\tnewCanvas.height = this.height;\n\t\t\t\t\tnewCanvas.getContext('2d').drawImage(this, 0, 0);\n\n\t\t\t\t\tpreload.appendChild(newCanvas);\n\n\t\t\t\t\t//store a reference to the canvas\n\t\t\t\t\tglobal.images[filename] = newCanvas;\n\n\t\t\t\t\ttracker.imagesLoaded++;\n\t\t\t\t\tupdateLoadingBar(tracker);\n\n\t\t\t\t\tif (onLoad) onLoad(index + 1);\n\n\t\t\t\t\t//resolve the Promise once all the images are loaded\n\t\t\t\t\tif (tracker.imagesLoaded >= tracker.numImages) resolve();\n\n\t\t\t\t\tthis.removeEventListener('load', loaded);\n\n\t\t\t\t}\n\n\t\t\t\tnewImg.addEventListener('load', loaded);\n\t\t\t}", "title": "" }, { "docid": "3b7f228305c271152e870639d489635e", "score": "0.45806813", "text": "draw() {\r\n this.ctx.drawImage(\r\n this.image,\r\n this.animCount * this.width,\r\n this.animRow * this.height,\r\n this.width,\r\n this.height,\r\n this.x + this.offsetX,\r\n this.y + this.offsetY,\r\n this.width,\r\n this.height\r\n );\r\n\r\n if (this.animDelayCount++ > this.animDelay) {\r\n this.animCount += 1;\r\n if (this.animCount > this.animEnd) {\r\n if (this.animLoop) {\r\n this.animCount = this.animStart;\r\n } else {\r\n this.animCount = this.animEnd;\r\n }\r\n }\r\n this.animDelayCount = 0;\r\n }\r\n }", "title": "" }, { "docid": "0e463399815552d58a56829f6ffa919a", "score": "0.4573965", "text": "createAnimation() {\n this.scene.anims.create({\n key: 'explode',\n frames: this.scene.anims.generateFrameNumbers('explosion', {\n start: 0,\n end: 6\n }),\n frameRate: FRAMERATE\n });\n }", "title": "" }, { "docid": "d7b0eff94c6dfd8c2ca143e8e20a3fbf", "score": "0.45690143", "text": "function Object_Animation(record) {\n var component;\n Object_Animation.__super__.constructor.call(this);\n this.image = record != null ? record.graphic.name : void 0;\n component = new gs.Component_FrameAnimation(record);\n this.addComponent(component);\n }", "title": "" }, { "docid": "73cc5e2261b7368284137a11b04622f0", "score": "0.45623648", "text": "sampleImage(){\n\t\tvar tempImage = $(\"<img>\",{\n\t\t\t'src': this.props.imageFile,\n\t\t\ton: {\n\t\t\t\tload: ()=> {\n\t\t\t\t\tthis.state.fullWidth = event.target.naturalWidth;\n\t\t\t\t\tthis.state.frameCount = this.state.fullWidth / this.props.frameWidth;\n\t\t\t\t\ttempImage.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "dd50f581c323c7ce7029c20b9652972f", "score": "0.4557272", "text": "function animationFrame() {\r\n var elapsed = (Date.now() - startTimeMS) / 1000;\r\n startTimeMS = Date.now();\r\n\r\n //only update frames when timer is below 0\r\n frameTimer = frameTimer - elapsed;\r\n if (frameTimer <= 0) {\r\n frameTimer = frameTimeMax;\r\n frameX++;\r\n if (frameX > frameXMax) {\r\n frameX = 0;\r\n frameY++;\r\n //end of row, move down to next row in sheet\r\n if (frameY > frameYMax) {\r\n frameY = 0;\r\n }\r\n }\r\n frame++;\r\n //reset frames to 0 in event that there are empty spaces on sprite sheet\r\n if (frame > frameMax) {\r\n frame = 0;\r\n frameX = 0;\r\n frameY = 0;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "465e41b6aaa90835c2d37e84a9a30deb", "score": "0.45480713", "text": "static fromFrames(frames) {\n const textures = [];\n for (let i2 = 0; i2 < frames.length; ++i2)\n textures.push(Texture.from(frames[i2]));\n return new AnimatedSprite(textures);\n }", "title": "" }, { "docid": "de7c2c20b8245ff6eb26c56955229ce3", "score": "0.45410943", "text": "createLoop() {\n var img = new Image()\n img.onload = ()=> { \n this.nextLoop=this.timeOut((this.loopspeed*1000));\n this.nextLoop.then(()=>{this.createLoop()});\n this.fixSize(img)\n };\n img.src = `${this.url}/api/v1/media/${this.images[this.index].id}/file?token=${this.token}`;\n this.index++;\n\n if (this.index > this.images.length - 1) {\n this.index = 0;\n }\n \n\n }", "title": "" }, { "docid": "f0bf83581bfa72c88a960a7d74cd9f55", "score": "0.453578", "text": "function addDelay(delay) {\n\t\tremoveDelay();\n\t\t_delayTimeout = window.setTimeout(function () {\n\t\t\t_requestID = setAnimation(onUpdateFrames, $this.element, $this.fps);\n\t\t\tif (typeof _vars.onStart === 'function') {\n\t\t\t\t_vars.onStart.apply($this, _vars.onStartParams);\n\t\t\t}\n\t\t\t$this.running = true;\n\t\t}, delay);\n\t}", "title": "" }, { "docid": "4c7984d1bed32324ccabb73fb3c27007", "score": "0.4533612", "text": "__newPhotoShowedUp(e) {\n let file = new File([e.detail.raw], \"headshot\" + e.timeStamp + \".jpg\");\n this.shadowRoot.querySelector(\"#fileupload\")._addFile(file);\n }", "title": "" }, { "docid": "f6477f4fba16cefb971bf4146851a337", "score": "0.45281145", "text": "function start()\n{\n\tif (count == arr.length){\n \t\tcount=0;\n\t}\n\t\n\tvar img = document.getElementById(\"showing\");\n\timg.src = arr[count];\n\timg.style.width=\"500px\";\n\timg.style.height=\"500px\";\n\tcount++; \n\n\tmyFlag = setTimeout(start, 2000);\n}", "title": "" }, { "docid": "b40861420c41d223a9a9ed8c3a43a5a3", "score": "0.45136622", "text": "setFrame (frameIndex, time, r, g, b, a) {\n frameIndex *= ColorTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + ColorTimeline.R] = r;\n this.frames[frameIndex + ColorTimeline.G] = g;\n this.frames[frameIndex + ColorTimeline.B] = b;\n this.frames[frameIndex + ColorTimeline.A] = a;\n }", "title": "" }, { "docid": "daeeda2b1ab97545f00c8bde404af419", "score": "0.45111573", "text": "function updateFrame() {\r\n var video = document.getElementById(\"movies\");\r\n var timeline = document.getElementById(\"timeline\");\r\n\r\n var ctx = timeline.getContext(\"2d\");\r\n\r\n // calculate out the current position based on frame\r\n // count, then draw the image there using the video\r\n // as a source\r\n var framePosition = frameCount % frameGrid;\r\n var frameX = (framePosition % frameColumns) * frameWidth;\r\n var frameY = (Math.floor(framePosition / frameRows)) * frameHeight;\r\n ctx.drawImage(video, 0, 0, 400, 300, frameX, frameY, frameWidth, frameHeight);\r\n\r\n frameCount++;\r\n }", "title": "" }, { "docid": "9a55794175e93f0bffba48361b0f9a2d", "score": "0.45104524", "text": "function addFrame(delta) {\r\n if (frames_count <= MAX_BOTTOM_GALLERY_FRAMES_COUNT) {\r\n \r\n frames_count++;\r\n if (deletedIdArray.length == 0) {\r\n lastFrameId = frames_count;\r\n }\r\n else {\r\n lastFrameId = deletedIdArray[index];\r\n deletedIdArray.splice(index, 1);\r\n }\r\n lastFrameId = lastFrameId.toString();\r\n curFrameId = lastFrameId;\r\n //creating new frame\r\n $('<form>').attr({ id: lastFrameId, style: 'z-index: 1;float:left; position:relative; margin:15px; left:20px; top:15px; border: 1px solid rgb(204, 204, 204); height:100px; width:100px' })\r\n .append($('<div>').attr({ id: 'paper'.concat(lastFrameId), style: 'position:absolute;left:-30px;top:-30px;' }))\r\n .append($('<div>').attr({style:'position:absolute; left:-1px; top:-1px; border: 1px solid rgb(204, 204, 204);pointer-events: auto; height:100px;width:100px'}))// rect arount image\r\n .append($('<img>').attr({ id: 'img'.concat(lastFrameId), style: 'z-index: 2; position:absolute;left:0px;top:0px;', height: '100px', width: '100px' }))\r\n .appendTo('#imgsHolder');\r\n addRadiusBttns(lastFrameId, delta);\r\n addDeleteButton(lastFrameId);\r\n //create new Frame object(container of wall, mask and sticker itemg)\r\n imagesDict[lastFrameId] = new Frame(lastFrameId);\r\n sijax_data('lastFrameId', lastFrameId)\r\n }\r\n else {\r\n alert(\"The limit of frames is exhausted!\")\r\n }\r\n\r\n}", "title": "" }, { "docid": "078c1b1c2ef97ff8c467265bc954a2d1", "score": "0.45086467", "text": "componentDidMount(){\n //add a duration of 2 seconds, and make its end value 400 for the size of the images.\n Animated.timing(this.sizeAnimation, {\n toValue: 400,\n duration: 2000\n }).start()\n \n Animated.timing(this.fadeIn, {\n toValue:1,\n duration:2000,\n }).start()\n }", "title": "" }, { "docid": "b3e4ca1d2ea827766d83daeb711c7835", "score": "0.44995782", "text": "function _animationFrame(fn) {\n var tolerance = 0.1;\n var fps = 60;\n var delay = 1e3 / fps;\n var lastTimeout = 0;\n var lastIteration = 0;\n var args;\n\n function iteration() {\n lastIteration = now();\n fastApply(fn, args);\n }\n\n function run() {\n var thisIteration = now();\n args = arguments;\n if (thisIteration - lastIteration > delay - tolerance) {\n clearTimeout(lastTimeout);\n iteration();\n } else {\n lastTimeout = setTimeout(iteration, delay % (thisIteration - lastIteration));\n }\n }\n this.run = run;\n }", "title": "" }, { "docid": "3a238e3a979697e6926be505baf7935d", "score": "0.44903114", "text": "function Animation(spriteSheet, frameWidth, frameHeight, sheetWidth, frameDuration, frames, \n loop, scale, startFrame) {\n this.spriteSheet = spriteSheet;\n this.frameWidth = frameWidth;\n this.frameDuration = frameDuration;\n this.frameHeight = frameHeight;\n this.sheetWidth = sheetWidth;\n this.frames = frames;\n this.totalTime = frameDuration * frames;\n this.elapsedTime = 0;\n this.loop = loop;\n this.scale = scale;\n this.startFrame = startFrame;\n this.animations = [];\n}", "title": "" }, { "docid": "05f09d483d182c3270b810de1b034220", "score": "0.44879246", "text": "function placeTimeRef (name, font, size, color, frameColor) { // timecode + currframe + fps , string, # pt, int, array, array\n var doc = app.activeDocument\n var posX, posY, alignId\n var timeRef = doc.artLayers.add()\n timeRef.kind = LayerKind.TEXT\n timeRef.textItem.contents = name\n timeRef.textItem.size = new UnitValue(size, 'pt')\n timeRef.textItem.font = font\n var solidColor = new SolidColor()\n solidColor.rgb.red = color[0]\n solidColor.rgb.green = color[1]\n solidColor.rgb.blue = color[2]\n timeRef.textItem.color = solidColor\n\n var widthRatio = doc.width / (timeRef.bounds[2] - timeRef.bounds[0])\n if (widthRatio < 1) { // before adding frame\n timeRef.resize(widthRatio * 100, widthRatio * 100)\n }\n// var frameWidth = addFrameForArtboardName(timeRef.bounds[3] - timeRef.bounds[1], frameColor)\n var frameWidth = doc.width\n timeRef.move(doc.layers[0], ElementPlacement.PLACEBEFORE)\n var w = doc.width // after adding frame\n var h = doc.height\n var leftIndent = frameWidth\n var rightIndent = w - frameWidth\n var topIndent = frameWidth / 2\n var bottomIndent = h - frameWidth / 2\n posX = leftIndent\n alignId = 'Left'\n posY = topIndent\n var bnds = timeRef.bounds\n var textHeight = bnds[3] - bnds[1]\n var textWidth = bnds[2] - bnds[0]\n var textLayerYCenter = (bnds[1] + bnds[3]) / 2\n var deltaX = posX - bnds[0].value // adjust for bounds\n var deltaY = posY - textLayerYCenter.value // adjust for bounds\n timeRef.translate(deltaX, deltaY) // adjust for bounds\n return timeRef\n}", "title": "" }, { "docid": "3d64a1dc6e4ac312032046f96481c57c", "score": "0.44780752", "text": "function onRecorderStart() {\n\tinitialTime = new Date();\n\tlet interval = setInterval(() => {\n\t\tif (!recordGif) clearInterval(interval);\n\t\twindow.requestAnimationFrame(() =>\n\t\t\tgif.addFrame(canvas, {\n\t\t\t\tcopy: true,\n\t\t\t\tdelay: 50,\n\t\t\t})\n\t\t);\n\t}, 50);\n}", "title": "" }, { "docid": "5078a26b10897b82774d10803fa747f6", "score": "0.44766602", "text": "function addFrame() {\n setFrames([\n {\n uri: 'http://www.example.com',\n },\n ]);\n }", "title": "" }, { "docid": "17832ed6cf9f4f2d8d6ffc56af1accbd", "score": "0.44762155", "text": "function updateSlide(filePath){ \n console.log(\"***Updating slide...\"); \n $('#notre_frame').attr('src', filePath);\n console.log(\"***Slide updated\");\n}", "title": "" }, { "docid": "e983049780afef3f3c4558f8f268275c", "score": "0.4475411", "text": "function Pic(fileName, fileType){//requires string\n this.name = fileName;\n this.filepath = `./images/${fileName}.${fileType}`;\n this.timesClicked = 0;\n this.timesDisplayed = 0;\n this.percentClicked = 0;\n this.percentDisplayed = 0;\n pics.push(this);\n}", "title": "" }, { "docid": "6e4d14d6a431b1de72463825c545ce94", "score": "0.44712394", "text": "static thumbAnimation(obj, params, name, duration) {\n const navigationAnimation = new RODIN.AnimationClip(name, params);\n navigationAnimation.duration(duration);\n obj.animation.add(navigationAnimation);\n obj.animation.start(name);\n }", "title": "" }, { "docid": "0c59f33fb3b6f8738e4dbbc444ce7661", "score": "0.44689327", "text": "function animateDetail(thing, frame){\n\n thing.drawDetail(thing.detailContext, frame);\n if(frame < thing.nFrames){\n frame++;\n window.transAnimateLoop = setTimeout(function(){animateDetail(thing, frame)},thing.duration/thing.FPS*1000);\n }\n}", "title": "" }, { "docid": "0c59f33fb3b6f8738e4dbbc444ce7661", "score": "0.44689327", "text": "function animateDetail(thing, frame){\n\n thing.drawDetail(thing.detailContext, frame);\n if(frame < thing.nFrames){\n frame++;\n window.transAnimateLoop = setTimeout(function(){animateDetail(thing, frame)},thing.duration/thing.FPS*1000);\n }\n}", "title": "" }, { "docid": "c5f41208d366eaf6f6f5db6928a8716e", "score": "0.44664225", "text": "function AnimationFrame(animationClass,\n duration,\n expire,\n postAnimationHook,\n callHookIfExpired) {\n if (duration <= AnimationMachine.BUCKET_SIZE ||\n duration >= AnimationMachine.WINDOW_SIZE) {\n error('Invalid animation frame duration: ' + duration + '.' +\n ' Must be ' + AnimationMachine.BUCKET_SIZE + ' < duration < ' + AnimationMachine.WINDOW_SIZE);\n }\n\n this.animationClass = animationClass;\n this.duration = duration;\n this.expire = expire || false;\n this.postAnimationHook = postAnimationHook || null;\n this.callHookIfExpires = callHookIfExpired || false;\n}", "title": "" }, { "docid": "799920dee246627f79aef8f4ddc46b23", "score": "0.44566515", "text": "function timedFunction(filename) {\n return function(){\n loadJs(filename);\n }\n }", "title": "" }, { "docid": "799920dee246627f79aef8f4ddc46b23", "score": "0.44566515", "text": "function timedFunction(filename) {\n return function(){\n loadJs(filename);\n }\n }", "title": "" }, { "docid": "68e96204555591ab6b0e4cab81f0ad3c", "score": "0.44541067", "text": "start() {\r\n this.frameCounter = 0;\r\n this.animationRunning = true;\r\n }", "title": "" }, { "docid": "e1aea7d6fa20e400fe4352ef22f14dc1", "score": "0.44536543", "text": "function animation()\n{\n count = first_image;\n}", "title": "" }, { "docid": "cd5f9a6441e4625873df3dded96e6a40", "score": "0.44495413", "text": "function Animation(sprite, looping, frameTime) {\r\n this.sprite = sprite;\r\n this.frameTime = typeof frameTime != 'undefined' ? frameTime : 0.1;\r\n this.looping = looping;\r\n }", "title": "" }, { "docid": "3168ded0e79357b2f0c7028ffd081625", "score": "0.4439373", "text": "function appendElement(element) {\n element.setAttribute(\"class\", \"animation\");\n svgFrame.appendChild(element);\n}", "title": "" }, { "docid": "da9ff76fd88451cc24b5a9208a0840dd", "score": "0.44385627", "text": "nextFrame() {\r\n if (this.frameCounter >= this.framesPerAsset * this.assets.length - 1) {\r\n this.stop();\r\n } else {\r\n this.frameCounter++;\r\n }\r\n }", "title": "" }, { "docid": "2bf42c915b62c82a25fa9cf5a6009fcc", "score": "0.44382447", "text": "constructor(game, x, y, frame) {\n super(game, x, y, 'lava', frame);\n\n this.anchor.setTo(0.5, 0.5);\n var fillingAnim = this.animations.add('filling', [0,1,2], 2, false);\n fillingAnim.onComplete.add(function() { this.play('full'); }, this);\n this.animations.add('full', [3,4,5], 1, true);\n this.animations.stop();\n this.animations.play('filling');\n }", "title": "" }, { "docid": "43d9cf5551d4121e9e2494a84e680f81", "score": "0.44369483", "text": "function buildAnimation (cache, image, json, frameNames) {\n var frames = [];\n\n for (var i=0; i<frameNames.length; i++) {\n var frameName = frameNames[i];\n var data = cache.getByName(json).frames[frameName].frame;\n\n frames.push(\n new Kane.Frame({\n x: data.x,\n y: data.y,\n w: data.w,\n h: data.h\n })\n ); \n }\n\n return new Kane.Animation({\n image: cache.getByName(image),\n frames: frames,\n shouldLoop: true,\n fps: 1 \n });\n}", "title": "" }, { "docid": "493d40c5c3b369e2b77ce4ad66ad9610", "score": "0.4434221", "text": "function loadFile(e){\r\n var output = document.getElementById('preview');\r\n output.width = 54;\r\n output.src = URL.createObjectURL(e.target.files[0]);\r\n}", "title": "" }, { "docid": "65ceb125dafc71f421021353268d1890", "score": "0.44312322", "text": "function animate ({ avgFps, avgElapsed }) {\n const period = frames // 2 x for shuttle\n frameRef.current = (frameRef.current + 1) % (2 * period)\n const fc = frameRef.current\n const frame = (shuttle) ? period - Math.abs(period - fc) : fc % period\n\n draw(frame)\n if (showInfo || overlayColor) {\n const rest = { ctx: backing.ctx, engines: getEngines(), renderer, width, height, frames, overlayColor }\n annotate({ avgFps, avgElapsed, frame, ...rest })\n }\n }", "title": "" }, { "docid": "177e0420671fc7c3dd472155ddf36bb6", "score": "0.44305843", "text": "function updateFrame() {\r\n currentFrameTick = (++currentFrameTick);\r\n if (currentFrameTick % 5 == 0) {\r\n currentFrame = (++currentFrame) % frameCountColumns;\r\n }\r\n srcX = currentFrame * charWidth;\r\n srcY = 0;\r\n\r\n }", "title": "" }, { "docid": "a5bf9fe0bf569978c7c0c615dd034e69", "score": "0.44284064", "text": "function addImageFrame(){\n var parent = $('#ImageCapturer-Panel');\n var imageFrame = $('<div id=\"ImageCapturer-ImageFrame\"></div>')\n .css({\n width: '30%',\n height: '30%',\n borderRadius: '5px',\n margin: '40px auto 0px auto'\n })\n .appendTo(parent);\n}", "title": "" }, { "docid": "fd8d83c13fbb3d01dd7fd9a89c6d1334", "score": "0.441975", "text": "tumbnail(fname, time, outfile, size = undefined, quality = this.ffmpeg.DEFAULT_JPEG_QUALITY) {\n return this.ffmpeg.thumbnail(fname, time, outfile, size, quality);\n }", "title": "" }, { "docid": "954b3e82d5b70876946329bfa8d44fa6", "score": "0.4413341", "text": "function drawAni(){\r\n\tclearCanvas();\r\n\tvar img = new Image();\r\n\timg.onload = animate();\r\n\r\n\tvar fps = 10;\r\n\tvar xPos=0;\r\n\tvar yPos=0;\r\n\tfunction animate(){\r\n\tsetTimeout(draw,1000/fps);\r\n\t}\r\n\r\n\tfunction draw(){ \r\n\txPos++;\r\n\tyPos++;\r\n\tctx.clearRect(0,0,500,500);\r\n ctx.drawImage(img, xPos,200);\r\n ctx.drawImage(img, yPos,200);\r\n animate();\r\n\t}\r\n\r\n\timg.src = \"img.jpg\";\r\n}", "title": "" }, { "docid": "ea59178a2e969bae8b43ca97e0eb7a48", "score": "0.4407861", "text": "setFrame (frameIndex, time, attachmentName) {\n this.frames[frameIndex] = time;\n this.attachmentNames[frameIndex] = attachmentName;\n }", "title": "" }, { "docid": "5bc5d7e8ceb19735247a70a6e35da7cf", "score": "0.43934482", "text": "function addClip(n) {\n var d, t, dt, v;\n if (flist[n].jpg && flist[n].avi) {\n d = flist[n].dt;\n if (d.length === 14) {\n dt = d.substring(4, 6) + \"/\" + d.substring(6, 8) + \"/\" + d.substring(0, 4);\n t = d.substring(8, 10) + \":\" + d.substring(10, 12) + \":\" + d.substring(12, 14);\n } else {\n t = d; // just in case file name is not properly formatted\n }\n if (dt !== prevDt) {\n $(p).append(\"<div>\" + // inline block prevents X from wrapping to next line\n \"<h4 style='display:inline-block'>\" + dt + \"</h4>\" +\n \"<img class='deleteDate' src='/images/closeSign.png'/>\" +\n \"</div>\");\n prevDt = dt;\n }\n $(p).append(\"<span style='display:inline-block'>\" + // inline block prevents X from wrapping to next line\n \"<img class='motionSnapshot' src='\" + dir + \"/\" + flist[n].jpg + \"'\" +\n \" dt='\" + dt + \"'\" +\n \" title='\" + t + \"'\" +\n \" xfn='\" + n + \"'/>\" +\n \"<img class='closeSign' src='/images/closeSign.png'/>\" +\n \"</span>\");\n }\n }", "title": "" }, { "docid": "65f3831efd5c3c3dfd8e607be062879c", "score": "0.43911913", "text": "onFrame(timeToNextMS){\r\n\t\tvar self = this;\r\n\r\n\t\tif(self.stopped){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar frameStart = new Date().getTime();\r\n\r\n\t\tfunction onFrameCompleted(error){\r\n\t\t\tif(self.stopped){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif(timeToNextMS){\r\n\t\t\t\tvar now = new Date().getTime();\r\n\t\t\t\t// limit to [0, 10000]\r\n\t\t\t\ttimeToNextMS = Math.max(0, timeToNextMS);\r\n\t\t\t\ttimeToNextMS = Math.min(10000, timeToNextMS);\r\n\r\n\t\t\t\tvar timeElapsed = now - frameStart;\r\n\t\t\t\tvar triggerDelay = timeToNextMS - timeElapsed;\r\n\t\t\t\tif(triggerDelay < 1){\r\n\t\t\t\t\tvar fps = 1000 / timeElapsed;\r\n\t\t\t\t\tdc.console.log(`Animation lag at ${fps} fps`);\r\n\t\t\t\t\ttriggerDelay = 1;\r\n\t\t\t\t}\r\n\t\t\t\tsetTimeout(self.callOnFrameCaller.bind(self), triggerDelay);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar throttle = self.loadNextInStack();\r\n\t\t\t\tif(throttle){\r\n\t\t\t\t\tsetTimeout(self.callOnFrameCaller.bind(self), throttle);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tsetImmediate(self.callOnFrameCaller.bind(self));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tself.frameCallback(self.currentFrame, onFrameCompleted);\r\n\t}", "title": "" }, { "docid": "8ffb2d2a98827c1277b4fcb8de1bd18b", "score": "0.43864515", "text": "function file_handler(bitmap, canvas) {\n let ctx = canvas.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.drawImage(bitmap, 0, 0, canvas.width, canvas.height);\n canvas.dispatchEvent(new Event('_updated'));\n player.schedule_render();\n }", "title": "" }, { "docid": "33db2f1f726f5b972e4f0ebeb467f5e9", "score": "0.43840614", "text": "animatedSprite(key, layerName) {\n return this.canvasNodeFactory.addAnimatedSprite(key, layerName);\n }", "title": "" }, { "docid": "70ffd02b41fa4141d04f258fbb63b646", "score": "0.43666956", "text": "setFrame (frameIndex, time, r, g, b, a, r2, g2, b2) {\n frameIndex *= TwoColorTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + TwoColorTimeline.R] = r;\n this.frames[frameIndex + TwoColorTimeline.G] = g;\n this.frames[frameIndex + TwoColorTimeline.B] = b;\n this.frames[frameIndex + TwoColorTimeline.A] = a;\n this.frames[frameIndex + TwoColorTimeline.R2] = r2;\n this.frames[frameIndex + TwoColorTimeline.G2] = g2;\n this.frames[frameIndex + TwoColorTimeline.B2] = b2;\n }", "title": "" }, { "docid": "99fe62c8e16bd9bdbe12e0ecdbdb81cc", "score": "0.43602535", "text": "function addNewContentFrame(){\r\n\t\t\r\n\t\tif(counter == 12){ clearInterval(fact_card); }\r\n\t\t$(\".fact-popups\").append(\"<div id='content_frame_\" + counter + \"' class='content'><a href='#' class='image_capture' id='content_frames/frame_\" + counter + \".png' onclick='on(\" + counter + \")'><img src='images/content_frames/frame_\" + counter + \".png'></img></a></div>\");\r\n\t\r\n\t\t$(\"#content_frame_\" + counter).fadeOut(7000);\r\n\t\tcounter += 1;\r\n\t}", "title": "" }, { "docid": "2b13878c31dfd379455d5b6ec65051d0", "score": "0.4353972", "text": "function drawNewFrame() {\n \n\n }", "title": "" }, { "docid": "a12678298db4595592ff699c04b6e526", "score": "0.43472773", "text": "function Animation(frames) {\n this.frames = frames;\n if (this.frames.length === 0) {\n throw \"Your animation requires at least one frame.\";\n }\n }", "title": "" }, { "docid": "e3150bb6884a596a6409d1e3ac5f0d96", "score": "0.433748", "text": "constructor(options){\n super(options);\n this.numberOfFrames = options.numberOfFrames || 1; // The number of frames your spritesheet contains.\n this.numberOfRows = options.numberOfRows || 1; // If your sprite contains more rows select the correct row to animate.\n this.ticksPerFrame = options.ticksPerFrame || 1; // The speed it will loop trough it's frames. Will skip frames if below 1 to mimic speedup.\n this.loop = options.loop || false; // The animation will loop or not.\n this.reverse = options.reverse || false; // Determines if the animation will play in reverse.\n }", "title": "" }, { "docid": "60db1ddc04faf2d99b9e9c859d79227a", "score": "0.4328642", "text": "function newframe(genes) {\n if (genes) {\n const dispobj = xxxdispobj(genes);\n if (dispobj)\n dispobj.render();\n }\n if (newframePending) return;\n newframePending = true;\n if (!inAnimate) { processNewframe(); newframeNotanim++; }\n}", "title": "" }, { "docid": "9e60ac1a6c6db9d7f6877244c9b8f8ae", "score": "0.43267682", "text": "function draw() \n{\n\tdataFrames[countFrame].print();\n\t\n\ttextSize(22);\n\tfill(255);\n\ttext(\"Frame \" + (1 + countFrame) + \" / \" + dataFrames.length, 20, 30);\n\t\n\tif(dragging)\n\t{\n\t\tdataFrames[countFrame].set_new_point(dragObject, mouseX, mouseY);\n\t}\n}", "title": "" }, { "docid": "ac06a815b4ffefbdb758d5fdbbb61193", "score": "0.43189546", "text": "function KeyframeTrack(name,times,values,interpolation){KeyframeTrackConstructor.apply(this,arguments)}", "title": "" }, { "docid": "7a3f23a33d4284a28fc8b05b725e5a2e", "score": "0.4310195", "text": "function framesDisplay() {\n for (let i = animationFrames.length; i > -1; i--) {\n $('#canvas').append(animationFrames[i]);\n }\n $('#frame0').css('visibility', 'visible');\n}", "title": "" }, { "docid": "676be7306950640853c18e338b8cf5f5", "score": "0.43047258", "text": "function doTheFrameLoop () {\n var canvas = document.getElementById(\"canvas_images_1\");\n var ctx = canvas.getContext(\"2d\");\n\n frameIdx = (frameIdx + 1) % frames.length;\n ctx.putImageData(frames[frameIdx], 0, 0);\n\n timeoutFunction = setTimeout(doTheFrameLoop, frameTimeout);\n}", "title": "" }, { "docid": "b78ba28b01cc6daedcb1e9591cfc0bc9", "score": "0.4303409", "text": "function createThumbNail(fullFile, filePath, fileName){\n\tJimp.read(fullFile, function (err, image) {\n\t\tif (err) throw err;\n\t\tvar height = image.bitmap.height;\n\t\tvar width = image.bitmap.width; \n\t\tconsole.log(fileName + ' ' + height + 'x' + width);\n\t\tvar thumbNail = 'tn_' + fileName;\n\t\tvar newFile = path.join(fullFile, thumbNail);\n\t\tdel.sync(newFile);\n\t\timage.resize(150, Jimp.AUTO)\n\t\t .quality(80) \n\t\t .write(filePath + thumbNail); \n\t}); \n}", "title": "" }, { "docid": "58a83f5311d3a07da42dce99fc5cc890", "score": "0.43029925", "text": "function KeyframeTrack(name,times,values,interpolation){KeyframeTrackConstructor.apply(this,arguments);}", "title": "" }, { "docid": "62325b7ab0737051c49c82b58cbf958a", "score": "0.4298886", "text": "async function fadeIn() {\r\nlet elem = document.getElementById(\"image\");\r\nlet height = 0;\r\nlet width = 0;\r\nlet id = setInterval(frame, 1);\r\nfunction frame() {\r\n if (height === 300 && width === 300) {\r\n clearInterval(id);\r\n } else {\r\n height++;\r\n width++;\r\n elem.style.height = height + 'px';\r\n elem.style.width = width + 'px';\r\n }\r\n}\r\n}", "title": "" }, { "docid": "e2adae107edf2c7ecd0f762f1adfd85f", "score": "0.429621", "text": "componentDidMount() {\n const start = Date.now();\n\n const img = new Image();\n img.onload = e => {\n const end = Date.now();\n const diff = end - start;\n\n this.setState({ loaded: true, animation: diff > 100 });\n };\n img.src = this.props.src;\n }", "title": "" }, { "docid": "eed60d1e68c960810af0393ac4a98ad6", "score": "0.42950737", "text": "function PlayAnimation(imageIndex) {\r\n LoadImages();\r\n if (typeof (imageIndex) == 'undefined' || imageIndex == null)\r\n setTimeout('ChangeImage()', (_TimeOut * 1000));\r\n else\r\n setTimeout('ChangeImage(' + imageIndex + ')', (_TimeOut * 1000));\r\n}", "title": "" }, { "docid": "41f7f4e9a98d78af7c0c31a99a3b248c", "score": "0.4293087", "text": "fps(...args) {\n this._fps(1, ...args);\n }", "title": "" } ]
f5083b31943c9522cc6233b53dd028a9
At each animation frame...
[ { "docid": "c8be44f0d1adc619e4d1f39aec425936", "score": "0.0", "text": "function draw() {\n background(0);\n\n //Run the sampling process once\n poisson.run();\n //Draw it\n poisson.show();\n\n}", "title": "" } ]
[ { "docid": "7d07b339e296f58bb8c7f7eb63fcc981", "score": "0.75750935", "text": "function _frameAnimation(){\n\t\tvar i = _legIndex%15, j = _legIndex/15;\n\t\tif(i==0){\n\t\t\tif(j==0)\n\t\t\t\t_legFrame(0);\n\t\t\telse if(j==1)\n\t\t\t\t_legFrame(1);\n\t\t\telse if(j==2)\n\t\t\t\t_legFrame(2);\n\t\t\telse if(j==3)\n\t\t\t\t_legFrame(3);\n\t\t\telse if(j==4){\n\t\t\t\t_legFrame(0);\n\t\t\t\t_legIndex = -1;\n\t\t\t} \n\t\t}\n\t\t_legIndex++;\n\t}", "title": "" }, { "docid": "feb749ca4c0eabd4008239a081d22ba7", "score": "0.7534237", "text": "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "title": "" }, { "docid": "c8bc048e818a87817b9561278ed23d4d", "score": "0.749274", "text": "_animate() {\n\t\t// Implement functionality.\n\t}", "title": "" }, { "docid": "c8bc048e818a87817b9561278ed23d4d", "score": "0.749274", "text": "_animate() {\n\t\t// Implement functionality.\n\t}", "title": "" }, { "docid": "c8bc048e818a87817b9561278ed23d4d", "score": "0.749274", "text": "_animate() {\n\t\t// Implement functionality.\n\t}", "title": "" }, { "docid": "c8bc048e818a87817b9561278ed23d4d", "score": "0.749274", "text": "_animate() {\n\t\t// Implement functionality.\n\t}", "title": "" }, { "docid": "29d77c4a8bac2eab898da7d18dca2f58", "score": "0.74845046", "text": "function animloop() {\n render();\n requestAnimFrame(animloop);\n}", "title": "" }, { "docid": "42b00c01638fd633b05bbe57fe2a2b7e", "score": "0.7478642", "text": "animationFrame() {\n this.speedX = this._prevX - this.x;\n this.speedY = this._prevY - this.y;\n\n this._prevX = this.x;\n this._prevY = this.y;\n\n this._pointerFrameTime++;\n }", "title": "" }, { "docid": "0b784587b9a3efe205ca013f3db7a262", "score": "0.7437239", "text": "function animloop() {\n\tinit = requestAnimFrame(animloop);\n\tdraw();\n}", "title": "" }, { "docid": "f503c0b2c4c5abb28a07cfc0dd1deb09", "score": "0.73998606", "text": "function tick() {\r\n requestAnimFrame(tick);\r\n draw();//produce imageof currrent frame\r\n animate();\r\n}", "title": "" }, { "docid": "3e4a69ce774d2eb020ab6d7badc2fb90", "score": "0.73996854", "text": "onAnimFrame(timestamp) {\n // If desired, request another anim frame for later\n if (this.continueAnimation) {\n requestAnimationFrame((timestamp) => { this.onAnimFrame(timestamp); });\n }\n\n // TODO animate stuff\n }", "title": "" }, { "docid": "0e627652c2dbee1ca260a57f82ddfaa9", "score": "0.73948145", "text": "function animation(){\n\tticksPassedFromLastAnimation++;\n\tif(actualAnimation!=lastAnimation){\n\t\tticksPassedFromLastAnimation = ticksBetweenAnimationChange;\n\t\tanimationIndex = 0;\n\t\tlastAnimation = actualAnimation;\n\t}\n\tif(ticksPassedFromLastAnimation>=ticksBetweenAnimationChange){\n\t\tticksPassedFromLastAnimation = 0;\n\t\tanimationIndex++;\n\t\tchangeFrame();\n\t}\n}", "title": "" }, { "docid": "5d521a640f270c8c5cbb7408c64f64b7", "score": "0.7390201", "text": "animationStep() {\n\t\tthis.flowStep()\n\t\tthis.swayStep()\n\t}", "title": "" }, { "docid": "195c37efc19da82e183ca7ecb55a8788", "score": "0.7368456", "text": "function animationFrames() {\n ballMovement();\n drawCanvas();\n requestAnimationFrame(animationFrames);\n}", "title": "" }, { "docid": "6b442db0c5606218979ed19a4c1d4f4d", "score": "0.7356659", "text": "function animloop() {\n render();\n\trequestAnimFrame(animloop);\n}", "title": "" }, { "docid": "e23556bc4ecd763d13864f1a1f2c4a6a", "score": "0.7314257", "text": "function loop() {\n animationFrame = requestAnimationFrame(onFrame);\n }", "title": "" }, { "docid": "f51ad307299333f3d8ef3208aa2f1f4e", "score": "0.73037153", "text": "function loop_1_Animations() {\n\n}", "title": "" }, { "docid": "85a8a6e051b299cbc542d2b8d508fb06", "score": "0.72698003", "text": "function animate() {\n current = new Date().getTime(); //update current time\n if (current - initial >= 500) //checks if 500ms have elapsed\n {\n //update current frame using modulo so it doesn't exceed frames\n currentFrame = (currentFrame + 1) % frames;\n initial = current //reset initial\n }\n}", "title": "" }, { "docid": "57bbc8a9468d0435628af3a98120c67f", "score": "0.72617686", "text": "animate() {}", "title": "" }, { "docid": "bef36a6c14cc02021beb1ddd31595eb3", "score": "0.7248853", "text": "function animate() {\n\t//get the horizontal offset from the array\n\tvar h_offset = fr_num * (63);\n\tvar v_offset = direction * (63);\n\t//get the image and reslice it\n\timg_element.style.backgroundPosition = `-${h_offset}px -${v_offset}px`;\n\t//update frame counter, 0->1->2->3->0->...\n\tfr_num = ++fr_num % 4;\n}", "title": "" }, { "docid": "7792dd3c3cdbc47ec0fa1b9ec35d9d0d", "score": "0.72371274", "text": "animation() {}", "title": "" }, { "docid": "8ecf5470f476facce007331c1a7ad09e", "score": "0.72340775", "text": "function animLoop() {\n draw();\n requestAnimFrame(animLoop);\n}", "title": "" }, { "docid": "ad9024774ae4236386fb5e2f818cd63d", "score": "0.72334456", "text": "function animate() {\n\n // request another frame\n\n rafId = requestAnimationFrame(animate);\n\n // calc elapsed time since last loop\n\n now = Date.now();\n elapsed = now - then;\n\n // if enough time has elapsed, draw the next frame\n\n if (elapsed > fpsInterval) {\n\n // Get ready for next frame by setting then=now, but also adjust for your\n // specified fpsInterval not being a multiple of RAF's interval (16.7ms)\n\n // overhead can lead to drift?\n let overhead = (elapsed % fpsInterval);\n\n // if(overhead > 0)\n // console.log(overhead);\n then = now - overhead;\n\n // Put your drawing code here\n step(overhead / RAF_INTERVAL);\n\n }\n }", "title": "" }, { "docid": "97571bd4ba698021eb2f0434f651cc26", "score": "0.7225366", "text": "function animation()\r\n\t{\r\n\t\tcount = first_image ;\r\n\t}", "title": "" }, { "docid": "7caeafba08cd1b8fb34195c8ab9b2f3d", "score": "0.71967715", "text": "anima() {\n this.frame++;\n\n if (this.frame >= this.matriz.length-1){\n this.frame = 0;\n }\n\n if (this.isBlinking){\n this.blink();\n }\n }", "title": "" }, { "docid": "ab863358350c1b6277d6a469d17bcd24", "score": "0.7187178", "text": "_animate() {\n\n\t\t// Functionality goes here, implemented in subclass.\n\t}", "title": "" }, { "docid": "ffdc7790f91f6a8f5f8ef2c3d61ecece", "score": "0.7135757", "text": "tick() {\n this.frame++;\n }", "title": "" }, { "docid": "5d9093f6b04b29622f4b52e48156307b", "score": "0.7135123", "text": "function animate() { /* idea from http://codeofrob.com/entries/a-javascript-game-loop-for-multiplayer-webgl.html */\n var timeAtThisFrame = new Date().getTime();\n var timeSinceLastDoLogic = (timeAtThisFrame - timeAtLastFrame) + leftover;\n var catchUpFrameCount = Math.floor(timeSinceLastDoLogic / idealTimePerFrame);\n\n controller.handleTicks(catchUpFrameCount);\n \n\t// render the 3D scene\n\trender();\n\t// relaunch the 'timer' \n\trequestAnimationFrame( animate );\n\t// update the stats\n\tstats.update();\n \n // set new dates for next call\n leftover = timeSinceLastDoLogic - (catchUpFrameCount * idealTimePerFrame);\n timeAtLastFrame = timeAtThisFrame;\n}", "title": "" }, { "docid": "103189ef4d7db5323a13adbb5f595d99", "score": "0.71315426", "text": "function loop_2_Animations() {\n\n}", "title": "" }, { "docid": "2c89d97d99263c7dc71df5959706f14b", "score": "0.71291995", "text": "function animate() {\n renderer.setAnimationLoop(render)\n}", "title": "" }, { "docid": "8f6f8a49a59293ed4e27ca9b0228e2c7", "score": "0.7113398", "text": "function nextFrame () {\n \n if (pause) {\n setTimeout ( nextFrame , 100);\n return;\n }\n \n var timeSinceLastDraw = ( new Date().getTime() - lastFrameTime ) / 1000; // sec\n lastFrameTime = new Date().getTime();\n \n // Eigentliche Frame-tätigkeit\n for (var i in onNewFrameFunctions) {\n \t\n \thold = onNewFrameFunctions[i]( gui.context, timeSinceLastDraw );\n }\n // Sicherstellen das die maximale Framerate nicht überschritten wird\n var actFrameTime = new Date().getTime();\n var timeDiff = actFrameTime - lastFrameTime;\n \n if (timeDiff < minFrameLength) {\n setTimeout ( nextFrame , minFrameLength - timeDiff);\n return;\n }\n onNewFrameFunctions = [];\n //nextFrame(); \n requestAnimFrame(nextFrame);\n }", "title": "" }, { "docid": "db935f8446253cc94edc7eb86383d901", "score": "0.7110405", "text": "function animate() {\r\n\t//get the horizontal offset from the array\r\n\tvar h_offset = fr_num * (63);\r\n\tvar v_offset = direction * (63);\r\n\t//get the image and reslice it\r\n\timg_element.style.backgroundPosition = `-${h_offset}px -${v_offset}px`; \r\n\t//update frame counter, 0->1->2->3->0->...\r\n\tfr_num = ++fr_num % 4;\r\n}", "title": "" }, { "docid": "54a9b9e01305a63f77d97c97b6a2a306", "score": "0.7109123", "text": "function onFrame() {\n setTime(Date.now() - start);\n loop();\n }", "title": "" }, { "docid": "3d9e5e49c1ea2989eb764187546ed6f2", "score": "0.7090441", "text": "function looper () {\n self.ctx.clearRect(0,0,self.canvasWidth,self.canvasHeight);\n for (var i = 0; i < self.animateArray.length; i++) {\n // console.log(animateObj);\n // console.log(\"length \"+self.animateArray.length);\n var animateObj = self.animateArray[i];\n if (typeof animateObj.counter === 'undefined' || reset===true) {\n animateObj.counter = 0;\n console.log(\"here again\")\n reset = false;\n };\n var newCounter = animateObj.counter;\n // console.log(animateObj);\n // console.log(animateObj.animate.path);\n if (animateObj.type === 'image') {\n if (typeof img[i]==='undefined') {\n img[i] = new Image();\n img[i].src=animateObj.src;\n };\n animateObj.src = img[i];\n\n };\n if (animateObj.counter>=animateObj.animate.path.length-1 && animateObj.animate.loop) {\n animateObj.counter=0;\n }\n\n if (animateObj.counter>=animateObj.animate.path.length-1 && !animateObj.animate.loop) {\n // console.log(typeof animateObj.callback);\n if (typeof animateObj.callback === 'function') {animateObj.callback()};\n // self.animateArray.splice(i,1);\n } else {\n self.ctx.save();\n var ref = animateObj.animate.ref;\n self.ctx.translate(getPixel(ref.x),getPixel(ref.y));\n if (typeof animateObj.animate.rotate !== 'undefined') {\n animateObj.animate.path[animateObj.counter].angle = animateObj.animate.rotate;\n };\n drawIt(self.ctx,animateObj.src,animateObj.width,animateObj.height, animateObj.type,animateObj.animate.path[animateObj.counter],animateObj.animate.objRotate);\n self.ctx.restore();\n if (counter%animateObj.animate.speed==0) {\n animateObj.counter++;\n };\n }\n // console.log(\"loading \"+counter+\" speed\"+animateObj.animate.speed);\n // console.log(\"counter \"+animateObj.counter);\n };\n counter++;\n\n var setter = function () {\n setTimeout(looper,timeToChangeFrame);\n }\n\n console.log(typeof timer);\n if (typeof timer != 'undefined' && typeof timer === 'number') {\n var newTime = new Date().getTime();\n if (timer>(newTime-startTime )) {\n requestAnimationFrame(setter);\n } else if (typeof callback === 'function') {callback();};\n } else {\n requestAnimationFrame(setter);\n };\n }", "title": "" }, { "docid": "1bc9aedb0418b9c08d7102b45c310a8a", "score": "0.70894706", "text": "onFrame_() {\n if (!this.isPlaying) {\n return;\n }\n\n // Calculate delta since last frame.\n let now = +new Date();\n let delta = Math.min(1000, now - this.lastFrame);\n\n this.lastFrame = now;\n\n // Update game state\n this.update(delta);\n this.animationPlayer.update(now / 1000);\n\n // Request next frame\n this.requestId = window.requestAnimationFrame(this.onFrame_);\n }", "title": "" }, { "docid": "c5b20ef451990390258b8ca494a20c92", "score": "0.7084175", "text": "function animate() {\n\tupdate();\n\t\n}", "title": "" }, { "docid": "1456968fa1dd87fffd229307d1587ec6", "score": "0.706218", "text": "function animate() {\n // loop back to the beginning if end is reached.\n if (currentTime.getTime() >= newComp.duration.getTime()) {\n currentFrame = 0;\n } else {\n currentFrame++;\n }\n\n updateTimecode();\n drawFrame(currentTime);\n updatePanelLayerInfo();\n}", "title": "" }, { "docid": "d67aa9dd5e2f90b31ed5413757b6e641", "score": "0.70542", "text": "function animationLoop() { \r\n update();\r\n draw();\r\n\t\trequestAnimationFrame(animationLoop);\t\t\r\n }", "title": "" }, { "docid": "23224e92d158b05c5ed87c77368760b0", "score": "0.7022659", "text": "animate(){\n if (this.newline) {\n this.frame = FRAME_NEWLINE\n } else if (this.dead === true && this.playfield.stage.state === 'gameover'){\n this.frame = FRAME_DEAD\n } else if (this.state === CLEAR){\n \n\n if (FRAME_CLEAR.length > this.time_cur){\n this.frame = FRAME_CLEAR[this.time_cur]\n }\n } else if (this.state === LAND){\n this.frame = FRAME_LAND[FRAME_LAND.length-this.counter]\n } else if (this.state === SWAPPING_L || this.state === SWAPPING_R){\n let v = (UNIT / TIME_SWAP) * this.counter\n switch (this.state) {\n case SWAPPING_L:\n this.sprite.x += v\n break\n case SWAPPING_R:\n this.sprite.x -= v\n break\n }\n this.frame = FRAME_LIVE\n } else if (this.danger){\n const i = FRAME_DANGER[FRAME_DANGER.length - this.counter+1]\n this.frame = i\n } else {\n this.frame = FRAME_LIVE\n }\n }", "title": "" }, { "docid": "76ca57a561186c1124daafaa3883d8a8", "score": "0.70161176", "text": "function flameAnimation() {\n flame_anim_frame++; /** Frame increment */\n if ( flame_anim_frame < 3 ) {\n getChild(glucose_estimation_stage, \"flames\").x = getChild(glucose_estimation_stage, \"flames\").x - flame_anim_width; /** Changing of animation object x position */\n } else {\n flame_anim_frame = 0;\n getChild(glucose_estimation_stage, \"flames\").x = 328;\n }\n}", "title": "" }, { "docid": "439cb1d56a3d85fc007bed50519d5358", "score": "0.7003569", "text": "animFrame(timeStamp) {\r\n if (this.state.continueAnimation) {\r\n if (!this.prevTime) {\r\n this.prevTime = timeStamp;\r\n }\r\n requestAnimationFrame(timeStamp => this.animFrame(timeStamp));\r\n let delta = timeStamp - this.prevTime;\r\n let interval = 1000 / 25;\r\n\r\n if (delta > interval) {\r\n this.prevTime = timeStamp - delta % interval;\r\n this.drawCanvas();\r\n this.state.life.step();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "9a7151ef10f3a2cf6bf36fa06b0a9a7a", "score": "0.6994354", "text": "function animate() {\n state.animation.tick = function() {\n updateState();\n draw();\n requestAnimationFrame(state.animation.tick);\n };\n state.animation.tick();\n }", "title": "" }, { "docid": "6c82e8f959187aa6619250d7022d6567", "score": "0.6991", "text": "_animate() {\n if (this.bvhLoader.loadingState === \"loading\" || this.fbxLoader.loadingState === \"loading\") {\n this.framerateTimeReference = -1\n $(\"#messagePlayer\").text(\"Chargement en cours\").show()\n return\n }\n\n requestAnimationFrame(this._animate.bind(this))\n this.cameraControls.update()\n this.animating = true\n\n // BVH ---\n this._updateAnimation(this.bvhLoader, this.bvhAnimationsArray, \"bvh\")\n\n // FBX ---\n this._updateAnimation(this.fbxLoader, this.fbxAnimationsArray, \"fbx\")\n\n this.animating = false\n this.renderer.render(this.scene, this.camera)\n }", "title": "" }, { "docid": "1142583a070a069e4e959080eabfa95b", "score": "0.69899344", "text": "function nextFrame(){\n\trequestID = requestAnimationFrame(nextFrame);\n\tdrawAll()\n}", "title": "" }, { "docid": "7d76eb11eee6a73fd3d43a2119f3983b", "score": "0.6985795", "text": "function frame() {\n\t\tif (pos == 1500) { /* animation keeps running until this position */\n\t\tclearInterval(id);\n\t\t}\t\n\t\telse {\n\t\t\tpos++; \n\t\t\telem.style.left = pos + 'px'; /* moves image left */\n\t\t}\n\t}", "title": "" }, { "docid": "1f981d2acbe1f5c3d2a8a0e6f3f9b216", "score": "0.698211", "text": "function animate() {\n }", "title": "" }, { "docid": "646d0b0d4df878de7b66c0b3d0f506b8", "score": "0.69787", "text": "step() {\n this.tI.update(this.ctx);\n this.anim = window.requestAnimationFrame(() => {\n this.step();\n });\n }", "title": "" }, { "docid": "c8ec06316fdf54e0585fb8ee681086b5", "score": "0.6966983", "text": "@autobind\n _animationLoop() {\n this._renderFrame();\n // Keep registering ourselves for the next animation frame\n if (typeof window !== 'undefined') {\n this._animationFrame = requestAnimationFrame(this._animationLoop);\n }\n }", "title": "" }, { "docid": "375f038251d001753585a95c7389b50d", "score": "0.69636923", "text": "function animationLoop(timeStamp){\n //7. Clears everything in canvas\n ctx.clearRect(0,0,canvas.width,canvas.height);\n //8. Draw image in Canvas\n ctx.fillRect(positionX,0,50,50);\n //9. Move Image\n positionX += 1;\n //1-. Cal this function again (Repeat from step 6)\n requestId = requestAnimationFrame(animationLoop);\n}", "title": "" }, { "docid": "f92da7a474c73565e525525652f3f157", "score": "0.6956781", "text": "function animate()\n{\n frameCount++;\n // movement update\n update();\n // render update\n render();\n // trigger next frame\n requestAnimationFrame(animate);\n}", "title": "" }, { "docid": "6955a48b664c9441477d7b8e591ed89b", "score": "0.6954347", "text": "animate() {\n window.setTimeout(() => {\n requestAnimationFrame(() => this._frame());\n }, 1500);\n }", "title": "" }, { "docid": "830763d3e5107f921b5b7e5c0b9c3c30", "score": "0.69485164", "text": "function onNextFrame(callback) {\n setTimeout(function() {\n requestAnimationFrame(callback);\n });\n}", "title": "" }, { "docid": "8f3f6f4b7a20828507389d47277119ec", "score": "0.6935831", "text": "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n animate();\r\n}", "title": "" }, { "docid": "8f3f6f4b7a20828507389d47277119ec", "score": "0.6935831", "text": "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n animate();\r\n}", "title": "" }, { "docid": "8f3f6f4b7a20828507389d47277119ec", "score": "0.6935831", "text": "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n animate();\r\n}", "title": "" }, { "docid": "d9a79c2d1bc342c62a3ae361e0c2f6da", "score": "0.69285846", "text": "function frameAnimate(){\n\tvar AnimateSpeed=1500;\n\tjQuery(\"#hist-white\").animate({opacity: 0}, {duration: AnimateSpeed})\n .animate({opacity: 1}, {duration: AnimateSpeed, complete: frameAnimate})\n}", "title": "" }, { "docid": "c644109900455184c85f7714719a4e8a", "score": "0.69258535", "text": "function onFrame(){\n\t//We only want this to run once, when the data is ready\n\tif (spaceData.isReady){\n\t\tdrawCircles(spaceData.total);\n\t\tspaceData.isReady = false;\n\t\tstartAnimation = true;\n\t\tconsole.log(project.activeLayer);\n\t}\n\n\t//Animation logic goes in here\n\tif (startAnimation){\n\t\tvar theCircle = project.activeLayer.children[1];\n\t\tif (theCircle.position.y > 800){\n\t\t\ttheCircle.position.y = 0;\n\t\t}\n\t\telse{\n\t\t\ttheCircle.position.y += 4;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3e50f2f8f623c56d1dfc9af6eb8cedfc", "score": "0.6919337", "text": "function animate() {\n requestAnimationFrame(animate);\n}", "title": "" }, { "docid": "92ab0f913c0717cf44853048c6857dda", "score": "0.6913282", "text": "function animate() {\n requestAnimationFrame(animate);\n update();\n }", "title": "" }, { "docid": "b8649946e33207dfd42b9ca6822e65fa", "score": "0.68945885", "text": "function run() {\n this.animation()\n\n if (this.id !== null)\n this.id = requestAnimationFrame(run.bind(this))\n}", "title": "" }, { "docid": "4364baa756a61e9763ea64df64772e75", "score": "0.6890862", "text": "animate() {\n this.trackItems = false;\n this.animation = () => { this._update() };\n this.scene.registerBeforeRender( this.animation );\n }", "title": "" }, { "docid": "147a9d8be2d77ebb42eeaafd01c7538a", "score": "0.6884178", "text": "animate(){\n //unused in this version\n }", "title": "" }, { "docid": "8ce4a72259ad96796c4765d5a5f53038", "score": "0.68840927", "text": "function animate(){\n requestAnimationFrame( animate );\n update();\n render();\n }", "title": "" }, { "docid": "545256e42f42c477f24cd7aee88ec854", "score": "0.6880797", "text": "function Animation() {\n }", "title": "" }, { "docid": "a8bd118403db4f5a4623ddff8299bf90", "score": "0.6879942", "text": "animate() {\n if (!this.stopped) {\n var t = performance.now();\n if (t - this._lastTime >= this._minFrameRate) {\n for (var i = 0, len = this._queue.length; i < len; i++) {\n this._queue[i]._triggerFrameAnimation(t);\n }\n //Request the next frame of the animation.\n this._lastTime = t;\n }\n this._animation = requestAnimationFrame(this.animate.bind(this));\n }\n }", "title": "" }, { "docid": "2e5562a69b9ab3b34509f2472634f3b7", "score": "0.6873707", "text": "function animate() {\n // current = new Date().getTime(); // update current\n // if (current - initial >= 500) { // check is greater that 500 ms\n // currentFrame = (currentFrame + 1) % frames; // update frame\n // initial = current; // reset initial\n // }\n // Draw sprite frame\n context.drawImage(sprite, (sprite.width / 6) * currentFrame, 0, 100, 100, gameobjects[0].x, gameobjects[0].y, 100, 100);\n}", "title": "" }, { "docid": "8af5b65604022b57980e43d8c336b826", "score": "0.68569165", "text": "function animationFunction() {\n index++; // Increment our arbitrary \"index\" variable by 1\n updateAxes(elapsed/1000*speed);\n advance(); // See calculation.js\n graphData.push([elapsed/1000*speed, velocity]); // Add new data to the \"graphData\" variable\n updateDOM();\n updateGraph(graphData);\n}", "title": "" }, { "docid": "641bab7d4d90b7d33111bd4ed99a1108", "score": "0.685406", "text": "function animate() {\n\t\t// Rendering loop.\n\t\twindow.requestAnimationFrame(animate);\n\t\trender();\n\t}", "title": "" }, { "docid": "72aa88aec9628859079783d640aea357", "score": "0.68508565", "text": "function startAnimationLoop() {\r\n requestAnimationFrame(startAnimationLoop);\r\n self.render();\r\n }", "title": "" }, { "docid": "120e3182a966a3606b7b4be5b7728e79", "score": "0.6846731", "text": "function animate() {\n // request another frame\n requestAnimationFrame(animate);\n // calc elapsed time since last loop\n now = Date.now();\n elapsed = now - then;\n // if enough time has elapsed, draw the next frame\n if (elapsed > fpsInterval) {\n // Get ready for next frame by setting then=now, but also adjust for your\n // specified fpsInterval not being a multiple of RAF's interval (16.7ms)\n then = now - (elapsed % fpsInterval);\n // Put your drawing code here\n if (current_scene.update) current_scene.update();\n }\n}", "title": "" }, { "docid": "8a073f7e85aaa8cf3b0a7ac69ad8d7a2", "score": "0.6845429", "text": "function animate(){\r\n\r\n // Clear canvas.\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n // Draw background.\r\n handleBackGround();\r\n\r\n // Draw character model and update it.\r\n character.draw();\r\n character.update();\r\n\r\n // Call new particle initialization for character effect and drawing.\r\n handleParticlesCharacter();\r\n handleParticlesDraw();\r\n\r\n // Handle collectibles generation.\r\n handleCollectibles();\r\n\r\n // Handle collisions.\r\n handleCollisions();\r\n\r\n // Add hue for nice rainbow color effect on draw.\r\n hue+=2;\r\n\r\n // Add frame.\r\n frames++;\r\n\r\n // Request new animation frame and call recursively.\r\n window.requestAnimationFrame(animate);\r\n \r\n}", "title": "" }, { "docid": "93068e90f2c24ee56a1e2f35aa9bd0a6", "score": "0.68351156", "text": "function animate() {\n renderer.animate( render );\n }", "title": "" }, { "docid": "dd280475be296c33a83a4663bab442f0", "score": "0.683379", "text": "function tick() {\n requestAnimFrame(tick);\n draw();\n animate();\n}", "title": "" }, { "docid": "dd280475be296c33a83a4663bab442f0", "score": "0.683379", "text": "function tick() {\n requestAnimFrame(tick);\n draw();\n animate();\n}", "title": "" }, { "docid": "06e1aeea44c180b390badcdd9f51fa22", "score": "0.6827047", "text": "function everyFrame() {\n\tupdate();\n\trender();\n\trequestAnimationFrame(everyFrame);\n}", "title": "" }, { "docid": "fcf5263f37e328ce613c9fe67ef280d9", "score": "0.6823148", "text": "step() {\n assertParameters(arguments);\n \n if (this._controller.board.fading) return;\n \n if (this._animated === Controller.AnimatingState.ANIMATE_MAX) {\n this._animationFinished();\n } else {\n this._animated ++;\n this._updateAnimatingHexagons();\n }\n }", "title": "" }, { "docid": "96324e7d09536c77fcc7a25fec58f0ca", "score": "0.6816153", "text": "function animate() {\n ctx.clearRect(0,0,canvas.width,canvas.height);\n ctx.fillStyle = 'blue';\n ctx.fillRect(0,0,controlsBar.width,controlsBar.height);\n handleGameGrid();\n \n handleDefenders();\n handleResources();\n handleProjectiles();\n handleEnemies();\n chooseDefender();\n handleFloatingMessage();\n handleGameStatus();\n \n frame++;\n \n if(!gameOver) requestAnimationFrame(animate);\n }", "title": "" }, { "docid": "4693703b6b4c47f8dd03db1ed2e0165b", "score": "0.680809", "text": "function animate() {\n\t\t\n\t\twindow.request = requestAnimationFrame(animate);\n\n\t\tdraw();\n\n\n\t}", "title": "" }, { "docid": "4c94cee807d5728d128bc8f5faff3d0f", "score": "0.6806369", "text": "function startAnimation(){\n //5. Start the animation using animationisonLoop function\n requestId=requestAnimationFrame(animationLoop);\n}", "title": "" }, { "docid": "3152653b5922ba2b9298478872feaaad", "score": "0.6804121", "text": "trigger_run() {\r\n\r\n\r\n if (this.data.enable_draw)\r\n return;\r\n\r\n // timer \r\n this.data.count = 0; \r\n\r\n\r\n this.data.sprite = Math.floor((Math.random() * 3) + 0);\r\n this.set_animation_sequence_current(this.data.sprite);\r\n\r\n\r\n this.sprite.x_pos = this.data.pos_x;\r\n this.sprite.y_pos = this.data.pos_y;\r\n this.data.enable_draw = true;\r\n }", "title": "" }, { "docid": "337b0cae6940150446580ac5b1d33b2b", "score": "0.6800259", "text": "animation(timestamp) {\n // console.log(timestamp)\n this.drawEverything()\n this.updateEverything(timestamp)\n\n // requestAnimationFrame will generate a timestamp that we will use it as a reference\n // for doing other things, and call the animation() again\n window.requestAnimationFrame((timestamp) => this.animation(timestamp));\n }", "title": "" }, { "docid": "a88b28008bc6a491e2a84517d93f6ee7", "score": "0.67945087", "text": "function _animLoop(f,g){function b(c){if(!1!==d){window.requestAnimationFrame(b,g);var e=c-a;160>e&&(d=f(e));a=c}}var d,a=+new Date;b(a)}", "title": "" }, { "docid": "a3a2fcae5ad795b8f2956f21da123255", "score": "0.6793559", "text": "function animate() {\n draw();\n requestAnimationFrame(animate);\n }", "title": "" }, { "docid": "b600757bfa232a2805bca6ad29de40de", "score": "0.6792972", "text": "function start_animation_loop () {\n\t\tlet previous_update_time = null;\n\n\t\tfunction loop (timestamp) {\n\t\t\tself.now = timestamp / 1000;\n\t\t\tself.elapsedSeconds = (previous_update_time === null) ? 0 : self.now - previous_update_time;\n\t\t\tprevious_update_time = self.now;\n\n\t\t\tif (self.mouse.buttons[2] !== false) {\n\t\t\t\tconst pressed_time = self.now - self.mouse.buttons[2];\n\n\t\t\t\tif (pressed_time > 0.15) {\n\t\t\t\t\tself.player.avatar.walk( pressed_time );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tself.viewport.update();\n\n\t\t\tif (self.running) requestAnimationFrame( loop );\n\t\t}\n\n\t\trequestAnimationFrame( loop );\n\n\t}", "title": "" }, { "docid": "3e1670ec7a6877437f93112e283b0eab", "score": "0.6782573", "text": "function tick() {\n\t// arranges for tick to be called again\n requestAnimFrame(tick);\n\t// draws everything\n drawScene();\n\t// changes vars for next frame\n animate();\n}", "title": "" }, { "docid": "cbb14e5a305df755cbba780b01f79787", "score": "0.67824614", "text": "function animate(){\n\n}", "title": "" }, { "docid": "4c25cf799ee8ae39022d33eccb208273", "score": "0.6774913", "text": "function AnimationSequence(){\n this.onStep = -1;\n this.steps = [];\n this.active = false;\n this.playing = false;\n}", "title": "" }, { "docid": "d7f1132df344f28669e265fe595fd4b5", "score": "0.67715394", "text": "function animate() {\n draw();\n requestAnimationFrame(animate);\n }", "title": "" }, { "docid": "2110995cb74f1a3058884274ea930011", "score": "0.67558765", "text": "function tick(){\n\t//Função específica para próxima repintura: ela mesma\n\trequestAnimFrame(tick);\n\t//Desenho os objetos\n\tdesenharCena();\n\t//Calculo os valores de animação\n\tanimar();\n}", "title": "" }, { "docid": "f8552c23645d3d0c1a5db590f1d3f2b3", "score": "0.67523646", "text": "animate(count) {\n this.draw(count % 50 == 0);\n window.requestAnimationFrame(() => {\n this.animate(++count);\n })\n }", "title": "" }, { "docid": "c8c15019613e77c1fee367e01c313f40", "score": "0.67509156", "text": "animateProgressOne() {\n this.timeout = setTimeout(this.onGazeOne, 1000);\n // begin animation\n }", "title": "" }, { "docid": "8e5ef960e9fc268668976d8b6f4be2d3", "score": "0.6741511", "text": "function animate() \n{\n requestAnimationFrame( animate );\n\trender();\t\t\n}", "title": "" }, { "docid": "57251e9ec0b85c2d13cf74b1f0da9301", "score": "0.673639", "text": "animate() {\n anime({\n duration: Infinity,\n update: () => {\n this.cxt.clearRect(0, 0, this.cW, this.cH);\n this.animations.forEach((anim) => {\n anim.animatables.forEach((animatable) => {\n if (typeof animatable.target.draw !== 'undefined') animatable.target.draw(this.cxt);\n });\n });\n },\n });\n }", "title": "" }, { "docid": "2a8a5cd06fbbf22a7745fcc071523b17", "score": "0.6734152", "text": "function animate() {\n\t\t\trequestAnimationFrame( animate );\n\t\t\trender();\n\t\t}", "title": "" }, { "docid": "f7556d393bb429347fe22cf1502793b7", "score": "0.6733665", "text": "setAnimation(){}", "title": "" }, { "docid": "d3f947e7d31c73956e5f08fd081ddb76", "score": "0.6717669", "text": "function animate() {\n\n // Calls the Animation Method again\n requestAnimationFrame(animate);\n \n // Updates the Trackball Controls\n controls.update();\n\n // Updates the Stats (Statistics for the Rendering Process)\n stats.update();\n\n}", "title": "" }, { "docid": "27afef58d7952e20d36de3dc89a97eac", "score": "0.6716699", "text": "function step() {\n redraw.stepAnimation();\n }", "title": "" }, { "docid": "00aebb04df003b1aaba32a5a05d9f637", "score": "0.6713025", "text": "function animate() {\n var timeNow = new Date().getTime();\n\n if (animate.timeLast) {\n var elapsed = timeNow - animate.timeLast;\n \n // stuff to do every tick here\n for (var key in items) {\n items[key].animation(elapsed);\n }\n }\n animate.timeLast = timeNow;\n}", "title": "" }, { "docid": "ef844efd3562ba2c8e5254dbd599a5b8", "score": "0.6711374", "text": "function startAnimation() {\n\tif(index >= frames.length) { // decrease until it's less than the array's length\n\t\tindex = 0; // for looping back and forth\n\t}\n\t$(\"mytextarea\").value = frames[index++];\n}", "title": "" }, { "docid": "19fcae9c21ec019067874f796e309b7a", "score": "0.6708262", "text": "function frame() {\n\t\tif (pos2 == 1500) { /* animation keeps running until this position */\n\t\tclearInterval(id2);\n\t\t}\t\n\t\telse {\n\t\t\tpos2++; \n\t\t\telem2.style.left = pos2 + 'px'; /* moves image left */\n\t\t}\n\t}", "title": "" }, { "docid": "f5a6cd2c25312d47e6567fe3edf24a8a", "score": "0.6705682", "text": "function animate() {\n renderer.render(app.stage);\n window.requestAnimationFrame(animate);\n if (shouldRun) {\n population.update();\n cyclesCount++;\n\n if (cyclesCount > PARAMETERS.MAX_CYCLES) {\n shouldRun = false;\n proceedToNextGen();\n }\n }\n }", "title": "" } ]
57c20aac147fcf34474d463eb58a5ce1
function of what is to happen when the button is clickedd
[ { "docid": "47fa1bbb063422cec9680d74feabbfdc", "score": "0.0", "text": "function handleClick(){\n \n //inner html of button pressed\n var buttonInnerHTML = this.innerHTML;\n\n makeSound(buttonInnerHTML);\n\n buttonAnimation(buttonInnerHTML);\n \n\n\n}", "title": "" } ]
[ { "docid": "8ba01ff34cb74f29ef9a583081e34d2e", "score": "0.8312681", "text": "buttonClicked() {\n\n\t}", "title": "" }, { "docid": "f7ea50ea5af00ac6d1f62d337cf4c343", "score": "0.7809098", "text": "function buttonclick(){\n console.log(\"clicked\");\n }", "title": "" }, { "docid": "8e827d5ffd46fe10917eac353f16e6f1", "score": "0.7767239", "text": "function clicked(){\n// console.log(\"The button was clicked\");\n}", "title": "" }, { "docid": "97a2f236a184aa63a74a9d5cd2888fe7", "score": "0.7339106", "text": "handleButtonPress()\r\n\t{\r\n\r\n\t}", "title": "" }, { "docid": "380ea346c752ab2ffcc49b74b300485a", "score": "0.73372346", "text": "function buttonClick() {\n console.log(\"clicked\");\n}", "title": "" }, { "docid": "6bca5b7d1a3b0b83ed56e558c24be941", "score": "0.7320104", "text": "function onButtonClick(event){\n console.log(\"Pressed button!\");\n }", "title": "" }, { "docid": "aa906c4cea1cbce606fbddd7cb9d1b0c", "score": "0.729894", "text": "function clicked() {\n\n}", "title": "" }, { "docid": "dc139ffb4bf381f7d83af4acd7edc1c9", "score": "0.72143096", "text": "function button(){\n console.log(\"button\")\n }", "title": "" }, { "docid": "02c8b7f1c953aee94ebfc45af05f2676", "score": "0.71925956", "text": "function btnClick() {\n //Do something here\n}", "title": "" }, { "docid": "e0788c89c7599d9fb326c16846068cd3", "score": "0.71818876", "text": "function clickButton(){\n\tdisplayAllInventory();\n\tcheckForNew();\n}", "title": "" }, { "docid": "ffca5ebc9aef2c539f0e1bc88e021393", "score": "0.7166983", "text": "onClick() { \n }", "title": "" }, { "docid": "fa7b4ce09fc34fd580a762d6105b9939", "score": "0.70931125", "text": "function buttonClicked(){\n //do something\n console.log('here');\n}", "title": "" }, { "docid": "f55f467f015b32e6a476871c88299d77", "score": "0.7086292", "text": "function clickMeButton_Click() {\r\n console.log(\"clicked\");\r\n}", "title": "" }, { "docid": "90bf62e7acb63aabc839ea283bf37515", "score": "0.7058989", "text": "function sampleButtonClicked () {\n alert(\"Sample Button clicked\");\n }", "title": "" }, { "docid": "efe7d08b584469ba99cb9b382ec619d7", "score": "0.7034864", "text": "function Click() {\n console.log(\"clicked!\");\n }", "title": "" }, { "docid": "65dbed7d48084b285cf85c8b63519730", "score": "0.70129246", "text": "function onButtonClicked() {\n console.log(\"I'm in the button click event\");\n}", "title": "" }, { "docid": "e59f9f38d2d51f81fd658c2786fe8359", "score": "0.69775987", "text": "click(){\n\n }", "title": "" }, { "docid": "d82fd82f5620c7b2fe97b6a1a959a465", "score": "0.69421107", "text": "function btnClick() {\n\t// Get target and verbose to ta2\n\tvar target = event.target;\n\tvar cap = target.innerHTML;\n\ttout(ta2, cap + \"\\n\");\n\t\n\t// Perform according to the clicked button\n\tif(cap == \"load\") {\n\t\tloadParameters(ta1);\n\t\tbtn3.disabled = false;\n\t\ttout(ta1, \"Parameters are loaded\\n\\n\");\n\t} else if(cap == \"clear\") {\n\t\tclearCanvas();\n\t\tbtn3.disabled = true;\n\t\tbtn1.disabled = true;\n\t\ttout(ta2, \"All are cleared except this element\\n\\n\");\n\t} else if(cap == \"read\") {\n\t\treadParameters(ta1);\n\t\tinitParams();\n\t\tclearCanvas();\n\t\tbtn1.disabled = false;\n\t\ttout(ta2, \"Parameters are read\\n\");\n\t\ttout(ta2, \"Slightly random grains position \"\n\t\t\t+ \"are generated\\n\\n\");\n\t} else if(cap == \"Start\") {\n\t\ttarget.innerHTML = \"Stop\";\n\t\tbtn3.disabled = true;\n\t\tta1.disabled = true;\n\t\ttout(ta2, \"Simulation starts\\n\\n\");\n\t\tproc = setInterval(simulation, Tproc);\n\t} else if(cap == \"Stop\") {\n\t\ttarget.innerHTML = \"Start\";\n\t\tbtn3.disabled = false;\n\t\tta1.disabled = false;\n\t\ttout(ta2, \"Simulation stops\\n\\n\");\n\t\tclearInterval(proc);\n\t} \n}", "title": "" }, { "docid": "c1091df0dec71247115c59b056aacfa4", "score": "0.6936106", "text": "getFulldataClicked(){\n \n }", "title": "" }, { "docid": "f5b6584f1f4624a757f15dafdb6ff921", "score": "0.69292927", "text": "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"scspg.js\\n\";\n\t\tinfo += \"Semi-circle segmented path generator\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start generation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "title": "" }, { "docid": "e185032b610a992394b790292610e216", "score": "0.6915217", "text": "function handlerClickButton(ev) {\n clickValue(ev);\n clickCounter();\n}", "title": "" }, { "docid": "4abdb3ee6f8370c27ae48e8dc0bd2a9f", "score": "0.68989944", "text": "function alarmBell() {\n console.log(\"Button has been clicked!\");\n}", "title": "" }, { "docid": "797e019d435a36280937f43c1895d118", "score": "0.6847447", "text": "function btn(){\n //Do some thing\n}", "title": "" }, { "docid": "4a4d1642f33d2f1c78b1441352353616", "score": "0.68432367", "text": "function onActivateClick() {}", "title": "" }, { "docid": "e9297e60a27abb3ad8e5fce676acd587", "score": "0.68344796", "text": "clickHandler() {\n console.log(\"Button clicked!\")\n }", "title": "" }, { "docid": "c96d0cf1a00d4d140a2f3a8de6b324be", "score": "0.6834471", "text": "function buttonAction(e) {\n return sfss.s.buttonAction(e);\n}", "title": "" }, { "docid": "e16452c763662c8d36d2cf6a01690ea1", "score": "0.6812006", "text": "function btnClick2() {\nconsole.log('btn 2 clicked')\n}", "title": "" }, { "docid": "84c3ab54442d9645780c0e764a646edb", "score": "0.6800741", "text": "function SEC_onButtonClick(event){SpinEditControl.onButtonClick(event)}", "title": "" }, { "docid": "2e2c0980edbb71d641addcca077c4d1c", "score": "0.68001896", "text": "function handleButtonClick(id, event) {\n\n \n props.updateResidents(props.numberOfPeople);\n props.changeStage(\"six\");\n }", "title": "" }, { "docid": "0572d621caa8baad30b7a63200be68fd", "score": "0.6773569", "text": "clickedButton(index) {\n // Value Was Given\n if (!isNaN(index)) {\n // Make sure Index is found in buttons array\n if (index < this.buttons.length && index >= 0) {\n this.buttons[index].fn();\n }\n // Invalid Index\n else {\n console.error(\"Invalid Index! Button Array Index Invalid!\");\n }\n // Done\n return;\n }\n // Position Object Given\n // Check for Mouse Position within any of the Buttons\n else {\n // Check Mouse vs Buttons\n for (const btn of this.buttons) {\n // Obtain Button's Location\n const obj = {\n x: btn.rectShape.x,\n y: btn.rectShape.y\n };\n // Obtain Button's Shape\n const shape = {\n w: btn.rectShape.w,\n h: btn.rectShape.h\n };\n // If mouse within\n if (Menu.within(obj, shape, index)) {\n // Prompt User for Arguments (for now it's 2)\n // Call Function with those Arugments\n if (btn.fnArgs == 2) {\n const a = parseInt(prompt(\"Enter Argument 1: \"));\n const b = parseInt(prompt(\"Enter Arguemnt 2: \"));\n btn.fn(a, b);\n }\n // Call Function without Arguments\n else {\n btn.fn();\n }\n return; // Stop Looking\n }\n }\n }\n }", "title": "" }, { "docid": "ecf59268a332bc4b3bb62c8eb778434a", "score": "0.676911", "text": "function buttonClick() {\r\n\t// Get target and verbose to taOut1\r\n\tvar target = event.target;\r\n\tvar cap = target.innerHTML;\r\n\ttout(taOut1, cap + \"\\n\");\r\n\t\r\n\t// Perform according to the clicked button\r\n\tif(cap == \"Load\") {\r\n\t\tloadParameters(taIn);\r\n\t\tbtRead.disabled = false;\r\n\t\ttout(taOut1, \"Parameters are loaded\\n\\n\");\r\n\t} else if(cap == \"Clear\") {\r\n\t\tclearAll();\r\n\t\tbtRead.disabled = true;\r\n\t\tbtStart.disabled = true;\r\n\t\ttout(taOut1, \"All are cleared except this element\\n\\n\");\r\n\t} else if(cap == \"Read\") {\r\n\t\treadParameters(taIn);\r\n\t\tinitParams();\r\n\t\tclearCanvas();\r\n\t\tdrawSystem();\r\n\t\tbtStart.disabled = false;\r\n\t\ttout(taOut1, \"Parameters are read\\n\\n\");\r\n\t} else if(cap == \"Start\") {\r\n\t\ttarget.innerHTML = \"Stop\";\r\n\t\tbtRead.disabled = true;\r\n\t\ttaIn.disabled = true;\r\n\t\ttout(taOut1, \"Simulation starts\\n\\n\");\r\n\t\tproc = setInterval(simulate, tproc);\r\n\t} else if(cap == \"Stop\") {\r\n\t\ttarget.innerHTML = \"Start\";\r\n\t\tbtRead.disabled = false;\r\n\t\ttaIn.disabled = false;\r\n\t\ttout(taOut1, \"Simulation stops\\n\\n\");\r\n\t\tclearInterval(proc);\r\n\t} else if(cap == \"Info\") {\r\n\t\ttout(taOut1, \"yukawa.js -- 20190323\\n\"\r\n\t\t\t+ \"Simulation of Yukawa Potential\\n\"\r\n\t\t\t+ \"on 2 Spherical Masses\\n\"\r\n\t\t\t+ \"Harianto Wibowo| \"\r\n\t\t\t+ \"hariantowb@gmail\"\r\n\t\t\t+ \"\\n\\n\"\r\n\t\t);\r\n\t}\r\n}", "title": "" }, { "docid": "482e503c9be5c291698a5b484ddf5033", "score": "0.67641294", "text": "function btn(e){\n alert(\"You clickied me!\");\n}", "title": "" }, { "docid": "8a60bbd678b04d70d97bad0164a40f6d", "score": "0.67435926", "text": "function onButtonClick(btn){\r\n //Ext.example.msg('Button Click','You clicked the \"{0}\" button.', btn.text);\r\n }", "title": "" }, { "docid": "5a622730272b801378be9b0448458fed", "score": "0.67258984", "text": "function btn_go() {\r\n btn_command(txtCommand.value);\r\n}", "title": "" }, { "docid": "67b8d235fb58cea39a3e7619986e8b7e", "score": "0.6724773", "text": "function onClickQuiz(clickedButton) {\r\n \r\n}", "title": "" }, { "docid": "0d95cd2660a576c1cbd4340f0c92241f", "score": "0.6718307", "text": "function onBtnClick(event) {\n if (event.target.id == \"programing_btn\") {\n const element = document.getElementById(event.target.id);\n g_coding_quotes = true;\n } else {\n g_coding_quotes = false;\n }\n getAPIResult();\n }", "title": "" }, { "docid": "67633383417adf68609ac7baa080b6b4", "score": "0.6712152", "text": "function buttonClicked(evt)\n{\n alert(`Button Clicked!!! Listener`);\n}", "title": "" }, { "docid": "476faaf9ab845d2aa1e2c7950c20d0da", "score": "0.67110085", "text": "function OnClick () {\t\t\n\t\tnote.OnClick();\n\t}", "title": "" }, { "docid": "8c78e7426fa275d51c8ed0263471c6c2", "score": "0.6709953", "text": "function buttonActionPerformed(evt) {//GEN-FIRST:event_buttonActionPerformed\r\n // TODO Добавьте свой код:\r\n }", "title": "" }, { "docid": "d8ad2530e541ba67d92401f5fca482d4", "score": "0.6699189", "text": "function songclick() {}", "title": "" }, { "docid": "7f117eeb6d7ec8a781851ef355b0e14e", "score": "0.6694423", "text": "function _btnWeight() {\n //Working\n console.log(\"doing something\");\n }", "title": "" }, { "docid": "206c0efde723947486f380f26ba1eb1d", "score": "0.66922057", "text": "click() {}", "title": "" }, { "docid": "206c0efde723947486f380f26ba1eb1d", "score": "0.66922057", "text": "click() {}", "title": "" }, { "docid": "206c0efde723947486f380f26ba1eb1d", "score": "0.66922057", "text": "click() {}", "title": "" }, { "docid": "953504be7b0d1d08745afc2e57338ac1", "score": "0.6672306", "text": "pressButton(label) {\n Alert.alert(label);\n }", "title": "" }, { "docid": "e23c2dd7e7edc0f09efb35b858791f88", "score": "0.666667", "text": "function clickHandler() {\n console.log('Button Clicked')\n }", "title": "" }, { "docid": "4462ddbfd60ea947de4d7d65b1ed1586", "score": "0.666316", "text": "function handleCharButtonClick() {\n}", "title": "" }, { "docid": "f905874f53bf0f1b19673e26a36b4119", "score": "0.66628295", "text": "function increment() {\r\n console.log(\"The button was clicked\")\r\n}", "title": "" }, { "docid": "38ed20ef12ec6465f6b1e9b7149572b9", "score": "0.66537136", "text": "function onBtnClick() {\n alert('Button clicked on Event Click.');\n}", "title": "" }, { "docid": "10e53d70943db245f8c98e01a2f77c78", "score": "0.66487676", "text": "function _commandButtonClick($btn) {\n exec($btn);\n }", "title": "" }, { "docid": "6b46a67c64ee9e056242b7c5d4e6e097", "score": "0.6645093", "text": "function clickMeParameter(evt){\n alert(`Button is clicked ${evt.target.value}`);\n \n }", "title": "" }, { "docid": "6092d2499f516e106a98a4e899524512", "score": "0.6623678", "text": "maxBetButtonClickAction () {}", "title": "" }, { "docid": "bb9b01b77da2100e42a8bc4e06cca578", "score": "0.6623654", "text": "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'SAVE':\r\n submitSave(\"saveAllTailQuote\");\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "2121ccdac13f253666cdca1671e7ddb2", "score": "0.66175556", "text": "function click(){\n alert('clicked...');\n }", "title": "" }, { "docid": "eb83831f6aac86e3bdcd7fe9f0652458", "score": "0.6604765", "text": "function doClick(button) {\r\n\r\n inputBox.focus();\r\n\r\n if (button.textOp) {\r\n\r\n if (undoManager) {\r\n undoManager.setCommandMode();\r\n }\r\n\r\n var state = new TextareaState(panels);\r\n\r\n if (!state) {\r\n return;\r\n }\r\n\r\n var chunks = state.getChunks();\r\n\r\n // Some commands launch a \"modal\" prompt dialog. Javascript\r\n // can't really make a modal dialog box and the WMD code\r\n // will continue to execute while the dialog is displayed.\r\n // This prevents the dialog pattern I'm used to and means\r\n // I can't do something like this:\r\n //\r\n // var link = CreateLinkDialog();\r\n // makeMarkdownLink(link);\r\n //\r\n // Instead of this straightforward method of handling a\r\n // dialog I have to pass any code which would execute\r\n // after the dialog is dismissed (e.g. link creation)\r\n // in a function parameter.\r\n //\r\n // Yes this is awkward and I think it sucks, but there's\r\n // no real workaround. Only the image and link code\r\n // create dialogs and require the function pointers.\r\n var fixupInputArea = function () {\r\n\r\n inputBox.focus();\r\n\r\n if (chunks) {\r\n state.setChunks(chunks);\r\n }\r\n\r\n state.restore();\r\n previewManager.refresh();\r\n };\r\n\r\n var noCleanup = button.textOp(chunks, fixupInputArea);\r\n\r\n if (!noCleanup) {\r\n fixupInputArea();\r\n }\r\n\r\n }\r\n\r\n if (button.execute) {\r\n button.execute(undoManager);\r\n }\r\n }", "title": "" }, { "docid": "13631adfa7c81e485122ba2bf18d4c7f", "score": "0.6580426", "text": "onclick() {}", "title": "" }, { "docid": "53e43de2d99f7759ea11ba9f7ce70f5f", "score": "0.6578411", "text": "function buttonClick() {\r\n\t// Get target and verbose to taCons\r\n\tvar target = event.target;\r\n\tvar cap = target.innerHTML;\r\n\ttout(taCons, cap + \"\\n\");\r\n\t\r\n\t// Perform according to the clicked button\r\n\tif(cap == \"Load\") {\r\n\t\tloadParameters(taInPar);\r\n\t\tbtRead.disabled = false;\r\n\t\ttout(taCons, \"Parameters are loaded\\n\\n\");\r\n\t} else if(cap == \"Clear\") {\r\n\t\tclearAll();\r\n\t\tbtRead.disabled = true;\r\n\t\tbtStart.disabled = true;\r\n\t\ttout(taCons, \"All are cleared except this element\\n\\n\");\r\n\t} else if(cap == \"Read\") {\r\n\t\treadParameters(taInPar);\r\n\t\ttout(taCons, \"\\nParameters are read\\n\\n\");\r\n\t\tinitParams();\r\n\t\tclearCanvas();\r\n\t\tdrawSystem();\r\n\t\tbtStart.disabled = false;\r\n\t\ttout(taCons, \"\\nNormalized acceleration of system is \"\r\n\t\t\t+ gamma+ \"\\n\\n\");\r\n\t} else if(cap == \"Start Simulation\") {\r\n\t\ttarget.innerHTML = \"Stop Simulation\";\r\n\t\tbtRead.disabled = true;\r\n\t\tbtGetPosition.disabled = true;\r\n\t\tbtStartVib.disabled = false;\r\n\t\ttaInPar.disabled = true;\r\n\t\ttout(taCons, \"Simulation starts\\n\\n\");\r\n\t\tZs = getCoefficient();\r\n\t\tdegree = getDegree();\r\n\t\ttout(taCons, \"Zs =\\t\"+Zs+\"\\tDegree =\\t\"+degree+\"\\n\");\r\n\t\tproc = setInterval(simulate, tproc);\r\n\t} else if(cap == \"Stop Simulation\") {\r\n\t\ttarget.innerHTML = \"Start Simulation\";\r\n\t\tbtRead.disabled = false;\r\n\t\tbtGetPosition.disabled = false;\r\n\t\ttaInPar.disabled = false;\r\n\t\tbtStartVib.innerHTML = \"Start Vibration\";\r\n\t\tbtStartVib.disabled = false;\r\n\t\ttout(taCons, \"Simulation stops at t = \" + t + \"\\n\\n\");\r\n\t\tclearInterval(proc);\r\n\t} else if(cap == \"Stop Vibration\") {\r\n\t\ttarget.innerHTML = \"Start Vibration\";\r\n\t\tvibOn = false;\r\n\t\ttout(taCons, \"Vibration off\\n\\n\");\r\n\t} else if(cap == \"Start Vibration\") {\r\n\t\ttarget.innerHTML = \"Stop Vibration\";\r\n\t\tvibOn = true;\r\n\t\ttout(taCons, \"Vibration on\\n\\n\");\r\n\t}\r\n\telse if(cap == \"Show Pos\") {\r\n\t\ttaInPos.value = \"\";\r\n\t\tgetPosition();\r\n\t\ttout(taCons, \"Get position is done\\n\");\r\n\t}else if(cap == \"Info\") {\r\n\t\ttout(taCons, \"oneIntrude.js -- 20190522\\n\"\r\n\t\t\t+ \"Brazil Nut Effet on single intruder systems \"\r\n\t\t\t+ \"Sparisoma Viridi | \"\r\n\t\t\t+ \"https://github.com/dudung/butiran\"\r\n\t\t\t+ \"\\n\"\r\n\t\t\t+ \"Muhammad Iqbal Rahmadhan Putra | \"\r\n\t\t\t+ \"[email protected]\"\r\n\r\n\t\t);\r\n\t}else if(cap == \"Help\"){\r\n\t\talert(\"\"\r\n\t\t\t+ \"|Clear| -> Clear all input and output area\\n\"\r\n\t\t\t+ \"|Load| -> Load default input parameters\\n\"\r\n\t\t\t+ \"|Read| -> Read input parameters\\n\"\r\n\t\t\t+ \"|Start Simulation| -> Start simulation\\n\"\r\n\t\t\t+ \"|Start Vibration| -> Start vibration on shaker as sine wave\\n\"\r\n\t\t\t+ \"|Show Pos| -> Show current position each grain\\n\"\r\n\t\t\t+ \"|Info| -> Show program description\\n\"\r\n\t\t\t+ \"|Help| -> Get help\\n\\n\"\r\n\t\t\t+ \"additional : \\n\"\r\n\t\t\t+ \" - to set intruder number change 'INTNUM' parameters\\n\"\r\n\t\t\t+ \" - to set input position as grain positions change 'FIXPOS' to 1\\n\"\r\n\t\t\t+ \" - all parameters are in SI-units\"\r\n\t\t\t+ \" \\n\\n\\n\"\r\n\t\t\t+ \"'Dan kebahagiaan itu dapat ditemukan di sebutir pasir gurun, seperti kata Sang Alkemis. Karena sebutir pasir adalah suatu momen penciptaan, dan alam semesta telah menghabiskan waktu jutaan tahun untuk menciptakannya.'- The Alchemist, Paulo Coelho\" \r\n\r\n\t\t);\r\n\t}\t\t\r\n}", "title": "" }, { "docid": "16b6fc01e7f1c0f277437409daec9f81", "score": "0.6569136", "text": "onButton( e ) {\n\t\tif ( !this.state.show )\n\t\t\tthis.doShow(e);\n\t\telse\n\t\t\tthis.doHide(e);\n\t}", "title": "" }, { "docid": "67c700502db38f06f48e8a01cdb18552", "score": "0.6563865", "text": "function buttonChanged(valueObj) {\n // TODO: Implement logic as and if needed! \n}", "title": "" }, { "docid": "e1bc1e745649b1ddfff62d99488bc8d0", "score": "0.65496624", "text": "function whatToDoOnClick() {\n alert(\"You Did it!\")\n}", "title": "" }, { "docid": "d4bd72e5f09def98a926791dca88c394", "score": "0.65426946", "text": "clicked() {\r\n if (this.hit() && this.activated) {\r\n for (let func of this.onClick) {\r\n if (typeof func === \"function\") func();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a3022d3ec2486e70a9cae2641ec3b6fb", "score": "0.6539541", "text": "function starClickFunction () { $(\"#observeBtn\").click(); }", "title": "" }, { "docid": "5a36f5ffffdd8d94db96be02d0db8e4a", "score": "0.65357745", "text": "function ex(btn){ \n thePlayerManager.showExercise(btn);\n}", "title": "" }, { "docid": "95380847c2fb0e862a165c8977383071", "score": "0.65264374", "text": "function control_button(textin,ypos_in,actif,varif,active)\r\n{\r\n if (draw_button(control_margin,ypos_in,button_width,button_height,Hcontext,control_button_style,button_corner,\"src\",active,HmouseX,HmouseY,Hmouse_clicking))\r\n {\r\n if (actif)\r\n {\r\n button_next_action_2 = actif;\r\n }\r\n if (varif)\r\n {\r\n button_next_var_2 = varif;\r\n }\r\n }\r\n draw_text(control_margin,ypos_in,button_width,button_height,3,textin,0,button_height*0.55,button_height*0.55,button_text_col,'',Hcontext);\r\n}", "title": "" }, { "docid": "b0bc8ce0e882b93de6aa9a17801a17f7", "score": "0.6523791", "text": "buttonClick(event) {\n event.preventDefault();\n if (event.currentTarget === this.buttCreate) {\n let game = this.extractGame();\n this.speak(\"game is \" + game);\n this.onCreateGameCallback(true, game);\n } else if (event.currentTarget === this.buttCancel) {\n this.onCreateGameCallback(false, undefined);\n } else {\n this.speak(\"Should not get here!\");\n }\n }", "title": "" }, { "docid": "92659be99fa8c6ea41855cf5bdd01925", "score": "0.65226364", "text": "clicked() {\r\n if (this.hit() && this.activated) {\r\n for (let func of this.onClick) {\r\n if (typeof func === \"function\") func();\r\n }\r\n }\r\n\r\n }", "title": "" }, { "docid": "73e19838ecf31ef2d1b4eb47bea39b7a", "score": "0.6522425", "text": "onClick (_engine) {}", "title": "" }, { "docid": "4a4f374d0bd88c85fbf0b1405417e174", "score": "0.6515517", "text": "function handleClick()\r\n{\r\n var buttonName= this.innerHTML;\r\n playAudio(buttonName);\r\n buttonAnimation(buttonName);\r\n}", "title": "" }, { "docid": "47b778fbf61c8c4c5739eb637446d767", "score": "0.65089864", "text": "checkClick() {\n // Only runs if mouse is inside the button\n if (mouseX - width/2 > this.x - this.width/2 && mouseX - width/2 < this.x + this.width/2 && mouseY > this.y - this.height/2 && mouseY < this.y + this.height/2) {\n // Select random data set from training data\n let d = random(this.data);\n // Loop through possible buttons\n switch(this.text) {\n case \"FeedForward\":\n // Generate guess with selected random input\n this.nn.feedForward(d.inputs);\n return;\n case (\"Auto Train (\" + this.autotrain_val + \" sims)\"):\n // Call autoTrain passed through data parameter\n this.nn()\n return;\n case \"Save Data\":\n // Call enableSaveRequest passed through data parameter\n this.nn()\n return;\n default:\n return;\n }\n }\n }", "title": "" }, { "docid": "6d1bd56458a9484dedc36da12968ca4d", "score": "0.6508533", "text": "function ButtonClick(event){\n // store which button has been clicked in currentButton\n //let currentButton = event.currentTarget; <- one way of getting a ref to the button\n let currentButton = event.currentTarget;\n switch(currentButton.getAttribute(\"id\")) {\n case \"HideButton\":\n FirstProjectImage.style.display = \"none\";\n break;\n case \"HalfSizeButton\":\n FirstProjectImage.style.maxWidth = \"50%\";\n FirstProjectImage.style.display = \"block\";\n break;\n case \"ThreeQuarterSizeButton\":\n FirstProjectImage.style.maxWidth = \"75%\";\n FirstProjectImage.style.display = \"block\";\n break;\n case \"ShowButton\":\n FirstProjectImage.style.display = \"block\";\n FirstProjectImage.style.maxWidth = \"100%\";\n break;\n }\n }", "title": "" }, { "docid": "d9941214ed9e6984ba7d7a87da9edc7d", "score": "0.6504175", "text": "function bind(){\n btnObtener.onclick = leerArchivoTxt;\n }", "title": "" }, { "docid": "fe57cce7877a58189055aa249d87bad8", "score": "0.6498597", "text": "function buttonDown() {\n\tbuttonPressed = true;\n}", "title": "" }, { "docid": "5833c24628c057d4953245e325685dec", "score": "0.6494779", "text": "function rtGuiClick() { rtGuiAdd(this.id); }", "title": "" }, { "docid": "7a7952535a11fee1d811cc3e2756df30", "score": "0.64912003", "text": "autoPlayButtonClickAction () {}", "title": "" }, { "docid": "68cc9f9e97d51e609a52c5aa7a0a9898", "score": "0.64874095", "text": "function onButtonClick(event){\n\t\tvar buttonId = event.target.attributes[\"data-button_id\"].value;\n\t\tthis.dispatchEvent( { type: Topbar.buttonClicked, buttonId: buttonId } );\n\t}", "title": "" }, { "docid": "2a84c43f30c7ca6c00169bbc4c3e922a", "score": "0.6487121", "text": "function handleClick(){\n var buttonInnerHTML = this.innerHTML;\n makeSound(buttonInnerHTML);\n buttonAnimation(buttonInnerHTML);\n}", "title": "" }, { "docid": "70e251e6accedae9663b8683337c4468", "score": "0.6478442", "text": "function clickme(button) {\n \tif (button.value == \"Density\") {\n \t\tbool_data1 = true;\n\t\t\tmap1.updateChoropleth(\n\t\t\t\tdataset1\n\t\t\t);\n \t};\n \tif (button.value == \"Population\") {\n \t\tbool_data1 = false;\n \t\tmap1.updateChoropleth(\n\t\t\t\tdataset2\n\t\t\t);\n \t};\n }", "title": "" }, { "docid": "c72897813777ce7e394336da6737f00a", "score": "0.64726716", "text": "function _click() {\n mode = mode == 0?1:0;\n _render();\n}", "title": "" }, { "docid": "6721aee5a3477d33b4797851ebc06e94", "score": "0.64685005", "text": "function handleClick() {\r\n console.log(\"A button was clicked!\");\r\n\r\n // We can use d3 to see the object that dispatched the event\r\n console.log(d3.event.target);\r\n}", "title": "" }, { "docid": "c0c6bba01c1ba112634bfdf39e43a53f", "score": "0.6467215", "text": "function callMe() {\n console.log('Clicked the button');\n}", "title": "" }, { "docid": "bef796462ecd86a53e9b30b8d9b75dc2", "score": "0.64667964", "text": "onClick(event, data) {\n\t\t\tlet id = this.props.id;\n\n\t\t\t// do something according to which button the user clicked\n\t\t\tlet key = data.key;\n\t\t\tif (key === 'delete') {\n\t\t\t\tthis.delete(id);\n\t\t\t}\n\t\t\telse if (key === 'edit') {\n\t\t\t\tthis.edit(id);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f3eb788bb06a7c881b63ad021fc93ddc", "score": "0.6462102", "text": "function _button(x, y, val)\n{\n\tvar args = arrayfromargs(arguments);\n\tbutton_in(x, y, val);\n}", "title": "" }, { "docid": "068c55df738cc63be68e16f72ff15958", "score": "0.6461896", "text": "function init(){\n document.querySelector('.calc-buttons')\n .addEventListener('click',function(event){\n buttonClick(event.target.innerText); /* takes what the user clicked to buttonClick function */\n })\n}", "title": "" }, { "docid": "d35719db44e5974c68079ff3130e4d79", "score": "0.64586633", "text": "onClick(e) {\n }", "title": "" }, { "docid": "a9ca198fe2b667d837e8f2118e0f4f50", "score": "0.64579374", "text": "function AboutButtonClick() {\n console.log(\"About Button was clicked\");\n }", "title": "" }, { "docid": "568505df225869d144b56a3cef23ff02", "score": "0.6452449", "text": "function checkClick() {\n //some code here\n}", "title": "" }, { "docid": "adc02382060d54df1aa40d50a7726b1a", "score": "0.6448972", "text": "function doClick(button) {\n\n\t\t\tinputBox.focus();\n\n\t\t\tif (button.textOp) {\n\n\t\t\t\tif (undoManager) {\n\t\t\t\t\tundoManager.setCommandMode();\n\t\t\t\t}\n\n\t\t\t\tvar state = new TextareaState(panels);\n\n\t\t\t\tif (!state) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar chunks = state.getChunks();\n\n\t\t\t\t// Some commands launch a \"modal\" prompt dialog. Javascript\n\t\t\t\t// can't really make a modal dialog box and the WMD code\n\t\t\t\t// will continue to execute while the dialog is displayed.\n\t\t\t\t// This prevents the dialog pattern I'm used to and means\n\t\t\t\t// I can't do something like this:\n\t\t\t\t//\n\t\t\t\t// var link = CreateLinkDialog();\n\t\t\t\t// makeMarkdownLink(link);\n\t\t\t\t//\n\t\t\t\t// Instead of this straightforward method of handling a\n\t\t\t\t// dialog I have to pass any code which would execute\n\t\t\t\t// after the dialog is dismissed (e.g. link creation)\n\t\t\t\t// in a function parameter.\n\t\t\t\t//\n\t\t\t\t// Yes this is awkward and I think it sucks, but there's\n\t\t\t\t// no real workaround. Only the image and link code\n\t\t\t\t// create dialogs and require the function pointers.\n\t\t\t\tvar fixupInputArea = function () {\n\n\t\t\t\t\tinputBox.focus();\n\n\t\t\t\t\tif (chunks) {\n\t\t\t\t\t\tstate.setChunks(chunks);\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.restore();\n\t\t\t\t\tpreviewManager.refresh();\n\t\t\t\t};\n\n\t\t\t\tvar noCleanup = button.textOp(chunks, fixupInputArea);\n\n\t\t\t\tif (!noCleanup) {\n\t\t\t\t\tfixupInputArea();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (button.execute) {\n\t\t\t\tbutton.execute(undoManager);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.6433515", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.6433515", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "d66030d2308f7030788b837a3b0793ae", "score": "0.64296746", "text": "onButtonClick(name)\n\t{\n\t\t// console.log(name) // debugging\n\t\tswitch(name)\n\t\t{\n\t\t\tcase \"calc\":\n\t\t\t\tthis.calculate()\n\t\t\t\tbreak\n\t\t\tcase \"reset\":\n\t\t\t\tthis.reset()\n\t\t\t\tbreak\n\t\t\tcase \"ce\":\n\t\t\t\tthis.ce()\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tthis.setState({\n\t\t\t\t\tresult: this.state.result + name\n\t\t\t\t})\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "b3d6fe62ed3ddfa608454a82cb7b3411", "score": "0.6426829", "text": "function handleClick() {\n console.log(\"A button was clicked!\");\n\n // We can use d3 to see the object that dispatched the event\n console.log(d3.event.target);\n}", "title": "" }, { "docid": "ae378bb9973e628168a6b900e8c08cab", "score": "0.6420018", "text": "btnAccept () {\n this.addItemToLocal();\n if(typeof this.trigger === 'function') {\n this.trigger();\n }\n }", "title": "" }, { "docid": "771818904bb76c2acae954eee09cbc70", "score": "0.6413566", "text": "function init()\n{\ndocument.querySelector('.calc-buttons')\n.addEventListener('click' ,function(event){\nbuttonClick(event.target.innerText);\n\n})\n\n}", "title": "" }, { "docid": "3be1f3e51269a94ad5e03e5c475f79b4", "score": "0.6413204", "text": "function handleClick(e) {\n\n //get value of button clicked\n let buttonClicked = e.target.innerText;\n\n //call function to handle input for calculation\n handleCalcInput(buttonClicked);\n\n}", "title": "" }, { "docid": "4cfc2a63242436fa9ff096b6179bcfa1", "score": "0.6411002", "text": "function buttonCallback()\n{\n alert(\"a button was clicked\");\n}", "title": "" }, { "docid": "1db89226f8f2f83782b6313f986cb875", "score": "0.6409773", "text": "clicked() {\n if (this.over()) {\n movieSelected = true;\n // Run the function to convert the image into text\n imageToText(this.img, this.screenplay);\n }\n }", "title": "" }, { "docid": "2410e4fd1893e8075da3766e71899fb8", "score": "0.6409566", "text": "function handlerTextButtonClick(){\n\n\tconsole.log(dbgMsg('1st Button Clicked...'));\n\n\tprintText();\n}", "title": "" }, { "docid": "4c34085b30b1f2bcee3a9a4d2b967eac", "score": "0.6395377", "text": "function setBtnto(action){\n\tvar obj= {\n\t\t'start_button' : action\n\t};\n\tsetObjectdata(obj);\n\tdocument.getElementById('start_button').text = action;\n}", "title": "" }, { "docid": "435d79abc5eea676acc3f4ac3323b11d", "score": "0.6393723", "text": "function mousePressed() {\n if (!movieSelected) buttons[movieIndex].clicked();\n}", "title": "" }, { "docid": "57f9b9e86e5d483defe8c3c3a07bbbe4", "score": "0.6393558", "text": "function button1() {\n\talert('Hi from function button1!');\n}", "title": "" }, { "docid": "ccac834d696fdd2346800308bff20b87", "score": "0.63910127", "text": "function buttonClicked(i, j) { //this is where you should start\n setStatusText(\"Button [\" + i + \", \" + j + \"] pressed\");\n clickHistory.push(i*8 + j);\n //set this button to a random color\n setButtonColor(i, j, getRandomColor());\n var currentText = getButtonText(i, j);\n var textValue = 0;\n if (currentText != \"\") {\n textValue = parseInt(currentText, 10); //convert the text to base10 (decimal) number\n }\n setButtonText(i, j, textValue+1);\n //increase the progress bar a bit\n progress += textValue;\n setProgressBar(\"bar\", \"bg-success\", progress);\n}", "title": "" } ]
b6008be26d3e10dbd363418b4573b64c
Removes a CSS class from a given element.
[ { "docid": "fe10a07dda094ce1bc7b55e6aa232d52", "score": "0.73324174", "text": "function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}", "title": "" } ]
[ { "docid": "bdaf13a6ae71b6299f8e46273c954eea", "score": "0.81589246", "text": "function removeClass( classname, element ) {\n var cln = element.className;\n var rxp = new RegExp('(?:^|\\\\s)'+classname+'(?!\\\\S)');\n cln = cln.replace( rxp, '' );\n element.className = cln;\n}", "title": "" }, { "docid": "908495d25d14e114a189d6bd1ba3cc43", "score": "0.8084997", "text": "function removeClass(element, nameOfClass){\n\t \n\t if ( hasClass(element, nameOfClass) ){\n\t \n\t var reg = new RegExp('(\\\\s|^)'+nameOfClass+'(\\\\s|$)');\n\t element.className=element.className.replace(reg,' ');\n\t }\n\t }", "title": "" }, { "docid": "090fbed7ec771954bcbb81eb46b9a069", "score": "0.79978955", "text": "function removeClass(element, className) {\n var classNames = element.className.split( ' ' );\n \n var index = classNames.length;\n while ( index-- ) {\n if ( className == classNames[ index ] ) {\n classNames.splice( index, 1 );\n }\n }\n\n element.className = classNames.join( ' ' );\n}", "title": "" }, { "docid": "495c6bae6f41205b05af73da31431bdb", "score": "0.79948646", "text": "function $removeClass(element, className)\n{\n if (element.classList.contains(className))\n element.classList.remove(className);\n}", "title": "" }, { "docid": "82fec92d0f3824735de9af10f0fa2aea", "score": "0.79409516", "text": "function removeClass(className, element) {\n if (element.classList)\n element.classList.remove(className);\n else\n element.className = element.className.replace(new RegExp('(^|\\\\b)' +\n className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\n }", "title": "" }, { "docid": "9c344d2ad724a36ebaaaf87459b8a92b", "score": "0.7883408", "text": "function removeClass(element, className) {\n\tif(typeof element != 'object') element = document.getElementById(element);\n\tvar classString = element.className;\n\tvar newClassString = '';\n\tvar indexPos = classString.indexOf(className);\n\tif(indexPos == -1) {\n\t\treturn;\n\t} else if (indexPos == 0) {\n\t\tnewClassString = classString.substring(0, indexPos) + classString.substr(indexPos+className.length);\n\t} else {\n\t\tnewClassString = classString.substring(0, indexPos-1) + classString.substr(indexPos+className.length);\n\t}\n\n\telement.className = newClassString;\n}", "title": "" }, { "docid": "68b204d21db3bbb183d61cdb63e91cf1", "score": "0.7804711", "text": "function removeClass(element,name){\nvar oldList=classList(element),\nnewList;\n\nif(!hasClass(element,name))return;\n\n// Replace the class name.\nnewList=oldList.replace(' '+name+' ',' ');\n\n// Trim the opening and closing spaces.\nelement.className=newList.substring(1,newList.length-1);\n}", "title": "" }, { "docid": "b385171e351b40186677ff144dfe4f43", "score": "0.7774747", "text": "function removeClass(element, name) {\n\t var oldList = classList(element),\n\t newList;\n\n\t if (!hasClass(element, name)) return;\n\n\t // Replace the class name.\n\t newList = oldList.replace(' ' + name + ' ', ' ');\n\n\t // Trim the opening and closing spaces.\n\t element.className = newList.substring(1, newList.length - 1);\n\t }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.7765842", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "0b8d370cc3b243e6b0dd4e933a6ca3f5", "score": "0.7764248", "text": "function removeClass(element, className) {\n $('.' + className, element).each(function(){\n unwrap(this);\n });\n }", "title": "" }, { "docid": "b72598e2215a678dbc8849e37a80d36b", "score": "0.7763857", "text": "function removeClass(element, className){\n if(element.classList){\n // console.log('remove class classList');\n element.classList.remove(className);\n }else{\n //Polyfill\n // console.log('remove class polyfill');\n var reg = new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)');\n element.className = element.className.replace(reg, '');\n }\n }", "title": "" }, { "docid": "cd34456e77e84b8e13c4039401c297c6", "score": "0.77542526", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n \n if (!hasClass(element, name)) return;\n \n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n \n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "dcccf85d455a7deab45887d42706d278", "score": "0.7745327", "text": "function removeClass(element, name) {\n\t var oldList = classList(element),\n\t newList;\n\t\n\t if (!hasClass(element, name)) return;\n\t\n\t // Replace the class name.\n\t newList = oldList.replace(' ' + name + ' ', ' ');\n\t\n\t // Trim the opening and closing spaces.\n\t element.className = newList.substring(1, newList.length - 1);\n\t }", "title": "" }, { "docid": "dcccf85d455a7deab45887d42706d278", "score": "0.7745327", "text": "function removeClass(element, name) {\n\t var oldList = classList(element),\n\t newList;\n\t\n\t if (!hasClass(element, name)) return;\n\t\n\t // Replace the class name.\n\t newList = oldList.replace(' ' + name + ' ', ' ');\n\t\n\t // Trim the opening and closing spaces.\n\t element.className = newList.substring(1, newList.length - 1);\n\t }", "title": "" }, { "docid": "50058826b6753651f86d00fd776b5f23", "score": "0.77326584", "text": "function removeClass(element, someClass) {\n var patternStr = '(^|\\\\s)*' + someClass + '(\\\\s|$)*';\n var pattern = new RegExp(patternStr);\n if (pattern.test(element.className)) {\n element.className = element.className.replace(pattern, ' ');\n }\n return element;\n}", "title": "" }, { "docid": "4fb9aa996bb03075bc56a94a2a6d3ba1", "score": "0.7725814", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "4fb9aa996bb03075bc56a94a2a6d3ba1", "score": "0.7725814", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "957ac5cc68e1fe5d84a0a169b2c4364b", "score": "0.7711483", "text": "function removeClass(element, value) {\n\n\tvar class2remove = value || '';\n\tvar cur = element.nodeType === 1 && (element.className ? (' ' + element.className + ' ').replace(rclass, ' ') : '');\n\n\tif (cur) {\n\n\t\twhile (cur.indexOf(' ' + class2remove + ' ') >= 0) {\n\n\t\t\tcur = cur.replace(' ' + class2remove + ' ', ' ');\n\n\t\t}\n\n\t\telement.className = value ? trim(cur) : '';\n\t}\n}", "title": "" }, { "docid": "4c6c03993de2924ca0e7dbaed49cb38e", "score": "0.7685407", "text": "function RemoveClass(element, name) {\n\tlet classes;\n\tclasses = element.className.split(\" \");//delar className i elementet på \" \"\n\twhile (classes.indexOf(name) > -1) {//så länge name finns i arrayen\n\t\tclasses.splice(classes.indexOf(name), 1); //plockar bort name\n\t}\n\telement.className = classes.join(\" \");// slår ihop alla element och uppdaterar elementets className\n}", "title": "" }, { "docid": "9383e603010144447583e581997fa544", "score": "0.7663486", "text": "function remClass(element, name) {\n\tif (hasClassList(element) && chkClass(element, name)) {\n\t\telement.classList.remove(name);\n\t}\n}", "title": "" }, { "docid": "b385d918b202ece3a3f70ea9690624a2", "score": "0.76281726", "text": "function removeClass(elem, className) {\n var newClass = ' ' + elem.className.replace( /[\\t\\r\\n]/g, ' ') + ' ';\n if (hasClass(elem, className)) {\n while (newClass.indexOf(' ' + className + ' ') >= 0 ) {\n newClass = newClass.replace(' ' + className + ' ', ' ');\n }\n elem.className = newClass.replace(/^\\s+|\\s+$/g, '');\n }\n}", "title": "" }, { "docid": "c85839e031494b810cd085ed1ddcf646", "score": "0.759529", "text": "function removeClass(element, className) {\n if (element.classList) element.classList.remove(className);\n else if (hasClass(element, className)) {\n var reg = new RegExp('(\\\\s|^)' + className + '(\\\\s|$)');\n element.className = element.className.replace(reg, ' ');\n }\n}", "title": "" }, { "docid": "a207e4ff06c0e2ab33930b2f936c0256", "score": "0.75718623", "text": "function removeClass(element, className) {\n if (!element) {\n return;\n }\n if (element.classList) {\n element.classList.remove(className);\n }\n else {\n var currentClassName = element.getAttribute(\"class\");\n if (currentClassName) {\n element.setAttribute(\"class\", currentClassName.split(\" \").filter(function (item) {\n return item !== className;\n }).join(\" \"));\n }\n //element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\");\n }\n}", "title": "" }, { "docid": "e0609cb7163d15bec502862f5a74a5bc", "score": "0.7571454", "text": "function RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "772ad2f3a5d9c7634bd37a37c944a7bb", "score": "0.75536376", "text": "function removeClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "b869510a36a407ea897834a3745fe151", "score": "0.75502956", "text": "function removeClass(elem, className) {\n\tvar classList = elem.classList;\n\tif (classList === undefined) {\n\t\tvar classes = elem.className ? elem.className.trim().split(/\\s+/) : [];\n\t\tvar i = classes.indexOf(className);\n\t\tif (i > -1) {\n\t\t\tclasses.splice(i, 1);\n\t\t\telem.className = classes.join(' ');\n\t\t}\n\t} else {\n\t\tclassList.remove(className);\n\t}\n\treturn elem;\n}", "title": "" }, { "docid": "21c398ef3b43c089648b5e6b9853bc1d", "score": "0.75454926", "text": "function w3RemoveClass(element, name) {\n\tvar i, arr1, arr2;\n\tarr1 = element.className.split(' ');\n\tarr2 = name.split(' ');\n\tfor (i = 0; i < arr2.length; i++) {\n\t\twhile (arr1.indexOf(arr2[i]) > -1) {\n\t\t\tarr1.splice(arr1.indexOf(arr2[i]), 1);\n\t\t}\n\t}\n\telement.className = arr1.join(' ');\n}", "title": "" }, { "docid": "2865abc253f6245a4be6f8cc8eddcafe", "score": "0.7541927", "text": "function w3RemoveClass(element, name) {\n\tvar i, arr1, arr2;\n\tarr1 = element.className.split(\" \");\n\tarr2 = name.split(\" \");\n\tfor (i = 0; i < arr2.length; i++) {\n\t\twhile (arr1.indexOf(arr2[i]) > -1) {\n\t\t\tarr1.splice(arr1.indexOf(arr2[i]), 1);\n\t\t}\n\t}\n\telement.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "b20f2eaf8218a94aadc84d8c68045234", "score": "0.754043", "text": "function removeClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "b20f2eaf8218a94aadc84d8c68045234", "score": "0.754043", "text": "function removeClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "3bf2a5617c333e02b2650b049bd60e97", "score": "0.7520934", "text": "function removeClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.74898124", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.74898124", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.74898124", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.74898124", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.74898124", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.74898124", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "ff676d4eacce990cc4e33c216fa0e4e8", "score": "0.7489179", "text": "function removeClass(elem, cls) {\n var classes = elem.className,\n present = elem.className.indexOf(cls) !== -1 ? true : false;\n if (present) {\n if (classes === cls) elem.className = '';\n else elem.className = elem.className.replace(' ' + cls, '');\n }\n }", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.7483872", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.7483872", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.7483872", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.74730957", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.74730957", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.74730957", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.74730957", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "8c9c0f77e6455fbd4c29c8365af2a03a", "score": "0.7420808", "text": "function removeClass$1(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}", "title": "" }, { "docid": "d309368ca356cdd1284d6c784d408fbb", "score": "0.7408278", "text": "function removeClass(element, name) {\n let arr1 = element.className.split(' ');\n let arr2 = name.split(' ');\n for (let i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(' ');\n}", "title": "" }, { "docid": "26862fe0243a797f392776042294a3b6", "score": "0.74006027", "text": "function removeClass_removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}", "title": "" }, { "docid": "96e927fcb1d7ff2256f42227fb6fc8ca", "score": "0.73973364", "text": "function WebForm_RemoveClassName(element, className) {\n var currentClassName = ' ' + WebForm_TrimString(element.className) + ' ';\n className = WebForm_TrimString(className);\n var index = currentClassName.indexOf(' ' + className + ' ');\n if (index >= 0) {\n element.className = WebForm_TrimString(currentClassName.substring(0, index) + ' ' +\n currentClassName.substring(index + className.length + 1, currentClassName.length));\n }\n}", "title": "" }, { "docid": "2c004026d41ca1f0750ec5fb0d6f4034", "score": "0.7384885", "text": "function removeClass(element, name) {\n let arr1 = element.className.split(' ');\n let arr2 = name.split(' ');\n for (let i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(' ');\n}", "title": "" }, { "docid": "5b948d7d57cbc2f8361f8e26b0560fe5", "score": "0.73756087", "text": "function mafRemoveClass(element, name) {\r\n let i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "efc65b5b4f3617a7e38b40136c16f630", "score": "0.736564", "text": "function removeClass(element, name) {\n let arr1 = element.className.split(' ');\n let arr2 = name.split(' ');\n for (let i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(' ');\n }", "title": "" }, { "docid": "4a2b9f3b8da4fff4e5ea418965cb8a8a", "score": "0.73423237", "text": "function removeClass(element, name) {\n\n var i, arr1, arr2;\n\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n\n for (i = 0; i < arr2.length; i++) {\n\n while (arr1.indexOf(arr2[i]) > -1) {\n\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "711b1a3a4acd7493a93701b24b654d3b", "score": "0.732377", "text": "function w3RemoveClass(element, name) {\n let i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n\n}", "title": "" }, { "docid": "973f36bb1078d9ce786ccd279028823d", "score": "0.7295823", "text": "function removeClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.remove(c);});}else{el.classList.remove(cls);}if(!el.classList.length){el.removeAttribute('class');}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";var tar=' '+cls+' ';while(cur.indexOf(tar)>=0){cur=cur.replace(tar,' ');}cur=cur.trim();if(cur){el.setAttribute('class',cur);}else{el.removeAttribute('class');}}}", "title": "" }, { "docid": "4f5570b8c4ff5a7b18c3e8064e4b0001", "score": "0.72936535", "text": "function removeClass(elem, name) {\n var cn = getClass(elem);\n var nameLen = name.length;\n var newcn = cn;\n\n if (cn == name) {\n newcn = \"\";\n } else {\n var index = (cn.indexOf(\" \" + name + \" \"));\n if (index > -1) {\n newcn = cn.substring(0, index) + cn.substring(index + nameLen + 1);\n } else {\n if (cn.endsWith(\" \" + name)) {\n var len = cn.length - (nameLen + 1);\n newcn = cn.substring(0, len);\n } else if (cn.startsWith(name + \"\")) {\n newcn = cn.substring(name.length + 1);\n }\n }\n }\n\n if (newcn != cn) {\n setClass(elem, newcn);\n }\n }", "title": "" }, { "docid": "56eaea5663e47d009d0f343086a9a897", "score": "0.72884876", "text": "function removeClass (element ,name){\n var i , arr1 ,arr2;\n arr1= element .className .split( \" \");\n arr2 =name .split( \"\");\n for ( i = 0 ; i < arr2 .length; i++ ){\n while( arr1 .indexOf( arr2[i]) > -1) {\n arr1.splice ( arr1 .indexOf ( arr2 [i]), 1);\n } \n }\n element.className = arr1 .join (\"\");\n\n }", "title": "" } ]
462657f2b73586b1c4ab3c2be5c46813
Wrapper para validacion de datos
[ { "docid": "754b956796fd3f18c61d0e46ac73c196", "score": "0.0", "text": "async function validateData(data, schema, useJoiError = true) {\n\treturn await joi.validate(data, schema, validationOptions, (err, validatedData) => {\n\t\t// Compruebo si hubo errores en la validacion\n\t\tif (err) {\n\t\t\t// Si los hay, le doy un formato personalizado a los errores\n\t\t\tlet joiError = {\n\t\t\t\tstatus: 'VALIDATION_ERROR',\n\t\t\t\tfields: {}\n\t\t\t};\n\t\t\t\n\t\t\t// Recorro los errores y devuelvo string personalizado segun su tipo\n\t\t\tconst errDetailsLength = err.details.length;\n\n\t\t\tfor (let i = 0; i < errDetailsLength; i++) {\n\t\t\t\tif (!joiError.fields.hasOwnProperty(err.details[i].context.key)) {\n\t\t\t\t\tjoiError.fields[err.details[i].context.key] = [];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch (err.details[i].type) {\n\t\t\t\t\tcase 'any.required':\n\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\terror: 'FIELD_REQUIRED'\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'any.allowOnly':\n\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\terror: 'FIELD_INVALID_VALUE',\n\t\t\t\t\t\t\tallowedValues: err.details[i].context.valids\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'number.integer':\n\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\terror: 'NUMBER_IS_NOT_INTEGER'\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'number.min':\n\t\t\t\t\t\tif (err.details[i].context.limit == 0) {\n\t\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\t\terror: 'FIELD_REQUIRED'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\t\terror: 'NUMBER_BELOW_MINIMUM',\n\t\t\t\t\t\t\t\tminimumNumber: err.details[i].context.limit\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'number.max':\n\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\terror: 'NUMBER_ABOVE_MAXIMUM',\n\t\t\t\t\t\t\tmaximumNumber: err.details[i].context.limit\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'string.min':\n\t\t\t\t\t\tif (err.details[i].context.limit == 1) {\n\t\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\t\terror: 'FIELD_REQUIRED'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\t\terror: 'STRING_BELOW_MINIMUM',\n\t\t\t\t\t\t\t\tminimumLength: err.details[i].context.limit\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'string.max':\n\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\terror: 'STRING_ABOVE_MAXIMUM',\n\t\t\t\t\t\t\tmaximumLength: err.details[i].context.limit\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'string.regex.base':\n\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\terror: 'INVALID_DATA',\n\t\t\t\t\t\t\tregex: err.details[i].context.pattern.toString()\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tjoiError.fields[err.details[i].context.key].push({\n\t\t\t\t\t\t\terror: 'INVALID_FIELD'\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Si alguno de los campos fallo por validacion \"required\" elimino todos los demas errores de validacion asociados a ese campo\n\t\t\tfor (let property in joiError.fields) {\n\t\t\t\tif (joiError.fields.hasOwnProperty(property)) {\n\t\t\t\t\tlet errorsLength = joiError.fields[property].length;\n\t\t\t\t\tfor (let i = 0; i < errorsLength; i++) {\n\t\t\t\t\t\tif (joiError.fields[property][i].error == 'FIELD_REQUIRED') {\n\t\t\t\t\t\t\tjoiError.fields[property] = [joiError.fields[property][i]];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn joiError;\n\t\t}\n\t\t\n\t\t// Devuelvo el objeto ya validado\n\t\treturn validatedData;\n\t});\n}", "title": "" } ]
[ { "docid": "c095d9493caf64a1cfeaa34c85d012ab", "score": "0.70589316", "text": "validarDatos() {\n let errores = '';\n\n if (!moment($('#venta-fecha').value).isValid()) {\n errores += '<br>Fecha inválida';\n }\n\n if (!$('#venta-cliente').value) {\n errores += '<br>Falta seleccionar el cliente';\n }\n\n let lineasDeVenta = this.tablaLineasVentas.getData();\n if (lineasDeVenta.length == 0) {\n errores += '<br>La venta aún no tiene 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 venta incompleto.';\n }\n }\n\n if (!util.esNumero($('#venta-paga').value)) {\n errores += '<br>Falta ingresar cuánto paga el cliente o cero si es preciso.';\n }\n\n return errores;\n }", "title": "" }, { "docid": "710bc46ccca35f7d6b3b6960c2a5eb37", "score": "0.6775453", "text": "validate(data) {\n return true;\n }", "title": "" }, { "docid": "3143ed65ce71a17c1d6b355aadef0593", "score": "0.6678382", "text": "_validate(data) {\n return true;\n }", "title": "" }, { "docid": "1e269cf1594c6ada53dd5666de564971", "score": "0.661598", "text": "validar(){\n let errores=[]\n\n //Validar Nombre\n let nombre = this.nombre\n if (nombre==\"\") errores.push({ mensaje1: \"El campo nombre no puede estar vacío.\"})\n\n //Validar email \n let email=this.email\n let emailRegex = /^[-\\w.%+]{1,64}@(?:[A-Z0-9-]{1,63}\\.){1,125}[A-Z]{2,63}$/i\n if(emailRegex.test(email)){console.log(\"El email es correcto.\")}\n \n else{errores.push({ mensaje2: \"El campo email es incorrecto, introduzca un formato válido.\"})}\n\n //Validar Teléfono\n let telefono=this.telefono\n if (telefono==\"\") errores.push({ mensaje3: \"El campo teléfono no puede estar vacío.\"})\n\n //Validar fecha \n let fecha = this.fecha\n let f= new Date()\n let fechaactual=f.getFullYear() + \"-0\" + (f.getMonth() +1) + \"-\" + f.getDate()\n\n if(fecha < fechaactual){errores.push({ mensaje4: \"Introduzca una fecha válida: debe ser superior a la fecha actual.\"})}\n\n return errores\n }", "title": "" }, { "docid": "7dc7e544eb4a0715ff93369388c14324", "score": "0.65798724", "text": "static validateData(data) {\n let validated = true;\n\n // object containing valid properties and their type\n const validProperties = {\n start: 'String',\n end: 'String',\n title: 'String',\n description: 'String',\n address: 'String',\n location: 'Object'\n }\n \n\n // check if parameter is a object\n if( !data || data.constructor !== Object ) {\n validated = false;\n throw new InvalidData('The data provided is invalid or malformed');\n }\n\n // check if object has correct number of properties and type\n if (Object.keys(data).length !== Object.keys(validProperties).length) validated = false;\n\n Object.keys(data).forEach((property) =>{\n if (!validProperties.hasOwnProperty(property)) {\n validated = false;\n throw new InvalidData('The data provided is invalid or malformed');\n } \n }); \n\n // ensure location object has only two properties, latitude and longitude \n validated = Object.keys(data.location).length === 2 ? validated : false;\n if(!validated) throw new InvalidData('The data provided is invalid or malformed');\n\n if(data.location.constructor !== Object) validated = false;\n Object.keys(data.location).forEach((key)=>{\n if (key !== 'latitude' && key != 'longitude') {\n validated = false;\n throw new InvalidData('The data provided is invalid or malformed');\n }\n });\n\n const reg = new RegExp(\"^-?([1-8]?[1-9]|[1-9]0)\\.{1}\\\\d{0,9}\");\n\n // validate latitude and longitude parameters\n console.log(data.location.longitude);\n console.log(reg.exec(data.location.longitude));\n if (!reg.exec(data.location.latitude) || !reg.exec(data.location.longitude)) throw new InvalidData('The data provided is invalid or malformed');\n\n\n //TODO: date validation\n\n // if (!validator.isAlphanumeric(data.description)) throw new InvalidData('The data p`rovided is invalid or malformed');\n\n // const latLong = data.location.lat + \", \" + data.location.long; // verify property names of lat long in JSON object\n // const validLocation = validator.isLatLong(latLong) ? latLong : null; // validate location string\n // if(!validLocation) validated = false; \n\n return validated;\n }", "title": "" }, { "docid": "99887cfa05a00086b07d845eca9d2007", "score": "0.6562886", "text": "_validate() {}", "title": "" }, { "docid": "f69845b12f906213e645efbfc2253d73", "score": "0.65495646", "text": "function valid ( ) {\n\n }", "title": "" }, { "docid": "932df23d98ab391baf199826fd2f311c", "score": "0.6542014", "text": "verifyInvalidDataErrorsForInputFields() {\n this.verifyErrorsOfBlankInputFields({ allErrors: false });\n }", "title": "" }, { "docid": "50097d0f60c721f46e768d76b6101b9a", "score": "0.6533931", "text": "validarDatos(detalleVentas) {\n let errores = '';\n\n if (!moment($('#devolucion_venta-fecha').value).isValid()) {\n errores += '<br>Fecha inválida';\n }\n\n if (!$('#devolucion_venta-cliente').value) {\n errores += '<br>Falta seleccionar el cliente';\n }\n\n if (!$('#devolucion_venta-datos_venta').value) {\n errores += '<br>Falta seleccionar una venta';\n }\n\n if (detalleVentas.length == 0) {\n errores += '<br>La venta no tiene detalles de venta.';\n } else {\n let hayDevoluciones = false;\n\n for (let i = detalleVentas.length - 1; i >= 0; --i) {\n if (util.esNumero(detalleVentas[i].cantidad) && detalleVentas[i].cantidad > 0) {\n hayDevoluciones = true;\n } else {\n detalleVentas.splice(i, 1);\n }\n }\n\n if (!hayDevoluciones) {\n errores += '<br>Ninguna de las líneas de venta tiene cantidades de devolución válidas.';\n }\n }\n return errores;\n }", "title": "" }, { "docid": "01b3faec6a6e3eff1af06409aaec07b9", "score": "0.64591944", "text": "function validateData() {\n\n const emailReg = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n const textReg = new RegExp(\"^[a-zA-Z\\\\s]*$\");\n const textmobileReg = new RegExp(\"^[1-9]{1}[0-9]{9}$\");;\n\n if (!(email || name || mob)) {\n setemailerr(true);\n setnameerr(true);\n setmobileerr(true);\n return false;\n }\n else if (!email || (emailReg.test(email) == false)) {\n setemailerr(true);\n return false;\n }\n else if (emailReg.test(email) == true)\n setemailerr(false);\n\n\n if (!name || (textReg.test(name) == false)) {\n setnameerr(true);\n return false;\n\n }\n else if (textReg.test(name) == true)\n setnameerr(false);\n\n if (!mob || (textmobileReg.test(mob) == false)) {\n setmobileerr(true);\n return false;\n\n }\n else if (textmobileReg.test(mob) == true)\n setmobileerr(false);\n\n saveData();\n }", "title": "" }, { "docid": "ca9a58f764a118e6eadb9947818e1a2d", "score": "0.64445525", "text": "validateFields() {\n // verificar se as informações foram preenchidas, se os campos estão vazios ou não\n const {description, amount, date} = Form.getValues()\n\n if( description.trim() === \"\" || // verificando se o description esta vazio ou\n amount.trim() === \"\" || // se o amount está vazio, ou\n date.trim() === \"\" ) { // se o date esta vazio\n throw new Error(\"Por favor, preencha todos os campos\") // new signifia que estou criando um novo objeto, nesse caso um objeto de erro com uma mensagem\n } // trim -> limpeza de espaços vazios\n }", "title": "" }, { "docid": "88f95cae5f485fffc614b921ff9435b8", "score": "0.63178355", "text": "function validaDato(oElemen, oValidacion)\n{\n\t// COMPROBAMOS QUE SE PUEDE EJECUTAR SU VALIDACION POR EL BOTON PULSADO\n\tif (!getEjecucionValidacion(oValidacion))\n\t\treturn new ParqMensaje('', null, null);\n\n\tvar sValor = trim(oElemen.value);\n\t// TEXTAREAS, quitamos retornos de carro y demos para que no fallen los EVAL\n\tif (oElemen.type == \"textarea\")\n\t\tsValor = quitarRetornos(sValor);\n\t\n\tvar sTipoDato = oValidacion.tipodato;\t\t\t\n\tvar bObligatorio = oValidacion.obligatorio;\n\tvar sValidacion = oValidacion.validacion;\n\tvar sCualificador= oValidacion.cualificador;\n\tvar sIdError = oValidacion.idEV;\n\tvar oMsgError;\n\tvar bTipoDatoArquitectura= true;\n\t\n\t// SI VIENE MENSAJE, MACHACAMOS EL CONCEPTO\t\n\tif (oValidacion.idMensaje != null && oValidacion.idMensaje != '')\n\t{\t\n\t\tsCon = \"\";\n\t\ttry \n\t\t{ \n\t\t\tsCon = getMensaje(oValidacion.idMensaje, oValidacion.dominio);\n\t\t}\n\t\tcatch(e)\n\t\t{\t\n\t\t\tsCon = oValidacion.concepto;\n\t\t}\t\n\t\toValidacion.concepto = sCon;\t\t\t\n\t}\n\t\n\tif ( (bObligatorio == 1) && (sValor == ''))\t\n\t{\t\n\t\treturn new ParqMsgObligatorio(oValidacion.concepto);\n\t}\n\t\n\t// Comprobamos que cumple la longitud minima esperada (si asi se especifico):\n\tif ( oValidacion.longmin != null && sValor != '' )\n\t{\n\t\tif (trim(sValor).length < oValidacion.longmin)\n\t\t{\n\t\t\treturn new ParqMsgErrorLongMinima(oValidacion.concepto, oValidacion.longmin, sValor);\n\t\t}\n\t}\n\tif ( ( sTipoDato != null ) && ( sValor != '' ) )\n\t{\n\tvar itipoDato = null;\t\t\t\t \n\t//Comprobamos que el valor del tipo de dato es un tipo de dato permitido\n\ttry \n\t{ \n\t\titipoDato = eval(sTipoDato);\n\t}\n\tcatch(e)\n\t{\t\n\t\tbTipoDatoArquitectura= false; \n\t}\n\t\n\tif (sTipoDato)\n\t{\n\t\tvar oParam= null;\n\t\tif (sTipoDato == 'dtFormatted') \n\t\t{\n\t\t\tif (sCualificador != null && sCualificador != '')\n\t\t\t\toParam= sCualificador;\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn new ParqMsgElementoSinFormato(oValidacion.concepto);\n\t\t\t} \t\t\n\t\t}\n\t\telse if ( (sCualificador != null) && (sCualificador != \"\"))\n\t\t\toParam= eval(sCualificador);\n\t\tif (bTipoDatoArquitectura)\n\t\t{\n\t\t\t//Validamos la funcion\n\t\t\tif (oParam)\n\t\t\t\toMsgError = oARQDFuncValidacion[getFnIndex(itipoDato)](sValor, oValidacion.concepto, oParam);\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tif (sTipoDato == 'dtRadioButton'){\n\t\t\t\t\toMsgError = oARQDFuncValidacion[getFnIndex(itipoDato)](oValidacion);\n\t\t\t\t} else{\n\t\t\t\t\toMsgError = oARQDFuncValidacion[getFnIndex(itipoDato)](sValor, oValidacion.concepto);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (oMsgError.codigo.length > 0)\n\t\t\t\treturn (sIdError == null || sIdError == '') ? oMsgError : new ParqMensaje(sIdError, null, 'ARQ');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Puede ser que se deba a que es un nuevo tipo de datos definido por el \n\t\t\t//\tusuario dinomicamente (mediante la funcion annadirTipoDatos():\n\t\t\tvar idex= getIndexFuncionDeTipoDato(sTipoDato);\n\t\t\tif (idex != -1)\n\t\t\t{\n\t\t\t\tvar oRetFuncPart= new ParqMensaje(\"\",null, 'ARQ');\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar sTipoP= typeof(oARQDFuncValidacionParticular[idex]);\n\t\t\t\t\tif (sTipoP.toUpperCase() == \"FUNCTION\") \n\t\t\t\t\t{\n\t\t\t\t\t\tif (oParam)\n\t\t\t\t\t\t\toRetFuncPart= oARQDFuncValidacionParticular[idex](sValor, oParam);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\toRetFuncPart= oARQDFuncValidacionParticular[idex](sValor);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (oParam)\n\t\t\t\t\t\t\toRetFuncPart= eval(oARQDFuncValidacionParticular[idex])(sValor, oParam);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\toRetFuncPart= eval(oARQDFuncValidacionParticular[idex])(sValor);\n\t\t\t\t\t}\n\t\t\t\t\tvar typRet= typeof(oRetFuncPart);\n\t\t\t\t\tif (typRet.toUpperCase() == \"STRING\")\n\t\t\t\t\t\toRetFuncPart= new ParqMensaje(null, oRetFuncPart, null);\n\t\t\t\t}\n\t\t\t\tcatch(e)\n\t\t\t\t{\n\t\t\t\t\treturn new ParqMsgFuncValidNoDefinida(oARQDFuncValidacionParticular[idex]);\n\t\t\t\t}\n\t\t\t\tif (oRetFuncPart.codigo.length > 0)\n\t\t\t\t\treturn (sIdError == null) ? oRetFuncPart : (new ParqMensaje(sIdError,null,'ARQ'));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn new ParqMsgTipoDatoNoPermitido(sTipoDato);\n\t\t\t\t}\n\t\t\t}\n\t\t}\t \n\t}\n\t\n\t// EJECUTAMOS SU VALIDACION PARTICULAR SI LA TIENE\n\tif (sValidacion != undefined && sValidacion != '')\n\t{\n\t\tvar oRetValPart;\n\t\tif(self[sValidacion.substring(0, (sValidacion.indexOf(\"(\")==-1?sValidacion.length:sValidacion.indexOf(\"(\")) )]) \n\t\t{ \n\t\t\tsValidacion= sValidacion + (sValidacion.indexOf(\"()\")==-1?\"()\":\"\") ;\n\t\t\toRetValPart= eval(sValidacion);\n\t\t\tvar typRet= typeof(oRetValPart);\n\t\t\tif (typRet.toUpperCase() == \"STRING\")\n\t\t\t{\n\t\t\t\treturn new ParqMensaje(oRetValPart, null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn oRetValPart;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn new ParqMsgFuncValidNoDefinida(sValidacion);\n\t\t}\n\t}\n\t\n\t// SI TODO HA IDO BIEN\n\treturn new ParqMensaje('', null, null);\n}", "title": "" }, { "docid": "3538f3d3dd16a1d382f9f3917bdb6959", "score": "0.6266783", "text": "validateFields() {\n const { description, amount, date } = this.getInputData()\n\n if (description.trim() === \"\" ||\n amount.trim() === \"\" ||\n date.trim() === \"\") {\n throw new Error(\"Por favor, preencha todos os campos\")\n }\n }", "title": "" }, { "docid": "529f452163ef5fe9d3b913ea7c9f0dbf", "score": "0.6265366", "text": "function validarDatos() {\n let numDoc = inputNumDoc.value;\n let id = inputID.value;\n let email = inputEmail.value;\n if(aditionalParam == \"id\") \n return numDoc && id;\n else return numDoc && email;\n}", "title": "" }, { "docid": "36fb8cfa964aa8abe560bde947a31145", "score": "0.6249574", "text": "_validateData() {\n try {\n this._validateBaseStat();\n this._validateAffectingElements(this.props.data.affectingMoves);\n this._validateAffectingElements(this.props.data.affectingNatures);\n this._validateAffectingCharacteristics();\n } catch (err) {\n throw err;\n }\n }", "title": "" }, { "docid": "fd1266e2bc67803ca59c3d833fe8f737", "score": "0.62386245", "text": "function Validators() {}", "title": "" }, { "docid": "49e662f49f11548ee0cb90ae413e14cb", "score": "0.6228827", "text": "function validate(values) {\n\n}", "title": "" }, { "docid": "f3e99c9d9a452d3eb58ebaafe2fd6168", "score": "0.62240463", "text": "function validate() {\n // Define the data object and include the needed parameters.\n // Make the validate API call and assign a callback function.\n}", "title": "" }, { "docid": "3cf31d65f4988563b19a9a5a97b7148b", "score": "0.6222913", "text": "function validarCamposDatosLocal() {\n var campo1 = false;\n var campo2 = false;\n var campo3 = false;\n var campo4 = false;\n\n if (!document.getElementById('cif').validity.valid) {\n $('[data-toggle=\"divCif\"]').tooltip('show'); \n temporizadorTooltip();\n document.getElementById('divCif').className = 'form-group has-error has-feedback'; \n } else {\n document.getElementById('divCif').className = 'form-group';\n campo1 = true;\n }\n\n if (!document.getElementById('nombre').validity.valid) {\n $('[data-toggle=\"divNombre\"]').tooltip('show'); \n temporizadorTooltip();\n document.getElementById('divNombre').className = 'form-group has-error has-feedback'; \n } else {\n document.getElementById('divNombre').className = 'form-group';\n campo2 = true;\n }\n\n if (!document.getElementById('direccion').validity.valid) {\n $('[data-toggle=\"divDireccion\"]').tooltip('show'); \n temporizadorTooltip();\n document.getElementById('divDireccion').className = 'form-group has-error has-feedback'; \n } else {\n document.getElementById('divDireccion').className = 'form-group';\n campo3 = true;\n }\n\n if (!(/^\\d{9}$/.test(document.getElementById('telefono').value))) {\n $('[data-toggle=\"divTelefono\"]').tooltip('show'); \n temporizadorTooltip();\n document.getElementById('divTelefono').className = 'form-group has-error has-feedback'; \n } else {\n document.getElementById('divTelefono').className = 'form-group';\n campo4 = true;\n }\n\n if (campo1 && campo2 && campo3 && campo4) {\n return true;\n }\n}", "title": "" }, { "docid": "1b4ae19aebf621ae617cc1a33499a33c", "score": "0.6212354", "text": "valid(validations){\n return this.validate(undefined, {set_errors: false}, validations || this.validation);\n }", "title": "" }, { "docid": "019c315d7b4c4fe520c93988aa27aa6d", "score": "0.6190599", "text": "_doValidation(realmData) {\n\n if (realmData === undefined) return false\n if (realmData.id === undefined) return false\n if (realmData.name === undefined) return false\n\n return true\n }", "title": "" }, { "docid": "6f0f6b689e787e063341b347ae62550d", "score": "0.6188439", "text": "function validar(pTituloActividad, pDescripcionActividad, pFechaActividad, pHoraInicioActividad, pHoraFinActividad, pUbicacionActividad, pCapacidadParticipantesActividad, nCupoActividad, pCostoActividad, sMonedaActividad, pCategoriaActividad, pPatrocinadorActividad, pAportePatrocinador, pFotoActividad, pRatingActividad, sPalabrasActividad) {\n let error = false;\n let expPalabras = /[À-ÿ\\w &]+$/;\n let expNumeros = /[0-9]+$/;\n let expPalabrasSimbolos = /[À-ÿ\\w.,-:$()*%#!@+=''\"\"?¿ &]+$/;\n\n\n // fechas\n let diaActividad = pFechaActividad.getDate() + 1;\n let mesActividad = pFechaActividad.getMonth() + 1;\n let annoActividad = pFechaActividad.getFullYear();\n\n \n\n if (pTituloActividad == '' || expPalabras.test(pTituloActividad) == false) {\n error = true;\n inputTituloActividad.classList.add('error-input');\n } else {\n inputTituloActividad.classList.remove('error-input');\n }\n\n /**\n * Daniel: borre el validar del ID Actividad\n */\n\n if (pDescripcionActividad == '' || expPalabrasSimbolos.test(pDescripcionActividad) == false) {\n error = true;\n inputDescripcionActividad.classList.add('error-input');\n } else {\n inputDescripcionActividad.classList.remove('error-input');\n }\n\n if (annoActividad < anoHoy || isNaN(annoActividad) == true) {\n error = true;\n inputFechaActividad.classList.add('error-input');\n } else if ((annoActividad == anoHoy && mesActividad < mesHoy) || isNaN(mesActividad) == true) {\n error = true;\n inputFechaActividad.classList.add('error-input');\n } else if ((annoActividad == anoHoy && mesActividad == mesHoy && diaActividad < diaHoy+1) || isNaN(diaActividad) == true) {\n error = true;\n inputFechaActividad.classList.add('error-input');\n } else {\n inputFechaActividad.classList.remove('error-input');\n }\n\n if (pHoraInicioActividad == '') {\n error = true;\n inputHoraInicioActividad.classList.add('error-input');\n } else {\n inputHoraInicioActividad.classList.remove('error-input');\n }\n\n if (pHoraFinActividad == '' || pHoraFinActividad < pHoraInicioActividad) {\n error = true;\n inputHoraFinActividad.classList.add('error-input');\n } else {\n inputHoraFinActividad.classList.remove('error-input');\n }\n\n if (pUbicacionActividad == '' || expPalabras.test(pUbicacionActividad) == false) {\n error = true;\n inputUbicacionActividad.classList.add('error-input');\n } else {\n inputUbicacionActividad.classList.remove('error-input');\n }\n\n if (sPalabrasActividad == '' || expPalabrasSimbolos.test(sPalabrasActividad) == false) {\n error = true;\n inputPalabrasActividad.classList.add('error-input');\n } else {\n inputPalabrasActividad.classList.remove('error-input');\n }\n\n if (pCapacidadParticipantesActividad == '' || expNumeros.test(pCapacidadParticipantesActividad) == false || pCapacidadParticipantesActividad <= 0) {\n error = true;\n inputCapacidadParticipantesActividad.classList.add('error-input');\n } else {\n inputCapacidadParticipantesActividad.classList.remove('error-input');\n }\n\n if (pCostoActividad === '' || expNumeros.test(pCostoActividad) == false || pCostoActividad < 0) {\n error = true;\n inputCostoActividad.classList.add('error-input');\n } else {\n inputCostoActividad.classList.remove('error-input');\n }\n\n if (document.querySelector('#moneda input[type=radio]:checked') == null) {\n document.querySelector('#moneda').classList.add('error-texto');\n error = true;\n } else {\n document.querySelector('#moneda').classList.remove('error-texto');\n }\n\n if (pCategoriaActividad == '') {\n error == true;\n inputCategoriaActividad.classList.add('error-input');\n } else {\n inputCategoriaActividad.classList.remove('error-input');\n }\n\n if (pPatrocinadorActividad == '') {\n inputPatrocinadorActividad.classList.add('error-input');\n } else {\n inputPatrocinadorActividad.classList.remove('error-input');\n }\n if (pAportePatrocinador == '' || expPalabrasSimbolos.test(pAportePatrocinador) == false) {\n error = true;\n inputAportePatrocinador.classList.add('error-input');\n } else {\n inputAportePatrocinador.classList.remove('error-input');\n }\n\n return error;\n}", "title": "" }, { "docid": "237fed864f76ce8335e4a816e9a10279", "score": "0.61758566", "text": "validate(_value, _utils) {\n return false;\n }", "title": "" }, { "docid": "dddbd3204cd069239124cb2b74d646c8", "score": "0.615836", "text": "isValid () {\n return this.validName() &&\n this.validMaidenName() &&\n this.validDatesUsed()\n }", "title": "" }, { "docid": "24ebdfc9c695e78e6e534ea37f39c804", "score": "0.6139543", "text": "function validarInput() {\r\n //con this envio el input\r\n longitudActual(this);\r\n // Si esta validando el correo\r\n if(this.type == 'email'){\r\n validarCorreo(this);\r\n }\r\n}", "title": "" }, { "docid": "069f52deb3e57d1941b5362b91680fba", "score": "0.61290115", "text": "function validaInvalid(obj) {\n\t\t\tvar errocampo = false;\n\n\t\t\tif($(\"#\"+obj.id+\":invalid\").length) {\n\t\t\t\tERRO = errocampo = true;\n\t\t\t\tvar msg = \"\";\n\t\t\t\tmsg = $(obj).data('pattern');\n\n\t\t\t\t$(obj).showMsg(\"Campo preechido incorretamente. \"+((msg) ? \"<br>\"+msg : \"\"));\n\t\t\t}\n\n\t\t\treturn errocampo;\n\t\t}// validaInvalid()", "title": "" }, { "docid": "e6d8851c95eae6b22aeaeb4c3f95aea4", "score": "0.61257184", "text": "function customValidation(input) {}", "title": "" }, { "docid": "bc082154c7fb80d88056dce878415958", "score": "0.61222196", "text": "validate () {\n\n }", "title": "" }, { "docid": "f2460c8f7e313bac99f54099282bc393", "score": "0.6104103", "text": "function validate(x){}", "title": "" }, { "docid": "adbda6caa94dfd64768e1e38022e2740", "score": "0.6093395", "text": "function validarCampo() {\n // Se valida la longitud del texto\n validarLongitud(this);\n \n // Validar email\n if (this.type === 'email') { validarEmail(this) }\n \n // Habilidar o deshabilitar el botón de envío\n validarBotonEnviar();\n\n}", "title": "" }, { "docid": "f2dcd361fc4f6cf30a320a5c3f969315", "score": "0.6088913", "text": "dataCheck () {\n if (this.x.length !== this.y.length || this.x.length === 0 || this.y.length === 0) {\n this.isValidated = false\n }\n }", "title": "" }, { "docid": "9f24b9a1feca9989c77d31c6b8a7d8fb", "score": "0.60852516", "text": "validate(form){\r\n let teste_de_validacao = true\r\n\r\n // limpa todas as validações antigas\r\n let currentValidations = document.querySelectorAll('form .error-validation');\r\n \r\n if(currentValidations.length) {\r\n this.cleanValidations(currentValidations);\r\n }\r\n \r\n // pegar todos inputs do formualrio\r\n let inputs = form.getElementsByTagName('input');\r\n // transformar HTMLCollection em array com rest operator\r\n let inputsArray = [...inputs];\r\n\r\n // loop nos inputs e validação mediante aos atributos encontrados\r\n inputsArray.forEach(function(input) {\r\n \r\n // fazer validação de acordo com o atributo do input\r\n for(let i = 0; this.validations.length > i; i++) {\r\n //pegar atributos do input\r\n if(input.getAttribute(this.validations[i]) != null) {\r\n \r\n // limpa string para saber o método (data-min-length --> minlength)\r\n let method = this.validations[i].replace(\"data-\", \"\").replace(\"-\", \"\");\r\n \r\n // valor do input\r\n let value = input.getAttribute(this.validations[i])\r\n \r\n // invoca o método\r\n if( this[method](input,value) == false){\r\n return teste_de_validacao = false;//modificacao da variavel para false\r\n }\r\n }//fim if\r\n }//fim for\r\n }, this);\r\n return teste_de_validacao //variavel de teste de validacao, liberar acesso caso esteja tudo certo\r\n }", "title": "" }, { "docid": "12cdb5235f14ca226afd4deb0a214fb0", "score": "0.6084258", "text": "validaciones() {\n this.moto.placa = this.moto.placa.length > 6 ? this.moto.placa.slice(0, 5) : this.moto.placa\n this.moto.cilindraje = this.moto.cilindraje.length > 3 ? this.moto.placa.slice(0, 2) : this.moto.cilindraje\n this.moto.modelo = this.moto.modelo.length > 4 ? this.moto.modelo.slice(0, 3) : this.moto.modelo\n }", "title": "" }, { "docid": "082630199919a7bf157ee52d456a5647", "score": "0.6077462", "text": "validacion() {\n let message=[]\n if (this.nombre == \"\") {\n message.push({error:'Lo sentimos, el formato del nombre indicado no es correcto. Vuelva a indicarlo de nuevo.'})\n }\n if (this.email == \"\") {\n message.push({error:'Lo sentimos, el formato del email indicado no es correcto. Vuelva a indicarlo de nuevo.'})\n }\n if (this.telefono == \"\" || this.telefono.length < 9 || this.telefono == isNaN) { //PREGUNTAR\n message.push({error:'Lo sentimos, el formato del teléfono indicado no es correcto. Vuelva a indicarlo de nuevo.'})\n \n }\n if (this.fecha == \"\") {\n message.push({error:'Por favor, indique una fecha para realizar la reserva de su cita.'})\n }\n if (this.hora == \"\") {\n message.push({error:'Por favor, indique una hora para realizar la reserva de su cita.'})\n }\n\n return message\n }", "title": "" }, { "docid": "5e285657745bc6b5f459c612a6f96eb3", "score": "0.6072161", "text": "oneValid() {\n super.valid();\n }", "title": "" }, { "docid": "40326290079357a44cdd15364b818256", "score": "0.6062476", "text": "_validate(data){\n //validate given config\n if (!data.setting) throw new EmptyMandatoryError(\"setting\", data, this.TEST_SETTING_SAMPLE());\n if (!(data.cases instanceof Array) || data.cases.length==0) throw new EmptyMandatoryError(\"cases\", data, this.TEST_SETTING_SAMPLE());\n if (!(data.functionNames instanceof Array) || data.functionNames==0) throw new EmptyMandatoryError(\"functionNames\", data, this.TEST_SETTING_SAMPLE());\n\n data.cases.forEach((entry,idx) => {\n if (entry.value === undefined) throw new EmptyMandatoryError(\"cases[\"+idx+\"].value\", entry, this.TEST_SETTING_SAMPLE());\n });\n }", "title": "" }, { "docid": "d3046e49db03ae417a4980de2d623d0f", "score": "0.60597026", "text": "constructor(...params) {\n //validates Id for non zero positive number\n let idRegex = RegExp(\"^[1-9][0-9]{0,}$\");\n if (idRegex.test(params[0])) this.id = params[0];\n else throw \"Invalid Id\";\n let nameRegex = RegExp(\"^[A-Z]{1}[a-z]{2,}$\");\n if (nameRegex.test(params[1])) this.name = params[1];\n else throw \"Invalid name\";\n this.salary = params[2];\n //validate m or f \n let genderRegex = RegExp(\"^[M|F]$\");\n if(genderRegex.test(params[3]))\n this.gender = params[3];\n else throw 'Invalid Gender';\n //date validation\n if(params[4]<=new Date().toLocaleDateString())\n this.startDate = params[4];\n else throw 'Invalid date';\n }", "title": "" }, { "docid": "f9be498dc1c2e6f26a02ddf2b9d0a07d", "score": "0.6045563", "text": "static valid(obj, type, schema) {\n\n try {\n\n return this.validate(obj, type, schema);\n\n } catch (e) {\n\n // console.log(e); // report error\n return false;\n\n }\n\n }", "title": "" }, { "docid": "230bc3d24a4aaa6d1f45be903482285c", "score": "0.60356224", "text": "function validate_dataAll (input_object) {\n return 1; \n }", "title": "" }, { "docid": "daeb0507348bf2fa00fac11156f188f4", "score": "0.6022589", "text": "function validacionDatos(){\r\n\r\n var inputNomEntrega = cojerElemento(\"inputNomEntrega\").value;\r\n if (inputNomEntrega.trim() == \"\") {\r\n alert(\"Tens que posar un nom\")\r\n return \"\";\r\n }\r\n\r\n var inputDescripcioEntrega = cojerElemento(\"inputDescripcioEntrega\").value;\r\n\r\n var inputDataInicialEntrega = cojerElemento(\"inputDataInicialEntrega\").value;\r\n if (inputDataInicialEntrega.trim() == \"\") {\r\n alert(\"Tens que posar una data inicial\")\r\n return \"\";\r\n }\r\n\r\n var inputHoraInicialEntrega = cojerElemento(\"inputHoraInicialEntrega\").value;\r\n if (inputHoraInicialEntrega.trim() == \"\") {\r\n alert(\"Tens que posar una hora inicial\")\r\n return \"\";\r\n }\r\n\r\n var dateTimeInicial = parseDate(inputDataInicialEntrega + \"-\" + inputHoraInicialEntrega);\r\n\r\n var inputDataFinalEntrega = cojerElemento(\"inputDataFinalEntrega\").value;\r\n if (inputDataFinalEntrega.trim() == \"\") {\r\n alert(\"Tens que posar una data final\");\r\n return \"\";\r\n }\r\n\r\n var inputHoraFinalEntrega = cojerElemento(\"inputHoraFinalEntrega\").value;\r\n if (inputHoraFinalEntrega.trim() == \"\") {\r\n alert(\"Tens que posar una hora final\");\r\n return \"\";\r\n }\r\n\r\n var dateTimeFinal = parseDate(inputDataFinalEntrega + \"-\" + inputHoraFinalEntrega);\r\n\r\n var inputDataEntregaEntrega = cojerElemento(\"inputDataEntregaEntrega\").value;\r\n if (inputDataEntregaEntrega.trim() == \"\") {\r\n alert(\"Tens que posar una data d'entrega\");\r\n return \"\";\r\n }\r\n\r\n var inputHoraEntregaEntrega = cojerElemento(\"inputHoraEntregaEntrega\").value;\r\n if (inputHoraEntregaEntrega.trim() == \"\") {\r\n alert(\"Tens que posar una hora d'entrega\");\r\n return \"\";\r\n }\r\n\r\n var dateTimeEntrega = parseDate(inputDataEntregaEntrega + \"-\" + inputHoraEntregaEntrega);\r\n\r\n //Compruebo que las fechas esten correctamente elegidas\r\n if (dateTimeInicial > dateTimeFinal || dateTimeInicial > dateTimeEntrega) {\r\n alert(\"La data inicial te que ser la primera\");\r\n return \"\";\r\n }\r\n\r\n //Compruebo que las fechas esten correctamente elegidas\r\n if (dateTimeFinal > dateTimeEntrega) {\r\n alert(\"La data final te que ser avans de la data d'entrega\");\r\n return \"\";\r\n }\r\n\r\n var inputValorActivitat = cojerElemento(\"inputValorActivitat\").value;\r\n if (inputValorActivitat.trim() == \"\") {\r\n alert(\"No has introduit un valor per l'activitat\");\r\n return \"\";\r\n }\r\n \r\n if (modulActual == \"\") {\r\n alert(\"Tens que seleccionar un modul\");\r\n return \"\"\r\n }\r\n\r\n return modulActual + \";\" + inputNomEntrega + \";\" + inputDescripcioEntrega + \";\" + inputDataInicialEntrega + \" \" + inputHoraInicialEntrega + \";\" + inputDataFinalEntrega + \" \" + inputHoraFinalEntrega + \";\" + inputDataEntregaEntrega + \" \" + inputHoraEntregaEntrega + \";\" + inputValorActivitat;\r\n}", "title": "" }, { "docid": "c1b57f9a0bda1c11d172d66f5c673884", "score": "0.6000814", "text": "getIsValidForm() {\n\n const validatedFields = {\n\n title: {value: !isEmpty(get(this.notification, 'title', '')), errorMessage: \"Поле <b>Заголовок</b> не вказано\"},\n message: {value: !isEmpty(get(this.notification, 'message', '')), errorMessage: \"Поле <b>Текст сповіщення</b> не вказано\"},\n notificationType: {value: !isEmpty(this.notificationType), errorMessage: \"Поле <b>Тип сповіщення</b> не вказано\"}\n }\n\n const notificationTypeCode = get(this.notificationType, 'code', stringEmpty())\n \n if (!isEmpty(notificationTypeCode) && !isEqual(notificationTypeCode, SYSTEM)) {\n \n validatedFields.receivers = {value: this.receivers && this.receivers.length > 0, errorMessage: \"Секція <b>Отримувачі сповіщення</b> повинен містити хоча б один запис\" }\n }\n\n const validationResult = isEqual(validator.validateFields(validatedFields, this.$q.notify).length, 0)\n\n return validationResult\n }", "title": "" }, { "docid": "3f06a129185fabf8c7bd21d443d45770", "score": "0.598248", "text": "get valid() {\r\n\t\tvar self = this;\r\n\t\treturn {\r\n\t\t\tdatetime : function(inp){\r\n\t\t\t\tvar r = self.dt(inp, self.standards.dt).isValid();\r\n\t\t\t\treturn r;\r\n\t\t\t\t},\r\n\t\t\tdate : function(inp){\r\n\t\t\t\treturn self.dt(inp, self.standards.d).isValid();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "05ede79b74be902d476d8d40a55ca01c", "score": "0.59762245", "text": "validateValues(obj) {\n let firstRGEX = /^[A-Z]{1,25}$/i\n let firstResult = firstRGEX.test(obj.firstName)\n if (firstResult === false) {\n alert(\"Please enter a valid first name\")\n this.addInvalid(\"firstName\")\n return null\n }\n let lastRGEX = /^[A-Z]{1,25}$/i\n let lastResult = lastRGEX.test(obj.lastName)\n if (lastResult === false) {\n alert(\"Please enter a valid last name\")\n this.addInvalid(\"lastName\")\n return null\n }\n\n let emailRGEX = /^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/\n let emailResult = emailRGEX.test(obj.email)\n if (emailResult === false) {\n alert(\"Please enter a valid email address\")\n this.addInvalid(\"email\")\n return null\n }\n\n let phoneRGEX = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\\s\\.]{0,1}[0-9]{3}[-\\s\\.]{0,1}[0-9]{4}$/\n let phoneResult = phoneRGEX.test(obj.telephone)\n if (phoneResult === false) {\n alert(\"Please enter a valid phone number in the correct format\")\n this.addInvalid(\"telephone\")\n return null\n }\n\n let cityRGEX = /^[A-Z]{1,25}$/i\n let cityResult = cityRGEX.test(obj.city)\n if (cityResult === false) {\n alert(\"Please enter a valid city\")\n this.addInvalid(\"city\")\n return null\n }\n\n let zipRGEX = /^[0-9]{5}$/\n let zipResult = zipRGEX.test(obj.zip)\n if (zipResult === false) {\n alert(\"Please enter a valid 5-digit ZIP code\")\n this.addInvalid(\"zip\")\n return null\n }\n\n let stateRGEX = /^[a-zA-Z]+(?:[\\s-][a-zA-Z]+)*$/i\n let stateResult = stateRGEX.test(obj.state)\n if (stateResult === false) {\n alert(\"Please enter a valid state\")\n this.addInvalid(\"state\")\n return null\n }\n return 1\n }", "title": "" }, { "docid": "7992f4f439f142689bc3edad31eaa019", "score": "0.5960269", "text": "validateDate() {\n let value = this.date.value;\n let min = dayjs(this.date.min).startOf('day');\n let max = dayjs();\n let errorMessage = null;\n\n if (!this.inThisMoment) {\n if (!isEmpty(value)) {\n let date = dayjs(value, 'YYYY-MM-DD').startOf('day');\n if (date.isSameOrAfter(min)) {\n if (date.isSameOrBefore(max)) {\n this.date.isOk();\n //Se valida la hora\n if (this.setTime) {\n this.validateTime();\n }\n\n return true;\n } else {\n errorMessage = \"No se pueden agregar gastos en el futuro.\";\n }\n } else {\n errorMessage = \"La fecha debe ser mayor a la fecha del lote\";\n }\n } else {\n errorMessage = \"Se debe elegir una fecha valida\";\n }\n } else {\n return true;\n }\n\n this.date.setError(errorMessage);\n return false;\n }", "title": "" }, { "docid": "7992f4f439f142689bc3edad31eaa019", "score": "0.5960269", "text": "validateDate() {\n let value = this.date.value;\n let min = dayjs(this.date.min).startOf('day');\n let max = dayjs();\n let errorMessage = null;\n\n if (!this.inThisMoment) {\n if (!isEmpty(value)) {\n let date = dayjs(value, 'YYYY-MM-DD').startOf('day');\n if (date.isSameOrAfter(min)) {\n if (date.isSameOrBefore(max)) {\n this.date.isOk();\n //Se valida la hora\n if (this.setTime) {\n this.validateTime();\n }\n\n return true;\n } else {\n errorMessage = \"No se pueden agregar gastos en el futuro.\";\n }\n } else {\n errorMessage = \"La fecha debe ser mayor a la fecha del lote\";\n }\n } else {\n errorMessage = \"Se debe elegir una fecha valida\";\n }\n } else {\n return true;\n }\n\n this.date.setError(errorMessage);\n return false;\n }", "title": "" }, { "docid": "1cd7376e3ad54c3a78ec903bdc755b09", "score": "0.5955598", "text": "function validar(params) {\n\n if (params.idnombre == \"\"){\n show_no(\"Alerta\",\"El nombre del cobrador no puede estar vacio\");\n return false;\n }\n return true\n}", "title": "" }, { "docid": "303c52d3d306c8b14ac73d9e8f374d0a", "score": "0.5953667", "text": "function data_validation(inputObj){\n //Get the element details\n var el = form_gen_get_element($(inputObj).attr(\"id\"));\n var re;\n \n //if el is false, return false\n if(el===false || el===undefined) {\n return false;\n }\n \n //Make sure the object exists in the form\n var dat = $(inputObj).html();\n if(dat===undefined) {\n return \"The \" + el.name + \" field does not exist on the form, can not validate non-existant data\";\n }\n \n //Get the type for the field\n var type = form_gen_get_type(el.type);\n \n //if not type, ,return false\n if(type===false || type===undefined) {\n return false;\n }\n \n //Get the value to a var\n var val = $(inputObj).val();\n \n //prepare a var for storing any error messages\n var errors = [];\n \n //min_len:26\n //max_len:33\n //regex_validation_rule:\"^[13][a-zA-Z0-9]{26,33}$\"\n //regex_validation_msg:\"~field~ must be a valid bitcoin address.\"}\n \n //if min lenght is set on the element, check it\n if(el.min_len !==undefined){\n \n //Check the value\n if(val < el.min_len) {\n errors.push(el.name + \" must be at least \" + el.min_len + \" characters long \\r\\n\");\n }\n }\n //Else check if the type has a minimum length\n else if(type.min_len !==undefined){\n //Check the value\n if(val < type.min_len) {\n errors.push(el.name + \" must be at least \" + type.min_len + \" characters long \\r\\n\");\n }\n }\n \n //if element max length is set, \n if(el.max_len !==undefined){\n //Check the value\n if(val > el.max_len) {\n errors.push(el.name + \" must be less than or equal to \" + el.min_len + \" characters long \\r\\n\");\n }\n }\n \n //else if the type max length is set, \n else if(type.max_len !==undefined){\n //Check the value\n if(val > type.max_len) {\n errors.push(el.name + \" must be less than or equal to \" + type.min_len + \" characters long \\r\\n\");\n }\n }\n \n //If element regex is set\n if(el.regex_validation_rule !==undefined){\n re = new RegExp(el.regex_validation_rule,'i');\n \n if(re.test(val)===false) {\n errors.push(el.regex_validation_msg.replace(\"~field~\",el.name)+\". Invalid match \" + val + \"\\r\\n\");\n }\n }\n //else if the type regex is set\n if(type.regex_validation_rule !==undefined){\n re = new RegExp(type.regex_validation_rule,'i');\n \n if(re.test(val)===false) {\n errors.push(type.regex_validation_msg.replace(\"~field~\",el.name)+\" Invalid match \" + val + \"\\r\\n\");\n }\n }\n \n if(errors.length < 1) {\n return true;\n }\n return errors;\n}", "title": "" }, { "docid": "669225c0a451961add95b5a17af42d70", "score": "0.59235114", "text": "function validaForm() {\n // Definizione dei campi da controllare\n var annoProvvedimento = $('#annoProvvedimento').val();\n var numeroProvvedimento = $('#numeroProvvedimento').val();\n var tipoProvvedimento = $('#tipoAttoProvvedimento').val();\n\n // definizione del vettore di errori\n var errori = [];\n\n if (annoProvvedimento === \"\") {\n errori.push(\"Il campo Anno deve essere selezionato\");\n }\n if (numeroProvvedimento === \"\" && tipoProvvedimento === \"\") {\n errori.push(\"Almeno uno tra i campi Numero e Tipo deve essere compilato\");\n }\n // Restituisco il vettore di errori\n return errori;\n }", "title": "" }, { "docid": "7f80defe01e92074c86c028798b85e08", "score": "0.59201735", "text": "function validation(data) {\n if (!data) {\n return false;\n }\n if (typeof (data) !== \"string\") {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "b29a3f21f8d9b4ec69caf6f878aeea94", "score": "0.59123033", "text": "function Validator() {}", "title": "" }, { "docid": "933bebf2373844792ae259b873f7f5c2", "score": "0.5904215", "text": "function validar(){\n if(window.revisarMail(document.getElementById('mailLogin'))&&\n window.revisarLongitud(document.getElementById('passLogin'))\n ){\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "710fe230a58e8723c82c1749716413bc", "score": "0.5902177", "text": "function dataValidation(event) {\n const elem = event.target;\n let status;\n\n switch (elem.id) {\n case 'card-num':\n status = cardNumberValidation(elem.value);\n break;\n case 'validity':\n status = cardDateValidation(elem.value);\n break;\n case 'cvv':\n status = cvvValidation(elem.value);\n break;\n }\n\n if (isError(status)) {\n setErrorPosition(elem.id);\n renderError(getTooltipId(elem.id), status, elem.id);\n }\n else {\n hideError(getTooltipId(elem.id), elem.id);\n removeErrorPosition(elem.id);\n elem.value = status;\n }\n}", "title": "" }, { "docid": "63703aa2b9c5ce3e0cfeffeb1a1355b8", "score": "0.5890414", "text": "function verificarDT(atrib, mens, id){\n bandera = false;\n if(atrib.value.length > 0){\n if(mens=='mtelefono' && atrib.value.length<9){\n error(atrib, mens, '<br>El numero de telefono no tiene los digitos necesarios')\n bandera = false;\n }else{\n arreglo(atrib, mens);\n bandera = true;\n }\n \n }else{\n error(atrib, mens, '<br>El campo esta vacio')\n bandera = false;\n }\n return bandera;\n}", "title": "" }, { "docid": "84c56614271104547cf2dde5cf8ce440", "score": "0.58898056", "text": "function validateInput(data)\n{\n const errors = {};\n\n if (isEmpty(data.deviceID) || validator.isEmpty(data.deviceID))\n {\n errors.deviceID = 'device ID required';\n }\n \n return {\n errors,\n isValid: isEmpty(errors)\n };\n}", "title": "" }, { "docid": "3020a5f989f63bcaf478c317c493454a", "score": "0.588026", "text": "function validateData(c, b) {\r\n if (!c || !b) {\r\n return true\r\n }\r\n var d = 0;\r\n\r\n function a(f) {\r\n return !(f === undefined || f === \"\")\r\n }\r\n b.forEach(function (n) {\r\n if (!n.name || n.type == \"hidden\") {\r\n return\r\n }\r\n var k = c[n.name];\r\n if (n.requiredIf && !a(c[n.requiredIf])) {\r\n return\r\n }\r\n if (n.type == \"checkbox\") {\r\n if (n.checkboxes) {\r\n n.checkboxes.forEach(function (o) {\r\n if (o.name == n.name) {\r\n o.checked = k ? true : false\r\n }\r\n })\r\n } else {\r\n n.checked = k ? true : false\r\n }\r\n } else {\r\n if (n.type == \"agecheck\") {\r\n if (c[n.name + \"_y\"] && c[n.name + \"_m\"] && c[n.name + \"_d\"]) {\r\n var h = parseInt(c[n.name + \"_y\"], 10);\r\n var l = parseInt(c[n.name + \"_m\"], 10);\r\n var f = parseInt(c[n.name + \"_d\"], 10);\r\n k = new Date(h, l - 1, f);\r\n if (k.getMonth() == l - 1 && k.getDate() == f) {\r\n n.value = k\r\n } else {\r\n k = -1;\r\n n.value = 0\r\n }\r\n } else {\r\n k = undefined;\r\n n.value = 0\r\n }\r\n } else {\r\n n.value = k\r\n }\r\n }\r\n n.error = null;\r\n if ((n.required || n.requiredIf) && !a(k)) {\r\n d++;\r\n n.error = n.errMsg;\r\n if (!n.error) {\r\n n.error = loc(\"Please enter a value for this field\")\r\n }\r\n }\r\n if (n.validate) {\r\n if (n.validate.toLowerCase() != \"none\") {\r\n var j = Validate.validate(k, n.validate);\r\n if (!j.valid) {\r\n d++;\r\n n.error = j.msg;\r\n return\r\n }\r\n }\r\n } else {\r\n var g = Validate.validate(k, n.type);\r\n if (!g.valid) {\r\n d++;\r\n n.error = g.msg;\r\n return\r\n }\r\n }\r\n if (n.type == \"agecheck\") {\r\n if (k == -1) {\r\n d++;\r\n n.error = loc(\"Please enter a valid date\")\r\n } else {\r\n var m = new Date(k);\r\n m.setFullYear(m.getFullYear() + n.minAge);\r\n if (m - new Date() > 0) {\r\n d++;\r\n n.error = loc(\"You must be at least {minage} years old\", {\r\n minage: n.minAge\r\n })\r\n }\r\n }\r\n }\r\n });\r\n return d === 0\r\n}", "title": "" }, { "docid": "5a7d731ca1ffaca3aa7eb91320cf1526", "score": "0.58735466", "text": "function validar(){\n /*\n Cuando entral al if es porque estan vacio o no selecionados y se manda a llamar\n un metodo en JAVA llamado getAlert que muestra un Toast con la informacion del \n campo que debe llenar...\n retorna True cuando todos los campos del form estan llenos\n */\n altura = $('#selectAltura option:selected').val();\n peso = $('#Peso').val();\n if(!$('input:radio[name=genero]:checked').is(':checked')){\n window.android.getAlerta(\"Genero\");\n return false;\n }\n if(!$('input:radio[name=complexion]:checked').is(':checked')){\n window.android.getAlerta(\"Complexion\");\n return false;\n }\n if(altura == '0'){\n window.android.getAlerta(\"Altura\");\n return false;\n }\n \n if(peso.length == 0){\n window.android.getAlerta(\"Peso\");\n return false;\n }\n\n if(peso.length >= 4){\n window.android.getAlerta(\"Peso, y este debe ser menos a 999\");\n return false;\n }\n \n return true;\n \n }", "title": "" }, { "docid": "a11852c3666ef5292251ead87a081b62", "score": "0.5871367", "text": "validate() {\n if (!isObject(this.$transformedResponse)) {\n throw new Error('The transformed response must be an object.');\n }\n\n each(this.$required, key => {\n if (!(key in this.$transformedResponse)) {\n throw new Error(`\"${key}\" is a required property and does not exist in the tranformed response.`);\n }\n });\n }", "title": "" }, { "docid": "589994aca273b13542bcf58985a54923", "score": "0.58710974", "text": "objectValidator(obj) {\n let dataIsValid = true;\n const invalidFields = [];\n Object.keys(obj).forEach(key => {\n if(key !== 'state') {\n if(!obj[key]){\n invalidFields.push(key);\n dataIsValid = false;\n }\n }\n });\n return {\n valid: dataIsValid,\n fields: invalidFields\n };\n }", "title": "" }, { "docid": "ca99ad9005c6e79860abe3b5dbe8994a", "score": "0.5870567", "text": "function validar() {\n\tvar msgErr = \"\";\n\tvar regEx = /^([a-zA-ZÑñáéíóú\\s]{2,})$/i;\n\tnombre = getNombre();\n\tdia = getDia();\n\tmes = getMes()-1;\n\tanio = getAnio();\n\tfecha = new Date(anio, mes, dia);\n\n\tif (nombre == \"\" || dia == \"\" || mes == \"\" || anio == \"\") {\n\t\tmsgErr = \"No puede dejar en blanco ningún campo del formulario.\";\n\t\tdocument.getElementById(\"msgErr\").innerHTML = msgErr;\n\t\treturn false;\n\t} else if (isNaN(dia) || parseInt(dia) < 1 || parseInt(dia) > 31) {\n\t\tmsgErr = \"No ha introducido un día válido.\";\n\t\tdocument.getElementById(\"msgErr\").innerHTML = msgErr;\n\t\treturn false;\n\t} else if (isNaN(mes) || parseInt(getMes()) < 1 || parseInt(getMes()) > 12) {\n\t\tmsgErr = \"No ha introducido un mes válido.\";\n\t\tdocument.getElementById(\"msgErr\").innerHTML = msgErr;\n\t\treturn false;\n\t} else if (isNaN(anio) || parseInt(anio) < 1 || parseInt(anio) > new Date().getFullYear()) {\n\t\tmsgErr = \"No ha introducido un año válido.\";\n\t\tdocument.getElementById(\"msgErr\").innerHTML = msgErr;\n\t\treturn false;\n\t} else if (dia != fecha.getDate() || mes != fecha.getMonth() || anio != fecha.getFullYear() || fecha >= new Date()) {\n\t\tmsgErr = \"No ha introducido una fecha válida.\";\n\t\tdocument.getElementById(\"msgErr\").innerHTML = msgErr;\n\t\treturn false;\n\t} else if (!regEx.test(nombre)) {\n\t\tmsgErr = \"El nombre introducido no es válido.\";\n\t\tdocument.getElementById(\"msgErr\").innerHTML = msgErr;\n\t\treturn false;\n\t}\n\n\tdocument.getElementById(\"msgErr\").innerHTML = msgErr;\n\treturn true;\n}", "title": "" }, { "docid": "d4b4decdc365b8431288d2ec9e3c0ce9", "score": "0.58623636", "text": "function validaCampos(nombre, matricula, carrera) {\n\tvar validaNombre = false;\n\tvar validarMatricula = false;\n\tvar validarCarrera = false;\n\n\t//Comprueba que no este vacio\n\tif(nombre.length == 0){\n\t\tMaterialize.toast('Ingresa el nombre completo del alumno', 4000);\n\t}\n\telse {\n\t\t//Comprueba que la longitud sea menor a 50 caracteres\n\t\tif(nombre.length > 50){\n \t\tMaterialize.toast('El nombre es demasiado largo. No debe superar 50 caracteres en total', 4000);\n \t}\n \telse {\n \t \tvalidaNombre = true;\n \t}\n\t}\n\n\t//Validar campo de matricula\n\t//Comprueba que no este vacio\n\tif(matricula.length == 0) {\n\t\tMaterialize.toast('Ingrese la matrícula del alumno', 4000);\n\t}\n\telse {\n\t\t//Comprueba que la longitud no sea diferente de 8 o que no sea numeros\n\t\tif(matricula.length != 8 || isNaN(matricula)) {\n\t\t\tMaterialize.toast('Ingrese una matrícula válida', 4000);\n\t\t}\n\t\telse {\n\t\t\tvalidarMatricula = true;\n\t\t}\n\t}\n\n\t//Validar campo de carrera\n\t//Comprueba que se aya seleccionado alguna opcion\n\tif(carrera == 0) {\n\t\tMaterialize.toast('Elige la carrera a la que pertenece el alumno', 4000);\n\t}\n\telse {\n\t\tvalidarCarrera = true;\n\t}\n\n\t//Indica si algun campo esta vacio\n\tif(validaNombre && validarMatricula && validarCarrera) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "039d670dde38b1665238ea15a7e21f03", "score": "0.5859894", "text": "validateUserData(obj){\n //destructuring:\n const {\n f_name,\n l_name,\n Email_adress,\n postal_code,\n house_adress,\n phone_num \n } = obj;\n\n //if the atributes are not empty the data will be send to the server:\n if((f_name === '') ||\n (l_name === '') ||\n (Email_adress === '') ||\n (postal_code === '') ||\n (house_adress === '') ||\n (phone_num === '')\n ){\n return false;\n }else{\n return true;\n }\n }", "title": "" }, { "docid": "9df6fff543cfb4c2025a2cb5ca970605", "score": "0.58405256", "text": "function validarFormulario(){\n nombre=$('#nombreU').val();\n apellido=$('#apellidoU').val()\n dni=$('#dniU').val()\n fec=$('#fecU').val()\n usuario=$('#usuario').val()\n contra=$('#contra').val()\n contra1=$('#Vcontra').val()\n tipo=$('#tipoU').val()\n if(nombre.length>0){\n if(apellido.length>0){\n if(dni.length>=8){\n if(fec.length>9){\n if(usuario.length>1){\n if(contra.length>6){\n if(contra==contra1){\n if(tipo.length>0){\n if(tipo!='Seleccionar'){\n return true;\n }else{\n alertify.error('Seleccione un opcion valida') \n return false; \n }\n }else{\n alertify.error('Seleccione un tipo de usuario') \n return false; \n }\n }else{\n alertify.error('Los campos no coinciden')\n $('#contra').focus();\n return false; \n }\n }else{\n alertify.error('Su contraseña debe tener 6 digitos minimo')\n $('#contra').focus();\n return false; \n }\n }else{\n alertify.error('Ingrese un usuario')\n $('#usuario').focus();\n return false; \n }\n }else{\n alertify.error('Ingrese una fecha de nacimiento')\n $('#fecU').focus();\n return false; \n }\n }else{\n alertify.error('Verifique el campo del DNI')\n $('#dniU').focus();\n return false; \n }\n }else{\n alertify.error('Los apellidos son obligatorios')\n $('#apellidoU').focus();\n return false; \n }\n }else{\n alertify.error('El nombre es un campo obligatorio')\n $('#nombreU').focus();\n return false;\n }\n}", "title": "" }, { "docid": "c740a78d62ca7801a382a12c33e937c2", "score": "0.58401096", "text": "validateSubmit() {\n let validations = [];\n validations.push(this.validateDate());\n validations.push(this.validateTime());\n\n //Retorna false si alguna de las validaciones es falsa, pero valida todos los campos\n return !validations.some(val => val === false);\n }", "title": "" }, { "docid": "1daf313f0b5183c69ac6a13a628d5733", "score": "0.583995", "text": "function ValidarSalarios()//funcion para validar los campos antes de mandar los datos al ajax\n{\n var validado = false; \n var anio = document.getElementById(\"anio\").value;\n var zonaA = document.getElementById(\"zonaA\").value;\t\n var zonaB = document.getElementById(\"zonaB\").value;\n var zonaC = document.getElementById(\"zonaC\").value;\n \n \n if(anio == \"\" )\n {\n \n cuteToast({\n type: \"error\",\n message: \"Revise el campo año, Ingrese solo números enteros\",\n timer: 4000\n \n })\n validado= false;\n $(\"#anio\").focus();\n }\n else\n {\n if(zonaA == \"\")\n {\n cuteToast({\n type: \"error\",\n message: \"Revise el campo Zona A. Ingrese solo números\",\n timer: 4000\n })\n \n validado= false;\n $(\"#zonaA\").focus();\n } \n else{\n if(zonaB == \"\")\n {\n cuteToast({\n type: \"error\",\n message: \"Revise el campo Zona B. Ingrese solo números\",\n timer: 4000\n })\n \n validado= false;\n $(\"#zonaB\").focus();\n } \n else{\n if(zonaC == \"\")\n {\n cuteToast({\n type: \"error\",\n message: \"Revise el campo Zona C. Ingrese solo números\",\n timer: 4000\n })\n \n validado= false;\n $(\"#zonaC\").focus();\n } \n else{\n validado=true;\n } \n } \n } \n }\n return validado;// retornamos el resultado\n\n}", "title": "" }, { "docid": "7865bb1cd7061b50e13be85b941775e2", "score": "0.58221143", "text": "validateSubmit() {\n let validations = [];\n validations.push(this.validateDate());\n validations.push(this.validateTime());\n validations.push(this.measurements.length > 0);\n\n //Retorna false si alguna de las validaciones es falsa, pero valida todos los campos\n return !validations.some(val => val === false);\n }", "title": "" }, { "docid": "e5a36e1a276e5c0bbfd40b77a2097d12", "score": "0.5816851", "text": "checkValidity(){if(this.inputElement.validate){return this.inputElement.validate()}}", "title": "" }, { "docid": "2bed2f3724311a246a65d317697a9a55", "score": "0.5815336", "text": "function validar(e){\n // Desactivo que se envíe\n e.preventDefault();\n // Lista de campos a validar\n let camposValidar=[\"identificador\",\"nombre\",\"fechaNacimiento\",\"correo\",\"telefono\",\"socio\"]\n for(const campo of camposValidar){\n valida(campo);\n }\n}", "title": "" }, { "docid": "24736db7ca88a39354f79a62dc3869a1", "score": "0.58103085", "text": "isValid() {\n\t\treturn every(keys(this.fields, (id) => {\n\t\t\treturn (this.fields[id].errors.length === 0);\n\t\t}));\n\t}", "title": "" }, { "docid": "50578def60272593f9d06c1276295ddd", "score": "0.5798838", "text": "function fun_validaData(valor)\n{\n var expReg = /^((0[1-9]|[12]\\d)\\/(0[1-9]|1[0-2])|30\\/(0[13-9]|1[0-2])|31\\/(0[13578]|1[02]))\\/(19|20)?\\d{2}$/;\n\n if(expReg.test(valor)){\n var erro = true;\n\n var dia = valor.substring(0,2);\n var mes = valor.substring(3,5);\n var ano = valor.substring(6,10);\n\n if ((mes == 4 || mes == 6 || mes == 9 || mes == 11 ) && dia > 30){\n erro = false;\n }\n else{\n if ((ano % 4) != 0 && mes == 2 && dia > 28){\n erro = false;\n }\n else{\n if ((ano%4) == 0 && mes == 2 && dia > 29){\n erro = false;\n }\n }\n }\n return erro;\n }\n else{\n return (false);\n }\n}", "title": "" }, { "docid": "767e1f20aef6981eb7b4d82af76857c9", "score": "0.5794827", "text": "validate(data) {\n return __awaiter(this, void 0, void 0, function* () {\n let propertieNames = this.getPropertyNames();\n let propertyListMessageList = {};\n let isValid = true;\n if (!propertieNames.length) {\n throw new Error('The model \"' + this.constructor.name + '\" has no defined properties. Maybe you forgot to define a default value');\n }\n for (let propertyName of propertieNames) {\n propertyListMessageList[propertyName] = {\n isValid: false,\n messages: []\n };\n let value = (data && data[propertyName]) ? data[propertyName] : null;\n let validationMessage = yield this.validateProperty(propertyName, value);\n propertyListMessageList[propertyName].messages = propertyListMessageList[propertyName].messages.concat(validationMessage);\n propertyListMessageList[propertyName].isValid = !this.hasErrors(propertyListMessageList[propertyName].messages);\n if (!propertyListMessageList[propertyName].isValid) {\n isValid = false;\n }\n }\n return {\n isValid: isValid,\n properties: propertyListMessageList\n };\n });\n }", "title": "" }, { "docid": "0f0eb87da29cc7906c59724df3b2b7a4", "score": "0.5793189", "text": "function validate(values)\n{\n\tconst errors = {};\n\n\t_.each(camposForma, ({ name }) => {\n\t\tif (!values[name]) errors[name] = '*Requerido';\n\t});\n\n\treturn errors;\n}", "title": "" }, { "docid": "801cfbc44d40ead929fdfa29bf79c418", "score": "0.5787075", "text": "function validaNome(nome,valida_campo_vazio){\n if(!validaCampo(nome,3,valida_campo_vazio)){\n return (false);\n }\n else{\n return(true);\n }\n}", "title": "" }, { "docid": "8b7d51ea4c6df77d36261b2281f92166", "score": "0.5781506", "text": "function validar() {\n //obtiene valores\n \n let startDate = $(\"#startDate\").val();\n let devolutionDate = $(\"#devolutionDate\").val();\n let client = $(\"#client\").val();\n let costume = $(\"#costume\").val();\n let errores = \"\";\n $(\"#mensajes\").html(\"\");\n\n //valida que los campos no sean vacios\n if (validaesVacio(startDate)) {\n errores = \"Debe seleccionar la fecha de inicio<br>\";\n $(\"#mensajes\").html(errores);\n $(\"#mensajes\").show(500);\n $(\"#startDate\").focus();\n return false;\n }else if (validaesVacio(devolutionDate)) {\n errores = \"Debe seleccionar la fecha de final<br>\";\n $(\"#mensajes\").html(errores);\n $(\"#mensajes\").show(500);\n $(\"#devolutionDate\").focus();\n return false;\n }else if (validaesVacio(client)) {\n errores = \"Debe seleccionar un cliente<br>\";\n $(\"#mensajes\").html(errores);\n $(\"#mensajes\").show(500);\n $(\"#client\").focus();\n return false;\n } else if (validaesVacio(costume)) {\n errores = \"Debe seleccionar una disfraz<br>\";\n $(\"#mensajes\").html(errores);\n $(\"#mensajes\").show(500);\n $(\"#costume\").focus();\n return false;\n } else {\n $(\"#mensajes\").html(\"\");\n $(\"#mensajes\").hide(500);\n return true;\n }\n\n return true;\n}", "title": "" }, { "docid": "624f4548e90261a37832da099864e1cb", "score": "0.5773276", "text": "async validateInput(input) {\n const keys = Object.keys(this.keys);\n const validata = {};\n // mapping through the keys to check the input\n keys.forEach((key) => {\n if (input[`${key}`] === null) {\n validata[`${key}`] = null;\n } else if (input[`${key}`] && input[`${key}`].constructor === this.keys[`${key}`]) {\n validata[`${key}`] = input[`${key}`];\n } else if (input[`${key}`] && ((input[`${key}`].constructor === this.keys[`${key}`].constructor) || (input[`${key}`].constructor === Number && this.keys[`${key}`].constructor === Object))) {\n validata[`${key}`] = input[`${key}`];\n } else if (input[`${key}`] && this.refsMultiple[`${key}`] && input[`${key}`].constructor === Array) {\n validata[`${key}`] = input[`${key}`];\n } else if (input[`${key}`] && this.refs[`${key}`] && input[`${key}`].constructor === Number) {\n validata[`${key}`] = input[`${key}`];\n } else if (input[`${key}`] && input[`${key}`].constructor !== this.keys[`${key}`] && input[`${key}`] !== null) {\n throw new TypeError(`Wrong datatype for field ${key}`);\n }\n });\n // this is for validating orders;\n if (input.content && this._checkContent) {\n this._checkContent(input);\n }\n return { passing: true, validata };\n }", "title": "" }, { "docid": "8d9f83ff1b64f8e18c594c10c171650a", "score": "0.5764332", "text": "constructor(value, validation) {\n this.value = value;\n this.validation = validation;\n }", "title": "" }, { "docid": "77bde5290aea4137aecda2ac67dd7cd0", "score": "0.5763203", "text": "isValid(){\n\t\tconst rules = {\n\t\t\tid: \t \t\t'required|integer',\n\t\t\tfirstName: 'required|string',\n\t\t\tlastName:\t\t'required|string',\n\t\t\temail: \t'required|string'\n\t\t}\n\t\tconst validation = new Validator(this, rules);\n\t\treturn validation.passes();\t\t\n\t}", "title": "" }, { "docid": "b4995dab30a1bece8805785a418d6ec7", "score": "0.57467526", "text": "function validarCampos(event){\n const {name, value} = event.target;\n const novoEstado = {...erros};\n novoEstado[name] = validacoes[name](value);\n setErros(novoEstado);\n }", "title": "" }, { "docid": "6e6d36e7fac894e1e9c19a8b02f348a7", "score": "0.573857", "text": "validateData(data) {\n // console.log('_validateData', window.pretty(data));\n return {\n indexVal: (data !== '' && data.selectedOwnerType !== ''),\n };\n }", "title": "" }, { "docid": "a6d842b585e333067fdac5d9a147bef7", "score": "0.5733358", "text": "function checkUserData(data) {\n switch (data.type) {\n case 'sex':\n emptyValidation(data);\n break;\n case 'surname':\n onlyLatinLetters(data);\n emptyValidation(data, true);\n break;\n case 'name':\n onlyLatinLetters(data);\n emptyValidation(data, true);\n break;\n case 'birthday':\n onlyBelow100years(data);\n dataFormat(data, true);\n emptyValidation(data, true);\n break;\n case 'citizenship':\n emptyValidation(data);\n break;\n case 'pasport-code':\n onlyLatinLettersAndNumbers(data);\n emptyValidation(data, true);\n break;\n case 'pasport-limit-date':\n onlyOver100years(data);\n emptyValidation(data, true);\n break;\n case 'email':\n onlyEmail(data);\n emptyValidation(data, true);\n break;\n case 'phone':\n onlyPhone(data);\n emptyValidation(data, true);\n break;\n }\n}", "title": "" }, { "docid": "fa11a62c91ad2ca497d04a0fa4b29645", "score": "0.57331777", "text": "function verifyData(){\n\n\tif (!$(\"#inputNombre\").val()) {\n\t\treturn false;\n\t}\n\tif (!$(\"#inputAp\").val()) {\n\t\treturn false;\n\t}\n\tif (!$(\"#inputAm\").val()) {\n\t\treturn false;\n\t}\n\tif (!$(\"#inputCuenta\").val()) {\n\t\talert(\"El usuario debe tener una cuenta\");\n\t\treturn false;\n\t}\n\tif (!$(\"#inputPassword\").val()) {\n\t\talert(\"El usuario debe tener una contraseña\");\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "2659a1aa4e23a4fd6e5ce86802649b1d", "score": "0.5731876", "text": "function validarCamposImpuestos() {\n var campo1 = false;\n var campo2 = false; \n \n if (!document.getElementById('iva').validity.valid) {\n $('[data-toggle=\"divImpuestoIva\"]').tooltip('show'); \n temporizadorTooltip();\n document.getElementById('divImpuestoIva').className = 'form-group has-error has-feedback'; \n } else {\n document.getElementById('divImpuestoIva').className = 'form-group';\n campo1 = true;\n } \n \n if (!document.getElementById('servicio mesa').validity.valid) {\n $('[data-toggle=\"divImpuestoServicioMesa\"]').tooltip('show'); \n temporizadorTooltip();\n document.getElementById('divImpuestoServicioMesa').className = 'form-group has-error has-feedback'; \n } else {\n document.getElementById('divImpuestoServicioMesa').className = 'form-group';\n campo2 = true;\n } \n \n if (campo1 && campo2) {\n return true;\n }\n}", "title": "" }, { "docid": "b50c901a30b6b53b3bc46d5a25c64b7a", "score": "0.57282424", "text": "function validar() {\n var mensajesError = '';\n var error = false;\n\n var nombreApellido = document.getElementById(\"nma\").value; // Nombre y Apellido:valor \n var dni = document.getElementById(\"dni\").value; // DNI:valor \n var telefono = document.getElementById(\"tel\").value; // Telefóno:valor \n\n if (nombreApellido.length == 0) {\n error = true;\n mensajesError += \"<p>El campo Nombre y apellido es obligatorio.</p>\";\n }\n if (dni.length == 0) {\n error = true;\n mensajesError += \"<p>El campo DNI es obligatorio.</p>\";\n\n }\n if (telefono.length == 0) {\n error = true;\n mensajesError += \"<p>El campo Teléfono es obligatorio.</p>\";\n }\n\n if (array.length < 6) {\n error = true;\n mensajesError += \"<p>Ingrese los sintomas que presenta, por favor.</p>\";\n }\n\n /* Muestra los mensajes de error */\n if (error == false) {\n registrarSintomas();\n return true;\n } else {\n document.getElementById(\"mensajes\").innerHTML = mensajesError;\n return false;\n }\n}", "title": "" }, { "docid": "00fac4994fa09bf9914fcf785f83b568", "score": "0.57235724", "text": "function validateInputs(data) {\n const schema = joi.object({\n firstname : joi.string().required(),\n lastname : joi.string().required(),\n email : joi.string().required().email(),\n phonenumber : joi.number().required(),\n password : joi.string().required()\n });\n return schema.validate(data)\n}", "title": "" }, { "docid": "48bc32776d88837c239db6efd840a39e", "score": "0.57202244", "text": "oneValid() {\n let foundInvalid = false;\n this.validatorList.forEach((value,parent) => {\n if(!value.isValid()) {\n foundInvalid = true;\n return false;\n }\n return true;\n }, this);\n if(!foundInvalid) {\n super.valid();\n } else {\n super.invalid();\n }\n }", "title": "" }, { "docid": "201e4f68a6853597252016c0d949d6b4", "score": "0.57185084", "text": "function validate(values){\n const errors = {};\n //console.log(values);\n if(!values.email){\n errors.email = 'Ingrese un correo electrónico valido!';\n }\n if(!values.password){\n errors.password = 'Ingrese su contraseña!';\n }\n return errors;\n}", "title": "" }, { "docid": "f583f4aa0c06fc91ac062a5dd348995f", "score": "0.5717939", "text": "function Validation(){\n\t\n\tValidateDNI(); Validate_Name(); Validate_Surname(); ValidateDate();ValidatePhone(); Validate_Email(); Validate_Account(); Add_New_Player();\n}", "title": "" }, { "docid": "cb44987fe8e4a8c69cf90303ec943441", "score": "0.5714041", "text": "validate(raw) {\n const data = { composite: {}, user: {} };\n const id = this.plugin;\n const schema = this._schema;\n const validator = this.registry.validator;\n return validator.validateData({ data, id, raw, schema }, false);\n }", "title": "" }, { "docid": "b1f8bb5fe9a14c7248b9402ad2d20bbc", "score": "0.57135016", "text": "@api\n validate() {\n if(this.varIdModuloLwc != null) { \n return { isValid: true }; \n } else { \n return { \n isValid: false, \n errorMessage: 'Selecione um modulo na lista!' \n }; \n }\n }", "title": "" }, { "docid": "7096997a5b11f0963168e90c2d4ff4ab", "score": "0.5708558", "text": "ValidateFields(firstName, lastName, Email, phone, tin) {\n //Validate first name\n if (!this.regexFirstName(firstName)) {\n throw new Error(\"Introduza o primeiro nome.\");\n }\n //Validate last name\n if (!this.regexLastName(lastName)) {\n throw new Error(\"Introduza o apelido.\");\n }\n //Validate email\n if (!this.regexEmail(Email)) {\n throw new Error(\"Introduza um email válido.\");\n }\n //Validate phone\n let result = this.validatePhone(phone.toString());\n if (!(result === true)) {\n throw new Error(result);\n }\n //Validate tin\n if (!this.validateTin(tin)) {\n throw new Error(\"Introduza um NIF válido.\");\n }\n }", "title": "" }, { "docid": "3c0258fed1ee2c176e30d1c0c6143a05", "score": "0.57048225", "text": "isObjectValid(data, schema) {\r\n Object.keys(schema.fields).forEach(expectedProperty => {\r\n if(!data.hasOwnProperty(expectedProperty)) {\r\n return false;\r\n }\r\n });\r\n return true;\r\n }", "title": "" }, { "docid": "40a4f95a2cf01071ce228e26dfed646a", "score": "0.569862", "text": "verifyingData() {\n // Boolean that will be return : true if no error ; false if error\n let submitOk = true;\n var nameRegex = /[0-9,;:!~#{[|`^@\\]}?./¤€§*$^%+µ£¨=)_(\"&)\\\\]/g;\n var mailRegex = /\\S+@\\S+\\.\\S+/;\n if (\n !firstName.validity.valid ||\n firstName.value.search(nameRegex) != -1\n ) {\n document.getElementById(\"firstInputError\").style.display = \"block\";\n this.removeGreenBorderValidation(firstName);\n this.firstName.setAttribute(\"aria-invalid\", \"true\");\n this.firstName.setAttribute(\"aria-describedby\", \"firstInputError\");\n submitOk = false;\n } else {\n this.greenBorderValidation(firstName);\n this.firstName.removeAttribute(\"aria-invalid\");\n this.firstName.setAttribute(\"aria-describedby\", \"first-describe\");\n document.getElementById(\"firstInputError\").style.display = \"none\";\n }\n\n if (\n !secondName.validity.valid ||\n secondName.value.search(nameRegex) != -1\n ) {\n document.getElementById(\"secondInputError\").style.display = \"block\";\n this.removeGreenBorderValidation(secondName);\n this.secondName.setAttribute(\"aria-invalid\", \"true\");\n this.secondName.setAttribute(\n \"aria-describedby\",\n \"secondInputError\"\n );\n submitOk = false;\n } else {\n this.greenBorderValidation(secondName);\n this.secondName.removeAttribute(\"aria-invalid\");\n this.secondName.setAttribute(\"aria-describedby\", \"second-describe\");\n document.getElementById(\"secondInputError\").style.display = \"none\";\n }\n\n if (!email.validity.valid || !mailRegex.test(email.value)) {\n document.getElementById(\"emailInputError\").style.display = \"block\";\n this.removeGreenBorderValidation(email);\n this.email.setAttribute(\"aria-invalid\", \"true\");\n this.email.setAttribute(\"aria-describedby\", \"emailInputError\");\n submitOk = false;\n } else {\n this.greenBorderValidation(email);\n this.email.removeAttribute(\"aria-invalid\");\n this.email.setAttribute(\"aria-describedby\", \"mail-describe\");\n document.getElementById(\"emailInputError\").style.display = \"none\";\n }\n\n if (!message.validity.valid) {\n document.getElementById(\"messageInputError\").style.display =\n \"block\";\n this.removeGreenBorderValidation(message);\n this.message.removeAttribute(\"aria-invalid\");\n this.message.setAttribute(\"aria-describedby\", \"messageInputError\");\n submitOk = false;\n } else {\n this.greenBorderValidation(message);\n this.message.setAttribute(\"aria-describedby\", \"message-describe\");\n this.message.removeAttribute(\"aria-invalid\");\n document.getElementById(\"messageInputError\").style.display = \"none\";\n }\n\n return submitOk;\n }", "title": "" }, { "docid": "4c7fecba0507661baadc18251d47c510", "score": "0.5687914", "text": "function validate(inst, validation)\r\n{\r\n}", "title": "" }, { "docid": "adedd7100ec03c855edb8eca161dcb67", "score": "0.5681487", "text": "function validaDatos(oFormulario)\n{\n\tvar sStringErrores = \"\";\n\tvar sResultado = \"\";\n\tvar gdForms = \"\";\n\tvar sTipoP;\n\tvar oPrimerElemenError;\n\tvar sRetorno = new ParqMensaje('', null, 'ARQ');\n\t\n\tsTipoP = typeof(oFormulario);\n\t\n\tif (sTipoP.toUpperCase() == \"OBJECT\") //Es formulario, obtengo nombre (si es que realmente lo necesito para algo\n\t\tgdForms = oFormulario;\n\telse\n\t{\t\t\n\t\tif ( sTipoP.toUpperCase() == \"STRING\" ) //Es el nombre del formulario\n\t\t\tgdForms = document.forms(oFormulario);\n\t\telse\t\n\t\t{\t\n\t\t\t// ERROR EN EL PARAMETRO DEL FORMULARIO A VALIDAR\n\t\t\tshowMessageCod(MSG_DATONOESPECIFICADO, iMsgTipoCerrar, getMensajeARQD(MSG_ERROR), getMensajeARQD(MSG_ERRORJS),null,null,\"DATO\",\"Formulario a validar\");\n\t\t\treturn \"Formulario desconocido\";\n\t\t}\n\t}\n\n\t// Recorremos el array de validaciones\n\tfor (cont=0; cont < oArrayValidaciones.length; cont++)\t\n\t{\t\t\t\t\n\t\tsResultado=\"\";\n\t\tvar oElemen;\n\t\t// var oElemen = gdForms.elements[cont];\n\t\t\n\t\tvar oValidacion = oArrayValidaciones[cont];\n\t\t\n\t\tif (oValidacion.id.length > 0)\n\t\t\toElemen = document.getElementById(oValidacion.id);\n\t\telse\n\t\t\toElemen = gdForms.elements[oValidacion.nombre];\n\t\t\n\t\tif (oElemen!=null && oElemen.type == undefined && oElemen[0]!=null && (oElemen[0].type == \"radio\" || oElemen[0].type == \"checkbox\") ){\n\t\t\toElemen = oElemen[0];\n\t\t}\n\t\t\n\t\t\t\n\t\tif (oElemen!=null && oElemen.type != undefined && (oElemen.type == \"text\" || oElemen.type == \"password\" || oElemen.type == \"textarea\" || oElemen.type == \"file\" || oElemen.type.substring(0,6) == \"select\" || oElemen.type == \"radio\" || oElemen.type == \"checkbox\"))\n\t\t{\t\n\t\t\tdesmarcarCampoError(oElemen);\n\t\t\t\t\t\n\t\t\tif (!oElemen.disabled){\n\t\t\t\tsResultado = validaDato(oElemen, oValidacion);\n\t\t\t\t}\t\n\t\n\t\t\tvar sTipoResultado= typeof(sResultado);\n\t\t\tif (sTipoResultado.toUpperCase() == \"STRING\")\n\t\t\t{\n\t\t\t\tif (sResultado != \"\")\n\t\t\t\t{\n\t\t\t\t\tif (sStringErrores == \"\")\n\t\t\t\t\t\toPrimerElemenError= oElemen;\n\t\t\t\t\tsStringErrores = sStringErrores + (sStringErrores.length==0?\"\":\"\\n\") + (cont+1) + \".- \" + ((sResultado.substring(0,2)==\"{{\")?sResultado.substring(2,sResultado.length-2):getMensajeARQD(sResultado));\n\t\t\t\t\t//cambiaColor(oElemen, true); // se cambia el color para indicar el error\n\t\t\t\t\tmarcarCampoError(oElemen);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( sTipoResultado.toUpperCase() == \"OBJECT\" )\n\t\t\t{ // deberoa ser un objeto ParqMensaje\t\t\t\n\t\t\t\tif (sResultado.codigo != \"\")\n\t\t\t\t{\n\t\t\t\t\tif (sStringErrores == \"\")\n\t\t\t\t\t\toPrimerElemenError= oElemen;\n\t\t\t\t\tvar args= \"\";\n\t\t\t\t\tfor (var k=0; k< sResultado.params.length; k++)\n\t\t\t\t\t\targs+= \",'\"+sResultado.params[k].nombre+\"','\"+sResultado.params[k].valor+\"'\";\n\t\t\t\t\t\n\t\t\t\t\tvar sTextoMsg;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tif (sResultado.dominio != 'ARQ' && sResultado.dominio != null)\n\t\t\t\t\t\t\tsTextoMsg= eval(\"getMensaje('\"+sResultado.codigo+\"','\"+sResultado.dominio+\"'\"+args+\")\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tsTextoMsg= eval(\"getMensajeARQD('\"+sResultado.codigo+\"'\"+args+\")\");\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tsTextoMsg= eval(\"getMensaje('\"+sResultado.codigo+\"','\"+sResultado.dominio+\"'\"+args+\")\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tsStringErrores = sStringErrores + (sStringErrores.length==0?\"\":\"\\n\") + sTextoMsg ;\t\t\t\t\t\n\t\t\t\t\t//cambiaColor(oElemen, true); // se cambia el color para indicar el error\n\t\t\t\t\tmarcarCampoError(oElemen);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\tif (sStringErrores == \"\") // NO HAY ERRORES\t\n\t{\n\t\tif(self['validacionGeneral']) \n\t\t{ \t\t\n\t\t\tsRetorno = eval(gValGeneral); \t\n\t\t\t\n\t\t\tvar typRet= typeof(sRetorno);\n\n\t\t\tif (typRet.toUpperCase() == \"STRING\")\n\t\t\t\tsRetorno= new ParqMensaje(sRetorno, null, null);\n\n\t\t\t// Es un Array de ParqMensajes\n\t\t\tif ( (!sRetorno.codigo) && (sRetorno.codigo != '') )\n\t\t\t{ \n\t\t\t\tfor (var k=0; k< sRetorno.length; k++)\n\t\t\t\t{\n\t\t\t\t\tvar oRetornoK= sRetorno[k];\n\t\t\t\t\tif (oRetornoK.codigo != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tvar args= \"\";\n\t\t\t\t\t\tfor (var m=0; m< oRetornoK.params.length; m++)\n\t\t\t\t\t\t\targs+= \",'\"+oRetornoK.params[m].nombre+\"','\"+oRetornoK.params[m].valor+\"'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar sTextoMsg;\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsTextoMsg= eval(\"getMensaje('\"+oRetornoK.codigo+\"','\"+oRetornoK.dominio+\"'\"+args+\")\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsTextoMsg= eval(\"getMensajeARQD('\"+oRetornoK.codigo+\"'\"+args+\")\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tsStringErrores = sStringErrores + (sStringErrores.length==0?\"\":\"\\n\") + sTextoMsg ;\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\tif (sStringErrores != \"\")\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tshowMessage(sStringErrores, iMsgTipoCerrar, 'Validacion de datos', 'Se han producido los siguientes errores:');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn sStringErrores;\n\t\t\t}\n\t\t\t//UN SOLO MENSAJE\n\t\t\tif (sRetorno.codigo != \"\") \n\t\t\t{\n\t\t\t\tvar args= \"\";\n\t\t\t\tfor (var k=0; k< sRetorno.params.length; k++) \n\t\t\t\t\targs+= \",'\"+sRetorno.params[k].nombre+\"','\"+sRetorno.params[k].valor+\"'\";\n\n\t\t\t\tvar sTextoMsg;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tsTextoMsg= eval(\"getMensaje('\"+sRetorno.codigo+\"','\"+sRetorno.dominio+\"'\"+args+\")\" );\n\t\t\t\t}\n\t\t\t\tcatch(e)\n\t\t\t\t{\n\t\t\t\t\tsTextoMsg= eval(\"getMensajeARQD('\"+sRetorno.codigo+\"'\"+args+\")\");\n\t\t\t\t}\n\n\t\t\t\tsStringErrores = sStringErrores + (sStringErrores.length==0?\"\":\"\\n\") + sTextoMsg ;\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t// eval(\"showMessageCod('\"+sRetorno.codigo+\"', '\"+sRetorno.dominio+\"', \"+iMsgTipoCerrar+\", 'Validacion de datos global', 'Se han producido los siguientes errores:',null,null\"+oParamMsg+\")\");\n\t\t\t\tshowMessage(sStringErrores, iMsgTipoCerrar, 'Validacion de datos', 'Se han producido los siguientes errores:');\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tif (self['preSubmit'])\n\t\t{\n\t\t\tsRetorno = eval(gPreSubmit);\n\t\t}\t\t\t\t\n\t\t\n\t\treturn sRetorno.codigo;\n\t}\n\telse\n\t{\n\t\tshowMessage(sStringErrores, iMsgTipoCerrar, 'Validacion de datos', 'Se han producido los siguientes errores:');\n\t\t\n\t\ttry \n\t\t{ \n\t\t\toPrimerElemenError.focus(); // ponemos el foco en el campo\t\n\t\t\toPrimerElemenError.select(); // seleccionamos el contenido del campo\t\t\t\t\t\t\t\t\n\t\t} \n\t\tcatch(e) {}\n\t\t\n\t\tif (self['preSubmit'])\n\t\t{\n\t\t\tsRetorno = eval(gPreSubmit);\n\t\t}\t\n\t\t\n\t\treturn sStringErrores;\n\t}\t\n}", "title": "" }, { "docid": "6573af805789d11883c54fa8b4fb1cff", "score": "0.56806386", "text": "dataIsValid() {\n return isValidEmail(this.state.email) && this.state.password;\n }", "title": "" }, { "docid": "a14cef8eb12bcfbe0355d70f5bbfdfa2", "score": "0.56801605", "text": "function validar_campos() {\n let res = true\n \n \n $(\".validar\").each((pos, element) => {\n if($(element).val() == \"\") {\n $(element).parent().addClass(\"has-error\")\n res = false\n }else{\n $(element).parent().removeClass(\"has-error\")\n }\n })\n\n return res\n}", "title": "" }, { "docid": "483dccfc6e002646edc5fe7b11395768", "score": "0.56796443", "text": "function validarEmpleo(id_empresa,id_ramo,id_cargo,id_tabla){\n\t\tempresa=document.getElementById(id_empresa);\n\t\tramo=document.getElementById(id_ramo);\n\t\tcargo=document.getElementById(id_cargo);\n\t\n\t\tif(empresa.value=='' || ramo.value=='' || cargo.value==''){\n\t\t\talert('Debe ingresar los campos con (*) !!!');\n\t\t\treturn false;\n\t\t}else{\n\t\t\tagregarEmpleo(id_empresa,id_ramo,id_cargo,id_tabla);\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "2c93e7a83f9942d2661a1140822d3e82", "score": "0.56773794", "text": "validate( dataIn ){\n if(!dataIn.html){\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "018ea8a6069926e61b00572c903e8218", "score": "0.5676804", "text": "function validData() {\n let check1 = validName();\n let check2 = validUserName();\n let check3 = checkPassword();\n let check4 = confirmPassword();\n let check5 = validEmail();\n return check1 * check2 * check3 * check4 * check5;\n}", "title": "" }, { "docid": "85528b59493cf8497e4c14928f7a8e48", "score": "0.5675037", "text": "function verificar(){\n\n const valido = validar();\n if(!valido){\n alert(\"El campo no es valido\");\n }else{\n alert(\"El campo es valido\");\n }\n}//fin funcion verificar()", "title": "" }, { "docid": "17c7d0e7d8d74dbc48d3a78cb10c336c", "score": "0.5673586", "text": "function validarFormNuevoHorarioP2() {\n var correcto = true, msg = '';\n if ($('#modalNuevoHorarioDescripcion').val() === \"\") {\n correcto = false;\n msg = 'Coloque la <b>Descripción</b>';\n $('#modalNuevoHorarioDescripcion').focus();\n } else if ($('#modalNuevoHorarioHrInicio').val() === \"\") {\n correcto = false;\n msg = 'Coloque la <b>Hora de Inicio</b>';\n $('#modalNuevoHorarioHrInicio').focus();\n } else if (isNaN(parseFloat($('#modalNuevoHorarioDuracion').val()))) {\n correcto = false;\n msg = 'La <b>Duración</b> es incorecta';\n $('#modalNuevoHorarioDuracion').focus();\n } else if (parseFloat($('#modalNuevoHorarioDuracion').val()) <= 0) {\n correcto = false;\n msg = 'La <b>Duración</b> NO es válida';\n $('#modalNuevoHorarioDuracion').focus();\n } else if ($('#modalNuevoHorarioDuracion').val() === \"\") {\n correcto = false;\n msg = 'Coloque la <b>Descripción</b>';\n $('#modalNuevoHorarioDuracion').focus();\n } else {\n horarioCuerpoJSON = [];\n horarioParamsConfigJSON = {\n IdHorario: IdHorarioGLOBAL,\n Descripcion: $('#modalNuevoHorarioDescripcion').val().toUpperCase(),\n HoraInicio: $('#modalNuevoHorarioHrInicio').val(),\n Duracion: $('#modalNuevoHorarioDuracion').val(),\n Tipo: $('#modalNuevoHorarioDuracionTipo').val(),\n Reloj: $('#modalNuevoHorarioReloj').val(),\n };\n horarioCuerpoJSON.push({\n IdHTML: cadAleatoria(8),\n HoraInicio24hrs: $('#modalNuevoHorarioHrInicio').val(),\n HoraInicio12hrs: reloj12hrs($('#modalNuevoHorarioHrInicio').val()),\n HoraTermino24hrs: fechaAddHrs(fechaArrHorarioGLOBAL, $('#modalNuevoHorarioHrInicio').val(), parseInt($('#modalNuevoHorarioDuracion').val()), $('#modalNuevoHorarioDuracionTipo').val(), true),\n HoraTermino12hrs: fechaAddHrs(fechaArrHorarioGLOBAL, $('#modalNuevoHorarioHrInicio').val(), parseInt($('#modalNuevoHorarioDuracion').val()), $('#modalNuevoHorarioDuracionTipo').val(), false),\n Lunes: '-',\n Martes: '-',\n Miercoles: '-',\n Jueves: '-',\n Viernes: '-',\n Sabado: '-',\n Domingo: '-',\n Receso: false,\n NumOrden: horarioCuerpoJSON.length + 1,\n });\n llenarTablaHorarios();\n }\n if (!correcto) {\n MsgAlerta(\"Atención!\", msg, 2900, \"default\");\n }\n return correcto;\n}", "title": "" }, { "docid": "440337c3be70cf68d1c015bb74d095e7", "score": "0.5672478", "text": "_validate() {\n\n if (this.isTypeahead) {\n this._validateTypeaheads();\n }\n else if (this.isSelect) {\n this._validateSelects();\n }\n }", "title": "" } ]
72cc8f8d6d8a841ae67a9a2ff086d9c2
check node is \0 or \9 hack
[ { "docid": "bb4edc931c5e3cebfeeb8726051f1345", "score": "0.63635904", "text": "function isHack(node) {\n return node.type === 'Identifier' && /^\\\\[09]/.test(node.name);\n}", "title": "" } ]
[ { "docid": "eca105c76aa7edecd5b8f0e7ed1041f2", "score": "0.60888433", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "title": "" }, { "docid": "21ec6660eee09c2f981e8ddc2310ad65", "score": "0.60494787", "text": "function isEscaped(node) {\n return node.escaped === true;\n}", "title": "" }, { "docid": "21ec6660eee09c2f981e8ddc2310ad65", "score": "0.60494787", "text": "function isEscaped(node) {\n return node.escaped === true;\n}", "title": "" }, { "docid": "21ec6660eee09c2f981e8ddc2310ad65", "score": "0.60494787", "text": "function isEscaped(node) {\n return node.escaped === true;\n}", "title": "" }, { "docid": "21ec6660eee09c2f981e8ddc2310ad65", "score": "0.60494787", "text": "function isEscaped(node) {\n return node.escaped === true;\n}", "title": "" }, { "docid": "21ec6660eee09c2f981e8ddc2310ad65", "score": "0.60494787", "text": "function isEscaped(node) {\n return node.escaped === true;\n}", "title": "" }, { "docid": "50c2c26d0b422e4e091f367c510914f2", "score": "0.6002165", "text": "function isCharAndNotRestricted(c){return c===0x9||c===0xA||c===0xD||c>0x1F&&c<0x7F||c===0x85||c>0x9F&&c<=0xD7FF||c>=0xE000&&c<=0xFFFD||c>=0x10000&&c<=0x10FFFF;}", "title": "" }, { "docid": "c40736a2c40a7771366aad8a9c34c1a3", "score": "0.5997802", "text": "function meaningfulChar(str,chr){\n if (str.length==1 && str[0]==\"0\" && chr==\"0\"){return false;}\n if (!(isNumber(prevChar(display,2)[0])) && prevChar(display,2)[1]==0){\n\t\t\n\t\t\tif (prevChar(display,2)[0] == \".\"){\n\t\t\t\treturn true;\n\t\t\t} else{\n\t\t\n \t\treturn false;\n\t\t\t}\n }\n\tif (str[str.length-1]==\"(\" && chr==\")\"){\n\t\treturn false;\n\t}\n\t\n return true;\n}", "title": "" }, { "docid": "934f092ac0d79a69bd788889a49e2e4c", "score": "0.59301406", "text": "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "934f092ac0d79a69bd788889a49e2e4c", "score": "0.59301406", "text": "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "934f092ac0d79a69bd788889a49e2e4c", "score": "0.59301406", "text": "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "934f092ac0d79a69bd788889a49e2e4c", "score": "0.59301406", "text": "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "934f092ac0d79a69bd788889a49e2e4c", "score": "0.59301406", "text": "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "934f092ac0d79a69bd788889a49e2e4c", "score": "0.59301406", "text": "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "934f092ac0d79a69bd788889a49e2e4c", "score": "0.59301406", "text": "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "192bcbac5b820f92f09e575ab1eff8e6", "score": "0.5909276", "text": "function isDigit(char){\n \n }", "title": "" }, { "docid": "afb94b54e1256fd2f93e8dd926b4f2aa", "score": "0.5902079", "text": "function isChar(c){return c>=0x0001&&c<=0xD7FF||c>=0xE000&&c<=0xFFFD||c>=0x10000&&c<=0x10FFFF;}", "title": "" }, { "docid": "fd91c7f093c80670cce296721b848775", "score": "0.5885891", "text": "function is_non_ascii(character) {\n return character > '~';\n}", "title": "" }, { "docid": "c3c585faa0af185b01c8c53f56db7b6c", "score": "0.5865905", "text": "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\'\n || ch === '['\n || ch === ']'\n || ch === '^'\n || ch === '('\n || ch === ')'\n || ch === '`';\n}", "title": "" }, { "docid": "c3c585faa0af185b01c8c53f56db7b6c", "score": "0.5865905", "text": "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\'\n || ch === '['\n || ch === ']'\n || ch === '^'\n || ch === '('\n || ch === ')'\n || ch === '`';\n}", "title": "" }, { "docid": "c3c585faa0af185b01c8c53f56db7b6c", "score": "0.5865905", "text": "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\'\n || ch === '['\n || ch === ']'\n || ch === '^'\n || ch === '('\n || ch === ')'\n || ch === '`';\n}", "title": "" }, { "docid": "c3c585faa0af185b01c8c53f56db7b6c", "score": "0.5865905", "text": "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\'\n || ch === '['\n || ch === ']'\n || ch === '^'\n || ch === '('\n || ch === ')'\n || ch === '`';\n}", "title": "" }, { "docid": "1240c5da0306f7085736e32c28203b8d", "score": "0.5751151", "text": "function isUTF8NonAscii(tok) {\n // In JavaScript, we just deal directly with Unicode code points,\n // so we aren't checking individual bytes for UTF-8 encoding.\n // Just check that the character is non-ascii.\n return tok.charCodeAt(0) >= 128;\n }", "title": "" }, { "docid": "7689f6aeaaa76e8bad85f4b932254896", "score": "0.57435226", "text": "function is_non_printable(character) {\n\tlet code = character.charCodeAt(0);\n return (\n (code >= 0x0000 && code <= 0x0008) ||\n (code === 0x000B) ||\n (code >= 0x000E && code <= 0x001F) ||\n (code === 0x007F)\n );\n}", "title": "" }, { "docid": "ffd2a11f7f99204af235aa707149a32a", "score": "0.5732435", "text": "checkEscapeChar(){\n\t\tif(!this.buffer.length) return;\n\t\tif(this.buffer[this.buffer.length - 1] === \"\\\\\"){\n\t\t\tthis.escaped = !this.escaped;\n\t\t}else{\n\t\t\tthis.escaped = false;\n\t\t}\n\t}", "title": "" }, { "docid": "a35c74b1729917a87e498b7bd8b52368", "score": "0.5728952", "text": "function isUTF8NonAscii(tok) {\n // In JavaScript, we just deal directly with Unicode code points,\n // so we aren't checking individual bytes for UTF-8 encoding.\n // Just check that the character is non-ascii.\n return tok.charCodeAt(0) >= 128;\n }", "title": "" }, { "docid": "a35c74b1729917a87e498b7bd8b52368", "score": "0.5728952", "text": "function isUTF8NonAscii(tok) {\n // In JavaScript, we just deal directly with Unicode code points,\n // so we aren't checking individual bytes for UTF-8 encoding.\n // Just check that the character is non-ascii.\n return tok.charCodeAt(0) >= 128;\n }", "title": "" }, { "docid": "7a47cbb332cafadd3ac2004e94f6fcfd", "score": "0.5710856", "text": "function IsValidChar(val) {\n\t//var mikExp = /[$\\\\@\\\\\\#%\\^\\&\\*\\(\\)\\[\\]\\+\\_\\{\\}\\`\\~\\=\\|\\!\\?\\;\\'\\\"\\,\\.\\/]/;\n\tvar mikExp = /[$\\\\@\\\\\\#%\\^\\&\\*\\[\\]\\+\\_\\{\\}\\`\\~\\=\\|\\!\\?\\;\\'\\\"\\,\\.\\/]/;\n\tvar str = val;\n\tvar strLength = str.length;\n\t\n\tfor (a=1; a<=strLength; a++) {\n\t\tvar lchar = val.charAt((strLength) - a);\n\t\tif(lchar.search(mikExp) == -1) {\n\t\t}\n\t\telse {\n\t\t\treturn (0);\n\t\t}\n\t}\n\treturn (1);\n}", "title": "" }, { "docid": "63efa4b2b75f9dfce3b811807455cc7d", "score": "0.5691408", "text": "function isNonAscii(code) {\n return code >= 0x0080;\n} // name-start code point", "title": "" }, { "docid": "8e916f91ea2bade23a1a95e507de74b4", "score": "0.5687004", "text": "function checkInvalidChar(fldVal)\n{\n\tvar ln = fldVal.length;\n\tfor(i=0;i<ln;i++)\n\t{\n\t\tif(fldVal.charAt(i)==' ' || fldVal.charAt(i)=='@' || fldVal.charAt(i)=='#' || fldVal.charAt(i)==';' || fldVal.charAt(i)==':' || fldVal.charAt(i)=='$' || fldVal.charAt(i)=='%' || fldVal.charAt(i)=='^' || fldVal.charAt(i)=='\"' || fldVal.charAt(i)==\"'\" || fldVal.charAt(i)=='(' || fldVal.charAt(i)==')' || fldVal.charAt(i)=='=' || fldVal.charAt(i)=='+' || fldVal.charAt(i)=='|' || fldVal.charAt(i)=='\\\\' || fldVal.charAt(i)=='/' || fldVal.charAt(i)=='{' || fldVal.charAt(i)=='}' || fldVal.charAt(i)=='[' || fldVal.charAt(i)==']' || fldVal.charAt(i)=='?' || fldVal.charAt(i)=='<' || fldVal.charAt(i)=='>' || fldVal.charAt(i)==',' || fldVal.charAt(i)=='!' || fldVal.charAt(i)=='~' || fldVal.charAt(i)=='`' || fldVal.charAt(i)=='*' || fldVal.charAt(i)=='&')\n\t\t{\n\t\t\treturn true;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "5381ecbe9ffc16b8df85af433c7774a9", "score": "0.56743395", "text": "function isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "5381ecbe9ffc16b8df85af433c7774a9", "score": "0.56743395", "text": "function isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "5381ecbe9ffc16b8df85af433c7774a9", "score": "0.56743395", "text": "function isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "5381ecbe9ffc16b8df85af433c7774a9", "score": "0.56743395", "text": "function isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "title": "" }, { "docid": "5e33e27f647026e3a43d0f5a7f73b7c2", "score": "0.5673984", "text": "function isChar(c) {\n return c >= SPACE && c <= 55295 || c === NL || c === CR || c === TAB || c >= 57344 && c <= 65533 || c >= 65536 && c <= 1114111;\n }", "title": "" }, { "docid": "4689cb3c952ce675b612e01cd9185050", "score": "0.5673687", "text": "function scanCharOrUnicodeEscape() {\n if (str.charCodeAt(index) === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */) {\n scanUnicodeOrHexEscape(true);\n } else {\n index++;\n }\n }", "title": "" }, { "docid": "b433425081da69c85a02d7ce1b6519e0", "score": "0.5642358", "text": "function isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n }", "title": "" }, { "docid": "1df2eba7a8163114b5a050747e260327", "score": "0.562561", "text": "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "title": "" }, { "docid": "1df2eba7a8163114b5a050747e260327", "score": "0.562561", "text": "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "title": "" }, { "docid": "1df2eba7a8163114b5a050747e260327", "score": "0.562561", "text": "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "title": "" }, { "docid": "1df2eba7a8163114b5a050747e260327", "score": "0.562561", "text": "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "title": "" }, { "docid": "51dd0cdb70caa884af674f6485d1f3d4", "score": "0.5622542", "text": "function isValidNode(str){\n\t\t\t\t\tvar excludeWords = [\"\"];\n\t\t\t\t\tif (layout.nodeRemoveText != null){\n\t\t\t\t\t\t// the user is told to separate by ';'\n\t\t\t\t\t\texcludeWords = layout.nodeRemoveText.split(\";\").map(function(word, index){\n\t\t\t\t\t\t\treturn word.trim();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (layout.nodeRemoveEmpty != null && layout.nodeRemoveEmpty && str === \"-\" \n\t\t\t\t\t\t||\n\t\t\t\t\t\texcludeWords.indexOf(str) >= 0\n\t\t\t\t\t\t){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "f0f3d2c27932bb2349ff10530ebfe7b9", "score": "0.56166726", "text": "function hasInvalidChar(str){\n\tvar reason;\n\tif(str.indexOf('&') > -1 ){\n\t\treason = '&';\n\t}else if(str.indexOf('%') > -1){\n\t\treason = '%';\n\t}else if(str.indexOf('|') > -1){\n\t\treason = '|';\n\t}else if(str.indexOf(';') > -1){\n\t\treason = ';';\n\t}else if(str.indexOf(':') > -1){\n\t\treason = ':';\n\t}else if(str.indexOf('<') > -1){\n\t\treason = '<';\n\t}else if(str.indexOf('>') > -1){\n\t\treason = '>';\n\t}else if(str.indexOf('`') > -1){\n\t\treason = '`';\n\t}\n\n\tif(reason){\n\t\treturn reason;\n\t}else\n\t\treturn false;\n}", "title": "" }, { "docid": "ea4dcde2bf776bd2936278e8f45e7a05", "score": "0.5611448", "text": "function badString(str) {\n return str == 'br' || str == 'nbsp' || str == 'span' || str == 'style' ||\n str == 'text' || str == 'shadow' || str == '1px';\n}", "title": "" }, { "docid": "7d2f23b4ea614f468f13144d1791dde1", "score": "0.5588671", "text": "function isNonAscii(code) {\n return code >= 0x0080;\n}", "title": "" }, { "docid": "7d2f23b4ea614f468f13144d1791dde1", "score": "0.5588671", "text": "function isNonAscii(code) {\n return code >= 0x0080;\n}", "title": "" }, { "docid": "7d2f23b4ea614f468f13144d1791dde1", "score": "0.5588671", "text": "function isNonAscii(code) {\n return code >= 0x0080;\n}", "title": "" }, { "docid": "1cbbde8fab62aabe76f283160fc4b74c", "score": "0.55824566", "text": "function isText(node) {\n\t\treturn objectKey(node, 'nodeType') === 3;\n\t}", "title": "" }, { "docid": "458fca93844f9b48413f74f595004786", "score": "0.55805933", "text": "function checkNameIsDigit(str) {\r\n let charCodeZero = \"0\".charCodeAt(0);\r\n let charCodeNine = \"9\".charCodeAt(0);\r\n console.log(charCodeNine);\r\n for (var i = 0; i < str.length; i++) {\r\n let charCodeNum = str[i].charCodeAt(0);\r\n if (charCodeNum >= charCodeZero && charCodeNum <= charCodeNine) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "2068b8b43bee8441d74b43a587fc8736", "score": "0.5557764", "text": "function isCharacterToEscape(character) {\n return !utils.isCharacterALetterOrNumber(character) && utils.isCharacterLessThan256(character);\n }", "title": "" }, { "docid": "05d32bfc0678d822e94f7c00863181c4", "score": "0.555334", "text": "function esChrReal(ch)\n{\n\tpatron = /\\d|\\.|-/;\n\treturn patron.test(ch);\n}", "title": "" }, { "docid": "eb518a3d7359f61d588c8158c4da7304", "score": "0.5549562", "text": "function isChar(c){return c>=SPACE&&c<=0xD7FF||c===NL||c===CR||c===TAB||c>=0xE000&&c<=0xFFFD||c>=0x10000&&c<=0x10FFFF;}", "title": "" }, { "docid": "077f912a4de9d8fdbf52728f01e9bd94", "score": "0.5547686", "text": "function isSpecialChar(caracter){\r\n if (caracter === 64 || caracter === 36 || caracter === 95){\r\n //Se retorna un true\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "feaf850d2c0c4f0b8a6a7cd15498c002", "score": "0.55423754", "text": "function isCharNumber(c) {\n return c >= '0' && c <= '9';\n}", "title": "" }, { "docid": "32e3f8dc4428faf5692725ef731e0ecc", "score": "0.55409116", "text": "function is_ascii(byte) {\n return byte >= 32 && byte <= 127;\n}", "title": "" }, { "docid": "c4c2f4fd0b10e45875ffdb3a77bf6c93", "score": "0.5525744", "text": "function isRestrictedChar(c){return c>=0x1&&c<=0x8||c===0xB||c===0xC||c>=0xE&&c<=0x1F||c>=0x7F&&c<=0x84||c>=0x86&&c<=0x9F;}", "title": "" }, { "docid": "9f20841cccff20aa0811ae564946da4a", "score": "0.5522233", "text": "function isCharDigit(c) {\r\n\tvar zeroAscii = \"0\".charCodeAt(0);\r\n\tvar nineAscii = \"9\".charCodeAt(0);\r\n\r\n\treturn c.charCodeAt() >= zeroAscii && c <= nineAscii;\r\n}", "title": "" }, { "docid": "01c0d3ef6725def371f80dae9bea2529", "score": "0.55094296", "text": "function checkSpecialChar(str,type)\n{\n\t\tstr=trim(str);\n\t\tvar patrn;\n\t\tif(type)\n\t\t\tpatrn=/^[a-zA-Z0-9~`!@#$%^&*()_+|\\\\{}[\\]:;<?,-./=']+$/; \n\n\t\telse\n\t\t\tpatrn=/^[a-zA-Z0-9~`!@#$%^&*()_+|\\\\{}[\\]:;<?,-./=']*$/; \n\n\t\tif (!patrn.exec(str)) return false ; \n\t\tif(str.indexOf(\" \",0)!=-1)\n\t\t\treturn false;\n\t\treturn true;\t\n}", "title": "" }, { "docid": "ebcab1801c05fba2e558f1d0f2d01c30", "score": "0.5504921", "text": "function isChar(c) {\n return c >= 1 && c <= 55295 || c >= 57344 && c <= 65533 || c >= 65536 && c <= 1114111;\n }", "title": "" }, { "docid": "4a395eea60d32abc840d70e9083fd3c3", "score": "0.5504261", "text": "function checkAddressSplChar(str)\n{\n\tif(/^[a-zA-Z0-9- &()@',.\\://\\\\]*$/.test(str)){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "4bedd3c26a44b63e18f02a79b18384ea", "score": "0.54949963", "text": "function checkChr(tree, chr) {\n if (!tree) { return false; }\n return tree.children[chr];\n}", "title": "" }, { "docid": "cb472a534b31301b47f859a4d92a1b26", "score": "0.5492713", "text": "function isNCNameChar(c){return isNCNameStartChar(c)||c===0x2D||c===0x2E||c>=0x30&&c<=0x39||c===0x00B7||c>=0x0300&&c<=0x036F||c>=0x203F&&c<=0x2040;}", "title": "" }, { "docid": "09dc25645c983ccfe9ca05adbb035492", "score": "0.5469734", "text": "function charIsInvalid(characterCheck) {\n const tweetCharNumber = $(characterCheck).children().find(\".text-box\").context[\"0\"].value.length\n return (tweetCharNumber > 140 || tweetCharNumber === 0) \n }", "title": "" }, { "docid": "e919a66b56e7fa31b9dc7f87a5de9a9d", "score": "0.5457873", "text": "function parseCharacter(buffer) {\n if (buffer) {\n stringBuffer += tokenValue();\n } else {\n AST.addNode(tokenValue(), 'leaf', tokenStream[0]);\n }\n \n if(checkToken(T_CHARACTER)) {\n \n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "f83a03d8923c03e398700f028d7c4587", "score": "0.5457643", "text": "function testescapable(ch) {\n var diddle = ch+\"\";\n var cc = diddle.charCodeAt(0);\n if (cc == 173 || cc == 1807 || cc == 6068 || cc == 6069 || cc == 65519 || cc == 92 || cc == 34) return true;\n if (cc >= 0 && cc <= 31) return true;\n if (cc >= 127 && cc <= 159) return true;\n if (cc >= 1536 && cc <= 1540) return true;\n if (cc >= 8204 && cc <= 8207) return true;\n if (cc >= 8232 && cc <= 8239) return true;\n if (cc >= 8288 && cc <= 8303) return true;\n if (cc >= 65520 && cc <= 65535) return true;\n return false;\n}", "title": "" }, { "docid": "dadb4bd58c873ccdc7197835208ba596", "score": "0.54458964", "text": "function isDigit(ch) {\n\t\treturn '1234567890'.indexOf(ch) != -1;\n\t}", "title": "" }, { "docid": "c08161bcca154dca1d0abc367c647eb5", "score": "0.5435173", "text": "static isDigit(ch) {\n return ch >= 0x30 && ch < 0x3A;\n }", "title": "" }, { "docid": "e0797a7ac966cae06d2a01b94dc8b724", "score": "0.5416613", "text": "function isASCIIDigit(c) {\n return c >= 48 && c <= 57;\n }", "title": "" }, { "docid": "a0bedbd954980fafe5b8e47aaa5c06cf", "score": "0.5408372", "text": "function isOpChar(ch) {\n return \"+-*/%=&|<>!\".indexOf(ch) > -1;\n }", "title": "" }, { "docid": "9b1383ad1f902b9377515968dab307b3", "score": "0.54046327", "text": "function testSpecialCharacter(string){\n var format = /[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,<>\\/?]+/;\n return format.test(string);\n}", "title": "" }, { "docid": "af3bd7c01e78a6c7a3e79d3f998c51eb", "score": "0.5396243", "text": "function isBlank(s)\n{\n var i=0;\n for (i=0; i < s.length;i++)\n {\n if (s.charCodeAt(i)!=32) break;\n }\n if (i==s.length) return true; \n \n return false;\n}", "title": "" }, { "docid": "ff9a88796ebc24ea30fb692b47c27997", "score": "0.53885096", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n }", "title": "" }, { "docid": "7bf6e6e0c3a6ba6203ef48e2a9b7efce", "score": "0.53798527", "text": "function isSuspiciousCaretResult(node, offset, x) {\n let len;\n if (node.nodeType != 3 || offset != (len = node.nodeValue.length))\n return false;\n for (let next = node.nextSibling; next; next = next.nextSibling)\n if (next.nodeType != 1 || next.nodeName != \"BR\")\n return false;\n return textRange(node, len - 1, len).getBoundingClientRect().left > x;\n}", "title": "" }, { "docid": "f8b446f4293d96674ad0cfe784670a6c", "score": "0.5375148", "text": "function isSpecialCharacter(char) {\n return !/[a-zA-Z]/.test(char);\n}", "title": "" }, { "docid": "bdbbe17b8aa60ca525c37287bf612d5f", "score": "0.5373006", "text": "function is_ignorable( nod )\r\n{\r\n return ( nod.nodeType == 8) || // A comment node\r\n ( nod.nodeType == 3); // a text node\r\n}", "title": "" }, { "docid": "0935f53e0f29ba6eb22415cd5761537e", "score": "0.5371599", "text": "function valNumberCharInStr( objvalue )\r\n{var blnHasNumericChar = false;\r\nvar chrCurChar = \"\";var strStringToCheck=objvalue.value;\r\nfor (x=0; x<strStringToCheck.length; x++){\r\nchrCurChar = strStringToCheck.substring( x, (x+1) );\r\nif (/\\d/.test(chrCurChar)){\r\nblnHasNumericChar = true;\r\nbreak;}}objvalue.focus();return blnHasNumericChar;}", "title": "" }, { "docid": "a26e0fac2775c86c3f9fdbd68d4ccc00", "score": "0.5368915", "text": "function isTextNode(node) {\n return isNode(node) && node.type === 2;\n}", "title": "" }, { "docid": "10d0450c4a3d9d84ce6f9f4ccbaf33ad", "score": "0.53477925", "text": "hasOutput(token) {\n const code = token.value.trim().charCodeAt(0);\n return code === 0x24; // $\n }", "title": "" }, { "docid": "21d19aff285784a8504858d1c925525b", "score": "0.5343645", "text": "function isASCII(str) {\n\t\treturn /^[\\x00-\\x7F]*$/.test(str);\n\t}", "title": "" }, { "docid": "00fdb6e43e19e43ccc5aea2b61e16d64", "score": "0.5342702", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n }", "title": "" }, { "docid": "b132f7f2656019ccb981c5de5d527537", "score": "0.5342244", "text": "function checkInvalidHeaderChar (val) {\n val += ''\n if (val.length < 1) { return false }\n var c = val.charCodeAt(0)\n if ((c <= 31 && c !== 9) || c > 255 || c === 127) { return true }\n if (val.length < 2) { return false }\n c = val.charCodeAt(1)\n if ((c <= 31 && c !== 9) || c > 255 || c === 127) { return true }\n if (val.length < 3) { return false }\n c = val.charCodeAt(2)\n if ((c <= 31 && c !== 9) || c > 255 || c === 127) { return true }\n for (var i = 3; i < val.length; ++i) {\n c = val.charCodeAt(i)\n if ((c <= 31 && c !== 9) || c > 255 || c === 127) { return true }\n }\n return false\n}", "title": "" }, { "docid": "0a6abad59ffe7bd2dcdd2e6be1dd43ed", "score": "0.53395814", "text": "function isNCNameStartChar(c){return c>=0x41&&c<=0x5A||c===0x5F||c>=0x61&&c<=0x7A||c>=0xC0&&c<=0xD6||c>=0xD8&&c<=0xF6||c>=0x00F8&&c<=0x02FF||c>=0x0370&&c<=0x037D||c>=0x037F&&c<=0x1FFF||c>=0x200C&&c<=0x200D||c>=0x2070&&c<=0x218F||c>=0x2C00&&c<=0x2FEF||c>=0x3001&&c<=0xD7FF||c>=0xF900&&c<=0xFDCF||c>=0xFDF0&&c<=0xFFFD||c>=0x10000&&c<=0xEFFFF;}", "title": "" }, { "docid": "0b271eff9e32a57cf33c9c86889a872f", "score": "0.5336116", "text": "function isMeaningfulJSXText(node) {\n return (\n isLiteral(node) &&\n (containsNonJsxWhitespaceRegex.test(\n rawText(node)\n ) ||\n !/\\n/.test(rawText(node)))\n );\n }", "title": "" }, { "docid": "d503880b566cff5e0654c06f1c07c702", "score": "0.533169", "text": "isDigit(ExprChar) {\n\t\tif (ExprChar === \"+\" || ExprChar === \"-\" || ExprChar === \"*\" || ExprChar === \"/\") {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.53283066", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "7d23bb448fda0ac0bd6ebd7c86b8ef26", "score": "0.5327143", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n }", "title": "" }, { "docid": "2d689619d5bb932fe1cff753ebdafc46", "score": "0.5324991", "text": "isNot(node) {\n return typeof node === 'string' && /not\\s*/i.test(node)\n }", "title": "" }, { "docid": "2d689619d5bb932fe1cff753ebdafc46", "score": "0.5324991", "text": "isNot(node) {\n return typeof node === 'string' && /not\\s*/i.test(node)\n }", "title": "" }, { "docid": "6c3fa4dd6857e9dd31147a56f93c0c10", "score": "0.532356", "text": "function _isBlankTextNode(node) {\r\n return node.nodeType === wysihtml5.TEXT_NODE && !wysihtml5.lang.string(node.data).trim();\r\n }", "title": "" }, { "docid": "5d26a3406d414c88bef3d41dcc84360b", "score": "0.5322979", "text": "function check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}", "title": "" }, { "docid": "5d26a3406d414c88bef3d41dcc84360b", "score": "0.5322979", "text": "function check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}", "title": "" }, { "docid": "5d26a3406d414c88bef3d41dcc84360b", "score": "0.5322979", "text": "function check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}", "title": "" } ]
6db1111227c4dc3a99f7e8bab2b1d50d
Opera <= 12 includes TextEvent in window, but does not fire text input events. Rely on keypress instead.
[ { "docid": "8a44b9a8336e900a59f4c376ff66e69d", "score": "0.0", "text": "function isPresto() {\n var opera = window.opera;\n return (\n typeof opera === 'object' &&\n typeof opera.version === 'function' &&\n parseInt(opera.version(), 10) <= 12\n );\n}", "title": "" } ]
[ { "docid": "3c5fd4815c8d055d81bc4f1990d433ef", "score": "0.66662824", "text": "function typeText(c, target, text) {\n var KE = c.Packages.java.awt.event.KeyEvent;\n var id = KE.KEY_TYPED;\n var when = c.Packages.java.lang.System.currentTimeMillis();\n var mod = 0;\n var code = KE.VK_UNDEFINED;\n\n for (var i = text.length-1; i >= 0; i--) {\n var e = new KE(target, id, when, 0, code, text[i].charCodeAt());\n c.dispatchEvent(e);\n }\n}", "title": "" }, { "docid": "2b0ca0ba91447ff74a94230241125efc", "score": "0.64881986", "text": "onElementKeyPress(event) {}", "title": "" }, { "docid": "eb4f8ff8d14c093475238c8ca2e51f51", "score": "0.6261711", "text": "function handleKeyPress(field, evt)\r\n{\r\n if (field.readOnly == true) return false;\r\n\t\r\n evt = (evt) ? evt : ((window.event) ? window.event : \"\");\r\n IEKeyModifier = 0;\r\n \r\n // Yes.. this a real HACK for the MAC platform. It appears that the event gets eaten and the keycode is lost after\r\n // passing thru the keydown event handler.. Dont fully understand why IE works differently on the MAC\r\n // Also... it works DIFFERENTLY between the IE on OS9.1 and OSX arghhhh.. in the 9.1 case, the value in the \r\n // keycode is -1 and in the OSX case, the keycode is 1 \r\n \r\n\t// prevent unwanted key stokes from being passed to the field\r\n// if (isDebugFlag)\r\n// window.status = \"KEYPRESS -- char code: \" + evt.keyCode + \" lastKeyPressed=\" + lastKeyPressed + \r\n// \" userAgent- \" + navigator.userAgent;\r\n\r\n\r\n // hocus pocus for Safari because for some reason, when you modified the event object, the modifications were not applied... \r\n // I for the life of me cant explain it.... any ideas? Therfore, store the key code and the char codes in a temporary variable\r\n // that we can modify and use later one in the processing\r\n var aKeyCode = 0\r\n var aCharCode = 0\r\n\r\n // Safari returns some strange keycodes.... > 65000 ... very strange... (probably a ones compliment number)\r\n if (isSafari)\r\n {\r\n\r\n // Experimentation: tried generating an event here... still has some promise for moving a cursor in Safari & IE\r\n // var aNewEvt = initKeyEvent(evt.eventType, evt.bubblesFlag, evt.cancelableFlag, evt.view, evt.ctrlKeyFlag, evt.altKeyFlag, \r\n // evt.shiftKeyFlag, evt.metaKeyFlag, lastKeyPressed, lastCharCode);\r\n // will never get past this point\r\n \r\n aKeyCode = lastKeyPressed;\r\n aCharCode = lastCharCode;\r\n\r\n // For some reason.. this doesnt seem to work on Safari... \r\n evt.keyCode = lastKeyPressed;\r\n evt.charCode = lastCharCode;\r\n// if (aDebugFlag)\r\n// window.status = \"RESET LASTKEY: evt.Keycode= \" + evt.keyCode + \" evt.charCode=\" + evt.charCode + \" lastKeyPressed=\" + lastKeyPressed; \r\n }\r\n else\r\n {\r\n // On the MACs, sometimes the keyCode comes in as a -1. It was as if the KEY DOWN gobbled it up. I dunno why!!\r\n // Therefore, we use the one that was stored in the ON KEY DOWN\r\n if (isMac && (evt.keyCode == -1 || evt.keyCode == 1) ) \r\n {\r\n evt.keyCode = lastKeyPressed;\r\n } // end if (isMac && (evt.keyCode == -1 || evt.keyCode == 1) ) \r\n } // end if (isSafari) \r\n \r\n \r\n if (isIE)\r\n {\r\n // Need to do this BEFORE the isDataKey is called... \r\n\t\tif (isDigit(String.fromCharCode(aKeyCode)))\r\n\t\t\tIEKeyModifier = IENumberKeyModifier;\r\n\t\telse if (isSign(String.fromCharCode(aKeyCode)))\r\n\t\t\tIEKeyModifier = IESignKeyModifier;\r\n } // end if (isIE)\r\n\r\n\t// prevent unwanted key stokes from being passed to the field. Only call the trapKeyPress one time\r\n // here.. because I think it was causing problems on the MAC. Dinking with the event object wasnt good after the first time...\r\n \r\n var aTrapResult = trapKeyPress(evt);\r\n \t\r\n if (isIE && aTrapResult) \r\n { \r\n if (isDataKey(evt.keyCode)) \r\n {\r\n // since we are preventing the default operation from being done\r\n\t\t\t// we have to print the typed character\r\n\t\t\tif (isBlankKey(evt.keyCode))\r\n\t\t\t\tsetText(field, currentPosition, KEY_BLANK);\r\n\t\t\telse\r\n\t\t\t\tsetText(field, currentPosition, evt.keyCode);\r\n currentPosition = nextCaretPosition(field, evt.keyCode);\r\n\t\t} // end if (isDataKey(evt.keyCode)) \r\n \r\n if (evt.keyCode != KEY_BACKSPACE && evt.keyCode != KEY_DELETE)\r\n setCaretPosition(field, currentPosition);\r\n \r\n \t} else if (isMoz && aTrapResult) \r\n {\r\n if (isSafari == false)\r\n {\r\n// if (isDebugFlag)\r\n// window.status = \"evt.charCode= \" + evt.charCode + \" evt.isChar=\" + evt.isChar;\r\n \r\n // on mozilla / firefox on os-x, this didnt work because evt.ischar returned false for a 0-9 keys\r\n // arghhh.. yet another inconsistency... \r\n // if (evt.charCode && evt.isChar && isDataKey(evt.charCode))\r\n if (evt.charCode && isDataKey(evt.charCode)) \r\n {\r\n // since we are preventing the default operation from being done\r\n // we have to print the typed character\r\n if (isBlankKey(evt.charCode))\r\n setText(field, currentPosition, KEY_BLANK);\r\n else\r\n setText(field, currentPosition, evt.charCode);\r\n\r\n currentPosition = nextCaretPosition(field, evt.charCode);\r\n \r\n// if (isDebugFlag)\r\n// window.status = \"NORMAL KEY - non safari \"; \r\n\r\n }\r\n else if (isControlKey(evt.keyCode)) \r\n {\r\n if (evt.keyCode == KEY_DELETE)\r\n {\r\n setText(field, currentPosition, KEY_BLANK);\r\n } else if (evt.keyCode == KEY_BACKSPACE)\r\n {\r\n setText(field, currentPosition, KEY_BLANK);\r\n currentPosition = nextCaretPosition(field, evt.keyCode);\r\n } else\r\n currentPosition = nextCaretPosition(field, evt.keyCode);\r\n\r\n// if (isDebugFlag)\r\n// window.status = \"CTRL KEY - non safari \"; \r\n } // end if (evt.charCode && isDataKey(evt.charCode)) \r\n\t\t} \r\n else \r\n {\r\n if (aKeyCode && isDataKey(aKeyCode))\r\n {\r\n // SAFARI Falls into this category\r\n // since we are preventing the default operation from being done\r\n // we have to print the typed character\r\n if (isBlankKey(aKeyCode))\r\n setText(field, currentPosition, KEY_BLANK);\r\n else\r\n setText(field, currentPosition, aKeyCode);\r\n\r\n currentPosition = nextCaretPosition(field, aKeyCode);\r\n\r\n// if (isDebugFlag)\r\n// window.status = \"DATA KEY - SAFARI \"; \r\n \r\n } else if (isControlKey(aKeyCode)) \r\n {\r\n if (aKeyCode == KEY_DELETE)\r\n {\r\n setText(field, currentPosition, KEY_BLANK);\r\n } else if (aKeyCode == KEY_BACKSPACE)\r\n {\r\n setText(field, currentPosition, KEY_BLANK);\r\n currentPosition = nextCaretPosition(field, aKeyCode);\r\n } else\r\n currentPosition = nextCaretPosition(field, aKeyCode);\r\n \r\n// if (isDebugFlag)\r\n// window.status = \"CTRL KEY - SAFARI \"; \r\n } // end if (aKeyCode && isDataKey(aKeyCode))\r\n } // end if (isSafari == false)\r\n \r\n setCaretPosition(field, currentPosition);\r\n\t}\r\n \r\n // On the MAC, if you dont return a true from here.. it appears as if the event will not propagate without returning a true here...\r\n if ((isMac && isMoz) || isSafari) return true;\r\n \r\n}", "title": "" }, { "docid": "e37b98b67e8325d2ab185054dd1e7618", "score": "0.62544745", "text": "function keyPressHandler(evt){\r\n var keyCode = evt.keyCode;\r\n if (inputFocused){\r\n return true;\r\n }\r\n if (keyCode == 106) { // j\r\n window.setTimeout(speakCurrentMessage,0);\r\n return true;\r\n }\r\n if (keyCode == 107) { // k\r\n window.setTimeout(speakCurrentMessage,0);\r\n return true;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "1fa49bb3b141c134d2636c0eeb6bab41", "score": "0.6202244", "text": "function bindTextInputEvents()\n{\n\t$(\"#contextbar\").bind(\"mouseup\", onContextMouseUp)\n}", "title": "" }, { "docid": "bd4057c590d2df31e89b6f20f72cabf5", "score": "0.61892384", "text": "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "bd4057c590d2df31e89b6f20f72cabf5", "score": "0.61892384", "text": "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "bd4057c590d2df31e89b6f20f72cabf5", "score": "0.61892384", "text": "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "bd4057c590d2df31e89b6f20f72cabf5", "score": "0.61892384", "text": "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "1b9e23de333cbea7eb86fae819961006", "score": "0.61854434", "text": "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "1b9e23de333cbea7eb86fae819961006", "score": "0.61854434", "text": "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "1b9e23de333cbea7eb86fae819961006", "score": "0.61854434", "text": "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "3f455938ac54f9abd91a080076a8fb9a", "score": "0.61283416", "text": "function keydown_event(e){debug('keydown \"'+e.key+'\" '+e.fake+' '+e.which);var result;process=(e.key||'').toLowerCase()==='process'||e.which===0;dead_key=no_keypress&&single_key&&!is_backspace(e);// special keys don't trigger keypress fix #293\ntry{if(!e.fake){single_key=is_single(e);// chrome on android support key property but it's \"Unidentified\"\nno_key=String(e.key).toLowerCase()==='unidentified';backspace=is_backspace(e);}}catch(exception){}// keydown created in input will have text already inserted and we\n// want text before input\nif(e.key===\"Unidentified\"){no_keydown=true;// android swift keyboard have always which == 229 we will triger proper\n// event in input with e.fake == true\nreturn;}// meta and os are special keydown triggered by Emoji picker on Windows 10\n// meta is in Google Chrome is is in Firefox\nif(!e.fake&&['meta','os'].indexOf(e.key.toLowerCase())===-1){no_keydown=false;}no_keypress=true;// Meta+V did bind input but it didin't happen because terminal paste\n// prevent native insert action\n_clip.$node.off('input',paste);var key=get_key(e);if(is_function(settings.keydown)){e.key=ie_key_fix(e);result=settings.keydown.call(self,e);if(result!==undefined){//skip_keypress = true;\nif(!result){skip_insert=true;}return result;}}if(key!==prev_key){clear_hold();}// CTRL+C hanlding is only exception of cmd aware terminal logic\n// cmd need to call CTRL+C keymap when terminal is not enabled\nif(enabled||key==='CTRL+C'&&is_terminal_selected(self)){if(hold){prev_key=key;key='HOLD+'+key;if(hold_pause){return;}if(settings.holdRepeatTimeout>0&&is_delay_key(key)){hold_pause=true;self.oneTime(settings.holdRepeatTimeout,'delay',function(){hold_pause=false;});}}else{self.oneTime(settings.holdTimeout,'hold',function(){hold=true;});prev_key=key;}// if e.fake ignore of space is handled in input and next keydown\n// is not triggered this is just in case code since on Android\n// keydown is not triggered only input so event is always fake on Android\nif(!e.fake&&is_android){if(skip_keydown){clear_hold();skip_keydown=false;return false;}if(mobile_ignore_key(key)){skip_keydown=true;}else if(mobile_ignore_key(prev_key)){// just in case next key is different then space\nskip_keydown=false;}}restart_animation();// CTRL+V don't fire keypress in IE11\nskip_insert=['CTRL+V','META+V'].indexOf(key)!==-1;// only enter will reset history (and down arrow on last command)\nif(key.toLowerCase()==='enter'){first_up_history=true;}if(reverse_search&&clear_reverse_search_key(e)){clear_reverse_state();draw_prompt();if(e.which===27){// ESC\nself.set('');}redraw();if(e.which===13){keydown_event.call(this,e);}}else if(is_function(_keymap[key])){result=_keymap[key](e);if(result===true){return;}if(result!==undefined){return result;}}else if(e.altKey){return;}else{skip_keypress=false;return;}// this will prevent for instance backspace to go back one page\n//skip_keypress = true;\n//e.preventDefault();\n}}", "title": "" }, { "docid": "39b2de4d10ab55224f104f2b0105c6bc", "score": "0.61177665", "text": "function testKeyEvent(e) {\n var key = _.invert(KEYS)[e.which];\n if (key) {\n dispatcher.trigger('keycontrols:keypressed', key);\n }\n}", "title": "" }, { "docid": "4f1fa34abd3f314cca54827bd68cbb12", "score": "0.610679", "text": "function handleKeyDown(field, evt)\r\n{\r\n var aReturnValue = true;\r\n evt = (evt) ? evt : ((window.event) ? window.event : \"\")\r\n\r\n IEKeyModifier = 0;\r\n\r\n // Always keep the last key pressed around... sometimes event gets eaten on MACs\r\n lastKeyPressed = evt.keyCode;\r\n lastCharCode = evt.charCode ? evt.charCode : 0;\r\n \r\n\t// prevent unwanted key stokes from being passed to the field\r\n\r\n// if (isDebugFlag) \r\n// window.status = \"KEYDOWN --- char code: \" + evt.keyCode + \" curpos - \" + currentPosition + \" usrAgt = \" + navigator.userAgent;\r\n\r\n if (isIE)\r\n {\r\n // YOU DONT GET CHARCODES in this routine.. you only get the keycodes\r\n // Need to do this BEFORE the isDataKey is called... \r\n\t\tif (evt.keyCode >= KEY_NUMPAD_0 && evt.keyCode <= KEY_NUMPAD_9)\r\n\t\t\tIEKeyModifier = IENumberKeyModifier;\r\n\t\telse if (evt.keyCode == KEY_NUMPAD_MINUS || evt.keyCode == KEY_NUMPAD_PLUS)\r\n\t\t\tIEKeyModifier = IESignKeyModifier;\r\n } // end if (isIE)\r\n\r\n\r\n// if (isDebugFlag)\r\n// window.status = \"before trapcall: KEYPRESS a - keycode: \" + evt.keyCode;\r\n\r\n if (isIE && trapKeyPress(evt))\r\n {\r\n if (isControlKey(evt.keyCode) ) \r\n {\r\n if ((evt.keyCode != KEY_DELETE && evt.keyCode != KEY_BACKSPACE))\r\n {\r\n currentPosition = nextCaretPosition(field, evt.keyCode);\r\n }\r\n else\r\n {\r\n // (IE BUG) we can't really prevent the DELETE key from deleting the current\r\n // character so we have to insert a blank one after it's done\r\n if (evt.keyCode == KEY_DELETE)\r\n {\r\n if (evt.ctrlKey == true)\r\n {\r\n nullMaskedField(field.id);\r\n currentPosition = nextCaretPosition(field, KEY_HOME);\r\n }\r\n else\r\n setText(field, currentPosition, KEY_BLANK);\r\n } // end if (evt.keyCode == KEY_DELETE) \r\n\r\n if (evt.keyCode == KEY_BACKSPACE)\r\n {\r\n if (evt.ctrlKey == true)\r\n {\r\n nullMaskedField(field.id);\r\n currentPosition = nextCaretPosition(field, KEY_HOME);\r\n }\r\n else\r\n {\r\n setText(field, currentPosition, KEY_BLANK); \r\n currentPosition = nextCaretPosition(field, evt.keyCode);\r\n } // end if (evt.ctrlKey == true) \r\n } // end if (evt.keyCode == KEY_BACKSPACE)\r\n \r\n }\r\n // for control keys.. dont perform default action\r\n evt.returnValue = false;\r\n aReturnValue = true;\r\n setCaretPosition(field, currentPosition);\r\n }\r\n else\r\n {\r\n // Let events that are not CONTROL TYPE keys propagate to the next level. \r\n evt.returnValue = true;\r\n aReturnValue = true;\r\n// if (isDebugFlag) \r\n// window.status = \"KEYDOWN-NON CONTROL KEY --- char code: \" + evt.keyCode + \" curpos - \" + currentPosition + \r\n// \" isMoz =\" + isMoz + \" isIE=\" + isIE + \" is_safari=\" + isSafari + \r\n// \" cancelBubble= \" + evt.cancelBubble + \" type= \" + evt.type;\r\n } // end if (isControlKey(evt.keyCode) ) \r\n }\r\n else\r\n {\r\n // let all 'known special keys TAB & ENTER ' propagate... but squash any others... \r\n // strange control keys etc... otherwise, you will get strange characters that popup in the \r\n // edit boxes\r\n if (isIE) \r\n {\r\n if (isAllowedKey(evt.keyCode)) \r\n evt.returnValue = true;\r\n else\r\n evt.returnValue = false;\r\n } // end if (isIE) \r\n } // end if (isIE && trapKeyPress(evt))\r\n \r\n if ((isIE && isMac) || (isMoz && isMac) || isSafari) \r\n {\r\n// if (isDebugFlag) \r\n// window.status = \"KEYDOWN-NON RETURN --- char code: \" + evt.keyCode + \" curpos - \" + currentPosition + \r\n// \" isMoz =\" + isMoz + \" isIE=\" + isIE + \" is_safari=\" + isSafari + \r\n// \" cancelBubble= \" + evt.cancelBubble + \" type= \" + evt.type;\r\n return aReturnValue;\r\n } // end if ((isIE && isMac) || (isMoz && isMac) || isSafari)\r\n \r\n return;\r\n}", "title": "" }, { "docid": "5d0f8a9cc8e100729b96ec5574f17987", "score": "0.60576576", "text": "function s(){var n=this,i=window||t;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(t){n.isNativeEvent(t)&&e(t.target).trigger(\"input\")},misbehaves:function(t){n.isNativeEvent(t)&&(n.behavesOk(t),e(document).on(\"change.inputevent\",t.data.selector,n.fakeInputEvent),n.fakeInputEvent(t))},behavesOk:function(t){n.isNativeEvent(t)&&e(document).off(\"input.inputevent\",t.data.selector,n.behavesOk).off(\"change.inputevent\",t.data.selector,n.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var t=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<t.length;r++){var o=t[r];e(document).on(\"input.inputevent\",o,{selector:o},n.behavesOk).on(\"change.inputevent\",o,{selector:o},n.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "271245c385a3465be257a98508f591b4", "score": "0.6054046", "text": "function onDocumentInput(e) { self.__onDocumentInput(e) }", "title": "" }, { "docid": "c7ee4501585114a2917c2d23001c5615", "score": "0.6047074", "text": "function synthesizeText(aEvent, aWindow)\n{\n netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');\n\n var utils = _getDOMWindowUtils(aWindow);\n if (!utils) {\n return;\n }\n\n if (!aEvent.composition || !aEvent.composition.clauses ||\n !aEvent.composition.clauses[0]) {\n return;\n }\n\n var firstClauseLength = aEvent.composition.clauses[0].length;\n var firstClauseAttr = aEvent.composition.clauses[0].attr;\n var secondClauseLength = 0;\n var secondClauseAttr = 0;\n var thirdClauseLength = 0;\n var thirdClauseAttr = 0;\n if (aEvent.composition.clauses[1]) {\n secondClauseLength = aEvent.composition.clauses[1].length;\n secondClauseAttr = aEvent.composition.clauses[1].attr;\n if (aEvent.composition.clauses[2]) {\n thirdClauseLength = aEvent.composition.clauses[2].length;\n thirdClauseAttr = aEvent.composition.clauses[2].attr;\n }\n }\n\n var caretStart = -1;\n var caretLength = 0;\n if (aEvent.caret) {\n caretStart = aEvent.caret.start;\n caretLength = aEvent.caret.length;\n }\n\n utils.sendTextEvent(aEvent.composition.string,\n firstClauseLength, firstClauseAttr,\n secondClauseLength, secondClauseAttr,\n thirdClauseLength, thirdClauseAttr,\n caretStart, caretLength);\n}", "title": "" }, { "docid": "ed54925da1e61837900f8da07244841a", "score": "0.5969321", "text": "onElementKeyUp(event) {}", "title": "" }, { "docid": "0df91ed043afb77763166637a725095e", "score": "0.59679437", "text": "function keyPressHandler(event)\n\t{\n debugLog('keyPressHandler:', event.target);\n\n\t\t// Make sure it's not the same event firing over and over again\n\t\tif (keyPressEvent == event) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tkeyPressEvent = event;\n\t\t}\n\n\t\t// Get character that was typed\n\t\tvar charCode = event.keyCode || event.which;\n\t\tif (charCode == KEYCODE_RETURN) {\t// If return, clear and get out\n\t\t\treturn clearTypingBuffer();\n\t\t}\n\n\t\t// Clear timer if still running, and start it again\n\t\tclearTypingTimer();\n\t\ttypingTimer = setTimeout(clearTypingBuffer, typingTimeout);\n\n\t\t// Add new character to typing buffer\n\t\tvar char = String.fromCharCode(charCode);\n\t\ttypingBuffer.push(char);\n\n\t\t// Check typed text for shortcuts\n\t\tcheckShortcuts(typingBuffer.join(''), char, event.target);\n\t}", "title": "" }, { "docid": "36fd9c8f0a7195fc939ee339b0a51159", "score": "0.5962197", "text": "function f(e,t){if(\"topInput\"===e)\n// In modern browsers (i.e., not IE8 or IE9), the input event is exactly\n// what we want so fall through here and trigger an abstract event\nreturn t}", "title": "" }, { "docid": "177d9bb74dd53c1fce70346798879fbc", "score": "0.595855", "text": "function InputTextHandler(e) {\n\t \n setInputText(e.target.value);\n }", "title": "" }, { "docid": "250b1cbfd2ad39eafa0de401d5b51a6d", "score": "0.5956521", "text": "function handleText() {\n element.bind('focus', clickToEditCtrl.enableEditor);\n element.bind('blur', clickToEditCtrl.disableEditor);\n element.bind('keypress', function(event) {\n if (event.which == 13) {\n clickToEditCtrl.save(event);\n }\n });\n }", "title": "" }, { "docid": "cf2db97243bdc22b54fe66c5c27e88cf", "score": "0.5951686", "text": "handleTextChange(e) {}", "title": "" }, { "docid": "9b78b129988bcc6e400ce36b5fb89bae", "score": "0.5941848", "text": "function _preventTextSelectionIE(event)\n\t{\n\t\tevent.preventDefault();\n\t}", "title": "" }, { "docid": "cf90bdd35a5855e845014d8deda50ee9", "score": "0.5938576", "text": "function s(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function e(t){return t.originalEvent&&!1!==t.originalEvent.isTrusted},fakeInputEvent:function i(s){t.isNativeEvent(s)&&e(s.target).trigger(\"input\")},misbehaves:function i(s){t.isNativeEvent(s)&&(t.behavesOk(s),e(document).on(\"change.inputevent\",s.data.selector,t.fakeInputEvent),t.fakeInputEvent(s))},behavesOk:function i(s){t.isNativeEvent(s)&&e(document).off(\"input.inputevent\",s.data.selector,t.behavesOk).off(\"change.inputevent\",s.data.selector,t.misbehaves)},install:function s(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],o=0;o<n.length;o++){var r=n[o];e(document).on(\"input.inputevent\",r,{selector:r},t.behavesOk).on(\"change.inputevent\",r,{selector:r},t.misbehaves)}}},uninstall:function t(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "1a8ed43f05455316b99da0784c71111c", "score": "0.5937256", "text": "function textEnter(event) {\r\n\tvar raw_text = document.getElementById(\"text_input\").value.toLowerCase().trim();\r\n\tvar first_char = raw_text.substring(0, 1);\r\n\tvar the_text = raw_text.substring(1, raw_text.length);\r\n\t\t\r\n\t//blank or not enter key? we're not interested\r\n\tif(raw_text.length == 0 || event.keyCode != 13) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\telse if(first_char == \"!\") {\r\n\t\tactionCommand(the_text);\r\n\t}\r\n\telse if(first_char == \"@\") {\r\n\t\tshowTablesITouch(the_text);\r\n\t}\r\n\telse if(first_char == \"#\") {\r\n\t\tshowTablesThatTouchMe(the_text);\r\n\t}\r\n\telse if(first_char == \"$\") {\r\n\t\tshowTableGroup(the_text);\r\n\t}\r\n\telse {\r\n\t\tsearchForField(raw_text);\r\n\t}\r\n\t\r\n\t//blank out text\r\n\tdocument.getElementById(\"text_input\").value = \"\";\r\n}", "title": "" }, { "docid": "02629afef179c8cac47c43d423b86bf2", "score": "0.5928493", "text": "function inputText(e) {\n //arrow keys\n if ([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {\n e.stopPropagation();\n //enter key\n } else if(e.keyCode === 13 && this.innerText.length <= CHAR_LIMIT) {\n this.blur();\n\n MAP_DIV.style.cursor = '';\n\n e.preventDefault();\n //limit\n } else if (this.innerText.length >= CHAR_LIMIT && e.keyCode !== 8) {\n e.preventDefault();\n }\n}", "title": "" }, { "docid": "1b8ce4bab5edab43fdb080e647d0d5a2", "score": "0.59284174", "text": "function keyCatcherTextInput(){\n event.stopPropagation();\n if (event.key === \"Escape\" || event.key === \"Esc\") {\n console.log(\"Escape key pressed\");\n cancelTextInput();\n }\n //text edit fields will accept input on enter key\n if (event.key === \"Enter\") {\n event.preventDefault();\n event.target.blur(); //this will auto-trigger accept\n }\n\n}", "title": "" }, { "docid": "11fde9d543f746908d28d2cc3cd29673", "score": "0.5925386", "text": "function trapKeyPress(evt)\r\n{\r\n\r\n evt = (evt) ? evt : ((window.event) ? window.event : \"\")\r\n var retVal = false;\r\n\r\n\t// we want to allow some special keys like TAB, ENTER, etc...\r\n\tif (isAllowedKey(evt.keyCode))\r\n\t\treturn false;\r\n\r\n\tif (isIE) \r\n {\r\n\t\t// prevent the default (print, caret moves forward) routine from being executed\r\n\r\n\t\tif (isDataKey(evt.keyCode) || isControlKey(evt.keyCode))\r\n\t\t // accepted key strokes\r\n retVal = true;\r\n\t\telse\r\n\t\t retVal = false;\r\n\t\tevt.returnValue = false;\r\n\t} else if (isMoz) \r\n {\r\n if (isSafari == true)\r\n { \r\n if (isDataKey(evt.keyCode) || isControlKey(evt.keyCode) || isControlKey(lastKeyPressed) )\r\n retVal = true;\r\n else\r\n retVal = false;\r\n\r\n// if (isDebugFlag)\r\n// window.status =\"TRAP KEYPRESS B- RET = \" + retVal + \" Key Pressed: \" + evt.keyCode + \" Char code: \" + evt.charCode; \r\n }\r\n else \r\n {\r\n if (isDataKey(evt.charCode) || isControlKey(evt.keyCode)) \r\n\t\t retVal = true;\r\n else\r\n retVal = false;\r\n\r\n// if (isDebugFlag)\r\n// window.status =\"TRAP KEYPRESS A- RET = \" + retVal + \" Key Pressed: \" + evt.keyCode + \" Char code: \" + evt.charCode; \r\n } // end if (isSafari == true) \r\n\r\n\t\t// prevent the default (print, caret moves forward) routine from being executed\r\n evt.preventDefault();\r\n\t}\r\n\r\n// \tif (isDebugFlag)\r\n// window.status =\"TRAP KEYPRESS - RET = \" + retVal + \" Key Pressed: \" + evt.keyCode + \" Char code: \" + evt.charCode; \r\n\r\n\treturn retVal;\r\n}", "title": "" }, { "docid": "3fa5a04771fb42dc4902fa393eef42a1", "score": "0.58617055", "text": "function keyPress( e ) {\n\tif( typeof window.event != \"undefined\" )\n\t\te = window.event; // IE fix\n\tif( e.type == \"keypress\" ) {\n\t\tvalue = e.which;\n\t\tmemStoreByte( 0xff, value );\n\t}\n}", "title": "" }, { "docid": "ed438ca48a31fd66d621dcd151983310", "score": "0.58540493", "text": "onKeyUp(ev) {\n // check if 'Enter' was pressed\n if (ev.code === 'Enter') {\n ChromeGA.event(ChromeGA.EVENT.TEXT, this.name);\n this.fireEvent('setting-text-changed', this.value);\n }\n }", "title": "" }, { "docid": "c8e267426aeb6ad4f993d3c253f96986", "score": "0.58300143", "text": "keydown(ev) {}", "title": "" }, { "docid": "4e255d3d8e411f793e16fc02701a1abd", "score": "0.5795925", "text": "function attachTextListener(input, func) {\n if (window.addEventListener) {\n input.addEventListener('input', func, true);\n } else\n input.attachEvent('onpropertychange', function() {\n func.call(input);\n });\n}", "title": "" }, { "docid": "85b256d6df7cd76183aad71e836acf47", "score": "0.57900524", "text": "function InputEvent() {\n var _this13 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n $.extend(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this13.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this13.isNativeEvent(evt)) {\n _this13.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this13.fakeInputEvent);\n _this13.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this13.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this13.behavesOk).off('change.inputevent', evt.data.selector, _this13.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this13.behavesOk).on('change.inputevent', selector, { selector: selector }, _this13.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "title": "" }, { "docid": "458e389da2fc8bd5115af23fc97646fa", "score": "0.5784707", "text": "function keyPressHandler(event)\n {\n console.log('keyPressHandler:', event.target);\n\n // Make sure it's not the same event firing over and over again\n if (keyPressEvent == event) {\n return;\n } else {\n keyPressEvent = event;\n }\n\n // Get character that was typed\n var charCode = event.keyCode || event.which;\n if (charCode == KEYCODE_SPACEBAR) {\n if (event.target.value === '') {\n event.preventDefault();\n return;\n }\n }\n if (charCode == KEYCODE_RETURN) {\t// If return, clear and get out\n clearTypingBuffer();\n if (event.target.value.trim() != '') { // Only submit if there's content\n spotlightSubmit();\n }\n event.preventDefault();\n return;\n }\n // If user hit ESC, close spotlight\n if (charCode == KEYCODE_ESC) {\n hideSpotlight();\n return;\n }\n\n // Add new character to typing buffer\n var char = String.fromCharCode(charCode);\n typingBuffer.push(char);\n\n // Check typed text for shortcuts\n // checkShortcuts(typingBuffer.join(''), char, event.target);\n var shortcut = typingBuffer.join('');\n if (checkShortcuts(shortcut, char, event.target)) {\n // Replace text in the input field\n replaceTextRegular(shortcut.trim(), '', event.target);\n updateSpotlightPlaceholderText();\n }\n\n checkDupes();\n }", "title": "" }, { "docid": "9fea7c2acd09bb01ee23a256f6bdec5d", "score": "0.5750865", "text": "function physicalKeyboardListener(event) {\n var x = event.which || event.keyCode;\n event.preventDefault();\n if (x == 8) {\n //event.preventDefault();\n deleteText();\n }\n else if (x == 37 || x == 38 || x == 39 || x == 40) {\n // event.preventDefault();\n arrowKeys(x);\n }\n else if (x == 96 || x == 91 || x == 93 || x == 59 || x == 39 || x == 44 || x == 46 || x == 47) {\n symbolsKey();\n }\n else if (x == 42 || x == 43 || x == 45 || x == 47) {\n arithmeticKeys();\n }\n else if (x == 33) {\n pageUpKey();\n }\n else if (x == 34) {\n pageDownKey();\n }\n else if (x == 27) {\n escapeKey();\n }\n else if (x == 13) {\n enterKey();\n }\n else if (x >= 112 && x <= 123) {\n functionKeys();\n }\n //else if (x == 32) {\n // document.getElementById(\"userInput\").innerHTML += \"&nbsp;\";\n //}\n else {\n //document.getElementById(\"userInput\").innerHTML += \"\" + x.toString();\n listenAndWrite(String.fromCharCode(x).toString().toLowerCase());\n }\n}", "title": "" }, { "docid": "64716ccc8e683009d45ba509bb2b9400", "score": "0.57439315", "text": "function keyUpHandler(e) {\n if (isWindowFocused) {\n //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "title": "" }, { "docid": "3575a1fe1dccc4c77286e429e6e5ad59", "score": "0.57340395", "text": "addLocationText(text){\n // Set the location if there is content\n var locationNode = this.elem[0];\n if (locationNode) {\n locationNode.dispatchEvent(getKeyboardEvent('keydown'));\n locationNode.value = locationNode.value == '' ?\n text : locationNode.value + ', ' + text;\n locationNode.dispatchEvent(getKeyboardEvent('input'));\n locationNode.dispatchEvent(getKeyboardEvent('keyup'));\n var changeEvt2 = document.createEvent(\"HTMLEvents\");\n changeEvt2.initEvent('change', false, true);\n locationNode.dispatchEvent(changeEvt2);\n }\n }", "title": "" }, { "docid": "737de504a35fc0dec348049a320b8c81", "score": "0.5729001", "text": "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "title": "" }, { "docid": "737de504a35fc0dec348049a320b8c81", "score": "0.5729001", "text": "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "title": "" }, { "docid": "11bd9e7ca7cbba0c892efe0e9d0d799b", "score": "0.5717008", "text": "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "title": "" }, { "docid": "11bd9e7ca7cbba0c892efe0e9d0d799b", "score": "0.5717008", "text": "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "title": "" }, { "docid": "11bd9e7ca7cbba0c892efe0e9d0d799b", "score": "0.5717008", "text": "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "title": "" }, { "docid": "6d57ebc8ecbf921e704653764cc11c6f", "score": "0.5713624", "text": "function easySend() {\n\tif(inputField) {\n\t\tinputField.addEventListener(\"keypress\", ctrlEnter, false);\n\t}else{\n\t\twindow.addEventListener(\"keypress\", ctrlEnter, false);\n\t}\n}", "title": "" }, { "docid": "39d865e5aa9e30b1dbe52009689a6d14", "score": "0.57110506", "text": "function insertTextAtCursor(text) {\n // This will let us use the undo history. It doesn't seem to be working for\n // the contentEditable=\"true\" divs gmail uses, though. Text inputs but\n // doesn't undo.\n var el = document.activeElement;\n var e = document.createEvent('TextEvent');\n e.initTextEvent('textInput', true, true, null, text);\n el.focus();\n el.dispatchEvent(e);\n}", "title": "" }, { "docid": "648da4a36e1e8a0b15ee24b212ea499e", "score": "0.56961155", "text": "logTextEvent(text) {\n console.log(text);\n }", "title": "" }, { "docid": "7e54ba0279608693d709c63fad33d0d3", "score": "0.5692128", "text": "function keypress(evt) {\n\tif(evt.keyCode === 13){\n\t\tsendText();\n\t} \n}", "title": "" }, { "docid": "30c31cb11ee9817552022b143d9a872d", "score": "0.56738186", "text": "function txtKeyDown(obj, event) {\n if (!event)\n event = getEvent(event);\n var tdObj = obj.parentNode;\n if (tdObj == null)\n return;\n var fgObj = getGridObj(tdObj);\n if (event.keyCode == 9 || event.keyCode == 13) {\n if (fgObj.Search == true) {\n if (event.shiftKey != true) {\n MoveNextSearchCell(tdObj);\n }\n else {\n MovePreviousSearchCell(tdObj);\n }\n iFg_StopNavi(event);\n return;\n }\n if (getIAttribute(tdObj, \"cT\") == 'iLookup') {\n lkpBlur(obj);\n iFg_HideLkpGrid(obj);\n }\n else if (getIAttribute(tdObj, \"cT\") == 'iCheckBox') {\n //chkBlur(obj);\n chkChange(obj);\n }\n else if (getIAttribute(tdObj, \"cT\") == 'iDate') {\n txtBlur(obj);\n iFg_txtChange(obj);\n iFg_HideCal();\n }\n else {\n txtBlur(obj); iFg_txtChange(obj);\n }\n if (event.shiftKey == false) {\n MoveNext(tdObj);\n }\n else {\n MovePrevious(tdObj);\n }\n SetFocustoEditCtrl(document.all[fgObj.id]);\n iFg_StopNavi(event);\n }\n else if (event.keyCode == get_icHlpKey() && get_icHlpEnb()) {\n lHp(event);\n }\n}", "title": "" }, { "docid": "4dc3a7fb10e5e426dc237c422c4bc99a", "score": "0.56520003", "text": "function getWouldBeText(event)\n{\n\tvar theText = mydiv.innerText;\n\tvar charCode = event.charCode;\n\tvar newChar = String.fromCharCode(charCode);\n\tvar selectedText = window.getSelection().toString();\n\n\tif(theText.charCodeAt(theText.length-1) == 10)\n\t\ttheText = theText.substring(0, theText.length-1);\n\n\tif(selectedText) //if text is selected\n\t{\t\t\n\t\tif(charCode == 8) //delete key, replace w/nothing\n\t\t\tnewChar = \"\"; \n\t\t\n\t\ttheText = theText.replace(selectedText, newChar);\n\t}\n\telse if(charCode == 8) //delete key\n\t\ttheText = theText.substring(0, theText.length-1);\n\telse\n\t\ttheText = theText + newChar;\n\t\t\n\treturn theText;\n}", "title": "" }, { "docid": "f61ab88628e0e4f3bc17616da3121049", "score": "0.56518805", "text": "function InputEvent() {\n var _this14 = this;\n var globals = window || global;\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n _extends(this, {\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n });\n }", "title": "" }, { "docid": "107958c8ff66bf436d51a3ed8075938d", "score": "0.56504166", "text": "function trigg_ent(evt){\nif (evt.keyCode === 13) \n {fire();}\n}", "title": "" }, { "docid": "a751fa61ebb42b51f0ace2b431cf4e18", "score": "0.56448865", "text": "function clickHandler() {\n //browser events \n console.log(\"clicked\");\n console.log(\"input\",txtinp.value);\n \n }", "title": "" }, { "docid": "a5e859b1a6eba5117804cb74134dcf4d", "score": "0.56419325", "text": "function typeahead_onkeypress(event) {\n var eventObject = event ? event : window.event;\n var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;\n // TODO: Add your event handler code here\n\n\n alert(\"keypress\");\n\n}", "title": "" }, { "docid": "4515816487b2f78f0b03cc67c77fc6bf", "score": "0.5634814", "text": "function WordEntryKeyPress(event)\r\n{\r\n\tif (CrosswordFinished) return;\r\n\t// Treat an Enter keypress as an OK click.\r\n\tif (CurrentWord >= 0 && event.keyCode == 13) OKClick();\r\n}", "title": "" }, { "docid": "e1bb2060556e8d3b03cafa802fafe7f3", "score": "0.56252533", "text": "function uiHandleKeypress(event, formElementId) { \t \n \t // Check the keyCode\n \t if (!event) return false;\n \t \n \t var keyCode;\n \t if (event.keyCode) keyCode = event.keyCode;\n \t else keyCode = event.which; // Mozilla\n \t \n \t try { \t \t\n\t \t uiKeypressHandlerRegistry.invokeHandlers(formElementId, keyCode, event);\t \t \n \t }\n \t catch (e) { \t\n \t \t\t//Keyboard handler errors may be thrown after AJAX region updates.\n \t \twindow.status = \"Keyboard handler error (non-critical): \" + e;\n \t }\n \t \n \t return false;\n}", "title": "" }, { "docid": "e6bf2b04da15dd3a038e110e029790c3", "score": "0.5615141", "text": "function keyevents(e) {\n if (cmdWindow.active) {\n var code = e.keyCode || e.which;\n cmdWindow.userprint(String.fromCharCode(code));\n if (e.keyCode == 13)\n e.preventDefault();\n return true;\n }\n\n if (e.keyCode == 8) return false;\n return true;\n}", "title": "" }, { "docid": "d082ceaddbaf3adcd2dfa1aeeb670061", "score": "0.5612078", "text": "function handleKeyPress() {}", "title": "" }, { "docid": "979f78b4fc970c932a89356a775ca0ed", "score": "0.56113756", "text": "function getFallbackBeforeInputChars(domEventName,nativeEvent){// If we are currently composing (IME) and using a fallback to do so,\n// try to extract the composed characters from the fallback object.\n// If composition event is available, we extract a string only at\n// compositionevent, otherwise extract it at fallback events.\nif(isComposing){if(domEventName==='compositionend'||!canUseCompositionEvent&&isFallbackCompositionEnd(domEventName,nativeEvent)){var chars=getData();reset();isComposing=false;return chars;}return null;}switch(domEventName){case'paste':// If a paste event occurs after a keypress, throw out the input\n// chars. Paste events should not lead to BeforeInput events.\nreturn null;case'keypress':/**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */if(!isKeypressCommand(nativeEvent)){// IE fires the `keypress` event when a user types an emoji via\n// Touch keyboard of Windows. In such a case, the `char` property\n// holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n// is 2, the property `which` does not represent an emoji correctly.\n// In such a case, we directly return the `char` property instead of\n// using `which`.\nif(nativeEvent.char&&nativeEvent.char.length>1){return nativeEvent.char;}else if(nativeEvent.which){return String.fromCharCode(nativeEvent.which);}}return null;case'compositionend':return useFallbackCompositionData&&!isUsingKoreanIME(nativeEvent)?null:nativeEvent.data;default:return null;}}", "title": "" }, { "docid": "06919b6fee548ab93c43d5482432110b", "score": "0.5606848", "text": "function inputHandler(e){\n\t\tsetTextInput(e.target.value);\n\t}", "title": "" }, { "docid": "49e6661ed9c7cf84cb21d265aa978cd7", "score": "0.55975765", "text": "_onInput(ev) {\n // Record the cursor position that was computed on keydown or before\n // contentEditable execCommand (whatever preceded the 'input' event)\n this._recordHistoryCursor(true);\n const cursor = this._historySteps[this._historySteps.length - 1].cursor;\n const { focusOffset, focusNode, anchorNode, anchorOffset } = cursor || {};\n const wasCollapsed = !cursor || (focusNode === anchorNode && focusOffset === anchorOffset);\n\n // Sometimes google chrome wrongly triggers an input event with `data`\n // being `null` on `deleteContentForward` `insertParagraph`. Luckily,\n // chrome provide the proper signal with the event `beforeinput`.\n const isChromeDeleteforward =\n ev.inputType === 'insertText' &&\n ev.data === null &&\n this._lastBeforeInputType === 'deleteContentForward';\n const isChromeInsertParagraph =\n ev.inputType === 'insertText' &&\n ev.data === null &&\n this._lastBeforeInputType === 'insertParagraph';\n if (this.keyboardType === KEYBOARD_TYPES.PHYSICAL || !wasCollapsed) {\n if (ev.inputType === 'deleteContentBackward') {\n this.historyRollback();\n ev.preventDefault();\n this._applyCommand('oDeleteBackward');\n } else if (ev.inputType === 'deleteContentForward' || isChromeDeleteforward) {\n this.historyRollback();\n ev.preventDefault();\n this._applyCommand('oDeleteForward');\n } else if (ev.inputType === 'insertParagraph' || isChromeInsertParagraph) {\n this.historyRollback();\n ev.preventDefault();\n if (this._applyCommand('oEnter') === UNBREAKABLE_ROLLBACK_CODE) {\n this._applyCommand('oShiftEnter');\n }\n } else if (['insertText', 'insertCompositionText'].includes(ev.inputType)) {\n // insertCompositionText, courtesy of Samsung keyboard.\n const selection = this.document.getSelection();\n // Detect that text was selected and change behavior only if it is the case,\n // since it is the only text insertion case that may cause problems.\n if (anchorNode !== focusNode || anchorOffset !== focusOffset) {\n ev.preventDefault();\n this._applyRawCommand('oDeleteBackward');\n insertText(selection, ev.data);\n const range = selection.getRangeAt(0);\n setCursor(range.endContainer, range.endOffset);\n }\n // Check for url after user insert a space so we won't transform an incomplete url.\n if (\n ev.data.includes(' ') &&\n selection &&\n selection.anchorNode &&\n !this.commandBar._active\n ) {\n ev.preventDefault();\n this._convertUrlInElement(closestElement(selection.anchorNode));\n this.execCommand('insertText', ev.data);\n }\n this.sanitize();\n this.historyStep();\n } else if (ev.inputType === 'insertLineBreak') {\n this.historyRollback();\n ev.preventDefault();\n this._applyCommand('oShiftEnter');\n } else {\n this.sanitize();\n this.historyStep();\n }\n }\n }", "title": "" }, { "docid": "a42875a7210ba6ba434ad07266c29fd3", "score": "0.55837786", "text": "function InputEvent() {\n var _this14 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n $.extend(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "title": "" }, { "docid": "3a666a80c4d51e9226c0cc21dee7b48d", "score": "0.558122", "text": "function TextExtFocus() {}", "title": "" }, { "docid": "3e661b714ad25a05f082cba181cfe2cc", "score": "0.55738324", "text": "function onDocumentKeyDown(event){\n\n\t}", "title": "" }, { "docid": "fcf5bb28ea02db7c7afd4b643f5c3380", "score": "0.55668765", "text": "function getElement(event)\r\n{\r\n\r\nvar timout = document.getElementById('zeitfenster').innerHTML;\r\nwhile (timout>0)\r\n {\r\n document.getElementById('eingabe').value = document.getElementById('now').innerHTML;\r\n document.getElementById('eingabe').value += ' ';\r\n\r\n//=== work in progress \r\n\r\n\r\nvar fireOnThis = document.getElementById('eingabe');\r\n\r\nvar fireOnCorrect = document.getElementById('correct1');\r\nfireOnCorrect.value = 'test';\r\n\r\nif( window.KeyEvent ) {\r\n var evObj = document.createEvent('KeyEvents');\r\n evObj.initKeyEvent( 'keyup', true, true, window, false, false, false, false, 32, 0 );\r\n //evObj.keyCode = 32;\r\n //alert('hi true cond');\r\n} else {\r\n var evObj = document.createEvent('UIEvents');\r\n evObj.initUIEvent( 'keyup', true, true, window, 1 );\r\n evObj.keyCode = 13;\r\n //alert('hi false cond');\r\n}\r\nfireOnThis.dispatchEvent(evObj);\r\n\r\n//== end of constructions\r\n\r\n\r\n timout--;\r\n }//end while\r\n}", "title": "" }, { "docid": "9a13fc7e445b931711f644ccf4fee0a4", "score": "0.5566253", "text": "function onTextKeyDown(e) {\n\t\t// Alt and AltGr for inspect mode.\n\t\t//console.log(e.keyCode);\n\n\t\tif (me.ast && me.ast.script && !me.ast.hasErrors() && e.keyCode == 13 && me.ast.token == \"EOF\" && me.intextarea.selectionStart >= me.ast.script.end) {\n\t\t\t//console.log(\"BREAK TO NEW BOX\");\n\t\t\t//me.insertStatement(undefined, true);\n\t\t\tme.history.push(me.ast.stream.code);\n\t\t\tme.historyindex = me.history.length;\n\t\t\tif (window.localStorage) {\n\t\t\t\twindow.localStorage.setItem(\"console_history\", JSON.stringify(me.history));\n\t\t\t}\n\t\t\t$(me.outdiv).find(\".fake-caret\").remove();\n\t\t\tme.$codearea.append($('<div class=\"scriptbox-historic\">'+me.outdiv.innerHTML+'</div>'));\n\n\t\t\tme.ast.execute(EdenUI.ScriptBox.consoleAgent, eden.root.scope, function(res) {\n\t\t\t\tlet result = (res) ? res : me.ast.lastresult;\n\t\t\t\tif (result !== undefined) {\n\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\tresult.then(r => {\n\t\t\t\t\t\t\tconsole.log(\"Result\",r);\n\t\t\t\t\t\t\tme.$codearea.append($('<div class=\"scriptbox-value\">'+EdenUI.Highlight.html(Eden.edenCodeForValue(r))+'</div>'));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"Result\",result);\n\t\t\t\t\t\tme.$codearea.append($('<div class=\"scriptbox-value\">'+EdenUI.Highlight.html(Eden.edenCodeForValue(result))+'</div>'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Make sure scrolled to bottom.\n\t\t\tme.inputhider.scrollTop = me.inputhider.scrollHeight;\n\t\t\tme.setSource(\"\");\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!e.altKey) {\n\n\t\t\t// If not Ctrl or Shift key then\n\t\t\tif (!e.ctrlKey && e.keyCode != 17 && e.keyCode != 16) {\n\t\t\t\t// Make TAB key insert TABs instead of changing focus\n\t\t\t\tif (e.keyCode == 9) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar start = me.intextarea.selectionStart;\n\t\t\t\t\tvar end = me.intextarea.selectionEnd;\n\n\t\t\t\t\t// set textarea value to: text before caret + tab + text after caret\n\t\t\t\t\tme.intextarea.value = me.intextarea.value.substring(0, start)\n\t\t\t\t\t\t\t\t+ \"\\t\"\n\t\t\t\t\t\t\t\t+ me.intextarea.value.substring(end);\n\n\t\t\t\t\t// put caret at right position again\n\t\t\t\t\tme.intextarea.selectionStart =\n\t\t\t\t\tme.intextarea.selectionEnd = start + 1;\n\t\t\t\t\t//updateLineHighlight();\n\t\t\t\t\tme.rebuild();\n\t\t\t\t} else if (e.keyCode == 37 || e.keyCode == 38 || e.keyCode == 39 || e.keyCode == 40 || e.keyCode == 36 || e.keyCode == 35) {\n\t\t\t\t\t// Shift arrow selection, move to editable div.\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\tme.setCaretToFakeCaret();\n\t\t\t\t\t\tme.outdiv.focus();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if (e.keyCode == 38) {\n\t\t\t\t\t\t// Up, scroll up in history\n\t\t\t\t\t\t//console.log(\"UP\");\n\t\t\t\t\t\tif (me.historyindex > 0) {\n\t\t\t\t\t\t\tme.historyindex--;\n\t\t\t\t\t\t\tme.setSource(me.history[me.historyindex]);\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (e.keyCode == 40) {\n\t\t\t\t\t\t// Down, scoll down in history\n\t\t\t\t\t\t//console.log(\"DOWN\");\n\t\t\t\t\t\tif (me.historyindex < me.history.length-1) {\n\t\t\t\t\t\t\tme.historyindex++;\n\t\t\t\t\t\t\tme.setSource(me.history[me.historyindex]);\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tme.historyindex = me.history.length;\n\t\t\t\t\t\t\tme.setSource(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t// Update fake caret position at key repeat rate\n\t\t\t\t\tme.updateLineCachedHighlight();\n\t\t\t\t\t// Adjust scroll position if required\n\t\t\t\t\t//checkScroll();\n\t\t\t\t} else if (e.keyCode == 13 || (e.keyCode == 8 && me.intextarea.value.charCodeAt(me.intextarea.selectionStart-1) == 10)) {\n\t\t\t\t\t// Adding or removing lines requires a full re-highlight at present\n\t\t\t\t\tme.refreshentire = true;\n\t\t\t\t}\n\n\t\t\t} else if (e.ctrlKey) {\n\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\tif (e.keyCode == 37 || e.keyCode == 38 || e.keyCode == 39 || e.keyCode == 40 || e.keyCode == 36 || e.keyCode == 35) {\n\t\t\t\t\t\t// Ctrl+Shift arrow selection, move to editable div.\n\t\t\t\t\t\tme.setCaretToFakeCaret();\n\t\t\t\t\t\tme.outdiv.focus();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else if (e.keyCode === 38) {\n\t\t\t\t\t// up\n\t\t\t\t\tonPrevious();\n\t\t\t\t} else if (e.keyCode === 40) {\n\t\t\t\t\t// down\n\t\t\t\t\tonNext();\n\t\t\t\t} else if (e.keyCode === 86) {\n\n\t\t\t\t} else if (e.keyCode === 65) {\n\t\t\t\t\t// Ctrl+A to select all.\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tme.outdiv.focus();\n\t\t\t\t\t//me.selectAll();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Alt key is pressed so.....\n\t\t\tif (e.keyCode == 187 || e.keyCode == 61) {\n\t\t\t\t// Alt+Plus: Zoom in\n\t\t\t\t//agent.state[obs_zoom]++;\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.keyCode == 189 || e.keyCode == 173) {\n\t\t\t\t// Alt+Minus: Zoom out\n\t\t\t\t//agent.state[obs_zoom]--;\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.keyCode == 48) {\n\t\t\t\t//Alt+0\n\t\t\t\t//agent.state[obs_zoom] = 0;\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "8edf940f8912f246451e07c144ee8490", "score": "0.55653477", "text": "onKeyPress(event) {\n // We're delegating the keypress event to the TagInputManager\n this.tagInputManager.onKeyPress(event);\n }", "title": "" }, { "docid": "556c0fd6c0e86e855591db9eb516f198", "score": "0.5557121", "text": "_keyup( e ) { this.__keyup( e ); }", "title": "" }, { "docid": "a407561d09c021d2ae07accbcd94b3b7", "score": "0.5555153", "text": "function enableTyping() {\n\t\t$(window).keypress(function(e) {\n\t\t\tif(e.keyCode == 13|| e.which == 13) {\n\t\t\t\tinterpret();\n\t\t\t} else {\n\t\t\t\texpression += String.fromCharCode(e.keyCode || e.which);\n\t\t\t\t$(\"#derivative\").html(expression);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "df53cfaf1d6e14906e189646776a6165", "score": "0.5554132", "text": "function InputEvent() {\n var _this14 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n _extends(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "title": "" }, { "docid": "8d8b91a4d4d1eca0bcd2cc839ab73a50", "score": "0.5552683", "text": "function getTypedCharCode(evt) {\n return evt.charCode ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);\n}", "title": "" }, { "docid": "d2c442ee38c00582df151d2957df3d5c", "score": "0.5548131", "text": "function textSelectEvent() {\n const p = document.body\n p.addEventListener('mouseup', (e) => {\n const selection = window.getSelection().toString();\n\n if (selection === '') {\n console.log('click');\n } else {\n console.log('selection', selection);\n }\n });\n}", "title": "" }, { "docid": "b9aa7766cf84b8dc0fe1214aba79fb6a", "score": "0.5542565", "text": "function onkeypress_document(event) {\n\t\t//see http://javascript.info/tutorial/keyboard-events\n\n\t\tif (event.isDefaultPrevented) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// get the key event.type must be keypress\n\t\tvar key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;\n\t\tfunction getChar(event) {\n\t\t\tif (event.which === null) {\n\t\t\t\treturn String.fromCharCode(event.keyCode); // IE\n\t\t\t}\n\t\t\telse if (event.which !== 0 && event.charCode !== 0) {\n\t\t\t\treturn String.fromCharCode(event.which); // the rest\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn null; // special key\n\t\t\t}\n\t\t}\n\n\t\t// get app specific values\n\t\tvar edit = app.state.edit();\n\n\t\t//commands\n\t\tvar char = getChar(event || window.event);\n\t\tif (!char) return;\n\t\tchar = char.toUpperCase();\n\t\tif (event.ctrlKey) {\n\t\t\tif (char === 'E') { // ctrl+E ... toggle edit mode\n\t\t\t\tevent.preventDefault(); //prevent default behaviour\n\t\t\t\tapp.toggleEdit();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (char === 'D') { // ctrl+D ... toggle view details\n\t\t\t\tevent.preventDefault(); //prevent default behaviour\n\t\t\t\tapp.toggleDetails();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//Test\n\t\t\tif (char === 'T') { // ctrl+Z ... undo (unsaved) changes\n\t\t\t\tevent.preventDefault(); //prevent default behaviour\n\t\t\t\talert('Ctrl-T detected')\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} //if (event.ctrlKey)\n\n\t\t//pass on all other keys\n\t\treturn true;\n\t}", "title": "" }, { "docid": "4a2a82d6bdf69815e05565ad94f63317", "score": "0.5538793", "text": "function addKeyboardEvents() \n{\n addEvent(document, \"keydown\", function(e) \n {\n keyboard[e.keyCode] = true;\n });\n\n addEvent(document, \"keyup\", function(e) \n {\n keyboard[e.keyCode] = false;\n });\n}", "title": "" }, { "docid": "168ae12ad822e9b290b4f5e0b898df7e", "score": "0.5531407", "text": "function escBackSpace() // called on document.body keydown event\n {\n if(event.keyCode == 8)\n {\n if (gotBodyFocus == 1 | document.activeElement.getAttribute(\"type\") != \"text\") // to avoid the backspace event except the Textbox \n {\n //event.keyCode = 0;\n event.returnValue=false\n }\n \n } \n }", "title": "" }, { "docid": "75eea59548fe54beb9f66173e0bbc2ca", "score": "0.5528787", "text": "function handleEvent(e){\n\t\t\t\tvar charOrCode;\n\n\t\t\t\t// Filter out keydown events that will be followed by keypress events. Note that chrome/android\n\t\t\t\t// w/word suggestion has keydown/229 events on typing with no corresponding keypress events.\n\t\t\t\tif(e.type == \"keydown\" && e.keyCode != 229){\n\t\t\t\t\tcharOrCode = e.keyCode;\n\t\t\t\t\tswitch(charOrCode){ // ignore state keys\n\t\t\t\t\t\tcase keys.SHIFT:\n\t\t\t\t\t\tcase keys.ALT:\n\t\t\t\t\t\tcase keys.CTRL:\n\t\t\t\t\t\tcase keys.META:\n\t\t\t\t\t\tcase keys.CAPS_LOCK:\n\t\t\t\t\t\tcase keys.NUM_LOCK:\n\t\t\t\t\t\tcase keys.SCROLL_LOCK:\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif(!e.ctrlKey && !e.metaKey && !e.altKey){ // no modifiers\n\t\t\t\t\t\tswitch(charOrCode){ // ignore location keys\n\t\t\t\t\t\t\tcase keys.NUMPAD_0:\n\t\t\t\t\t\t\tcase keys.NUMPAD_1:\n\t\t\t\t\t\t\tcase keys.NUMPAD_2:\n\t\t\t\t\t\t\tcase keys.NUMPAD_3:\n\t\t\t\t\t\t\tcase keys.NUMPAD_4:\n\t\t\t\t\t\t\tcase keys.NUMPAD_5:\n\t\t\t\t\t\t\tcase keys.NUMPAD_6:\n\t\t\t\t\t\t\tcase keys.NUMPAD_7:\n\t\t\t\t\t\t\tcase keys.NUMPAD_8:\n\t\t\t\t\t\t\tcase keys.NUMPAD_9:\n\t\t\t\t\t\t\tcase keys.NUMPAD_MULTIPLY:\n\t\t\t\t\t\t\tcase keys.NUMPAD_PLUS:\n\t\t\t\t\t\t\tcase keys.NUMPAD_ENTER:\n\t\t\t\t\t\t\tcase keys.NUMPAD_MINUS:\n\t\t\t\t\t\t\tcase keys.NUMPAD_PERIOD:\n\t\t\t\t\t\t\tcase keys.NUMPAD_DIVIDE:\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif((charOrCode >= 65 && charOrCode <= 90) || (charOrCode >= 48 && charOrCode <= 57) || charOrCode == keys.SPACE){\n\t\t\t\t\t\t\treturn; // keypress will handle simple non-modified printable keys\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar named = false;\n\t\t\t\t\t\tfor(var i in keys){\n\t\t\t\t\t\t\tif(keys[i] === e.keyCode){\n\t\t\t\t\t\t\t\tnamed = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!named){\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} // only allow named ones through\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcharOrCode = e.charCode >= 32 ? String.fromCharCode(e.charCode) : e.charCode;\n\t\t\t\tif(!charOrCode){\n\t\t\t\t\tcharOrCode = (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 48 && e.keyCode <= 57) || e.keyCode == keys.SPACE ? String.fromCharCode(e.keyCode) : e.keyCode;\n\t\t\t\t}\n\t\t\t\tif(!charOrCode){\n\t\t\t\t\tcharOrCode = 229; // IME\n\t\t\t\t}\n\t\t\t\tif(e.type == \"keypress\"){\n\t\t\t\t\tif(typeof charOrCode != \"string\"){\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif((charOrCode >= 'a' && charOrCode <= 'z') || (charOrCode >= 'A' && charOrCode <= 'Z') || (charOrCode >= '0' && charOrCode <= '9') || (charOrCode === ' ')){\n\t\t\t\t\t\tif(e.ctrlKey || e.metaKey || e.altKey){\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} // can only be stopped reliably in keydown\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// create fake event to set charOrCode and to know if preventDefault() was called\n\t\t\t\tvar faux = { faux: true }, attr;\n\t\t\t\tfor(attr in e){\n\t\t\t\t\tif(!/^(layer[XY]|returnValue|keyLocation)$/.test(attr)){ // prevent WebKit warnings\n\t\t\t\t\t\tvar v = e[attr];\n\t\t\t\t\t\tif(typeof v != \"function\" && typeof v != \"undefined\"){\n\t\t\t\t\t\t\tfaux[attr] = v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlang.mixin(faux, {\n\t\t\t\t\tcharOrCode: charOrCode,\n\t\t\t\t\t_wasConsumed: false,\n\t\t\t\t\tpreventDefault: function(){\n\t\t\t\t\t\tfaux._wasConsumed = true;\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t},\n\t\t\t\t\tstopPropagation: function(){\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tthis._lastInputProducingEvent = faux;\n\n\t\t\t\t// Give web page author a chance to consume the event. Note that onInput() may be called multiple times\n\t\t\t\t// for same keystroke: once for keypress event and once for input event.\n\t\t\t\t// 0 && console.log(faux.type + ', charOrCode = (' + (typeof charOrCode) + ') ' + charOrCode + ', ctrl ' + !!faux.ctrlKey + ', alt ' + !!faux.altKey + ', meta ' + !!faux.metaKey + ', shift ' + !!faux.shiftKey);\n\t\t\t\tif(this.onInput(faux) === false){ // return false means stop\n\t\t\t\t\tfaux.preventDefault();\n\t\t\t\t\tfaux.stopPropagation();\n\t\t\t\t}\n\t\t\t\tif(faux._wasConsumed){\n\t\t\t\t\treturn;\n\t\t\t\t} // if preventDefault was called\n\n\t\t\t\t// IE8 doesn't emit the \"input\" event at all, and IE9 doesn't emit it for backspace, delete, cut, etc.\n\t\t\t\t// Since the code below (and perhaps user code) depends on that event, emit it synthetically.\n\t\t\t\t// See http://benalpert.com/2013/06/18/a-near-perfect-oninput-shim-for-ie-8-and-9.html.\n\t\t\t\tif(has(\"ie\") <= 9){\n\t\t\t\t\tswitch(e.keyCode){\n\t\t\t\t\tcase keys.TAB:\n\t\t\t\t\tcase keys.ESCAPE:\n\t\t\t\t\tcase keys.DOWN_ARROW:\n\t\t\t\t\tcase keys.UP_ARROW:\n\t\t\t\t\tcase keys.LEFT_ARROW:\n\t\t\t\t\tcase keys.RIGHT_ARROW:\n\t\t\t\t\t\t// These keys may alter the <input>'s value indirectly, but we don't want to emit an \"input\"\n\t\t\t\t\t\t// event. For example, the up/down arrows in TimeTextBox or ComboBox will cause the next\n\t\t\t\t\t\t// dropdown item's value to be copied to the <input>.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif(e.keyCode == keys.ENTER && this.textbox.tagName.toLowerCase() != \"textarea\"){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.defer(function(){\n\t\t\t\t\t\t\tif(this.textbox.value !== this._lastInputEventValue){\n\t\t\t\t\t\t\t\ton.emit(this.textbox, \"input\", {bubbles: true});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "d252a73ed19445dfeaecdfebc73a6e60", "score": "0.5528787", "text": "function handleEvent(e){\n\t\t\t\tvar charOrCode;\n\n\t\t\t\t// Filter out keydown events that will be followed by keypress events. Note that chrome/android\n\t\t\t\t// w/word suggestion has keydown/229 events on typing with no corresponding keypress events.\n\t\t\t\tif(e.type == \"keydown\" && e.keyCode != 229){\n\t\t\t\t\tcharOrCode = e.keyCode;\n\t\t\t\t\tswitch(charOrCode){ // ignore state keys\n\t\t\t\t\t\tcase keys.SHIFT:\n\t\t\t\t\t\tcase keys.ALT:\n\t\t\t\t\t\tcase keys.CTRL:\n\t\t\t\t\t\tcase keys.META:\n\t\t\t\t\t\tcase keys.CAPS_LOCK:\n\t\t\t\t\t\tcase keys.NUM_LOCK:\n\t\t\t\t\t\tcase keys.SCROLL_LOCK:\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif(!e.ctrlKey && !e.metaKey && !e.altKey){ // no modifiers\n\t\t\t\t\t\tswitch(charOrCode){ // ignore location keys\n\t\t\t\t\t\t\tcase keys.NUMPAD_0:\n\t\t\t\t\t\t\tcase keys.NUMPAD_1:\n\t\t\t\t\t\t\tcase keys.NUMPAD_2:\n\t\t\t\t\t\t\tcase keys.NUMPAD_3:\n\t\t\t\t\t\t\tcase keys.NUMPAD_4:\n\t\t\t\t\t\t\tcase keys.NUMPAD_5:\n\t\t\t\t\t\t\tcase keys.NUMPAD_6:\n\t\t\t\t\t\t\tcase keys.NUMPAD_7:\n\t\t\t\t\t\t\tcase keys.NUMPAD_8:\n\t\t\t\t\t\t\tcase keys.NUMPAD_9:\n\t\t\t\t\t\t\tcase keys.NUMPAD_MULTIPLY:\n\t\t\t\t\t\t\tcase keys.NUMPAD_PLUS:\n\t\t\t\t\t\t\tcase keys.NUMPAD_ENTER:\n\t\t\t\t\t\t\tcase keys.NUMPAD_MINUS:\n\t\t\t\t\t\t\tcase keys.NUMPAD_PERIOD:\n\t\t\t\t\t\t\tcase keys.NUMPAD_DIVIDE:\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif((charOrCode >= 65 && charOrCode <= 90) || (charOrCode >= 48 && charOrCode <= 57) || charOrCode == keys.SPACE){\n\t\t\t\t\t\t\treturn; // keypress will handle simple non-modified printable keys\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar named = false;\n\t\t\t\t\t\tfor(var i in keys){\n\t\t\t\t\t\t\tif(keys[i] === e.keyCode){\n\t\t\t\t\t\t\t\tnamed = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!named){\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} // only allow named ones through\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcharOrCode = e.charCode >= 32 ? String.fromCharCode(e.charCode) : e.charCode;\n\t\t\t\tif(!charOrCode){\n\t\t\t\t\tcharOrCode = (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 48 && e.keyCode <= 57) || e.keyCode == keys.SPACE ? String.fromCharCode(e.keyCode) : e.keyCode;\n\t\t\t\t}\n\t\t\t\tif(!charOrCode){\n\t\t\t\t\tcharOrCode = 229; // IME\n\t\t\t\t}\n\t\t\t\tif(e.type == \"keypress\"){\n\t\t\t\t\tif(typeof charOrCode != \"string\"){\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif((charOrCode >= 'a' && charOrCode <= 'z') || (charOrCode >= 'A' && charOrCode <= 'Z') || (charOrCode >= '0' && charOrCode <= '9') || (charOrCode === ' ')){\n\t\t\t\t\t\tif(e.ctrlKey || e.metaKey || e.altKey){\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} // can only be stopped reliably in keydown\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// create fake event to set charOrCode and to know if preventDefault() was called\n\t\t\t\tvar faux = { faux: true }, attr;\n\t\t\t\tfor(attr in e){\n\t\t\t\t\tif(!/^(layer[XY]|returnValue|keyLocation)$/.test(attr)){ // prevent WebKit warnings\n\t\t\t\t\t\tvar v = e[attr];\n\t\t\t\t\t\tif(typeof v != \"function\" && typeof v != \"undefined\"){\n\t\t\t\t\t\t\tfaux[attr] = v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlang.mixin(faux, {\n\t\t\t\t\tcharOrCode: charOrCode,\n\t\t\t\t\t_wasConsumed: false,\n\t\t\t\t\tpreventDefault: function(){\n\t\t\t\t\t\tfaux._wasConsumed = true;\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t},\n\t\t\t\t\tstopPropagation: function(){\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tthis._lastInputProducingEvent = faux;\n\n\t\t\t\t// Give web page author a chance to consume the event. Note that onInput() may be called multiple times\n\t\t\t\t// for same keystroke: once for keypress event and once for input event.\n\t\t\t\t//console.log(faux.type + ', charOrCode = (' + (typeof charOrCode) + ') ' + charOrCode + ', ctrl ' + !!faux.ctrlKey + ', alt ' + !!faux.altKey + ', meta ' + !!faux.metaKey + ', shift ' + !!faux.shiftKey);\n\t\t\t\tif(this.onInput(faux) === false){ // return false means stop\n\t\t\t\t\tfaux.preventDefault();\n\t\t\t\t\tfaux.stopPropagation();\n\t\t\t\t}\n\t\t\t\tif(faux._wasConsumed){\n\t\t\t\t\treturn;\n\t\t\t\t} // if preventDefault was called\n\n\t\t\t\t// IE8 doesn't emit the \"input\" event at all, and IE9 doesn't emit it for backspace, delete, cut, etc.\n\t\t\t\t// Since the code below (and perhaps user code) depends on that event, emit it synthetically.\n\t\t\t\t// See http://benalpert.com/2013/06/18/a-near-perfect-oninput-shim-for-ie-8-and-9.html.\n\t\t\t\tif(has(\"ie\") <= 9){\n\t\t\t\t\tswitch(e.keyCode){\n\t\t\t\t\tcase keys.TAB:\n\t\t\t\t\tcase keys.ESCAPE:\n\t\t\t\t\tcase keys.DOWN_ARROW:\n\t\t\t\t\tcase keys.UP_ARROW:\n\t\t\t\t\tcase keys.LEFT_ARROW:\n\t\t\t\t\tcase keys.RIGHT_ARROW:\n\t\t\t\t\t\t// These keys may alter the <input>'s value indirectly, but we don't want to emit an \"input\"\n\t\t\t\t\t\t// event. For example, the up/down arrows in TimeTextBox or ComboBox will cause the next\n\t\t\t\t\t\t// dropdown item's value to be copied to the <input>.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif(e.keyCode == keys.ENTER && this.textbox.tagName.toLowerCase() != \"textarea\"){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.defer(function(){\n\t\t\t\t\t\t\tif(this.textbox.value !== this._lastInputEventValue){\n\t\t\t\t\t\t\t\ton.emit(this.textbox, \"input\", {bubbles: true});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "59dede349179f18a8d76e40a06aed525", "score": "0.5523951", "text": "function vt(e,t){if(e===md||e===Vf||e===Lf)\n// On the selectionchange event, the target is just document which isn't\n// helpful for us so just check activeElement instead.\n//\n// 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n// propertychange on the first input event after setting `value` from a\n// script and fires only keydown, keypress, keyup. Catching keyup usually\n// gets it and catching keydown lets us fire an event for the first\n// keystroke if user does a key repeat (it'll be a little delayed: right\n// before the second keystroke). Other input methods (e.g., paste) seem to\n// fire selectionchange normally.\nreturn st(gh)}", "title": "" }, { "docid": "5d4ea436ce2397936b20aa28054fd65f", "score": "0.5515219", "text": "function DHCWeb_LookUpItemTransKeyPress(e)\r\n{\r\n\tif(!e){\r\n\t\tvar e = event?event:(window.event?window.event:null);\r\n\t}\r\n\tvar type=websys_getType(e);\r\n\tvar key=websys_getKey(e);\r\n\t///alert(type+ \" \"+key);\r\n\t///evtName\r\n\tif ((type=='keypress')&&(key==13)){\r\n\t\tvar eSrc=window.event.srcElement;\r\n\t\tvar myobj=document.getElementById(eSrc.name);\r\n\t\tif ((myobj)&&(myobj.onkeydown)) {\r\n\t\t\tvar myNewEvent=document.createEventObject();\r\n\t\t\tmyNewEvent.keyCode = 117;\r\n\t\t\tmyobj.fireEvent(\"onkeydown\",myNewEvent);\r\n\t\t\tevent.cancleBubble=true;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "e1bbefead0f9af032e818baf42379fd4", "score": "0.5512959", "text": "function keypress_handler(event) {\n console.log(\"Keyboard button pressed\", event.keyCode); \n}", "title": "" }, { "docid": "599eff660906dde253245d843c8d7888", "score": "0.5510101", "text": "function entierKeyPress(field, evt) {\r\n\r\n return numericKeyPress(false, false, false, field, evt); \r\n}", "title": "" }, { "docid": "3d8e57ac501e8901fcf41b0c640388b6", "score": "0.5500903", "text": "function sendKeyEvent(aTarget, aCharCode, aKeyCode, aHasShift) {\n var doc = aTarget.ownerDocument;\n var win = doc.defaultView;\n\n var event = makeKeyEvent(doc, \"keydown\", 0, aKeyCode, aHasShift);\n var accepted = aTarget.dispatchEvent(event);\n\n // Preventing the default keydown action also prevents the default\n // keypress action.\n if (aCharCode) {\n event = makeKeyEvent(doc, \"keypress\", aCharCode, 0, aHasShift);\n } else {\n event = makeKeyEvent(doc, \"keypress\", 0, aKeyCode, aHasShift);\n }\n if (!accepted) {\n event.preventDefault();\n }\n accepted = aTarget.dispatchEvent(event);\n\n // Always send keyup\n event = makeKeyEvent(doc, \"keyup\", 0, aKeyCode, aHasShift);\n aTarget.dispatchEvent(event);\n return accepted;\n}", "title": "" }, { "docid": "d408d88a107ee86a47e763e3239e29ec", "score": "0.54954666", "text": "function addEventKeyboard() {\n\taddEventBrowser(document,\"keydown\", function(e) {\n\t\t//Ponemos en true la tecla que presionamos\n\t\tkeyboard[e.keyCode] = true;\n\t});\n\taddEventBrowser(document,\"keyup\", function(e) {\n\t\t//Ponemos en false la tecla que dejo de ser presionada\n\t\tkeyboard[e.keyCode] = false;\n\t});\n\tfunction addEventBrowser(element,eventName,func) {\n\t\tif(element.addEventListener) {\n\t\t\t//Evento para los demas Navegadores\n\t\t\telement.addEventListener(eventName,func,false); \n\t\t} else if(element.attachEvent) {\n\t\t\t//Evento solo para navegador Explorer\n\t\t\telement.attachEvent(eventName,func);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e4077a73283edd51ef59c5fcbdefee7", "score": "0.54913366", "text": "function init() {\n console.log('KeyControls init');\n $(window).on('keyup', testKeyEvent);\n}", "title": "" }, { "docid": "e8c39b6c5b919099b98dd153ed71f7c2", "score": "0.5488755", "text": "function onTextKeyUp(e) {\n\t\tif (!e.altKey) {\n\t\t\tif (!e.ctrlKey && (\te.keyCode == 37 ||\t//Arrow keys\n\t\t\t\t\t\t\t\te.keyCode == 38 ||\n\t\t\t\t\t\t\t\te.keyCode == 39 ||\n\t\t\t\t\t\t\t\te.keyCode == 40 ||\n\t\t\t\t\t\t\t\te.keyCode == 36 ||\t// Home key\n\t\t\t\t\t\t\t\te.keyCode == 35)) {\t// End key\n\n\t\t\t\tme.updateLineCachedHighlight();\n\n\t\t\t\t// Force a scroll for home and end AFTER key press...\n\t\t\t\tif (e.keyCode == 36 || e.keyCode == 35) {\n\t\t\t\t\t//checkScroll();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!e.ctrlKey && e.keyCode == 8 && me.intextarea.value == \"\") {\n\t\t\t\t\t//me.removeStatement();\n\t\t\t\t} else {\n\t\t\t\t\tme.rebuild();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5ef480ec3debcc65703b0ccf6ed4fb07", "score": "0.5485157", "text": "onKeyDown(event) {\n // Don't steal input events from their real targets\n const nodeName = event.target.nodeName;\n if(nodeName === 'INPUT' || nodeName === 'TEXTAREA' || nodeName === 'SELECT') {\n return;\n }\n\n const key = keyCodes[event.keyCode] || String.fromCharCode(event.keyCode);\n switch(key) {\n // Keyboard tree traversal\n case 'UPARROW':\n case 'W':\n this.moveSelectionUp();\n break;\n case 'DOWNARROW':\n case 'S':\n this.moveSelectionDown();\n break;\n case 'LEFTARROW':\n case 'A':\n this.moveSelectionLeft();\n break;\n case 'RIGHTARROW':\n case 'D':\n this.moveSelectionRight();\n break;\n }\n }", "title": "" }, { "docid": "94aca2f4f579f831435389c2192b03b4", "score": "0.5479754", "text": "function keyPressHandler(evt) {\n evt = evt || window.event;\n if (evt) {\n var keyCode = evt.charCode || evt.keyCode;\n charLogged = String.fromCharCode(keyCode);\n stream.push(charLogged);\n }\n }", "title": "" }, { "docid": "75239c594dde4540b3c8e5b2860afd46", "score": "0.54764193", "text": "function fakeKey(event, chr, createKeyUp) {\n\t\tconst util = ZombieKeys.Util;\n\t\ttry {\n\t\t\tlet isDebug = ZombieKeys.Preferences.isDebugOption('fakeKey');\n\t\t\tif (isDebug) {\n\t\t\t\tZombieKeys.logKey(\"fakeKey: ('\" + chr + \"' \" + event.type + \")\", event);\n\t\t\t\tif (event.type=='keypress')\n\t\t\t\t\tZombieKeys.LastAliveKeyDown = chr; // remember keyPress\n\t\t\t\telse {\n\t\t\t\t\tif (chr==ZombieKeys.LastAliveKeyDown) { // avoid duplication on keyup!\n\t\t\t\t\t\tZombieKeys.LastAliveKeyDown = null;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tZombieKeys.LastAliveKeyDown = null;\n\t\t\t\t}\n\t\t\t\tdebugger;\n\t\t\t}\n\n\t\t\t// var view = window; // event.view;\n\t\t\tlet target = event.originalTarget ? event.originalTarget : (event.target ? event.target : document.commandDispatcher.focusedElement);\n\n\t\t\tif (ZombieKeys.Preferences.isPreference('subComma')) {\n\t\t\t\tswitch (chr) {\n\t\t\t\t\tcase \"\\u015e\": // S-cedilla\n\t\t\t\t\t\tchr = \"\\u0218\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"\\u015f\": // s-cedilla\n\t\t\t\t\t\tchr = \"\\u0219\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"\\u0162\": // T-cedilla\n\t\t\t\t\t\tchr = \"\\u021a\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"\\u0163\": // t-cedilla\n\t\t\t\t\t\tchr = \"\\u021b\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"\\u1e10\": // D-cedilla - does not exist in Unicode\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"\\u1e11\": // d-cedilla - does not exist in Unicode\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// compose window or elements that do not expose selection (e.g. gmail compose area)\n\t\t\tif (target.nodeName==\"HTML\" ||\n\t\t\t\tnull==target.selectionStart ||\n\t\t\t\tisNaN(target.selectionStart)\n\t\t\t\t) {\n\n\t\t\t\t// PRESS\n\t\t\t\tlet keypress_event = document.createEvent(\"KeyboardEvent\"), // KeyEvents\n\t\t\t\t eventView = (event.view) ? event.view : keypress_event.view; // make xbl compatible (?)\n\t\t\t\tif (util.Application=='Postbox' && util.AppVersion>=5.0) {\n\t\t\t\t\t// Postbox 5.0\n\t\t\t\t // nsDOMKeyboardEvent::InitKeyEvent - got an additional character.\n\t\t\t\t\tkeypress_event.initKeyEvent(\"keypress\", true, true, eventView,\n\t\t\t\t\t\t\t\t\t false, false, false, false, false, // ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, aIsRepeat\n\t\t\t\t\t\t\t\t\t 0, chr.charCodeAt(0)); \n\t\t\t\t\t\n\t\t\t\t}\n else {\n\t\t\t\t\tkeypress_event.initKeyEvent(\"keypress\", true, true, eventView,\n\t\t\t\t\t\t\t\t\t false, false, false, false, // ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, \n\t\t\t\t\t\t\t\t\t 0, chr.charCodeAt(0));\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\t \n\t\t\t\tutil.logDebugOptional(\"fakeKey\", (\"faking '\" + chr + \"': \" + keypress_event.type + \" + target: \" + target.id + \"\\n---\"));\n\t\t\t\ttarget.dispatchEvent(keypress_event);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tZombieKeys.insertAtCaret(target, chr);\n\t\t\t}\n\t\t\t// \"keypress\" or \"keyup\"\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t}\n\t\tcatch(ex) {\n\t\t\tutil.logToConsole(\"exception during fakekey: \" + ex.toString());\n\t\t}\n\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54749864", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "8c5a190db3afac60494a52e469cf2fe6", "score": "0.54720926", "text": "function findApp_butt(event) {\n simulateEvent(event.target.previousSibling, 'keyup');\n}", "title": "" }, { "docid": "941a119f863f47cea4322feb566de718", "score": "0.54700613", "text": "function _keyboard_action(objEvent) {\n\t\t\t// To ie\n\t\t\tif ( objEvent == null ) {\n\t\t\t\tkeycode = event.keyCode;\n\t\t\t\tescapeKey = 27;\n\t\t\t// To Mozilla\n\t\t\t} else {\n\t\t\t\tkeycode = objEvent.keyCode;\n\t\t\t\tescapeKey = objEvent.DOM_VK_ESCAPE;\n\t\t\t}\n\t\t\t// Get the key in lower case form\n\t\t\tkey = String.fromCharCode(keycode).toLowerCase();\n\t\t\t// Verify the keys to close the ligthBox\n\t\t\tif ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {\n\t\t\t\t_finish();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d3989cb8587997f203040afa22a9a7af", "score": "0.5467252", "text": "setUserText(text) {\n this.textHolderDOM().innerText = text\n this.onInput() // ~~ call handler manually\n }", "title": "" }, { "docid": "f09623cd14305ef17f877d8489e9bda1", "score": "0.546319", "text": "function textAreaEvent (eventText) {\n\n var textField = $(eventText);\n return textField.val();\n\n}", "title": "" } ]
b9b4da7ba3a772461e077697734d0a4c
Sign the account in and add it from the redux storage
[ { "docid": "28e782b2d00729d6348b5390b703033c", "score": "0.0", "text": "handleSignIn() {\n const provider = new firebase.auth.GoogleAuthProvider();\n firebase.auth().signInWithPopup(provider)\n .then((result) => {\n const { subscribeAccount } = this.props;\n const {\n user: {\n email = ''\n } = {}\n } = result;\n\n if (email.length) {\n subscribeAccount(email);\n }\n })\n .catch(() => {});\n }", "title": "" } ]
[ { "docid": "84eb8e232af685a51757a009899da670", "score": "0.741852", "text": "signIn () {\n let credentials = this.getLocalStorage().getItem('credentials')\n\n if (credentials) {\n user.logIn(JSON.parse(credentials)).then(({ data }) => {\n if (data && data._id) {\n store.dispatch(userActions.signIn(data))\n }\n })\n }\n }", "title": "" }, { "docid": "4c93c7100037782d1a0b1cfaba2507f4", "score": "0.67345285", "text": "async function signIn() {\n const { username, password } = reducerState\n try {\n const user = await Auth.signIn({ username, password })\n dispatch({\n type: 'SET_USER',\n user: user,\n })\n console.log('user successfully logged in!')\n } catch (err) {\n console.log(err, ' in errore')\n dispatch({\n type: 'ERROR_AUTH',\n error: err,\n })\n }\n }", "title": "" }, { "docid": "254e49f2cf3c1502c03315a88f04fab9", "score": "0.65636325", "text": "async signIn(\n { state, commit, dispatch },\n { localKeyPairName, address, sessionType = `ledger` }\n ) {\n let accountAddress\n switch (sessionType) {\n case `ledger`:\n case `explore`:\n accountAddress = address\n break\n default:\n // local keyStore\n state.localKeyPairName = localKeyPairName\n accountAddress = await getLocalAddress(state, localKeyPairName)\n }\n commit(`setSignIn`, true)\n commit(`setSessionType`, sessionType)\n commit(`setUserAddress`, accountAddress)\n await dispatch(`loadPersistedState`)\n commit(`toggleSessionModal`, false)\n await dispatch(`initializeWallet`, { address: accountAddress })\n dispatch(`persistSession`, {\n localKeyPairName,\n address: accountAddress,\n sessionType\n })\n\n state.externals.track(`event`, `session`, `sign-in`, sessionType)\n }", "title": "" }, { "docid": "a5541f038afbbfb5d3b5327a47d9918f", "score": "0.6487134", "text": "userSignIn({ dispatch, commit }, { email, password }) {\n // eslint-disable-next-line\n console.log(\"actions:userSignIn\");\n auth\n .signInWithEmailAndPassword(email, password)\n .then(cred => {\n commit(\"setCurrentUser\", cred.user); //uid\n commit(\"setIsAuthenticated\", true);\n dispatch(\"getUserProfile\");\n dispatch(\"getHunts\");\n router.push(\"/showhunts\");\n // eslint-disable-next-line\n console.log(\"Signed in:\", cred.user, cred.user.email);\n })\n .catch(err => {\n // eslint-disable-next-line\n console.log(\"Sign In error\", err);\n });\n }", "title": "" }, { "docid": "a6528989bf92ffa9b5293c2f1aa99c5f", "score": "0.6462615", "text": "handleSignIn(e) {\n\t\te.preventDefault()\n\t\tlet email = this.refs.email.value\n\t\tlet password = this.refs.password.value\n\t\tfirebaseApp.auth().signInWithEmailAndPassword(email,password).then(response=>{\n\t\t\tlet tokenKey = \"logged\";\n\t\t\t\t\tlet tokenValue = true;\n\t\t\t\t\twindow.localStorage.setItem(tokenKey, JSON.stringify(tokenValue));\n\t\t\t\t\tthis.props.history.push('/');\n\t\t})\n\t\t.catch(error => {\n\t\t\tthis.setState({error})\n\t\t\tlet tokenKey = \"logged\";\n\t\t\tlet tokenValue = false;\n\t\t\twindow.localStorage.setItem(tokenKey, JSON.stringify(tokenValue));\n\t\t\talert(error);\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "aa2b704a51f7afe6c85133de7d54bd91", "score": "0.6431968", "text": "loginSubmit() {\n\t\tvar self = this;\n\t\tif(!self.state.email || !self.state.password){\n\t\t\tAlert.alert('Please fill in your email and password!');\n\t\t\treturn;\n\t\t}\n\t\tself.props.addUser(self.state.email, self.state.password)\n\t\t.then(() => {\n\t\t\tif(JSON.stringify(self.props.user) === '{}' ){\n\t\t\t\tAlert.alert('Username or Password is incorrect. Please try again!');\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\treturn AsyncStorage.setItem('user', JSON.stringify(self.props.user))\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.props.navigation.navigate('AllScreen');\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t\t.catch((err) => {\n\t\t\tAlert.alert(err.message);\n\t\t\tconsole.log('Error logging in :', err);\n\t\t});\n\t}", "title": "" }, { "docid": "44d72cccef17d03a4f2e14766b91a76a", "score": "0.63723934", "text": "function store() {\n localStorage.setItem('signUpUser', signUpUser.value);\n localStorage.setItem('signUpPassword', signUpPassword.value);\n}", "title": "" }, { "docid": "081df97a99daa6f9e2d334b9a44ad51a", "score": "0.63479215", "text": "function login() {\n //calling the auth0 signin method\n //profile is going to come back from auth0 and its going to be JSON object which contains the user profile detail\n //name, email and avatar url\n //token is the JWT user web token when user sign in\n //Then will set these item in local storage\n auth.signin({}, function(profile, token) {\n //when we have successful login I wanna set to local storage\n store.set('profile', profile);\n store.set('id_token', token);\n //if these are successful I want the user to redirect to the home page\n $location.path('/home');\n }, function (error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "89d6f9cb0bd4693722c68f494a923cda", "score": "0.6312838", "text": "function makeAccount(username, password){\n if(username === '' || password === '') return;\n let ref = database.ref('Accounts');\n let account = {\n username : username,\n password : password,\n accountType : \"user\" \n }\n //accountType is default user, only people with access to\n //firebase can change a user's account level\n\n ref.push(account);\n //add the user to sessionStorage and link to index\n activeUser = new User(username, password);\n sessionStorage.setItem(\"user\", JSON.stringify(activeUser));\n window.location.href=\"index.html\";\n}", "title": "" }, { "docid": "9b947c6b0e4245f9387e086b18904970", "score": "0.6288378", "text": "signUserIn({ commit }, payload) {\n commit('setLoading', true)\n commit('clearError')\n Firebase.auth().signInWithEmailAndPassword(payload.Email, payload.Password)\n .then(\n user => {\n commit('setLoading', false)\n const newUser = {\n id: user.user.uid,\n email: user.user.email,\n Nome: user.user.displayName\n }\n commit('setUser', newUser)\n localStorage.setItem('token', newUser)\n }\n )\n .catch(error => {\n commit('setError', 'Não foi possível concluir requerimento de acesso. Favor verificar suas credenciais ou se há conexão com a internet.')\n commit('setLoading', false)\n })\n }", "title": "" }, { "docid": "c727f2cc98c4e0bb55442621f2069cd7", "score": "0.6253552", "text": "async handleLogin({\n commit,\n // state\n }, payLoad) {\n commit('SET_LOADING', true);\n setTimeout(() => {\n commit('SET_LOADING', false);\n }, 500)\n try {\n let res = await axios.post(`${firebase_API.API_AUTH}:signInWithPassword?key=${firebase_API.API_KEY}`, payLoad.data)\n let checkLogin = {\n idToken: res.data.idToken,\n localId: res.data.localId,\n email: res.data.email,\n };\n const db = firebase.firestore();\n db.collection(\"user\").add({\n token: payLoad.token,\n idCoachLogin: res.data.localId,\n });\n commit('SET_TOKEN_ID', checkLogin);\n localStorage.setItem(\"checkLogin\", JSON.stringify(checkLogin));\n return true;\n } catch (err) {\n console.log(err);\n return false;\n }\n }", "title": "" }, { "docid": "d1b33945b939e89b68ddfc3fcc34b499", "score": "0.6251756", "text": "async signIn(context, payload) {\n console.log(payload);\n\n return new Promise(async (resolve, reject) => {\n try {\n let result = await axios.post(URLS.URLS.signin, {\n credentials: payload.credentials\n })\n\n if (result.data.auth) {\n await context.commit('setCurrentUser', {\n user: result.data.user\n })\n await window.localStorage.setItem('jwt', result.data.token)\n }\n resolve(result)\n\n } catch (error) {\n reject(error)\n }\n })\n }", "title": "" }, { "docid": "049df7dcbf2149353cbb44129b7eaad4", "score": "0.6216466", "text": "function singIn() {\r\n let email = document.getElementById(\"email\").value,\r\n p = document.getElementById(\"password\").value;\r\n var account = JSON.parse(localStorage.getItem(email));\r\n if (account.email == email && account.password == p) {\r\n localStorage.setItem(\"ACTIVE\", JSON.stringify(account));\r\n window.location.href = \"home.html\";\r\n } else {\r\n alert(\"Usuario Invalido\");\r\n }\r\n}", "title": "" }, { "docid": "d34e3f5f769538a02ed67a22715023ed", "score": "0.6191135", "text": "function loggedIn() {\n dispatch({ type: 'LOGGED_IN', login: true });\n }", "title": "" }, { "docid": "266659897dbe61235835f35f96886edc", "score": "0.61858094", "text": "function login() {\n return new Promise(async (resolve, reject) => {\n const web3 = store.getState().web3.instance\n const { authentication, account } = store.getState().paperchain\n try {\n const result = await authentication.login.call({from: account})\n const payload = { type: USER_LOGGED_IN, data: { name: web3.toUtf8(result[0]), field: result[1].toNumber()}}\n resolve(store.dispatch(payload))\n } catch (error) {\n reject(error)\n }\n })\n}", "title": "" }, { "docid": "eb9f7b425ec5e7bf0628f5cb2df7cacf", "score": "0.61806345", "text": "_login(username, password) {\n API.login({ username, password }).then((res,err) => {\n if (res.data.error) {\n console.log(res.data.error)\n }\n if (res.data.loggedIn) {\n var tutor = {\n username: res.data.user.username,\n id: res.data.user._id,\n loggedIn: Date.now(),\n expiresAt: Date.now() + 1200000\n }\n localStorage.setItem(\"tutor\", JSON.stringify(tutor))\n // update the state\n const data = localStorage.getItem(\"tutor\");\n if (data) {\n this.setState({\n loggedIn: res.data.loggedIn,\n tutor: res.data.user,\n redirectTo: res.data.user.contract ? \"Tutors\" : \"Tutors/account\"\n });\n }\n } \n })\n }", "title": "" }, { "docid": "637505e5862e77c3a0db7f4178fca0bf", "score": "0.6166875", "text": "function startSignIn() {\n // document.getElementById('signInButton').disabled = true;\n console.log(\"StartSignIn\");\n // if (firebase.auth().currentUser) {\n // firebase.auth().signOut();\n // localStorage.setItem('name', null);\n // localStorage.setItem('newName', null);\n // localStorage.setItem('uid', null);\n // } else {\n // startAuth(true);\n // }\n startAuth(true);\n}", "title": "" }, { "docid": "0a6dc3842362f37d9a7113e82f092fc2", "score": "0.61443275", "text": "SignIn(email, password) {\n return this.afAuth.auth.signInWithEmailAndPassword(email, password)\n .then((result) => {\n let dp = result.user.displayName;\n if (!dp || dp == \"\") {\n dp = email;\n }\n this.updateOnDisconnect(result.user.uid, dp);\n this.updateOnDisconnect(result.user.uid, dp);\n this.updateUserData({\n uid: result.user.uid,\n email: email,\n displayName: dp,\n photoURL: ''\n });\n const status = 'online';\n this.setUserData(email, dp, status, result.user.uid);\n this.authState = result;\n this.router.navigate(['app']);\n this.store.dispatch(new _auth_actions__WEBPACK_IMPORTED_MODULE_8__[\"Authenticated\"](new _user_model__WEBPACK_IMPORTED_MODULE_2__[\"User\"](result.user.uid, result.user.displayName, email)));\n //this.router.navigate(['logoBattle']);\n }).catch((error) => {\n window.alert(error.message);\n });\n }", "title": "" }, { "docid": "6b7033df7d6bc102ab99d97625a54cba", "score": "0.6132808", "text": "async function signin(formData, history) {\n try {\n const { data } = await api.signin(formData);\n\n dispatch({ type: AUTH, payload: data });\n\n history.push(\"/\");\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "3fd9658b834f0fe95da7d68dce3ee340", "score": "0.6131629", "text": "signIn ({commit, dispatch}, payload) {\n commit('setLoading', true, {root: true})\n firebase.auth().signInWithEmailAndPassword(payload.email, payload.password)\n .then(\n response => {\n commit('setLoading', false, {root: true})\n // auth state has changed, so listener will be fired from main.js,\n // to fetch user data\n })\n .catch(\n error => {\n commit('setLoading', false, {root: true})\n commit('setError', error, {root: true})\n }\n )\n }", "title": "" }, { "docid": "0947d24fb52524f86506402ca2e9ef2d", "score": "0.6107094", "text": "async function signIn() {\n const googleAuth = gapi.auth2.getAuthInstance();\n const authResult = await googleAuth.signIn();\n\n if (googleAuth.isSignedIn.get()) {\n const idToken = authResult.getAuthResponse().id_token;\n setCookie('id_token', idToken);\n await fetch('/add-user', {method: 'POST'});\n window.location.href = 'home-page.html';\n }\n}", "title": "" }, { "docid": "d49b9088e1b90b13b2c5d58b726e4ac5", "score": "0.6106094", "text": "componentWillMount() {\n try {\n const user = JSON.parse(localStorage.getItem('authUser'));\n\n store.dispatch({\n type: 'SIGN_IN_USER',\n authUser: user\n });\n } catch (error) {\n console.log(error);\n return;\n }\n }", "title": "" }, { "docid": "bdd488e6f3c8d5953f7b4abc4a972376", "score": "0.6103928", "text": "async signIn(username, password) {\n let user = null;\n const body = {\n emailAddress: username,\n password: password\n };\n try {\n const result = await axios.post(\"/api/login\", body);\n localStorage.setItem(\"uuid\", result.data);\n user = await axios.get(\"/api/login\", { params: { uuid: result.data } });\n } catch (error) {\n console.log(error.response.data);\n }\n if (user) {\n this.context.setUser(user.data);\n this.props.history.push(\"/userprofile\");\n }\n }", "title": "" }, { "docid": "36c99cd486bc0bc9f33d4f832de6f205", "score": "0.6100897", "text": "function signIn(){\n\n }", "title": "" }, { "docid": "7a23384b34ddad0d7d02eeaad6336956", "score": "0.6100452", "text": "signUp({ commit, dispatch }, userData) {\n const authData = { email: userData.email, password: userData.password, returnSecureToken: true };\n\n axiosInstance.post('/accounts:signUp?key=AIzaSyCOMzxMfs0gbqbsG6lq5BBawxrvaq457HI', authData)\n .then(res => {\n console.log(res);\n commit('authUser', { token: res.data.idToken, userId: res.data.localId });\n\n localStorage.setItem('userId', res.data.localId);\n localStorage.setItem('token', res.data.idToken);\n\n // let's store the date when we signUp (expiresIn contains 3600s, not a date. We need to calculate a date).\n let now = new Date();\n const signUpDate = new Date(now.getTime() + res.data.expiresIn * 1000);\n localStorage.setItem('expirationDate', signUpDate);\n\n // save new user for dashboard\n dispatch('storeUser', userData);\n // set Autologout with timer (depends on token expiration time, 3600 by default from firebase)\n dispatch('setLogoutTimer', res.data.expiresIn);\n })\n .catch(error => console.log(error));\n }", "title": "" }, { "docid": "d6676526d609061e8a311adfbbfc397e", "score": "0.6092461", "text": "onSignUpClick(username, password) {\n //1. Register with Firebase\n //2. Send Confirmation \n this.props.authstore.signUp(username, password).then((userData) => {\n\n goToLogin();\n }\n ).catch((error) => {\n this.setState({error: error.message});\n }\n );\n }", "title": "" }, { "docid": "6e5ab849b3ba2bb91108d765a93b446f", "score": "0.60854644", "text": "onSuccess() {\n let basicProfile = window.gapi.auth2\n .getAuthInstance()\n .currentUser.get()\n .getBasicProfile();\n localStorage.setItem(\"signedIn\", true);\n this.setState(\n {\n isSignedIn: true,\n err: null,\n userId: basicProfile.getId(),\n profileName: basicProfile.getName(),\n profileEmail: basicProfile.getEmail(),\n profilePhotoURL: basicProfile.getImageUrl()\n },\n () => {\n this.validateAndPostProfileData(basicProfile);\n }\n );\n }", "title": "" }, { "docid": "4cd1716f24eb902900e61e51b470e01b", "score": "0.60608363", "text": "onSuccessfulLogIn(a) {\n this.alertInfo('Youre logged in!');\n console.log(a);\n this.setState({\n disabled: '',\n currentUser: a.id,\n buttonText: 'My Account',\n login: {\n username: '',\n password: '',\n loggedIn: true,\n },\n });\n this.getUserInfo(this.state.currentUser);\n }", "title": "" }, { "docid": "77118515499fe3c0dbd860d975f4ed8f", "score": "0.6059138", "text": "saveUserLogin(){\n let token = jwt.decode(sessionStorage.getItem(\"token\"));\n sessionStorage.setItem(\"userType\",token.identity[1]);\n sessionStorage.setItem(\"user\",token.identity[0]);\n }", "title": "" }, { "docid": "01796639900ad6b999fae4ed8de3c5a7", "score": "0.6017595", "text": "function initalizeAccounts(){\n localStorage.setItem('accounts', JSON.stringify({}))\n}", "title": "" }, { "docid": "91982762f42dc1931d9558de141aae71", "score": "0.6012282", "text": "function storeUser(authData) {\n $localStorage.local_user = authData;\n\n login(authData);\n }", "title": "" }, { "docid": "27b2bb4fdf4fef85554e78c5f1bb51f5", "score": "0.59933186", "text": "login({ commit, dispatch }, userData) {\n const authData = { email: userData.email, password: userData.password, returnSecureToken: true };\n\n axiosInstance.post('/accounts:signInWithPassword?key=AIzaSyCOMzxMfs0gbqbsG6lq5BBawxrvaq457HI', authData)\n .then(res => {\n console.log(res);\n commit('authUser', { token: res.data.idToken, userId: res.data.localId });\n\n localStorage.setItem('userId', res.data.localId);\n localStorage.setItem('token', res.data.idToken);\n\n let now = new Date();\n const loginDate = new Date(now.getTime() + res.data.expiresIn * 1000);\n localStorage.setItem('expirationDate', loginDate);\n\n // set Autologout with timer (depends on token expiration time, 3600 by default from firebase)\n dispatch('setLogoutTimer', res.data.expiresIn);\n })\n .catch(error => console.log(error));\n }", "title": "" }, { "docid": "0701e07be817f3c816f00b7c563304ad", "score": "0.5978803", "text": "login(e) {\r\n e.preventDefault();\r\n\r\n fireDB.auth().signInWithEmailAndPassword(this.state.email, this.state.password).then((u) => {\r\n this.props.getDataItems();\r\n }).catch((e) => {\r\n this.showError(e);\r\n });\r\n }", "title": "" }, { "docid": "680bfb22aeb66f79df38aa7278d6b64f", "score": "0.5978294", "text": "async onLogin(login) {\n let store = new Store(login);\n await store.init();\n this.setState({ store, login })\n }", "title": "" }, { "docid": "ad2200f183fe2b2b1a0566861ca5e454", "score": "0.59713346", "text": "function signUp() {\r\n\t\r\n const email = document.getElementById('sEmail').value;\r\n const pass = document.getElementById('sPassword').value;\r\n firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION);\r\n firebase.auth().createUserWithEmailAndPassword(email, pass).then(user => {\r\n user.getIdToken(true).then(idToken => {\r\n addUser().then(() => {\r\n sessionStorage.setItem('token', idToken);\r\n window.location = \"/\";\r\n });\r\n });\r\n }).catch(error => {\r\n\r\n });\r\n}", "title": "" }, { "docid": "84b2d868cdb7f5db8e515f20827b6a6f", "score": "0.5957241", "text": "function accountCreated(){\n window.location.href = \"/main-screen/signed-in-main.html\"\n\n const clinic = document.getElementById(\"clinic\").value;\n const familyName = document.getElementById(\"familyName\").value;\n const petsName = document.getElementById(\"petsName\").value;\n const policyNum = document.getElementById(\"policyNum\").value;\n const microchipNum = document.getElementById(\"microchipNum\").value;\n const tagId = document.getElementById(\"tagId\").value;\n\n localStorage.setItem(\"CLINIC\", clinic);\n localStorage.setItem(\"FAMILYNAME\", familyName);\n localStorage.setItem(\"PETSNAME\", petsName);\n localStorage.setItem(\"POLICYNUM\", policyNum);\n localStorage.setItem(\"MICROCHIPNUM\", microchipNum);\n localStorage.setItem(\"TAGID\", tagId);\n\n return;\n}", "title": "" }, { "docid": "358f255dca7f8a307bde76cd6b47f764", "score": "0.595663", "text": "loginuser({ commit }, payload) {\n return new Promise((resolve, reject) => {\n axios\n .post(\"/v1/users/login\", {\n email: payload.email,\n password: payload.password\n })\n .then(response => {\n //if the status code shows a successful request\n if (response.status == 200) {\n //store the user data in the store\n commit(\"setUserData\", response.data);\n //store if the user allows push notifications or not\n if (response.data.user.registraionToken == undefined) {\n localStorage.setItem(\"allowNotifications\", false);\n } else {\n localStorage.setItem(\"allowNotifications\", true);\n }\n //REMEMBER ME LOGIC\n //If the user choses to remember him store his data in the local storage\n if (payload.rm == true) {\n localStorage.setItem(\"userToken\", response.data.token);\n //store the frequently used user data\n localStorage.setItem(\"username\", response.data.user.name);\n localStorage.setItem(\"email\", response.data.user.email);\n localStorage.setItem(\"userID\", response.data.user._id);\n localStorage.setItem(\"type\", response.data.user.type);\n localStorage.setItem(\"imageUrl\", response.data.user.imageUrl);\n localStorage.setItem(\"premium\", response.data.user.premium);\n localStorage.setItem(\"authType\", \"symphonia\");\n }\n //If the user choses not to remember him store his data in the session Storage\n else {\n sessionStorage.setItem(\"userToken\", response.data.token);\n //store the frequently used user data\n sessionStorage.setItem(\"username\", response.data.user.name);\n sessionStorage.setItem(\"email\", response.data.user.email);\n sessionStorage.setItem(\"userID\", response.data.user._id);\n sessionStorage.setItem(\"type\", response.data.user.type);\n sessionStorage.setItem(\"imageUrl\", response.data.user.imageUrl);\n sessionStorage.setItem(\"premium\", response.data.user.premium);\n sessionStorage.setItem(\"authType\", \"symphonia\");\n }\n resolve(true);\n }\n })\n .catch(error => {\n reject(error.response.data);\n });\n });\n }", "title": "" }, { "docid": "99ff6bc04092b32e685ee95fe896f1f3", "score": "0.59507835", "text": "handleSubmit() {\n const { email, password, vegan, vegetarian, nut, dairy, seafood, gforeman, microwave, toaster } = this.state;\n Accounts.createUser({\n email, username: email,\n password,\n vegan,\n vegetarian,\n nut,\n dairy,\n seafood,\n gforeman,\n microwave,\n toaster,\n }, (err) => {\n if (err) {\n this.setState({ error: err.reason });\n } else {\n // browserHistory.push('/login');\n // to\n }\n });\n }", "title": "" }, { "docid": "285bc94bc29a2dffb1e469609e830bb8", "score": "0.59329027", "text": "function signup(credentials){\n axios.post('/auth/signup', credentials)\n .then(res => {\n const { user, token } = res.data\n localStorage.setItem('token', token)\n localStorage.setItem('user', JSON.stringify(user))\n setUserState(prevUserState => ({\n ...prevUserState,\n user, token\n }))\n })\n .catch(err => handleAuthErr(err.response.data.errMsg))\n }", "title": "" }, { "docid": "0ae9806deac79fb908ef6d2b61631d42", "score": "0.5932046", "text": "async signIn ({ dispatch }, credentials) {\n let response = await axios.post('users/login', credentials)\n return dispatch('attempt', response.data.message)\n }", "title": "" }, { "docid": "f53971a88ba8ef75962a32f56d18d55d", "score": "0.5930811", "text": "function signInUser(email,password) {\n const auth = getAuth()\n signInWithEmailAndPassword(auth,email,password)\n .then(result => {\n setUser(result.user)\n console.log(result.user)\n }) \n }", "title": "" }, { "docid": "6df1d68a37d218959d5eb740105aa07f", "score": "0.5918459", "text": "function saveUser() {\n // Referenciando a Database e a pasta onde está sendo adicionado os elementos\n firebase.auth().signInWithEmailAndPassword(document.getElementById('email').value, document.getElementById('senha').value)\n .then(() => {\n alert(\"Logado\")\n\n firebase.auth().onAuthStateChanged((user) => {\n sessionStorage.idLogado = user.uid\n window.location.href = \"index.html\";\n })\n })\n .catch(() => {\n alert(\"Ocorreu um Erro\")\n })\n}", "title": "" }, { "docid": "a93d31ee209b4ee03bd8fb7a9097a38f", "score": "0.59149355", "text": "signIn(email, password) {\n this.props.dispatch(loginUser({\n email,\n password\n }));\n sendEvent('signin page', 'signin', 'email');\n }", "title": "" }, { "docid": "b3275d79ba82f5c4f78eb6f0e66013e4", "score": "0.59020096", "text": "loginInUser(e) {\n e.preventDefault();\n\n // Get state values\n let email = this.state.email,\n password = this.state.password,\n _this = this;\n\n // Set authentication persistence\n auth().setPersistence(auth.Auth.Persistence.SESSION).then(function() {\n // Run login function in <App />\n _this.props.login(email, password);\n })\n .catch(function(error) {\n // Catch and alert any errors\n alert(error.message);\n });\n }", "title": "" }, { "docid": "6c3661855250746d9d75b06c9926dad1", "score": "0.59012663", "text": "logInUser (user) {\n auth.forceAuth();\n console.log(user);\n // store.dispatch({\n // type: USER_FIRSTNAME,\n // text: user.firstName\n // });\n store.dispatch({\n type: USER_LOGGED_IN,\n action: true,\n text: user.firstName\n });\n this.props.history.push(\"/menu\");\n }", "title": "" }, { "docid": "ff35d13df50ba4938554b8762006db4e", "score": "0.59012544", "text": "signedin ({ commit, dispatch }, user) {\n const uid = user.uid\n commit('SET_USER', user)\n commit('SET_ERROR',null)\n dispatch('userProfileModule/openDBChannel', { uid }, { root: true })\n // Explanation:\n // store.dispatch('userProfileModule/openDBChannel')\n // .catch(console.error)\n // or fetchAndAdd\n // or store.dispatch('userData/setUserId')\n // or store.dispatch('userData/setUserId', id)\n .then( () => { \n dispatch('userProfileModule/initIfNew', user, { root: true })\n })\n .then( () => { \n dispatch('testCollectionModule/openDBChannel', {}, { root: true })\n })\n //.then( () => {\n //console.log(\"SUCCESS signedIn from store.auth.js: \" + uid)\n //})\n .catch( (error) => {\n commit('SET_ERROR',error)\n commit('SET_USER', undefined)\n // An error happened after signing in\n //console.log(error);\n Vue.prototype.$dialog.error({\n text: 'Error after signing in: ' + error,\n title: 'Error',\n persistent: true\n })\n })\n }", "title": "" }, { "docid": "180d04646f2ace2e9a6561b52291596c", "score": "0.5891055", "text": "function store(){\n localStorage.setItem('usernameid',usernameid.value);\n localStorage.setItem('passwordid',passwordid.value);\n}", "title": "" }, { "docid": "b3c3ae1f8acc1a0387ab77150cc3a8c4", "score": "0.5886283", "text": "function Login() {\n const [state,dispatch]=useStateValue()\n const signIn=()=>{\n auth.signInWithPopup(provider)\n .then(result=>{\n dispatch({\n type: actionTypes.SET_USER,\n user: result.user,\n })\n }).catch((error)=>alert(error.message))\n }\n return (\n <div className='login'>\n <div className='login__logo'>\n <img src='https://vectr.com/koricha/b2Rqg7cQ5.svg?width=640&height=640&select=b2Rqg7cQ5page0&quality=1' alt=''/>\n </div>\n <div>\n <Button type='submit' onClick={signIn}>\n Sign in\n </Button>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "f755761b295ba244bb898168acc766c0", "score": "0.58587474", "text": "setCurrentUsername(state,payload){\n state.email = payload.email;\n state.userLoggedIn = payload.isLoggedIn;\n state.userLoggedIn = true;\n localStorage.setItem('email',payload.email);\n }", "title": "" }, { "docid": "3e4f50dab22804ecb002d313d59ad7a4", "score": "0.58577764", "text": "async function loginUser(){\n const timestamp = Date.now();\n const ts = account + timestamp; \n // -----------testing to modify\n //old way without ts\n // const keyChain = await keychain(window, 'requestSignBuffer', account, starWars, 'Posting');\n // end old way\n // new way using ts\n const keyChain = await keychain(window, 'requestSignBuffer', account, ts, 'Posting');\n // end new way\n // ------------end testing\n const {data, success, msg, cancel, notActive} = keyChain;\n console.log(data);\n if(success){ \n const dataUsername = data.username;\n postData(`${authEP}checkGatsbySig`, dataUsername, msg, ts)\n .then(data => {\n console.log(data);\n data.json()\n .then(response => {\n console.log(response);\n const { profile_PicURL, token, usertype, banned} = response;\n //testing to log into beechat after user was logged into JAB\n // logInBeeChat(timestamp,msg);\n // end testing\n\n // TODO -> Important\n // Get the settings under the > Setting table on MongoDB\n // btw we need to create that.\n // it will help us to: - set the chat as the user wants + other future options.\n //set all upcomming data.\n\n //testing react redux store\n dispatch(setValueOnProfile({ type: \"username\", value: dataUsername}));\n dispatch(setValueOnProfile({ type: \"logged\", value: true}));\n dispatch(setValueOnProfile({ type: \"usertype\", value: usertype}));\n dispatch(setValueOnProfile({ type: \"token\", value: token}));\n // end testing redux\n\n const profile = {\n profilePicUrl: encode(profile_PicURL),\n token: encode(token),\n logged: encode(true),\n logginIn: encode(false),\n username: encode(dataUsername),\n usertype: encode(usertype),\n loginmethod: encode('KCH'),\n banned: encode(banned),\n newmessages: encode(\"x1-f\"),\n authbee: encode(false),\n };\n const JSONprofile = JSON.stringify(profile);\n localStorage.setItem(\"_NoneOfYourBusiness\",JSONprofile);\n successfulLogin(account,timestamp,msg);\n if(banned){\n alert('You have been Banned. Please Contact the admins as you only have some limited features on Job A Board.!');\n }\n // setData();\n //From this point on, we can check:\n // - if token present on localStorage.\n // - ask for a check to see if it is valid sending it as requested var[x-access-token]\n // - ask for a check on important actions.\n })\n })\n .catch(error => {\n console.log('Error while logging to API.');\n console.log(error);\n setLogginIn(false);\n });\n //end back-end\n }else if(!cancel) {\n if(notActive) {\n alert('Please allow Keychain to access this website');\n setLogginIn(false);\n } else {\n setLogginIn(false);\n console.log(msg);\n console.log(keyChain);\n }\n }else if (cancel){\n //user cancelled so...\n setLogginIn(false);\n }\n }", "title": "" }, { "docid": "f40a1f222369cfc57bb6146dd5059e6b", "score": "0.5846515", "text": "function Login({setUser}) {\r\n\r\n const signIn = () => {\r\n auth.signInWithPopup(provider) /* what happened here is called 'promise' */\r\n .then ((result) => { /**see the result as a kind of a variable that saeves the user login detailsa */\r\n const newUser = {\r\n name: result.user.displayName,\r\n photo: result.user.photoURL,\r\n \r\n }\r\n // console.log(newUser)\r\n localStorage.setItem('user', JSON.stringify(newUser));/* using the local storage it has the parameter localstorge.setitem(myData , Data) where mydata is what the browser storage is going to idetify see it as a variable that will store the datas and then the data is the actual information that needs to be stringify else you can not see it as data.stringify at the browser backend but will show as mydata so therefore my data is seen as user and data is seen as setuser */\r\n setUser(newUser);\r\n }) \r\n .catch((error) =>{\r\n alert(error.message)\r\n })\r\n }\r\n\r\n return (\r\n <Container>\r\n <Content>\r\n <SlackImage src =\"http://assets.stickpng.com/images/5cb480cd5f1b6d3fbadece79.png\"/>\r\n <h1>Sign in Slack</h1>\r\n <SignInButton onClick = {() => signIn ()}>\r\n Sign in with google\r\n </SignInButton>\r\n </Content>\r\n </Container>\r\n )\r\n}", "title": "" }, { "docid": "5d13d0465fc792cc71d29d013a55fb25", "score": "0.5841858", "text": "signIn() {\n \n let {email, password} = this.state;\n let errors = '';\n\n if (email == '') {\n errors = \"Please enter in a valid email.\\n\";\n }\n\n if (password == '') {\n errors += \"Please enter in a valid password.\"\n }\n if (errors != '') {\n this.setState({result: errors});\n } else {\n\n fetch('http://www.appointshare.com/login.php', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n email: email,\n password: password\n })\n })\n .then((response) => response.json())\n .then((responseData) => {\n \n // console.log(responseData);\n if (responseData[0].status == 'success') {\n \n try {\n AsyncStorage.setItem('@uid:key', responseData[0].id);\n } catch (error) {\n console.log(error);\n }\n\n this.replaceRoute('home');\n \n } else {\n this.setState({result: 'Email or Password is incorrect'});\n // var _navigator; // If applicable, declare a variable for accessing your navigator object to handle payload.\n\n\n }\n })\n .catch((error) => {\n console.warn(error);\n })\n .done();\n }\n\n }", "title": "" }, { "docid": "fd793d32a674cdfd0be050dd20f25a70", "score": "0.5838288", "text": "signIn() {\n this.setState({ loading: true });\n this.unregister = firebase.auth().signInWithEmailAndPassword(this.state.email, this.state.password)\n .then((firebaseUser) => {\n Cookie.save('user', firebaseUser.displayName);\n this.setState({ loading: false });\n }).catch((err) => {\n console.log(err);\n document.querySelector('#password_text').value = '';\n this.setState({ failed: true, loading: false, error: err.message });\n });\n }", "title": "" }, { "docid": "172f584dc94611767901908d79a6d4d8", "score": "0.5838093", "text": "login(e) {\n e.preventDefault();\n fire.auth().signInWithEmailAndPassword(this.state.email, this.state.password).then((u)=>{\n }).catch((error) => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "2fe73b27c025b0eeeae9e60b60dca4d3", "score": "0.5831517", "text": "authenticated (value) { window.localStorage.setItem('authenticated', value) }", "title": "" }, { "docid": "9b58cc827cbbe39c18816877d99d9e01", "score": "0.5829064", "text": "signIn() {\n const user = prompt('Please enter your name', 'Joe Shmoe');\n localStorage.setItem(this.currentUserKey, user);\n this.userJournal = localStorage.getItem(user);\n if (!this.userJournal) {\n this.userJournal = {\n currentQuestionIndex: 0,\n entries: []\n };\n localStorage.setItem(user, JSON.stringify(this.userJournal));\n } else {\n this.userJournal = JSON.parse(this.userJournal);\n }\n this.setState({\n user,\n question: this.getCurrentQuestion(),\n journalEntries: this.userJournal.entries\n });\n }", "title": "" }, { "docid": "e110662510d6840f9baa60d22d6fc749", "score": "0.58232725", "text": "onStoreUpdate() {\n this.store.authAccess.username = this.store.prefs.username;\n }", "title": "" }, { "docid": "2e522899569e789517ad2598332ef600", "score": "0.5822739", "text": "signIn() {\n this.props.form.validateFields((err, values) => {\n \n // Lorsqu'il n'y a pas d'erreur de saisie\n if (!err) {\n // on récupère notre authentification, \n // les valeurs des champs et une référence sur le router\n const auth = this.context\n const { email, password, remember } = values\n const history = this.props.routerHistory\n \n // on authentifie le user\n auth.connect(email, password, remember)\n .then(()=>{\n this.setState({ submitButtonLoading: false })\n message.success(\"Vous êtes maintenant connecté\")\n\n // on redirige ensuite le user soit sur la page d'acceuil, \n // soit sur la page précédente\n if (history.action === 'PUSH') {\n history.goBack()\n } else {\n history.push(HOME)\n }\n })\n .catch(error => {\n this.setState({ submitButtonLoading: false })\n switch(error.code) {\n case \"auth/user-not-found\":\n message.error(\"Aucun compte ne correspond à cet identifiant. Le compte a dû être supprimé\")\n break;\n case \"user-data-not-found\":\n message.error(\"Aucun compte ne correspond à cet identifiant. Le compte a dû être supprimé\")\n break;\n case \"auth/wrong-password\":\n message.error(\"Votre identifiant et/ou votre mot de passe sont incorrect\")\n break;\n default:\n message.error(\"Impossible de vous connecter. Réessayez plus tard\")\n }\n })\n }\n else{\n this.setState({ submitButtonLoading: false })\n }\n })\n }", "title": "" }, { "docid": "f8e44447c5e6cfad6cbce0cebad0100f", "score": "0.58186096", "text": "function handleLogin() {\n firebase.auth().signInWithEmailAndPassword(email, password)\n .then((userCredential) => {\n var user = userCredential.user;\n dispatch(setUser(user));\n dispatch(setLogIn());\n // setLogin(true);\n // navigation.navigate(\"Home\");\n })\n .catch((error) => {\n var errorCode = error.code;\n var errorMessage = error.message;\n console.log(errorCode, errorMessage);\n });\n }", "title": "" }, { "docid": "35465c5dafcfcbbcae20fb2885190323", "score": "0.58128595", "text": "login(context) {\n console.log(\"Login Action\");\n context.commit(\"setAuth\", { isAuth: true });\n }", "title": "" }, { "docid": "7e08fb1a01914be8956bb519ad42f149", "score": "0.58088756", "text": "signUp ({commit, dispatch}, payload) {\n commit('setLoading', true, {root: true})\n firebase.auth().createUserWithEmailAndPassword(payload.email, payload.password)\n .then(\n response => {\n commit('setLoading', false, {root: true})\n const user = {\n id: response.user.uid,\n email: response.user.email,\n userName: payload.userName,\n scenes: []\n }\n commit('updateUser', user, {root: true}) // set user locally\n dispatch('saveState', user) // save to fb\n })\n .catch(\n error => {\n commit('setLoading', false, {root: true})\n commit('setError', error, {root: true})\n }\n )\n }", "title": "" }, { "docid": "6c17e582da105e64a7d6e5c1a1392ba0", "score": "0.5797055", "text": "async signIn(context, credentials) {\n let result = ''; // Message renvoyé au front, qui sera affiché si c'est une erreur\n // Si on récupère bien un login et un mot de passe\n if (credentials.login && credentials.password) {\n const formCredentials = credentials;\n if (formCredentials.login.includes('@')) { // Si le login utilisé est un fait un email\n formCredentials.email = formCredentials.login; // on le réatribue\n delete formCredentials.login;\n }\n try {\n // On check sur l'api si les infos correspondent\n const response = await axios.post(`${axios.defaults.baseURL}auth/`, formCredentials);\n // Si on recoit bien un token, alors les infos correspondent\n if (response.data) {\n await axios.post(`${axios.defaults.baseURL}auth/login`, formCredentials).then((tokensList) => {\n const tokens = tokensList.data;\n // On update le state\n context.commit({\n type: 'sign',\n username: response.data.login,\n token: tokens.access_token,\n });\n // On renvoit un résultat positif\n result = { isSigned: true, token: tokens.access_token, username: response.data.login };\n return result;\n }).catch(() => {\n // Si aucun token n'est renvoyé, alors on force le sign out (au cas où)\n result = { isSigned: false, error: 'No token generated' };\n context.commit('signOut');\n });\n } else {\n // Si pas de data, alors on force le sign out (au cas où)\n result = { isSigned: false, error: 'Can\\'t authenticate as this user' };\n context.commit('signOut');\n return result;\n }\n } catch (e) {\n // Si l'api renvoie une erreur\n let errorList = e;\n if (e.response && e.response.data) errorList = e.response.data.errors;\n result = { isSigned: false, error: errorList };\n context.commit('signOut');\n return result;\n }\n // Si il mange le login ou le password\n } else {\n result = { isSigned: false, error: 'No login or password provided' };\n context.commit('signOut');\n return result;\n }\n return result;\n }", "title": "" }, { "docid": "6dec38b7b99da5889180d0578267e23e", "score": "0.5796386", "text": "login() {\n this.props.auth.login();\n }", "title": "" }, { "docid": "a5d9f8f47a35d6b9f3787014dcd86bce", "score": "0.5793812", "text": "login(username, password) {\n return axios.post(API_BACKEND_URL + \"signin\",{\n username,\n password\n }).then(response => {\n if (response.data.accessToken) {\n sessionStorage.setItem(\"user\", JSON.stringify(response.data));\n }\n return response.data;\n });\n }", "title": "" }, { "docid": "04e9ec0f46de317891f8dad45f27fc20", "score": "0.57795674", "text": "function SignInForm() {\n const { store, publish, isAuthenticated } = useContext(appContext);\n const history = useHistory();\n const setAuth = (key) => {\n const query = new URLSearchParams(history.location.search);\n window.localStorage.setItem(\"8n2b5\", key);\n history.push(query.get(\"from\") || \"/\");\n };\n\n // Checking if already logged in\n if (isAuthenticated()) {\n history.push(\"/\");\n return null;\n }\n\n ///getting response data and sending POST requests to URLs\n //GOOGLE\n const responseGoogle = async (response) => {\n const resG = await makeRequest(GOOGLE_URL, {\n access_token: response.accessToken,\n });\n\n // Checking for error\n if (resG.error.status) {\n\n // Push Error Notification\n alert(\"Failed to Sign-in/Sign-UP\")\n return;\n }\n\n setAuth(resG.data.key);\n };\n\n //FACEBOOK\n const responseFacebook = async (response) => {\n const resF = await makeRequest(FACEBOOK_URL, {\n access_token: response.accessToken,\n });\n\n if (resF.error.status) {\n // Push Error Notification\n alert(\"Failed to Sign-in/Sign-UP\")\n return;\n }\n\n setAuth(resF.data.key);\n };\n\n return (\n <div\n className={`form-container ${\n store.currentForm !== \"sign_in\" ? \"hide\" : \"\"\n }`}\n >\n {\" \"}\n {/* Heading of form */}\n <div className=\"heading\">\n <h3>Sign In</h3>\n <p>\n New user?{\" \"}\n <a role=\"button\" onClick={() => publish({ currentForm: \"sign_up\" })}>\n Create an account\n </a>\n </p>\n </div>\n {/* Input Form */}\n <form>\n <input type=\"email\" placeholder=\"Email Address\" />\n <input type=\"current-password\" placeholder=\"Password\" />\n <span>\n <input className=\"check\" type=\"Checkbox\" />\n Keep me signed in\n </span>\n <input type=\"submit\" value=\"SIGN IN\" />\n </form>\n {/* One click sign up/ sign in Buttons */}\n <div className=\"display-buttons\">\n <span className=\"line-one\"></span>\n <div className=\"text\">Or Sign In With</div>\n <span className=\"line-two\"></span>\n </div>\n {/* google button */}\n <div className=\"click-signups\">\n <div className=\"google\">\n <GoogleLogin\n clientId=\"41492064673-d8vie206dv3b0aboievgi9riuf19ggsj.apps.googleusercontent.com\"\n buttonText=\"GOOGLE\"\n onSuccess={responseGoogle}\n onFailure={responseGoogle}\n cookiePolicy={\"single_host_origin\"}\n />\n </div>\n{/* facebook button */}\n <div className=\"facebook\">\n <FacebookLogin\n appId=\"4666313333440145\"\n fields=\"name,email,picture\"\n callback={responseFacebook}\n />\n </div>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "267ec1628039e79671b1189c9aed774e", "score": "0.5778593", "text": "login() {\n db.auth.signInWithPopup(db.provider).then((result) => {\n this.setState({\n user: result.user,\n });\n });\n }", "title": "" }, { "docid": "e1a6256ec099446bd02fedfe3440b37b", "score": "0.577542", "text": "function checkLogIn() {\n\t\tsetIsInvalid(false);\n\t\tsetIsLoading(true);\n\t\t\n\t\t fetch(`${API_URL}s/`,{\n\t\t\t method: 'GET',\n\t\t\t headers: {\n\t\t\t\t 'Authorization': localStorage.getItem(\"token\")\n\t\t\t }}).then ( res => res.json()\n\t\t\t ).then (data => { \n\t\t\t\t localStorage.setItem('user', JSON.stringify(data));\n\t\t\t\t setIsSubmit(true);\n\t\t\t\t setIsLoading(false);\n\t\t })\n\t\t\t .catch (error => { \n\t\t\t\t console.log(error);\n\t\t\t\t setIsInvalid(true);\n\t\t\t\t localStorage.removeItem('token');\n\t\t\t\t localStorage.removeItem('user');\n\t\t\t\t setIsLoading(false);\n\t\t\t })\n\t\t }", "title": "" }, { "docid": "4f8a13708a6972941a6d0076a69ddfec", "score": "0.5773823", "text": "function signIn() {\n var email = document.getElementById(\"email\");\n var password = document.getElementById(\"password\");\n\n auth.signInWithEmailAndPassword(email.value, password.value).then(() => {\n console.log(\"Signed in \" + email.value);\n hideShowStudentData(true);\n });\n //\n //promise.catch(e => console.log(e.message));\n \n \n // Any actions you want to do that they are signed in\n}", "title": "" }, { "docid": "5b2030e21f757de165c26ce228fe520f", "score": "0.57735664", "text": "CreateAccount() {\n this.setState({\n loading: true,\n });\n const creator = {\n publicKey: this.state.creator_publicKey,\n weight: this.state.creator_weight,\n username: this.state.creator_username,\n };\n\n CreateAccount(\n creator,\n this.state.users,\n this.state.low_threshold,\n this.state.med_threshold,\n this.state.high_threshold,\n this.state.account_name\n )\n .then((public_key) => this.props.history.push(\"/account/\" + public_key))\n .catch((e) => console.log(e));\n }", "title": "" }, { "docid": "98cd7960fb6b0f8d3c623b1d1a3d5aac", "score": "0.5773015", "text": "function signIn() {\n\t// If they have a user account and aren't already logged in\n\tif(userID !== 0 && !hasAccount) {\n\t\t$.ajax({\n\t\t\turl: userURL+\"generateToken\", // Generates a token for the SwitchBru signup\n\t\t\tmethod: \"POST\",\n\t\t\tdata: {\"id\":userID,\"UID\":UID},\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function(response) {\n\t\t\t\tif(response.error == false) { // If there is no error\n\t\t\t\t\t// Redirect to the account login page with the token and return page (encrypted)\n\t\t\t\t\twindow.location.href = accountURL+\"dns?token=\"+response.token+\"&return=\"+response.r+\"&signin=true\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// If there is an error\n\t\t\t\t\talert(\"An error occurred.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function() {\n\t\t\t\talert(\"An error occurred.\");\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "e33af3446bbcbb25ec3dd726e4a92377", "score": "0.57713056", "text": "storeUser ({commit, state}, userData) {\n if (!state.idToken) {\n return\n }\n globalAxios.post('/users.json' + '?auth=' + state.idToken, userData)\n .then(res => console.log(res))\n .catch(error => console.log(error))\n }", "title": "" }, { "docid": "56bbdb15f7393b3bf3efd9aae161f3a8", "score": "0.57704514", "text": "login(username, password) {\n return axios\n .post(API_URL + \"/signin\", { username, password })\n .then((response) => {\n if (response.data.accessToken) {\n localStorage.setItem(\"user\", JSON.stringify(response.data));\n }\n return response.data;\n });\n }", "title": "" }, { "docid": "f6fa9ddabd890b1050815c871415b8da", "score": "0.57563823", "text": "function onSignin() {\n\tsignin(email, password)\n\t\t.then(res => console.log('res: ', res))\n\t\t.catch(err => console.log('err: ', err.message))\n}", "title": "" }, { "docid": "7d0d950f0c5bf50c884ed74ff11a4831", "score": "0.575438", "text": "login(token)\n { \n try {\n payload = jwt.verify(token, key);\n //req.id = payload.id;\n //req.userType = payload.userType;\n //console.log(payload.userType)\n this.setState(\n {\n current:payload.userType,\n message:\"welcome back\",\n token:token,\n userId:payload.id,\n userType:payload.userType\n })\n localStorage.setItem('document',JSON.stringify(this.state));\n //console.log(this.state)\n } catch (error) {\n \n }\n \n \n \n }", "title": "" }, { "docid": "b449ccbcb030804d98bca1f96570c834", "score": "0.5753291", "text": "async logIn(\n { commit, dispatch },\n { login_type, username, password, otp_token } = {}\n ) {\n const { token, otp_token_required } = await createToken(\n login_type,\n username,\n password,\n otp_token\n )\n\n if (otp_token_required)\n return {\n otp_token_required,\n }\n\n commit('SET_ACCESS_TOKEN', token)\n\n // 소켓 인증\n sio.emit('authenticate', { token })\n\n dispatchActionForAllModules('loggedInInit')\n\n Promise.all([\n dispatch('getOtps'),\n dispatch('account/getAccounts', null, {\n root: true,\n }).then(() => dispatch('getUserInfo')),\n ]).catch((e) => Vue.toasted.error(e.message))\n }", "title": "" }, { "docid": "48377ad82f027e08bdaaf842454e8ae6", "score": "0.5749221", "text": "async handleSignUp({\n commit\n }, payLoad) {\n commit('SET_LOADING', true);\n setTimeout(() => {\n commit('SET_LOADING', false);\n }, 500)\n try {\n let res = await axios.post(`${firebase_API.API_AUTH}:signUp?key=${firebase_API.API_KEY}`, payLoad.data);\n commit('SET_LOADING', false);\n commit('SET_TOKEN_ID', res.data);\n const db = firebase.firestore();\n db.collection(\"user\").add({\n token: payLoad.token,\n idCoachLogin: res.data.localId,\n });\n localStorage.setItem(\"checkLogin\", JSON.stringify(res.data));\n localStorage.setItem(\"userId\", JSON.stringify(res.data));\n return true\n } catch (err) {\n console.log(err);\n return false;\n }\n }", "title": "" }, { "docid": "78473dc4a3ccc6795ec57457a1b9ac6f", "score": "0.5748539", "text": "async function logIn() {\n\n try {\n let responseToken = await JoblyApi.login(formData);\n window.localStorage.setItem('token', responseToken);\n window.localStorage.setItem('username', formData.username);\n setToken(responseToken);\n history.push(\"/companies\");\n }\n catch (err) {\n setErrorMessage(messages => ([\n ...messages, ...err\n ]));\n }\n\n\n }", "title": "" }, { "docid": "df0ce7b1878a0ddc218164d49c1aa446", "score": "0.574845", "text": "autologin ({commit}) {\n const token = localStorage.getItem('token')\n const expirationDate = localStorage.getItem('expirationDate')\n const userId = localStorage.getItem('userId')\n\n const now = new Date()\n if (now >= expirationDate) {\n return\n }\n commit('AUTH_USER', {\n token: token,\n userId: userId\n })\n }", "title": "" }, { "docid": "eb7756545001e14c13d63e6c5d5e1315", "score": "0.57474154", "text": "function signIn() {\n WeDeploy\n .auth(address.auth)\n .signInWithEmailAndPassword(login.email.value, login.password.value)\n .then(function() {\n login.submit.disabled = true;\n login.submit.innerText = 'Loading...';\n document.location.href = './chat.html';\n })\n .catch(function() {\n login.submit.disabled = false;\n login.submit.innerText = 'Sign In';\n alert('Sign-in failed.');\n });\n}", "title": "" }, { "docid": "a5a39d7d247041a737efcc2ff335aa17", "score": "0.57459927", "text": "static async register(firstName, lastName, email, password, dob, tel) {\n const res = await axios.post(url, {\n firstName,\n lastName,\n email,\n password,\n dob,\n tel,\n });\n const token = res.data.data.token;\n localStorage.setItem(\"jwt\", JSON.stringify(token));\n }", "title": "" }, { "docid": "a37bbeb239bba9302047db0d86196bf2", "score": "0.5738372", "text": "login(email, password, callback) {\n firebase.auth().signInWithEmailAndPassword(email, password)\n .then(function(user) {\n AsyncStorage.removeItem(KEY_NAME);\n AsyncStorage.setItem(KEY_NAME, JSON.stringify(user));\n callback(false);\n })\n .catch(function(error) {\n callback(true);\n });\n }", "title": "" }, { "docid": "1fb0326ed0da67d4ff3ed5d6812bfc99", "score": "0.57327044", "text": "async logAsRegistered() {\n try {\n await AsyncStorage.setItem('email', this.state.email);\n firebase.analytics().logEvent('registration_completed');\n this.props.navigation.navigate('TabNav');\n } catch (error) {\n this.setState({showMsgModal: true, errMsg: 'Error with saving registration'});\n firebase.analytics().logEvent('saving_registration_error');\n }\n }", "title": "" }, { "docid": "75ddda5b15bf657b3a749b1ba14d8d81", "score": "0.5731182", "text": "function logIn()\n{\n\tvar data =\n\t{\n\t\tusername: _usernameField.value,\n\t\tpassword: _passwordField.value,\n\t\trememberMe: !!(_rememberMe.checked)\n\t};\n\n\t// Hide any server error that might have popped up before\n\tnotifier.hideErrorBar();\n\n\taxios.post(LOG_IN_URL, data, true).then(() =>\n\t{\n\t\t// If successful, let's take the user to the orders page\n\t\twindow.location.href = ORDERS_URL;\n\t}, () =>\n\t{\n\t\tnotifier.showSpecializedServerError(LOG_IN_INVALID_MESSAGE);\n\t});\n}", "title": "" }, { "docid": "3f93e11952ce5d63022c1eb5886dfe04", "score": "0.5730374", "text": "async function handleSignIn(e) {\n e.preventDefault();\n const email = e.currentTarget.elements.email.value;\n const password = e.currentTarget.elements.password.value;\n try {\n await signInWithEmailAndPassword(auth, email, password);\n const userId = auth.currentUser.uid;\n startMovieId = await getMoviesFromDB(userId, 'watchedMovies');\n loadMoreBtn.hide();\n addBtnWatchedAccentColor();\n markupMyLibrary();\n successfulSignInMsg();\n closeSignInModal();\n } catch {\n authErrorMsg();\n }\n}", "title": "" }, { "docid": "dc9b946c197e848d70c461069592908e", "score": "0.57220477", "text": "signInExistingUsertoAPI() { }", "title": "" }, { "docid": "c31f4c8e2983b507d38d91b7f2f9b0a9", "score": "0.57150364", "text": "function addAccount(account) {\n let saved_accounts = accounts_json;\n if (saved_accounts == undefined || saved_accounts == null || saved_accounts.list == 0)\n accounts = {\n list: [account]\n };\n else {\n saved_accounts.list.push(account)\n accounts = saved_accounts;\n }\n chrome.storage.local.set({\n accounts: encryptJson(accounts, mk)\n });\n initializeMainMenu();\n}", "title": "" }, { "docid": "4bbb51bd8ccac749ea1dce56443f638f", "score": "0.57145214", "text": "function init(){\n let name = sessionStorage.getItem('name');\n document.getElementById('signedInAs').textContent = `Signed in as ${name}`\n}", "title": "" }, { "docid": "9e262ce36fbf24fb4b377e1c40bce0b3", "score": "0.57120514", "text": "@action login() {\n this.inProgress = true;\n this.errors = undefined;\n\n return agent.Auth.login(this.values.username, this.values.password)\n .then((user) => commonStore.setToken(user.accessToken))\n .then(() => userStore.pullUser())\n .catch(action((err) => {\n this.errors = err.response && err.response.body && err.response.body.message;\n throw err;\n }))\n .finally(action(() => {\n this.inProgress = false;\n //TODO: need to reset() ?? --> leak password\n this.reset();\n }));\n }", "title": "" }, { "docid": "4407b9ebd437c9d83ea066dfbead6f75", "score": "0.5710844", "text": "function login() {\r\n const email = document.getElementById('txtEmail').value;\r\n const pass = document.getElementById('txtPassword').value;\r\n\r\n firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION);\r\n firebase.auth().signInWithEmailAndPassword(email, pass).then(user => {\r\n user.getIdToken(true).then(idToken => {\r\n sessionStorage.setItem('token', idToken);\r\n window.location = \"/\";\r\n });\r\n }).catch(error => {\r\n\r\n });\r\n}", "title": "" }, { "docid": "4265b47a1668e35599fff2e2cb514e97", "score": "0.5708471", "text": "checkUserIsLoggedIn(state,payload){\n \n if(payload.userLoggedIn){\n state.userLoggedIn = payload.userLoggedIn;\n state.email = localStorage.getItem('email');\n state.userLoggedIn = true;\n var email = state.email\n \n // for getting all local storage tokens, calling\n // the API for getCurrentUser to get series of \n // available tokens\n getCurrentUser(email).then((data) =>{\n \n var heapOfUnusedData = Object.keys(data.storage);\n var localTokens = [];\n heapOfUnusedData.forEach((item,index) => {\n\n // if it is token then it will have 3\n // parts seperated by '.'\n var tokenToCheck = item.split('.');\n if(tokenToCheck.length > 2){\n localTokens.push(item);\n } else{\n // do nothing\n }\n })\n state.authStorageTokens = localTokens\n })\n .catch((err) =>{\n console.log('Err:',err);\n })\n } else{\n\n // repeat sign out action if user is not logged in\n var tokensToRemove = state.authStorageTokens\n tokensToRemove.forEach((item,index) =>{\n localStorage.removeItem(item);\n })\n state.authStorageTokens = []\n state.userLoggedIn = false;\n localStorage.removeItem('email');\n }\n }", "title": "" }, { "docid": "818e8f4df6a758555b4801b66f3a1a23", "score": "0.5703372", "text": "signIn(username, password) {\n // This is where you would call Firebase, an API etc...\n // calling setState will re-render the entire app (efficiently!)\n this.setState({\n user: {\n username,\n password,\n }\n })\n }", "title": "" }, { "docid": "8887d41336808c7ecba7403ffe827e76", "score": "0.57023984", "text": "function signInCaller() {\n checkLogin();\n\n\n }", "title": "" }, { "docid": "aad13a80e8f7050165731db41e87d172", "score": "0.57011604", "text": "signUp(e) {\n let email = e.target.email.value;\n let password = e.target.password.value;\n userService.signUp(email, password)\n .then((data) => {\n if (data.id) {\n let updateStateData = {\n user: data,\n loggedIn: true,\n };\n this.setState(updateStateData, () => {\n this.props.router.push('/quizzes');\n });\n } else {\n console.log('Signup Error');\n }\n })\n .catch((err) => {\n console.log(err);\n })\n }", "title": "" }, { "docid": "e92a531901922ab9448fc35afeda4709", "score": "0.5699107", "text": "LOGIN(state, payload) {\n state.user = {\n ...state.user,\n ...payload,\n };\n }", "title": "" }, { "docid": "2ff10faa6722b39c1e821fd843bb9e04", "score": "0.5697549", "text": "signIn() {\n if (!this.path || !this.authenticate) {\n throw new Error(\"'path' and 'authenticate' required.\");\n }\n else {\n const _$ = this;\n const requestOptions = {\n method: 'POST',\n body: JSON.stringify(this.authenticate),\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\"\n }\n };\n\n fetch(this.path, requestOptions)\n .then(response => { return response.json(); })\n .then(response => {\n if (response.success || response.code === 200) {\n _$.$.index.setStoredValue(\"user\", response.user).then(() => {\n _$._setUser(response.user);\n _$._setStatusKnown(true);\n }).catch((error) => {\n console.warn(\"Index error: \" + error);\n });\n }\n else {\n var error = response.msg || response.message || response.err || response.error;\n _$.fire('error', error);\n }\n })\n .catch(error => {\n _$.fire('error', error);\n });\n }\n }", "title": "" }, { "docid": "0dcd55732ebcfdff4db7e3ea3010fa55", "score": "0.5696184", "text": "signIn() {\n let username = this.state.username;\n let password = this.state.password;\n let credentials = new URLSearchParams();\n credentials.append(\"username\", username);\n credentials.append(\"password\", password);\n fetch(\"/CalculatorAPI/StartSession\", {\n method: \"POST\",\n body: credentials\n }).then((response) => response.json())\n .then(result => {\n if (!result.error) {\n if (result.hasSession) {\n this.props.signIn();\n } else {\n this.invalidCredentials();\n }\n } else {\n this.errorMessage();\n }\n }).catch((reason) => {\n this.errorMessage();\n });\n }", "title": "" }, { "docid": "0762e63adac177f6e483b4b5f88e8afc", "score": "0.56913334", "text": "function createAccount (account) {\n var accounts = storage.getItemSync('accounts');\n\n if (typeof accounts === \"undefined\") {\n accounts = [];\n }\n\n accounts.push(account);\n\n storage.setItemSync('accounts', accounts);\n\n return account;\n}", "title": "" }, { "docid": "4095d173c88e8eb89a0e8cb1d907f3e8", "score": "0.5691182", "text": "setAuth(state, payload){\n state.auth = {\n uid: payload.uid,\n userName: payload.userName\n }\n }", "title": "" }, { "docid": "403f743f880b8ec356e36a8b4fbb2779", "score": "0.5690793", "text": "function handleSignupOrLogin() {\n setUserState({\n user: getUser()\n });\n }", "title": "" }, { "docid": "c8a1e0122741d038cd7dc4c64dfe6e64", "score": "0.5682786", "text": "async function Sign(e)\n{ \ne.preventDefault();\nconst email =document.getElementById('email').value;\nconst password=document.getElementById('password').value;\nfirebase.auth().signInWithEmailAndPassword(email, password).then((userCredential) => \n {\n // Signed in\n var user = userCredential.user;\n props.setLog(true);\n // props.setUser(user);\n }).catch((error) => \n {\n var errorCode = error.code;\n var errorMessage = error.message;\n alert('Failed to sign in!');\n });\n}", "title": "" }, { "docid": "341b6a57a6d93949ee3956dfe8935232", "score": "0.5682269", "text": "function SignInHandler(e) {\n e.preventDefault();\n window.location.href = \"http://localhost:3000/y2bmovies#/ui-components/starter\";\n sessionStorage.userId = 1;\n}", "title": "" } ]
cbea9a242ca2ec3c2b6658c8b4246e4e
you can pass any thing in props like component, elements, fucntion even can change the name of prop in spread.
[ { "docid": "000e8d77573346b0c46b314030b053f9", "score": "0.5606074", "text": "function App() {\n return (\n <div className=\"App\">\n <h1>Cart</h1>\n <CartItem/>\n <Testprop cat dog={\"hello dogs\"} ele={{a:1}} comp={<CartItem/>}/>\n\n\n </div>\n );\n}", "title": "" } ]
[ { "docid": "f29613e1489d5a5c6c3e4e7b75a03c5d", "score": "0.64249134", "text": "function PassProperty(props){\n \n return (\n <div>\n <h2>Passing Value by Attribute Dynamically | Name:{props.title} | Address: {props.city}</h2>\n <p>Lorem ipsum dolor sit amet.</p>\n \n </div>\n );\n}", "title": "" }, { "docid": "18c384870baef9e06a6904f5d9ee7c1c", "score": "0.62854034", "text": "render() {\n \t//This is the \"spread\" syntax for object in ES6\n return (<Style {...this.props}>\n <div className=\"propDiv\">{this.props.property}</div>\n <div className=\"stateDiv\">{this.state.text}</div>\n </Style>);\n }", "title": "" }, { "docid": "2ee6a3b33d7b96dd16b6f8f7c2bd8039", "score": "0.6223632", "text": "SpreadElement(node) {\n this.visit(node.argument);\n }", "title": "" }, { "docid": "79a06d7b588d74774fc0df499cd8962d", "score": "0.6146622", "text": "SpreadElement(node) {\n this.visit(node.argument);\n }", "title": "" }, { "docid": "be8f898db23200ca6e89da9ab4da2e74", "score": "0.6119882", "text": "function spreadFunction(...multipleArgs) {\r\n console.log(multipleArgs);\r\n}", "title": "" }, { "docid": "9456074950f28d330610bc8812ef3b9a", "score": "0.6119713", "text": "function FunctionalComponent(props) {\n return <p>Hello, {props.name} {props.something}</p>;\n}", "title": "" }, { "docid": "836ee22f6ed2e52342b0bc17f7dd372c", "score": "0.5952138", "text": "function function1_(props){ return <h1>Hola,{props.nombre}</h1>; }", "title": "" }, { "docid": "3c9a3cdd7b359a3fce8b3791c3d9f703", "score": "0.58729327", "text": "render() {\n return <this.props.Component {...this.props.props} />;\n }", "title": "" }, { "docid": "634d85390ccbabbbc7a36d918f1558c1", "score": "0.5870295", "text": "render() {\n const { Component } = this.props;\n return <Component {...this.props} />;\n }", "title": "" }, { "docid": "6817fb0cc6fb419ee5b1e96e11b6e130", "score": "0.58488077", "text": "function Input(props) {\n return (\n <input { ...props } />\n );\n}", "title": "" }, { "docid": "ae9b5731e9215fbd940dffcb67330e18", "score": "0.5845714", "text": "function PropIndex() {\n return (\n <div>\n {/* <PropFunction name =\"shyam\" />\n <PropFunction name =\"manideep\" />\n <h3>hello welcome</h3>\n <PropClass name = \"shyam\" />\n <PropClass name= \"manideep\" /> */}\n {/* <StateClass /> */}\n <ParentComp />\n </div>\n )\n}", "title": "" }, { "docid": "2505edbc107678249bce1e0fdd8a6f9b", "score": "0.5840532", "text": "function FunctionalComponent(props) {\n return <li>Hello, {props.name}</li>\n }", "title": "" }, { "docid": "9f39c4b9742402460b4d361e16da2bc8", "score": "0.576547", "text": "function speadArgs(fn) {\n return function spreadFn(argsArr) {\n return fn(...argsArr);\n };\n}", "title": "" }, { "docid": "bf2c61f37dd28fae9395441a77396cc0", "score": "0.57460445", "text": "function Sendingprops() {\n const[state,setState]=useState();\n const functioninparent=(textfromchild)=>{//text recieved here is the argument set for this parameter \"textfromchild\" in child;\n \n setState(textfromchild)\n }\n \n \n return (\n <>\n \n <Propsreciever idd=\"from parent to child\" func={functioninparent}></Propsreciever> \n {/* idd is a prop sent to a component named props reciever */}\n \n <p >{state}</p>\n </>\n )\n}", "title": "" }, { "docid": "dd6aa7edded17b2f68d1ba39dfebb809", "score": "0.5715103", "text": "function getCard(Card,functions,Data){\n return class extends React.Component{\n constructor(props){\n super(props);\n this.title = functions;\n }\n showContent = () => {\n return ( <div>\n {this.props.content}\n {this.props.content}\n {this.props.content}\n </div>)\n }\n render(){\n return(\n <div>\n {/* <Card {...this.props}/> this code not working */}\n {this.showContent()}\n </div>\n )\n }\n }\n}", "title": "" }, { "docid": "c3bbc046965bd2d0440d6aa181f2d222", "score": "0.5694458", "text": "function MyApp({ Component, pageProps }) {\n return <Component {...pageProps} />;\n}", "title": "" }, { "docid": "c3bbc046965bd2d0440d6aa181f2d222", "score": "0.5694458", "text": "function MyApp({ Component, pageProps }) {\n return <Component {...pageProps} />;\n}", "title": "" }, { "docid": "e324e5d9e7b222bb8e37f8894e696aa1", "score": "0.5679009", "text": "function MyApp({ Component, pageProps }) {\n return <Component {...pageProps} />\n}", "title": "" }, { "docid": "e324e5d9e7b222bb8e37f8894e696aa1", "score": "0.5679009", "text": "function MyApp({ Component, pageProps }) {\n return <Component {...pageProps} />\n}", "title": "" }, { "docid": "ce448422deb77e3dc0de3484ec9ae3f3", "score": "0.56386924", "text": "function BookList() {\n return (\n <section className=\"booklist\">\n {books.map((book) => {\n return <Book key={book.id} book={book}></Book>; //<Book key={book.id} book={...book}></Book> spread operater book object\n })}\n ;\n </section>\n );\n}", "title": "" }, { "docid": "0ea3c664fe919f34cc787547118f164d", "score": "0.5630015", "text": "function spreadRest(){\n\tlet name = [\"firstname\", \"lastname\"];\n\tlet bio = [...name, \"address\"];\n\tconsole.log(bio);\n\n\t// rest parameter\n\tfunction fullBio(...fullname) {\n\t\tlet addressWithName = [...fullname, \"address\"]; \n\t\tlet addressWithNameArray = [fullname, \"address\"];\n\t\tconsole.log(addressWithName); // [\"firstname\", \"lastname\", \"address\"]\n\t\tconsole.log(addressWithNameArray); // [Array(2), \"address\"]\n\n\t}\n\tfullBio(\"firstname\", \"lastname\");\n}", "title": "" }, { "docid": "ef1ffbc8160430fd7c7cbbc0aabdf497", "score": "0.5627607", "text": "function MyApp ({ Component, pageProps }) {\n return <Component {...pageProps} />\n}", "title": "" }, { "docid": "6fb8dbf0c51629ca4fbdafe0692b1c1c", "score": "0.5584505", "text": "function printSpread(...a) { // Spread as function args\n console.log(a);\n}", "title": "" }, { "docid": "5af4665c1276ad99dfec6815da53288d", "score": "0.5566575", "text": "render() {\n return (\n <div>\n <Greet firstName = \"Mary\" lastName = \"Quite Contrary\" />\n </div>\n )\n }", "title": "" }, { "docid": "294a55c3066fe32d2ee33de51e5617eb", "score": "0.555814", "text": "function Booking() {\n \n return (\n <>\n <BookingSection {...bookObjOne} />\n <BookingSection {...bookObjTwo} />\n </>\n )\n}", "title": "" }, { "docid": "de9d78a130148b76630ffdaa27db8d82", "score": "0.55437785", "text": "function foo(...a) {}", "title": "" }, { "docid": "890ccb8ecda9db1a32dd28265454fabb", "score": "0.5511007", "text": "function Greeting(props) {\n return (\n <div>\n <h1>Good Afternoon ,{props.name}</h1>\n <p>thi is para para</p>\n </div>\n ); \n}", "title": "" }, { "docid": "a3c403e3465189631286b0a8ececa116", "score": "0.55087024", "text": "function spreadus() {\n var args = Array.prototype.slice.apply(arguments);\n args._spreadus_ = true;\n return args;\n }", "title": "" }, { "docid": "ab4ca7c87cda9b3f594bf722866ebb75", "score": "0.547192", "text": "render(){\n\n //div wraps it into one item\n //because you can only return one item\n return (\n // jsx styles per component\n //react allows you to write js syntax in html\n // each component is its separate universe\n // react using jsx to render there fake DOM\n // creates the react virtual DOM compares to actual browser DOM , and then updates actual DOM\n //creates objects and only changes what needs to be done in DOM\n //beacuase its js we have to use className\n <div className=\"f3 tc\">\n <h1>OrlandoMg!</h1>\n <p> whats up dudes</p>\n <p>yeah man</p>\n <p>{this.props.greeting}</p>\n </div>\n)\n// wrap in curly braces so it knows its js ,\n//this.props greeting so it binds it to greeting Prop\n}", "title": "" }, { "docid": "ee7bb86142853dc69035243cf8e1fd28", "score": "0.5458545", "text": "function HolaMundo(props){\n return(\n <div>\n <h1>Hola {props.nombre} y {props.nombre2}</h1>\n <h2>Google Developer Expert {props.chenchomaster}</h2>\n </div>\n );\n}", "title": "" }, { "docid": "035ba31853cba618ab434d833af61f69", "score": "0.544621", "text": "function Button(props){\n return <div>\n <button>{props.theme}</button>\n </div>\n \n}", "title": "" }, { "docid": "7fb1f0c773d5026a73f199799b5325e8", "score": "0.54193884", "text": "render() {\n const { Component, pageProps } = this.props;\n return <Component {...pageProps} />;\n }", "title": "" }, { "docid": "d581885997984e7c592c1d9de6857d36", "score": "0.5415626", "text": "function a1(...x) {}", "title": "" }, { "docid": "f2929326e7485f8c7a719df33c5b9a72", "score": "0.5404944", "text": "function DialogContent(props) {\n return <Component {...props} />;\n}", "title": "" }, { "docid": "38eb089bbb820dc3fab91b26a79380af", "score": "0.5398174", "text": "function Card({ title, description }) {\n // console.log(props)\n // const { title, description } = props\n\n // must return JSX\n return (\n <div className=\"card\">\n <h1>{title}</h1>\n <h4>{description}</h4>\n </div>\n )\n}", "title": "" }, { "docid": "a7de65c3c14f222b3e92ccc9b87f57d4", "score": "0.5393045", "text": "function JSXSpreadAttribute(node, print) {\n this.push(\"{...\");\n print.plain(node.argument);\n this.push(\"}\");\n}", "title": "" }, { "docid": "407f71590b3d81a31359e8ee6bcca520", "score": "0.53873754", "text": "function getSpread(data = {}) {\n const {people, ...object} = data;\n const test = ['1', {}, '3,', object];\n console.log(test);\n}", "title": "" }, { "docid": "4ec292d71f88251261fafe88e67f93d9", "score": "0.53822595", "text": "function AnotherBasicComponent(props: { name: string }): React.Node {\n return <div>Bonjour {props.name}!</div>;\n}", "title": "" }, { "docid": "2b2728c0155b8175ab50d91d78185f76", "score": "0.5377237", "text": "function App(props) {\n var city_name=\"Greater Noida\";\n var count=6;\n var arr=[];\n for(var i=0;i<count;i++){\n arr.push(<Seller details={props.details[i]}/>)\n \n } \n \n\n \n // console.log(props.details);\n return (\n <div className=\"product-strip-parent\">\n <div class=\"product-strip-child\">\n <div class=\"product-category\">\n <h3> Sellers nearby</h3>\n </div>\n <div className=\"product-spread\">\n {[...arr]}\n </div>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "6ecf8bc1238ee4b1c5babfc4bd3d3874", "score": "0.53640765", "text": "function Hello(props) {\n return <div>Hello {props.addressee}!</div>;\n}", "title": "" }, { "docid": "915bac80f9d72e546989e97b066d5e58", "score": "0.53575575", "text": "function Person (props) { // needs to be a capital letter to work with react\n return (\n <div className=\"person\">\n <h1>{ props.name }</h1>\n <p>{ props.age }</p>\n </div>\n );\n}", "title": "" }, { "docid": "ebf64ad29a4e99540b1826ec3b798348", "score": "0.53538615", "text": "function myFunctionBeforeSpread(a,b,c) {\n console.log(`a=${a}, b=${b}, c=${c}`);\n}", "title": "" }, { "docid": "e50a0d28493385d056b4238765b5baa6", "score": "0.5347197", "text": "render() {\n return (\n <Component\n {...this.props}\n {...this.state}\n />\n );\n }", "title": "" }, { "docid": "e7f7c8651d88a29e39df671d9ef3f3f9", "score": "0.53458893", "text": "function Hello(props) {\n return <h2>{props.title}</h2>\n}", "title": "" }, { "docid": "6bea8b910aaefba97ccb564fecefdd12", "score": "0.53148854", "text": "function valueFunctionProp(prop, ...args) {\n return typeof prop === 'function' ? prop(...args) : prop;\n}", "title": "" }, { "docid": "1d750197f7c3d78a173b42a3af91f1fb", "score": "0.5304512", "text": "render(){\n \n return (\n <React.Fragment>\n <h1 className=\"e\">Hello {this.props.myname} </h1>\n <F myname={'F'}/>\n \n </React.Fragment>\n );\n }", "title": "" }, { "docid": "e9a5073a38297547aa9289c51db7531a", "score": "0.5302964", "text": "function spreadoperatordemo(a, b, c, ...d) {\n console.log(a, b, c, d);\n}", "title": "" }, { "docid": "b88579e7b081202d9505c384e42e7040", "score": "0.52973783", "text": "function FunctionalComponent(props){\n return (<h1>Hello world</h1>);\n}", "title": "" }, { "docid": "bfcbab973de3d4aa773b4b130a051cb2", "score": "0.52887136", "text": "function Welcome(props) {\n\n return (\n <div>\n <h1>Hello, {props.name}</h1>\n <h2>Hope you're having a great time!</h2>\n </div>\n )\n}", "title": "" }, { "docid": "fb322f9d970c5401ca884cd47fff72a7", "score": "0.52681184", "text": "function n(e,t){this.props=e,this.context=t}", "title": "" }, { "docid": "508dcdb77db9b71d59c29b8c7a5c2d06", "score": "0.52551377", "text": "function ProductAdvanced(props){\n const style={\n width:'30%',\n border:'1px solid blue',\n margin:'5px',\n padding:'10px',\n float:'left',\n backgroundColor:'white',\n color:'black'\n }\n\n //console.log(props.product.name);\n\n //Destructure process\n const {name,price}=props.product;\n \n return(\n <div style={style}>\n <h2>{name}</h2>\n <h3>{price}</h3>\n <button>Buy Now</button>\n </div>\n )\n}", "title": "" }, { "docid": "6d43ae801461ecdf2612006e7035b4d2", "score": "0.5239434", "text": "function BookList() {\n return (\n //This is jsx\n //Pass props where we render, the function that renders.\n <section className=\"Booklist\">\n {/* These are the components. */}\n <Book\n // These are the properties\n title={firstBook.title}\n img={firstBook.img_src}\n author={firstBook.Author}\n desc={firstBook.Desc}\n imgAlt={firstBook.img_alt}\n >\n <p>\n {/* This is children props */}\n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cupiditate\n minus voluptatum reprehenderit obcaecati aut beatae, rerum quae eos\n unde totam!\n </p>\n </Book>\n {/* This is a function call in jsX*/}\n <Book\n title={secondBook.title}\n img={secondBook.img_src}\n author={secondBook.Author}\n desc={secondBook.Desc}\n imgAlt={secondBook.img_alt}\n />\n </section>\n );\n}", "title": "" }, { "docid": "ec731d99c72b3cf9df0a6c795c0fe562", "score": "0.52384454", "text": "function Header( props ){\n\n //console.log('See my props ', props)\n // Your props will look like this\n /*\n {\n name: 'Manish',\n age: 20,\n bootcamp: true,\n children: 'Hello buddy'\n }\n\n */\n\n return <h3 className=\"myHeader\" >My {props.name}</h3>\n}", "title": "" }, { "docid": "0ea01ecb1cc9377feb658fdb40462995", "score": "0.523636", "text": "function Hello(props) {\n // Correct: this use of <div> is legitimate because div is a valid HTML tag:\n return <div>Hello {props.toWhat}</div>;\n}", "title": "" }, { "docid": "6b0e8367efe6a255d0d8451cf6c47d7c", "score": "0.5234517", "text": "function Hi(props) {\n\n\n return <div>\n {/* <img src={props.pic}/> */}\n <p className = \"name\" > { props.text } </p>\n <p className = \"data\" > { props.date } </p>\n <p className = \"descrip\" > { props.descrip } </p>\n {/* <p>\n <button>abc</button>\n </p>\n */}\n </div>;\n\n\n\n\n\n}", "title": "" }, { "docid": "646a1ca859828cc51bdcfd495f5661e1", "score": "0.52307594", "text": "function processComponentArgs(namedArgs) {\n var keys = namedArgs.names;\n var attrs = namedArgs.value();\n var props = Object.create(null);\n var args = Object.create(null);\n props[ARGS] = args;\n for (var i = 0; i < keys.length; i++) {\n var name = keys[i];\n var ref = namedArgs.get(name);\n var value = attrs[name];\n if (typeof value === 'function' && value[ACTION]) {\n attrs[name] = value;\n } else if (ref[UPDATE]) {\n attrs[name] = new MutableCell(ref, value);\n }\n args[name] = ref;\n props[name] = value;\n }\n props.attrs = attrs;\n return props;\n }", "title": "" }, { "docid": "cde01c574a383839d4410ed7977c991d", "score": "0.52302116", "text": "function BookList() {\n return (\n <section className=\"booklist\">\n {/* <Book\n //here img is a prop and then in the {} we are setting it's value\n //then that it is passed to the Book component\n img={firstBook.img}\n title={firstBook.title}\n author={firstBook.author}\n > */}\n {/* this is a props child */}\n {/* <p>\n Lorem ipsum dolor sit, amet consectetur adipisicing elit. Ratione,\n inventore.\n </p> */}\n {/* </Book>\n <Book\n img={secondBook.img}\n title={secondBook.title}\n author={secondBook.author}\n /> */}\n\n {books.map((book) => {\n // const { img, title, author } = book;\n return <Book key={book.id} {...book}></Book>;\n //{...book} can be book={book}\n })}\n </section>\n );\n}", "title": "" }, { "docid": "d5d31dc898fe8be01d4f3332255a6ddc", "score": "0.5213276", "text": "function T(props){\n return(\n <div>\n <h1 className=\"t\">Hello {props.myname}</h1>\n <U myname={'U'}/>\n </div>\n )\n}", "title": "" }, { "docid": "44e181783ebaec9f0e42a5e6f7282572", "score": "0.5203174", "text": "constructor(...props) { //le pasamos el array de los properties\n super(...props); //hacemos un super y le pasamos directamente el array\n //Esto nos permite pasar tantas properties como queramos\n }", "title": "" }, { "docid": "2096ee62ad3327f68ac7f6de5717aff0", "score": "0.5195526", "text": "function Tweet(props){\n\n //y para llamarlo solo usamos props.\"nombre de la propiedad que hayamos mandado\"\n return(\n <div className=\"tweet\">\n <h3>{props.name}</h3>\n <p>{props.tweet}</p>\n <h3>{props.like}</h3>\n </div>\n );\n}", "title": "" }, { "docid": "19ebaa08ec6f67714c29746d917c0fc5", "score": "0.51726085", "text": "function call() {\n\t\t\t\t\t\t\tme[prop].apply(me, args);\n\t\t\t\t\t\t}", "title": "" }, { "docid": "10efe8579bfead0b04223905f1de85f8", "score": "0.51657885", "text": "map(props) {\n }", "title": "" }, { "docid": "164759801835529e7feb82e1f06bf712", "score": "0.51626045", "text": "assignStyles(...args) {\n return Object.assign({}, ...args);\n }", "title": "" }, { "docid": "943c0c8bce77b4e62bbbe4d424276f50", "score": "0.5157133", "text": "function myData(firstName, State, ...args) {\n console.log(args); // [\"Chris\",\"Minnesota\",\"Developer\", \"Minneapolis\"]\n}", "title": "" }, { "docid": "dcaff49d2e4d805204b89f3114aee44f", "score": "0.5154014", "text": "function parseSpread() {\n var node = startNode();\n next();\n node.argument = parseExpression(true);\n return finishNode(node, \"SpreadElement\");\n }", "title": "" }, { "docid": "8643f53ca415350d59ee57483d3af7eb", "score": "0.51460433", "text": "function Appchild(props) {\n return (\n <div>\n <h1> this is child : {props.name}</h1>\n </div>\n );\n}", "title": "" }, { "docid": "a1ee7caefef7b492f242ada27b06e039", "score": "0.51412845", "text": "function ChildComponent(props) {\n // the first thing we need to do is accept props as an argument\n // this will be an obj that contains the values passed through from the parent component\n\n return (\n <div>\n <h1>My name is: {props.name}</h1>\n {/* use the handleChange method coming from props on an onChange event */}\n <input type=\"text\" onChange={props.handleChange}/>\n </div>\n )\n}", "title": "" }, { "docid": "0bd1de762e717b2d5e22c9586938abb9", "score": "0.51271415", "text": "function applyProps(node, props) {\n if (!node) return; // Reject text nodes\n\n if (node.type !== 'element') return node;\n var prevProps = node.properties || {};\n\n var className = _toConsumableArray(prevProps.className || []).concat(_toConsumableArray(props.className || []));\n\n var result = _objectSpread({}, node, {\n properties: _objectSpread({}, prevProps, props, {\n className: className.length ? className : undefined\n })\n });\n\n return result;\n}", "title": "" }, { "docid": "4d9fcca2948135576f0876e7535857fc", "score": "0.51204103", "text": "function FirstComponent(props) {\n return <h4>Hi {props.name}, this is our first component.</h4>\n}", "title": "" }, { "docid": "540aceba2eb894734fc0de1c13ea6296", "score": "0.51181275", "text": "function Hello (props)\n{ // Every component should return JSX.\n let input = props.input;\n let heading = props.heading;\n let empty = props.empty;\n \n return (\n <div>\n <h1> { heading } </h1>\n <h2> { input } </h2>\n <p> { empty } </p>\n</div>\n );\n}", "title": "" }, { "docid": "2eb833a51d8547b269a732cbe5ef6261", "score": "0.5117606", "text": "function getName(...otherNames){\r\n console.log(otherNames)\r\n}", "title": "" }, { "docid": "2313496dd89490a71a1e087b7125a236", "score": "0.5110371", "text": "function hello(props) {\n // Correct! This use of <div> is legitimate because div is a valid HTML tag:\n return <div>Hello {props.toWhat}</div>;\n}", "title": "" }, { "docid": "d3085d71579b176e1b77e5f20f680371", "score": "0.5106621", "text": "function foo(...myArr){\n console.log(myArr); \n}", "title": "" }, { "docid": "36a02ceca2d6a340550d755d147ffe75", "score": "0.5103722", "text": "render() {\n\n // `props` is no longer passed as an argument,\n // but instead accessed with `this.props`\n return (\n <li>{this.props.todo}</li>\n );\n\n }", "title": "" }, { "docid": "36a02ceca2d6a340550d755d147ffe75", "score": "0.5103722", "text": "render() {\n\n // `props` is no longer passed as an argument,\n // but instead accessed with `this.props`\n return (\n <li>{this.props.todo}</li>\n );\n\n }", "title": "" }, { "docid": "149d2b349ac2a68fff31fb78cc83aa56", "score": "0.50829226", "text": "function Person(props){\n const styles={\n color:'blue',\n border:'10px solid gray',\n margin: '15px',\n padding:'25px',\n backgroundColor:'cyan'\n }\n return(\n <div style={styles}>\n <h1> Name : {props.name} </h1>\n <h2>profession : {props.job}</h2>\n <h5></h5>\n </div>\n ) \n \n}", "title": "" }, { "docid": "10c758f3dde7f93b0a3f3737a0fce8d2", "score": "0.5080281", "text": "render() {\n return (<div>\n <h1>ES-6 Functional Component</h1>\n <h2>{this.props.name}</h2>\n <h2>{this.props.message}</h2>\n <h2>{+(this.props.age)+10}</h2>\n <h2>{parseInt(this.props.age)+10}</h2>\n </div>);\n }", "title": "" }, { "docid": "62f5dbb2be7ae689b4a573a987f795de", "score": "0.5078895", "text": "function Person({personProp}) {\n return (\n <div>\n <h2>I have an id: {personProp.id} and I know {personProp.skill}</h2>\n </div>\n )\n}", "title": "" }, { "docid": "c2b17f1b5b08bee0eeb159cf32588506", "score": "0.5077752", "text": "function mergeProps(stateProps, dispatchProps, ownProps) {\n const handleSubmit = (event) => {\n event.preventDefault();\n const {random} = stateProps\n const message = `\n Random: ${random}\n `\n alert(message);\n } \n \n return {\n ...stateProps,\n ...ownProps,\n ...dispatchProps,\n handleSubmit,\n };\n}", "title": "" }, { "docid": "3a2344a78f282433e0ab2a00b5b16a52", "score": "0.5072382", "text": "render() {\n const { title, mainStyle, textstyle, ...rest } = this.props\n return (\n <ToubchblePlatForm\n {...rest}\n >\n <View\n style={[mainStyle]}\n >\n\n <Text style={textstyle}>{title}</Text>\n </View>\n </ToubchblePlatForm>\n\n )\n }", "title": "" }, { "docid": "6828a8085ace6a7d9cfc20825c35a854", "score": "0.5071377", "text": "function hello(...myParameter){\n return myParameter\n}", "title": "" }, { "docid": "ace34d4bc6b9e3ec3858ce6f5297666c", "score": "0.50701433", "text": "prop(prop) { return this.props[prop.id]; }", "title": "" }, { "docid": "269e5fee97efde7ed2c1a1c0555a87c4", "score": "0.5061824", "text": "componentWillReceiveProps(newProps) {\n if (this.props.params !== undefined && newProps.params !== this.props.params) {\n this.setState( {\n x: newProps.params.x,\n y: newProps.params.y,\n z: newProps.params.z\n })\n }\n\n }", "title": "" }, { "docid": "5879d9e1ef0800b425a5257b7a7e1f67", "score": "0.50465155", "text": "function GenreButton(props) {\n // let musicButtons = [\"Techno\", \"Classic\", \"Jazz\"];\n return <button onClick={() => props.action()}>{props.musicButtonsTitle}</button>;\n\n // function WelcomeMessage(props) {\n // return (\n // <div>\n // <h1>Hello {props.name}!</h1>\n // </div>\n // );\n // }\n\n // <div className=\"App\">\n // <WelcomeMessage name=\"John\" />\n // <WelcomeMessage name=\"Peter\" />\n // </div>\n\n // <div>\n // <button className=\"genre-button\">{technoButton}</button>\n // <button className=\"genre-button\">{jazzButton}</button>\n // </div>\n}", "title": "" }, { "docid": "fd13baba7d5458f88fd982ed876797a7", "score": "0.50454736", "text": "function f(o) {\n var prop = \"arguments\";\n f[prop] = f[prop];\n}", "title": "" }, { "docid": "9b4dc67a79315d04f44ae221da9a2e3f", "score": "0.50433975", "text": "function Hi(props){\n return <div><strong>Hello {props.name}!</strong>\n <h1>Welcome to React</h1>\n <h2>So far all is good</h2>\n <li>test 1</li>\n <li>test 2</li>\n\n {5 + 10}\n </div>\n}", "title": "" }, { "docid": "39d1cff548cae19233902be56751a025", "score": "0.50353134", "text": "function DynamicData(props){\n\n return(\n <div className=\"singlerepate\" style={{border:'1px solid #ccc', padding:'20px', margin:'20px', width:'40%',backgroundColor:'#333',}}>\n <h4>My Name: {props.name}</h4>\n <h5>My profession: {props.profession}</h5>\n </div>\n )\n\n}", "title": "" }, { "docid": "1cd35c4cde8504c7187beeb83576d18a", "score": "0.50318867", "text": "render(){\n \n return (\n <React.Fragment>\n <h1 className=\"m\">Hello {this.props.myname} </h1>\n <N myname={'N'}/>\n \n </React.Fragment>\n );\n }", "title": "" }, { "docid": "bcb10b9bdde496642d988a1e5fcaedd9", "score": "0.5024782", "text": "function FancyButton(props) {\n return (\n <button\n style={{\n // Props #3: use the value of the prop in the location you need it\n fontSize: props.fontSize,\n }}\n >\n {props.children}\n </button>\n );\n}", "title": "" }, { "docid": "1901511da7e339ce5a38b991b63b8b94", "score": "0.5020647", "text": "mergePropsHook () { return {}}", "title": "" }, { "docid": "fb129beed4873d9c3fe788a35d140b1b", "score": "0.50028306", "text": "function App (){\n \n \n return (\n <div className=\"App\">\n \n <Sendingprops/> \n <UseRefuseEffect class=\"useName\"/>\n </div>\n \n );\n}", "title": "" }, { "docid": "1716acf09f0f6e8b99d1e3e1dbf46ba0", "score": "0.4997227", "text": "function MyApp({ Component, pageProps }) {\n return (\n <Layout>\n <Component {...pageProps} />\n </Layout>\n );\n}", "title": "" }, { "docid": "4f98980751b69bdfc33294546171ab57", "score": "0.4995287", "text": "function App() {\n const [taskArr, setTaskArr] = useState([])\n const [taskCurr, setTaskCurr] = useState('')\n const onChangeHandle = input => setTaskCurr(input)\n\n //? Is there a cleaner way to send these props/states in?\n return (\n <div className=\"App\">\n <input type=\"text\" id=\"input-task\" onChange={(e) => onChangeHandle(e.target.value)}/>\n <button id=\"button-task\" onClick={() => NewTask({taskArr, setTaskArr, taskCurr})}>Add Task</button> \n <List Todo={Todo} taskArr={taskArr} />\n </div>\n );\n}", "title": "" }, { "docid": "19e30005a7eef634a522b3448204ffdd", "score": "0.4993103", "text": "function IndividualFriend (props ) {\n return <div className='individual-friend'>\n <h3>ID: {props.id}</h3>\n <span>|</span>\n <h3>Name: {props.name}</h3>\n <span>|</span>\n <h3>Age: {props.age}</h3>\n <span>|</span>\n <h3>Email: {props.email}</h3>\n </div>\n}", "title": "" }, { "docid": "e4d4a2e9d7f2547af612e97123da812e", "score": "0.4992123", "text": "function App() {\n\nreturn (\n\n<div>\n\n<Counter />\n\n<LoginComponent /> \n\n<ButtonComponent />\n\n<Hello />\n\n<Welcome name = \"Jake\" />\n\n<Greet name=\"John\"/>\n\n<State/>\n\n</div>\n\n);\n\n}", "title": "" }, { "docid": "a4a2e3e6ec6dd096ca1d9b360fa5cd09", "score": "0.49859825", "text": "render() {\n let ThemedComponent = this._themedComponent()\n return <ThemedComponent {...this._themedInputProps()} />\n }", "title": "" }, { "docid": "0edd6fbfc7d77c770a1fc7727ba4188f", "score": "0.49844524", "text": "function Prop(options) {\n if (options === void 0) { options = {}; }\n return function (target, key) {\n if (!Array.isArray(options) && typeof options.type === 'undefined') {\n options.type = Reflect.getMetadata('design:type', target, key);\n }\n vueClassComponent.createDecorator(function (componentOptions, k) {\n (componentOptions.props || (componentOptions.props = {}))[k] = options;\n })(target, key);\n };\n}", "title": "" }, { "docid": "0edd6fbfc7d77c770a1fc7727ba4188f", "score": "0.49844524", "text": "function Prop(options) {\n if (options === void 0) { options = {}; }\n return function (target, key) {\n if (!Array.isArray(options) && typeof options.type === 'undefined') {\n options.type = Reflect.getMetadata('design:type', target, key);\n }\n vueClassComponent.createDecorator(function (componentOptions, k) {\n (componentOptions.props || (componentOptions.props = {}))[k] = options;\n })(target, key);\n };\n}", "title": "" }, { "docid": "598873f0e201bbca47f9c860b8c79f68", "score": "0.49837604", "text": "function WrappedApp({ Component, pageProps }) {\n return <Component { ...pageProps } />;\n}", "title": "" }, { "docid": "c84c7aba8a7fa846923477674bb8b30a", "score": "0.49743757", "text": "render() {\n\t return (\n\t <header className=\"App-header\">\n\t\t<img src={logo} className=\"App-logo\" alt=\"logo\" />\n\t\t{/* <p> */}\n\t\t {/* Added Learned about passing in parameters (strings)*/}\n\t\t Edit <code>src/App.js</code> and save to reload. ({this.props.title})\n\t\t{/* </p> */}\n\t\t\n\t\t{/* Added Learned about passing in parameters (numbers)*/}\n\t\t{/* <div>{this.props.num}</div> */}\n \n\t\t{/* Added Learned about passing in parameters (Objects)*/}\n\t\t{/* <div>{this.props.myObj.a}</div> */}\n\t\t{/* <div>{this.props.myObj.b}</div> */}\n \n\t\t{/* Added Learned about passing in parameters (Turn Objects into Strings) */}\n\t\t{/* <div>{JSON.stringify(this.props.myObj.b)}</div> */}\n \n\t\t{/* Added Learned about passing in parameters (Get Arrays)*/}\n\t\t{/* <div>{this.props.myArr[0]}</div> */}\n\t\t{/* <div>{this.props.myArr[1]}</div> */}\n\t\t{/* <div>{this.props.myArr[2]}</div> */}\n \n \n\t\t{/* Added Learned about passing in parameters (Passing in functions)*/}\n\t\t{/* <div>{this.props.myFuncAdd(10,12)}</div> */}\n\t\t{/* <div>{this.props.myFuncSub(12,10)}</div> */}\n\t\t{/* <div>{this.props.myFuncMult(2,2)}</div> */}\n \n\t\t<a\n\t\t className=\"App-link\"\n\t\t href=\"https://reactjs.org\"\n\t\t target=\"_blank\"\n\t\t rel=\"noopener noreferrer\"\n\t\t>\n\t\t Learn React\n\t\t</a>\n\t </header>\n\t )\n\t}", "title": "" } ]
c130a5bbc6bb5bdd22c26c403032aa4d
Inserts this part into a container. This part must be empty, as its contents are not automatically moved.
[ { "docid": "5ca464872aaeb182ebf47d6c32f3395a", "score": "0.5446242", "text": "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "title": "" } ]
[ { "docid": "c0cc82ed8b67af14d12b0896f161770e", "score": "0.6418116", "text": "insertAfterPart(ref) {\n ref._insert(this.startNode = (0, _template.createMarker)());\n\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "c2e2eff0993021f2459523fe0317de0f", "score": "0.6401022", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = (0, _template.createMarker)());\n\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "c2e2eff0993021f2459523fe0317de0f", "score": "0.6401022", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = (0, _template.createMarker)());\n\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "c2e2eff0993021f2459523fe0317de0f", "score": "0.6401022", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = (0, _template.createMarker)());\n\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "c2e2eff0993021f2459523fe0317de0f", "score": "0.6401022", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = (0, _template.createMarker)());\n\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "c2e2eff0993021f2459523fe0317de0f", "score": "0.6401022", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = (0, _template.createMarker)());\n\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "577ce721d3df2d8811cfe7db71319e4b", "score": "0.6393413", "text": "attach() {\n this.element_.insertBefore(this.container_, this.element_.firstChild);\n }", "title": "" }, { "docid": "5cf323c8642405e75dfe06031084ca3d", "score": "0.63874173", "text": "appendIntoPart(part) {\n part._insert(this.startNode = (0, _template.createMarker)());\n\n part._insert(this.endNode = (0, _template.createMarker)());\n }", "title": "" }, { "docid": "2427da315d7cb402e36d52b2910e7f09", "score": "0.6359922", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = (0, _template.createMarker)());\n\n part.__insert(this.endNode = (0, _template.createMarker)());\n }", "title": "" }, { "docid": "2427da315d7cb402e36d52b2910e7f09", "score": "0.6359922", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = (0, _template.createMarker)());\n\n part.__insert(this.endNode = (0, _template.createMarker)());\n }", "title": "" }, { "docid": "2427da315d7cb402e36d52b2910e7f09", "score": "0.6359922", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = (0, _template.createMarker)());\n\n part.__insert(this.endNode = (0, _template.createMarker)());\n }", "title": "" }, { "docid": "2427da315d7cb402e36d52b2910e7f09", "score": "0.6359922", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = (0, _template.createMarker)());\n\n part.__insert(this.endNode = (0, _template.createMarker)());\n }", "title": "" }, { "docid": "2427da315d7cb402e36d52b2910e7f09", "score": "0.6359922", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = (0, _template.createMarker)());\n\n part.__insert(this.endNode = (0, _template.createMarker)());\n }", "title": "" }, { "docid": "641f2a08b7092cd2455a518119ddc912", "score": "0.63104475", "text": "insertAfterPart(ref) {\n ref._insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "7b1da33d7fe89869c6e6e4689019c7ec", "score": "0.63043547", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "7b1da33d7fe89869c6e6e4689019c7ec", "score": "0.63043547", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "b4a8ecd450181c34edfaa28182d5bb54", "score": "0.62970537", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "b4a8ecd450181c34edfaa28182d5bb54", "score": "0.62970537", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "b4a8ecd450181c34edfaa28182d5bb54", "score": "0.62970537", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "2873ceb060f521c1b7e150d0ceafe483", "score": "0.62956524", "text": "insertAfterPart(ref) {\n ref._insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "8138221e5424a4814b05e671f864afdb", "score": "0.6283328", "text": "insertAfterPart(ref) {\n ref._insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "931e449312460e121153f7282a85427a", "score": "0.6274588", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "931e449312460e121153f7282a85427a", "score": "0.6274588", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "931e449312460e121153f7282a85427a", "score": "0.6274588", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "501e8ad020d8d8890ac265bd035c20bd", "score": "0.626676", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "1967a69a49d23ef9c74ca5ff51db3882", "score": "0.62262", "text": "insertAfterPart(ref) {\n ref.__insert(this.startNode = (0,_template_js__WEBPACK_IMPORTED_MODULE_5__.createMarker)());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }", "title": "" }, { "docid": "bf7f226c0402022d023a91288f650be9", "score": "0.61874634", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = createMarker());\n part.__insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "901c17464a2e6af3ccc3cdb27db4ffbd", "score": "0.61824656", "text": "appendIntoPart(part) {\n part._insert(this.startNode = createMarker());\n part._insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "6b5f31b3199d71b10781ff00a5f5c275", "score": "0.6156325", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = (0,_template_js__WEBPACK_IMPORTED_MODULE_5__.createMarker)());\n part.__insert(this.endNode = (0,_template_js__WEBPACK_IMPORTED_MODULE_5__.createMarker)());\n }", "title": "" }, { "docid": "6fd53fd2998049ba23735f53060624ed", "score": "0.61550564", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = createMarker());\n part.__insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "6fd53fd2998049ba23735f53060624ed", "score": "0.61550564", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = createMarker());\n part.__insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "6fd53fd2998049ba23735f53060624ed", "score": "0.61550564", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = createMarker());\n part.__insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "9574ee39c45e94449c96271450607c6b", "score": "0.6143353", "text": "appendIntoPart(part) {\n part._insert(this.startNode = createMarker());\n part._insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "64f935bb7696edde37b7ffac9e6ef019", "score": "0.61312735", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = createMarker());\n part.__insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "64f935bb7696edde37b7ffac9e6ef019", "score": "0.61312735", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = createMarker());\n part.__insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "efa3416c8633a6436985974c166665b6", "score": "0.6125381", "text": "appendIntoPart(part) {\n part._insert(this.startNode = createMarker());\n part._insert(this.endNode = createMarker());\n }", "title": "" }, { "docid": "506125a645fe79655d9fbe6693b90028", "score": "0.61159486", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n part.__insert(this.endNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n }", "title": "" }, { "docid": "506125a645fe79655d9fbe6693b90028", "score": "0.61159486", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n part.__insert(this.endNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n }", "title": "" }, { "docid": "506125a645fe79655d9fbe6693b90028", "score": "0.61159486", "text": "appendIntoPart(part) {\n part.__insert(this.startNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n part.__insert(this.endNode = Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n }", "title": "" }, { "docid": "7847469c53dc40c6139d58c81040b54a", "score": "0.5889251", "text": "appendInto(container) {\n this.startNode = container.appendChild((0, _template.createMarker)());\n this.endNode = container.appendChild((0, _template.createMarker)());\n }", "title": "" }, { "docid": "7847469c53dc40c6139d58c81040b54a", "score": "0.5889251", "text": "appendInto(container) {\n this.startNode = container.appendChild((0, _template.createMarker)());\n this.endNode = container.appendChild((0, _template.createMarker)());\n }", "title": "" }, { "docid": "7847469c53dc40c6139d58c81040b54a", "score": "0.5889251", "text": "appendInto(container) {\n this.startNode = container.appendChild((0, _template.createMarker)());\n this.endNode = container.appendChild((0, _template.createMarker)());\n }", "title": "" }, { "docid": "7847469c53dc40c6139d58c81040b54a", "score": "0.5889251", "text": "appendInto(container) {\n this.startNode = container.appendChild((0, _template.createMarker)());\n this.endNode = container.appendChild((0, _template.createMarker)());\n }", "title": "" }, { "docid": "7847469c53dc40c6139d58c81040b54a", "score": "0.5889251", "text": "appendInto(container) {\n this.startNode = container.appendChild((0, _template.createMarker)());\n this.endNode = container.appendChild((0, _template.createMarker)());\n }", "title": "" }, { "docid": "7847469c53dc40c6139d58c81040b54a", "score": "0.5889251", "text": "appendInto(container) {\n this.startNode = container.appendChild((0, _template.createMarker)());\n this.endNode = container.appendChild((0, _template.createMarker)());\n }", "title": "" }, { "docid": "2a0cd6252b396657c36e2d6e8c5074e8", "score": "0.5785203", "text": "onAdd() {\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }", "title": "" }, { "docid": "a1741ec8a5e550785f6c78167e9e2166", "score": "0.5619086", "text": "addPart(aPart){\n if(!this.acceptsSubpart(aPart.type)){\n throw new Error(`${this.type} does not accept subparts of type ${aPart.type}`);\n }\n\n let found = this.subparts.indexOf(aPart);\n if(found < 0){\n // if the part is a stack then append after the last stack\n if(aPart.type == \"stack\"){\n let allStacks = this.subparts.filter((part) => {\n return part.type == \"stack\";\n });\n this.subparts.splice(allStacks.length, 0, aPart);\n } else {\n this.subparts.push(aPart);\n }\n aPart._owner = this;\n }\n }", "title": "" }, { "docid": "ae0af200c7784d5d986f7c8b70a76c8c", "score": "0.55708826", "text": "function insertOrAppend(container, pos, el) {\n var childs = container.childNodes;\n if (pos < childs.length) {\n var refNode = childs[pos];\n container.insertBefore(el, refNode);\n } else {\n container.appendChild(el);\n }\n }", "title": "" }, { "docid": "e8a5156318f9be4f86a63697e42387eb", "score": "0.5556123", "text": "appendInto(container) {\n this.startNode = container.appendChild((0,_template_js__WEBPACK_IMPORTED_MODULE_5__.createMarker)());\n this.endNode = container.appendChild((0,_template_js__WEBPACK_IMPORTED_MODULE_5__.createMarker)());\n }", "title": "" }, { "docid": "6172074a3e53a3c3a5ad07576256ee88", "score": "0.5546166", "text": "function insertPart(part){\n var text = \"\\n\";\n if (part.nodeType == 3) {\n select.snapshotChanged();\n part = makePartSpan(part);\n text = part.currentText;\n afterBR = false;\n }\n else {\n if (afterBR && window.opera)\n point(makePartSpan(\"\"));\n afterBR = true;\n }\n part.dirty = true;\n nodeQueue.push(part);\n point(part);\n return text;\n }", "title": "" }, { "docid": "c7a5d098ba741949f2edc375a19f9d78", "score": "0.5457814", "text": "appendInto(container) {\n this.startNode = container.appendChild(Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n this.endNode = container.appendChild(Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n }", "title": "" }, { "docid": "c7a5d098ba741949f2edc375a19f9d78", "score": "0.5457814", "text": "appendInto(container) {\n this.startNode = container.appendChild(Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n this.endNode = container.appendChild(Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n }", "title": "" }, { "docid": "c7a5d098ba741949f2edc375a19f9d78", "score": "0.5457814", "text": "appendInto(container) {\n this.startNode = container.appendChild(Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n this.endNode = container.appendChild(Object(_template_js__WEBPACK_IMPORTED_MODULE_5__[\"createMarker\"])());\n }", "title": "" }, { "docid": "c99ad631ee50c331e484d4ae7a8bbde5", "score": "0.54542613", "text": "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "title": "" }, { "docid": "c99ad631ee50c331e484d4ae7a8bbde5", "score": "0.54542613", "text": "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "title": "" }, { "docid": "c99ad631ee50c331e484d4ae7a8bbde5", "score": "0.54542613", "text": "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "title": "" }, { "docid": "c99ad631ee50c331e484d4ae7a8bbde5", "score": "0.54542613", "text": "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "title": "" }, { "docid": "c8ab89f8531060577971863204f4d649", "score": "0.54330015", "text": "function addToContainer(content) {\n while (panel.container.childNodes.length > 0) {\n panel.container.removeChild(panel.container.firstChild)\n }\n\n panel.container.appendChild(content)\n }", "title": "" }, { "docid": "5c7fcfd1f861b750de9cdf094e01dfe3", "score": "0.5414118", "text": "function addContainer(e) {\n\t\t\t\tvar containerTemplate = _.template($(\"#preview-design-format-container-template\").html());\n\n\t\t\t\tif (e && e.target !== undefined) {\n\t\t\t\t\tif ($genTemplatePage.find(\".section-container\").length > 0) {\n\t\t\t\t\t\t$(e.target).closest(\".section-container\").after(\n\t\t\t\t\t\t\t\tcontainerTemplate());\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$genTemplatePage.find(\".scroll-content\").append(containerTemplate());\n\t\t\t\t}\n\t\t\t\t$genTemplatePage.find(\".add-container\").off('click').click(addContainer);\n\t\t\t\t$genTemplatePage.find(\".delete-container\").off('click').click(deleteContainer);\n\t\t\t\t$genTemplatePage.find(\".section-select-data-btn\").off('click').click(handleSectionSelectData);\n\t\t\t\t$genTemplatePage.find(\".clear-section\").off('click').click(handleClearSection);\n\n\t\t\t\tcontainerDisplayOnHoverAction(\".section-container\");\n\t\t\t\t$genTemplatePage.find(\".selectFormat\").off('change').change(handleSectionFormatChange);\n\t\t\t\t\n\t\t\t\t$genTemplatePage.find(\".input-preview-section-title\").off('keyup kewdown cut paste').on('keyup kewdown cut paste', handleEditSectionTitle);\n\t\t\t\tif(e) {\n\t\t\t\t\t$genTemplatePage.find(\".delete-container\").removeClass(\"hide\");\n\t\t\t\t} else {\n\t\t\t\t\t$genTemplatePage.find(\".delete-container\").addClass(\"hide\");\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "758003aba1d14d30fbd6c36c4960474b", "score": "0.541346", "text": "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "title": "" }, { "docid": "e52d987432cab9af8baa19dc3c9cba3f", "score": "0.54021555", "text": "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "title": "" }, { "docid": "b4388388575095b6ca0ab063add461ed", "score": "0.5374136", "text": "function _containerInsertBefore(nodes) {\n return this._containerInsert(this.key, nodes);\n}", "title": "" }, { "docid": "7a38bfef1bb80219f266a6b50348e8df", "score": "0.53716284", "text": "didInsertElement(){\n\t\tthis._super(...arguments);\n\t\tthis.createMap();\n\t\tthis.service = new google.maps.places.PlacesService(this.map);\n\t}", "title": "" }, { "docid": "a2fa97566df16be7aed52d5a2daefc46", "score": "0.53604096", "text": "appendChildToContainer(stage, child) {\n stage.addChild(child.shape);\n stage.update();\n }", "title": "" }, { "docid": "8f72c660cf379c64d596393e24f04691", "score": "0.5352343", "text": "didInsertElement() {\n this._super(...arguments);\n\n this.createElements();\n }", "title": "" }, { "docid": "f53587d84219440b5ca5dfd8fd752aa3", "score": "0.5325377", "text": "function add(e) {\n const part = new NodePart(container.options);\n part.appendIntoPart(container);\n part.setValue(e);\n part.commit();\n return part;\n }", "title": "" }, { "docid": "780e72ddfe0553737845215724291440", "score": "0.52733535", "text": "function prepend(insertElement) {\n if (elements.length > 0) {\n forEach(elements, function (element, index) {\n element.insertBefore(insertElement, element.firstChild);\n });\n }\n return this;\n }", "title": "" }, { "docid": "026c6f0d3f2d7500ec96c6c3cef5055c", "score": "0.52724224", "text": "addPart(aPart){\n if(!this.acceptsSubpart(aPart.type)){\n throw new Error(`${this.type} does not accept subparts of type ${aPart.type}`);\n }\n\n let found = this.subparts.indexOf(aPart);\n if(found < 0){\n this.subparts.push(aPart);\n aPart._owner = this;\n }\n }", "title": "" }, { "docid": "f8652328d9db82fdfdf442efb0959a69", "score": "0.5262831", "text": "insert(element) {\n this.item.push(element);\n }", "title": "" }, { "docid": "94568e3e2f7552b20a8ffcfd777aa87b", "score": "0.52497995", "text": "function insertLeft() {\n if (!validateValue()) {\n return;\n }\n const queue = document.getElementById(\"queue\");\n if (queue.hasChildNodes()) {\n queue.insertBefore(createDiv(), queue.firstChild);\n } else {\n queue.appendChild(createDiv());\n }\n}", "title": "" }, { "docid": "02d5274e5dc87eea355d45539e63eca2", "score": "0.52373517", "text": "insert(index, details) {\n const that = this;\n\n if (typeof details === 'string') {\n details = { content: details };\n }\n\n if (!details || typeof details !== 'object') {\n that.error(that.localize('invalidSettings', { elementType: that.nodeName.toLowerCase(), method: 'insert' }));\n return;\n }\n\n if (typeof index !== 'number') {\n that.error(that.localize('invalidIndex', { elementType: that.nodeName.toLowerCase(), method: 'insert' }));\n return;\n }\n\n const item = details instanceof Smart.SplitterItem ? details : that._createItem(details);\n\n if (that.contains(item)) {\n if (that._items.indexOf(item) === index) {\n return;\n }\n\n that.removeChild(item);\n }\n\n if (index >= that._items.length || that._items.length === 0) {\n that.appendChild(item);\n }\n else {\n that.insertBefore(item, that._items[index]);\n }\n }", "title": "" }, { "docid": "ede95f35030e612f094a8ea40e6d8d05", "score": "0.52369976", "text": "setupContainer() {\n this.element = document.createElement('div');\n this.element.appendChild(this.editor.element);\n this.element.appendChild(this.message);\n }", "title": "" }, { "docid": "8f55e0005580afd5f4c485239da8d35c", "score": "0.5217224", "text": "function hopAddBlock() {\n\n var curStyle = (_placeholder) ? getRenderedStyle( _placeholder, 'display' ) : null,\n pTop = 0,\n pLeft = 0;\n\n if ( curStyle != 'none' && _placeholder) {\n // get placeholder position\n pos = findPos( _placeholder, _diffLeft, _diffTop );\n pLeft = pos.left;\n pTop = pos.top;\n\n // move add-block there\n _addBlock.style.top = pTop + 'px';\n _addBlock.style.left = pLeft + 'px';\n }\n }", "title": "" }, { "docid": "ac278ae6d2c7b0e72db1614a437ca2b5", "score": "0.5216261", "text": "place() {\n // head must be placed from the oitside\n if (!this.isFirst) {\n this.position.position = this.prev.position;\n const orientation = this.prev.orientation.clone();\n // going the other way than the prev is moving to\n orientation.turnAround();\n this.position.move(orientation);\n }\n // place into map\n this.moveInMap();\n //console.log(\"Placed segment into: \", this.position.x, this.position.y)\n //console.log(this.next, this.snake.segments, this.index);\n if (this.next) {\n this.next.place();\n }\n }", "title": "" }, { "docid": "e86ee857347114584e0e26bcc46d076f", "score": "0.51965636", "text": "appendChild(node) {\n const that = this;\n\n if (!that.isCompleted || node instanceof HTMLElement && node.classList.contains('smart-resize-trigger-container')) {\n const args = Array.prototype.slice.call(arguments, 2);\n\n return HTMLElement.prototype.appendChild.apply(that, args.concat(Array.prototype.slice.call(arguments)));\n }\n\n if (!node || !(node instanceof Smart.SplitterItem)) {\n that.error(that.localize('invalidNode', { elementType: that.nodeName.toLowerCase(), method: 'appendChild', node: 'node' }));\n return\n }\n\n that.insertBefore(node, null);\n }", "title": "" }, { "docid": "728c5665c6691599699cb018bde3d9ce", "score": "0.51956123", "text": "async _add() {\n const fragment = new DocumentFragment();\n const clone = this.template.content.cloneNode(true);\n const itemDescription = await this.getItemDescription();\n if(itemDescription != \"\") {\n clone.querySelector(\"#description\").innerText = itemDescription;\n clone.querySelector(\"#date\").innerText = formattedDate();\n fragment.appendChild(clone);\n document.body.appendChild(fragment);\n }\n }", "title": "" }, { "docid": "69583dd02c0eec6ae013a7ad5ecdb28d", "score": "0.51666653", "text": "_insertBeforeContainer(parent, container, node) {\n if (!container) {\n this._addToParent(node);\n this._elementStack.push(node);\n }\n else {\n if (parent) {\n // replace the container with the new node in the children\n const index = parent.children.indexOf(container);\n parent.children[index] = node;\n }\n else {\n this._rootNodes.push(node);\n }\n node.children.push(container);\n this._elementStack.splice(this._elementStack.indexOf(container), 0, node);\n }\n }", "title": "" }, { "docid": "69583dd02c0eec6ae013a7ad5ecdb28d", "score": "0.51666653", "text": "_insertBeforeContainer(parent, container, node) {\n if (!container) {\n this._addToParent(node);\n this._elementStack.push(node);\n }\n else {\n if (parent) {\n // replace the container with the new node in the children\n const index = parent.children.indexOf(container);\n parent.children[index] = node;\n }\n else {\n this._rootNodes.push(node);\n }\n node.children.push(container);\n this._elementStack.splice(this._elementStack.indexOf(container), 0, node);\n }\n }", "title": "" }, { "docid": "69583dd02c0eec6ae013a7ad5ecdb28d", "score": "0.51666653", "text": "_insertBeforeContainer(parent, container, node) {\n if (!container) {\n this._addToParent(node);\n this._elementStack.push(node);\n }\n else {\n if (parent) {\n // replace the container with the new node in the children\n const index = parent.children.indexOf(container);\n parent.children[index] = node;\n }\n else {\n this._rootNodes.push(node);\n }\n node.children.push(container);\n this._elementStack.splice(this._elementStack.indexOf(container), 0, node);\n }\n }", "title": "" }, { "docid": "69583dd02c0eec6ae013a7ad5ecdb28d", "score": "0.51666653", "text": "_insertBeforeContainer(parent, container, node) {\n if (!container) {\n this._addToParent(node);\n this._elementStack.push(node);\n }\n else {\n if (parent) {\n // replace the container with the new node in the children\n const index = parent.children.indexOf(container);\n parent.children[index] = node;\n }\n else {\n this._rootNodes.push(node);\n }\n node.children.push(container);\n this._elementStack.splice(this._elementStack.indexOf(container), 0, node);\n }\n }", "title": "" }, { "docid": "69583dd02c0eec6ae013a7ad5ecdb28d", "score": "0.51666653", "text": "_insertBeforeContainer(parent, container, node) {\n if (!container) {\n this._addToParent(node);\n this._elementStack.push(node);\n }\n else {\n if (parent) {\n // replace the container with the new node in the children\n const index = parent.children.indexOf(container);\n parent.children[index] = node;\n }\n else {\n this._rootNodes.push(node);\n }\n node.children.push(container);\n this._elementStack.splice(this._elementStack.indexOf(container), 0, node);\n }\n }", "title": "" }, { "docid": "be72b166acdaa3511bc9e042b4bd45e6", "score": "0.51206064", "text": "mount(content) {\n if (content instanceof Array) {\n while (this.firstChild) this.removeChild(this.lastChild);\n for (let n of content) {\n if (n instanceof Node) {\n this.appendChild(n);\n } else {\n this.insertAdjacentHTML(\"beforeend\", n);\n }\n }\n } else if (content instanceof Node) {\n while (this.firstChild) this.removeChild(this.lastChild);\n this.appendChild(content);\n } else if (content != null) {\n this.innerHTML = content;\n }\n }", "title": "" }, { "docid": "4aabe915628240283cbfd82a1a6a8959", "score": "0.51109564", "text": "@action\n\tdidInsert(element) {\n\t\tthis._element = element;\n\t}", "title": "" }, { "docid": "cab6aa004888f0b624b123bcd3d938b4", "score": "0.51091164", "text": "function prepareNewElement(data, offset) {\n\t\t// extract necessary content\n\t\tdata = $(data).find(contentDiv);\n\t\t\n\t\t// insert new content\n\t\t$(contentWrapper).append(data);\n\t\t\n\t\t// set width to parent width\n\t\tdata.css('width', $(contentWrapper).css('width'));\n\t\t\n\t\t// set starting position\n\t\tdata.css('left', offset);\n\t}", "title": "" }, { "docid": "f8b6220fc83dd8729453b31f835945aa", "score": "0.5098643", "text": "onAdd() {\n this.getPanes().floatPane.appendChild(this.content)\n this.content.style.display = 'block'\n }", "title": "" }, { "docid": "5e33502a259c2d02d5ee8a64b170863e", "score": "0.50957173", "text": "appendChild(node) {\n const that = this;\n\n if (!node) {\n that.error(that.localize('invalidNode', { elementType: that.nodeName.toLowerCase(), method: 'appendChild', node: 'node' }));\n return\n }\n\n if (!that.isCompleted || node instanceof HTMLElement && node.classList.contains('smart-resize-trigger-container')) {\n const args = Array.prototype.slice.call(arguments, 2);\n return HTMLElement.prototype.appendChild.apply(that, args.concat(Array.prototype.slice.call(arguments)));\n }\n\n that.$.content.appendChild(node);\n }", "title": "" }, { "docid": "15c9a75acfb006e7394ef511001e963d", "score": "0.50885016", "text": "function InsertEl(e)\n{\n var src = e.srcElement || e.target; \n var newDragItem;\n //get div object\n var objEle = Ext.get('container').query('.dropblock');\n if(objEle.length>0)\n {\n newDragItem = Ext.DomHelper.insertAfter(objEle[objEle.length - 1].id,{\n tag:'div',\n cls: 'dropblock',\n html: GetHtml() \n },true);\n }\n else\n {\n // if has label, add the item below the label row.\n var lable = document.getElementById('label');\n var labelOrBtn = lable == null ? 'btn': 'label';\n newDragItem = Ext.DomHelper.insertAfter(labelOrBtn,{\n tag:'div',\n cls: 'dropblock',\n html: GetHtml()\n },true);\n }\n\n FocusAddedItem();\n}", "title": "" }, { "docid": "ce1dd93295a0fca31a571fd59adc165c", "score": "0.508181", "text": "insert(node) {\n if (this.type === NodeAnchorType.Next) {\n this.el.before(node);\n }\n else {\n this.el.append(node);\n }\n }", "title": "" }, { "docid": "ac83743ffbd463b7ea47086cebc23f22", "score": "0.5079213", "text": "onAdd() {\nthis.getPanes().floatPane.appendChild(this.containerDiv);\n}", "title": "" }, { "docid": "f48742f5f38828d121a09637610b3a13", "score": "0.5041097", "text": "insert(index: number, view: View): void | Promise<any> {\n let children = this.children;\n let length = children.length;\n\n if ((index === 0 && length === 0) || index >= length) {\n return this.add(view);\n }\n\n view.insertNodesBefore(children[index].firstChild);\n children.splice(index, 0, view);\n\n if (this.isAttached) {\n view.attached();\n return this.animateView(view, 'enter');\n }\n }", "title": "" }, { "docid": "d93f77ac8c181973fb442d0548ecc48b", "score": "0.50349844", "text": "function insert(injector, node, slotName = '') {\n const { slots, ptr } = injector;\n const target = slots\n ? getSlotContext(injector, slotName).element\n : injector.parentNode;\n domInsert(node, target, ptr ? getAnchorNode(ptr.next, target) : void 0);\n injector.ptr = ptr ? listInsertValueAfter(node, ptr) : listPrependValue(injector, node);\n return node;\n }", "title": "" }, { "docid": "4454edcce15505b871350b7f324abb72", "score": "0.5034809", "text": "function abInsertLayout() {\n\tlet block = wp.blocks.createBlock( 'vt/vt-layouts' );\n\twp.data.dispatch( 'core/editor' ).insertBlocks( block );\n}", "title": "" }, { "docid": "bd99bf1324c3d8b250926e44fc4cefd0", "score": "0.5033078", "text": "addPart(aPart){\n let isValid = this.acceptsSubpart(aPart.type);\n if(!isValid){\n // Consider replacing this generic exception\n // with a message based approach that sends\n // these sorts of non-fatal errors to System\n // as a kind of message. This way we can display\n // errors in SimpltTalk objects.\n throw new Error(`Windows cannot wrap parts of type ${aPart.type}`);\n }\n this.subparts.forEach(subpart => {\n this.removePart(subpart);\n });\n this.subparts.push(aPart);\n aPart._owner = this;\n }", "title": "" }, { "docid": "7caf0fe35bf38917ff6a8760064deb4f", "score": "0.50329703", "text": "appendElements() {\n this.carousel__controls.appendChild(this.carousel__previous)\n this.carousel__controls.appendChild(this.carousel__next)\n this.carousel__container.appendChild(this.carousel__controls)\n this.carousel__container.appendChild(this.carousel__items)\n this.section.appendChild(this.carousel__container)\n this.appendChild(this.section)\n }", "title": "" }, { "docid": "b45f65508e1b04ef5c2fdc528358e555", "score": "0.5021261", "text": "insertBefore(node) {\n if (this.fragment.hasChildNodes()) {\n node.parentNode.insertBefore(this.fragment, node);\n } else {\n const parentNode = node.parentNode;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n\n while (current !== end) {\n next = current.nextSibling;\n parentNode.insertBefore(current, node);\n current = next;\n }\n\n parentNode.insertBefore(end, node);\n }\n }", "title": "" }, { "docid": "05820cf4a9c816cb0a8442ecb65ff1bb", "score": "0.50145864", "text": "function clipart_insertToSlide(idx) {\n\tvar objectSize = 200;\n\t\n\t// SVG\n\tvar element = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\tvar thisPos = getInsertionPosition(element, objectSize, objectSize);\n\t\n\telement.setAttribute(\"class\", \"clipartElement\");\n\telement.style.left = thisPos.x + \"px\";\n\telement.style.top = thisPos.y + \"px\";\n\telement.style.width = objectSize + \"px\";\n\telement.style.height = objectSize + \"px\";\n\telement.style.zIndex = String(zIndexBase);\n\t\n\telement.setAttribute(\"precisionselect\", \"true\");\n\telement.setAttribute(\"movable\", \"true\");\n\telement.setAttribute(\"selectable\", \"true\");\n\telement.setAttribute(\"removable\", \"true\");\n\telement.setAttribute(\"draggable\", \"false\");\n\telement.setAttribute(\"dotid\", \"dot_clipart\"); // To select the tool when the element is selected\n\telement.setAttribute(\"eonresize\", \"shapeOnResize(w, h)\");\n\telement.setAttribute(\"viewBox\", \"-3 -3 106 106\");\n\telement.id = \"CLPA_\" + Date.now();\n\n\t// PATH data\n\tvar pa = iconData[idx].data.indexOf(\"\\\"\") + 1;\n\tvar pb = iconData[idx].data.indexOf(\"\\\"\", pa);\n\tvar pathData = iconData[idx].data.substr(pa, pb - pa);\n\t\n\t// PATH rendering\n\tvar path = document.createElementNS(\"http://www.w3.org/2000/svg\", 'path');\n\tpath.setAttribute(\"d\", pathData);\n\tpath.setAttribute(\"fill\", clipart_color);\n\tpath.setAttribute(\"selectable\", \"true\");\n\tpath.setAttribute(\"class\", \"renderingPath\");\n\telement.appendChild(path);\n\t\n\tcurrentSlide.appendChild(element);\n\tzOrder_bringToFront(element);\n\t\n\tset_selection(element);\n\tdotFromSelection();\n}", "title": "" }, { "docid": "86c6897df4e587ad30b8c004bb3ef4f2", "score": "0.5004149", "text": "function attach() {\r\n if (!container.parentNode) {\r\n doc.body.appendChild(container);\r\n }\r\n }", "title": "" }, { "docid": "227a9c86ca930ae72c4e0f0d25e75e12", "score": "0.50032574", "text": "prepend(parent, child) {\n parent.insertBefore(child, parent.firstChild);\n }", "title": "" } ]
385012c7dc64bd7fb18103649c7af920
function that returns pie chart
[ { "docid": "311604f216c53e6636299a366ac8ef9d", "score": "0.0", "text": "function SexualOrientationPieChart () {\n //get info from the store\n const form = useSelector((store)=>store.form);\n\n //variables to target\n let total=form.length;\n let heterosexual=0;\n let homosexual=0;\n let bisexual=0;\n let asexual=0;\n let noDisclosure=0;\n let heterosexualDisplay=0;\n let homosexualDisplay=0;\n let bisexualDisplay=0;\n let asexualDisplay=0;\n let noDisclosureDisplay=0;\n\n //map through data from the store\n form.map((item)=>{\n //targets proper question\n let answer=item.answers[97]\n //if heterosexual add 1 to heterosexual\n if(answer.answer==='Heterosexual (straight)'){\n heterosexual++\n }\n //if homosexual add 1 to homosexual\n else if(answer.answer==='Homosexual'){\n homosexual++\n }\n //if bisexual add 1 to bisexual\n else if(answer.answer==='Bisexual'){\n bisexual++\n }\n //if asexual add 1 to asexual\n else if(answer.answer==='Asexual'){\n asexual++\n }\n //if nothing add one to no disclosure\n else {\n noDisclosure++\n }\n //display heterosexual count as a percentage of the total\n heterosexualDisplay = ((heterosexual / total) * 100).toFixed(1);\n //display homosexual count as a percentage of the total\n homosexualDisplay = ((homosexual / total) * 100).toFixed(1);\n //display bisexual count as a percentage of the total\n bisexualDisplay = ((bisexual / total) * 100).toFixed(1);\n //display asexual count as a percentage of the total\n asexualDisplay = ((asexual / total) * 100).toFixed(1);\n //display no disclosure as a percentage of the total\n noDisclosureDisplay = ((noDisclosure / total) * 100).toFixed(1);\n })\n //data for the table\n const data = {\n labels: ['Heterosexual (straight) %', 'Homosexual', 'Bisexual', 'Asexual', 'Not Disclosed '],\n datasets: [\n {\n label: '# of Votes',\n data: [\n heterosexualDisplay,\n homosexualDisplay,\n bisexualDisplay,\n asexualDisplay,\n noDisclosureDisplay\n ],\n backgroundColor: [\n 'rgba(188, 149, 255, .2)',\n 'rgba(255, 184, 111, .2)',\n 'rgba(148, 197, 204, 0.2)',\n 'rgba(224, 202, 60, .2)',\n 'rgba(114, 24, 23, 0.2)',\n ],\n borderColor: [\n 'rgba(0, 73, 116, 1)',\n 'rgba(0, 73, 116, 1)',\n 'rgba(0, 73, 116, 1)',\n 'rgba(0, 73, 116, 1)',\n 'rgba(0, 73, 116, 1)',\n ],\n borderWidth: 1,\n },\n ],\n };\n //returns total and pie chart\n return (\n <>\n <div className='header'>\n <h1 className='title'>Sexual Orientation</h1>\n </div>\n <Pie data={data} />\n </>\n )\n}", "title": "" } ]
[ { "docid": "48ce6a1aee6398396a7ea59cd94d0ea9", "score": "0.7393841", "text": "function create_pie_chart_3(index) {\n var white = +(param_data[index][\"% White\"] * 100).toFixed(2),\n black = +(param_data[index][\"% Black\"] * 100).toFixed(2),\n hispanic = +(param_data[index][\"% Hispanic\"] * 100).toFixed(2),\n asian = +(param_data[index][\"% Asian\"] * 100).toFixed(2),\n american_indian = +(param_data[index][\"% American Indian\"] * 100).toFixed(2),\n pacific_islander = +(param_data[index][\"% Pacific Islander\"] * 100).toFixed(2),\n biracial = +(param_data[index][\"% Biracial\"] * 100).toFixed(2),\n nonresident = +(param_data[index][\"% Nonresident Aliens\"] * 100).toFixed(2);\n\n var pie3_data =\n {\n labels: [\"White\", \"Black\", \"Hispanic\", \"Asian\", \"American Indian\", \"Pacific Islander\", \"Biracial\", \"Nonresidents\"],\n values: [white, black, hispanic, asian, american_indian, pacific_islander, biracial, nonresident]\n };\n\n console.log(pie3_data);\n\n create_pie(\"#pies\", pie3_data, \"#pie3\",\n [\"#8dd3c7\", \"#ffffb3\", \"#bebada\", \"#fb8072\", \"#80b1d3\", \"#fdb462\", \"#b3de69\", \"#fccde5\"], \"Ethnicity Distribution\");\n show(\"#pie3\")\n }", "title": "" }, { "docid": "3f06a56dc052d3c3d7e649445be5c9dc", "score": "0.73319805", "text": "function pieChartData(data) { \n output_pie = [];\n\n var pie_trace = {\n labels: data[0][\"labels\"],\n values: data[0][\"values\"],\n type: \"pie\",\n text: data[0][\"hoverinfo\"],\n hoverinfo: `label+text+value+percent`,\n textinfo: `percent`\n };\n\n var pie_layout = {\n \"showlegend\": true,\n \"height\": 500, \n \"width\": 500,\n \"margin\":{t: 0, b:0}\n }\n var pie_data = [pie_trace];\n\n output_pie.push(pie_data);\n output_pie.push(pie_layout);\n \n return output_pie;\n}", "title": "" }, { "docid": "b7842cea79f0f8962042c734dab459e4", "score": "0.72049946", "text": "function generatePieChart() {\n var pieChartOutline = {\n \t\"header\": {\n \t\t\"title\": {\n \t\t\t\"text\": \"Inheritance\",\n \t\t\t\"fontSize\": 20,\n \t\t\t\"font\": \"Helvetica Neue\",\n // \"font-weight\": \"bold\",\n \t\t},\n \t\t\"subtitle\": {\n \"text\": \"\",\n \"color\": \"#ffffff\",\n \t\t\t\"fontSize\": 12,\n \t\t\t\"font\": \"open sans\"\n \t\t},\n \t\t\"titleSubtitlePadding\": 9\n \t},\n \t\"footer\": {\n \"color\": \"#999999\",\n \t\t\"fontSize\": 15,\n \t\t\"font\": \"open sans\",\n \t\t\"location\": \"\"\n \t},\n \t\"size\": {\n \"canvasHeight\": 350,\n \t\t\"canvasWidth\": 450,\n \t\t\"pieOuterRadius\": \"90%\"\n \t},\n \t\"data\": {\n \t\t\"sortOrder\": \"value-desc\",\n \t\t\"content\": [\n \t\t\t{\n \t\t\t\t\"label\": \"Inherited\",\n \t\t\t\t\"value\": $(\".source_data\").data(\"inherited\"),\n \t\t\t\t\"color\": \"#2484c1\"\n \t\t\t},\n \t\t\t{\n \t\t\t\t\"label\": \"De novo\",\n \t\t\t\t\"value\": $(\".source_data\").data(\"denovo\"),\n \t\t\t\t\"color\": \"#71afd7\"\n \t\t\t},\n \t\t\t{\n \t\t\t\t\"label\": \"Unknown\",\n \t\t\t\t\"value\": $(\".source_data\").data(\"unknown\"),\n \t\t\t\t\"color\": \"#4daa4b\"\n \t\t\t}\n \t\t]\n \t},\n \"labels\": {\n\t\t\"outer\": {\n\t\t\t\"pieDistance\": 32\n\t\t},\n\t\t\"inner\": {\n \"format\": \"value\",\n\t\t\t\"hideWhenLessThanPercentage\": 3\n\t\t},\n\t\t\"mainLabel\": {\n\t\t\t\"fontSize\": 16\n\t\t},\n\t\t\"percentage\": {\n\t\t\t\"color\": \"#ffffff\",\n\t\t\t\"decimalPlaces\": 0,\n \"fontSize\": 14\n\t\t},\n\t\t\"value\": {\n\t\t\t\"color\": \"#ffffff\",\n\t\t\t\"fontSize\": 14\n\t\t},\n\t\t\"lines\": {\n\t\t\t\"enabled\": true\n\t\t},\n\t\t\"truncation\": {\n\t\t\t\"enabled\": true\n\t\t}\n\t},\n\t\"effects\": {\n // Remove to re-enable effects\n \"load\": { //this\n\t\t\t\"effect\": \"none\" //this\n\t\t}, //this\n\t\t\"pullOutSegmentOnClick\": {\n\t\t\t// \"effect\": \"linear\", // put this back in\n \"effect\": \"none\", //this\n \"speed\": 400,\n\t\t\t\"size\": 8\n\t\t}, // this (only the comma)\n \"highlightSegmentOnMouseover\": false, //this\n\t\t\"highlightLuminosity\": -0.5 //this\n\t},\n\t\"misc\": {\n\t\t\"gradient\": {\n\t\t\t\"enabled\": true,\n\t\t\t\"percentage\": 100\n\t\t}\n\t}\n};\n\n // Scale down the pie chart, title, and labels if the screen is narrower than 580 pixels\n if (window.innerWidth <= 580) {\n pieChartOutline.size.canvasWidth = parseInt(225 * window.innerWidth / 580 + 225);\n pieChartOutline.size.canvasHeight = parseInt(175 * window.innerWidth / 580 + 175);\n pieChartOutline.header.title.fontSize = parseInt(10 * window.innerWidth / 580 + 10);\n pieChartOutline.labels.mainLabel.fontSize = parseInt(8 * window.innerWidth / 580 + 8);\n pieChartOutline.labels.value.fontSize = parseInt(7 * window.innerWidth / 580 + 7);\n }\n\n // Generate the pie chart using d3.pie\n var pie = new d3pie(\"pieChart\", pieChartOutline);\n }", "title": "" }, { "docid": "bcdcfb506bfdd1039c48b4ca7b13d9a7", "score": "0.71673495", "text": "function getPieChart (title, data) {\n return {\n \"header\": {\n \"title\": {\n \"text\": title\n }\n },\n \"size\": {\n \"canvasWidth\": 500,\n \"canvasHeight\": 500,\n \"pieOuterRadius\": \"75%\"\n },\n \"data\": {\n \"sortOrder\": \"value-desc\",\n \"content\": data\n },\n \"labels\": {\n \"outer\": {\n \"pieDistance\": 32\n },\n \"inner\": {\n \"hideWhenLessThanPercentage\": 3\n },\n \"mainLabel\": {\n \"fontSize\": 11\n },\n \"percentage\": {\n \"color\": \"#ffffff\",\n \"decimalPlaces\": 0\n },\n \"value\": {\n \"color\": \"#adadad\",\n \"fontSize\": 11\n },\n \"lines\": {\n \"enabled\": true\n },\n \"truncation\": {\n \"enabled\": true\n }\n },\n \"effects\": {\n \"pullOutSegmentOnClick\": {\n \"effect\": \"linear\",\n \"speed\": 400,\n \"size\": 8\n }\n },\n \"misc\": {\n \"gradient\": {\n \"enabled\": true,\n \"percentage\": 100\n }\n }\n };\n}", "title": "" }, { "docid": "9cfc7c168c0882f679504f3e36c6c1b0", "score": "0.71312153", "text": "function _draw_pie() {\n let content = '<g>';\n _chart.slices.forEach( (slice, index) => {\n content += `<path class=\"stroke-${index}\" d=\"M${_trim(slice.points[0].x)},${_trim(slice.points[0].y)} `;\n for ( let i = 1; i < slice.points.length; i++) {\n content += `A ${options.radius} ${options.radius} 0 0 1 ${_trim(slice.points[i].x)} ${_trim(slice.points[i].y)} `;\n }\n content += `\" fill=\"none\" />`;\n const labelPosition = _get_label_position(slice, index);\n content += `<text class=\"label fill-${index}\" transform=\"matrix(1 0 0 1 ${labelPosition.x} ${labelPosition.y}), rotate(90)\">${slice.percent}%</text>`;\n });\n\n content += `<text class=\"total\" transform=\"matrix(1 0 0 1 ${options.viewbox.width/2 - 20} ${options.viewbox.height/2}), rotate(90)\">€${_chart.total.toFixed(1)}m</text></g>`;\n\n return content;\n }", "title": "" }, { "docid": "155a59b3eb0a6e3375bd9b346ec65fff", "score": "0.7119648", "text": "function createChart() {\r\n chart = AmCharts.makeChart( \"chartdiv\", {\r\n\t \"type\": \"pie\",\r\n\t \"theme\": \"light\",\r\n\t \"dataProvider\": dataForGraph,\r\n\t \"titleField\": \"cliente\",\r\n\t \"valueField\": \"venta\",\r\n\t \"labelRadius\": 5,\r\n\r\n\t \"radius\": \"42%\",\r\n\t \"innerRadius\": \"60%\",\r\n\t \"labelText\": \"[[title]]\"\r\n\t} );\r\n}", "title": "" }, { "docid": "00d60a1b2894a5df65266b5f5e9f74f1", "score": "0.7116222", "text": "function create_pie_chart_2(index) {\n var num_unemployed = +param_data[index][\"Number of Unemployed 8 years after entry\"],\n num_employed = +param_data[index][\"Number of Employed 8 years after entry\"];\n\n var total = num_employed + num_unemployed;\n\n var percent_unemployed = Math.round(num_unemployed / total * 100),\n percent_employed = Math.round(num_employed / total * 100);\n\n console.log(percent_employed);\n\n var pie2_data =\n {\n labels: [\"Unemployed 8 years after entry\", \"Employed 8 years after entry\"],\n values: [percent_unemployed, percent_employed]\n };\n\n if (num_unemployed !== 0 && num_employed !== 0) {\n create_pie(\"#pies\", pie2_data, \"#pie2\", [\"#fbb4ae\", \"#b3cde3\"], \"Employment Rate\");\n show(\"#pie2\");\n } else {\n hide(\"#pie2\");\n }\n }", "title": "" }, { "docid": "3c2ec3794da081c1bdf5763d6192d7a8", "score": "0.7008802", "text": "function renderPieChart () {\n const x = width / 2;\n const y = height / 2;\n const r = Math.min(x, y) - 2;\n const set = sets[0];\n const sum = sumSet(set);\n\n let a1 = 1.5 * Math.PI;\n let a2 = 0;\n\n for (let i = 0; i < set.length; i++) {\n ctx.fillStyle = colorOf(i);\n ctx.beginPath();\n a2 = a1 + ((set[i] / sum) * (2 * Math.PI));\n\n // TODO opts.wedge\n ctx.arc(x, y, r, a1, a2, false);\n ctx.lineTo(x, y);\n ctx.fill();\n a1 = a2;\n }\n}", "title": "" }, { "docid": "886ffe90ae075542717e3c7617111306", "score": "0.6941065", "text": "function pieData (rows, total) {\n var ratio = parseFloat(total) / 100, // total / 100%\n data = [];\n\n for (var i=0; i < rows.length; i++) {\n var percentage = parseFloat(rows[i].total) / ratio;\n data.push({\n name: rows[i].name,\n y: parseFloat(percentage.toFixed(2)),\n total: parseInt(rows[i].total) // custom data\n });\n }\n return data;\n}", "title": "" }, { "docid": "5daa4fafd590851638076edd252f3c8a", "score": "0.6887544", "text": "function pieChart(jsonData, chartid) {\n\n\t// Config settings\n\tvar chartSizePercent = 75;\n\t// The chart radius relative to the canvas width/height (in percent)\n\tvar sliceBorderWidth = 1;\n\t// Width (in pixels) of the border around each slice\n\tvar sliceBorderStyle = \"#fff\";\n\t// Colour of the border around each slice\n\tvar sliceGradientColour = \"#ddd\";\n\t// Colour to use for one end of the chart gradient\n\tvar maxPullOutDistance = 20;\n\t// How far, in pixels, to pull slices out when clicked\n\tvar pullOutFrameStep = 2;\n\t// How many pixels to move a slice with each animation frame\n\tvar pullOutFrameInterval = 40;\n\t// How long (in ms) between each animation frame\n\tvar pullOutLabelPadding = 30;\n\t// Padding between pulled-out slice and its label\n\tvar pullOutLabelFont = \"12px Arial, Verdana, sans-serif\";\n\t// Pull-out slice label font\n\tvar pullOutValueFont = \"12px Arial, Verdana, sans-serif\";\n\t// Pull-out slice value font\n\tvar pullOutValuePrefix = \"\";\n\t// Pull-out slice value prefix\n\tvar pullOutShadowColour = \"rgba( 0, 0, 0, .5 )\";\n\t// Colour to use for the pull-out slice shadow\n\tvar pullOutShadowOffsetX = 5;\n\t// X-offset (in pixels) of the pull-out slice shadow\n\tvar pullOutShadowOffsetY = 5;\n\t// Y-offset (in pixels) of the pull-out slice shadow\n\tvar pullOutShadowBlur = 5;\n\t// How much to blur the pull-out slice shadow\n\tvar pullOutBorderWidth = 2;\n\t// Width (in pixels) of the pull-out slice border\n\tvar pullOutBorderStyle = \"#333\";\n\t// Colour of the pull-out slice border\n\tvar chartStartAngle = -.5 * Math.PI;\n\t// Start the chart at 12 o'clock instead of 3 o'clock\n\n\t// Declare some variables for the chart\n\tvar canvas;\n\t// The canvas element in the page\n\tvar currentPullOutSlice = -1;\n\t// The slice currently pulled out (-1 = no slice)\n\tvar currentPullOutDistance = 0;\n\t// How many pixels the pulled-out slice is currently pulled out in the animation\n\tvar animationId = 0;\n\t// Tracks the interval ID for the animation created by setInterval()\n\tvar chartData = [];\n\t// Chart data (labels, values, and angles)\n\tvar chartColours = [];\n\t// Chart colours (pulled from the HTML table)\n\tvar totalValue = 0;\n\t// Total of all the values in the chart\n\tvar canvasWidth;\n\t// Width of the canvas, in pixels\n\tvar canvasHeight;\n\t// Height of the canvas, in pixels\n\tvar centreX;\n\t// X-coordinate of centre of the canvas/chart\n\tvar centreY;\n\t// Y-coordinate of centre of the canvas/chart\n\tvar chartRadius;\n\t// Radius of the pie chart, in pixels\n\tvar flag = 0;\n\n\tvar ct = 0;\n\tvar sliceArray = [];\n\t// Set things up and draw the chart\n\tinit();\n\n\t/**\n\t * Set up the chart data and colours, as well as the chart and draw the initial pie chart\n\t */\n\n\tfunction init() {\n\n\t\t// Get the canvas element in the page\n\t\tcanvas = document.getElementById(chartid);\n\n\t\t// Exit if the browser isn't canvas-capable\n\t\tif ( typeof canvas.getContext === 'undefined')\n\t\t\treturn;\n\n\t\t// Initialise some properties of the canvas and chart\n\t\tcanvasWidth = canvas.width;\n\t\tcanvasHeight = canvas.height;\n\t\tcentreX = canvasWidth / 2;\n\t\tcentreY = canvasHeight / 2;\n\t\tchartRadius = Math.min(canvasWidth, canvasHeight) / 2 * (chartSizePercent / 100);\n\n\t\t// Grab the data from the json,\t\t\n\t\tvar currentPos = 0;\n\t\tvar currentRow = 1;\t\t\n\t\tvar hex;\n\t\tif (jsonData.xdata.length > 0) {\n\t\t\tfor(var i=0;i<jsonData.xdata.length ;i++,currentRow++){\n\t\t\t\tvar value = parseFloat(jsonData.ydata[i]);\t\t\t\t\t\t\t\t\n\t\t\t\ttotalValue += value;\n\t\t\t\tvalue = value.toFixed(2);\t\t\t\t\n\t\t\t\tchartData[currentRow] = [];\n\t\t\t\tchartData[currentRow]['label']=jsonData.xdata[i];\t\t\t\t\n\t\t\t\tchartData[currentRow]['value']=value;\n\t\t\t\thex = (jsonData.color[i]).match(/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/);\n\t\t\t\tchartColours[currentRow] = [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)];\n\t\t\t}\t\t\t\n\t\t\t// The current position of the slice in the pie (from 0 to 1)\n\t\t\tfor (var slice in chartData) {\n\t\t\t\tchartData[slice]['startAngle'] = 2 * Math.PI * currentPos;\n\t\t\t\tchartData[slice]['endAngle'] = 2 * Math.PI * (currentPos + (chartData[slice]['value'] / totalValue));\n\t\t\t\tcurrentPos += chartData[slice]['value'] / totalValue;\n\t\t\t}\t\t\t\n\t\t}else{\n\t\t\tcurrentRow = 2;\n\t\t\tchartData[currentRow] = [];\n\t\t\tchartData[currentRow]['label'] = \"No Records\";\n\t\t\tchartData[currentRow]['value'] = 0;\t\t\t\n\t\t\thex = \"#ED5713\".match(/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/);\n\t\t\tchartColours[currentRow] = [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)];\n\t\t\ttotalValue = 100;\n\t\t\tflag = 1;\t\t\t\t\t\t\n\t\t\t// The current position of the slice in the pie (from 0 to 1)\n\t\t\tfor (var slice in chartData) {\n\t\t\t\tchartData[slice]['startAngle'] = 2 * Math.PI * currentPos;\n\t\t\t\tchartData[slice]['endAngle'] = 2 * Math.PI * (currentPos + (100 / totalValue));\n\t\t\t\tcurrentPos += 100 / totalValue;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t// All ready! Now draw the pie chart, and add the click handler to it\n\t\tdrawChart();\n\t\t$(\"#\" + chartid).click(handleChartClick);\n\t}\n\n\t/**\n\t * Process mouse clicks in the chart area.\n\t *\n\t * If a slice was clicked, toggle it in or out. If the user clicked outside\n\t * the pie, push any slices back in.\n\t *\n\t * @param Event\n\t * The click event\n\t */\n\n\tfunction handleChartClick(clickEvent) {\n\n\t\t// Get the mouse cursor position at the time of the click, relative to the canvas\n\t\tvar parentOffset = $(this).parent().offset();\n\t\tvar mouseX = clickEvent.pageX - parentOffset.left;\n\t\tvar mouseY = clickEvent.pageY - parentOffset.top;\n\n\t\t// Was the click inside the pie chart?\n\t\tvar xFromCentre = mouseX - centreX;\n\t\tvar yFromCentre = mouseY - centreY;\n\t\tvar distanceFromCentre = Math.sqrt(Math.pow(Math.abs(xFromCentre), 2) + Math.pow(Math.abs(yFromCentre), 2));\n\n\t\tif (distanceFromCentre <= chartRadius) {\n\n\t\t\t// Yes, the click was inside the chart.\n\t\t\t// Find the slice that was clicked by comparing angles relative to the chart centre.\n\n\t\t\tvar clickAngle = Math.atan2(yFromCentre, xFromCentre) - chartStartAngle;\n\t\t\tif (clickAngle < 0)\n\t\t\t\tclickAngle = 2 * Math.PI + clickAngle;\n\n\t\t\tfor (var slice in chartData) {\n\t\t\t\tif (clickAngle >= chartData[slice]['startAngle'] && clickAngle <= chartData[slice]['endAngle']) {\n\n\t\t\t\t\t// Slice found. Pull it out or push it in, as required.\n\t\t\t\t\ttoggleSlice(slice);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// User must have clicked outside the pie. Push any pulled-out slice back in.\n\t\tpushIn();\n\t}\n\n\t/**\n\t * Process mouse clicks in the table area.\n\t *\n\t * Retrieve the slice number from the jQuery data stored in the clicked\n\t * table cell, then toggle the slice\n\t *\n\t * @param Event\n\t * The click event\n\t */\n\n\tfunction handleTableClick(clickEvent) {\n\t\tvar slice = $(this).data('slice');\n\t\ttoggleSlice(slice);\n\t}\n\n\t/**\n\t * Push a slice in or out.\n\t *\n\t * If it's already pulled out, push it in. Otherwise, pull it out.\n\t *\n\t * @param Number\n\t * The slice index (between 0 and the number of slices - 1)\n\t */\n\n\tfunction toggleSlice(slice) {\n\t\tif (slice == currentPullOutSlice) {\n\t\t\tpushIn();\n\t\t} else {\n\t\t\tstartPullOut(slice);\n\t\t}\n\t}\n\n\t/**\n\t * Start pulling a slice out from the pie.\n\t *\n\t * @param Number\n\t * The slice index (between 0 and the number of slices - 1)\n\t */\n\n\tfunction startPullOut(slice) {\n\n\t\t// Exit if we're already pulling out this slice\n\t\tif (currentPullOutSlice == slice)\n\t\t\treturn;\n\n\t\t// Record the slice that we're pulling out, clear any previous animation, then start the animation\n\t\tcurrentPullOutSlice = slice;\n\t\tcurrentPullOutDistance = 0;\n\t\tclearInterval(animationId);\n\t\tanimationId = setInterval(function() {\n\t\t\tanimatePullOut(slice);\n\t\t}, pullOutFrameInterval);\n\t}\n\n\t/**\n\t * Draw a frame of the pull-out animation.\n\t *\n\t * @param Number\n\t * The index of the slice being pulled out\n\t */\n\n\tfunction animatePullOut(slice) {\n\n\t\t// Pull the slice out some more\n\t\tcurrentPullOutDistance += pullOutFrameStep;\n\n\t\t// If we've pulled it right out, stop animating\n\t\tif (currentPullOutDistance >= maxPullOutDistance) {\n\t\t\tclearInterval(animationId);\n\t\t\treturn;\n\t\t}\n\n\t\t// Draw the frame\n\t\tdrawChart();\n\t}\n\n\t/**\n\t * Push any pulled-out slice back in.\n\t *\n\t * Resets the animation variables and redraws the chart. Also un-highlights\n\t * all rows in the table.\n\t */\n\n\tfunction pushIn() {\n\t\tcurrentPullOutSlice = -1;\n\t\tcurrentPullOutDistance = 0;\n\t\tclearInterval(animationId);\n\t\tdrawChart();\t\t\n\t}\n\n\t/**\n\t * Draw the chart.\n\t *\n\t * Loop through each slice of the pie, and draw it.\n\t */\n\n\tfunction drawChart() {\t\t\n\t\t// Get a drawing context\n\t\tvar context = canvas.getContext('2d');\n\t\t// Clear the canvas, ready for the new frame\n\t\tcontext.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\tif (flag == 0) {\t\t\t\n\t\t\tfor (var slice in chartData) {\n\t\t\t\tsliceArray[ct++] = slice;\n\t\t\t\tif (slice != currentPullOutSlice) {\n\t\t\t\t\tdrawSliceAnimation(context, slice);\n\t\t\t\t}\n\t\t\t}\n\t\t\tflag = 1;\n\t\t\tct = 0;\n\t\t\tsetTimeout(slicePart, 500);\n\t\t} else {\n\t\t\tfor (var slice in chartData) {\n\t\t\t\tif (slice != currentPullOutSlice) {\t\t\t\t\n\t\t\t\t\tdrawSlice(context, slice);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If there's a pull-out slice in effect, draw it.\n\t\t// (We draw the pull-out slice last so its drop shadow doesn't get painted over.)\n\t\tif (currentPullOutSlice != -1)\n\t\t\tdrawSlice(context, currentPullOutSlice);\n\n\t}\n\n\tfunction slicePart() {\n\t\ttoggleSlice(sliceArray[ct]);\n\t\tct++;\n\t\tif (ct <= sliceArray.length) {\n\t\t\tsetTimeout(slicePart, 500);\n\t\t} else {\n\t\t\tcurrentPullOutSlice = -1;\n\t\t}\n\t}\n\n\t/**\n\t * Draw an individual slice in the chart.\n\t *\n\t * @param Context\n\t * A canvas context to draw on\n\t * @param Number\n\t * The index of the slice to draw\n\t */\n\n\tfunction drawSliceAnimation(context, slice) {\n\n\t\t// Compute the adjusted start and end angles for the slice\n\t\tvar startAngle = chartData[slice]['startAngle'] + chartStartAngle;\n\t\tvar endAngle = chartData[slice]['endAngle'] + chartStartAngle;\n\n\t\tvar angle = startAngle;\n\t\tfunction f() {\n\t\t\t// This slice isn't pulled out, so draw it from the pie centre\n\t\t\tstartX = centreX;\n\t\t\tstartY = centreY;\n\n\t\t\t// Set up the gradient fill for the slice\n\t\t\tvar sliceGradient = context.createLinearGradient(0, 0, canvasWidth * .75, canvasHeight * .75);\n\t\t\tsliceGradient.addColorStop(0, sliceGradientColour);\t\t\t\n\t\t\tsliceGradient.addColorStop(1, 'rgb(' + chartColours[slice].join(',') + ')');\n\t\t\t// Draw the slice\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo(startX, startY);\n\t\t\tcontext.arc(startX, startY, chartRadius, startAngle, angle, false);\n\t\t\tcontext.lineTo(startX, startY);\n\t\t\tcontext.closePath();\n\t\t\tcontext.fillStyle = sliceGradient;\n\t\t\tcontext.shadowColor = (slice == currentPullOutSlice) ? pullOutShadowColour : \"rgba( 0, 0, 0, 0 )\";\n\t\t\tcontext.fill();\n\t\t\tcontext.shadowColor = \"rgba( 0, 0, 0, 0 )\";\n\t\t\tif (slice == currentPullOutSlice) {\n\t\t\t\tcontext.lineWidth = pullOutBorderWidth;\n\t\t\t\tcontext.strokeStyle = pullOutBorderStyle;\n\t\t\t} else {\n\t\t\t\tcontext.lineWidth = sliceBorderWidth;\n\t\t\t\tcontext.strokeStyle = sliceBorderStyle;\n\t\t\t}\n\n\t\t\t// Draw the slice border\n\t\t\tcontext.stroke();\n\t\t\tvar lastangle = angle;\n\t\t\tangle = angle + 0.5;\n\t\t\tif (angle < endAngle) {\n\t\t\t\tsetTimeout(f, 70);\n\t\t\t} else if (lastangle < endAngle) {\n\t\t\t\tangle = endAngle;\n\t\t\t\tlastangle = endAngle;\n\t\t\t\tf();\n\t\t\t}\n\t\t}\n\n\t\tf();\n\t}\n\n\tfunction drawSlice(context, slice) {\n\t\t// Compute the adjusted start and end angles for the slice\n\t\tvar startAngle = chartData[slice]['startAngle'] + chartStartAngle;\n\t\tvar endAngle = chartData[slice]['endAngle'] + chartStartAngle;\n\n\t\tif (slice == currentPullOutSlice) {\t\t\t\n\t\t\t// We're pulling (or have pulled) this slice out.\n\t\t\t// Offset it from the pie centre, draw the text label, and add a drop shadow.\n\n\t\t\tvar midAngle = (startAngle + endAngle) / 2;\n\t\t\tvar actualPullOutDistance = currentPullOutDistance * easeOut(currentPullOutDistance / maxPullOutDistance, .8);\n\t\t\tstartX = centreX + Math.cos(midAngle) * actualPullOutDistance;\n\t\t\tstartY = centreY + Math.sin(midAngle) * actualPullOutDistance;\t\t\t\n\t\t\tcontext.fillStyle = 'rgb(' + chartColours[slice].join(',') + ')';\n\t\t\tcontext.textAlign = \"center\";\n\t\t\tcontext.font = pullOutLabelFont;\n\t\t\tcontext.fillText(chartData[slice]['label'], centreX + Math.cos(midAngle) * (chartRadius + maxPullOutDistance + pullOutLabelPadding), centreY + Math.sin(midAngle) * (chartRadius + maxPullOutDistance + pullOutLabelPadding));\n\t\t\tcontext.font = pullOutValueFont;\n\t\t\tcontext.fillText(pullOutValuePrefix + chartData[slice]['value'] + \" (\" + (parseInt(chartData[slice]['value'] / totalValue * 100 + .5)) + \"%)\", centreX + Math.cos(midAngle) * (chartRadius + maxPullOutDistance + pullOutLabelPadding), centreY + Math.sin(midAngle) * (chartRadius + maxPullOutDistance + pullOutLabelPadding) + 10);\n\t\t\tcontext.shadowOffsetX = pullOutShadowOffsetX;\n\t\t\tcontext.shadowOffsetY = pullOutShadowOffsetY;\n\t\t\tcontext.shadowBlur = pullOutShadowBlur;\n\n\t\t} else {\n\n\t\t\t// This slice isn't pulled out, so draw it from the pie centre\n\t\t\tstartX = centreX;\n\t\t\tstartY = centreY;\n\t\t\tvar midAngle = (startAngle + endAngle) / 2;\n\t\t\tvar actualPullOutDistance = currentPullOutDistance * easeOut(currentPullOutDistance / maxPullOutDistance, .8);\n\t\t\tcontext.fillStyle = 'rgb(' + chartColours[slice].join(',') + ')';\n\t\t\tcontext.textAlign = \"left\";\n\t\t\tcontext.font = pullOutLabelFont;\n\t\t\tvar label = chartData[slice]['label'].length > 10 ? chartData[slice]['label'].substring(0, 10) + \"...\" : chartData[slice]['label'];\n\t\t\tcontext.fillText(label + \" , \" + chartData[slice]['value'] + \" (\" + (parseInt(chartData[slice]['value'] / totalValue * 100 + .5)) + \"%)\", 5, 22 * (slice - 1));\n\t\t\tcontext.font = pullOutValueFont;\n\t\t\t/*context.fillText(chartData[slice]['label'], centreX + Math.cos(midAngle) * (chartRadius + maxPullOutDistance + pullOutLabelPadding - 22), centreY + Math.sin(midAngle)\n\t\t\t * (chartRadius + maxPullOutDistance + pullOutLabelPadding - 22));\n\t\t\t */\n\t\t\tcontext.font = pullOutValueFont;\n\t\t\t/*context.fillText(pullOutValuePrefix + chartData[slice]['value'] + \" (\" + (parseInt(chartData[slice]['value'] / totalValue * 100 + .5)) + \"%)\", centreX\n\t\t\t + Math.cos(midAngle) * (chartRadius + maxPullOutDistance + pullOutLabelPadding - 22), centreY + Math.sin(midAngle)\n\t\t\t * (chartRadius + maxPullOutDistance + pullOutLabelPadding - 22) + 10);\n\t\t\t */\n\t\t\tcontext.shadowOffsetX = pullOutShadowOffsetX;\n\t\t\tcontext.shadowOffsetY = pullOutShadowOffsetY;\n\t\t\tcontext.shadowBlur = pullOutShadowBlur;\n\t\t}\n\n\t\t// Set up the gradient fill for the slice\n\t\tvar sliceGradient = context.createLinearGradient(0, 0, canvasWidth * .75, canvasHeight * .75);\n\t\tsliceGradient.addColorStop(0, sliceGradientColour);\n\t\tsliceGradient.addColorStop(1, 'rgb(' + chartColours[slice].join(',') + ')');\n\n\t\t// Draw the slice\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(startX, startY);\n\t\tcontext.arc(startX, startY, chartRadius, startAngle, endAngle, false);\n\t\tcontext.lineTo(startX, startY);\n\t\tcontext.closePath();\n\t\tcontext.fillStyle = sliceGradient;\n\t\tcontext.shadowColor = (slice == currentPullOutSlice) ? pullOutShadowColour : \"rgba( 0, 0, 0, 0 )\";\n\t\tcontext.fill();\n\t\tcontext.shadowColor = \"rgba( 0, 0, 0, 0 )\";\n\n\t\t// Style the slice border appropriately\n\t\tif (slice == currentPullOutSlice) {\n\t\t\tcontext.lineWidth = pullOutBorderWidth;\n\t\t\tcontext.strokeStyle = pullOutBorderStyle;\n\t\t} else {\n\t\t\tcontext.lineWidth = sliceBorderWidth;\n\t\t\tcontext.strokeStyle = sliceBorderStyle;\n\t\t}\n\n\t\t// Draw the slice border\n\t\tcontext.stroke();\n\t}\n\n\t/**\t \n\t * @param Number\n\t * The ratio of the current distance travelled to the maximum\n\t * distance\n\t * @param Number\n\t * The power (higher numbers = more gradual easing)\n\t * @return Number The new ratio\n\t */\n\n\tfunction easeOut(ratio, power) {\n\t\treturn (Math.pow(1 - ratio, power) + 1);\n\t}\n\n}", "title": "" }, { "docid": "3f359405818867f3982ac07a53dd37bb", "score": "0.68811196", "text": "function create_pie_chart_1(index) {\n var percent_part_time = Math.round(+param_data[index][\"% Part-time Undergrads\"] * 100);\n var percent_full_time = 100 - percent_part_time;\n\n var pie1_data =\n {\n labels: [\"Part-time Undergrads\", \"Full-time Undergrads\"],\n values: [percent_part_time, percent_full_time]\n };\n\n if (percent_part_time !== 0) {\n create_pie(\"#pies\", pie1_data, \"#pie1\", [\"#7fc97f\", \"#beaed4\"], \"Student Status\");\n show(\"#pie1\");\n } else {\n hide(\"#pie1\");\n }\n }", "title": "" }, { "docid": "bf8cf9f789029dabd2511c13d128ff5b", "score": "0.68391263", "text": "function pieChart(options) {\n let { width, height, cx, cy, r, lx, ly, data } = options;\n\n // This is the XML namespace for svg elements\n let svg = \"http://www.w3.org/2000/svg\";\n\n // Create the <svg> element, and specify pixel size and user coordinates\n let chart = document.createElementNS(svg, \"svg\");\n chart.setAttribute(\"width\", width);\n chart.setAttribute(\"height\", height);\n chart.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n\n // Define the text styles we'll use for the chart. If we leave these\n // values unset here, they can be set with CSS instead.\n chart.setAttribute(\"font-family\", \"sans-serif\");\n chart.setAttribute(\"font-size\", \"18\");\n\n // Get labels and values as arrays and add up the values so we know how\n // big the pie is.\n let labels = Object.keys(data);\n let values = Object.values(data);\n let total = values.reduce((x, y) => x + y);\n\n // Figure out the angles for all the slices. Slice i starts at angles[i]\n // and ends at angles[i+1]. The angles are measured in radians.\n let angles = [0];\n values.forEach((x, i) => angles.push(angles[i] + (x / total) * 2 * Math.PI));\n\n // Now loop through the slices of the pie\n values.forEach((value, i) => {\n // Compute the two points where our slice intersects the circle\n // These formulas are chosen so that an angle of 0 is at 12 o'clock\n // and positive angles increase clockwise.\n let x1 = cx + r * Math.sin(angles[i]);\n let y1 = cy - r * Math.cos(angles[i]);\n let x2 = cx + r * Math.sin(angles[i + 1]);\n let y2 = cy - r * Math.cos(angles[i + 1]);\n\n // This is a flag for angles larger than a half circle\n // It is required by the SVG arc drawing component\n let big = angles[i + 1] - angles[i] > Math.PI ? 1 : 0;\n\n // This string describes how to draw a slice of the pie chart:\n let path =\n `M${cx},${cy}` + // Move to circle center.\n `L${x1},${y1}` + // Draw line to (x1,y1).\n `A${r},${r} 0 ${big} 1` + // Draw an arc of radius r...\n `${x2},${y2}` + // ...ending at to (x2,y2).\n \"Z\"; // Close path back to (cx,cy).\n\n // Compute the CSS color for this slice. This formula works for only\n // about 15 colors. So don't include more than 15 slices in a chart.\n let color = `hsl(${(i * 40) % 360},${90 - 3 * i}%,${50 + 2 * i}%)`;\n\n // We describe a slice with a <path> element. Note createElementNS().\n let slice = document.createElementNS(svg, \"path\");\n\n // Now set attributes on the <path> element\n slice.setAttribute(\"d\", path); // Set the path for this slice\n slice.setAttribute(\"fill\", color); // Set slice color\n slice.setAttribute(\"stroke\", \"black\"); // Outline slice in black\n slice.setAttribute(\"stroke-width\", \"1\"); // 1 CSS pixel thick\n chart.append(slice); // Add slice to chart\n\n // Now draw a little matching square for the key\n let icon = document.createElementNS(svg, \"rect\");\n icon.setAttribute(\"x\", lx); // Position the square\n icon.setAttribute(\"y\", ly + 30 * i);\n icon.setAttribute(\"width\", 20); // Size the square\n icon.setAttribute(\"height\", 20);\n icon.setAttribute(\"fill\", color); // Same fill color as slice\n icon.setAttribute(\"stroke\", \"black\"); // Same outline, too.\n icon.setAttribute(\"stroke-width\", \"1\");\n chart.append(icon); // Add to the chart\n\n // And add a label to the right of the rectangle\n let label = document.createElementNS(svg, \"text\");\n label.setAttribute(\"x\", lx + 30); // Position the text\n label.setAttribute(\"y\", ly + 30 * i + 16);\n label.append(`${labels[i]} ${value}`); // Add text to label\n chart.append(label); // Add label to the chart\n });\n\n return chart;\n}", "title": "" }, { "docid": "a9d5417eab38be16f266b311cea97706", "score": "0.6832212", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Estado', 'cantidad'],\n ['No medidos', 8],\n ['Peligro', 2],\n ['Alerta', 4],\n ['Admisible', 2],\n ['Observacion', 8]\n ]);\n\n // Optional; add a title and set the width and height of the chart\n var options = {pieHole:'0.4'};\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('donut_chart1'));\n chart.draw(data, options);\n\n var chart = new google.visualization.PieChart(document.getElementById('donut_chart2'));\n chart.draw(data, options);\n\n var chart = new google.visualization.PieChart(document.getElementById('donut_chart3'));\n chart.draw(data, options); \n }", "title": "" }, { "docid": "171a8d51cd0c772febd2ab51265801d2", "score": "0.6830227", "text": "function pieChart(pD){\r\n var pC ={}, pieDim ={w:250, h: 250};\r\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\r\n\r\n var newData = JSON.parse(JSON.stringify(pD));\r\n newData.map(function(d) {\r\n d.freq = isNumeric(Math.log(d.freq + 1)) ? Math.log(d.freq + 1) : 0;\r\n return d;\r\n });\r\n pD = newData;\r\n\r\n // create svg for pie chart.\r\n var piesvg = d3.select(id).append(\"svg\")\r\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\r\n .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\r\n\r\n // create function to draw the arcs of the pie slices.\r\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\r\n\r\n // create a function to compute the pie slice angles.\r\n var pie = d3.layout.pie().sort(null).value(function(d) { return d.freq; });\r\n\r\n // Draw the pie slices.\r\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\r\n .each(function(d) { this._current = d; })\r\n .style(\"fill\", function(d) { return segColor(d.data.type); })\r\n .on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\r\n\r\n // create function to update pie-chart. This will be used by histogram.\r\n pC.update = function(nD){\r\n var newData = JSON.parse(JSON.stringify(nD));\r\n newData.map(function(d) {\r\n d.freq = isNumeric(Math.log(d.freq + 1)) ? Math.log(d.freq + 1) : 0;\r\n return d;\r\n });\r\n nD = newData;\r\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\r\n .attrTween(\"d\", arcTween);\r\n };\r\n // Utility function to be called on mouseover a pie slice.\r\n function mouseover(d){\r\n // call the update function of histogram with new data.\r\n hG.update(fData.map(function(v){\r\n return [v.species,v.freq[d.data.type]];}),segColor(d.data.type));\r\n }\r\n //Utility function to be called on mouseout a pie slice.\r\n function mouseout(d){\r\n // call the update function of histogram with all data.\r\n hG.update(fData.map(function(v){\r\n return [v.species,Math.floor(Math.pow(Math.E,v.total))];}), barColor);\r\n }\r\n // Animating the pie-slice requiring a custom function which specifies\r\n // how the intermediate paths should be drawn.\r\n function arcTween(a) {\r\n var i = d3.interpolate(this._current, a);\r\n this._current = i(0);\r\n return function(t) { return arc(i(t)); };\r\n }\r\n return pC;\r\n }", "title": "" }, { "docid": "e42811c25dc972d352b3c684a0058cb5", "score": "0.67930067", "text": "function pieChart(pD){\n\t\t var pC ={}, pieDim ={w:250, h: 250};\n\t\t pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n\t\t \n\t\t // create svg for pie chart.\n\t\t var piesvg = d3.select(id).append(\"svg\")\n\t\t .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n\t\t .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n\t\t \n\t\t // create function to draw the arcs of the pie slices.\n\t\t var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n\t\t // create a function to compute the pie slice angles.\n\t\t var pie = d3.layout.pie().sort(null).value(function(d) { return d.freq; });\n\n\t\t // Draw the pie slices.\n\t\t piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n\t\t .each(function(d) { this._current = d; })\n\t\t .style(\"fill\", function(d) { return segColor1(d.data.type); })\n\t\t .on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n\n\t\t // create function to update pie-chart. This will be used by histogram.\n\t\t pC.update = function(nD){\n\t\t piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n\t\t .attrTween(\"d\", arcTween);\n\t\t } \n\t\t // Utility function to be called on mouseover a pie slice.\n\t\t function mouseover(d){\n\t\t // call the update function of histogram with new data.\n\t\t hG.update(fData.map(function(v){ \n\t\t return [v.Region,v.freq[d.data.type]];}),\n\t\t segColor1(d.data.type), segColor2(d.data.type));\n\t\t }\n\t\t //Utility function to be called on mouseout a pie slice.\n\t\t function mouseout(d){\n\t\t // call the update function of histogram with all data.\n\t\t hG.update(fData.map(function(v){\n\t\t return [v.Region,v.total];}), barColor1, barColor2);\n\t\t }\n\t\t // Animating the pie-slice requiring a custom function which specifies\n\t\t // how the intermediate paths should be drawn.\n\t\t function arcTween(a) {\n\t\t var i = d3.interpolate(this._current, a);\n\t\t this._current = i(0);\n\t\t return function(t) { return arc(i(t)); };\n\t\t } \n\t\t return pC;\n\t\t }", "title": "" }, { "docid": "38d3f332a28eda67815abdeab3ba7d2b", "score": "0.6769979", "text": "function builtPie() {\n \n var data = aggregateExpensesByCategory(startDatePieChart, finishDatePieChart);\n \n $('#container-pie').highcharts({\n \n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false\n },\n \n title: {\n text: ''\n },\n \n credits: {\n enabled: false\n },\n \n tooltip: {\n /*formatter: function () {\n return this.series.name + ': <b>' + this.y + '</b><br/>{point.percentage:.1f}%';\n }*/\n pointFormat: '{series.name}: {point.percentage:.1f}%' //<b>{point.y:.2f}%</b><br>\n },\n \n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: 'pointer',\n dataLabels: {\n enabled: false\n },\n showInLegend: true\n }\n },\n \n series: [{\n type: 'pie',\n name: 'Total',\n data: data\n }]\n });\n}", "title": "" }, { "docid": "0ecb5f3025996ce5a4103f57e234656e", "score": "0.6761209", "text": "function pieChart(pD) {\n\t\tvar pC = {},\n\t\t pieDim = {\n\t\t\tw : 250,\n\t\t\th : 250\n\t\t};\n\t\tpieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n\n\t\t// create svg for pie chart.\n\t\tvar piesvg = d3.select(id).append(\"svg\").attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\").attr(\"transform\", \"translate(\" + pieDim.w / 2 + \",\" + pieDim.h / 2 + \")\");\n\n\t\t// create function to draw the arcs of the pie slices.\n\t\tvar arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n\t\t// create a function to compute the pie slice angles.\n\t\tvar pie = d3.layout.pie().sort(null).value(function(d) {\n\t\t\treturn d.freq;\n\t\t});\n\n\t\t// Draw the pie slices.\n\t\tpiesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc).each(function(d) {\n\t\t\tthis._current = d;\n\t\t}).style(\"fill\", function(d) {\n\t\t\treturn segColor(d.data.type);\n\t\t}).on(\"mouseover\", mouseover).on(\"mouseout\", mouseout);\n\n\t\t// create function to update pie-chart. This will be used by histogram.\n\t\tpC.update = function(nD) {\n\t\t\tpiesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500).attrTween(\"d\", arcTween);\n\t\t};\n\t\t// Utility function to be called on mouseover a pie slice.\n\t\tfunction mouseover(d) {\n\t\t\t// call the update function of histogram with new data.\n\t\t\thG.update(fData.map(function(v) {\n\t\t\t\treturn [v.State, v.freq[d.data.type]];\n\t\t\t}), segColor(d.data.type));\n\t\t}\n\n\t\t//Utility function to be called on mouseout a pie slice.\n\t\tfunction mouseout(d) {\n\t\t\t// call the update function of histogram with all data.\n\t\t\thG.update(fData.map(function(v) {\n\t\t\t\treturn [v.State, v.total];\n\t\t\t}), barColor);\n\t\t}\n\n\t\t// Animating the pie-slice requiring a custom function which specifies\n\t\t// how the intermediate paths should be drawn.\n\t\tfunction arcTween(a) {\n\t\t\tvar i = d3.interpolate(this._current, a);\n\t\t\tthis._current = i(0);\n\t\t\treturn function(t) {\n\t\t\t\treturn arc(i(t));\n\t\t\t};\n\t\t}\n\n\t\treturn pC;\n\t}", "title": "" }, { "docid": "bde1fa9418be662247edb5e95f6f82d0", "score": "0.6759075", "text": "function drawChart() {\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Paslon');\n data.addColumn('number', 'Jumlah Suara');\n data.addRows(arr);\n\n // Optional; add a title and set the width and height of the chart\n var options = {\n title: paslon,\n titleTextStyle:{\n fontName: \"Calibri\",\n fontSize: 24\n },\n width: 1057,\n height: 230,\n fontName: 'Calibri',\n fontSize: 16,\n is3D: true,\n sliceVisibilityThreshold: 0\n };\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(elem);\n chart.draw(data, options);\n }", "title": "" }, { "docid": "46f2d971d64ca364fae9e93176abcb8b", "score": "0.67388827", "text": "function coffeeVsTeaPieChart() {\n var query = new google.visualization.Query(\n 'https://docs.google.com/spreadsheets/d/1JJVW8U7xtVYqGYsCY36hq5YUOmpdx8WuUYCNX0HtkDc/edit?usp=sharing');\n query.setQuery('SELECT E,F');\n query.send(coffeeVsTeaPieChartQueryResponse);\n }", "title": "" }, { "docid": "f0e1efe6a2cafa6b72a6ec600b43f4a0", "score": "0.67378235", "text": "function printPieChart(results)\n{\n var processedObj = {};\n var fatturatoTotale = 0;\n\n for (var i = 0; i < results.length; i++) {\n var vendita = results[i];\n var venditore = vendita.salesman;\n var amount = parseInt(vendita.amount);\n\n if (processedObj[venditore] == undefined)\n {\n processedObj[venditore] = 0;\n }\n\n processedObj[venditore] += amount;\n fatturatoTotale += amount;\n }\n\n var arrayLabels = [];\n var arrayAmounts = [];\n\n for (var nomeVenditore in processedObj) {\n var percentualeFatturato = processedObj[nomeVenditore] / fatturatoTotale * 100;\n console.log(percentualeFatturato);\n\n arrayLabels.push(nomeVenditore);\n arrayAmounts.push(percentualeFatturato.toFixed(2));\n }\n\n var myPieChart = new Chart($('#pie'), {\n type: 'pie',\n data: {\n datasets: [{\n data: arrayAmounts,\n labels: arrayLabels,\n backgroundColor: [\n 'rgba(255, 99, 132)',\n 'rgba(54, 162, 235)',\n 'rgba(255, 206, 86)',\n 'rgba(75, 192, 192)',\n 'rgba(153, 102, 255)',\n 'rgba(255, 159, 64)'\n ],\n }],\n\n labels: arrayLabels,\n }\n });\n}", "title": "" }, { "docid": "1c589129c5fcceb14f8a5d85810219cd", "score": "0.6736643", "text": "function pieChart(pD){\n\t\tvar pC ={}, pieDim ={w:250, h: 250};\n\t\tpieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n\t\t\t\t\n\t\t// create svg for pie chart.\n\t\tvar piesvg = d3.select(\"#piesvg\")\n\t\t\t.attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n\t\t\t.attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n\t\t\n\t\t// create function to draw the arcs of the pie slices.\n\t\tvar arc = d3.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n\t\t// create a function to compute the pie slice angles.\n\t\tvar pie = d3.pie().sort(null).value(function(d) { return d.cost; });\n\n\t\t// Draw the pie slices.\n\t\tpiesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n\t\t\t.each(function(d) { this._current = d; })\n\t\t\t.style(\"fill\", function(d) { return segColor(d.data.type); })\n\t\t\t.on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n\n\t\t// create function to update pie-chart. This will be used by histogram.\n\t\tpC.update = function(nD){\n\t\t\tpiesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n\t\t\t\t.attrTween(\"d\", arcTween);\n\t\t} \n\t\t// Utility function to be called on mouseover a pie slice.\n\t\tfunction mouseover(d){\n\t\t\t// call the update function of histogram with new data.\n\t\t\thG.update(cData.map(function(v){ \n\t\t\t\treturn [v.Years,v.event[d.data.type]];}),segColor(d.data.type));\n\t\t}\n\t\t//Utility function to be called on mouseout a pie slice.\n\t\tfunction mouseout(d){\n\t\t\t// call the update function of histogram with all data.\n\t\t\thG.update(cData.map(function(v){\n\t\t\t\treturn [v.Years,v.total];}), barColor);\n\t\t}\n\t\t// Animating the pie-slice requiring a custom function which specifies\n\t\t// how the intermediate paths should be drawn.\n\t\tfunction arcTween(a) {\n\t\t\tvar i = d3.interpolate(this._current, a);\n\t\t\tthis._current = i(0);\n\t\t\treturn function(t) { return arc(i(t)); };\n\t\t} \n\t\treturn pC;\n\t}", "title": "" }, { "docid": "10b6bfde21e0f4d8bf9c0c54ef1df455", "score": "0.6723097", "text": "function formatPieData(d) {\n var penCount = 0;\n var strCount = 0;\n var neoCount = 0;\n\n // For each bacteria, find the antibiotics that has the lowest MIC. \n // And, count the number of bacterias for which each antibiotic has the lowest MIC\n d.forEach(function(d) {\n\n var lowest = Math.min(d[\"Penicilin\"],d[\"Streptomycin \"],d[\"Neomycin\"]);\n\n // Find which antibiotic has the lowest MIC for this paticular bacteria, and increase the count.\n if(d[\"Penicilin\"] == lowest) {\n penCount ++;\n } else if (d[\"Streptomycin \"] == lowest) {\n strCount ++;\n } else {\n neoCount ++;\n }\n });\n\n // Return the data for the proportion of each antibiotics\n var pie = [{\n // Due to the exception of \"Proteus vulgaris\", increase a count for Neomycin and the overall number of bacteria\n values: [(penCount/17),(strCount/17),((neoCount+1)/17)],\n labels: ['Penicilin', 'Streptomycin', 'Neomycin'],\n color: ['#444','Orange','Green'],\n type: 'pie'\n }];\n return pie;\n}", "title": "" }, { "docid": "73add88e38970f5580f23d80072cd431", "score": "0.6717279", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Result','DAA'],\n ['Right Answer',score],\n ['Wrong Answer',wrongAns],\n]);\n\n // Optional; add a title and set the width and height of the chart\n var options = {\n title : \"Result\",\n is3D: true,\n slices: {\n 0: {color: '#00b300'},\n 1: {color: '#ff0000'},\n },\n titleTextStyle : {\n fontSize : 30, \n }\n }\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "154b284bdb6e8c567d5b87db8ea045a3", "score": "0.6709014", "text": "function graficoPieQuadroGeral(operacional, inativas, suspeitas, desabilitadas) {\r\n Highcharts.chart('container-status', {\r\n chart: {\r\n type: 'pie'\r\n },\r\n title: {\r\n text: 'Status Geral'\r\n },\r\n colors: ['#5c5c61', '#f25e59', '#f7b354', '#64e572'], /*ordem das cores - [suspeita, inativa, desabilitada, operacional]*/\r\n tooltip: {\r\n pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\r\n },\r\n plotOptions: {\r\n pie: {\r\n allowPointSelect: true,\r\n cursor: 'pointer',\r\n dataLabels: {\r\n enabled: true,\r\n format: '<b>{point.name}</b>: {point.percentage:.1f} %',\r\n style: {\r\n color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'\r\n }\r\n }\r\n }\r\n },\r\n series: [{\r\n name: 'Status',\r\n data: [{\r\n name: 'Desabilitada',\r\n y: desabilitadas\r\n }, {\r\n name: 'Inativa',\r\n y: inativas\r\n }, {\r\n name: 'Suspeita',\r\n y: suspeitas\r\n }, {\r\n name: 'Operacional',\r\n y: operacional\r\n }]\r\n }]\r\n });\r\n}", "title": "" }, { "docid": "3067e3cc8bd116a6e8332983acba65a1", "score": "0.6703049", "text": "function pieChart(pD){\n var pC ={}, pieDim ={w:250, h: 250};\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n \n // create svg for pie chart.\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n \n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function(d) { return d.freq; });\n\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) { this._current = d; })\n .style(\"fill\", function(d) { return segColor(d.data.type); })\n .on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD){\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n } \n // Utility function to be called on mouseover a pie slice.\n function mouseover(d){\n // call the update function of histogram with new data.\n hG.update(data.map(function(v){ \n return [v.university,v.freq[d.data.type]];}),segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(data.map(function(v){\n return [v.university,v.total];}), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) { return arc(i(t)); };\n } \n return pC;\n }", "title": "" }, { "docid": "2acb0ce452ea5b56945d8ee96334dacd", "score": "0.6699457", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Cuisine');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Japanese', 1],\n ['Italian', 1],\n ['American', 1],\n ['Mediterranean', 1],\n ['French', 1],\n ]);\n\n // Set chart options\n var options = {\n 'title':'NUMBER OF RESTAURANTS BY CUISINE',\n 'width':1200,\n 'height':600,\n 'backgroundColor': '#00a79d',\n 'colors':['coral','aquamarine','#FBB040','#00EDFF','#D0E669'],\n 'fontName':'Gotham',\n 'titleTextStyle': {color: 'white', fontSize: 25},\n 'legend':{textStyle: {color: 'white', fontSize: 16}},\n 'pieSliceText':'none',\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "160af4b0a3c409126a1f364bf9f3f029", "score": "0.6693358", "text": "function pieChart(pD){\n var pC ={}, pieDim ={w:250, h: 250};\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n \n // create svg for pie chart.\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n \n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n \n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function(d) { return d.freq; });\n \n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) { this._current = d; })\n .style(\"fill\", function(d) { return segColor(d.data.type); })\n .on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n \n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD){\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n } \n // Utility function to be called on mouseover a pie slice.\n function mouseover(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){ \n return [v.fileType,v.freq[d.data.type]];}),segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.fileType,v.total];}), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) { return arc(i(t)); };\n } \n return pC;\n }", "title": "" }, { "docid": "bdc681c09885dc21f5bb9d7b783295a7", "score": "0.6678949", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n\n var rows = [];\n\n for (var i = 0; i < arrayMarcaJuntos.length; i++) {\n rows.push(arrayMarcaJuntos[i]);\n }\n\n data.addRows(rows);\n\n // data.addRows([\n // [result.data[1].marca, result.data[1].marca.length],\n // ['Onions', 1],\n // ['Olives', 1],\n // ['Zucchini', 1],\n // ['Pepperoni', 2]\n // ]);\n\n // Set chart options\n var options = {\n 'title': 'Marcas mais populares',\n 'width': 400,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_marcas'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "422342b8efbbc37e69d333dc8b55bbdb", "score": "0.66759354", "text": "function graficoPieQuadroGeralOperadoras(claro, oi, tim, vivo, semOperadora) {\r\n Highcharts.chart('container-operadoras', {\r\n chart: {\r\n type: 'pie'\r\n },\r\n title: {\r\n text: 'Inatividade Chips - Últimas 24h'\r\n },\r\n colors: ['#69248a', '#0829cf', '#f28900', '#ff0000','#424040'], /*ordem das cores - [vivo, tim, oi, claro, sem chip definido]*/\r\n tooltip: {\r\n pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\r\n },\r\n plotOptions: {\r\n pie: {\r\n allowPointSelect: true,\r\n cursor: 'pointer',\r\n dataLabels: {\r\n enabled: true,\r\n format: '<b>{point.name}</b>: {point.percentage:.1f} %',\r\n style: {\r\n color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'\r\n }\r\n }\r\n }\r\n },\r\n series: [{\r\n name: 'Status',\r\n data: [{\r\n name: 'Vivo',\r\n y: vivo\r\n }, {\r\n name: 'Tim',\r\n y: tim\r\n }, {\r\n name: 'Oi',\r\n y: oi\r\n }, {\r\n name: 'Claro',\r\n y: claro\r\n },{\r\n name: 'Sem Chip definido',\r\n y: semOperadora\r\n }]\r\n }]\r\n });\r\n}", "title": "" }, { "docid": "0b1760ee79fbe2aa91a188fd255f7a5f", "score": "0.6673992", "text": "function pct_populacao() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Idades');\n data.addColumn('number', 'Percentagem');\n data.addRows([\n ['Jovem 0-14 anos', 15.12943321],//(3893(população 0-14 anos)/24136(população total))*100\n ['Activa 15-64 anos', 69.62628439],//(16805(população 15-64 anos)/24136(população total))*100 \n ['Idosa >65 anos', 18.86808088]//(4554(população >65 anos)/24136(população total))*100\n ]);\n\n // Set chart options\n var options = {title:'Percentagem de população activa, jovem e idosa'};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('pct_populacao'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "36bd00aa63cbc6e0fd4cfdf7ed18ac99", "score": "0.6672332", "text": "function makeChart(name) {\n console.assert(color.length >= areas.length, \"Houston, we have a problem.\");\n var data = [];\n var keys = areas;\n for (var i = 0; i < keys.length; i++) {\n data.push({ \"label\": areaDict[keys[i]],\n \"value\": authorAreas[unescape(name)][keys[i]],\n \"color\": color[i] });\n }\n var pie = new d3pie(name + \"-chart\", {\n \"header\": {\n \"title\": {\n \"text\": unescape(name),\n \"fontSize\": 24,\n \"font\": \"open sans\"\n },\n \"subtitle\": {\n \"text\": \"Publication Profile\",\n \"color\": \"#999999\",\n \"fontSize\": 14,\n \"font\": \"open sans\"\n },\n \"titleSubtitlePadding\": 9\n },\n \"size\": {\n \"canvasHeight\": 500,\n \"canvasWidth\": 500,\n \"pieInnerRadius\": \"38%\",\n \"pieOuterRadius\": \"83%\"\n },\n \"data\": {\n \"content\": data,\n \"smallSegmentGrouping\": {\n \"enabled\": true,\n \"value\": 1\n }\n },\n \"labels\": {\n \"outer\": {\n \"pieDistance\": 32\n },\n \"inner\": {\n \"format\": \"value\",\n \"hideWhenLessThanPercentage\": 2\n },\n \"mainLabel\": {\n \"fontSize\": 12\n },\n \"percentage\": {\n \"color\": \"#ffffff\",\n \"decimalPlaces\": 0\n },\n \"value\": {\n \"color\": \"#ffffff\",\n \"fontSize\": 10\n },\n \"lines\": {\n \"enabled\": true\n },\n \"truncation\": {\n \"enabled\": true\n }\n },\n \"effects\": {\n \"load\": {\n \"effect\": \"none\"\n },\n \"pullOutSegmentOnClick\": {\n \"effect\": \"linear\",\n \"speed\": 400,\n \"size\": 8\n }\n },\n \"misc\": {\n \"gradient\": {\n \"enabled\": true,\n \"percentage\": 100\n }\n }\n });\n}", "title": "" }, { "docid": "af7d0923162f3d153627f7c1268cace5", "score": "0.6671709", "text": "function race_pie_function(asian, white, black, hispanic){\r\n var race_pie = new d3pie(\"race_pie\", {\r\n \"header\": {\r\n \"title\": {\r\n \"text\": \"Shootings in the U.S. by Race\",\r\n \"fontSize\": 24,\r\n \"font\": \"open sans\"\r\n }\r\n // \"subtitle\": {\r\n // \"text\": \"Dare I say, Real Data\",\r\n // \"color\": \"#999999\",\r\n // \"fontSize\": 12,\r\n // \"font\": \"open sans\"\r\n // },\r\n // \"titleSubtitlePadding\": 10\r\n },\r\n \"footer\": {\r\n \"color\": \"#999999\",\r\n \"fontSize\": 10,\r\n \"font\": \"open sans\",\r\n \"location\": \"bottom-left\"\r\n },\r\n \"size\": {\r\n \"canvasWidth\": 450,\r\n \"canvasHeight\": 450,\r\n \"pieOuterRadius\": \"70%\"\r\n },\r\n // \"footer\": {\r\n // \"text\": \"Source: www.FakeData.com\",\r\n // \"color\": \"#999999\",\r\n // \"fontSize\": 10,\r\n // \"font\": \"open sans\",\r\n // \"location\": \"bottom-left\"\r\n // },\r\n \"data\": {\r\n \"sortOrder\": \"value-desc\",\r\n \"content\": [\r\n {\r\n \"label\": \"Asian\",\r\n \"value\": asian,\r\n \"color\": \"#ccb2b2\"\r\n },\r\n {\r\n \"label\": \"White\",\r\n \"value\": white,\r\n \"color\": \"#ccc8b2\"\r\n },\r\n {\r\n \"label\": \"Black\",\r\n \"value\": black,\r\n \"color\": \"#c3ccb2\"\r\n },\r\n {\r\n \"label\": \"Hispanic\",\r\n \"value\": hispanic,\r\n \"color\": \"#b5ccb2\"\r\n }\r\n ]\r\n },\r\n \"labels\": {\r\n \"outer\": {\r\n \"pieDistance\": 28\r\n },\r\n \"inner\": {\r\n \"hideWhenLessThanPercentage\": 3\r\n },\r\n \"mainLabel\": {\r\n \"fontSize\": 11\r\n },\r\n \"percentage\": {\r\n \"color\": \"#ffffff\",\r\n \"decimalPlaces\": 0\r\n },\r\n \"value\": {\r\n \"color\": \"#adadad\",\r\n \"fontSize\": 11\r\n },\r\n \"lines\": {\r\n \"enabled\": true\r\n },\r\n \"truncation\": {\r\n \"enabled\": true\r\n }\r\n },\r\n \"effects\": {\r\n \"pullOutSegmentOnClick\": {\r\n \"effect\": \"linear\",\r\n \"speed\": 400,\r\n \"size\": 9\r\n }\r\n },\r\n \"misc\": {\r\n \"gradient\": {\r\n \"enabled\": false,\r\n \"percentage\": 100\r\n }\r\n },\r\n \"callbacks\": {\r\n \"onMouseoverSegment\": null,\r\n \"onMouseoutSegment\": null,\r\n \"onClickSegment\": null\r\n }\r\n });\r\n}", "title": "" }, { "docid": "f3a2014152735511054214e987e601a9", "score": "0.66682917", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n\n var rows = [];\n\n data.addRows([\n ['Sensor', sensor],\n ['Atuador', atuador],\n ['Display', display]\n ]);\n\n\n // Set chart options\n var options = {\n 'title': 'Categorias de Dispositivos mais populares',\n 'width': 400,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_tipos'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "2c7a8d73218f7ab7bd8415a6b4ce908e", "score": "0.6666933", "text": "function createPieFromDataset() {\n\tpieChart.removeAll();\n\n\tfor(var i = 0; i < labels.length; i++) {\n pieChart.addPiece(values[i], i%colors.length, false, labels[i]);\n }\n}", "title": "" }, { "docid": "5974aff460acffdddcbc7c0e9f8b9aa1", "score": "0.66602343", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n var dung_han = parseInt(total_all_month_of_year[gl_cur_month].TRA_SOM_HAN) + parseInt(total_all_month_of_year[gl_cur_month].TRA_DUNG_HAN);;\n var qua_han = parseInt(total_all_month_of_year[gl_cur_month].TRA_QUA_HAN);\n \n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Đúng hạn', dung_han],\n ['Quá hạn', qua_han]\n ]);\n\n // Set chart options\n var options = {\n 'height': 300,\n 'top': 0,\n 'left': 0,\n legend: {position: 'top'}\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('pie-chart'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "be68a7dfc7e558db6177ab742515b1ee", "score": "0.66488963", "text": "function getPieData(dStats){\n\tvar needsWork = 0;\n\tvar unsure = 0;\n\tvar correct = 0;\n\t\n\tfor(var i = 0; i < dStats.length; i++){\n\t\tneedsWork += dStats[i][0];\n\t\tunsure += dStats[i][1];\n\t\tcorrect += dStats[i][2];\n\t}\n\t\n\tvar total = needsWork + unsure + correct;\n\t\n\tvar percentages = new Array((100 * needsWork / total) , (100 * unsure / total) , (100 * correct / total));\n\t\n\treturn percentages;\n\t\n}", "title": "" }, { "docid": "8b4efec93838fa21d89fa6a02e4e1c54", "score": "0.66424155", "text": "function pieChart(pD) {\n var pC = {},\n pieDim = {\n w: 200,\n h: 200\n };\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n\n // create svg for pie chart.\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\" + pieDim.w / 2 + \",\" + pieDim.h / 2 + \")\");\n\n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function (d) {\n return d.freq;\n });\n\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function (d) {\n this._current = d;\n })\n .style(\"fill\", function (d) {\n return segColor(d.data.type);\n })\n .on(\"mouseover\", mouseover).on(\"mouseout\", mouseout);\n\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function (nD) {\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n }\n // Utility function to be called on mouseover a pie slice.\n function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.State, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function (v) {\n return [v.State, v.total];\n }), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function (t) {\n return arc(i(t));\n };\n }\n return pC;\n }", "title": "" }, { "docid": "75e92fea580807552469eb565bf615fc", "score": "0.66348404", "text": "function chart28(data) {\n\tvar NA = 0;\n\tvar unknown = 0;\n\tvar pld = 0;\n\tvar nieod = 0;\n\tvar pdm = 0;\n\tconsole.log(data);\n\tfor (var x in data) {\n\t\tif (data[x] == '[Not Available]') {\n\t\t\tNA++;\n\t\t}\n\t\tif (data[x] == '[Unknown]') {\n\t\t\tunknown++;\n\t\t}\n\t\tif (data[x] == 'Persistent locoregional disease') {\n\t\t\tpld++;\n\t\t}\n\t\tif (data[x] == 'No imaging evidence of disease') {\n\t\t\tnieod++;\n\t\t}\n\t\tif (data[x] == 'Persistent distant metastases') {\n\t\t\tpdm++;\n\t\t}\n\t}\n\t\n\t$('#container').highcharts({\n\t\ttitle: {\n\t\t\ttext: 'Clinical Status Within 3 Months of Surgery'\n\t\t},\n\t\ttooltip: {\n\t\t\tpointFormat: '<b>{point.percentage:.1f}%</b>'\n\t\t},\n\t\tplotOptions: {\n\t\t\tpie: {\n\t\t\t\tallowPointSelect: true,\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tdataLabels: {\n\t\t\t\t\tenabled: true\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tseries: [{\n\t\t\ttype: 'pie',\n\t\t\tname: '',\n\t\t\tdata: [\n\t\t\t\t['[Not Available]', NA],\n\t\t\t\t['[Unknown]', unknown],\n\t\t\t\t['Persistent locoregional disease', pld],\n\t\t\t\t['No imaging evidence of disease', nieod],\n\t\t\t\t['Persistent distant metastases', pdm]\n\t\t\t]\n\t\t}]\n\t});\n}", "title": "" }, { "docid": "fd9d9f38b28997b94113eddb58991e39", "score": "0.6628878", "text": "function getGenreValue()\n {\n genreArr.sort(); //Sort array for the right count\n var currentGenre = null; \n var cnt = 0;\n colorcount = 0; \n //loop through array of genres \n for (x = 0; x <= genreArr.length; x++) \n { \n if (genreArr[x] != currentGenre) //check if the genreArr is niet gelijk aan currrent genre\n {\n \n if (cnt > 0) \n { \n //array push for the genre + count of that genre\n everyGenreArr.push(\n {\n \n x: currentGenre, //push genre\n value: \"\" + cnt + \"\", //push count\n fill: colorArray[colorcount] //push color for the chart to show\n });\n colorcount++\n }\n currentGenre = genreArr[x];\n cnt = 1;\n } \n else \n {\n cnt++;\n }\n }\n //All genres are counted now the pie chart can be shown\n pieShow();\n }", "title": "" }, { "docid": "de5bb459e4ace2ceaf285117ec87ffa7", "score": "0.6627267", "text": "function createPieCharts(used_vehicle,new_vehicle) {\n /* var labels = new Array('Otters', 'Badgers', 'Stoats', 'Bears');\n var values = new Array(7.3, 4.2, 4.1, 3.6);\n var colors = new Array('#EAA83A', '#FEC56B', '#51C5D4', '#89DAEF');*/\n console.log(\"in CreatePieCharts\");\n var labels = new Array('New','Used');\n var values = new Array(new_vehicle, used_vehicle);\n var colors = new Array('#c24642', '#51C5D4');\n drawPie(labels, values, colors, 'cPie1');\n}", "title": "" }, { "docid": "84534d3cd1dd64e735123ebbf19899ac", "score": "0.66263574", "text": "function getPieChartData(monismResult, naturalismResult, theismResult) {\n return {\n type: \"pie\",\n data: {\n labels: [\"Monism\", \"Naturalism\", \"Theism\"],\n datasets: [{\n data: [monismResult, naturalismResult, theismResult],\n backgroundColor: [\"rgb(61, 69, 255)\", \"rgb(114, 255, 111)\", \"rgb(255, 96, 96)\"],\n borderWidth: 0\n }]\n }\n }\n }", "title": "" }, { "docid": "ab4bcd8cdaba10f961fdb28c7f92ba46", "score": "0.66262996", "text": "function draw_pie1() {\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\t//url : \"https://live.runmyprocess.com/live/112501412000161590/analysis/process/COUNT?field=NUMBER&group=MONTH&operator=EE%20EE%20IS%20EE&value=146550%20TEST%20NULL%20159933&filter=PROJECT%20MODE%20PARENT%20PROCESS&nb=10000&media=json\",\n\t\turl :\"https://live.runmyprocess.com/live/112501412000161590/analysis/process/COUNT?field=NUMBER&group=MEASURE_1&operator=EE%20EE%20IS%20EE&filter=PROJECT%20MODE%20PARENT%20PROCESS&value=146550%20LIVE%20NULL%20159933&nb=10000&media=json\",\t \n\t\tasync : true,\n\t\tdata:{},\n\t\tdataType : \"json\",\n\t\terror :function () {\n\t\t\t\talert('Error while loading status.');\n\t\t},\n\t\tsuccess : function (P_result) {\n\t\t\tvar my_entries = get_array(P_result.feed.entry.content.data, \"result\");\n\t\t\tvar array_data = new Array();\n\t\t\tfor (var i = 0; i < my_entries.length; i++) {\n\t\t\t\tarray_data.push({\n\t\t\t\t\t\"label\" : my_entries[i].serie.value,\n\t\t\t\t\t\"value\" : parseFloat(my_entries[i].value)\n\t\t\t\t});\n\t\t\t}\n\t\t\t//alert(JSON.stringify(array_data));\n\t\t\tvar html_id = \"chart_1\";\n\t\t\tdrawPieChart_js(html_id, array_data);\n\t\t}\n\t});\t\n}", "title": "" }, { "docid": "7d1bd2fc1a87de1b214b7ae9e6724d35", "score": "0.6609428", "text": "function buildPie(alignmentArr){\n\n //Get the alignment score count from the alignment array\n var values = alignmentArr.map(function(arr) { return arr[1]; });\n var arrSum = values.reduce((a, b) => a + b, 0)\n\n var chartDataArr = [];\n var chartLabelArr = [];\n \n for (var x = 0; x < 5; x++) { \n var percentScore = Math.round((alignmentArr[x][1]/arrSum)*100);\n chartDataArr.push(percentScore);\n chartLabelArr.push(alignmentArr[x][0]); \n }\n \n var ctx = document.getElementById('pieChart').getContext('2d');\n \n // Config for Pie Chart\n var pieChart = new Chart(ctx,{\n type: 'pie',\n data: {\n labels: chartLabelArr,\n datasets: [{\n data: chartDataArr,\n backgroundColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderColor: [\n 'rgba(255, 255, 255, 1)'\n ],\n borderWidth: 4\n }]\n },\n options: {\n responsive: true,\n plugins: {\n labels: {\n render: 'percentage',\n precision: 1,\n fontSize: 14,\n fontColor: '#fff',\n fontStyle: 'bold',\n textShadow: true,\n shadowBlur: 2,\n shadowOffsetX: 0,\n shadowOffsetY: 2,\n shadowColor: 'rgba(0,0,0,0.5)'\n }\n },\n legend: {\n fullWidth: true,\n labels:{\n fontColor: 'rgba(0,0,0,.8)',\n usePointStyle: true\n }\n }\n }\n });\n}", "title": "" }, { "docid": "5d647fc40dcb9d807a8d8d882ee1af8d", "score": "0.6599145", "text": "function loadPieChart(numUsed, numThrownaway) {\n var chart = new CanvasJS.Chart(\"chartContainer\", {\n animationEnabled: true,\n backgroundColor: \"#4f734f\",\n data: [{\n type: \"pie\",\n startAngle: 240,\n yValueFormatString: \"##0\\\"\\\"\",\n indexLabel: \"{label} {y}\",\n dataPoints: [{\n y: numUsed,\n label: \"Used\"\n },\n {\n y: numThrownaway,\n label: \"Thrown Away\"\n }\n ]\n }]\n });\n chart.render();\n} //end loadPieChart", "title": "" }, { "docid": "db0a6b5a8966982c4c0cfc790438b011", "score": "0.6588898", "text": "function drawCountPie1() { \n \n var data = google.visualization.arrayToDataTable([\n ['Type', 'Avg Rides'],\n ['Members', 8113],\n ['Casual Users', 1340]\n ]);\n \n var options = {\n legend: 'none',\n colors:['#0A49A1','#8FC6EF'],\n fontSize: 9,\n chartArea: {left:5, width:'90%',height:'90%'}\n };\n \n var chart = new google.visualization.PieChart(document.getElementById('CountPie1'));\n chart.draw(data, options);\n \n }", "title": "" }, { "docid": "fd1b6b568aef638fc2b15163af413404", "score": "0.6568584", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Ratio', 'Gender ratio'],\n ['Female', 6.2],\n ['Unidentified', 9.2],\n ['Male', 84.6],\n]);\n\n // Optional; add a title and set the width and height of the chart\nvar options = {\n 'title':'gender ratio',\n titleTextStyle: {color: '#fff', fontSize: 30},\n colors:['#D2042D','#ff6347','#eb081a'],\n backgroundColor: {fill: '#fff',fillOpacity: 0},\n pieHole: 0.4,\n chartArea:{left:0,top:50,width:'300%'},\n pieSliceBorderColor : \"#5A5A5A\",\n fontSize: 15,\n tooltip: {textStyle: {color: 'red'}},\n legend: {position: 'bottom',\n textStyle: {color: 'white',fontSize: 16}}\n };\n \n\n // Display the chart inside the <div> element with id=\"piechart\"\nvar chart = new google.visualization.PieChart(document.getElementById('genderchart'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "debbe68b192df113f61d032d74371a2a", "score": "0.6568158", "text": "function drawChart() \n{\n\n var data = google.visualization.DataTable([\n [\"Grade Level\",\"# of Students\"],\n \n]);\n // Optional; add a title and set the width and height of the chart\n var options = {\"title\":\"# of Students by Grade Level\", \"width\":550, \"height\":400};\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById(\"piechart\"));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "99b8c94a391f20b7c0aeaa0d79fd8f15", "score": "0.65657145", "text": "function drawChart() {\n\n// Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['所得税', 134900],\n ['法人税', 77920],\n ['消費税', 101990],\n ['その他 揮発油税,酒税等', 94460],\n ['その他収入', 94905],\n ['公債', 442980]\n ]);\n\n // Set chart options\n var options = {'title':'平成23年度当初予算(歳入内訳)',\n 'width':800,\n 'height':800};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "8a99d819d300d2acc124713b7735bef6", "score": "0.65592384", "text": "function drawPie(obj, divId, graphHeight) {\n\n\tif (obj.values == null) {\n\t\t$(\"#\" + divId).html(\n\t\t\t\t\"<p><h2>\" + \"title\" + \"</h2></p>\");\n\t\treturn;\n\t}\n\t\n\tobj.values.sort(function(a, b) {\n\t\treturn compareNumberDesc(a,b,\"vals\");\n\t});\n\n\tvar data = new google.visualization.DataTable();\n\tdata.addColumn(obj.cols.x.type, obj.cols.x.title);\n\tvar yCol = obj.cols.y[0];\n\tdata.addColumn(yCol.type, yCol.title);\n\n\tdata.addRows(obj.values.length);\n\t$.each(obj.values, function(i, item) {\n\t\tvar title = item.title;\n\t\tif (obj.cols.x.type == \"string\") {title = title.toString();}\n\t\tdata.setValue(i, 0, title);\n\t\tdata.setValue(i, 1, item.vals[0]);\n\t});\n\t\n\t\n\tvar is3D = obj.options[\"3D\"];\n\tvar pieHole = (obj.options[\"donut\"]?0.3:0);\n\t\n\tvar options = {\n\t\tis3D : true,\n//\t\tpieHole: pieHole,\n//\t\tpieSliceBorderColor : 'white',\n//\t\tsliceVisibilityThreshold : 0,\n\t\twidth : $('#' + divId).width(),// 333,\n\t\theight : graphHeight ? graphHeight : 275,\n//\t\tanimation : {\n//\t\t\tduration : 1000,\n//\t\t\teasing : 'out'\n//\t\t},\n\t\tchartArea : {\n\t\t\twidth : '90%',\n\t\t\theight : '70%'\n\t\t},\n//\t\tbackgroundColor : {\n//\t\t\tstroke : '#666',\n//\t\t\tstrokeWidth : 0\n//\t\t},\n\t\tlegend : {\n\t\t\tposition : 'bottom'\n\t\t},\n\t\ttitleTextStyle : {\n\t\t\tcolor : \"#555555\",\n\t\t\tfontSize: 18\n\t\t},\n\t\ttitle : obj.titles.chart,\n\t};\n\t\n\tif (obj.options[\"donut\"]){\n\t\toptions.slices = { \n\t\t\t\t1: {offset: 0.2},\n\t\t\t\t5: {offset: 0.1}\n\t\t\t};\n\t}\n\t\n\tif (obj.chartColor){\n\t\toptions.colors = obj.chartColor;\n\t}\n\t\n\tvar formatter = new google.visualization.NumberFormat(\n\t\t\t{pattern:'#,###'});\n\tformatter.format(data, 1);\n\n\tpieChart = new google.visualization.PieChart(document.getElementById(divId));\n\tpieChart.draw(data, options);\n\t\t\n\t// zoom dialog\n\tif(obj.zoom != null){\n\t\tgoogle.visualization.events.addListener(pieChart, 'select', function(event) {\n\t\t\tvar selection = pieChart.getSelection();\n\t\t\tif(selection[0] == null){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(selection[0].row == null){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectedRow = selection[0].row;\n\t\n\t\t\t$(\"#zoomDialog\").trigger('click');\n\t\t\tvar chartCode = obj.zoom.chartCode;\n\t\t\tvar params = obj.values[selectedRow].zoomParam;\n\t\t\tgetChartData(chartCode, \"dialogChart\", params);\n\t\t});\t\n\t}\n\t\n}", "title": "" }, { "docid": "876640d08016573a5dccef70cfc41925", "score": "0.6541921", "text": "function pieBaker() {\n pieColor = d3.scale.category20c(); //builtin range of colors\n\n raceInfoBuffer = {};\n raceInfoBuffer[\"Black/African-American\"] = parseInt(selectedSchoolObject[\"demographics\"][\"black_african_american_total\"]);\n raceInfoBuffer[\"Asian\"] = parseInt(selectedSchoolObject[\"demographics\"][\"asian_total\"]);\n raceInfoBuffer[\"White\"] = parseInt(selectedSchoolObject[\"demographics\"][\"white_total\"]);\n raceInfoBuffer[\"Hispanic/Latinx\"] = parseInt(selectedSchoolObject[\"demographics\"][\"hispanic_latino_total\"]);\n raceInfoBuffer[\"Native Hawaiian/Other Pacific Islander\"] = parseInt(selectedSchoolObject[\"demographics\"][\"native_hawaiian_other_pacific_islander_total\"]);\n\traceInfoBuffer[\"American Indian/Alaska Native\"] = parseInt(selectedSchoolObject[\"demographics\"][\"american_indian_alaska_native_total\"]);\n\t// raceInfoBuffer[\"Multiracial\"] = parseInt(selectedSchoolObject[\"demographics\"][\"two_plus_races_total\"]);\n\t// raceInfoBuffer[\"International\"] = parseInt(selectedSchoolObject[\"demographics\"][\"nonresident_alien_total\"]);\n\n\traceProportionsBuffer = {};\n\tvar totalPop = \n\t\traceInfoBuffer[\"Black/African-American\"] +\n\t\traceInfoBuffer[\"Asian\"] +\n\t\traceInfoBuffer[\"White\"] +\n\t\traceInfoBuffer[\"Hispanic/Latinx\"] +\n\t\traceInfoBuffer[\"Native Hawaiian/Other Pacific Islander\"] +\n\t\traceInfoBuffer[\"American Indian/Alaska Native\"];\n\t\t// raceInfoBuffer[\"Multiracial\"] +\n\t\t// raceInfoBuffer[\"International\"];\n\traceProportionsBuffer[\"Black/African-American\"] = raceInfoBuffer[\"Black/African-American\"]/totalPop;\n\traceProportionsBuffer[\"Asian\"] = raceInfoBuffer[\"Asian\"]/totalPop;\n\traceProportionsBuffer[\"White\"] = raceInfoBuffer[\"White\"]/totalPop;\n\traceProportionsBuffer[\"Hispanic/Latinx\"] = raceInfoBuffer[\"Hispanic/Latinx\"]/totalPop;\n\traceProportionsBuffer[\"Native Hawaiian/Other Pacific Islander\"] = raceInfoBuffer[\"Native Hawaiian/Other Pacific Islander\"]/totalPop;\n\traceProportionsBuffer[\"American Indian/Alaska Native\"] = raceInfoBuffer[\"American Indian/Alaska Native\"]/totalPop;\n\t// raceProportionsBuffer[\"Multiracial\"] = raceInfoBuffer[\"Multiracial\"]/totalPop;\n\t// raceProportionsBuffer[\"International\"] = raceInfoBuffer[\"International\"]/totalPop;\n\n\t// selects the canvas on which to bake the pie\n var racePie = d3.select(\"#detailVis\")\n \t.select(\"#canvas\")\n \t.append(\"g\")\n \t.attr(\"id\", \"racePie\")\n \t.attr(\"class\", \"tab1\");\n\n // bakes the pie name\n racePie.append(\"text\")\n\t\t\t.attr(\"class\", \"detailVisHeader\")\n\t\t\t.attr(\"x\", racePieVis.x)\n\t\t\t.attr(\"y\", racePieVis.y)\n\t\t\t.text(\"Race Demographics\");\n\n\t// bakes the pie data\n var vis = racePie\n .append(\"g\") //make a group to hold our pie chart\n .attr(\"transform\", \"translate(\" + (racePieVis.x + racePieVis.r) + \",\" + (racePieVis.y + racePieVis.r + 10) + \")\") //move the center of the pie chart from 0, 0 to radius, radius\n .data([d3.entries(raceInfoBuffer)]);\n \n \t// bakes pie slice data\n var arc = d3.svg.arc() //this will create <path> elements for us using arc data\n .outerRadius(racePieVis.r);\n\n // bakes pie slice data for a list of values\n var pie = d3.layout.pie() //this will create arc data for us given a list of values\n .value(function(d) { return d.value; }); //we must tell it out to access the value of each element in our data array\n \n \t// bakes pie slices\n var arcs = vis.selectAll(\"g.slice\") //this selects all <g> elements with class slice (there aren't any yet)\n .data(pie) //associate the generated pie data (an array of arcs, each having startAngle, endAngle and value properties) \n .enter() //this will create <g> elements for every \"extra\" data element that should be associated with a selection. The result is creating a <g> for every object in the data array\n .append(\"svg:g\") //create a group to hold each slice (we will have a <path> and a <text> element associated with each slice)\n .attr(\"class\", \"slice\"); //allow us to style things in the slices (like text)\n \n arcs.append(\"svg:path\")\n .attr(\"fill\", function(d, i) { return pieColor(i); } ) //set the color for each slice to be chosen from the color function defined above\n .attr(\"d\", arc); //this creates the actual SVG path using the associated data (pie) with the arc drawing function\n \n var raceNames = d3.keys(raceInfoBuffer);\n\n var racePercents = racePie.selectAll(\"text.raceText\")\n \t.data(d3.entries(raceProportionsBuffer))\n \t.enter()\n \t.append(\"text\")\n \t.attr(\"x\", 38 + racePieVis.x + 10)\n .attr(\"y\", function(d,i) {\n \treturn racePieVis.h + 15 + racePieVis.y + (10 * (i + 1));\n })\n .attr(\"text-anchor\", \"end\")\n .attr(\"class\", \"raceText\")\n .text(function(d, i) { \n \treturn 100 * Math.round(10000 * parseFloat(d.value))/10000 + \"%\"; \n });\n\n var raceBoxes = racePie.selectAll(\"rect\")\n \t.data(raceNames)\n \t.enter()\n\t\t.append(\"rect\")\n \t.attr(\"width\", \"10px\")\n \t.attr(\"height\", \"10px\")\n \t.attr(\"x\", 40 + racePieVis.x + 10)\n .attr(\"y\", function(d,i) {\n \treturn racePieVis.h + 15 + racePieVis.y + (10 * i);\n })\n .attr(\"fill\", function(d,i) {\n \treturn pieColor(i);\n })\n .attr(\"label\", function(d, i) { \n \treturn d; \n });\n\n var raceLabels = racePie.selectAll(\"text.pieText\")\n \t.data(raceNames)\n \t.enter()\n \t.append(\"text\") //add a label to each slice\n .attr(\"x\", 54 + racePieVis.x + 10)\n .attr(\"y\", function(d,i) {\n \treturn racePieVis.h + 15 + racePieVis.y + (10 * (i + 1));\n })\n .attr(\"text-anchor\", \"left\") //center the text on it's origin\n .attr(\"class\", \"pieText\")\n .text(function(d, i) { \n \treturn d; \n }); //get the label from our original data array\n\n\n\n // TODO: make descriptive text append to a neatly sorted area\n // TODO: make descriptive text append with boxes for the correct color\n}", "title": "" }, { "docid": "4333001c8e7538677dd859034ccbc2cd", "score": "0.6535561", "text": "function categories(){\n\tvar data = {\n\t\t\tlabels: [ //labels of the chart\n\t\t\t\t\"Category A\",\n\t\t\t\t\"Category B\",\n\t\t\t\t\"Category C\"\n\t\t\t],\n\t\t\tdatasets: [\n\t\t\t\t{\n \t\tlabel: 'Categories ',\n\t\t\t\t\tdata: [totalperA,totalperB,totalperC],//values of chart\n\t\t\t\t\tbackgroundColor: [ // colors for each slice of pie\n\t\t\t\t\t\t\"#009900\",\n\t\t\t\t\t\t\"#FCD116\",\n\t\t\t\t\t\t\"#000000\"\n\t\t\t\t\t],\n\t\t\t\t\thoverBackgroundColor: [// hover color\n\t\t\t\t\t\t\"#808080\",\n\t\t\t\t\t\t\"#808080\",\n\t\t\t\t\t\t\"#808080\"\n\t\t\t\t\t],\n \tborderWidth: 1\n\t\t\t\t}]\n\t\t\t};\n\t\t\t\n\t\tvar ctx = document.getElementById(\"Chart1\");//access the canvas for the chart\n\t\t\n//chart creation object\nvar myChart = new Chart(ctx, {\n\t\t\ttype: 'pie',//type of chart\n\t\t\tdata: data,\n\t\t\toptions: {\n\t\t\t\tanimation:{\n\t\t\t\t\tanimateScale:true// Boolean - whether or not the chart should animate.\n\t\t\t\t\t},\n\t\t\t\t// Boolean - whether or not the chart should be responsive and resize when the browser does.\n\t\t\t\tresponsive: true,\n\t\t\t}\n\t\t});\t\n\t}", "title": "" }, { "docid": "ef832a1bd633f906118245f2f4f479f8", "score": "0.652017", "text": "function initialPie(response) {\n\n var totalEmp = 0;\n var pctEmp = d3.format(\",.1%\");\n for (var i = 0; i < response.length; i++) {\n totalEmp = totalEmp + response[i].value;\n \n \n }\n\n\n var color = d3.scale.category20();\n \n\n var path = pieSvg.selectAll(\"path\")\n .data(pie(response))\n .enter()\n .append(\"path\");\n\n var text = pieSvg.selectAll(\"text\")\n .data(pie(response))\n .enter()\n .append(\"text\")\n .attr(\"transform\", function (d) {\n var c = arc.centroid(d),\n x = c[0],\n y = c[1],\n h = Math.sqrt(x * x + y * y);\n return \"translate(\" + (x/h * (radius - 25)) + \",\" + (y/h * (radius -25)) + \")\";\n })\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"middle\")\n .attr('font-size', '10px')\n .text(function (d) { return pctEmp(d.data.value / totalEmp); });\n\n path.transition()\n .duration(500)\n .attr(\"fill\", function (d, i) {\n return color(d.value);\n })\n .attr(\"d\", arc)\n .each(function (d) {\n this._current = d;\n })\n .attrTween(\"d\", arcTween);\n\n\n path.append(\"title\")\n .text(function (d) { return d.data.industryName; });\n\n }", "title": "" }, { "docid": "ec9148f15680d73a42ae9d36648ea246", "score": "0.6513695", "text": "function makePie(cf,ID,height,width,questionWith_){\n\t//console.log(\"ID for question \"+questionWith_+\" is \",ID)\n\tvar Dim = cf.dimension(function(d){ return d[questionWith_];},true);\n\t//console.log(\"DIM for question \"+questionWith_+\" is \",Dim)\n\tvar dimGroup = Dim.group();\n\tvar PieChart = dc.pieChart(\"#\"+ID)\n\t\t\t.height(height)\n .width(width)\n .dimension(Dim)\n .group(dimGroup);\n}", "title": "" }, { "docid": "ff0f5d821ed30912087775ae77b996a2", "score": "0.6513653", "text": "function drawChart() {\r\n var data = google.visualization.arrayToDataTable([\r\n ['Task', 'Hours per Day'],\r\n ['Work', 8],\r\n ['Friends', 2],\r\n ['Eat', 2],\r\n ['TV', 2],\r\n ['Gym', 2],\r\n ['Sleep', 8]\r\n]);\r\n\r\n // Optional; add a title and set the width and height of the chart\r\n // var options = {'title':'My Average Day', 'width':550, 'height':400};\r\n var options = {\r\n legend:{position:'none'}, \r\n chartArea:{left:0,top:0,width:'100%',height:'95%'}, \r\n pieHole: 0.3,\r\n pieStartAngle: 100,\r\n sliceVisibilityThreshold: .2,\r\n pieSliceText:'label',\r\n pieResidueSliceColor: '#ccc',\r\n pieResidueSliceLabel: 'Outros',\r\n backgroundColor: 'transparent'}\r\n\r\n // Display the chart inside the <div> element with id=\"piechart\"\r\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\r\n // Wait for the chart to finish drawing before calling the getImageURI() method.\r\n google.visualization.events.addListener(chart, 'ready', function () {\r\n //chart_div.innerHTML = '<img src=\"' + chart.getImageURI() + '\">';\r\n document.getElementById(\"grafico-torta\").src= chart.getImageURI();\r\n //console.log(chart_div.innerHTML);\r\n });\r\n\r\n chart.draw(data, options);\r\n \r\n}", "title": "" }, { "docid": "efeb66da1038805b8a04c1490052309e", "score": "0.6481831", "text": "function drawPieChart(data, container) {\n\tvar categories = {\n\t\t'oil': ['Oil','#6D8F9D'],\n\t\t'coal': ['Coal', '#958D63'],\n\t\t'carbon': ['Carbon', '#6E6E6E'],\n\t\t'R':['Republican', '#cc3333'],\n\t\t'D':['Democrat', '#3333cc'],\n\t\t'G':['Green', '#33cc33'],\n\t\t'L':['Libertarian', '#cc33cc'],\n\t\t'I':['Independant', '#cccc33'],\n\t\t'N':['Non-Partisan', '#cccccc']\n\t}\n\n\tvar width = $(window).width() / 2 * 0.9,\n\t\theight = $(window).height() / 2 * 0.675,\n\t\tradius = Math.min(width,height) / 2;\n\tvar color = d3.scale.category20();\n\n\tvar pie = d3.layout.pie()\n\t\t.value(function(d) { return d.value; })\n\t\t.sort(key);\n\n\tvar arc = d3.svg.arc()\n\t\t.innerRadius(radius * 0.25)\n\t\t.outerRadius(radius * 1.0);\n\n\tvar getAngle = function (d) {\n\t\tvar angle = (180 / Math.PI * (d.startAngle + d.endAngle) / 2 - 90);\n\t\tif ( angle > 90 ) { angle -= 180; }\n\t\treturn angle;\n\t};\n\n\tvar svg = d3.select(this.container+' svg>g');\n\tif (svg.empty()) {\n\t\tsvg = d3.select(this.container).append('svg')\n\t\t\t.attr('width',width)\n\t\t\t.attr('height',height)\n\t\t\t.append('g')\n\t\t\t\t.attr('transform','translate('+ width/2 + ',' + height/2 + ')');\n\t}\n\n\tvar arcs = svg.datum(data).selectAll('.arc')\n\t\t.data(pie, key)\n\t\t.enter().append('g')\n\t\t.attr('class','arc')\n\n\tarcs.append('path') \n\t\t.attr('fill',function(d,i) { return categories[d.data.label][1]; })\n\t\t.attr('d',arc)\n\t\t.each(function(d) { this._current = d; })\n\t\t.on('mouseenter', brighten)\n\t\t.on('mouseleave', darken);\n\n\tarcs.append('text')\n\t\t.attr('class', 'chart-label')\n\t\t.attr(\"transform\", function(d) { return \"translate(\" + arc.centroid(d) + \")\" +\n\t\t\t\"rotate(\" + getAngle(d) + \")\"; })\n\t\t.attr(\"dy\", \".35em\")\n\t\t.style(\"text-anchor\", \"middle\")\n\t\t.text(function(d) { return d.data.label; });\n\n\tsvg.datum(data).selectAll('path').data(pie, key).exit()\n\t\t.transition(750)\n\t\t.attr('fill', '#fff')\n\n\tsvg.datum(data).selectAll('.arc').data(pie,key).exit().transition(750).remove();\n\n\n\tchange();\n\n\tfunction change() {\n\t\t//var path = svg.datum(data).selectAll('path')\n\t\t//pie.value(function(d) { return d.value; });\n\t\tpath = svg.datum(data).selectAll('path').data(pie, key);\n\t\tpath.transition().duration(750).attrTween('d',arcTween)\n\t\t\t.attr('fill',function(d,i) { return categories[d.data.label][1]; })\n\n\t\tsvg.datum(data).selectAll('text').data(pie,key)\n\t\t\t.attr(\"transform\", function(d) { return \"translate(\" + arc.centroid(d) + \")\" +\n\t\t\t\t\"rotate(\" + getAngle(d) + \")\"; })\n\t\t\t.attr(\"dy\", \".35em\")\n\t\t\t.style(\"text-anchor\", \"middle\")\n\t\t\t.text(function(d) { return categories[d.data.label][0]; });\n\t}\n\n\tfunction arcTween(a) { var i = d3.interpolate(this._current, a);\n\t\tthis._current = i(0);\n\t\treturn function(t) {\n\t\t\treturn arc(i(t));\n\t\t};\n\t}\n\n\tfunction key(d) {\n\t\t//trying to maintain consistency across companies and legislators in pie chart grouping\n\t\tvar label = typeof(d.label) != 'undefined' ? d.label : d.data.label;\n\t\tif (label == 'coal') { \n\t\t\tlabel= 'D';\n\t\t} else if(label == 'oil') { \n\t\t\tlabel= 'R';\n\t\t} else if(label == 'carbon') { \n\t\t\tlabel= 'N';\n\t\t}\n\t\treturn label;\n\t}\n}", "title": "" }, { "docid": "dd2ad00ec0883e92f403a841ec8ec448", "score": "0.648017", "text": "function pieChart(pD){\nvar pC ={}, pieDim ={w:250, h: 250};\npieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n// create svg for pie chart.\nvar piesvg = d3.select(id).append(\"svg\")\n.attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n.attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n// create function to draw the arcs of the pie slices.\nvar arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n// create a function to compute the pie slice angles.\nvar pie = d3.layout.pie().sort(null).value(function(d) { return d.perc; });\n// Draw the pie slices.\npiesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n.each(function(d) { this._current = d; })\n.style(\"fill\", function(d) { return segColor(d.data.type); });\n// create function to update pie-chart. This will be used by histogram.\npC.update = function(nD){\npiesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n.attrTween(\"d\", arcTween);\n};\n\n// Animating the pie-slice requiring a custom function which specifies\n// how the intermediate paths should be drawn.\nfunction arcTween(a) {\nvar i = d3.interpolate(this._current, a);\nthis._current = i(0);\nreturn function(t) { return arc(i(t)); };\n}\nreturn pC;\n}", "title": "" }, { "docid": "6e3b3bef099b2ce46afd435ac637f45c", "score": "0.64743394", "text": "function bakeThePie(options)\n{\n //data and valueFunc are required\n if (!options.data || !options.valueFunc)\n {\n return '';\n }\n var data = options.data,\n valueFunc = options.valueFunc,\n r = options.outerRadius ? options.outerRadius : 28, //default outer radius = 28px\n rInner = options.innerRadius ? options.innerRadius : r - 10, //default inner radius = r-10\n strokeWidth = options.strokeWidth ? options.strokeWidth : 1, //default stroke is 1\n pathClassFunc = options.pathClassFunc ? options.pathClassFunc : function() {\n return '';\n }, //class for each path\n pathTitleFunc = options.pathTitleFunc ? options.pathTitleFunc : function() {\n return '';\n }, //Title for each path\n pieClass = options.pieClass ? options.pieClass : 'marker-cluster-pie', //class for the whole pie\n pieLabel = options.pieLabel ? options.pieLabel : d3.sum(data, valueFunc), //label for the whole pie\n pieLabelClass = options.pieLabelClass ? options.pieLabelClass : 'marker-cluster-pie-label', //Class for the pie label\n\n origo = (r + strokeWidth), //center coordinate\n w = origo * 2, //width and height of the svg element\n h = w,\n donut = d3.pie(),\n arc = d3.arc().innerRadius(rInner).outerRadius(r);\n\n //Create svg element\n var svg = document.createElementNS(d3.namespaces.svg, 'svg');\n\n //Create pie chart\n var vis = d3.select(svg)\n .data([data])\n .attr('class', pieClass)\n .attr('width', w)\n .attr('height', h);\n\n var arcs = vis.selectAll('g.arc')\n .data(donut.value(valueFunc))\n .enter().append('svg:g')\n .attr('class', 'arc')\n .attr('transform', 'translate(' + origo + ',' + origo + ')');\n\n arcs.append('svg:path')\n .attr('class', pathClassFunc)\n .attr('stroke-width', strokeWidth)\n .attr('fill', function(d) {\n if (d.data.key=='evaluation') {\n return \"url(#diagEval)\"\n } else if (d.data.key=='intervention') {\n return \"url(#diagInt)\"\n }\n })\n .attr('d', arc)\n .append('svg:title')\n .text(pathTitleFunc);\n\n vis.append('text')\n .attr('x', origo)\n .attr('y', origo)\n .attr('class', pieLabelClass)\n .attr('text-anchor', 'middle')\n //.attr('dominant-baseline', 'central')\n //IE doesn't seem to support dominant-baseline, but setting dy to .3em works\n .attr('dy', '.3em')\n .text(pieLabel);\n //return svg-markup (not actual element)\n return serializeXmlNode(svg);\n}", "title": "" }, { "docid": "66ba9858a34642beb8892da1fa538487", "score": "0.6473889", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Receitas', receitas],\n ['Despesas', despesas],\n ]);\n\n // Set chart options\n var options = {'title':'Relatório de Receitas e Despesas',\n 'width':500,\n 'height':400,\n is3D: true\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "f1584c97b1662c5dbf918cf1921dc779", "score": "0.64725125", "text": "function makePieChart (dataset, svg_id) {\n\n const svg = d3.select(svg_id);\n const width = svg.attr(\"width\");\n const height = svg.attr(\"height\");\n\n const radius = Math.min(width, height) / 2;\n const g = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\");\n\n const color = [];\n for (const hex of dataset){\n color.push(hex.color);\n }\n\n\n // Generate the arcs\n const arc = d3.arc()\n .innerRadius(0)\n .outerRadius(radius);\n\n const label = d3.arc()\n .outerRadius(radius)\n .innerRadius(radius - 90);\n\n // Generate the pie\n const create_pie = d3.pie()\n .value(function(d) {\n return d.val;\n });\n\n const pie_data = create_pie(dataset);\n\n\n\n //Generate groups\n const arcs = g.selectAll(\"arc\")\n .data(pie_data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"arc\")\n\n //Draw arc paths\n arcs.append(\"path\")\n .attr(\"fill\", function(d, i) {\n return color[i];\n })\n .attr(\"d\", arc);\n\n\n arcs.append(\"text\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + label.centroid(d) + \")\";\n })\n .text(function(d) { return (d.data.name) + \"\\n\" + (d.data.val) + \"%\"; });\n\n}", "title": "" }, { "docid": "e864686498b9426dc16703e000116a2b", "score": "0.6470381", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Наличные деньги', 0],\n ['Министерство Финансов Республики Казахстан', 100],\n ['Корпоративные облигации в KZT и USD', 0],\n ['Корпоративные акции в KZT и USD', 0],\n ['Депозитарные расписки', 0],\n ['Вклады в банках', 0],\n ['Финансовые инструменты Инвестиционных фондов', 0],\n ['Индексные фонды облигаций и (ETFs)', 0],\n ['Инструменты денежного рынка (РЕПО и другое)', 0],\n ['Производные финансовые инструменты', 0]\n ]);\n\n // Set chart options\n var options = {'title':'Структура активов фонда по видам финансовых инструментов:',\n legend: 'none',\n chartArea: {'width': '90%', 'height': '60%'},\n colors: ['#e5577d']\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "4b0dbc024389e9bafb95aeb93fcf62e0", "score": "0.64694935", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Label', 'Nilai Indeks'],\n ['IKL', 8],\n ['IKS', 2],\n ['IKE', 4]\n ]);\n\n // Optional; add a title and set the width and height of the chart\n var options = { 'title': 'Indeks Desa Membangun', 'width': 600, 'height': 400, };\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "9d8b49a085b2e7cf91ce887139c4f38b", "score": "0.6464879", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['College Ave.', 23],\n ['Busch', 10],\n ['Cook/Douglass', 12],\n ['Livingston', 19]\n ]);\n\n // Set chart options\n var options = {\n width: 400,\n height: 240,\n // title: 'Where\\'s the action?',\n colors: ['red', '#2f2f2f', 'grey', 'lightgrey'],\n is3D: true,\n backgroundColor: 'black',\n pieSliceText: 'value',\n titleTextStyle: {\n color: 'white',\n fontSize: 20,\n bold: false,\n italic: false\n },\n legend: { position: 'right', textStyle: { color: 'white', fontSize: 12 } }\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "b86913a952bfa9685207214a07822a57", "score": "0.6463844", "text": "function printPieChart(parentClass,width,height,data,total,factor) {\n\n //Define color palette\n var z = d3.scaleOrdinal(d3.schemeCategory10);\n z.domain(data.map(function(c) { return c.cat; }));\n \n //Defne overall size\n radius = width / 2.2;\n\n //Define size of inner and outter (pie vs donut)\n var arc = d3.arc()\n .outerRadius(radius - 10)\n .innerRadius(radius - radius/factor);\n\n //Pie function for printing speicifc arcs\n var pie = d3.pie()\n .sort(null)\n .value(function(d) {\n return d.sum;\n });\n\n var svg = d3.select('.'+parentClass).append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\");\n\n var g = svg.selectAll(\".arc\")\n .data(pie(data))\n .enter().append(\"g\"); \n\n \tg.append(\"path\")\n .attr(\"d\", arc)\n .style(\"fill\", function(d,i) {\n return z(d.data.cat);\n });\n\n //Show percentage close to each section\n g.append(\"text\")\n .attr(\"transform\", function(d) {\n var _d = arc.centroid(d);\n _d[0] *= 1.4 / factor ;\t//multiply by a constant factor\n _d[1] *= 1.4 / factor;\t//multiply by a constant factor\n return \"translate(\" + _d + \")\";\n })\n .attr(\"dy\", \".50em\")\n .style(\"text-anchor\", \"middle\")\n .text(function(d) {\n if( d.data.sum / total * 100 < 8) {\n return '';\n }\n return parseFloat(d.data.sum / total * 100).toFixed(2) + '%';\n });\n \n}", "title": "" }, { "docid": "338c55aaf2c68dd7918e93dfd37da4b7", "score": "0.64626974", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n\n //for (let k = 0; k < objJson.length; k++) {\n //primera version, puede que haya otra forma mas pro de llenarla\n //el problema lo vislumbro en la ultima coma, si es que vas pro un for\n //para refactoring...\n data.addRows([\n [objJsonChart[0].symbol + \"-\" + objJsonChart[0].meaning, objJsonChart[0].fav_votes],\n [objJsonChart[1].symbol + \"-\" + objJsonChart[1].meaning, objJsonChart[1].fav_votes],\n [objJsonChart[2].symbol + \"-\" + objJsonChart[2].meaning, objJsonChart[2].fav_votes],\n [objJsonChart[3].symbol + \"-\" + objJsonChart[3].meaning, objJsonChart[3].fav_votes],\n [objJsonChart[4].symbol + \"-\" + objJsonChart[4].meaning, objJsonChart[4].fav_votes]\n ]);\n // Set chart options\n var options = {\n //'title': 'How Many Tacos I Ate Last Night',\n 'width': 400,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "353a9ea43a26d6822fb5657a0feda57c", "score": "0.645547", "text": "function createPieChart(data, node, width, height, options){\r\n options = _.merge({\r\n units: ''\r\n }, options);\r\n\r\n node.html('');\r\n\r\n nv.addGraph(function() {\r\n var chart = nv.models.pieChart()\r\n .margin({top: 0, right: 0, bottom: 0, left: 0})\r\n .x(function(d) { return d.label })\r\n .y(function(d) { return d.percent })\r\n .showLegend(false)\r\n .showLabels(false)\r\n .color(data.map(function(d){return d.color}))\r\n .valueFormat(function(d){return d3.format('.0f')(d) + '%'})\r\n .width(width)\r\n .height(height);\r\n\r\n var sortedData = data.slice();\r\n sortedData.sort(function(a, b){return d3.descending(a.percent, b.percent)});\r\n node.append('ul')\r\n .classed('inlineTop legend', true)\r\n .selectAll('li')\r\n .data(sortedData)\r\n .enter().append('li')\r\n .classed('legendElement small', true)\r\n .each(function(d){\r\n var node = d3.select(this);\r\n node.append('div').classed('inlineTop', true).style('background', d.color);\r\n var percentLabel = ((d.percent >= 1)? Math.round(d.percent): '< 1') + '%';\r\n var label = '<b>' + percentLabel + ' ' + d.label;\r\n if (d.value != null){\r\n label += '</b><br/>(' + formatNumber(d.value) + ' ' + options.units + ')';\r\n }\r\n node.append('div').classed('inlineTop', true).html(label);\r\n if (d.tooltip){\r\n node.attr('title', d.tooltip);\r\n }\r\n });\r\n\r\n node.append('svg')\r\n .classed('inlineTop', true)\r\n .style({\r\n width: width,\r\n height: height\r\n })\r\n .datum(data)\r\n .call(chart);\r\n\r\n return chart;\r\n });\r\n}", "title": "" }, { "docid": "78529eb3f8a8537b8b8eb49a46d71293", "score": "0.64533526", "text": "function drawCountPie2() { \n \n var data = google.visualization.arrayToDataTable([\n ['Type', 'Avg Rides'],\n ['Members', 4875],\n ['Casual Users', 2563]\n ]);\n \n var options = {\n legend: 'none',\n colors:['#0A49A1','#8FC6EF'],\n fontSize: 9,\n chartArea: {left:5, width:'90%',height:'90%'}\n };\n \n var chart = new google.visualization.PieChart(document.getElementById('CountPie2'));\n chart.draw(data, options);\n \n }", "title": "" }, { "docid": "dbe580a54f169e797a7a272014ce9e61", "score": "0.6443794", "text": "function renderPie(data) {\n\tlet dingus = data.dingus / (data.dingus + data.widget) * 100;\n\tlet widget = data.widget / (data.dingus + data.widget) * 100;\n\t\n\tvar chartPie = Highcharts.chart('pie-chart',{\n\t\tchart: {\n\t\t\ttype:'pie'\n\t\t},\n\t\ttitle: {\n\t\t\ttext: 'Dingus vs. Widget'\n\t\t},\n\t\tsubtitle: {\n\t\t\ttext: 'Total Number of Solds in Percentage'\n\t\t},\n\t\tplotOptions: {\n\t\t\tpie: {\n\t\t\t\tshowInLegend: true\n\t\t\t}\n\t\t},\n\t\tcredits: {\n\t\t\tenabled: false\n\t\t},\n\t\ttooltip: {\n\t\t\tpointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\n\t\t},\n\t\tseries: [{\n\t\t\tname: 'Sales',\n\t\t\tcolorByPoint: true,\n\t\t\tdata: [{\n\t\t\t\tname: 'Dingus',\n\t\t\t\ty: dingus\n\t\t\t}, {\n\t\t\t\tname: 'Widget',\n\t\t\t\ty: widget\n\t\t\t}]\n\t\t}],\n\t});\n\tglobalPie = chartPie;\n}", "title": "" }, { "docid": "c8b56cd03ed60373b97af10e8460ba1f", "score": "0.6441766", "text": "function drawChart() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Category');\n data.addColumn('number', 'TestCount');\n data.addRows(outerarray);\n var options = {'title': 'Tests given per Subject',\n titleTextStyle: {\n color: \"#191970\",\n fontName: \"Arial\",\n fontSize: 20,\n bold: true,\n },\n 'width': 600,\n 'height': 300,\n 'backgroundColor': '#E4F1FF',\n 'legend': {\n textStyle: {fontSize: 15}\n },\n 'is3D': true};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('pie_chart'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "4f1a353045b47e247459c1a9824099fe", "score": "0.6440062", "text": "function Getchart(dic){\n // var cla=new Array();\n // if (classification=='emotion') {\n cla=['fear','happiness','disgust','surprise','sadness'];\n // }else if (classification=='gender') {\n // cla=['male','female','other','other','other'];\n // }else if (classification=='age') {\n // cla=['10-19','20-29','30-39','40-49','50+'];\n // }else if (classification=='region') {\n // cla=['Asia', 'Africa', 'Australia', 'Europe', 'North America', 'South America', 'Antarctica'];\n // }else if (classification=='education') {\n // cla= ['Certificate', 'Diploma', 'Bachelor Degree', 'Postgraduate Degree','Postgraduate Degree'];\n // }; \n // console.log(\"dic in Getchart\",dic);\n var dataList = new Array();\n for (var i = 0; i < cla.length; i++) {\n \n dataList[i]={value: dic[cla[i]], name: cla[i]}\n };\n // console.log(\"dataList in Getchart\",dataList);\n\n var app = {};\n option = null;\n option = {\n tooltip: {\n trigger: 'item',\n formatter: '{a} <br/>{b}: {c} ({d}%)'\n },\n legend: {\n orient: 'horizontal',\n left:80,\n top:450,\n data: cla\n },\n series: [\n {\n name: '',\n type: 'pie',\n radius: ['50%', '70%'],\n avoidLabelOverlap: false,\n label: {\n normal: {\n show: false,\n position: 'center'\n },\n emphasis: {\n show: true,\n textStyle: {\n fontSize: '20',\n fontWeight: 'bold'\n }\n }\n },\n labelLine: {\n normal: {\n show: false\n }\n },\n data: dataList\n }\n ]\n };\n ;\n if (option && typeof option === \"object\") {\n // container.innerHTML = \"<div id='container' style=\"height:500%\">\" \n // +myChart.setOption(option, true)+ \"</div>\"\n\n // document.getElementById(\"container\").innerHTML=myChart.setOption(option, true);\n // console.log(option);\n return option;\n };\n }", "title": "" }, { "docid": "1d960035c83351d5781ca38da98a312f", "score": "0.6408479", "text": "function drawChart() {\n\t// Create the data table.\n\tdata = new google.visualization.DataTable();\n\tdata.addColumn('string', 'Topping');\n\tdata.addColumn('number', 'Slices');\n\tdata.addRows([\n\t['Love', 3],\n\t['Hate', 1]\n\t]);\n// Set chart options\n\n\toptions = {'title':'Love/Hate Percentage',\n\t'pieHole': 0.4,\n\t'width':480,\n\t'height':480,\n\t'titleTextStyle': {color: 'red',fontSize:20},\n\t'chartArea.backgroundColor': '#383838',\n\t'backgroundColor' : '#383838'};\n\n// Instantiate and draw our chart, passing in some options.\n\tchart = new google.visualization.PieChart(document.getElementById('chart_div'));\n\tchart.draw(data, options);\n}", "title": "" }, { "docid": "d84e15abef1d0a39b9d1f94648c55824", "score": "0.64076716", "text": "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'categories');\r\n data.addColumn('number', 'people');\r\n data.addRows([\r\n ['기타', 2004],\r\n ['대남병원', 119],\r\n ['신천지대구교회', 2992],\r\n ['이스라엘성지순례', 51],\r\n ['천안시운동시설', 80],\r\n ['확진자접촉', 82]\r\n ]);\r\n\r\n // Set chart options\r\n var options = {'backgroundColor': 'transparent'};\r\n\r\n\r\n\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\r\n chart.draw(data, options);\r\n\r\n }", "title": "" }, { "docid": "0a3cbf67d649429b8bae0437ada13767", "score": "0.63913685", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable(newDataArray);\n \n // Optional; add a title and set the width and height of the chart\n var options = { title: \"My Average Day\", width: 550, height: 400 };\n \n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(\n document.getElementById(\"piechartLD\")\n );\n chart.draw(data, options);\n }", "title": "" }, { "docid": "79f9c4cb00434fe667be2fe0cd853efc", "score": "0.6390478", "text": "function GetPieOption(AC,NAC){\n var option = {\n\t tooltip : {\n\t\ttrigger: 'item',\n\t\tformatter: \"{b} : {c} ({d}%)\"\n\t },\n series : [\n\t\t{\n\t\t name:'PG Summary',\n\t\t type:'pie',\n\t\t radius : '60%',\n\t\t center: ['50%', '50%'],\n\t\t data:[\n\t\t {value:AC, name:'Active+Clean'},\n\t\t {value:NAC, name:'Not Active+Clean'},\n\t\t ]\n\t\t}\n\t ],\n color:[\"green\",\"orange\"]\n \t};\n \n\treturn option;\n\n}", "title": "" }, { "docid": "ce07cb7a80a2507f575b7bef67afdbbe", "score": "0.6389961", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Task', 'Hours per Day'],\n ['Chrome', 50],\n ['Firefox', 25],\n ['Safari', 17],\n ['Safari', 8]\n]);\n\n // Here i added a title and set the width and height of the pie chart\n var options = {'title':'Browser Stats', 'width':400, 'height':250};\n\n // Here Displays the pie chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "b7fbcc5b90fe17c98ac7848b3efef2cb", "score": "0.63881737", "text": "function create_hosp_pie_chart(user_state_specifics){\n try{\n var ctx = document.getElementById(\"pieChart2\").getContext(\"2d\");\n var hospitalized = user_state_specifics[\"hosp_currently\"];\n var icu = user_state_specifics[\"icu_currently\"];\n var nonICU = hospitalized - icu;\n // create chart using the canvas\n var pieChart2 = new Chart(ctx, {\n type: 'pie',\n data: {\n datasets: [{\n // displays number of patients in ICU out of total hospitalizations \n data: [ nonICU , icu ],\n backgroundColor: ['rgba(255, 87, 51, 1)', 'rgba(199, 0, 57, 1)'],\n }],\n labels: ['In hospital (general)', 'In hospital ICUs'],\n },\n options: {\n cutoutPercentage: 0,\n legend: {\n display: true,\n position: 'top',\n align: 'start',\n labels: {\n boxWidth: 20,\n fontSize: 14,\n fontStyle: 'bold',\n },\n },\n responsive: false,\n events: ['click'], // prevents a weird hover bug\n },\n });\n } \n catch(err) {\n console.log(\"no hospitalization data\");\n }\n}", "title": "" }, { "docid": "981a2971400d5104f0eb459b09af0159", "score": "0.63828653", "text": "function drawPie(id, data){\n\t \tvar pieData = new Array();\n\t \tvar i = 0;\n\t \tfor (var key in data) {\n\t\t\tif (data.hasOwnProperty(key)) {\n\t\t\t\t pieData[i] = {\n\t\t\t\t\t\tvalue: data[key],\n\t\t\t\t\t\tcolor: colors[i%6],\n\t\t\t\t\t\thighlight: colors[i%6],\n\t\t\t\t\t\tlabel: key\n\t\t\t\t\t};\n\t\t\t\t i++;\n\t\t\t}\n\t \t}\n \t\n var ctx = document.getElementById(id).getContext(\"2d\");\n window.myPie = new Chart(ctx).Pie(pieData);\n}", "title": "" }, { "docid": "4e8b66148e2c75d735be6d705ac119a0", "score": "0.6381383", "text": "function createDonutChart(selector, percent) {\n var duration = 2000;\n var transition = 200;\n var width = $(selector).width();\n var height = width;\n var viewBox = \"0 0 \" + width + \" \" + height;\n\n var dataset = {\n lower: calcPercent(0),\n upper: calcPercent(percent)\n },\n radius = Math.min(width, height) / 2.25,\n pie = d3.layout.pie().sort(null),\n format = d3.format(\".0%\");\n\n var arc = d3.svg.arc()\n .innerRadius(radius * .5)\n .outerRadius(radius);\n\n var svg = d3.select(selector).append(\"svg\")\n .attr(\"viewBox\", viewBox)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\");\n\n var path = svg.selectAll(\"path\")\n .data(pie(dataset.lower))\n .enter().append(\"path\")\n .attr(\"class\", function (d, i) {\n return \"color\" + i\n })\n .attr(\"d\", arc)\n .each(function (d) {\n this._current = d;\n });\n\n var progress = 0;\n\n var timeout = setTimeout(function () {\n clearTimeout(timeout);\n path = path.data(pie(dataset.upper));\n path.transition().duration(duration).attrTween(\"d\", function (a) {\n var i = d3.interpolate(this._current, a);\n var i2 = d3.interpolate(progress, percent)\n this._current = i(0);\n return function (t) {\n return arc(i(t));\n };\n });\n }, 200);\n\n function calcPercent(percent) {\n return [percent, 100 - percent];\n };\n }", "title": "" }, { "docid": "860dc6264e2524e7e50e75fe5bae98b3", "score": "0.63778675", "text": "function dealTypes_piechart(arr) { \n var ctx = document.getElementById('dealTypes');\n var myChart = new Chart(ctx, {\n type: 'doughnut',\n data: {\n labels: ['Buyer Side', 'List Side', 'Double-End', ],\n datasets: [{\n label: 'Deal Types',\n data: arr,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n ],\n borderWidth: 3\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "title": "" }, { "docid": "ed5c791415e229ddf441f0168bb19109", "score": "0.63767225", "text": "function drawChart1() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n // Set chart options\n var options = {'title':'How Much Pizza I Ate Last Night',\n 'width':400,\n 'height':300};\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "b752b5811415c51f10857a6439df2d62", "score": "0.63692296", "text": "function drawOrderStatusChart() {\n\n\n \n \n // Create the data table for Sarah's pizza.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n var i;\n for(i = 0; i < count; i++)\n {\n data.addRows([[orderStatus[i], orderOrders[i]]]);\n }\n // data.addRows([\n // ['Mushrooms', 1],\n // ['Onions', 1],\n // ['Olives', 2],\n // ['Zucchini', 2],\n // ['Pepperoni', 1]\n // ]);\n\n // Set options for Sarah's pie chart.\n var options = {title:'Order Status Information',\n width:300,\n height:200};\n\n // Instantiate and draw the chart for Sarah's pizza.\n var chart = new google.visualization.PieChart(document.getElementById('OrderStatus_chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "37848d3e8d1b165b54a71b3672ff8dcc", "score": "0.6368126", "text": "function creaGraficoPie (labelsVenditori, venditePerSalesman){\n var ctx = $('#grafico-due');\n var myPieChart = new Chart(ctx, {\n type: 'pie',\n data: {\n labels: labelsVenditori,\n datasets: [{\n label: 'Vendite Mensili',\n data: venditePerSalesman,\n backgroundColor: ['lightcoral', 'lightblue', 'lightgreen', 'lightyellow']\n }]\n }\n });\n }", "title": "" }, { "docid": "2454f418657d0cbf9d0eca58113a9ba9", "score": "0.63629234", "text": "function drawChart1() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Rok');\n data.addColumn('number', 'Znamka');\n data.addRows([\n ['A', 20],\n ['B', 11],\n ['C', 13],\n ['D', 7],\n ['E', 5],\n ['FX', 0],\n ['FN', 1]\n ]);\n\n // Set chart options\n var options = {'title':'Známky za rok 2012/13:',\n 'width':400,\n 'height':300,\n 'sliceVisibilityThreshold':0};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "88cbf8c1227d0f0bc5167b657be92836", "score": "0.6362087", "text": "function drawChart() {\r\n var data = google.visualization.arrayToDataTable([\r\n ['Scheme', 'Counted'],\r\n ['.com', 5],\r\n ['.edu', 1],\r\n ['.gov', 1],\r\n ['other', 1],\r\n ]);\r\n\r\n // Optional; add a title and set the width and height of the chart\r\n var title = {\r\n 'title': 'Url TLD',\r\n 'width': 600,\r\n 'height': 400\r\n };\r\n\r\n // Display the chart inside the <div> element with id=\"piechart\"\r\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\r\n chart.draw(data, title);\r\n }", "title": "" }, { "docid": "9d39dd1895cfe13209afd4a191cda9c5", "score": "0.6361974", "text": "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Topping');\r\n data.addColumn('number', 'Slices'); \r\n data.addRows([\r\n ['California', 3],\r\n ['Arizona', 1],\r\n ['Texas', 1],\r\n ['Indiana', 1],\r\n ['Newyork', 2]\r\n ]);\r\n\r\n // Set chart options\r\n var options = {'title':'How Many People Are Affected By Cancer in USA ?',\r\n 'width':650,\r\n 'height':500};\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\r\n chart.draw(data, options);\r\n }", "title": "" }, { "docid": "f36e49572ceabaeb268c8bb89d1a3ad8", "score": "0.6358522", "text": "function createGraph1(value1){\n\t$(\"#pie1\").empty();\n\t\n\tvar w = 300, //width\n h = 300, //height\n r = 150, //radius\n \n color = d3.scale.category20c(); //builtin range of colors\n\n data = [{\"label\":\"\", \"value\":value1}, \n {\"label\":\"\", \"value\":(100-value1)}];\n \n var vis = d3.select(\"#pie1\")\n .append(\"svg:svg\") //create the SVG element inside the <body>\n .data([data]) //associate our data with the document\n .attr(\"width\", w) //set the width and height of our visualization (these will be attributes of the <svg> tag\n .attr(\"height\", h)\n .append(\"svg:g\") //make a group to hold our pie chart\n .attr(\"transform\", \"translate(\" + r + \",\" + r + \")\") //move the center of the pie chart from 0, 0 to radius, radius\n\n var arc = d3.svg.arc() //this will create <path> elements for us using arc data\n .outerRadius(r);\n\n var pie = d3.layout.pie() //this will create arc data for us given a list of values\n .value(function(d) { return d.value; }); //we must tell it out to access the value of each element in our data array\n\n var arcs = vis.selectAll(\"g.slice\") //this selects all <g> elements with class slice (there aren't any yet)\n .data(pie) //associate the generated pie data (an array of arcs, each having startAngle, endAngle and value properties) \n .enter() //this will create <g> elements for every \"extra\" data element that should be associated with a selection. The result is creating a <g> for every object in the data array\n .append(\"svg:g\") //create a group to hold each slice (we will have a <path> and a <text> element associated with each slice)\n .attr(\"class\", \"slice\"); //allow us to style things in the slices (like text)\n\n arcs.append(\"svg:path\")\n .attr(\"fill\", function(d, i) { return color(i); } ) //set the color for each slice to be chosen from the color function defined above\n .attr(\"d\", arc); //this creates the actual SVG path using the associated data (pie) with the arc drawing function\n\n arcs.append(\"svg:text\") //add a label to each slice\n .attr(\"transform\", function(d) { //set the label's origin to the center of the arc\n //we have to make sure to set these before calling arc.centroid\n d.innerRadius = 0;\n d.outerRadius = r;\n return \"translate(\" + arc.centroid(d) + \")\"; //this gives us a pair of coordinates like [50, 50]\n })\n .attr(\"text-anchor\", \"middle\") //center the text on it's origin\n .text(function(d, i) { return data[i].label; }); //get the label from our original data array\n}", "title": "" }, { "docid": "5c12d2673e5f7666e01c63536cbfdb43", "score": "0.63550454", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Equipamentos');\n data.addColumn('number', 'Potência');\n data.addRows([\n ['Iluminação', 3],\n ['Ambiente', 1],\n ['Eletrodomésticos', 1],\n ['Lazer', 1]\n ]);\n\n // Set chart options\n var options = {'title':'Consumo de energia por tipo de Equipamento',\n 'width':400,\n 'height':300};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "6f8f91e086b6af09bf181b75585a1f0f", "score": "0.63526255", "text": "function buildPieGraph(d) {\n // Determine the traces and layout of the graph\n var traces = formatPieData(d);\n var layout = {\n title: 'Proportion of the antibiotics that has the lowest MIC',\n height: window.height,\n width: window.width\n };\n Plotly.newPlot('piegraph', traces, layout, {staticPlot: true});\n}", "title": "" }, { "docid": "be19dc092bac6b6e90fca7712d1c1565", "score": "0.6340758", "text": "function draw_main_box() {\n var data = new google.visualization.DataTable(),\n options = {\n backgroundColor: 'transparent',\n colors: ['#CB3334', '#FFCC33', '#653332', '#CC6633', '#666535', '#263c94']\n },\n chart = new google.visualization.PieChart(document.getElementById('img_total_percentage'));\n\n data.addColumn('string', 'Incidencias');\n data.addColumn('number', 'Porcentaje');\n data.addRows([\n [a_tipo_incidente[0], parseInt(a_cantidad_type[0], 10)],\n [a_tipo_incidente[1], parseInt(a_cantidad_type[1], 10)],\n [a_tipo_incidente[2], parseInt(a_cantidad_type[2], 10)],\n [a_tipo_incidente[3], parseInt(a_cantidad_type[3], 10)],\n [a_tipo_incidente[4], parseInt(a_cantidad_type[4], 10)],\n [a_tipo_incidente[5], parseInt(a_cantidad_type[5], 10)]\n ]);\n\n chart.draw(data, options);\n\n\n //put the total number incident on the view\n $('#num-incident0').html(a_tipo_incidente[0] +' : ' + a_cantidad_type[0]);\n $('#num-incident1').html(a_tipo_incidente[1] +' : ' + a_cantidad_type[1]);\n $('#num-incident2').html(a_tipo_incidente[2] +' : ' + a_cantidad_type[2]);\n $('#num-incident3').html(a_tipo_incidente[3] +' : ' + a_cantidad_type[3]);\n $('#num-incident4').html(a_tipo_incidente[4] +' : ' + a_cantidad_type[4]);\n $('#num-incident5').html(a_tipo_incidente[5] +' : ' + a_cantidad_type[5]);\n $('#num-incident6').html('Gertakari Guztira / Total de incidentes : ' + a_cantidad_type[6]);\n}", "title": "" }, { "docid": "360c0442dc3b4dfe78557fa2d1f380f6", "score": "0.63368756", "text": "function chart() {\n return chart;\n }", "title": "" }, { "docid": "4a6db872eb6fe316e262e44703c4f195", "score": "0.63355184", "text": "function renderInsufPie(male, female, countryName, year) {\n d3.select(\".chartT\")\n .select(\"#chart\")\n .transition()\n .duration(1000)\n .style(\"opacity\", \"0\")\n .remove();\n chartT.html(\"<div id='chart'></div>\");\n chartT.style(\"display\", \"block\").style(\"opacity\", 1);\n // var maleVal = (male/alldata * 100);\n // var femaleVal = (female/alldata * 100);\n\n var insufOption2 = {\n colors: [\"#1A73E8\", \"#d4526e\"],\n chart: {\n height: 350,\n width: 700,\n type: \"pie\"\n },\n title: {\n text:\n \"Prevalence of insufficient activity among male and female in \" +\n countryName +\n \" in year \" +\n year\n },\n labels: [\"Insufficient Activity(Male)\", \"Insufficient Activity(Female)\"],\n series: [Math.ceil(male), Math.ceil(female)],\n responsive: [\n {\n breakpoint: 480,\n options: {\n chart: {\n width: 200\n },\n legend: {\n position: \"bottom\"\n }\n }\n }\n ]\n };\n chart = new ApexCharts(document.querySelector(\"#chart\"), insufOption2);\n chart.render();\n}", "title": "" }, { "docid": "2215b33003f3ec1aae230f001e48e4ad", "score": "0.6329934", "text": "function pie_chart_config(xy_data, title_name, pie_type, size)\n{\n var config = {\n type: pie_type, //'pie', 'doughnut'\n data:\n {\n datasets: [\n {\n data: [],\n backgroundColor: getRandom(Object.values(chartColors), xy_data.data.length), // Choose random colors with the same number of length of the data\n }],\n labels: []\n },\n options:\n {\n responsive: true,\n legend:\n {\n position: 'top',\n },\n title:\n {\n display: true,\n text: title_name,\n fontSize: 20\n },\n animation:\n {\n animateScale: true,\n animateRotate: true\n }\n }\n };\n\n // Push data to the above config object\n for (x of xy_data.data)\n {\n config.data.labels.push(x[0]);\n config.data.datasets[0].data.push(x[1]);\n };\n\n // Set the configuration in the above config object based on where we want a full or only half a pie/doughnut plot\n if (size == 'full')\n {\n config.options.circumference = 2 * Math.PI; //Set the circumference to be complete circle\n config.options.rotation = -Math.PI / 2;\n }\n else\n {\n config.options.circumference = Math.PI; //Set the circumference to be helf of a circle\n config.options.rotation = -Math.PI;\n }\n\n return config //Return the config\n}", "title": "" }, { "docid": "91e1158c13dc2e811b2f00120913248b", "score": "0.63273156", "text": "function chart(id){\n var id = id;\n var n = $(id);\n\n var angle,\n markerAngle,\n lastAngle = 0.1;\n\n $.each($(id), function() {\n\n // $(this).attr('transform', 'rotate(' + lastAngle + ' 110 110)');\n $(this).css({\n transform: 'rotate(' + lastAngle + 'deg)'\n });\n\n angle = (360 / 100) * $(this).attr('aria-valuenow');\n markerAngle = lastAngle + (angle / 2);\n lastAngle = lastAngle + angle;\n if(lastAngle >= 360) {\n lastAngle = 0.1;\n }\n\n $(this).attr('data-marker-angle', markerAngle);\n\n $(this).click(function() {\n $(this).parents('.c-svg-pie-chart').find('.marker').css({\n transform: 'rotate(' + $(this).attr('data-marker-angle') + 'deg)'\n });\n $(this).parents('.c-svg-pie-chart').find('.data').text($(this).attr('aria-valuenow'));\n $($(this).parents('.c-svg-pie-chart').find('.selected')).removeClass('selected');\n $(this).addClass('selected');\n });\n });\n}", "title": "" }, { "docid": "e7fc5be7c901f644bfc94a8909cde821", "score": "0.6325488", "text": "function showPieChart(tag, val) {\n\tvar deg = val*100;\n\t\n\t$(tag).css(\"transform\",\"rotate(\"+rotDeg(deg)+\"deg)\");\n\tif (deg > 50) {\n\t\t$(tag).addClass(\"over50\");\n\t}\n}", "title": "" }, { "docid": "23d5c989a5d50f156e4327ae47d9c3b2", "score": "0.6324201", "text": "function pieChart(sample) {\n\n d3.json(`/metadatatotals${sample}`).then((data) => {\n var labels = [];\n var values = [];\n Object.entries(data).forEach(([key, value]) => {\n labels.push(key);\n values.push(value);\n console.log('pieChart labels array: ', labels);\n console.log('pieChart values array: ', values);\n \n // Build a Pie Chart\n var pieData = [{\n values : values,\n labels : labels,\n hovertext : labels,\n hoverinfo: \"hovertext\",\n type: \"pie\"\n }];\n \n var pieLayout = {\n margin: {t:0, l:0}\n };\n \n // insert in the html div ID = pie\n Plotly.plot(\"pie\", pieData, pieLayout); \n });\n });\n }", "title": "" }, { "docid": "219f72c021a9070fdedc30237cc4db0b", "score": "0.63216275", "text": "function drawChart() {\n\n let data = google.visualization.arrayToDataTable([\n ['Bike', 'Color'],\n ['Silver', 11 ],\n ['Red', 11],\n ['Blue', 2],\n ]);\n\n let options = {\n height: 400,\n width: 500,\n title: 'Stolen bikes by color',\n pieHole: 0.4,\n colors: ['#e0440e', '#e6693e', '#ec8f6e', '#f3b49f', '#f6c7b6']\n };\n\n let chart = new google.visualization.PieChart(document.getElementById('colorDonut')); \t\t\tchart.draw(data, options);\n }", "title": "" }, { "docid": "356ed52c7c27e4724d25b535ccfd1d8c", "score": "0.6316221", "text": "function drawChart() {\n\n //console.log(tabStat);\n // Create the data table.\n \n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n tabStat.forEach(function(st){\n //console.log(st);\n data.addRows([[st[0], st[1]]]);\n });\n \n // Set chart options\n var options = {'title':'Répartition des équipes par Centre de recherche',\n\n 'height':400};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "c70b2c83b218391799c34f1e1cee776b", "score": "0.6314733", "text": "function crea_grafico_categorie(){\n\tvar count = [];\n\n\tvar query='SELECT (count (?org) as ?count) ?label WHERE{\\\n\t\t\t\t\t?org a org:Organization;\\\n\t\t\t\t\torg:purpose ?purp.\\\n\t\t\t\t\t?purp a skos:Concept;\\\n\t\t\t\t\trdfs:label ?label.\\\n\t\t\t\t\t} GROUP BY ?label';\n\t\tvar encodedquery = encodeURIComponent(prefissi+query);\n\t\t/*Dichiaro il formato dell'output*/\n\t\tvar url = endpointURL + \"query?query=\" + encodedquery + \"&format=\" + \"json\";\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: url,\n\t\t\t\tsuccess: function (d){\n\t\t\t\t\t$data = d.results.bindings;\n\t\t\t\t\tvar totale = 0;\n\t\t\t\t\t/*Creo l'array con l'associazione \"categoria-numero di risultati\"*/\n\t\t\t\t\tfor(var i=0;i<$data.length;i++){\n\t\t\t\t\t\tif($data[i].label.value != \"Associazione no profit\"){\n\t\t\t\t\t\t\tcount.push({y: Number($data[i].count.value), indexLabel: $data[i].label.value});\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\ttotale += parseInt($data[i].count.value);\n\t\t\t\t\t}\t\n\t\t\t\t\t/*Creo e visualizzo il grafico*/\n\t\t\t\t\tvar chart = new CanvasJS.Chart(\"chartCategorie\",{\n\t\t\t\t\ttheme: \"theme1\",\n\t\t\t\t\t\t\ttitle :{\n\t\t\t\t\t\t\t\ttext: \"Grafico Categorie\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tlegend:{\n\t\t\t\t\t\t\t\tverticalAlign: \"bottom\",\n\t\t\t\t\t\t\t\thorizontalAlign: \"center\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdata: [{\n\t\t\t\t\t\t\t\ttype: \"pie\",\n\t\t\t\t\t\t\t\tdataPoints : count\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tchart.render();\n\t\t\t\t\t\t$(\"#chart_totale\").html(\"<label>Totale risultati: </label><label>\"+totale_risultati+\"</label>\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\talert('Errore nel recupero dei dati'+textStatus);\n\t\t\t\t\tconsole.log(errorThrown);\n\t\t\t\t}\n\t\t\t \n\t\t\t});\n\n\n\n}", "title": "" }, { "docid": "ebd72c313119507330d454385566bf76", "score": "0.63102794", "text": "function createDonutChart(props) {\n var offsets = [];\n var counts = [props.score1, props.score2, props.score3, props.score4, props.score5];\n var total = 0;\n for (var i = 0; i < counts.length; i++) {\n offsets.push(total);\n total += counts[i];\n }\n var fontSize = total >= 1000 ? 22 : total >= 100 ? 20 : total >= 10 ? 18 : 16;\n var r = total >= 1000 ? 50 : total >= 100 ? 32 : total >= 10 ? 24 : 18;\n var r0 = Math.round(r * 0.6);\n var w = r * 2;\n\n var html = '<svg width=\"' + w + '\" height=\"' + w + '\" viewbox=\"0 0 ' + w + ' ' + w +\n '\" text-anchor=\"middle\" style=\"font: ' + fontSize + 'px sans-serif\">';\n\n for (i = 0; i < counts.length; i++) {\n html += donutSegment(offsets[i] / total, (offsets[i] + counts[i]) / total, r, r0, colors[i]);\n }\n html += '<circle cx=\"' + r + '\" cy=\"' + r + '\" r=\"' + r0 +\n '\" fill=\"white\" /><text dominant-baseline=\"central\" transform=\"translate(' +\n r + ', ' + r + ')\">' + total.toLocaleString() + '</text></svg>';\n\n var el = document.createElement('div');\n el.innerHTML = html;\n return el.firstChild;\n }", "title": "" }, { "docid": "8548243fcfd5424e2061b9de6a6aae86", "score": "0.6308702", "text": "function create_activity_pie_chart(user_state_specifics){\n var low_risk_events = user_state_specifics[\"low_risk_events\"];\n var mod_risk_events = user_state_specifics[\"mod_risk_events\"];\n var mod_high_risk_events = user_state_specifics[\"mod_high_risk_events\"];\n var high_risk_events = user_state_specifics[\"high_risk_events\"];\n var total_events = 0\n\n total_events += (low_risk_events*2) + (mod_risk_events*4) + (mod_high_risk_events*8) + (high_risk_events*16)\n try{\n var ctx = document.getElementById(\"pieChart1\").getContext(\"2d\");\n // create chart using the canvas\n var chart = new Chart(ctx, {\n type: 'pie',\n data: {\n datasets: [{\n // displays each event type by percentage of total risk score to 2 decimals\n data: [(Math.round(low_risk_events*2/total_events*(100))/100), (Math.round(mod_risk_events*4/total_events*(100))/100), \n (Math.round(mod_high_risk_events*8/total_events*(100))/100), (Math.round(high_risk_events*16/total_events*(100))/100)],\n backgroundColor: ['rgba(88, 214, 141, 1)', 'rgba(255, 195, 0, 1)', 'rgba(255, 87, 51, 1)', 'rgba(199, 0, 57, 1)'],\n }],\n labels: [\n 'Low risk',\n 'Moderate risk',\n 'Moderate-High risk',\n 'High risk'\n ]\n },\n options: {\n responsive: false,\n cutoutPercentage: 50,\n legend: {\n display: true,\n position: 'top',\n align: 'start',\n labels: {\n boxWidth: 20,\n fontSize: 14,\n fontStyle: 'bold',\n },\n },\n events: ['click'], // prevents a weird hover bug\n },\n });\n }\n catch(err){\n console.log('No activities selected')\n }\n}", "title": "" }, { "docid": "f076ef46aaab60b566be42aada4fcb54", "score": "0.6305547", "text": "function drawChart() {\n \n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Candidatura');\n data.addColumn('number', 'Porcentaje de votos');\n for ( var c in resultados ) {\n data.addRow([c, parseFloat(resultados[c]['Total'])]);\n }\n \n // Set chart options\n var options = {'title':'Resultados elecciones rectorado',\n 'width':'95%',\n 'is3D' : true,\n 'height':400,\n\t\t 'colors': ['#FCC541','#27C6FB'],\n 'legend': {'position':'top',\n\t\t\t 'maxLines':2}};\n\n \n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('total'));\n chart.draw(data, options);\n \n // Create the data table.\n var sectores = new google.visualization.DataTable();\n sectores.addColumn('string', 'Sector - %');\n var columnas = new Object;\n for ( var c in resultados ) {\n\tsectores.addColumn('number', '% '+c);\n\tsectores.addColumn({type:'number',role:'annotation'});\n\tfor ( var s in resultados[c]['Sector'] ) {\n\t columnas[resultados[c]['Sector'][s][\"Sector\"]] = [];\n }\n }\n for ( var c in resultados ) {\n for ( var s in resultados[c]['Sector'] ) {\n\t columnas[resultados[c]['Sector'][s][\"Sector\"]].push(parseFloat(resultados[c]['Sector'][s]['Resultado']));\n\t columnas[resultados[c]['Sector'][s][\"Sector\"]].push(parseFloat(resultados[c]['Sector'][s]['Votos']));\n\t}\n }\n\n for (var c in columnas ) {\n\tvar breve = c.replace('PROFESORADO','Pr');\n\tbreve = breve.replace('DOCTOR','Dr');\n\tbreve = breve.replace('PERMANENTE','Perm.');\n\tbreve = breve.replace('ASOCIADOS','Asoc.');\n\tsectores.addRow([breve,columnas[c][0],columnas[c][1],columnas[c][2],columnas[c][3]]);\n }\n\t\n // Set chart options\n options = {'title':'Resultados elecciones rectorado - Sectores',\n\t animation: {\"startup\": true,\n\t\t\t \"duration\": 1000,\n\t\t\t \"easing\": 'out'},\n 'width':'95%',\n 'height':600,\n\t 'colors': ['#FCC541','#27C6FB'],\n 'legend': {'position':'bottom'} };\n \n // Instantiate and draw our chart, passing in some options.\n var chart_sectores = new google.visualization.BarChart(document.getElementById('sectores'));\n chart_sectores.draw(sectores, options);\n}", "title": "" }, { "docid": "f9b4d953dc027ab5790b3f109da2de0e", "score": "0.6302581", "text": "function initChart() {\n //load PieChart of the type: donutchart\n chart = new google.visualization.PieChart(document.getElementById('donutchart'));\n }", "title": "" } ]
768a1a501a9aa5eab59a6f4afecdb1a6
this method removes marker and updates related polylines
[ { "docid": "2e4f14ad64d22a68ec6c92a4f312d690", "score": "0.7374491", "text": "function removeMarker(marker) {\n var index = marker.mainId;\n moveMarkers(index, -1);\n movePolys((index - 1 < 0 ? 0 : index - 1), -1);\n showIndirectMarkers();\n calculateDistance();\n last_index = index;\n updatePoly(index - 1, ds2_response);\n }", "title": "" } ]
[ { "docid": "1484bf958cfbb5b706e0adaff6664c5c", "score": "0.7236097", "text": "function resetPolyLines() {\n clearPolyLines();\n for (var i = 0; i < myMarkers.length-1; i++) {\n addPolyLine(myMarkers[i], myMarkers[i+1]);\n }\n}", "title": "" }, { "docid": "05bc752830b46596fa06b3066ef2a495", "score": "0.7215078", "text": "_removeMapMarker() {\n if (this.marker) {\n if (this.marker instanceof ComplexMarker) {\n this.map.removeLayer(this.marker.circle);\n this.map.removeLayer(this.marker.square);\n return;\n }\n\n this.map.removeLayer(this.marker);\n this.marker = null;\n }\n }", "title": "" }, { "docid": "bdc66b72e0ee0e4641b2f33cb6bdde85", "score": "0.69631076", "text": "function removeLine() {\n busPath.setMap(null);\n}", "title": "" }, { "docid": "f7208cce9ab97796f70a2ec9df39e241", "score": "0.68959713", "text": "function markerDragEvent() {\n removeAllMarkersFromMap();\n resetPolyLines();\n placeAllMarkersOnMap(map);\n}", "title": "" }, { "docid": "7fc93657c077c32e54310fc9ace9ecd2", "score": "0.68220896", "text": "function clearMap() {\n boundsOfPolyLine = null;\n for (var stopId in stopMarkersSelected) {\n stopMarkersSelected[stopId].setMap(null);\n }\n for (var stopId in stopMarkersBackground) {\n stopMarkersBackground[stopId].setMap(null);\n }\n for (var i = 0; i < existingPolylines.length; ++i) {\n existingPolylines[i].setMap(null);\n }\n stopMarkersSelected = {};\n stopMarkersBackground = {};\n existingPolylines = [];\n}", "title": "" }, { "docid": "7fbd305654d9be0a3de83593071b3c28", "score": "0.6812827", "text": "function remove_line_on_map(path){\n // we get google.maps.Polyline\n // and set to null \n path.setMap(null);\n}", "title": "" }, { "docid": "e581a3e12016fa31b5ade9014a353912", "score": "0.67820334", "text": "function addRemoveFunction(thisMarker){\n thisMarker.addEventListener(\"mousedown\",function(e){\n if(spaceDown){\n // Remove the marker from the map and the array\n map.removeLayer(thisMarker);\n markers.splice(markers.indexOf(thisMarker),1);\n \n drawLines();\n markerClick=true;\n } \n }, false );\n}", "title": "" }, { "docid": "4ea90cb82d87db6bbc61b39f9be39521", "score": "0.6780157", "text": "_removeMarkers() {\n // Limit removal to the current SVG display.\n $(this._svgDisplay.htmlElement)\n .find('.selection')\n .remove();\n this._markers.length = 0;\n }", "title": "" }, { "docid": "b9810e9df9af0a4c80e4aa4a707fd80c", "score": "0.6751455", "text": "function removeAllMarker() {\n listMarker.forEach(marker => {\n map.removeLayer(marker);\n });\n listMarker = [];\n}", "title": "" }, { "docid": "976cde346fb589557cf3c3f93c33c9f8", "score": "0.67173856", "text": "function reload_map_line(){\n plPoints = []\n plPoints.push({style:\"solid\",weight:4,color:\"#f00\",opacity:0.6,points:spot_points}) \n addPolyline()\n}", "title": "" }, { "docid": "b7ac0a5397ac71881fc3c73af8cd2dee", "score": "0.6714306", "text": "function undoLastMark() {\r\n\tnewPaddockCoords.pop();\r\n\tmarkersArray.getAt(markersArray.getLength() - 1).setMap(null);\r\n\tmarkersArray.pop();\r\n}", "title": "" }, { "docid": "d6113d7e38ebc9b27f0e940e6f7145ca", "score": "0.67058754", "text": "function deleteOverlays() {\n\t\n\t//Remove old lines\n\tfor ( var i = 0; i < lines.length; i++) {\n\t\tlines[i].setMap(null);\n\t}\n\tlines = [];\n\t\n\t//Delete markers\n\tclearOverlays();\n\tmarkers = [];\n}", "title": "" }, { "docid": "a2df26c017ee110f5f77a52f14dbcdd9", "score": "0.67046225", "text": "function removeMarkerFromMap(marker) {\n mymap.removeLayer(marker);\n}", "title": "" }, { "docid": "c8eea2d0ee54b3b89166ef9cd4f52382", "score": "0.6698913", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n //-----Simon\n calculateConvexHull();\n }", "title": "" }, { "docid": "1aabc0e7ff3bffe450dd6d72e05ce295", "score": "0.6697605", "text": "function clearPolyLines() {\n\t\t\tfor (var j = 0; j < polylineList.length; j++) {\n\t\t\t\tpolylineList[j].setMap(null);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2e26a39537c0da8b2b767ed03f3d9ada", "score": "0.6686428", "text": "removeMarker(marker) {\n marker.setMap(null);\n }", "title": "" }, { "docid": "a4f694edd677614354b0c46e69ff851c", "score": "0.66739583", "text": "function clearOverlays() {\n if ($scope.markers) {\n for (var i = 0; i < $scope.markers.length; i++) {\n $scope.markers[i].setMap(null);\n }\n $scope.markers.length = 0;\n $scope.currentLocMarker($scope.currentLocObj);\n \n var newArr = $scope.arr.splice(50, 20);\n newArr.push($scope.currentLocMark);\n console.log('new marker arr');\n console.log(newArr);\n for (i = 0; i < newArr.length; i++) {\n $scope.createMarker(newArr[i]);\n }\n }\n\n }", "title": "" }, { "docid": "14ede06352ab784039d011deb6039de1", "score": "0.6662821", "text": "function deleteMarkers() {\n oznakeLI.clearLayers();\n}", "title": "" }, { "docid": "fd84bea619d2be0041639cd1b97a3afd", "score": "0.6652924", "text": "function removeMapLine(line) {\n mymap.removeLayer(line);\n}", "title": "" }, { "docid": "bd356e69ff8a56753cbe8fd8b1580160", "score": "0.6648802", "text": "function deleteOverlays() {\n clearOverlays();\n markers = [];\n }", "title": "" }, { "docid": "d6f9413a3d760cf66da699350a82410a", "score": "0.6643402", "text": "function clearPolyLines() {\n currentPolyLines = [];\n}", "title": "" }, { "docid": "e33ec6f840117a264f41d13a5e8a90f0", "score": "0.66231805", "text": "function removePolyline(bus_id) {\n var pos = overlayPosition(bus_id);\n var polyline = overlay[pos].polyline;\n polyline.setMap(null);\n }", "title": "" }, { "docid": "70c04acefcfbe1bed3751244a04cf933", "score": "0.6610257", "text": "function deleteOverlays() {\n if (marker) {\n $.each(marker, function(index,c) { \n \tc.setMap(null);\n })\n marker = new Object();\n }\n}", "title": "" }, { "docid": "97edb9d9dc2de575d76e2e6b573133be", "score": "0.66048217", "text": "function removePoly() {\n if (poly != undefined) {\n map.removeControl(poly);\n poly = undefined;\n }\n}", "title": "" }, { "docid": "d5a096b4e3a8d1ea3a7826dc01755239", "score": "0.65712893", "text": "function clearCurrentMarker(){\n \tmarker.setMap(null);\n }", "title": "" }, { "docid": "2648fadf73534c7120bfc6ec038cceb3", "score": "0.6554789", "text": "function removeMarkers() {\n console.log(\"removeMarkers\");\n\n console.log(\" markers_before: \", mapDataObject2.schoolMarkersArray.length);\n var schoolMarkersArray = mapDataObject2.schoolMarkersArray;\n if (schoolMarkersArray) {\n for(i = 0; i < schoolMarkersArray.length; i++){\n schoolMarkersArray[i].setMap(null);\n schoolMarkersArray[i] = null;\n }\n }\n mapDataObject2.schoolMarkersArray = [];\n console.log(\" markers_after: \", mapDataObject2.schoolMarkersArray.length);\n }", "title": "" }, { "docid": "3bd3909800359bbe74d146b860321aff", "score": "0.6546161", "text": "function deletePolyline(index) {\n map_polylines[index].setMap(null);\n deleteObjectsInputs('#line_' + index);\n deleteObjectsInputs('#line_coords_' + index);\n deleteObjectsInputs('#line_' + index + '_edit');\n deleteObjectsInputs('#line_' + index + '_delete');\n deleteObjectsInputs('#line_' + index + '_div');\n }", "title": "" }, { "docid": "e2be9a675879639d583b3167537f832a", "score": "0.6545335", "text": "refreshMap() {\n this.map.removePoints('VehicleLayer')\n this.map.plotPoints('VehicleLayer', this.assets)\n }", "title": "" }, { "docid": "4624a23a758bbd2119a7d9b9d386aec9", "score": "0.6541922", "text": "function cleanMarker(){\n for (var i = 1; i < markers.length-1; i++) {\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "6de9feab6a0bb4fad7082981551499ca", "score": "0.65267104", "text": "function deleteOverlays() {\n clearOverlays();\n markers = [];\n}", "title": "" }, { "docid": "e21c4d5aab2c35609048ba9b943c7c21", "score": "0.6507164", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n removeAllcircles();\n }", "title": "" }, { "docid": "ed434c3c54a1763698cc392f6be8eb03", "score": "0.65058887", "text": "function removeMarkers() {\n for (var i in hackathons) {\n hackathons[i].mark.setMap(null);\n }\n }", "title": "" }, { "docid": "131f223c37526552e0b0fb4ab3b3ea5c", "score": "0.6486387", "text": "function clearMarkers() {\n setAllMap(null);\n polyline.setMap(null);\n document.getElementById('elevation_chart').style.display = 'none';\n $('#receiver-placeholder,#transmiter-placeholder').html('');\n}", "title": "" }, { "docid": "c56e1072e2d5268622d3ebeddd987f49", "score": "0.6484787", "text": "function updateMap() {\n for (var i = 0; i < packagesOnMap.length; i++) {\n\n // If the Polyline does not already exist, make a new one\n if (!(packagesOnMap[i] in mapLines)) {\n mapLines[packagesOnMap[i]] = new google.maps.Polyline({\n path: [],\n geodesic: true,\n strokeColor: colors[packagesOnMap[i]],\n strokeOpacity: 1.0,\n strokeWeight: 3\n });\n }\n mapLines[packagesOnMap[i]].setMap(map);\n\n // If the destination map marker does not already exist, make a new one\n if (!(packagesOnMap[i] in destinationMapMarkers)) {\n destinationMapMarkers[packagesOnMap[i]] = new google.maps.Marker({\n position: destinations[packagesOnMap[i]],\n animation: null,\n title: packagesOnMap[i] + \"'s Destination Marker\",\n icon: pinSymbol(colors[packagesOnMap[i]]),\n label: {\n text: 'B'\n }\n });\n\n // Display an infoWindow with the UUID of the package onclick for the marker\n destinationMapMarkers[packagesOnMap[i]].addListener('click', infoWindowCallback(true, i));\n }\n destinationMapMarkers[packagesOnMap[i]].setMap(map);\n\n // If there is a starting coordinate and the origin map marker does not exist, make a new one\n if (packagePositions[packagesOnMap[i]] != undefined) {\n if(!(packagesOnMap[i] in originMapMarkers)) {\n originMapMarkers[packagesOnMap[i]] = new google.maps.Marker({\n position: packagePositions[packagesOnMap[i]][0]['coords'],\n animation: null,\n title: packagesOnMap[i] + \"'s Origin Marker\",\n icon: pinSymbol(colors[packagesOnMap[i]]),\n label: {\n text: 'A'\n }\n });\n\n // Display an infoWindow with the UUID of the package onclick for the marker\n originMapMarkers[packagesOnMap[i]].addListener('click', infoWindowCallback(false, i));\n \n }\n originMapMarkers[packagesOnMap[i]].setMap(map);\n\n // Update the Polyline with new points that are not on it already (by number of points)\n var currentPath = mapLines[packagesOnMap[i]].getPath();\n for (var j = currentPath.length; j < packagePositions[packagesOnMap[i]].length; j++) {\n currentPath.push(packagePositions[packagesOnMap[i]][j]['coords']);\n }\n mapLines[packagesOnMap[i]].setPath(currentPath);\n }\n }\n}", "title": "" }, { "docid": "ce2876b03b965959511b96c9f0aeb626", "score": "0.64833236", "text": "function updatePoly(i, d) {\n if (poly2[i].getPath().getLength() > 20) {\n poly2[i] = new google.maps.Polyline([polyLine[i].getPath().getAt(lastVertex - 1)]);\n }\n \n if (polyLine[i].GetIndexAtDistance(d) < lastVertex + 2) {\n if (poly2[i].getPath().getLength() > 1) {\n poly2[i].getPath().removeAt(poly2[i].getPath().getLength() - 1)\n }\n poly2[i].getPath().insertAt(poly2[i].getPath().getLength(), polyLine[i].GetPointAtDistance(d));\n } else {\n poly2[i].getPath().insertAt(poly2[i].getPath().getLength(), endLocation[i].latlng);\n }\n \n }", "title": "" }, { "docid": "48eee9f1309d6f622f9a07bfe3d8cabb", "score": "0.6483201", "text": "clearMarkings (){\n if(this.markerStop)\n this.markerStop.setMap(null);\n if(this.markerStart)\n this.markerStart.setMap(null);\n if(this.path)\n this.path.setMap(null);\n }", "title": "" }, { "docid": "1abec58a4ecbd6b089aad87d930b912f", "score": "0.64743936", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n circles = [];\n }", "title": "" }, { "docid": "a031bcf242c9b91a82140bc84145e298", "score": "0.647106", "text": "function removeLastPolyLine() {\n currentPolyLines.pop();\n}", "title": "" }, { "docid": "62bf8ad1fe08f3881c5784cc706ffd32", "score": "0.6467826", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markerAdd = []\r\n markersJSON = [];\r\n }", "title": "" }, { "docid": "92288e2aeca61e66bd8da3793ee84373", "score": "0.64661855", "text": "destroy() {\n this.editor.getDefaultMarkerLayer().clear();\n }", "title": "" }, { "docid": "651b3bd23a44866f5d1b2addf3b4f15b", "score": "0.6445883", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n }", "title": "" }, { "docid": "46e40bbc48af22f67cbd79bd45f06a4f", "score": "0.64428467", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "46e40bbc48af22f67cbd79bd45f06a4f", "score": "0.64428467", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "46e40bbc48af22f67cbd79bd45f06a4f", "score": "0.64428467", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "46e40bbc48af22f67cbd79bd45f06a4f", "score": "0.64428467", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "905667eff04bb980952afa62e97f990d", "score": "0.6441292", "text": "function deleteMarkers() {\n clearMarkers();\n markers = []; \n}", "title": "" }, { "docid": "b282c0c94d150bc9a7078d688c76f528", "score": "0.6434362", "text": "function clearMarkGPS() {\r\n if (markerGPS) {\r\n try {\r\n for (i in markerGPS) {\r\n markerGPS[i].setMap(null);\r\n }\r\n } catch (e) { catche(e); }\r\n markerGPS.length = 0; //add\r\n }\r\n}", "title": "" }, { "docid": "1cc69d5dd6a7e6e73a0da57a78271a13", "score": "0.6434314", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "e0e8d02622f62eb70813bd9328a0678e", "score": "0.6430449", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "e0e8d02622f62eb70813bd9328a0678e", "score": "0.6430449", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "74255fddeb26b0e027ccfd53c6f9b30d", "score": "0.64246964", "text": "updateISSMapOverlays(trackData) {\n const positions = this.issPositionData[0].Coordinates[1][0];\n\n // add location marker if there is none\n if (this.locationMarker == null) {\n this.locationMarker = L.marker([this.currentLocation.latitude, this.currentLocation.longitude]).addTo(this.issMap);\n // if location has changed, remove old marker and set new marker in new location\n } else if (this.locationMarker.getLatLng().lng != this.currentLocation.longitude) {\n this.issMap.removeLayer(this.locationMarker);\n this.locationMarker = L.marker([this.currentLocation.latitude, this.currentLocation.longitude]).addTo(this.issMap);\n }\n\n // add iss icon marker if there is none\n if (this.issMarker == null) {\n this.issMarker = L.marker(trackData.markerLatLng, {icon: this.issIcon}).addTo(this.issMap);\n // when iss location updates, remove the marker at the old location and set new marker in new location\n } else {\n this.issMap.removeLayer(this.issMarker);\n this.issMarker = L.marker(trackData.nextLatLng, {icon: this.issIcon}).addTo(this.issMap);\n }\n\n if (this.issFullPastPolyline == null\n || this.issPartialPastPolyline == null\n || this.issPartialFuturePolyline == null\n || this.issFullFuturePolyline == null) {\n const fullFuturePath = this.generatePolylineLatLng(this.startTrack.start, this.startTrack.end, positions);\n const fullPastPath = this.generatePolylineLatLng(this.endTrack.start, this.endTrack.end, positions);\n const pastOfCurrentPath = this.generatePolylineLatLng(this.indexTrack.start, this.issCurrentLocationIndex + 2, positions, 'pre');\n const futureOfCurrentPath = this.generatePolylineLatLng(this.issCurrentLocationIndex, this.indexTrack.end, positions, 'post');\n\n this.issFullPastPolyline = L.polyline(fullPastPath, {color: '#9e1c1c', opacity: 0.4}).addTo(this.issMap);\n this.issPartialFuturePolyline = L.polyline(futureOfCurrentPath, {color: '#ffffff', weight: 4}).addTo(this.issMap);\n this.issPartialPastPolyline = L.polyline(pastOfCurrentPath, {color: '#d6d328', weight: 4}).addTo(this.issMap);\n this.issFullFuturePolyline = L.polyline(fullFuturePath, {color: '#1c979e', opacity: 0.4}).addTo(this.issMap);\n } else {\n this.addedPastTracks.push(L.polyline([trackData.previousLatLng, trackData.nextLatLng], {color: '#d6d328', opacity: 0.7}).addTo(this.issMap));\n }\n }", "title": "" }, { "docid": "a8b6e3f0dbbadb5e74f0651805e06743", "score": "0.6419972", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "a8b6e3f0dbbadb5e74f0651805e06743", "score": "0.6419972", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "74043926590097a62340e238aa9aeb28", "score": "0.6414322", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "9321912499f9c53f4889fda1e5d36eab", "score": "0.64100045", "text": "function removeMarkers() {\n _.forEach($scope.markers, function (marker) {\n marker.setMap(null);\n marker = null;\n });\n $scope.markers = [];\n }", "title": "" }, { "docid": "798d4df58bd30ad94e8fa908bd8e6eea", "score": "0.6409674", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n lines = [];\n windows = [];\n }", "title": "" }, { "docid": "cefff5cc904e71b080d6f14ec2e5395f", "score": "0.64095974", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "c5c1f7f4aa24345172e70f776d78e6fb", "score": "0.64052194", "text": "function removePath() {\n map.eachLayer(function (layer) {\n if (layer instanceof L.Marker) {\n map.removeLayer(layer);\n }\n });\n}", "title": "" }, { "docid": "63f05cc5561a65821c3f963536748a14", "score": "0.64014417", "text": "function removeMarkers() {\n for (i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n circle.setMap(null);\n }", "title": "" }, { "docid": "537eb709d0cebd76ff296bcf5d18f6f7", "score": "0.63927644", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "537eb709d0cebd76ff296bcf5d18f6f7", "score": "0.63927644", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "537eb709d0cebd76ff296bcf5d18f6f7", "score": "0.63927644", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "50ffe4e09c3fbebd9a722173d9c10fe8", "score": "0.6387856", "text": "function clearPoints() {\n map.removeLayer('mainMapLayer');\n }", "title": "" }, { "docid": "d3fe5e7741222dd7508aab6d0d8a2442", "score": "0.638776", "text": "function deleteMarkers() {\r\n \t clearMarkers();\r\n \t markers = [];\r\n \t}", "title": "" }, { "docid": "34323710b0231df4236d00711919533f", "score": "0.6387532", "text": "function remove_marker(id) {\n\tif (id in drone_dict) {\n\t\tdrone_dict[id].setMap(null);\n\t\tdrone_dict[id] = null;\n\t\t// do not delete the ID so that it can be recycled\n\t\t// also deleting will hurt performance\n\t}\n}", "title": "" }, { "docid": "d5c883817cf31e2357d773e04c6864bc", "score": "0.6385683", "text": "function placeLastPolyLine() {\n currentPolyLines[currentPolyLines.length - 1].setMap(map);\n}", "title": "" }, { "docid": "23459e4547e1e79c8c2dacf7845bd60d", "score": "0.6376624", "text": "function deleteMarkers() {\n\tclearMarkers();\n\tmarkers = {};\n}", "title": "" }, { "docid": "96d7b39066b3f9bd860fbbabe3b6e0d0", "score": "0.63676906", "text": "removeLayer() {\n this.getStartEndMarker().forEach(marker => marker.remove());\n return MapContryBase.prototype.removeLayer.call(this);\n }", "title": "" }, { "docid": "229aed2b7bacb66336dcb28442422a0e", "score": "0.6366753", "text": "function resetSelectedLine() {\n // Remove each marker from the map\n for (var i = 0; i < selectedLineData.length; i++) {\n selectedLineData[i].setMap(null);\n }\n\n // Dereference the markers\n selectedLineData = [];\n\n // Unhide other lines\n for (var i = 0; i < routes.length; i++) {\n routes[i].line.setMap(airQualityMap);\n }\n }", "title": "" }, { "docid": "71400cee3293c0d9a4aa7b2b76fb1489", "score": "0.63496697", "text": "function deleteMarkers() {\n clearMarkers();\n team_code_to_marker = {}\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.6342786", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.6342786", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.6342786", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.6342786", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.6342786", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.6342786", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.6342786", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "6ed3abc418b23fc3da21c5c57b5f39e5", "score": "0.6340846", "text": "deleteMarkers() {\n for (let mark in this.markers) {\n this.markers[mark].setMap(null);\n }\n this.markers = {};\n}", "title": "" }, { "docid": "c0d4952743160ece06b9dffd354c9aca", "score": "0.6322525", "text": "function removeLastMarker() {\n myMarkers.pop();\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "4beca0213d2236d176147df22d7d31d0", "score": "0.632109", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "ab6a9b134e8edf4ec8d8452080edb65c", "score": "0.6318425", "text": "function deleteOverlays() {\n if (markers) {\n for (let i in markers) {\n // console.log(markers[i], '##################################')\n markers[i].setMap(null);\n }\n markers.length = 0;\n }\n}", "title": "" } ]
c5cfeb3a8e1cbe33fcb408d04bf16e89
Define a function that takes two numbers and spits out a whole bunch of information about these two number to the console.
[ { "docid": "600eb412a3f816ed03aa914f254615d5", "score": "0.0", "text": "function mathify(number1, number2) {\n\n //test if both variables actually hold numbers.\n if(typeof number1 == \"number\" && typeof number2 == \"number\") {\nvar sum = number1 + number2;\nvar difference = number1 - number2;\nvar product = number1 * number2;\nvar quotient = number1 / number2;\n// we are giving two aruements only.\n//reports the result to console.\nconsole.log(\"The sum of \" + number1 + \" and \" + number2 + \" is:\",sum);\nconsole.log(\"The difference of \" + number1 + \" and \" + number2 + \" is:\", difference);\nconsole.log(\"The product of \" + number1 + \" and \" + number2 + \" is:\", product);\nconsole.log(\"The quotient of \" + number1 + \" and \" + number2 + \" is:\", quotient);\n//if not numbers...\n} else {\n //type out the errors.\n console.log(\"The value of number1 is not a number! try again.\", \"The datatype of number1 is\" + typeof number1);\n console.log(\"The value of number1 is not a number! try again.\", \"The datatype of number2 is\" + typeof number2);\n} }", "title": "" } ]
[ { "docid": "8a17eea9ba48b546b4f96cfa4b9ea90e", "score": "0.7703911", "text": "function print(num1, num2){\n console.log(num1, num2);\n}", "title": "" }, { "docid": "b17b8c5064e7bdac8677177d42b64776", "score": "0.7203654", "text": "function printResult(a, b) {\n console.log(a + b)\n}", "title": "" }, { "docid": "800acb573198e5fd1fc011ea70045c9d", "score": "0.70916855", "text": "function addTwoNums(x, y){\n\n//x and y are parameters\n\n\tconsole.log(x + y);\n}", "title": "" }, { "docid": "3f5e554102f515c55b2d14860a21adf1", "score": "0.7063521", "text": "function myDisplayer(sum,subtract) {\n console.log('sum of two number'+\"=\"+ sum +\"\\n\"+ 'difference of two number '+\"=\"+ subtract);\n}", "title": "" }, { "docid": "2da8d69f0c59add38d49614084fd8433", "score": "0.7038827", "text": "function numbers(x, y) {\n if (x === y) {\n console.log(x*y)\n } else {\n console.log(x+y)\n }\n }", "title": "" }, { "docid": "ffe9a3bb489e410af283849caa2eb886", "score": "0.6942645", "text": "function printAndReturn(num1, num2) {\n console.log(num1);\n return num2;\n}", "title": "" }, { "docid": "b7f2af8b6068cf28259659dec12f27cb", "score": "0.693777", "text": "function functionWithArgs(num1, num2) {\n console.log(num1 + num2);\n }", "title": "" }, { "docid": "f8039b54117cc4f393ebebfcfce7824c", "score": "0.6897133", "text": "function printResult2(num) {\n console.log('Result: ' + num);\n}", "title": "" }, { "docid": "1c48415117d554629cf6513a2fc4948b", "score": "0.68528306", "text": "function addNumbers (numOne, numTwo) {\n console.log(numOne + numTwo);\n}", "title": "" }, { "docid": "c241b954861890172d0b941e41300265", "score": "0.6836387", "text": "function display(num1, num2)\n{\n document.getElementById(\"displayer\").innerHTML=\"<br/>numbers inputted: \" + num1 + \" and \" + num2;\n}", "title": "" }, { "docid": "9cc28c17eae48cb5ed396a311139dd9a", "score": "0.68007195", "text": "function addAnyTwoNumbers(x, y){\n console.log(x + y);\n}", "title": "" }, { "docid": "3dcd35214274f3795d92ca69f8019635", "score": "0.67965496", "text": "function y(num1, num2){\n console.log(num1); \n return num1+num2;\n}", "title": "" }, { "docid": "f5a8cc347ddf38e9139e6efc26a7cf2b", "score": "0.6788758", "text": "function twoParameters(parameterOne, parameterTwo) {\n console.log(parameterOne + \",\" + parameterTwo);\n}", "title": "" }, { "docid": "a928787cb7e6520c227db98b2bb14e03", "score": "0.6782865", "text": "function add2(a, b) {\r\n console.log(\"\\n Addition is \" + (a + b) + \"\\n \");\r\n}", "title": "" }, { "docid": "b1452746ee9ac4b15bbd15b4c91458b6", "score": "0.67601854", "text": "function addNumbers(num1, num2) {\n\tconsole.log(num1 + num2);\n}", "title": "" }, { "docid": "4f32956313e62410e952d045c66563fb", "score": "0.6725311", "text": "function y(num1, num2){\n console.log(num1); \n return num1+num2;\n }", "title": "" }, { "docid": "cc717fb72256fa33b29e2b9a00aa4ed9", "score": "0.67118657", "text": "function printOut(number1, number2, number3) {\r\n console.log('the number1: ' + number1 + ', the number2: ' + number2 + ', and the number3: ' + number3);\r\n}", "title": "" }, { "docid": "d01eb7749ab8879f978e40d4815cc3d0", "score": "0.67039424", "text": "function addNumbers(num1, num2) {\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "65f02337d2a2f73bbb9867a36dbee52c", "score": "0.66907865", "text": "function sub(number1,number2){\n console.log(number1,number2);\n}", "title": "" }, { "docid": "1463fbe289a9ddfaca8beedda8a2b51a", "score": "0.66832316", "text": "function sum(numOne, numTwo) {\n console.log(numOne + numTwo);\n}", "title": "" }, { "docid": "d904f0a55203b1174f16fc9be3bf2980", "score": "0.6677206", "text": "function persons(one, two) {\n document.write(\"<b>\" + one + \"</b>\" + \" is better than \" + \"<b>\" + two + \"</b>\" + \"<br/>\");\n}", "title": "" }, { "docid": "b899f081425845524a908e510de11582", "score": "0.6662726", "text": "function addNumbers(Num1, Num2){\n var result = Num1 + Num2;\n console.log(\"The result of \", Num1, \" + \", Num2, \" is: \", result);\n}", "title": "" }, { "docid": "f4004925fc84a85bfa0f795a4fef34e5", "score": "0.6625325", "text": "function numberSum(number1, number2) {\n console.log(number1 + number2);\n}", "title": "" }, { "docid": "5e9f40d2098f42dffdd8e4b6734393a6", "score": "0.66152424", "text": "function functionWithArgs(num1, num2) {\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "5e9f40d2098f42dffdd8e4b6734393a6", "score": "0.66152424", "text": "function functionWithArgs(num1, num2) {\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "7ac31b16bc267850bbf7f857dc81213b", "score": "0.66144234", "text": "function AddTwoNumbers(number1, number2) {\n var sum = number1 + number2;\n console.log(sum)\n}", "title": "" }, { "docid": "cabded9703c2f1476730164625c5c2cb", "score": "0.6608395", "text": "function porConsola(numero1, numero2){\r\n console.log(\"Para los numeros \"+numero1 + \" y \" + numero2 + \": \");\r\n console.log(\"Suma: \"+(numero1+numero2));\r\n console.log(\"Resta: \"+(numero1-numero2));\r\n console.log(\"Multiplicacion: \"+(numero1*numero2));\r\n console.log(\"Division: \"+(numero1/numero2));\r\n console.log(\"-----------------------\");\r\n}", "title": "" }, { "docid": "5e20ac22330f73fb18b0fed49f2bbee2", "score": "0.65946704", "text": "function addNumbers(num1, num2){\nlet product = num1 + num2;\n\tconsole.log('${num1} + ${num2} is ${product}');\n}", "title": "" }, { "docid": "6c2e54c828911262329e8fa020a2e84f", "score": "0.6587703", "text": "function addNums(num1, num2) {\n // console.loggin num1 + num2 (our parameters)\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "2b8d6fc80b2af2d1b60a4f2bb45db74a", "score": "0.65865123", "text": "function two(a, b) {\n return a + b;\n}", "title": "" }, { "docid": "1a22b80d9be79e5b4900f59b2ec2cc34", "score": "0.6585444", "text": "function subTwoNumAlert(num1,num2){\n alert(num1 - num2)\n}", "title": "" }, { "docid": "ec64f042bab5407dd17309a149b199c6", "score": "0.657281", "text": "function compareTwoNumbers (numberOne, numberTwo) {\n if (numberOne > numberTwo) {\n return console.log('The first number was bigger!');\n }\n else if (numberOne < numberTwo) {\n return console.log('The second number was bigger!');\n }\n else if (numberOne === numberTwo) {\n return console.log('The numbers are the same!');\n }\n} // end compareTwoNumbers", "title": "" }, { "docid": "d8f65d1e0958bd080e5598f3c228b2b9", "score": "0.6563579", "text": "function sum(num1, num2) {\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "884c62c080f71af120d6a591cda18806", "score": "0.6557897", "text": "function addTwoNumbers(a, b) {\r\n return a + b;\r\n}", "title": "" }, { "docid": "6239a70839843030802cbb95a77d7e57", "score": "0.65545946", "text": "function trueFunction(num1, num2) {\r\n let text = \"\";\r\n let i;\r\n for(i = 1; i <= 100; i++) {\r\n if(i % 3 === 0 && i % 5 === 0) {\r\n text += i + \", \";\r\n }\r\n }\r\n return \"Function that executes when \" +\r\n \"2 statements are true : \" + text;\r\n}", "title": "" }, { "docid": "34ad9baeef48b2ee737e25900a65fe8c", "score": "0.65510315", "text": "function addNums (num1, num2) {\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "b6a39a831744a90881803590eb7efed9", "score": "0.6548667", "text": "function addNumbers(a,b){\n console.log(a+b);\n}", "title": "" }, { "docid": "e9265ba92b212a3f326efc3a5e901514", "score": "0.6545412", "text": "function sumNumbers(a,b) {\n console.log(a + b);\n}", "title": "" }, { "docid": "12fbaa67da65fcdd7b905691a624abb7", "score": "0.65351015", "text": "function functionWithArgs(num1, num2){\n console.log(num1 + num2)\n}", "title": "" }, { "docid": "ff97a5cef076496a2fc7be290fb44b8c", "score": "0.65324044", "text": "function numberSum(num1, num2) {\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "b1c6f63b30e0c599ceb475191b1cd57f", "score": "0.6529756", "text": "function first (a,b){\n document.write(a + b)\n}", "title": "" }, { "docid": "ed4e72e969e59cc8259aea92e6f8760e", "score": "0.65245044", "text": "function add2Numbers(num1, num2) {\r\n const sum = num1 + num2\r\n return num1 + \" + \" + num2 + \" = \" + sum;\r\n}", "title": "" }, { "docid": "1b905a5d7fbd455a1ecd53e0f3e823a0", "score": "0.6523505", "text": "function sum_of_num(a, b){\n console.log(\"[Basic function] sum of number is : \"+(a+b));\n}", "title": "" }, { "docid": "caf3b634bf061bf61ed7ed9698df9b62", "score": "0.6509018", "text": "function functionWithArgs(num1, num2){\n console.log(num1+num2);\n}", "title": "" }, { "docid": "ed41f6481e85e40f18813196871dd118", "score": "0.6506168", "text": "function sumNumbers(a,b) {\n console.log(a+b);\n}", "title": "" }, { "docid": "0775223d924286edf086d025586ef4b2", "score": "0.6497027", "text": "function printEvenBetween (numOne, numTwo) {\r\n\tvar evenNumArray = [];\r\n\tif(numOne < numTwo) {\r\n\t\tfor(var i = numOne + 1; i < numTwo; i++ ) {\r\n\t\t\tif ((i % 2) === 0) {\r\n\t\t\t\tevenNumArray.push(i);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\treturn evenNumArray;\r\n\t}else if (numOne > numTwo) {\r\n\t\tfor(var i = numTwo + 1; i < numOne; i++ ) {\r\n\t\t\tif ((i % 2) === 0) {\r\n\t\t\t\tevenNumArray.push(i);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\treturn evenNumArray;\t\r\n\t}else {\r\n\t\treturn \"Nothing in Between\"\r\n\t}\r\n}", "title": "" }, { "docid": "2c1ad5218a0776ed2ea0094ebca428a5", "score": "0.649062", "text": "function numbers (a, b) {\n\t\tvar substract = b - a;\n\t\tconsole.log(substract);\n\t}", "title": "" }, { "docid": "333101ee0b3220f00cd91d3ea1f55427", "score": "0.6486411", "text": "function adder(num1, num2) {\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "7cb6e7749ea379d3afecdcebe95e0410", "score": "0.64784425", "text": "function multiplyTwoNumbers(a,b) {\n\tconsole.log(a,b)\n\treturn a * b\n\t}", "title": "" }, { "docid": "895f2b5ac35408b732d00ed877e2760d", "score": "0.64750534", "text": "function calcAndDisplay (a, b, callback) {\n const result = callback(a,b);\n console.log(`${callback.name} result: ${result}`);\n}", "title": "" }, { "docid": "d102646cab2f78844a5b88f727973b1a", "score": "0.64707834", "text": "function parttwo(yourname, add1, add2, div1, div2){\n console.log('name:', yourname);\n console.log('sum of ' + add1 + ' + ' + add2 + ' is: ', add1 + add2);\n console.log(+ div1 + ' divided by ' + div2 + ' is:', div1 / div2);\n}", "title": "" }, { "docid": "c8afcc69484514661d3d032220d44fac", "score": "0.6467536", "text": "function printBetween (numOne, numTwo) { \r\n\tvar numberArray = [];\t\r\n\tif (numOne < numTwo) {\r\n\t\tfor (var i = numOne + 1; i < numTwo; i++) {\r\n\t\t\tnumberArray.push(i);\t\r\n\t\t}\r\n\t\treturn numberArray;\r\n\t}else if (numOne > numTwo) {\r\n\t\tfor (var i = numTwo + 1; i < numOne; i++) {\r\n\t\t\tnumberArray.push(i);\t \t\r\n\t\t}\r\n\t\treturn numberArray;\r\n\t}else {\r\n\t\treturn \"Nothing in Between\"\r\n\t}\r\n\r\n\tprintBetween();\r\n\r\n}", "title": "" }, { "docid": "67c55a955b051bf4debcbba4560bc5af", "score": "0.64667547", "text": "function addTwoAndAlert(num1,num2){\n let answer = num1 + num2\n alert(answer)\n}", "title": "" }, { "docid": "8a3afaf0193b30a2b4dc028c6caad8f4", "score": "0.64555067", "text": "function addNums() {\r\n console.log(`the sum is: ${num1 + num2}`);\r\n}", "title": "" }, { "docid": "d1743c484566ec0dfdd9483aa28d3b54", "score": "0.64470947", "text": "function printStraipsnis(x,y){\n console.log(\"Antraste:\",x,\"\\n\",\" \",y+\";\");\n}", "title": "" }, { "docid": "6beec900b2f906bfc9fe270c8091388a", "score": "0.6444172", "text": "function addNum(num1,num2){\r\n console.log(num1+num2);\r\n}", "title": "" }, { "docid": "d87812fcfec1306187a730e32f87142c", "score": "0.6434847", "text": "function number(x,y,cb){\n var ans=cb(x,y);\n console.log(`OUTPUT: ${ans}`);\n}", "title": "" }, { "docid": "76ed6152fcc902902c450a2d039f842c", "score": "0.64314795", "text": "function addNum(num1, num2){\n console.log(num1 + num2);\n}", "title": "" }, { "docid": "95c8e0b5725833b21715beb529b8c49f", "score": "0.642672", "text": "function printNumber(num){\n console.log(`It is ${num}`);\n return num * 2\n}", "title": "" }, { "docid": "766d533cc18cae70bee11dc00c58da8e", "score": "0.64227295", "text": "function addTwoNumbers(numOne, numTwo) {\n return numOne + numTwo;\n}", "title": "" }, { "docid": "766d533cc18cae70bee11dc00c58da8e", "score": "0.64227295", "text": "function addTwoNumbers(numOne, numTwo) {\n return numOne + numTwo;\n}", "title": "" }, { "docid": "95ac97153887e12120fcfb35ebb5fc5c", "score": "0.64181954", "text": "function sumOfNumbers(n1, n2) {\r\n console.log(n1);\r\n}", "title": "" }, { "docid": "7f224658815331b16e1c0b8e149e4e9a", "score": "0.6417234", "text": "function add(number1, number2) {\n console.log(number1 + number2);\n}", "title": "" }, { "docid": "47fdc8c30aa78365e3247331ce495459", "score": "0.6407796", "text": "function addNumbers(num1, num2) {\n\n var result = num1 + num2;\n console.log(num1 + \" + \" + num2 + \" = \" + result);\n}", "title": "" }, { "docid": "b980e2d3c1e19ab28da7fe9fc2091b79", "score": "0.6407354", "text": "function addTwoNumbers(number1, number2){\n return number1 + number2;\n}", "title": "" }, { "docid": "97e5be73bdcb226d08b7b60d148ddf9f", "score": "0.6403328", "text": "function haha2(a,b){\n console.log(`The sum is ${a+b}`);\n}", "title": "" }, { "docid": "92fa3a9e113cdcc57bfdd19f8f2b1c73", "score": "0.63938886", "text": "function naem (a, b){\r\n console.log(a, b);\r\n }", "title": "" }, { "docid": "1f3c8ef8a6499ca374225f7044f752a2", "score": "0.63923126", "text": "function add(num1, num2) {\n\tconsole.log(num1 + num2);\n}", "title": "" }, { "docid": "64e08a7f39705ee45d87d2752f1e2bd4", "score": "0.6369875", "text": "function calculadora(num1,num2) {\n \n console.log(\"Suma: \" + (num1+num2));\n console.log(\"Resta: \" + (num1-num2));\n console.log(\"División: \" + (num1*num2));\n console.log(\"Multiplicación: \" + (num1/num2));\n \n}", "title": "" }, { "docid": "a17e3e49704ca07b4e934eca6fa4b285", "score": "0.6367914", "text": "function add_two_numbers(n1, n2) {\n return n1 + n2;\n}", "title": "" }, { "docid": "6fbfa2cc8cc8d1c6997671c2ba5784fb", "score": "0.6357845", "text": "function daAllInOne(string1, string2, string3, num1, num2) {\n console.log(string1 + ' ' + string2 + ' ' + string3)\n console.log(num1 + num2)\n}", "title": "" }, { "docid": "9a8ef038fa4450bd99c58590b9902b6d", "score": "0.6347809", "text": "function number(num1, num2) {\n if(num1 === num2) {\n console.log(true);\n } else {\n console.log(false);\n }\n}", "title": "" }, { "docid": "6eea427da88369712985a8d00da442d8", "score": "0.6347276", "text": "function addTwoNumbers (num1, num2){\r\n return num1 + num2; \r\n}", "title": "" }, { "docid": "39f6762b5c0bb5a6aeb06d6d93d5984d", "score": "0.6344992", "text": "function printSomething(a,b)\n{\nconsole.log(\"a soft murmur ...\")\n\nreturn a+b;\n\n}", "title": "" }, { "docid": "ef8ac876a59d7f91069aa422ba6583c0", "score": "0.63435453", "text": "function addTwoNumbers(number1, number2) {\n return number1 + number2;\n}", "title": "" }, { "docid": "7495b3b3e34f46a77e0fc129a82b8ce8", "score": "0.63434744", "text": "function maxOfTwoNumbers(num1, num2) {\n if (num1 > num2) {\n console.log(`${num1} is larger than ${num2}`);\n } else {\n console.log(`${num1} is less than ${num2}`);\n }\n return;\n}", "title": "" }, { "docid": "f3fa1f7552be50ae24b34eb1250aeff7", "score": "0.63434327", "text": "function calcuradora(numero1, numero2) {\r\n // conjunto de instrucciones a ejecutar\r\n console.log(\"suma: \"+(numero1+numero2));\r\n console.log(\"multiplica: \"+(numero1*numero2));\r\n console.log(\"division: \"+(numero1/numero2));\r\n console.log(\"resta: \"+(numero1-numero2));\r\n\r\n}", "title": "" }, { "docid": "8c24b41ff2bf4fce86888e2266ed5781", "score": "0.6340372", "text": "function twoParams(paramA = 80, paramB = 20) {\n console.log(`paramA=${paramA} paramB=${paramB}`);\n return paramA + paramB;\n}", "title": "" }, { "docid": "928b3fec7499fd50e330878f74ec7514", "score": "0.6317916", "text": "function arth (num1, num2){\n console.log(num1+num2);\n console.log(num1/num2);\n console.log(num1-num2);\n console.log(num1*num2);\n \n \n}", "title": "" }, { "docid": "da333adac62c6e8db0c280b21e7a31ba", "score": "0.63065666", "text": "function sumNumbers(num1, num2) {\n var result = num1 + num2;\n console.log(result)\n}", "title": "" }, { "docid": "1fc4841dee7500da4a2671a0c2e76a1d", "score": "0.62993264", "text": "function largerNumber (int1, int2) { //created a function to take in 2 integers\n\n if (int1 > int2) { // if int1 is greater than int2 print true\n return true;\n } else if (int1 < int2) { // else if int1 is less than int2 print false\n return false;\n } else if (int1 === int2) { // else if int2 & int 2 are the same print Same number\n return \"Same number\";\n } else {\n return \"Nice Try\"; // if you print anything else, print nice try\n }\n}", "title": "" }, { "docid": "888cc9d7f667e3628912f7f74e5a3892", "score": "0.6299246", "text": "function addTwoNumbers(num1, num2) {\n return num1 + num2;\n}", "title": "" }, { "docid": "5eb2917d110144620532afe55a1d2fe1", "score": "0.62934744", "text": "function sumNumbers(num1 , num2){\n var result = num1 + num2;\n console.log(result);\n}", "title": "" }, { "docid": "ea01643e7744fb4d9ba8622bc1b9e4a4", "score": "0.628816", "text": "function myFunction (firsArguement, secondArguement) {\n if (firsArguement > secondArguement) {\n return 'First Number is greater than second number';\n } else {\n return 'Second Number is greater than first number';\n }\n}", "title": "" }, { "docid": "efbd2ae9d4f93d566ab8df5c0808cb08", "score": "0.62849545", "text": "function addition(num1, num2){\n console.log(num1 + num2)\n}", "title": "" }, { "docid": "56416020131f38cd9639a9ce9bcf9d17", "score": "0.62848693", "text": "function add(num1,num2){\n console.log(num1+num2);\n}", "title": "" }, { "docid": "a1f2163f7cf02650dc6a53227302501e", "score": "0.62841845", "text": "function multiplyNumbers(num1, num2){\n\tlet product = num1 * num2;\n\t\tconsole.log('${num1} * ${num2} is ${product}');\n\t}", "title": "" }, { "docid": "a7712ea2dece51f15128382e2f5e7ca7", "score": "0.62748355", "text": "function sing(lyric1,lyric2) {\n\tconsole.log(lyric1);\n\tconsole.log(lyric2)\n}", "title": "" }, { "docid": "ae297a5cf03c845c4f3d437471e29845", "score": "0.6272555", "text": "function myNumber(num1 , num2) {\n \n return num1 + num2;\n }", "title": "" }, { "docid": "ff890e544e20a2dfd1e3809c65c9db8f", "score": "0.627165", "text": "function functionWithArgs(n1, n2){\n console.log(n1+n2);\n}", "title": "" }, { "docid": "f28640574b11cf6011bc6308f3b12649", "score": "0.6258448", "text": "function sumNumbers(num1, num2){\r\n var result=num1 + num2;\r\n console.log(result);\r\n}", "title": "" }, { "docid": "e5468a5aa3e3a2b7e71df3412479d62f", "score": "0.6258349", "text": "function divideTwoAndLog(n1,n2){\n console.log(n1/n2)\n}", "title": "" }, { "docid": "ffcbd97f90d609fa5b5d5f3bab1c5a4d", "score": "0.62549275", "text": "function adunare(a,b) {\n return console.log(a+b)\n}", "title": "" }, { "docid": "43ccc042f971854249a68c3a2859bfd2", "score": "0.62512976", "text": "function porConsola(numero1, numero2){\n\tconsole.log(\"Resta: \"+(numero1-numero2));\n\tconsole.log(\"Multiplicacion: \"+(numero1*numero2));\n\tconsole.log(\"Division: \"+(numero1/numero2));\n}", "title": "" }, { "docid": "1d8cecb5e8cb640f494f9a0592a78268", "score": "0.6250131", "text": "function subtraction(num1, num2) {\n console.log(num1, num2);\n}", "title": "" }, { "docid": "e2d8b18e19199c39f7248b318c661ef0", "score": "0.6249283", "text": "function logNumbers(num1, num2){\n var i = num1 +1;\n while(i < num2){\n console.log(i);\n i++;\n }\n}", "title": "" }, { "docid": "0b3a56db5193ebd94406d19cd8a00ed0", "score": "0.6240991", "text": "function greeting(person1, person2) {\n console.log(\"\".concat(person1, \" says hello to \").concat(person2, \".\"));\n}", "title": "" }, { "docid": "219f5679b2bbfae3d2c6c23ef81bae8e", "score": "0.6236613", "text": "function add(num1,num2){\n console.log(num1+num2);\n }", "title": "" }, { "docid": "c0654248a36f8a005841c4a846df7040", "score": "0.62221044", "text": "function subNumbers(num1, num2){\n\tlet product = num1 - num2;\n\t\tconsole.log('${num1} - ${num2} is ${product}');\n\t}", "title": "" }, { "docid": "5d31965abbe712fbf2f8075dc6684fbf", "score": "0.6212045", "text": "function addTwo(num1, num2) {\n var add = num1 + num2;\n alert(\"The sum of your two numbers is: \" + add);\n bigOrSmall(add);\n}", "title": "" }, { "docid": "041f9fca34ad714c6e32af2f9c11586f", "score": "0.620976", "text": "function subFn(number1, number2) {\n var difference = number1 - number2;\n output.value = difference;\n}", "title": "" } ]
163aaeadbdeca5319fb74bd553913e8f
Generates the map for the Player
[ { "docid": "fd7aabfcea465ded2af1478d60c34e3f", "score": "0.0", "text": "function createMap(){ \n document.write(\"<table>\"); \n \n for( var y = 0; y < height; y++){ \n document.write(\"<tr>\"); \n for( var x = 0; x < width; x++){ \n if(x == 0 || x == width -1 || y == 0 || y == height - 1){ \n document.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n } \n\t\t\telse{ \n\t\t\t\t/// here\n\t\t\t\tif(y==12 && (x==5 || x==7)){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse ///here\n\t\t\t\tif(x==47 && y==2){\n\t\t\t\t\tdocument.write(\"<td class='finish' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse /// here\n\t\t\t\tif(y==12 && x==6){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse /// here\n\t\t\t\tif(y==12 && ( x==9 || x==11 )){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse /// here\n\t\t\t\tif( x==4 && y==3 ){\n\t\t\t\t\tdocument.write(\"<td class='blank' id='\"+ x + \"-\" + y +\"'></td>\");\n\t\t\t\t}\n\t\t\t\telse /// here\n\t\t\t\tif( x==8 && y==26 ){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\");\n\t\t\t\t}\n\t\t\t\telse /// here\n\t\t\t\tif(x==16 && (y>=1 && y<=3)){\n\t\t\t\t\tdocument.write(\"<td class='blank' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif((x==4 || x==12 || x==20) && (y>=1 && y<=24)){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif((x==8 || x==16 || x==24) && (y>=4 && y<=27) ){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif((y==4 || y==12 || y==20) && (x>=25 && x<=45)){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif((y==8 || y==16 || y==24) && (x>=28 && x<=48)){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tdocument.write(\"<td class='blank' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n }\n\t\t\t\n\t\t\t\n } \n document.write(\"</tr>\"); \n } \n document.write(\"</table>\"); \n\t\n}", "title": "" } ]
[ { "docid": "2378f0dd8896044c7b7625bbbeb688b6", "score": "0.7236407", "text": "function create_map(){\n\tif(random_maps){\n\t\tif (initialized){\n\t\t\tdestroy_villages();\n\t\t\tdestroy_aqueduct();\n\t\t\t//TODO: get rid of those messages...here might be a good place\n\t\t}\n\t\tcursor_aqueduct = new Aqueduct (0, 0, \"right\");\n\t cursor_aqueduct.visible = false;\n\t\t\n\t water_source = new Grid_Object (0, 4, 0, \"source.png\", 2, 4);\n\t goal_city = new Grid_Object (22, 5, 0, \"goal_city.png\", 2, 2);\n\t for (var i = 0; i < 6; i++) {\n\t \tVillage.create ();\n\t }\n\t}\n\t\n}", "title": "" }, { "docid": "7a7db695aa300485392491a02acea06c", "score": "0.7201724", "text": "function playerMap() {\n\n let mapX = map(playerSprite.xPos, enviorment.xMin, enviorment.xMax - width, miniMap.x + miniMap.playerDot/2, miniMap.xSize + width*0.01 - miniMap.playerDot/2);\n let mapY = map(playerSprite.yPos, enviorment.yMin, enviorment.yMax - height, miniMap.y + miniMap.playerDot/2, miniMap.ySize + height*0.01 - miniMap.playerDot/2);\n let rectW = map(width, enviorment.xMin, enviorment.xMax, miniMap.x, miniMap.xSize);\n let rectH = map(height, enviorment.yMin, enviorment.yMax, miniMap.y, miniMap.ySize);\n\n // player of position\n fill(\"blue\");\n noStroke();\n ellipse(mapX, mapY, miniMap.playerDot);\n\n // rectangle of vision\n noFill();\n stroke(255);\n strokeWeight(2);\n rectMode(CENTER);\n rect(mapX, mapY, rectW, rectH);\n\n // fixing the brakeables\n rectMode(CORNER);\n stroke(0);\n strokeWeight(1);\n}", "title": "" }, { "docid": "efd9e89f20728c1c78891a2cb239f0bb", "score": "0.7068677", "text": "function GenerateObjectMap(mapWidth, map){\n var width = mapWidth;\n var height = map.length / width;\n\n /* 0 - SB, 1 - C, 2 - SE\n 3 - G, 4 - D, 5 - S, 6 - W, 7 - CB\n 8 9 10 11 12\n 13 - L, 14 - S, 15 - DB */\n\n var objectMap = new Array(width*height);\n var surface = 0;\n\n /* 0 - Nothing\n 1 - Player\n 2 - Enemy */\n\n /* place enemies (NOT FULLY IMPLEMENTED) and locates the surface of the game map */\n for(i = 0; i < width; i++){\n for(j = 0; j < height; j++){\n var temp = map[j * width + 1];\n var num = noisy.randomNumber(0, 10);\n if(temp < 3){\n if(temp == 2 && j > 0){\n if(num > 9.8)\n objectMap[j-1 * width + i] = 2;\n }\n }\n else if(temp > 2 && temp < 13){\n if(surface == 0)\n surface = j-1;\n if(temp == 7 || temp == 12){\n if(num > 9.8)\n objectMap[j * width + i] = 2;\n }\n }\n else{\n if(temp == 15){\n if(num > 9.8)\n objectMap[j * width + i] = 2;\n }\n }\n }\n }\n\n /*Place player in the middle*/\n objectMap[surface * width + width/2] = 1;\n return objectMap;\n }", "title": "" }, { "docid": "85b0c900e2cccf87bb0440f33c90076b", "score": "0.7023639", "text": "createMap(){\n this.map = this.make.tilemap({key:'maze1'});\n this.tiles = this.map.addTilesetImage('spritesheet2');\n this.backGroundLayer = this.map.createStaticLayer('bg', this.tiles,0,0); \n this.wall = this.map.createStaticLayer('wall', this.tiles,0,0); \n this.decoracion = this.map.createStaticLayer('decoracion', this.tiles,0,0); \n }", "title": "" }, { "docid": "11ddb5d4b33113f662633c0ac98a4274", "score": "0.6957776", "text": "function buildMap(game){\n\n}", "title": "" }, { "docid": "b8dfac3f87df08c9742bcecbd735809b", "score": "0.69169766", "text": "function createMap() {\n //Loading tilemap \n var map = game.add.tilemap('map');\n map.addTilesetImage('tilesheet', 'tileset');\n //Setting bounds to the world (x,y,gameWidth,gameHeight)\n game.world.setBounds(0, 0, 1600, 1600);\n //If map has a layers a loop must be created to load the layers \n var layer;\n for(var i = 0; i < map.layers.length; i++) {\n layer = map.createLayer(i);\n }\n}", "title": "" }, { "docid": "a0679f113afbe0346d131714503674b6", "score": "0.68602383", "text": "function generateMap()\n {\n for(var i = 0; i < 25; i++)\n {\n for(var j = 0; j < 25; j++)\n {\n //\n // put wallscx\n //\n \n if( (i % 2) === 0 && (j % 2) === 0)\n {\n var w = Crafty.e(\"2D, DOM, wall, Collision, solid, SpriteAnimation\")\n .attr({\n x:i*TILE_SPACE, \n y:j*TILE_SPACE,\n z:1\n })\n .collision();\n \n if(w.hit('solid')) {\n w.destroy();\n }\n }\n } \n }\n }", "title": "" }, { "docid": "48fc3462d25df29ecfbe16bb4c67d75d", "score": "0.68135214", "text": "buildMap() {\n this.map = [];\n let settings = this.getSettings();\n let worldMap = settings.map;\n worldMap.map((obj, index) => {\n let row = ~~(index / 27);\n this.map[row] = this.map[row] || [];\n let ceil = index;\n if (index >= this.gameCells) {\n ceil = index % this.gameCells;\n }\n let gameObject = this.createGameObject(obj, row, ceil);\n this.map[row].push(gameObject);\n });\n }", "title": "" }, { "docid": "a74114df4d24d4554791d75899c82907", "score": "0.681214", "text": "function SandboxGen(){\n this.generateMap=function(){\n var pNum=1;\n var regions=[];\n for(var i=0;i<10;i++){\n regions.push(new Region(i*20,i*20,20));\n }\n var players=[];\n players.push(new Player(0,new Computer(),new MajorPower()));\n\n var j=0;\n regions.forEach(function(r1){\n regions.forEach(function(r2){\n if(r1!=r2){\n r1.addBorder(r2);\n r2.addBorder(r1);\n }\n });\n r1.setOwner(players[0]);\n if(j>5){\n players[(j%pNum)].setCapital(r1);\n }\n j++;\n });\n var data={};\n data[\"regions\"]=regions;\n data[\"players\"]=players;\n return data;\n }\n\n}", "title": "" }, { "docid": "f4d227d2e942844f6a54240efd00037b", "score": "0.67449653", "text": "function generateMap(){\n\tMAPPROCEDURE = {\n\t\tdimensions: {\n\t\t\tx: 2000,\n\t\t\ty: 2000\n\t\t},\n\t\tcheckpoint: {\n\t\t\tx: 200,\n\t\t\ty: 200,\n\t\t},\n\t\tmap : [{\n\t\t\t\tground: groundsType[3],\n\t\t\t\tx:[0, 500],\n\t\t\t\ty:[0, 1000]\n\t\t\t},{\n\t\t\t\tground: groundsType[4],\n\t\t\t\tx:[500, 1000],\n\t\t\t\ty:[0, 1000]\n\t\t\t},{\n\t\t\t\tground: groundsType[3],\n\t\t\t\tx:[1000, 1500],\n\t\t\t\ty:[0, 2000]\n\t\t\t},{\n\t\t\t\tground: groundsType[4],\n\t\t\t\tx:[1500, 2000],\n\t\t\t\ty:[0, 2000]\n\t\t\t}\n\t\t\t,{\n\t\t\t\tground: groundsType[3],\n\t\t\t\tx:[0, 500],\n\t\t\t\ty:[1000, 2000]\n\t\t\t}\n\t\t\t,{\n\t\t\t\tground: groundsType[4],\n\t\t\t\tx:[500, 1000],\n\t\t\t\ty:[1000, 2000]\n\t\t\t}\n\t\t]\n\t};\n\t\n\t//Generating patterns\n\tfor(var index = 0; index< MAPPROCEDURE.map.length; index++){\n\t\ttmpElement = document.createElement(\"img\");\n\t\ttmpElement.setAttribute(\"src\", \"texture/\"+MAPPROCEDURE.map[index].ground.name+\".png\");\n\t\ttmpElement.setAttribute(\"id\", \"img\"+MAPPROCEDURE.map[index].ground.name);\n\t\tdocument.getElementById(\"images\").appendChild(tmpElement);\n\t\t\n\t}\n}", "title": "" }, { "docid": "86118a8c891167b1ba07ddbab47dfd9c", "score": "0.66897404", "text": "function renderMap() {\n map.tiles.forEach(function (tile) {\n tile.render();\n });\n map.start.render();\n map.end.render();\n map.rocks.forEach(function (rock) {\n rock.render();\n });\n }", "title": "" }, { "docid": "7c071b7610686af60e75b3447c829bb3", "score": "0.66391385", "text": "function drawMap()\n {\n for(row = 0; row < world.height; row++)\n {\n for(column = 0; column < world.width; column++)\n {\n if(map[row*world.height+column] == 0)\n $('#game_world').append(\"<img id='pac_\"+row+\"_\"+column+\"' src='/images/w0.png' />\");\n else if(map[row*world.height+column] == 1)\n $('#game_world').append(\"<img id='pac_\"+row+\"_\"+column+\"' src='/images/w1.png' />\");\n else if(map[row*world.height+column] == 2)\n $('#game_world').append(\"<img id='pac_\"+row+\"_\"+column+\"' src='/images/w2.png' />\");\n else if(map[row*world.height+column] == 3)\n $('#game_world').append(\"<img id='pac_\"+row+\"_\"+column+\"' src='/images/w3.png' />\");\n else if(map[row*world.height+column] == 4)\n $('#game_world').append(\"<img id='pac_\"+row+\"_\"+column+\"' src='/images/w4.png' />\");\n else if(map[row*world.height+column] == 5)\n $('#game_world').append(\"<img id='pac_\"+row+\"_\"+column+\"' src='/images/w5.png' />\");\n else if(map[row*world.height+column] == 6)\n $('#game_world').append(\"<img id='pac_\"+row+\"_\"+column+\"' src='/images/w6.png' />\");\n }\n $('#game_world').append('<br />');\n }\n }", "title": "" }, { "docid": "ee3e2376f32323a406233f5b48a1493e", "score": "0.6628652", "text": "createMap()\n {\n // Log the map's creation.\n this.log(\"Creating map\");\n\n // Cycle through the sprites that require creation.\n for(let s = 0; s < this.ml.sprites.length; s++)\n {\n // Get the current sprite.\n let currentSprite = this.ml.sprites[s];\n\n // Opts for sprite's entity.\n let opts = \n {\n position: currentSprite.position\n };\n\n // Create entity.\n let entity = new Entity(opts);\n \n // Log the creation.\n this.log(`Creating tile: [${s}]`);\n\n // Set sprite opts.\n opts = \n {\n parent: entity,\n image: this.il.getImage(currentSprite.sprite)\n };\n\n // Create and add sprite.\n let sprite = entity.createComponent(Sprite, opts);\n this.spriteRenderer.addComponent(sprite);\n\n // If the entity is a wall.\n if(currentSprite.layer === \"Wall\")\n {\n // Set the entity's tag.\n entity.tag = \"Wall\";\n\n // Create the rectangle and the wall's collider.\n let rect = entity.createComponent(Rectangle, {width: 64, height: 64});\n let collider = entity.createComponent(Collider, {rect: rect, static: true});\n\n // Add collider to collider system.\n this.colliderSystem.addComponent(collider);\n }\n\n // If entity is a door.\n if(currentSprite.layer === \"Doors\")\n {\n // Set the entity's tag.\n entity.tag = \"door\";\n\n // Create the required door component.\n let door = entity.createComponent(Door, {});\n\n // Add door to the door system.\n this.doorSystem.addComponent(door);\n }\n }\n }", "title": "" }, { "docid": "087a082ea7ba9e5e6f1965adf2048f1a", "score": "0.654256", "text": "function createWorld(map){\n const MAPWIDTH = map[0].length;\n const MAPHEIGHT = map.length;\n const mapTiles = game.add.group();\n let index = 0;\n // printMap(map);\n for(let i = 0; i < MAPHEIGHT; i++){\n for(let j = 0; j < MAPWIDTH; j++){\n index = whichTile(map, i, j);\n mapTiles.create(CONSTANTS.tileSize * j , CONSTANTS.tileSize * i, 'tiles', index);\n }\n }\n}", "title": "" }, { "docid": "1088c57abed80763cd598090c60701b0", "score": "0.65242314", "text": "function createMaps() {\n currentmap = [1,1];\n jumplev1 = 32;\n jumplev2 = 64;\n ceillev = 88; // The floor is 88 spaces (11 blocks) below the yloc = 0 level\n ceilmax = 104; // The floor is 104 spaces (13 blocks) below the top of the screen (yloc = -16)\n castlev = -48;\n \n mapfuncs = new Array(9);\n for(var i=1; i<=9; ++i) {\n mapfuncs[i] = [0,0,0,0,0];\n for(var j=mapfuncs[i].length; j>0; --j)\n mapfuncs[i][j] = window[\"World\" + i + \"\" + j];\n }\n \n mapfuncs[\"Random\"] = {\n Overworld: WorldRandomOverworld,\n Underworld: WorldRandomUnderworld,\n Underwater: WorldRandomUnderwater,\n Bridge: WorldRandomBridge,\n Sky: WorldRandomSky\n };\n \n document.cookie = \"\";\n}", "title": "" }, { "docid": "91ab9f74a07fef31d5cbc5b5521e30c2", "score": "0.6502366", "text": "displayMap() {\n this.groundMapLayers = this.add.group();\n this.highMapLayers = this.add.group();\n this.map = this.add.tilemap('map');\n this.map.addTilesetImage('tilesheet', 'tileset');\n this.map.gameLayers = [];\n for(var i = 0; i < this.map.layers.length; i++) {\n var group = (i <= this.nbGroundLayers-1 ? this.groundMapLayers : this.highMapLayers);\n this.map.gameLayers[i] = this.map.createLayer(this.map.layers[i].name,0,0,group);\n this.map.gameLayers[i].visible = false; // Make map invisible before the game has fully loaded\n }\n this.map.gameLayers[0].inputEnabled = true; // Allows clicking on the map\n this.map.gameLayers[0].events.onInputUp.add(this.handleMapClick, this);\n this.createDoorsMap(); // Create the associative array mapping coordinates to doors/teleports\n\n //this.world.resize(this.map.widthInPixels,this.map.heightInPixels);\n this.world.setBounds(0,0,this.map.widthInPixels,this.map.heightInPixels);\n\n this.map.tileset = {\n gid: 1,\n tileProperties: this.map.tilesets[0].tileProperties\n };\n\n this.createCollisionArray();\n }", "title": "" }, { "docid": "471103dc4c88fb20f08d545692f7c43e", "score": "0.64831305", "text": "function spawnMap() {\n // Spawn solids\n var arr = map.area.presolids, prething, thing;\n while(arr.length > map.current_solid && screen.right + quads.width * 2 + quads.rightdiff >= arr[map.current_solid].xloc * unitsize) {\n prething = arr[map.current_solid];\n thing = prething.object;\n addThing(thing, prething.xloc * unitsize - screen.left, prething.yloc * unitsize);\n thing.placenum = map.current_solid;\n ++map.current_solid;\n }\n // Spawn characters\n arr = map.area.prechars;\n while(arr.length > map.current_char && screen.right + quads.rightdiff >= arr[map.current_char].xloc * unitsize) {\n prething = arr[map.current_char];\n thing = prething.object;\n addThing(thing, prething.xloc * unitsize - screen.left, prething.yloc * unitsize);\n thing.placenum = map.current_char;\n ++map.current_char;\n }\n map.area.current = map.current;\n map.area.current_solid = map.current_solid;\n map.area.current_char = map.current_char;\n}", "title": "" }, { "docid": "44e6df93cfc1d7d2e0636f7424722fbc", "score": "0.6443404", "text": "toMap(name) {\n //loading the map the player chose\n this.onOverWorld = false;\n this.stopMusic();\n loaded = false;\n canvas.getContext(\"2d\").clearRect(0, 0, canvas.width, canvas.height);\n canvas.remove();\n loadMap(name, this.user, function (m) {\n m.loadCharacter(overWorld.characters.getCharacter());\n // m.playMusic();\n }, this);\n }", "title": "" }, { "docid": "75c8026211cb078eed0d21960f339899", "score": "0.64401287", "text": "function createMap(){\n\t\tworldMapInstance = new WorldMap(svg);\n\t}", "title": "" }, { "docid": "40afab4c70d934dbf4036cfc541f2012", "score": "0.6434984", "text": "function drawMap(game) {\n\n\t// Create the map\n\tvar map = new google.maps.Map(document.getElementById(\"map\"), {\n\t\tzoom: game.startingVariables.zoomLevel,\n\t\tcenter: new google.maps.LatLng(game.startingVariables.lat, game.startingVariables.lon),\n\t\tmapTypeId: google.maps.MapTypeId.TERRAIN\n\t});\n\t// Add the map to the game object\n\tgame.startingVariables.map = map;\n\n\t// Create the markers\n\tvar markers = createMarkers(game);\n\n\t// Add the markers to the game object\n\tgame.startingVariables.markers = markers;\n\n\t// Show the city name\n\tdocument.getElementById(\"locationName\").innerHTML = game.currentLocation;\n\tdocument.getElementById(\"locationName\").style.display = \"block\";\n\tdocument.getElementById(\"location\").style.display = \"block\";\n\tdocument.getElementById(\"currentLocationTitle\").innerHTML = \"<p>\" + game.currentLocation + \"</p>\";\n\n\t// Show the buttons\n\tdocument.getElementById(\"buttons\").style.display = \"block\";\n\n\t// Show the map\n\tdocument.getElementById(\"map\").style.display = \"block\";\n\n\t// Return the game object\n\treturn game;\n}", "title": "" }, { "docid": "7b932b136b500800507f011bcde65140", "score": "0.6373653", "text": "function map_start() {\n start = new Date(); // Has to be first to execute\n maps_setup(); // Sets up the map-objects ( in maps.js )\n setup();\n // tiles_amount = Math.max(...([].concat([].concat(...map[0]),\n // [].concat(...map_overlay)))); // Get the amount of textures for the map\n ctx.canvas.width = tile_columns * tile_size;\n ctx.canvas.height = tile_rows * tile_size;\n for (var i = 0; i < tiles_amount; i++) {\n tiles[i] = new Image();\n tiles[i].src = tile_path + (i + 1) + \".png\";\n }\n\n // Set up characters/animations\n for (var i = 0; i < animations.length; i++) {\n anims[i] = new animation();\n anims[i].setup(animations[i][0], animations[i][1]);\n for (var a = 0; a < animations[i].length - 2; a++) {\n anims[i].frame_pattern[a] = animations[i][a + 2];\n }\n }\n}", "title": "" }, { "docid": "be5d17196a7fdd8a9647cb33f904e624", "score": "0.6364122", "text": "createTilemap(){ \n this.map = this.make.tilemap({ key: \"map\"});\n console.log(\"mapWidth: \", this.map.widthInPixels);\n console.log(\"mapHeight\", this.map.heightInPixles);\n\n this.tileset = this.map.addTilesetImage(\"simples_pimples\", \"tiles\");\n this.groundLayer = this.map.createStaticLayer(\n \"groundLayer\",\n this.tileset,\n 0,\n 0\n );\n\n this.backgroundTileset = this.map.addTilesetImage(\"castle_tilesheet\", \"castle-tileset\");\n this.background_layer = this.map.createStaticLayer(\n \"background_layer\",\n this.backgroundTileset,\n 0,\n 0\n );\n\n this.furnitureTileset = this.map.addTilesetImage(\"castle_tilesheet\", \"castle-tileset\");\n this.furniture_layer = this.map.createStaticLayer(\n \"furniture_layer\",\n this.furnitureTileset,\n 0,\n 0\n );\n this.groundLayer.setCollisionByExclusion(-1, true);\n }", "title": "" }, { "docid": "e3b90d2dc0535804e00dce4b3684df72", "score": "0.63614136", "text": "function generateMap(bossExist) {\r\n\t\tfunction generateRoom(map, y, x, dir) {\r\n\t\t\tif(y < 3 || y > 46 || x < 3 || x > 96) return;\r\n\t\t\tvar room, a, b;\r\n\t\t\tif(dir === 'T') {\r\n\t\t\t\troom = [[y, x], [y-1, x], [y-2, x], [y-3, x], [y-1, x+1], [y-2, x+1], [y-3, x+1], [y-1, x-1], [y-2, x-1], [y-3, x-1]];\r\n\t\t\t\ta = y - 2;\r\n\t\t\t\tb = x;\r\n\t\t\t}\r\n\t\t\telse if(dir === 'B') {\r\n\t\t\t\troom = [[y, x], [y+1, x], [y+2, x], [y+3, x], [y+1, x+1], [y+2, x+1], [y+3, x+1], [y+1, x-1], [y+2, x-1], [y+3, x-1]];\r\n\t\t\t\ta = y + 2;\r\n\t\t\t\tb = x;\r\n\t\t\t}\r\n\t\t\telse if(dir === 'L') {\r\n\t\t\t\troom = [[y, x], [y, x-1], [y, x-2], [y, x-3], [y-1, x-1], [y-1, x-2], [y-1, x-3], [y+1, x-1], [y+1, x-2], [y+1, x-3]];\r\n\t\t\t\ta = y;\r\n\t\t\t\tb = x - 2;\r\n\t\t\t}\r\n\t\t\telse if(dir === 'R') {\r\n\t\t\t\troom = [[y, x], [y, x+1], [y, x+2], [y, x+3], [y-1, x+1], [y-1, x+2], [y-1, x+3], [y+1, x+1], [y+1, x+2], [y+1, x+3]];\r\n\t\t\t\ta = y;\r\n\t\t\t\tb = x + 2;\r\n\t\t\t}\r\n\t\t\tif(room.every(function(v) {return map[v[0]][v[1]] === '#'})) {\r\n\t\t\t\troom.forEach(function(v) {\r\n\t\t\t\t\tmap[v[0]][v[1]] = ' ';\r\n\t\t\t\t});\r\n\t\t\t\tmap[y][x] = '_';\r\n\t\t\t\tif(Math.random() < 0.6 && dir !== 'B') { //T\r\n\t\t\t\t\tgenerateRoom(oriMap, a-2, b, 'T');\r\n\t\t\t\t}\r\n\t\t\t\tif(Math.random() < 0.6 && dir !== 'T') {\t//B\r\n\t\t\t\t\tgenerateRoom(oriMap, a+2, b, 'B');\r\n\t\t\t\t}\r\n\t\t\t\tif(Math.random() < 0.6 && dir !== 'R') { //L\r\n\t\t\t\t\tgenerateRoom(oriMap, a, b-2, 'L');\r\n\t\t\t\t}\r\n\t\t\t\tif(Math.random() < 0.6 && dir !== 'L') { //R\r\n\t\t\t\t\tgenerateRoom(oriMap, a, b+2, 'R');\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\tfunction addMapElem(map, bossExist) {\r\n\t\t\tvar outerLen = map.length,\r\n\t\t\t\tinnerLen = map[0].length, \r\n\t\t\t\tweapon, first, i, j;\r\n\t\t\tfor(i = 0; i < outerLen; i++) {\r\n\t\t\t\tfor(j = 0; j < innerLen; j++) {\r\n\t\t\t\t\tif(map[i][j] === ' ') {\r\n\t\t\t\t\t\tif((!map[i-1]||(map[i-1][j]!='_'))&&map[i][j-1]!='_'&&(!map[i+1]||(map[i+1][j]!='_'))&&map[i][j+1]!='_') {\r\n\t\t\t\t\t\t\tif(!first) {\r\n\t\t\t\t\t\t\t\tfirst = true;\r\n\t\t\t\t\t\t\t\tif(!bossExist)map[i][j] = '5';\r\n\t\t\t\t\t\t\t\telse map[i][j] = '6';\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(Math.random() < 0.1) map[i][j] = '4'; //enemy;\r\n\t\t\t\t\t\t\telse if(Math.random() < 0.1) map[i][j] = '3'; //drag;\r\n\t\t\t\t\t\t\telse if(Math.random() < 0.05 && !weapon) { //weapon;\r\n\t\t\t\t\t\t\t\tweapon = true;\r\n\t\t\t\t\t\t\t\tmap[i][j] = '2';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn map;\r\n\t\t}\r\n\t\tvar oriMap = fillMap(100, 50),\r\n\t\t\ti, j;\r\n\t\tfor(i = 24; i < 27; i++) {\r\n\t\t\tfor(j = 49; j < 52; j++) {\r\n\t\t\t\toriMap[i][j] = ' ';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(Math.random() < 1) { //T\r\n\t\t\tgenerateRoom(oriMap, 23, 50, 'T');\r\n\t\t}\r\n\t\tif(Math.random() < 0.4) {\t//B\r\n\t\t\tgenerateRoom(oriMap, 27, 50, 'B');\r\n\t\t}\r\n\t\tif(Math.random() < 0.4) { //L\r\n\t\t\tgenerateRoom(oriMap, 25, 48, 'L');\r\n\t\t}\r\n\t\tif(Math.random() < 0.4) { //R\r\n\t\t\tgenerateRoom(oriMap, 25, 52, 'R');\r\n\t\t}\r\n\t\toriMap[25][50] = '1';\r\n\t\treturn addMapElem(oriMap, bossExist);\r\n\t}", "title": "" }, { "docid": "1131729260686a220f97fc6c37f98cae", "score": "0.6349662", "text": "function drawMap(players,grass, missiles) {\n var Width = c.width;\n var Height = c.height;\n //TODO have spacing be controlled based on the size of the player\n var GridSize = 80;\n\n // get a clean slate\n ctx.clearRect(0, 0, c.width, c.height);\n var i;\n for (i = -(Player.y % GridSize); i < Height; i += GridSize) {\n ctx.beginPath();\n ctx.lineWidth = 1;\n ctx.moveTo(0, i);\n ctx.lineTo(Width, i);\n ctx.stroke();\n ctx.closePath();\n }\n for (i = -(Player.x % GridSize); i < Width; i += GridSize) {\n ctx.beginPath();\n ctx.lineWidth = 1;\n ctx.moveTo(i, 0);\n ctx.lineTo(i, Height);\n ctx.stroke();\n ctx.closePath();\n }\n\n for (var key in players) {\n if (Player.id != key && players[key] != null) {\n //TODO implement enemy ram\n var offsetX = players[key][0] - Player.x;\n var offsetY = players[key][1] - Player.y;\n var radius = getRadius(players[key][2]);\n if (Math.abs(offsetX) < Width/2 + radius && Math.abs(offsetY) < Height/2 + radius) {\n drawCircle(radius, Width/2 + offsetX, Height/2 + offsetY, players[key][3]);\n //TODO Make this a function?\n // rotateAndPaintImage(ctx, img, Player.angle, Width/2 - Player.radius/2, Height/2 - Player.radius/2, Player.radius, Player.radius );\n // ctx.translate(Width/2 + offsetX, Height/2 + offsetY);\n // ctx.rotate(players[key][4] - Math.PI/2);\n // ctx.drawImage(enemyRam,-radius,-Player.radius,2*players[key][3],2*players[key][3]);\n // ctx.rotate(-players[key][4] + Math.PI/2);\n // ctx.translate(-Width/2 - offsetX, -Height/2 - offsetY);\n\n }\n }\n }\n // Render FIRED missiles\n for (var i = 0; i < Game.firedMissiles.length; i++) {\n if (Game.firedMissiles[i] != null) {\n var offsetX = Game.firedMissiles[i].x - Player.x;\n var offsetY = Game.firedMissiles[i].y - Player.y;\n if (Math.abs(offsetX) < Width/2 + MISSILE_SIZE && Math.abs(offsetY) < Height/2 + MISSILE_SIZE) {\n if (Game.firedMissiles[i].playerid != Player.id && Math.abs(offsetX) < Player.radius + MISSILE_SIZE && Math.abs(offsetY) < Player.radius + MISSILE_SIZE) {\n //TODO: Make damage dynamic\n Player.size -= HIT_REDUCTION;\n console.log('HIT');\n Game.firedMissiles[i] = null;\n if(Player.size <= 0) {\n console.log('DEATH');\n processDeath(Game.firedMissiles[i]);\n }\n socket.emit('MissileHit', Game.firedMissiles[i]);\n\n }\n drawCircle(MISSILE_SIZE, Width/2 + offsetX, Height/2 + offsetY, 'red');\n //TODO Make this a function?\n // rotateAndPaintImage(ctx, img, Player.angle, Width/2 - Player.radius/2, Height/2 - Player.radius/2, Player.radius, Player.radius );\n // ctx.translate(Width/2 + offsetX, Height/2 + offsetY);\n // ctx.rotate(players[key][4] - Math.PI/2);\n // ctx.drawImage(enemyRam,-radius,-Player.radius,2*players[key][3],2*players[key][3]);\n // ctx.rotate(-players[key][4] + Math.PI/2);\n // ctx.translate(-Width/2 - offsetX, -Height/2 - offsetY);\n\n }\n }\n }\n //TODO Make this a function?\n // rotateAndPaintImage(ctx, img, Player.angle, Width/2 - Player.radius/2, Height/2 - Player.radius/2, Player.radius, Player.radius );\n ctx.translate(Width/2, Height/2);\n ctx.rotate(Player.angle - Math.PI/2);\n ctx.drawImage(img,-Player.radius,-Player.radius,2*Player.radius,2*Player.radius);\n ctx.rotate(-Player.angle + Math.PI/2);\n ctx.translate(-Width/2, -Height/2);\n // drawCircle(Player.radius, Width/2, Height/2, Player.color);\n\n for (i = 0; i < grass.length; i++) {\n if (grass[i] != null) {\n var offsetX = grass[i].x - Player.x;\n var offsetY = grass[i].y - Player.y;\n if (Math.abs(offsetX) < Width / 2 + GRASS_SIZE && Math.abs(offsetY) < Height / 2 + GRASS_SIZE) {\n if (Math.abs(offsetX) < Player.radius + GRASS_SIZE && Math.abs(offsetY) < Player.radius + GRASS_SIZE) {\n socket.emit('EatRequest', {id: i, x: grass[i].x, y: grass[i].y});\n grass[i] = null;\n }\n else {\n drawCircle(GRASS_SIZE, Width / 2 + offsetX, Height / 2 + offsetY, 'green');\n }\n }\n }\n }\n // when a player gets close enough, pick up the missile\n var j;\n for (j = 0; j < missiles.length; j++) {\n if (missiles[j] != null) {\n var offsetX = missiles[j].x - Player.x;\n var offsetY = missiles[j].y - Player.y;\n if (Math.abs(offsetX) < Width / 2 + MISSILE_SIZE && Math.abs(offsetY) < Height / 2 + MISSILE_SIZE) {\n if (Math.abs(offsetX) < Player.radius + MISSILE_SIZE && Math.abs(offsetY) < Player.radius + MISSILE_SIZE) {\n socket.emit('PickupRequest', {id: j, x: missiles[j].x, y: missiles[j].y});\n missiles[j] = null;\n }\n else {\n drawCircle(MISSILE_SIZE, Width / 2 + offsetX, Height / 2 + offsetY, 'blue');\n }\n }\n }\n }\n}", "title": "" }, { "docid": "7deb100c14cbaf9e81a8a731e3d3d9ea", "score": "0.6340025", "text": "function drawMap(map) {\n\t\t// create the main div\n\t\tvar main = document.createElement(\"div\");\n\t\t// set the main div width to map grid * 32 px, in order to set the width to dynamic size\n\t\tmain.style.width = map.width * 32 + \"px\";\n\t\t// loop through the multidimensional array, the rows first\n\t\tfor(var row = 0;row < map.height;row++) {\n\t\t\tvar rowDiv = document.createElement(\"div\"); // create the row handle\n\t\t\tfor(var cell = 0;cell < map.width;cell++) { \n\t\t\t\tvar cellDiv = document.createElement(\"div\"); // create the columns\n\t\t\t\tcellDiv.id = row + \"-\" + cell; \t\t\t\t// set current column id\n\t\t\t\tif(map.mapGrid[row][cell][0] === \"W\") { // if the current column value equals \"W\", assign wall class to the element\n\t\t\t\t\tcellDiv.className = tiles.wall;\n\t\t\t\t} else if(map.mapGrid[row][cell][0] === \"G\") { // if the current column value equals \"G\", assign goal class to the element\n\t\t\t\t\tcellDiv.className = tiles.goal;\n\t\t\t\t} else {\t\t\t\t\t\t\t\t\t\t// anything else, assign \"space\" class to the element\n\t\t\t\t\tcellDiv.className = tiles.space;\n\t\t\t\t}\n\t\t\t\tif(map.mapGrid[row][cell][0] === \"P\") { // if the current column value equals \"P\", assign character class to the element\n\t\t\t\t\tplayer.positionX = row;\t\t\t\t// set the player positionX\n\t\t\t\t\tplayer.positionY = cell;\t\t\t// set the player positionY\n\t\t\t\t\tcellDiv.classList.add(entities.character);\t// set the player object type\n\t\t\t\t} else if (map.mapGrid[row][cell][0] === \"B\") { // if the current column value equals \"B\", assign block class to the element\n\t\t\t\t\t// add block class\n\t\t\t\t\tcellDiv.classList.add(entities.block);\t\t\n\t\t\t\t\t// create new object of type block and set positions, type and push it into blocks array\n\t\t\t\t\tblocks.push({positionX: row, positionY: cell, isPlayer: false, type: entities.block});\n\t\t\t\t}\n\t\t\t\t// assign css float left property to the element to set all elements in one row\n\t\t\t\tcellDiv.style.float = \"left\"\n\t\t\t\trowDiv.appendChild(cellDiv); // append current element to current row\n\t\t\t}\n\t\t\tmain.appendChild(rowDiv); // append current row to the main element\n\t\t}\n\t\tdocument.body.appendChild(main); // append the main element to the body element\n\t}", "title": "" }, { "docid": "7bdc6cf8055b407a5e8f6a73c66a9945", "score": "0.63148737", "text": "function initMap() {\n for(var i = 0; i < 400; i ++) {\n var x = floor(random(0, 40));\n var y = floor(random(0, 40));\n\n board.tiles[x][y].p = new Piece(x, y, 'W', '');\n }\n}", "title": "" }, { "docid": "c1619d6fb6ec3c3973c37fa9698e1461", "score": "0.6299981", "text": "function generateMap() {\n // leave outside border as ocean\n //\n var oceanBorder = 2;\n for (var c = oceanBorder; c < celCols - oceanBorder; c++) {\n for (var r = oceanBorder; r < celCols - oceanBorder; r++) {\n var cel = cels[c][r];\n cel.state = states.rock;\n cel.c = c;\n cel.r = r;\n cel.moisture = 0;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "fc821626fd38b07f26a7231802542d1c", "score": "0.62988436", "text": "function drawMap() {\n if (mapGraphic == null) {\n for (var i = 0; i < gamemap.cols; i++) {\n for (var j = 0; j < gamemap.rows; j++) {\n if (gamemap.grid[i][j].wall) {\n gamemap.grid[i][j].show(color(255));\n }\n }\n }\n //grabs image from the maze generation algorithm\n mapGraphic = get(gamemap.x, gamemap.y, gamemap.w, gamemap.h);\n }\n image(mapGraphic, gamemap.x, gamemap.y);\n}", "title": "" }, { "docid": "3751ddef38b88b2713b9cb985ef28f92", "score": "0.6267279", "text": "function create () {\n\n game.stage.backgroundColor = '#000000';\n\n mainMap = game.add.tilemap('map', tileSize, tileSize);\n\n mainMap.addTilesetImage('overview_background');\n\n mainLayer = mainMap.createLayer(0);\n mainLayer.resizeWorld();\n\n for(var n=0; n<maxTurns; n++) {\n playerShot[n] = game.add.sprite(-50, -50, 'shot');\n game.physics.enable(playerShot[n], Phaser.Physics.ARCADE);\n }\n for(var r=0; r<(maxEnemies*maxTurns); r++) {\n enemyShot[r] = game.add.sprite(-50, -50, 'shot');\n game.physics.enable(enemyShot[r], Phaser.Physics.ARCADE);\n }\n\n //add our default map\n addMapOfType([1,0,0,0]);\n placePlayer();\n initBoard();\n}", "title": "" }, { "docid": "2662fd834291f83d85998414f92311b5", "score": "0.6245542", "text": "function drawPlayers(map)\n{\n //var player_map\n var db = new sql.Database( 'players.sqlite' );\n db.all(\"SELECT * FROM \" + table,\n function( err, rows ) {\n if (err != null)\n { console.log(err);\n return;\n }\n for( var i = 0; i < rows; i++ )\n {\n x= rows[i].xpos;\n y = rows[i].ypos\n map[x][y] += rows[i].name;\n //players are added into array from database\n }\n }\n } );\n\n}", "title": "" }, { "docid": "38d9c3a54e031eb613daeb9c89fdff9c", "score": "0.6243867", "text": "function startLevel(map) {\n map.placePlayer(7, 5);\n map.player.draw();\n\n var autoGeneratedMaze = new ROT.Map.DividedMaze(map.getWidth(), map.getHeight());\n\n autoGeneratedMaze.create( function (x, y, mapValue) {\n\n // don't write maze over player\n if (map.player.atLocation(x,y)) {\n return 0;\n }\n\n else if (mapValue === 1) {\n map.placeObject(x,y, 'wall');\n }\n else {\n map.placeObject(x,y,'empty');\n }\n });\n \n map.placeObject(map.getWidth()-5, map.getHeight()-4, 'goal');\n}", "title": "" }, { "docid": "5ae8441b440d76739ad0b5c67613cdb2", "score": "0.62394106", "text": "function drawMap(){\n var board = game.selectedLevel.board;\n for(var i = 0; i < board.length; i++){\n for(var j = 0; j < board[i].length; j++) {\n game.context.drawImage(tiles[board[i][j]].image, j * game.tileSize, i * game.tileSize, game.tileSize, game.tileSize);\n }\n }\n}", "title": "" }, { "docid": "3cfb1fb02c64d651968c79c8ec6d6bca", "score": "0.6219657", "text": "function createMap(mapheight, mapwidth) {\n\t//Create the board, setting random squares to be obstacles\n\tfor (var x = 0; x < rows; x++) {\n\t\tmap[x] = [];\n\t\tboard[x] = [];\n\t\tfor (var y = 0; y < columns; y++) {\n\t\t\t//Give each square a 25% chance of being an obstacle\n\t\t\tvar square = Math.floor(Math.random() * 4);\n\t\t\t//0 = open, 1 = obstacle\n\t\t\ttile = new Object();\n\t\t\tif (x % 2 == 1 && y % 2 == 1) { //solid\n\t\t\t\tboard[x][y] = 2;\n\t\t\t\ttile.passable = 0;\n\t\t\t\ttile.solid = 1;\n\t\t\t} else if (square == 0) { // destructible crate\n\t\t\t\tboard[x][y] = 1;\n\t\t\t\ttile.passable = 1;\n\t\t\t} else { // empty\n\t\t\t\tboard[x][y] = 0;\n\t\t\t\ttile.passable = 0;\n\t\t\t}\n\t\t\tmap[x][y] = tile;\n\t\t}\n\t}\n\t// clear starting positions\n\tboard[0][0] = 0;\n\tboard[1][0] = 0;\n\tboard[0][1] = 0;\n\tboard[rows - 1][columns - 1] = 0;\n\tboard[rows - 2][columns - 1] = 0;\n\tboard[rows - 1][columns - 2] = 0;\n}", "title": "" }, { "docid": "0e6d547df0c95b703fb18baa8c780e4a", "score": "0.6216005", "text": "function newMap(){\n\n\t\tclearGame();\n\t\tinitiate(2);\n\t\tbShowRules();\n\t\tnewNumbersFromPermutation();\n\t\tif(trueMaps.length>1){\n\n\t\t\tnewMap();\n\t\t\treturn;\n\n\t\t}\n\t\t\n\t\tfindFewerRules();\n\t\t\n\t}", "title": "" }, { "docid": "42f5f2904088fc502a91b8a8c6d63026", "score": "0.61863846", "text": "function drawMap(){\n\n //### clear the canvas\n ctx.clearRect(0,0,canvas.width, canvas.height);\n\n //### draw game elements\n drawScore();\n drawFood();\n drawSnake();\n }", "title": "" }, { "docid": "5ec11e2a4e11453b6b5c40fc05e6e0a2", "score": "0.6186164", "text": "function setUpMap(room){\r\n\t// Sets up temporary save of game. (*)\r\n\ttempPlayer.setPlayer(gordon);\r\n\ttempMap.setRoom(room);\r\n\r\n\t// describe the room\r\n\toutput.innerHTML += room.describeRoom() + \"<br>\" // Provides verbal description of entering current room.\r\n\toutput.innerHTML += room.getDescription2() + \"<br>\"; // Provides verbal description of current room.\r\n\r\n\tif(room.getArmor() > 0) // If there are armor boosts inside the room\r\n\t{ \t\t\t\t\t// Player armor is increased.\r\n\t\toutput.innerHTML += \"Thou encounterest ye olde GREENE ARMOUR. Thou gain \" + map.getArmor() + \" armor points.<br>\";\r\n\t\tgordon.increaseArmor(map.getArmor());\r\n\t\tmap.setArmor(0);\r\n\t}\r\n\r\n\tm = null;\r\n\r\n\tif(room.getMonster() != null){ \t\t// If monsters are extant\r\n\t\t\t\t\t\t\t\t\t\t// but not necessarily alive\r\n\r\n\t\tif(firstScreen){ // hard coded, this is probably bad\r\n\t\t\toutput.innerHTML += \"Thou haveth upon yeself only thy DAGGER.<br>\"+\r\n\t\t\t\"Verily something approaches from yonder umbrage!<br>\";\r\n\t\t}\r\n\r\n\t\tm = new Monster(3); // test monster \"Hello world\"\r\n\t\tm.setMonster(room.getMonster()); \r\n\t\t\r\n\t\tif(room.getMonsterAmount() > 0){ \t// If monsters are extant\r\n\t\t\toutput.innerHTML += \"A\";\t\t// and also alive\r\n\t\t\tif(isVowel(m.getName().charAt(0)))\r\n\t\t\t\toutput.innerHTML += \"n\"\r\n\t\t\toutput.innerHTML += (\" \" + m.getName() + \" standeths before ye.<br>\"); // Player is reminded that this is so.\r\n\t\t\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\toutput.innerHTML += \"Ye olde lifeless corpse of the \" + m.getName() + \" lies before ye.<br>\";\r\n\t\t\tif(firstMonster){\r\n\t\t\t\toutput.innerHTML += \"Mighteth you wanteth to LOOT it of its belongings?<br>\";\r\n\t\t\t\tfirstMonster = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif(room.getObjectCount() > 0) // If objects are still extant\r\n\t{\r\n\t\tfor(var x=0;x<room.getObjectCount();x++){\r\n\t\t\t// Player is reminded as such.\r\n\t\t\toutput.innerHTML += \"Thou encounterest ye olde \";\r\n\t\t\ttempItems[x] = new Item(\"null\",0,0,0);\r\n\t\t\ttempItems[x].setItem(room.getItemAt(x));\r\n\t\t\t\r\n\t\t\toutput.innerHTML += tempItems[x].getName();\r\n\t\t\toutput.innerHTML += \".<br>\";\r\n\t\t}\r\n\t\t// this will work but its probably a good idea to set this to an array once\r\n\t\t// that is, when they enter the room for the first time set array tempItems\r\n\t\t// not every single time the room is described etc\r\n\t}\r\n\r\n\tif(firstScreen == true){\r\n\t\toutput.innerHTML += \"Type HELP for a list of commands.<br>\";\r\n\t\tfirstScreen = false;\r\n\t}\r\n\r\n\toutput.innerHTML += \"What dost thou do?<br><br>\"; // THE prompt\r\n\t$(window).scrollTop() + $(window).height();\r\n\r\n}", "title": "" }, { "docid": "97bdbb8bd2c443c6dd0726267c5d1c38", "score": "0.61854833", "text": "function IsoMap (sceneName, mapName) {\n\n\t\t//create a new map object\n\t\tvar map = {\n\t\t\t//x, y, z\n\t\t\t\"position\": [0, 0, 0],\n\t\t\t//w, h\n\t\t\t\"cellSize\": [0, 0],\n\t\t\t\"spriteSheetName\": '',\n\t\t\t\"node\": jQuery('<div id=\"iso-map-' + mapName + '\"></div>'),\n\t\t\t\"rotation\": 0,\n\t\t\t\"CSS\": {},\n\t\t\t\"customCSS\": {},\n\t\t\t\"CSSUpdated\": true,\n\t\t\t\"tilesUpdated\": false\n\t\t};\n\n\t\tmaps[sceneName][mapName] = map;\n\n\t\tscenes[sceneName].node.append(map.node);\n\n\t\t//fill the tiles in view\n\t\t//TODO: Only load tiles in view\n\t\t//action('scene-pan', 'map-fill-tiles', function (limits) {\n\n\t\t//});\n\n\t\t//create an update loop\n\t\taction('scene-' + sceneName, 'map', function () {\n\n\t\t\tif (map.CSSUpdated) {\n\t\t\t\tmap.CSSUpdated = false;\n\n\t\t\t\t//calculate the element anchor\n\t\t\t\tvar anchorX = 'left';\n\t\t\t\tvar anchorY = 'top';\n\t\t\t\tvar positionX = map.position[0];\n\t\t\t\tvar positionY = map.position[1];\n\t\t\t\tvar positionZ = map.position[2];\n\n\t\t\t\t//if the position is negative then convert it to bottom or right based positioning\n\t\t\t\t//Note: -1 is converted to 0 from the right or left.\n\t\t\t\tif (positionX < 0) {\n\t\t\t\t\tpositionX = -(positionX + 1);\n\t\t\t\t\tanchorX = 'right';\n\t\t\t\t}\n\t\t\t\tif (positionY < 0) {\n\t\t\t\t\tpositionY = -(positionY + 1);\n\t\t\t\t\tanchorY = 'bottom';\n\t\t\t\t}\n\n\t\t\t\t//update the elements css\n\t\t\t\tmap.CSS = jQuery.extend(map.customCSS, {\n\t\t\t\t\t\"z-index\": positionZ,\n\t\t\t\t\t\"position\": \"absolute\"\n\t\t\t\t});\n\n\t\t\t\tif (anchorX === \"left\") {\n\t\t\t\t\tdelete map.CSS[\"right\"];\n\t\t\t\t} else {\n\t\t\t\t\tdelete map.CSS[\"left\"];\n\t\t\t\t}\n\t\t\t\tif (anchorY === \"top\") {\n\t\t\t\t\tdelete map.CSS[\"bottom\"];\n\t\t\t\t} else {\n\t\t\t\t\tdelete map.CSS[\"top\"];\n\t\t\t\t}\n\n\t\t\t\tmap.CSS[anchorX] = positionX;\n\t\t\t\tmap.CSS[anchorY] = positionY;\n\n\t\t\t\tmap.node.attr('style', '').css(map.CSS);\n\t\t\t}\n\n\t\t\t//execute the map hook\n\t\t\thook('map');\n\n\t\t});\n\n\t\t/* --------------------------------------------------\n\t\t Tile Related\n\t\t -------------------------------------------------- */\n\n\t\t/**\n\t\t * Retrieve a tile by its grid position\n\t\t * @param x {int}\n\t\t * @param y {int}\n\t\t * @param z {int}\n\t\t */\n\t\tfunction getTile(x, y, z) {\n\t\t\treturn tiles[sceneName][mapName][x][y][z];\n\t\t}\n\n\t\t/**\n\t\t * Set a tile's css.\n\t\t * @param x {int}\n\t\t * @param y {int}\n\t\t * @param z {int}\n\t\t * @param css {object} An object containing the css properties and their values, or a css property name\n\t\t * @param value {string|int} [optional]\n\t\t */\n\t\tfunction tileCSS(x, y, z, css, value) {\n\t\t\tvar tile = getTile(x, y, z);\n\t\t\tif (typeof css === \"string\") {\n\t\t\t\ttile.CSS[css] = value;\n\t\t\t} else {\n\t\t\t\tfor (var property in css) {\n\t\t\t\t\tif (css.hasOwnProperty(property)) {\n\t\t\t\t\t\ttile.CSS[property] = css[property];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttile.CSSUpdated = true;\n\t\t}\n\n\t\t/**\n\t\t * Set the position of a tile's sprite in its sprite sheet\n\t\t * @param x {int}\n\t\t * @param y {int}\n\t\t * @param z {int}\n\t\t * @param spritePos {object} an array containing the x and y of the sprite\n\t\t */\n\t\tfunction tileSpritePosition(x, y, z, spritePos) {\n\t\t\tz = z || 0;\n\t\t\tvar tile = getTile(x, y, z);\n\t\t\ttile.spritePosition = spritePos;\n\t\t\ttile.CSSUpdated = true;\n\t\t}\n\n\n\t\t/* --------------------------------------------------\n\t\t Map Related\n\t\t -------------------------------------------------- */\n\n\t\t/**\n\t\t * Set the map position.\n\t\t * @param x {int}\n\t\t * @param y {int}\n\t\t */\n\t\tfunction position(x, y) {\n\t\t\tmap.position = [x, y];\n\t\t}\n\n\t\t/**\n\t\t * Set the cell size\n\t\t * @param w {int}\n\t\t * @param h {int}\n\t\t */\n\t\tfunction cellSize(w, h) {\n\t\t\tmap.cellSize = [w, h];\n\t\t}\n\n\t\t/**\n\t\t * Set the map limits\n\t\t * @param size {object}\n\t\t * @param startPosition {object}\n\t\t */\n\t\tfunction tileCreate(size, startPosition) {\n\n\t\t\tif(!size[2]) size[2] = 1;\n\n\t\t\tvar x = startPosition[0];\n\t\t\tvar y = startPosition[1];\n\t\t\tvar z = startPosition[2] || 0;\n\n\t\t\t//get the sprite sheet\n\t\t\tvar spriteSheet = sprites[maps[mapName].spriteSheetName];\n\n\t\t\tfor (var zI = 0; zI < size[2]; zI += 1) {\n\t\t\t\tfor (var yI = 0; yI < size[1]; yI += 1) {\n\t\t\t\t\tfor (var xI = 0; xI < size[0]; xI += 1) {\n\t\t\t\t\t\tvar tile = IsoTile(sceneName, mapName, [x + xI, y + yI, z + zI]);\n\n\t\t\t\t\t\t//set the background\n\t\t\t\t\t\ttile.CSS[\"background\"] = 'url(' + spriteSheet.url + ')';\n\t\t\t\t\t\ttile.CSS[\"width\"] = map.cellSize[0] + \"px\";\n\t\t\t\t\t\ttile.CSS[\"height\"] = map.cellSize[1] + \"px\";\n\t\t\t\t\t\ttile.CSSUpdated = true;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Set the sprite sheet for the tiles\n\t\t * @param spriteSheetName {string}\n\t\t */\n\t\tfunction spriteSheet(spriteSheetName) {\n\t\t\tmap.spriteSheetName = spriteSheetName;\n\t\t}\n\n\t\t//add the map to the maps object\n\t\tmaps[mapName] = map;\n\n\t\t//return API\n\t\treturn {\n\t\t\t\"position\": position,\n\t\t\t\"cellSize\": cellSize,\n\t\t\t\"tile\": {\n\t\t\t\t\"create\": tileCreate,\n\t\t\t\t\"css\": tileCSS\n\t\t\t},\n\t\t\t\"sprite\": {\n\t\t\t\t\"sheet\": spriteSheet\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "93039a58051a7af45b61943d54d30daa", "score": "0.6184606", "text": "function newPlayer(name) {\n return {\n name,\n x: Math.round(Math.random() * (mapSize - 1)),\n y: Math.round(Math.random() * (mapSize - 1)),\n };\n}", "title": "" }, { "docid": "ebdfdbfe05c036253d29b57a91b0ca07", "score": "0.61759067", "text": "function generate_map()\n{\n // Orginal image dim \n var width = 3824;\n var height = 1658;\n\n // new_h because we want to keep aspect ratio of map, we want to fit width to our canvas\n var new_h = (CANVAS_W() * height) / width;\n\n map_cover = paper.rect(0, 0, CANVAS_W(), CANVAS_H()).attr(\n {\n 'fill': \"#eaedf1\",\n 'stroke-opacity': 0\n });\n\n map = paper.image(\"../images/map.png\", 0, 0, CANVAS_W(), new_h);\n\n // Set default location in troy\n var abs_x = ( 300 / 1000 ) * map.attr('width');\n var abs_y = ( 140 / 434 ) * map.attr('height');\n\n\n // Place in troy\n MAP_MARKER = paper.circle(abs_x, abs_y, 4).attr({'fill': 'red'});\n\n hide_map();\n\n // Event handler when clicking\n map.click(function()\n {\n\n // moved our coordinate\n GLOBAL_SKETCH_ALTERED = true;\n\n // move the marker\n move_marker(CURSOR_X,CURSOR_Y);\n\n // set cursormode a little after being clicked\n setTimeout (cursorMode , 300);\n }); // click\n}", "title": "" }, { "docid": "965aadd663c9ed659596b2a091ddc579", "score": "0.6163619", "text": "function generatePlayer(){\r\n var randNum = Math.floor(Math.random()*map.height);\r\n player.positionX = randNum;\r\n player.positionY = randNum;\r\n\r\n var play = document.createElement(\"img\");\r\n play.id = player.id;\r\n play.style.position = player.position;\r\n play.style.zIndex = \"1\";\r\n play.style.height = player.height+\"px\";\r\n play.style.width = player.width+\"px\";\r\n play.style.top = randNum+\"px\";\r\n play.style.left = randNum+\"px\";\r\n play.src = \"images/human-black-10x20.png\";\r\n\r\n var mapping = document.querySelector(\"#gamearea\");\r\n obstacleArray.push(player);\r\n mapping.appendChild(play);\r\n}", "title": "" }, { "docid": "cb62172ec45fd33a3553f4ca57fd54c5", "score": "0.6162841", "text": "function drawMap() {\n var map_border = 2;\n var map_w = Math.floor(canvas.width / 7);\n var map_h = Math.floor(canvas.height / 7);\n var map_x = 5;\n var map_y = canvas.height - map_h - 5;\n \n var gap_w = (map_w - map_border * 2) / grid_w;\n var gap_h = (map_h - map_border * 2) / grid_h;\n \n if(can_render) {\n c.fillStyle = '#000';\n c.fillRect(map_x, map_y, map_w, map_h);\n c.fillStyle = '#fff';\n c.fillRect(map_x + map_border, map_y + map_border, map_w - map_border * 2,\n map_h - map_border * 2);\n \n for(var i = 0; i < grid_w; i++) {\n for(var j = 0; j < grid_h; j++) {\n var color = grid[i][j];\n if(color != '#FFFFFF') {\n c.fillStyle = color;\n var x = map_x + map_border + i * gap_w;\n var y = map_y + map_border + j * gap_h;\n c.fillRect(x, y, gap_w, gap_h);\n }\n }\n }\n \n c.strokeStyle = '#000';\n c.lineWidth = 1;\n players.forEach(function(player) {\n var x = map_x + map_border + player.x * gap_w;\n var y = map_y + map_border + player.y * gap_h;\n c.strokeRect(x, y, gap_w, gap_h);\n });\n }\n }", "title": "" }, { "docid": "231abde92def664bdc4b4a4e2727a55d", "score": "0.6145462", "text": "function createMap(scene, world) {\r\n createLights(scene);\r\n createGround(scene, world);\r\n createBuilding(scene, world);\r\n createDelimitationWalls(scene, world);\r\n createWhiteWalls(scene, world);\r\n createTurrets(scene, world);\r\n createBarrels(scene, world);\r\n createTrees(scene, world);\r\n createBottomPlanes(scene, world);\r\n}", "title": "" }, { "docid": "8a7e6396b3bf57b33f600477e915dbc3", "score": "0.6136777", "text": "function setUpMap() {\n var mapCanvas, mapContext, canH, canW;\n \n mapCanvas = document.getElementById(\"mapCan\");\n mapContext = mapCanvas.getContext(\"2d\");\n \n canH = mapCanvas.height;\n canW = mapCanvas.width;\n \n graphBackground(mapContext, canH, canW);\n graphDiagonal(mapContext, canH, canW);\n graphParabola(mapContext, canH, canW);\n \n return mapContext;\n}", "title": "" }, { "docid": "e907e71e58f475d6b5ba276046f424d3", "score": "0.6136263", "text": "function renderMap(id){\n var playerX = playerLocations.get(id).x;\n var playerY = playerLocations.get(id).y;\n\n start_x = playerX - 4;\n start_y = playerY - 4;\n\n var locs = create2DArray(9, 9);\n \n for(var [target, loc] of playerLocations){\n if(loc.state == PLAYER_DEAD){\n continue;\n }\n var tmpx = parseInt(loc.x);\n var tmpy = parseInt(loc.y);\n if((tmpx >= start_x && tmpx <= playerX + 4) && (tmpy >= start_y && tmpy <= playerY + 4)){\n if(target == id){\n locs[tmpx - start_x][tmpy - start_y] = 1;\n }\n else {\n locs[tmpx - start_x][tmpy - start_y] = 2;\n }\n \n }\n }\n\n for(let x = 0; x < locs.length; x++){\n for(let y = 0; y < locs[x].length; y++){\n if(start_x + x < 0 || start_y + y < 0 || start_y + y >= 100 || start_x + x >= 100){ \n continue;\n }\n if(locs[x][y] === undefined){\n locs[x][y] = gameMap[start_x + x][start_y + y];\n \n }\n }\n }\n\n return locs;\n}", "title": "" }, { "docid": "01f9f7b4a4db24b86ebb33a506d499b9", "score": "0.6130669", "text": "function World11(map) {\n map.locs = [\n new Location(0, true),\n new Location(0, exitPipeVert),\n new Location(1)\n ];\n map.areas = [\n new Area(\"Overworld\", function() {\n setLocationGeneration(0);\n\n pushPreThing(text, 20, 96, [\"<div style='width:350px;height:305px;background-color:#d64d00;border-radius:7px;box-shadow:3px 3px #efb28b inset, -3px -3px black inset;'><p style='text-align:left;padding:7px 14px;font-family: Super Mario Bros Alphabet;font-size:106px;line-height:96px;text-shadow:6px 8px black'>Super<br>Mario Bros<br></p><p style='text-align:center;text-shadow:2px 2px 1px #61341b'>Arrow/WASD keys move<br>Shift to fire/sprint<br>P/M to pause/mute</p></div>\"]);\n \n pushPrePattern(\"backreg\", 0, 0, 5);\n pushPreFloor(0, 0, 69);\n \n pushPreThing(Block, 128, jumplev1);\n pushPreThing(Brick, 160, jumplev1);\n pushPreThing(Block, 168, jumplev1, Mushroom);\n pushPreThing(Goomba, 176, 8);\n pushPreThing(Brick, 176, jumplev1);\n pushPreThing(Block, 176, jumplev2);\n pushPreThing(Block, 184, jumplev1);\n pushPreThing(Brick, 192, jumplev1);\n pushPrePipe(224, 0, 16, false);\n pushPrePipe(304, 0, 24);\n pushPrePipe(368, 0, 32);\n pushPreThing(Goomba, 340, 8);\n pushPrePipe(368, 0, 32);\n pushPreThing(Goomba, 412, 8);\n pushPreThing(Goomba, 422, 8);\n pushPrePipe(456, 0, 32, false, 2);\n pushPreThing(Block, 512, 40, [Mushroom, 1], true);\n pushPreFloor(568, 0, 15);\n pushPreThing(Brick, 618, jumplev1);\n pushPreThing(Block, 626, jumplev1, Mushroom);\n pushPreThing(Brick, 634, jumplev1);\n pushPreThing(Brick, 640, jumplev2);\n pushPreThing(Goomba, 640, jumplev2 + 8);\n pushPreThing(Brick, 648, jumplev2);\n pushPreThing(Brick, 656, jumplev2);\n pushPreThing(Goomba, 656, jumplev2 + 8);\n pushPreThing(Brick, 664, jumplev2);\n pushPreThing(Brick, 672, jumplev2);\n pushPreThing(Brick, 680, jumplev2);\n pushPreThing(Brick, 688, jumplev2);\n pushPreThing(Brick, 696, jumplev2);\n pushPreFloor(712, 0, 64);\n pushPreThing(Brick, 728, jumplev2);\n pushPreThing(Brick, 736, jumplev2);\n pushPreThing(Brick, 744, jumplev2);\n pushPreThing(Brick, 752, jumplev1, Coin);\n pushPreThing(Block, 752, jumplev2);\n pushPreThing(Goomba, 776, 8);\n pushPreThing(Goomba, 788, 8);\n pushPreThing(Brick, 800, jumplev1);\n pushPreThing(Brick, 808, jumplev1, Star);\n pushPreThing(Block, 848, jumplev1);\n pushPreThing(Koopa, 856, 12);\n pushPreThing(Block, 872, jumplev1);\n pushPreThing(Block, 872, jumplev2, Mushroom);\n pushPreThing(Block, 896, jumplev1);\n pushPreThing(Goomba, 912, 8);\n pushPreThing(Goomba, 924, 8);\n pushPreThing(Brick, 944, jumplev1);\n pushPreThing(Brick, 968, jumplev2);\n pushPreThing(Brick, 976, jumplev2);\n pushPreThing(Brick, 984, jumplev2);\n pushPreThing(Goomba, 992, 8);\n pushPreThing(Goomba, 1004, 8);\n pushPreThing(Goomba, 1024, 8);\n pushPreThing(Goomba, 1036, 8);\n pushPreThing(Brick, 1024, jumplev2);\n pushPreThing(Brick, 1032, jumplev1);\n pushPreThing(Block, 1032, jumplev2);\n pushPreThing(Brick, 1040, jumplev1);\n pushPreThing(Block, 1040, jumplev2);\n pushPreThing(Brick, 1048, jumplev2); \n // To do: clean these genericstones up\n pushPreThing(GenericStone, 1072, 8);\n pushPreThing(GenericStone, 1080, 16, 1, 2);\n pushPreThing(GenericStone, 1088, 24, 1, 3);\n pushPreThing(GenericStone, 1096, 32, 1, 4);\n pushPreThing(GenericStone, 1120, 32, 1, 4);\n pushPreThing(GenericStone, 1128, 24, 1, 3);\n pushPreThing(GenericStone, 1136, 16, 1, 2);\n pushPreThing(GenericStone, 1144, 8);\n pushPreThing(GenericStone, 1184, 8);\n pushPreThing(GenericStone, 1192, 16, 1, 2);\n pushPreThing(GenericStone, 1200, 24, 1, 3);\n pushPreThing(GenericStone, 1208, 32, 1, 4);\n pushPreThing(GenericStone, 1216, 32, 1, 4);\n \n pushPreFloor(1240, 0, 69);\n pushPreThing(GenericStone, 1240, 32, 1, 4);\n pushPreThing(GenericStone, 1248, 24, 1, 3);\n pushPreThing(GenericStone, 1256, 16, 1, 2);\n pushPreThing(GenericStone, 1264, 8, 1, 1);\n pushPrePipe(1304, 0, 16, false, false, 1);\n \n pushPreThing(Brick, 1344, jumplev1);\n pushPreThing(Brick, 1352, jumplev1);\n pushPreThing(Block, 1360, jumplev1);\n pushPreThing(Brick, 1368, jumplev1);\n pushPreThing(Goomba, 1392, 8);\n pushPreThing(Goomba, 1404, 8);\n \n pushPrePipe(1432, 0, 16);\n pushPreThing(GenericStone, 1448, 8);\n pushPreThing(GenericStone, 1456, 16, 1, 2);\n pushPreThing(GenericStone, 1464, 24, 1, 3);\n pushPreThing(GenericStone, 1472, 32, 1, 4);\n pushPreThing(GenericStone, 1480, 40, 1, 5);\n pushPreThing(GenericStone, 1488, 48, 1, 6);\n pushPreThing(GenericStone, 1496, 56, 1, 7);\n pushPreThing(GenericStone, 1504, 64, 2, 8);\n endCastleOutside(1580, 0, castlev);\n }),\n new Area(\"Underworld\", function() {\n setLocationGeneration(2);\n makeCeiling(32, 7);\n pushPreFloor(0, 0, 17);\n fillPreThing(Brick, 0, 8, 1, 11, 8, 8);\n fillPreThing(Brick, 32, 8, 7, 3, 8, 8);\n fillPreThing(Coin, 33, 31, 7, 2, 8, 16);\n fillPreThing(Coin, 41, 63, 5, 1, 8, 8);\n pushPreThing(PipeSide, 104, 16, 1);\n pushPreThing(PipeVertical, 120, 88, 88);\n })\n ];\n}", "title": "" }, { "docid": "db76e65395798a49479a2ef87bc599bb", "score": "0.61191", "text": "function makePlayerMap(players) {\n var playerMap = {};\n players.forEach(function (player) {\n playerMap[player._id] = { shortID: player.shortID, name: player.player_name };\n });\n return playerMap;\n}", "title": "" }, { "docid": "ea0bc729ba7decad7254e877a950432a", "score": "0.6106351", "text": "function loadMap(level)\n{\n console.log(\"loading a map!\");\n\n //Create the MAP!\n var currentMap = level.map;\n var w = level.w;\n var h = level.h;\n\n //CENTER the map\n var widthDiff = game.width - level.w*TILE_SIZE;\n var heightDiff = (game.height-uiBar.h) - level.h*TILE_SIZE;\n var xOffset = Math.floor(widthDiff/2);\n var yOffset = Math.floor(heightDiff/2);\n\n var startX = xOffset;\n var startY = uiBar.h + yOffset;\n\n for(i=0;i<h;i++)\n {\n for(j=0;j<w;j++)\n {\n var posX = j*TILE_SIZE + startX;\n var posY = i*TILE_SIZE + startY;\n var posCenterX = posX+32; //account for centered anchor\n var posCenterY = posY+32; //account for centered anchor\n\n if(currentMap[i*w+j] == '#') \n {\n var block = blocks.create(posX,posY,'block');\n game.physics.enable(block, Phaser.Physics.ARCADE);\n block.body.immovable = true;\n }\n else if(currentMap[i*w+j] == 'E')\n {\n floorTiles.create(posX, posY, 'floor');\n\n var enemy = enemies.create(posX,posY,'enemy');\n game.physics.enable(enemy, Phaser.Physics.ARCADE);\n }\n else if(currentMap[i*w+j] == 'p')\n {\n floorTiles.create(posX, posY, 'floor');\n\n heroSmart.body.x = posX;\n heroSmart.body.y = posY;\n }\n else if(currentMap[i*w+j] == 'P')\n {\n floorTiles.create(posX, posY, 'floor');\n\n heroKiller.body.x = posX;\n heroKiller.body.y = posY;\n }\n else if(currentMap[i*w+j] == 'a')\n {\n goal1.x = posCenterX; //posX;\n goal1.y = posCenterY;//posY;\n }else if(currentMap[i*w+j] == 'b')\n {\n goal2.x = posCenterX;//posX;\n goal2.y = posCenterY;//posY;\n }\n else if(currentMap[i*w+j] == '1')\n {\n //switch 1\n switches[0].revive();\n switches[0].x = posX;// switches[0].body.x = posX;\n switches[0].y = posY;\n }\n else if(currentMap[i*w+j] == '2')\n {\n //switch 2\n switches[1].revive();\n switches[1].x = posX;\n switches[1].y = posY;\n\n }\n else if(currentMap[i*w+j] == '3')\n {\n //switch 3\n switches[2].revive();\n switches[2].x = posX;\n switches[2].y = posY;\n }\n else if(currentMap[i*w+j] == '4')\n {\n //switch 4\n switches[3].revive();\n switches[3].x = posX;\n switches[3].y = posY;\n }\n else if(currentMap[i*w+j] == '9' || currentMap[i*w+j] == '8' || currentMap[i*w+j] == '7' || currentMap[i*w+j] == '6' || currentMap[i*w+j] == '5')\n {\n \n //and assign it to the correct switch!\n if(currentMap[i*w+j] == '9')\n {\n //ORANGE\n var gate = switches[0].gates.create(posX,posY,'gate1On')\n game.physics.enable(gate, Phaser.Physics.ARCADE);\n gate.body.immovable = true;\n switches[0].active = true;\n }\n else if(currentMap[i*w+j] == '8')\n {\n //GREEN\n var gate = switches[1].gates.create(posX,posY,'gate2On')\n game.physics.enable(gate, Phaser.Physics.ARCADE);\n gate.body.immovable = true;\n switches[1].active = true;\n }\n else if(currentMap[i*w+j] == '7')\n {\n //YELLOW\n var gate = switches[2].gates.create(posX,posY,'gate3On')\n game.physics.enable(gate, Phaser.Physics.ARCADE);\n gate.body.immovable = true;\n switches[2].active = true;\n }\n else if(currentMap[i*w+j] == '6')\n {\n //PURPLE\n var gate = switches[3].gates.create(posX,posY,'gate4On')\n game.physics.enable(gate, Phaser.Physics.ARCADE);\n gate.body.immovable = true;\n switches[3].active = true;\n }\n else if(currentMap[i*w+j] == '5')\n {\n //Creates colorless gates\n var gate = grayGates.create(posX,posY,'gate0')\n game.physics.enable(gate, Phaser.Physics.ARCADE);\n gate.body.immovable = true;\n }\n }\n else{\n floorTiles.create(posX, posY, 'floor');\n }\n }\n }\n}", "title": "" }, { "docid": "c0c33ff799d4474954600b44a437f68d", "score": "0.60995287", "text": "function createGamePieceBitmaps(){\n\t\tvar i;\n\t\tvar coinFrameRate = 20;\n\t\t\n\t\t//create player bitmap\n\t\tvar playerShape = new createjs.Shape();\n\t\t\n\t\tplayerShape.graphics.inject(drawPlayer);\n\t\tplayerShape.cache(0, 0, 64, 133);\n\t\tplayer = new createjs.Bitmap(playerShape.cacheCanvas);\n\t\tplayer.regX = 32;\n\t\tplayer.regY = 66.5;\n\t\t\n\t\t//create yellow enemy sprite\n\t\tvar shapeEnemyYellow = new createjs.Shape();\n\t\t\n\t\tshapeEnemyYellow.graphics.inject(drawEnemyYellow);\n\t\tshapeEnemyYellow.cache(0, 0, 63, 127);\n\t\tspriteEnemyYellow = new createjs.Bitmap(shapeEnemyYellow.cacheCanvas);\n\t\tspriteEnemyYellow.regX = 31.5;\n\t\tspriteEnemyYellow.regY = 63.5;\n\t\t\n\t\t//create green enemy sprite\n\t\tvar shapeEnemyGreen = new createjs.Shape();\n\t\t\n\t\tshapeEnemyGreen.graphics.inject(drawEnemyGreen);\n\t\tshapeEnemyGreen.cache(0, 0, 63, 127);\n\t\tspriteEnemyGreen = new createjs.Bitmap(shapeEnemyGreen.cacheCanvas);\n\t\tspriteEnemyGreen.regX = 31.5;\n\t\tspriteEnemyGreen.regY = 63.5;\n\t\t\n\t\t//create blue enemy sprite\n\t\tvar shapeEnemyBlue = new createjs.Shape();\n\t\t\n\t\tshapeEnemyBlue.graphics.inject(drawEnemyBlue);\n\t\tshapeEnemyBlue.cache(0, 0, 63, 127);\n\t\tspriteEnemyBlue = new createjs.Bitmap(shapeEnemyBlue.cacheCanvas);\n\t\tspriteEnemyBlue.regX = 31.5;\n\t\tspriteEnemyBlue.regY = 63.5;\n\t\t\n\t\t//create road segments\n\t\tvar roadSegmentShape = new createjs.Shape();\n\t\t\n\t\troadSegmentShape.graphics.inject(drawRoadSegment);\n\t\troadSegmentShape.cache(0, 0, 800, 150);\n\t\troadSegments[0] = new createjs.Bitmap(roadSegmentShape.cacheCanvas);\n\t\tfor(i = 1; i < 6; i++){\n\t\t\troadSegments[i] = roadSegments[0].clone();\n\t\t}\n\t\t//create gold coin sprite\n\t\tvar coinGoldSheet = new createjs.SpriteSheet({\n\t\t\timages:[loadQueue.getResult(assets.COIN_GOLD)],\n\t\t\tframes: {width: 32, height: 32}\n\t\t});\n\t\tspriteCoinGold = new createjs.Sprite(coinGoldSheet, 0);\n\t\tspriteCoinGold.framerate = coinFrameRate;\n\t\t\n\t\t//create silver coin sprite\n\t\tvar coinSilverSheet = new createjs.SpriteSheet({\n\t\t\timages:[loadQueue.getResult(assets.COIN_SILVER)],\n\t\t\tframes: {width: 32, height: 32}\n\t\t});\n\t\tspriteCoinSilver = new createjs.Sprite(coinSilverSheet, 0);\n\t\tspriteCoinSilver.framerate = coinFrameRate;\n\t\t\n\t\t//create copper coin sprite\n\t\tvar coinCopperSheet = new createjs.SpriteSheet({\n\t\t\timages: [loadQueue.getResult(assets.COIN_COPPER)],\n\t\t\tframes: {width: 32, height: 32}\n\t\t});\n\t\tspriteCoinCopper = new createjs.Sprite(coinCopperSheet, 0);\n\t\tspriteCoinCopper.framerate = coinFrameRate;\n\t\t\n\t\t//create explosion sprite\n\t\tvar explosionSheet = new createjs.SpriteSheet({\n\t\t\timages: [loadQueue.getResult(assets.EXPLOSION)],\n\t\t\tframes: {width: 256, height: 256}\n\t\t});\n\t\tspriteExplosion = new createjs.Sprite(explosionSheet, 0);\n\t\tspriteExplosion.scaleX = 3;\n\t\tspriteExplosion.scaleY = 3;\n\t\tspriteExplosion.regX = 128;\n\t\tspriteExplosion.regY = 128;\n\t\tspriteExplosion.addEventListener(\"animationend\", onExplosionComplete);\n\t\t\n\t\t//create game over screen\n\t\tscreenGameOver = new createjs.Bitmap(loadQueue.getResult(assets.SCREEN_GAME_OVER));\n\t\t\n\t\t//create welcome screen\n\t\tscreenWelcome = new createjs.Bitmap(loadQueue.getResult(assets.SCREEN_WELCOME));\n\t}", "title": "" }, { "docid": "8b0168dc6060958bc3f77fca7f13ea53", "score": "0.6054691", "text": "init(player_num) {\n var gen = new this.map_gen(this.grid_size, this.grid_size, 4, 100);\n this.grid_size = Math.trunc(Math.random() * 4) + 5 + Math.trunc(Math.random() * 4) - 2;\n console.log(this.grid_size);\n var map_obj = gen.generate_map(this.grid_size);\n this.spawn = map_obj.spawn;\n this.walls = map_obj.walls;\n this.players_left = player_num;\n \n console.log(\"player 1 spawn: {\" + this.spawn.p1.x + \", \" + this.spawn.p1.y + \"}\");\n console.log(\"player 2 spawn: {\" + this.spawn.p2.x + \", \" + this.spawn.p2.y + \"}\");\n console.log(\"player 3 spawn: {\" + this.spawn.p3.x + \", \" + this.spawn.p3.y + \"}\");\n\n this.players[''+1] = new this.player_gen(''+1, this.spawn['p'+1].x*100 + 50, this.spawn['p'+1].y*100+50, 7, 'red', 30, 20);\n this.players[''+2] = new this.player_gen(''+2, this.spawn['p'+2].x*100 + 50, this.spawn['p'+2].y*100+50, 7, 'green', 30, 20);\n this.players[''+3] = new this.player_gen(''+3, this.spawn['p'+3].x*100 + 50, this.spawn['p'+3].y*100+50, 7, 'blue', 30, 20);\n for (var id in this.players) {\n this.wins[id] = 0;\n }\n var pm = require('./PowerupManager');\n this.power_manager = new pm({up_down: this.walls.x_walls, left_right: this.walls.y_walls}, {x: this.spawn['p'+1].x, y: this.spawn['p'+1].y});\n \n var cm = require('./CollisionManager');\n this.collision_manager = new cm(this.grid_size);\n\n this.game_timer = 250;\n \n }", "title": "" }, { "docid": "71daa7c7ce65a6d56b8119945965580b", "score": "0.60528874", "text": "function startGame() {\n\t// Set the variables\n\tvar locationName = \"WAGENINGEN\"; // \"\" for later versions\n\tvar playerName = \"\";\n\t// Create the game object\n\tvar game = new Object();\n\t// Create the startingVariables object\n\tvar startingVariables = new Object();\n\t// Create the player object\n\tvar player = new Object();\n\n\t// Add the starting location\n\tstartingVariables.locationName = \"WAGENINGEN\";\n\tsetLatLon(startingVariables);\n\n\t// Get the player's name\n\twhile (playerName.length < 1) {\n\t\t// Get the player's name\n\t\tplayerName = prompt(\"What is your name? \", \"Chariza\");\n\t\t// Add the playerName to the player object\n\t\tplayer.Name = playerName;\n\t}\n\t// Add the player to the topoPets object\n\tgame.player = player;\n\t// Show the player's name\n\tdocument.getElementById(\"playerTitle\").innerHTML = \"<p>\" + game.player.Name + \"</p>\";\n\n\t// Add the startingVariables to the game object\n\tgame.startingVariables = startingVariables;\n\n\t// Add the previous and current location to the game object\n\tgame.previousLocation = game.startingVariables.locationName;\n\tgame.currentLocation = game.startingVariables.locationName;\n\n\t// Draw the map\n\tgame = drawMap(game);\n\n\t// Return the game object\n\treturn game;\n }", "title": "" }, { "docid": "30b643f5acd7f5c687d471e0c48cddd1", "score": "0.605222", "text": "function drawMapFirstPass() {\r\n var x = g_map.player_hex.x;\r\n var y = g_map.player_hex.y;\r\n determineCandidatesForDrawing(x, y, x, y);\r\n updateLineOfSightInfo();\r\n updateTransparencyOfWalls();\r\n updateCamera(x, y);\r\n updateVisibleFloor();\r\n updateVisibleEntities(false, 0);\r\n drawFloor();\r\n drawEntities();\r\n drawHUD();\r\n}", "title": "" }, { "docid": "3613c14eac3f963f6f3c0ac0ab7d6c9d", "score": "0.60467553", "text": "function createMapBlocks() {\n for (let i = 0; i < 16; i++) {\n let block = document.createElement('div');\n block.classList.add('tile');\n let innerBlock = document.createElement('div');\n innerBlock.classList.add('tile');\n block.appendChild(innerBlock);\n mapa.appendChild(block);\n }\n}", "title": "" }, { "docid": "83c7d4d50fa1cd2a3fc5b1f43784b3da", "score": "0.604456", "text": "function mapCreateDummy(sizeX, difficulty) {\n var mapY = 2*9;\n var mapX = 16*sizeX;\n var tiles = new Array(mapX*mapY).fill(0);\n var enemies = new Array(mapX*mapY).fill(0);\n var pickups = new Array(mapX*mapY).fill(0);\n var decorations = new Array(mapX*mapY).fill(0);\n var decorationSeed = new Array(mapX*mapY).fill(0);\n var signs = new Array(0);\n // TODO: decorations\n\n // create floor\n for (var i = 0; i < mapX; i++) {\n py = mapY - 1;\n tiles[i + py*mapX] = LAYER_GROUND;\n }\n\n // Constant for setting up the random map\n const mapArea = mapY*mapX;\n const screenArea = 16.0*9.0;\n // We only assume horizontal size\n const mapScreens = sizeX;\n\n const seedTiles = Math.floor(mapArea / 60);\n const verticalCount = mapArea / 8;\n const horizontalCount = mapArea / 4;\n\n const randomCount = {\n enemyBurning: difficulty * mapScreens * 0.5,\n enemyTwister: difficulty * mapScreens * 0.5,\n enemyElectric: difficulty * mapScreens * 0.5,\n enemyStorm: difficulty * mapScreens * 0.5,\n enemyMagma: difficulty * mapScreens * 0.2,\n enemyTree: difficulty * mapScreens * 0.2,\n pickupMelons: mapScreens * 2.0,\n pickupMushrooms: mapScreens * 2.0\n };\n\n console.log('Creating random map with sizeX (screens):' + sizeX);\n console.log('Expected object count: ' + JSON.stringify(randomCount));\n\n // Add seed tiles\n for (var i = 0; i < seedTiles; i++) {\n var px = Math.floor(Math.random()*mapX);\n px = px >= mapX ? mapX - 1 : px;\n var py = Math.floor(Math.random()*(mapY - 7) + 7);\n py = py >= mapY ? mapY - 1 : py;\n tiles[px + py*mapX] = LAYER_CAVE;\n }\n\n // run vertical\n var count = 0;\n for (var i = 0; i < 100000; i++) {\n const newTile = LAYER_GROUND;\n var px = Math.floor(Math.random()*mapX);\n var py = Math.floor(Math.random()*mapY);\n const ot = (py > 0) && tiles[px + (py-1)*mapX] != 0;\n const ob = (py < mapX-1) && tiles[px + (py+1)*mapX] != 0;\n if (ot || ob) {\n tiles[px + py*mapX] = newTile;\n count += 1;\n if (count > verticalCount) break;\n }\n }\n // run horizontal\n count = 0;\n for (var i = 0; i < 100000; i++) {\n const newTile = LAYER_GROUND;\n var px = Math.floor(Math.random()*mapX);\n var py = Math.floor(Math.random()*mapY);\n const ol = (px > 0) && tiles[px - 1 + py*mapX] != 0;\n const or = (px < mapX-1) && tiles[px + 1 + py*mapX] != 0;\n if (ol || or) {\n tiles[px + py*mapX] = newTile;\n count += 1;\n if (count > horizontalCount) break;\n }\n }\n\n // Find the position for the player start and exit\n var startY;\n var exitY;\n for (startY = mapY - 2; startY >= 10; startY -= 1) {\n const index = 0 + startY*mapX;\n const curTile = tiles[index];\n if (curTile == 0 || curTile == LAYER_CAVE || startY == 10) {\n if (curTile == LAYER_GROUND) tiles[index] = 0;\n break;\n }\n }\n for (exitY = mapY - 2; exitY >= 10; exitY -= 1) {\n const index = mapX - 1 + exitY*mapX;\n const curTile = tiles[index];\n if (curTile == 0 || curTile == LAYER_CAVE || exitY == 10) {\n tiles[index] = LAYER_CAVE;\n break;\n }\n }\n // Clear up start and exit\n // TODO: Make this nicer\n for (var py = startY; py >= 0; py--) {\n const index = 0 + py*mapX;\n if(mapIsBlocked(tiles[index])) tiles[index] = 0;\n }\n for (var py = startY - 2; py >= 0; py--) {\n const index = 1 + py*mapX;\n if(mapIsBlocked(tiles[index])) tiles[index] = 0;\n }\n for (var py = startY - 4; py >= 0; py--) {\n const index = 2 + py*mapX;\n if(mapIsBlocked(tiles[index])) tiles[index] = 0;\n }\n for (var py = startY - 6; py >= 0; py--) {\n const index = 3 + py*mapX;\n if(mapIsBlocked(tiles[index])) tiles[index] = 0;\n }\n for (var py = startY; py >= 0; py--) {\n const index = mapX - 1 + py*mapX;\n if(mapIsBlocked(tiles[index])) tiles[index] = 0;\n }\n\n\n // Add some random enemies and PICKUPS\n\n mapSetRandomlyOnWalkableTiles(tiles, enemies, mapX, mapY, ENEMY_TWISTER_MONSTER, mapDummyCount(randomCount.enemyTwister));\n mapSetRandomlyOnWalkableTiles(tiles, enemies, mapX, mapY, ENEMY_ELECTRIC_MONSTER, mapDummyCount(randomCount.enemyElectric));\n mapSetRandomlyOnWalkableTiles(tiles, enemies, mapX, mapY, ENEMY_STORM_MONSTER, mapDummyCount(randomCount.enemyStorm));\n\n mapSetRandomlyOnWalkableTilesAboveGround(tiles, enemies, mapX, mapY, ENEMY_BURNING_MONSTER, 0, mapDummyCount(randomCount.enemyBurning));\n mapSetRandomlyOnWalkableTilesAboveGround(tiles, enemies, mapX, mapY, ENEMY_SHINING_TREE_MONSTER, 1, mapDummyCount(randomCount.enemyTree));\n mapSetRandomlyOnWalkableTilesAboveGround(tiles, enemies, mapX, mapY, ENEMY_MAGMA_MONSTER, 1, mapDummyCount(randomCount.enemyMagma));\n\n mapSetRandomlyOnWalkableTilesAboveGround(tiles, pickups, mapX, mapY, PICKUP_WATERMELON, 0, mapDummyCount(randomCount.pickupMelons));\n mapSetRandomlyOnWalkableTilesAboveGround(tiles, pickups, mapX, mapY, PICKUP_MUSHROOM1, 0, mapDummyCount(randomCount.pickupMushrooms));\n\n\n // Add some BG tiles\n var dy = Math.floor(Math.random()*10);\n for (var x = 0; x < mapX; x++) {\n dy += Math.random()*4.5 - 2;\n dy = Math.floor(dy);\n if (dy < 2) dy = 2;\n if (dy > 10) dy = 10;\n for (var y = 0; y < dy; y++) {\n const ay = mapY - 1 - y;\n if (tiles[x + ay*mapX] == 0) tiles[x + ay*mapX] = LAYER_CAVE;\n }\n }\n\n // Finally clear up stuff\n\n return {\n x: mapX,\n y: mapY,\n background: BACKGROUND_MOUNTAINS,\n tiles: tiles,\n enemies: enemies,\n pickups: pickups,\n decorations: decorations,\n decorationSeed: decorationSeed,\n playerStartX: 0,\n playerStartY: startY,\n exitX: mapX-1,\n exitY: exitY }\n\n}", "title": "" }, { "docid": "97a00351591f2decea0d0d664e2bbb1e", "score": "0.60445446", "text": "function GameMap(width, height, map_data, objectives, buildings)\r\n{\r\n GameMap.baseConstructor.call(this, width, height);\r\n \r\n var x;\r\n var y;\r\n var map_obj;\r\n \r\n var map_group = create_group(mySvg);\r\n \r\n /* Build up the data map */\r\n for (x = 0; x < width; x++)\r\n {\r\n for (y = 0; y < height; y++)\r\n {\r\n map_obj = new Object();\r\n \r\n if (typeof map_data == 'undefined')\r\n {\r\n map_obj.tile_type = 0;\r\n }\r\n else\r\n {\r\n map_obj.tile_type = map_data[y][x];\r\n }\r\n \r\n map_obj.occupied = false;\r\n map_obj.obscured = true;\r\n\r\n this.map[x][y] = map_obj;\r\n }\r\n }\r\n \r\n /* Build up the graphical map and add data to external structures.\r\n * Need to do this once we have a complete data map because tiles\r\n * may have dependence on others \r\n */\r\n for (x = 0; x < width; x++)\r\n {\r\n for (y = 0; y < height; y++)\r\n {\r\n map_obj = this.map[x][y];\r\n \r\n var mx = hexmap_get_map_coord_x(x);\r\n var my = hexmap_get_map_coord_y(x, y);\r\n\r\n if (map_obj.tile_type != TILE_WATER)\r\n {\r\n var edge_array = this.get3dEdges(x, y);\r\n map_obj.sprite = \r\n create_hexagon\r\n (\r\n map_group,\r\n gamemap_get_map_screenx(mx),\r\n gamemap_get_map_screeny(mx, my),\r\n hex_size,\r\n gamemap_get_fill(map_obj.tile_type),\r\n edge_array[0],\r\n edge_array[1],\r\n edge_array[2]\r\n );\r\n }\r\n else\r\n {\r\n map_obj.sprite = undefined;\r\n }\r\n\r\n if (map_obj.tile_type == TILE_OBJECTIVE)\r\n {\r\n objectives.addObjective(hexmap_get_map_coord_x(x), hexmap_get_map_coord_y(x, y));\r\n map_obj.sprite_over = create_image(mySvg, gamemap_get_map_screenx(mx), gamemap_get_map_screeny(mx, my), \"stones.svg\"); \r\n }\r\n else if (map_obj.tile_type == TILE_SPAWN0 || map_obj.tile_type == TILE_SPAWN1)\r\n {\r\n map_obj.sprite_over = create_image(mySvg, gamemap_get_map_screenx(mx), gamemap_get_map_screeny(mx, my), \"tent.svg\");\r\n }\r\n else if (map_obj.tile_type == TILE_OBSTACLE)\r\n {\r\n map_obj.sprite_over = create_image(mySvg, gamemap_get_map_screenx(mx), gamemap_get_map_screeny(mx, my), \"forest.svg\", 1.5, 1.5);\r\n }\r\n else if (map_obj.tile_type == TILE_BASE0 || map_obj.tile_type == TILE_BASE1)\r\n {\r\n /* 0 or 1 depending on team */\r\n var owner = map_obj.tile_type - TILE_BASE0;\r\n\r\n buildings.addBuilding\r\n (\r\n new Building\r\n (\r\n hexmap_get_map_coord_x(x),\r\n hexmap_get_map_coord_y(x, y),\r\n 2,\r\n 5,\r\n owner,\r\n this,\r\n undefined /* sprite */\r\n )\r\n );\r\n\r\n //map_obj.tile_type = TILE_GRASS;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "1b06bb85b604eca753abc7dae940c745", "score": "0.60440814", "text": "function generateMap(size, tile) {\n return __awaiter(this, void 0, void 0, function () {\n var grid;\n return __generator(this, function (_a) {\n grid = new Grid_1.default(size, size).mapQR(function (q, r) { return tile(q, r); });\n // const withRivers = generateRivers(grid)\n return [2 /*return*/, grid];\n });\n });\n }", "title": "" }, { "docid": "867963f57965ee45dd726ca3d113b6b9", "score": "0.60393286", "text": "function Player(i) {\n return Map({\n index: i,\n hp: (gameConstantsJS.debugMode ? 50 : 100),\n level: (gameConstantsJS.debugMode ? 5 : 1),\n exp: 0,\n expToReach: 1,\n gold: (gameConstantsJS.debugMode ? 10000 : 1),\n shop: Map({}), // Buys from 5\n hand: Map({}), // Sideline, 8 at once\n board: Map({}), // Placed on board (8x8 area, placeable is 4x8)\n rivals: Map({}), // Holds index and numbers of players played in battle\n /**\n * Board example\n * Map({ (Check OrderedMap in immutable)\n * 'x,y': unit,\n * '6,4': Map({name: 'Pidor'})\n * default: empty\n * })\n */\n });\n}", "title": "" }, { "docid": "f727ed8d1cbcb444a5de3987a885a62c", "score": "0.6027914", "text": "function genMap(width,height,threshold) {\n\tif (height === undefined) { \n\t\treturn genMap(width,width);\n\t} else {\n\t\treturn mapSubGrid(randGrid(4,4,threshold),width/8,1);\n\t}\n}", "title": "" }, { "docid": "32899e55e79ad55e68d03a1f5e980d8c", "score": "0.6025177", "text": "static generate(width = 100, height = 100, steps = 5) {\n\t\tconst map = new Map(width, height);\n\n\t\tmap.init_with_random();\n\n\t\tfor (let i = 0; i < steps; i++)\n\t\t\tmap.iterate();\n\n\t\treturn map;\n\t}", "title": "" }, { "docid": "e7f6a32ad362bdeb6b93207d34f1df2b", "score": "0.6024204", "text": "function generateMap(){\n console.log(\"generating map\");\n gameMap = create2DArray(100, 100);\n /* Generate enviorment */\n for(let x = 0; x < gameMap.length; x++){\n for(let y = 0; y < gameMap[x].length; y++){\n if(randomizer(10) == 9){ \n gameMap[x][y] = TILE_TREE;\n }\n else {\n gameMap[x][y] = TILE_GRASS;\n }\n\n }\n }\n\n\n /* Add fatties to the map */\n let fattyAmount = (randomizer(100) > 90) ? 2 : 1;\n \n /* Generate fatties */\n for(let i = 0; i <fattyAmount; i++){\n let isValid = false;\n while(!isValid){\n let potential_x = randomizer(100);\n let potential_y = randomizer(100);\n\n if(validPosition(potential_x, potential_y, npc.Fatty.getWidth, npc.Fatty.getWidth)){\n let tmp = new npc.Fatty(potential_x, potential_y);\n isValid = true;\n npcs.push(tmp);\n }\n }\n\n }\n\n\n\n gameState = STATE_RUNNING;\n \n}", "title": "" }, { "docid": "f19175290c89e3a737d41de757215869", "score": "0.60216415", "text": "function drawMiniMap(){\n\tif(Game == null || Game.display == null)\t\t//wait until game object is available\n\t\treturn;\n\n\t//set ui variables if Game object is available\n\tif(gameMapCanvas == null || tw == null || th == null || scw == null || sch == null){\n\t gameMapCanvas = Game.display.getContainer();\t\t//set the canvas if available (Game object set)\n\n\t //scale down (this would normally be calculated by the map size relative to the canvas size)\n\t\ttw = Game.display.getOptions().tileWidth;\n\t\tth = Game.display.getOptions().tileHeight;\n\t\tscw = miniCanvas.width/(Game.display.getOptions().width);\n\t\tsch = miniCanvas.height/(Game.display.getOptions().height);\n\t}\n\n\t//reset\n\t//mtx.save();\n\tmtx.clearRect(0, 0, miniCanvas.width, miniCanvas.height);\n\n\t//draw entire map from the game onto the minimap\n\tmtx.drawImage(gameMapCanvas, 0,0,miniCanvas.width,miniCanvas.height);\n\n\t//maybe add icons for the characters?\n\tlet pi = playerIcon;\n\tif(Game.king_barbarian == null && !grassLand20)\n\t\tpi = playerBarbKingIcon;\n\telse if(Game.king_barbarian != null && grassLand20)\n\t\tpi = playerGrassKingIcon;\n\telse if(Game.king_barbarian == null && grassLand20)\n\t\tpi = playerSuperKingIcon;\n\tmtx.drawImage(pi, 0,0,16,16, (Game.player._x*scw)-(iconSize/3), (Game.player._y*sch)-(iconSize/2), iconSize,iconSize);\n\t\n\n\tlet frogs = Game.frog_manager.frogs;\n\tfor(let f=0;f<frogs.length;f++){\n\t\tlet frog = frogs[f];\n\t\tmtx.drawImage(frogIcon, 0,0,16,16, (frog._x*scw)-(iconSize/3), (frog._y*sch)-(iconSize/2), iconSize,iconSize);\n\t}\n\tlet barbs = Game.barbarians\n\tfor(let b=0;b<barbs.length;b++){\n\t\tlet barb = barbs[b];\n\t\tmtx.drawImage((barb.is_king ? kingIcon : barbIcon), 0,0,16,16, (barb._x*scw)-(iconSize/3), (barb._y*sch)-(iconSize/2), iconSize,iconSize);\n\t}\n\n\n\n\t//draw camera box on minimap\n\tlet cw = (tw*camera.zoom);\n\tlet ch = (th*camera.zoom)\n\n\tmtx.strokeStyle = \"#fff\";\n\tmtx.strokeRect((camera.x/tw)*scw,(camera.y/th)*sch,((canvas.width/camera.zoom)/tw)*scw,((canvas.height/camera.zoom)/tw)*sch)\n}", "title": "" }, { "docid": "1b5c32e62aa4f3f17a2cde17440474fc", "score": "0.60207945", "text": "function generateGroundTiles() {\n\toffset += tile_size;\n\t\n\tif ( offset < ( end_of_map - tile_size ) ) {\n\t\taddTile( offset );\n\t\taddEnemy();\n\t\tgenerateGroundTiles();\n\t}\n}", "title": "" }, { "docid": "de5cbb9fe12726428f8e382e702e04b3", "score": "0.60147977", "text": "createTileMap() {\n this.tileMapImages = new Array(this.mapWidth);\n this.buildingImages = new Array(this.mapWidth);\n this.tileMapR90 = new Array(this.mapHeight);\n this.tileMapR180 = new Array(this.mapWidth);\n this.tileMapR270 = new Array(this.mapHeight);\n\n for (let x = this.mapWidth - 1; x >= 0; x--) {\n this.tileMapImages[x] = new Array(this.mapHeight);\n this.buildingImages[x] = new Array(this.mapHeight);\n this.tileMapR90[x] = new Array(this.mapWidth);\n this.tileMapR180[x] = new Array(this.mapHeight);\n this.tileMapR270[x] = new Array(this.mapWidth);\n for (let y = this.mapHeight - 1; y >= 0; y--) {\n let tileCoords = this.displayTileCoordinatesToWorldCoordinates(x, y);\n let tileImage = this.add.image(tileCoords.x, tileCoords.y, \n map.getMap()[x][y].tile).setScale(tileScale).setOrigin(0.5, 1);\n this.tileMapImages[x][y] = tileImage;\n // Add a placeholder building image to be replaced when necessary\n let buildingImage = this.add.image(tileCoords.x, tileCoords.y + buildingYDiff,\n '').setScale(tileScale).setOrigin(0.5, 1);\n buildingImage.setVisible(false);\n this.buildingImages[x][y] = buildingImage;\n // Build matrices to translate between canvas tiles and map tiles when\n // the map has been rotated.\n this.tileMapR90[x][y] = new Phaser.Math.Vector2(this.mapHeight - y - 1, x);\n this.tileMapR180[x][y] = new Phaser.Math.Vector2(this.mapWidth - x - 1 , this.mapHeight - y - 1);\n this.tileMapR270[x][y] = new Phaser.Math.Vector2(y, this.mapWidth - x - 1);\n }\n }\n }", "title": "" }, { "docid": "7b275f29d718561f0145fdb79e738b55", "score": "0.60133106", "text": "function drawMap(){\n ctx.innerHTML = dungeon.displayDungeon();\n\n}", "title": "" }, { "docid": "329a7f2932e1a3d14413229f47195a29", "score": "0.60006607", "text": "draw(map) {\n\n var k;\n var j;\n var x;\n var y;\n var drawId;\n\n for (k = 0; k < this.map.content.length; k++) {\n\n drawId = this.map.content[k].blockId;\n x = this.map.content[k].blockX;\n y = this.map.content[k].blockY;\n getSprite(parseInt(drawId)).drawBackground(x, y, this.canvas, this.cw, this.ch);\n }\n for (k = 0; k < this.map.entities.length; k++) {\n\n drawId = this.map.entities[k].Id;\n x = this.map.entities[k].X;\n y = this.map.entities[k].Y;\n getSprite(parseInt(drawId)).drawBackground(x, y, this.canvas, this.cw, this.ch);\n }\n for (k = 0; k < this.map.creatures.length; k++) {\n drawId = this.map.creatures[k].Id;\n x = this.map.creatures[k].X;\n y = this.map.creatures[k].Y;\n getSprite(parseInt(drawId)).drawBackground(x, y, this.canvas, this.cw, this.ch);\n }\n for (k = 0; k < this.map.interacts.length; k++) {\n drawId = this.map.interacts[k].Id;\n x = this.map.interacts[k].X;\n y = this.map.interacts[k].Y;\n getSprite(parseInt(drawId)).drawBackground(x, y, this.canvas, this.cw, this.ch);\n for (j = 0; j < this.map.interacts[k].action.length; j++) {\n drawId = this.map.interacts[k].action[j].id;\n x = this.map.interacts[k].action[j].x;\n y = this.map.interacts[k].action[j].y;\n\n if (this.map.interacts[k].action[j].type == \"spawn\") {\n switch (this.map.interacts[k].action[j].entType) {\n case \"Tile\":\n drawId = 1002;\n break;\n case \"Entity\":\n drawId = 1001;\n break;\n\n case \"EntityCreature\":\n drawId = 1004;\n break;\n }\n } else if (this.map.interacts[k].action[j].type == \"meta\"){\n drawId = 1003;\n }\n\n\n getSprite(drawId).drawBackground(x, y, this.canvas, this.cw, this.ch);\n\n }\n }\n\n\n }", "title": "" }, { "docid": "d4324a1fe07972106461e7ee65553299", "score": "0.59998834", "text": "function initMap() {\n worldMap = new google.maps.Map(document.querySelector('#mapMain'), {\n center : {lat: 30.0599153, lng: 31.262019913},\n zoom: 1\n });\n }", "title": "" }, { "docid": "816006e072fd6c9b17066ec678290ca9", "score": "0.59956706", "text": "function GameMap(rows, cols){\n this.rows = rows;\n this.cols = cols;\n // Create 2d Array representation of the map\n this.grid = new Array(rows);\n for(var i = 0; i < this.grid.length; i++){\n this.grid[i] = new Array(cols);\n for(var j = 0; j<cols; j++){\n this.grid[i][j] = CELL_EMPTY;\n }\n }\n // Clear the map\n ctx.clearRect(0,0,width,height);\n // Initialize an array of player objects\n this.players = new Array();\n // Initialize an array of block objects\n this.blocks = new Array();\n}", "title": "" }, { "docid": "4776dcea9d5055892d188aed24540e44", "score": "0.59876126", "text": "function initMap(gameLocation) {\n // The location of the games*/\n // The map, centered at the location\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 18, center: gameLocation, mapTypeId: google.maps.MapTypeId.SATELLITE});\n // The marker, positioned at the game location\n var marker = new google.maps.Marker({position: gameLocation, map: map});\n \n }", "title": "" }, { "docid": "0fc45d4223e11b802d064c549a22da95", "score": "0.5978842", "text": "renderMap() {\n\t\tlet block = this.state.blockProps;\n\t\tfor(var i=0; i<block.length; i++){\n\t\t\tthis.state.blockProps[i][1] = this.state.maps[this.state.curMap][i];\n\t\t}\n\t\tthis.setState(this.state);\n\t\tthis.createRandomMap();\n\t}", "title": "" }, { "docid": "a6d155719baca895d2a346a80b9915f5", "score": "0.59617656", "text": "function create() {\n \n // King -Player Sprite and spawn location x, y\n \n\n\n\n this.cameras.main.zoom = 4;\n this.cameras.main.roundPixels = true;\n\n let mbg = this.add.image(0, 0, 'skymid');\n let bbg = this.add.image(0, 0, 'skyback');\n let fbg = this.add.image(0, 0, 'skyfore');\n // Align.scaleToGameW(bg, 2);\n \n \n var map = this.make.tilemap({key: 'map'});\n \n\n const tileSet = map.addTilesetImage('CleanedTileSet', 'TILESET', 16, 16, 0, 0 );\n // const tileset = map.addTilesetImage(\"tileset\", \"tileset-extruded\", 48, 48, 1, 2);\n // const backgroundLayer = map.createStaticLayer('Background', tileset, 0, 0);\n // const interactiveLayer = map.createLayer('Interactive', tileset, 0, 0);\n\n // createFromObjects(layerName, {\n // name: \"sign\"\n // })\n\n // Place Pictures in order to have them display correctly\n var backgrounds = map.createLayer('background', tileSet, 0, 0); \n \n \n player = this.physics.add.sprite(570, 2750, 'king');\n\n var midgrounds = map.createLayer('Tile Layer 1', tileSet, 0, 0);\n midgrounds.setCollisionByProperty({ Collision: true })\n\n\n var foregrounds = map.createLayer('foreground', tileSet, 0, 0);\n \n\n\n \n // this.player.setDepth(2)\n // midgrounds.setDepth(2)\n // foregrounds.setDepth(1)\n // backgrounds.setDepth(3)\n// this.physics.world.bounds.width = groundLayer.width;\n// this.physics.world.bounds.height = groundLayer.height;\n\n this.add.image(600, 250, 'cloud1');\n this.add.image(700, 150, 'cloud2');\n this.add.image(750, 400, 'cloud3');\n this.add.image(300, 450, 'cloud4');\n\n // platforms = this.physics.add.staticGroup();\n // clouds = this.physics.add.staticGroup();\n\n // platforms.create(400, 568, 'ground').setScale(2).refreshBody();\n \n\n\n // movingPlatform = this.physics.add.image(400, 400, 'ground');\n // movingPlatform.setImmovable(true);\n // movingPlatform.body.allowGravity = false;\n // movingPlatform.setVelocityX(50);\n\n // clouds.create(500, 668, 'cloud1').setScale(2).refreshBody();\n \n // movingClouds = this.physics.add.image(500, 250, 'cloud1');\n // movingClouds.setImmovable(true);\n // movingClouds.body.allowGravity = false;\n // movingClouds.setVelocityX(50);\n \n\n\n \n this.cameras.main.setBounds(0, 0, map.widthInPixels, map.heightInPixels);\n this.cameras.main.roundPixels = true;\n this.cameras.main.startFollow(player)\n \n this.physics.add.collider(player, midgrounds);\n this.physics.add.staticGroup()\n \n\n this.anims.create({\n \n key: 'left',\n frames: this.anims.generateFrameNumbers('king', { start: 1, end: 4 }),\n frameRate: 10,\n repeat: -1\n \n });\n\n this.anims.create({\n key: 'turn',\n frames: [{ key: 'king', frame: 5 }],\n frameRate: 10\n });\n this.anims.create({\n key: 'jump',\n frames: [{ key: 'king', start: 6, end: 10 }],\n frameRate: 10\n });\n\n this.anims.create({\n key: 'right',\n frames: this.anims.generateFrameNumbers('king', { start: 1, end: 4 }),\n frameRate: 10,\n repeat: -1\n });\n\n cursors = this.input.keyboard.createCursorKeys();\n\n bolt1 = this.physics.add.group({\n key: 'bolt1',\n repeat: 1,\n setXY: { x: 500, y: 0, stepX: 70 }\n });\n\n bolt2 = this.physics.add.group({\n key: 'bolt2',\n repeat: 1,\n setXY: { x: 700, y: 0, stepX: 70 }\n });\n\n bolt1.children.iterate(function (child) {\n\n child.setBounceY(Phaser.Math.FloatBetween(0.1, 0.2));\n\n });\n\n bolt2.children.iterate(function (child) {\n\n child.setBounceY(Phaser.Math.FloatBetween(0.1, 0.2));\n\n });\n\n // this.physics.add.collider(bolt1, midgrounds);\n \n this.physics.add.collider(bolt1, midgrounds);\n this.physics.add.collider(bolt1, player, collectBolt1);\n\n this.physics.add.collider(bolt2, midgrounds);\n this.physics.add.collider(bolt2, player, collectBolt2);\n // this.physics.add.collider(bolt, movingPlatform);\n\n// this.physics.add.overlap(player, bolt, collectBolt, null, this);\n// theme = this.sound.add(\"theme\");\n// theme.play({\n// volume: 0.2,\n// loop: true\n// });\n\n\n\n\n// boltCollect(game)\n// function boltCollect(game) {\n \n // var bolt= game.data.immovable = game.add.sprite(game.world.centerX - 32, game.world.centerY - 32, 'blocks', 0);\n // imm.width = 64;\n // imm.height = 64;\n\n // // enable physics and set immovable\n // game.physics.enable(imm);\n // imm.body.immovable = true;\n // \n // bolt.disableBody(true, true)\n\n\n\n\n\n // };\n}", "title": "" }, { "docid": "a6efd7f11a4d29eaa7dc2803dc79b166", "score": "0.59471697", "text": "function init() {\n mapWidth = map[0].length;\n mapHeight = map.length;\n\n bindKeys();\n drawMiniMap();\n}", "title": "" }, { "docid": "58b9e43880f40c7c0dfc855da016c5f1", "score": "0.59413785", "text": "function drawWorld() {\n let output = \"\";\n for (var i = 0 ; i < world.length ; i++) {\n output += \"<div class='row'>\";\n for (var j = 0 ; j < world[i].length ; j++) {\n output += \"<div class='\" + blockType[world[i][j]] + \"'></div>\"\n }\n output += \"</div>\";\n }\n worldMap.innerHTML = output;\n}", "title": "" }, { "docid": "21428517d130047ad62def11bc76c037", "score": "0.5939773", "text": "function WorldMap(name) {\n this.name = name;\n this.raw = null;\n this.size = {width: 0, height: 0};\n }", "title": "" }, { "docid": "00cfe83d3f23dff3b54ca6c93e0e7f91", "score": "0.5939559", "text": "function initMap(){\n\t //create the baidu map\n createMap(5,15);\n\t //set map's events\n setMapEvent();\n\t //add the controls to baidu map\n addMapControl();\n\t \n }", "title": "" }, { "docid": "bd5ec59ee28eb0add7fd26192889c7fc", "score": "0.5928679", "text": "function GameMap(config)\r\n{\r\n\tthis.config = config;\r\n\t\r\n\tthis.gameViewer = null;\r\n\t\r\n\tthis.bounding = null;\r\n\tthis.view = null;\r\n\tthis.birthPlace = null;\r\n\t\r\n\tthis.id = \"\";\r\n\tthis.name = \"\";\r\n\t\r\n\tthis.images = null;\r\n\tthis.sceneLight = null;\r\n\t\r\n\tthis.objects = null;\r\n\t\r\n\tthis.resetMap();\r\n}", "title": "" }, { "docid": "6f4b07781532a138e3d2e91334dc5a2d", "score": "0.59057796", "text": "createSprite() {\n this.sprite = this.game.add.sprite(0, 0, 'map-startlocation');\n this.sprite.anchor.set(0.5);\n this.sprite.alpha = 0.75;\n this.sprite.scale.set(0.5);\n this.sprite.tint = PLAYER_MANAGER_COLORS[this.id - 1];\n this.add(this.sprite);\n }", "title": "" }, { "docid": "03f87e37657b7cb0995bc1142992ec59", "score": "0.59049165", "text": "function goToMap() {\n\t//console.log(\"goToMap\");\n\tgetHivesCoordinates(initializeMap);\n\ttransition(_(\"pmap\"), \"\"); //display the map\n}", "title": "" }, { "docid": "a814617bf0d8b84e099da670745395bb", "score": "0.5897926", "text": "function initMap() {}", "title": "" }, { "docid": "3f223445497bad3115753f14d89aaa67", "score": "0.5881748", "text": "function initMap() {\n\t\tmap = new google.maps.Map(document.getElementById('googleMap'), {\n\t\t\tzoom: 13,\n\t\t\tcenter: {lat: 60.4502, lng: 22.276} //centered on Turku\n\t\t});\n\t}", "title": "" }, { "docid": "03ca355f8aa65eb30f91833b986dbd3f", "score": "0.58803576", "text": "function DrawMap() {\r\n gl.useProgram(shaderProgram);\r\n var cur_map = GameData.maps[GameState.location.map];\r\n var cur_tileset = GameData.tilesets[cur_map.tileset];\r\n var border_tile = cur_tileset[cur_tileset.border][0];\r\n mvPushMatrix();\r\n var x_offset = -GameState.location.camera_x; var y_offset = -GameState.location.camera_y;\r\n if (cur_map.clamp) {\r\n var c;\r\n if (cur_map.clamp == \"Standard\") {c = 0;}\r\n\telse {c = cur_map.clamp;}\r\n if (x_offset > -32*(9-c)) {x_offset = -32*(9-c)}\r\n\tif (y_offset > -32*(7-c)) {y_offset = -32*(7-c)}\r\n\tif (x_offset < -32*(cur_map.tiles[0].length-10+c)) {x_offset = -32*(cur_map.tiles[0].length-10+c);}\r\n\tif (y_offset < -32*(cur_map.tiles.length-8+c)) {y_offset = -32*(cur_map.tiles.length-8+c);}\r\n }\r\n mat4.translate(mvMatrix, [x_offset, y_offset, 0]);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, rectBuffer);\r\n for (var x = -11-Math.floor(x_offset/32); x < 12-Math.floor(x_offset/32); x++) { // Draw panels\r\n for (var y = -9-Math.floor(y_offset/32); y < 10-Math.floor(y_offset/32); y++) {\r\n\t if (y < 0 || y >= cur_map.tiles.length || x < 0 || x >= cur_map.tiles[y].length) { // Draw tiles off the map\r\n \tDrawBorder(x,y,cur_map.tiles[0].length,cur_map.tiles.length,border_tile,cur_map.border,cur_tileset)\r\n\t }\r\n\t else {\r\n\t var tile = cur_tileset[cur_map.tiles[y][x]][0];\r\n\t\tDrawImage32({x:304+32*x, y:224+32*y, image:tile});\r\n\t }\r\n\t}\r\n }\r\n for (var obj in cur_map.objects) {if (cur_map.objects[obj].Display) {cur_map.objects[obj].Display();}}\r\n DrawHero();\r\n mvPopMatrix();\r\n}", "title": "" }, { "docid": "abcb277e162b1a12c3b78dc7ec90df14", "score": "0.58720875", "text": "function initializeAdminMap(latitude, longitude, playingFieldUpperLeftLatitude, playingFieldUpperLeftLongitude, playingFieldLowerRightLatitude, playingFieldLowerRightLongitude) {\n\t// 52.39353, 13.13138\n var latlng = new google.maps.LatLng(latitude, longitude);\n var myOptions = {\n\t\tzoom: 19,\n \tcenter: latlng,\n\t \tdisableDefaultUI: true,\n\t \tdisableDoubleClickZoom: true,\n\t\tdraggable: false,\n\t\tscrollwheel: false,\n \tmapTypeId: google.maps.MapTypeId.ROADMAP\n };\n \n\tmap = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n\t\n\tsouthWestLatLng = new google.maps.LatLng(playingFieldLowerRightLatitude, playingFieldUpperLeftLongitude);\n\tnorthEastLatLng = new google.maps.LatLng(playingFieldUpperLeftLatitude, playingFieldLowerRightLongitude);\n\tplayingFieldBounds = new google.maps.LatLngBounds(southWestLatLng, northEastLatLng);\n\t\n\tvar rectOptions = {\n\t\tstrokeColor: \"#FF0000\",\n\t\tstrokeOpacity: 0.8,\n\t\tstrokeWeight: 2,\n\t\tfillOpacity: 0,\n\t\tmap: map,\n\t\tbounds: playingFieldBounds,\n\t\tclickable: false,\n\t\tzIndex: 1\n\t};\n\n\tplayingField = new google.maps.Rectangle(rectOptions);\n\t\n\tgetItems();\n\tgetPlayers();\n\twindow.setInterval(\"getItems()\", 3000);\n\twindow.setInterval(\"getPlayers()\", 3000);\n}", "title": "" }, { "docid": "37cbc3de6053838732982ca90ce24fb5", "score": "0.58707017", "text": "function drawMap(){\n\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\t\tcontext.fillStyle = \"lightgrey\";\n\t\tcontext.fillRect(-500, -250, 1000, 500);\n\t\tcontext.fillStyle = \"black\";\n\t\tcontext.font = \"20px Cambria\";\n\t}", "title": "" }, { "docid": "09626de8ea2b3ed9114ac4b664ce8a94", "score": "0.5868492", "text": "function loadGameMap() {\n // Sets current location as center of the map\n navigator.geolocation.getCurrentPosition(function(position) {\n gameMapCenter = new google.maps.LatLng(position.coords.latitude, position.coords.longitude)\n gameMap.setCenter(gameMapCenter)\n })\n\n gameMap = new google.maps.Map(document.getElementById(\"game-map\"), gameMapOptions)\n setPlayerMarker(gameMapCenter)\n //Calls the function below to load up all the map markers.\n}", "title": "" }, { "docid": "13b6058e93719b1e19933f86d1a5b73d", "score": "0.58667415", "text": "function draw_map() {\n\n hideAll();\n mirror_camera_blur();\n select('#map', HTMLElement).position(75,75);\n select('#map', HTMLElement).show();\n\n /*Commenting out previous code to work with new code */\n // if ((mouseX >= 485 && mouseX <= 585) && (mouseY >= 370 && mouseY <= 420) && mouseIsPressed) {\n // default_map = false;\n // school_map = true;\n // work_map = false;\n // }\n // else if ((mouseX >= 635 && mouseX <= 735) && (mouseY >= 370 && mouseY <= 420) && mouseIsPressed) {\n // default_map = false;\n // school_map = false;\n // work_map = true;\n // }\n //\n // if (default_map) {\n // image(default_map_img, 75, 75, 850, 350);\n // }\n // else if (school_map) {\n // image(school_map_img, 75, 75, 850, 350);\n // }\n // else if (work_map) {\n // image(work_map_img, 75, 75, 850, 350);\n // }\n //\n // fill(0);\n // noStroke();\n // rect(485, 370, 100, 50);\n // rect(635, 370, 100, 50);\n //\n // fill(255);\n // textAlign(CENTER, CENTER);\n // textSize(25);\n // textFont('Courier New');\n // text('SCHOOL', 535, 395);\n // text('WORK', 685, 395);\n\n draw_header();\n}", "title": "" }, { "docid": "d0cc72f7c1133d798d81544370686e86", "score": "0.5864962", "text": "function generateMap() {\n\n //constant describing the village\n const roads = [\n \"Alice's House-Bob's House\", \"Alice's House-Cabin\",\n \"Alice's House-Post Office\", \"Bob's House-Town Hall\",\n \"Daria's House-Ernie's House\", \"Daria's House-Town Hall\",\n \"Ernie's House-Grete's House\", \"Grete's House-Farm\",\n \"Grete's House-Shop\", \"Marketplace-Farm\",\n \"Marketplace-Post Office\", \"Marketplace-Shop\",\n \"Marketplace-Town Hall\", \"Shop-Town Hall\"\n ];\n\n let map = [];\n\n roads.map(roadString => {\n return roadString.split(\"-\");\n })\n .forEach(road => {\n const start = road[0];\n const end = road[1];\n\n map = mapWithAddedConnection(start, end, map);\n map = mapWithAddedConnection(end, start, map);\n });\n\n map = replaceNeighbourStringsWithNeighbourObjects(map);\n\n return map;\n}", "title": "" }, { "docid": "42c2702e18f4f20af865fcaa40ea0b80", "score": "0.5851818", "text": "function createMap(){ \n document.write(\"<table>\"); \n \n for( var y = 0; y < height; y++){ \n document.write(\"<tr>\"); \n for( var x = 0; x < width; x++){ \n if(x == 0 || x == width -1 || y == 0 || y == height - 1){ \n document.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\"); \n } \n\t\t\telse{ \n\t\t\t\tif(x==12 && y==2){\n\t\t\t\t\tdocument.write(\"<td class='unlock' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif((x>=1 && x<=14) && y==4){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif((y>=1 && y<=3) && x==14){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif((x>=1 && x<=3) && y==24){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif(x==4 && (y ==24 || y==25 || y==26 || y==27)){\n\t\t\t\t\tdocument.write(\"<td class='wall' id='\"+ x + \"-\" + y +\"'></td>\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tdocument.write(\"<td class='blank' id='\"+ x + \"-\" + y +\"'></td>\"); \n\t\t\t\t}\n }\n\t\t\t\n } \n document.write(\"</tr>\"); \n } \n document.write(\"</table>\"); \n\t\n}", "title": "" }, { "docid": "6b5c963ad577e227994aeffc20f7d548", "score": "0.5847028", "text": "function dispMap() {\n for (var i = 0; i < 30; i++) {\n for (var y = 0; y < 30; y++) {\n dispTile(tilesheet, 32 * i + xOffSet, 32 * y + yOffSet);\n }\n }\n}", "title": "" }, { "docid": "10771816bb29cade1fa7095fcb68fb5b", "score": "0.58356005", "text": "function Map(mapIndex) {\n\tthis.collisionMap = new CollisionArea();\n\tthis.entities = [];\n\tthis.highestID = 0;\n\tthis.tiles;\n\t\n\tthis.tileSheetCanvas;\n\tthis.tileSheetCtx;\n\t\n\tthis.tileImg;\t\n\tthis.tileHeight;\n\tthis.tileWidth;\n\tthis.tilesPerRow;\n\t\n\tthis.mapWidth;\n\tthis.active = mapIndex;\n\t\n\tthis.loadMap(mapIndex);\n\n}", "title": "" }, { "docid": "17f2b5aced4dc2dda8fa34b138fde886", "score": "0.58343875", "text": "function TileMap()\n{\n\tthis.map\t= [];\n\tthis.w\t\t= 0;\n\tthis.h\t\t= 0;\n\t/*this.objMap = [];\n\tthis.ow = 0;\n\tthis.oh = 0;*/\n\tthis.levels\t= 4;\n}", "title": "" }, { "docid": "9cba2fa35b010e07c980546b3746931a", "score": "0.58328193", "text": "function createMap(user) {\n // map object. '_id' value set further on, here.\n var mapObj = constructor.map();\n \n // Get the map with the highest id value.\n mapsdb.findOne({}, { 'fields': { '_id': 1 }, 'limit': 1, 'sort': { '_id': -1 } }, function (err, doc) {\n if (err) {\n console.log(err);\n return;\n }\n \n // id is 0 for first item, or last id + 1 for new id value.\n mapObj['_id'] = (!doc ? 0 : doc['_id'] + 1);\n \n // Refer map into the world.maps object.\n world.maps[mapObj['_id']] = mapObj;\n \n // Update user object.\n user.player.map = mapObj['_id'];\n \n // Create first room at 0x0y0z.\n createRoom(0, 0, 0, user);\n \n // Update DB immediately.\n saveMap(mapObj);\n \n // Inform the user about the map's ID.\n if (mapObj['_id'] == 0) {\n socketHandler(user, 'info', 'The first map of this world has been created successfully!');\n } else {\n socketHandler(user, 'info', 'Map #' + mapObj['_id'] + ' has been created successfully.');\n }\n });\n}", "title": "" }, { "docid": "519664a4d4a1f8720e1e70da23088eb7", "score": "0.58326733", "text": "function draw_map () {\n\tgl.useProgram (shader_progs[0]);\n\tif (cam_dirty) {\n\t\tgl.uniformMatrix4fv (map_PV_loc, gl.FALSE, new Float32Array (PV));\n\t}\n\tgl.activeTexture (gl.TEXTURE0);\n\tgl.bindTexture (gl.TEXTURE_2D, map_tex);\n\tvao_ext.bindVertexArrayOES (quad_vao);\n\tgl.drawArrays (gl.TRIANGLE_STRIP, 0, 4);\n}", "title": "" }, { "docid": "286a545cd9d1f2cf7f0e90b0ec3baa34", "score": "0.58321154", "text": "function minimap(){\n var W = 20; //TODO Abstract\n for (var i=max(Character.y-20,0);i<min(Character.y+20, size);i++){\n for (var j=max(Character.x-20,0);j<min(Character.x+20, size);j++){\n writeTileGeneric(j-screenX+220, i-screenY+300, 2, map[j][i], seen[j][i], true, true);\n }\n }\n\n for (i in monsters){\n if (Character.revealm){\n writeTileGeneric(monsters[i].x-screenX+220, monsters[i].y-screenY+300, 2, \"j\", true, true);\n }\n }\n\n for (i in items){\n if (Character.reveali){\n try { \n writeTileGeneric(items[i].x-screenX+220, items[i].y-screenY+300, 2, \"?\", true, true);\n } catch(e) {\n debugger;\n }\n }\n }\n wTile(7*W+Character.x - screenX,6*W+ Character.y - screenY, \"ff\", \"ff\", \"ff\", 2);\n\n if (keys[27]){\n showMap = false;\n }\n }", "title": "" }, { "docid": "a03b93566d953d77c085d33d38902cf6", "score": "0.58243257", "text": "function initMap() {\n // define map and render it into the map div\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 40.7501481,\n lng: -111.8665667\n },\n zoom: 1,\n maxZoom: 17,\n backgroundColor: '#af9a6b',\n styles: styles,\n mapTypeId: 'terrain',\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n position: google.maps.ControlPosition.TOP_RIGHT\n }\n });\n // define bounds\n bounds = new google.maps.LatLngBounds();\n // define largeInfowindow\n largeInfowindow = new google.maps.InfoWindow();\n // create ALL map markers on map when loaded\n createMarkers();\n}", "title": "" }, { "docid": "f5c3a2ccf9b723cbedb22ed6db5c2118", "score": "0.5819214", "text": "function generateMapId () {\n\t\treturn 'mapbox-gl-map-' + Date.now();\n\t}", "title": "" }, { "docid": "2198484c4f533af1b2ea903a5b5a1868", "score": "0.5817696", "text": "function createMapContainer(){\n var mapLoc = document.querySelectorAll(\"body .nav-menu-style-images\")[0];\n var mapContainer = document.createElement(\"div\");\n mapContainer.id = \"map\";\n mapContainer.style = \"width: 60em; height: 65em\";\n mapLoc.appendChild(mapContainer);\n }", "title": "" }, { "docid": "f9f3c71db6832819ce6e405e48c6534a", "score": "0.58171576", "text": "function Map(sx, sy, bx, by, m)\r\n{\r\n\tThis.spawnx = sx;\r\n\tThis.spawny = sy;\r\n\tThis.basex = bx;\r\n\tThis.basey = by;\r\n\tThis.matrix = m;\r\n}", "title": "" }, { "docid": "8871c876ae4f2df916eab49d4afc5333", "score": "0.5813187", "text": "function createMap() {\n\n boydMap = L.map('map', {\n center: [73, -27],\n zoom: 9,\n maxZoom: 13 // Esri World Imagery basemap doesn't work past this zoom level -- consider looking for another basemap? (Custom one from Mapbox?)\n });\n\n // add OSM baselayer\n L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}').addTo(boydMap);\n\n // call getData function\n getData(boydMap);\n\n}", "title": "" }, { "docid": "770027924ec8fd56c9b3e120fc2cb691", "score": "0.5810597", "text": "draw() {\n translate(this.xOffset, this.yOffset);\n background(color('black'));\n image(this.gameMapImg, 0, 0);\n }", "title": "" }, { "docid": "2bad07e30abb4157182b0ca2a80decac", "score": "0.5799844", "text": "createGameMapImg() {\n let gameImg = createGraphics(this.width * this.boxSize, this.height * this.boxSize);\n\n gameImg.background(color('#bcaaa4'));\n\n gameImg.textSize(30);\n gameImg.textAlign(CENTER, CENTER);\n gameImg.text(\"The School At the night\", 10 * this.boxSize, 0 * this.boxSize, 9 * this.boxSize, 2 * this.boxSize);\n gameImg.textSize(15);\n gameImg.text(\"Tu tío olvidó pasar por ti. Ahora estás atrapado en la escuela. Si quisieres escapar, busca el portal verde usando las flechas o el control en pantalla antes que se acabe el tiempo. Buena suerte!\",\n 11 * this.boxSize, 2 * this.boxSize, 7 * this.boxSize);\n\n for (let component of this.components) {\n gameImg.image(component.img, component.x * this.boxSize, component.y * this.boxSize, component.width * this.boxSize, component.height * this.boxSize)\n }\n return gameImg;\n }", "title": "" }, { "docid": "74e3979b978e1c60de629de0f02872fb", "score": "0.5797857", "text": "generateMap() { //10, 10, 0.35 gives good results\n let mapArray = [];\n\n // calculate map parameters\n let numberOfItems = this.rows * this.cols; //zb 100\n let numberOfHoles = Math.floor(numberOfItems * this.percentHoles); // 30\n let emptyFields = numberOfItems - numberOfHoles - 2; // 68\n\n // generate initial array with all map fields\n let initialArray = [this.player, this.treasure];\n for (let i = 0; i < numberOfHoles; i++) {\n initialArray.push(this.hole);\n }\n for (let i = 0; i < emptyFields; i++) {\n initialArray.push(this.field);\n }\n\n // shuffle array with map elements\n function shuffle(a) {\n for (let i = a.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [a[i], a[j]] = [a[j], a[i]];\n }\n return a;\n }\n mapArray = shuffle(initialArray);\n\n // splice initial array into map\n function chunkify(a, n, balanced) {\n if (n < 2)\n return [a];\n var len = a.length,\n out = [],\n i = 0,\n size;\n if (len % n === 0) {\n size = Math.floor(len / n);\n while (i < len) {\n out.push(a.slice(i, i += size));\n }\n }\n else if (balanced) {\n while (i < len) {\n size = Math.ceil((len - i) / n--);\n out.push(a.slice(i, i += size));\n }\n }\n else {\n n--;\n size = Math.floor(len / n);\n if (len % size === 0)\n size--;\n while (i < size * n) {\n out.push(a.slice(i, i += size));\n }\n out.push(a.slice(size * n));\n }\n return out;\n }\n mapArray = chunkify(mapArray, this.rows, true);\n this.map = mapArray;\n }", "title": "" }, { "docid": "d0bb94141d8710899937d954d78d6182", "score": "0.5794058", "text": "function genMiniMap(srcMap) {\r\n\t// create a canvas object so we can draw our minimap image;\r\n\t// each cell on the source map is one pixel on the minimap\r\n\tconst miniCanvas = canvas.createCanvas(srcMap.width, srcMap.height);\r\n\tconst ctxt = miniCanvas.getContext(\"2d\");\r\n\r\n\t// draw the minimap\r\n\tfor (let row = 0; row < srcMap.height; row++) {\r\n\t\tfor (let col = 0; col < srcMap.width; col++) {\r\n\t\t\t// determine if we are looking at a clear or solid tile, and draw\r\n\t\t\t// the appropriate color\r\n\t\t\tconst collType = srcMap.collData[row * srcMap.width + col];\r\n\t\t\tif (collType == 0) {\r\n\t\t\t\tctxt.fillStyle = FILL_CLEAR;\r\n\t\t\t} else {\r\n\t\t\t\tctxt.fillStyle = FILL_SOLID;\r\n\t\t\t}\r\n\t\t\tctxt.fillRect(col, row, 1, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t// obtain an image buffer object from our canvas\r\n\treturn miniCanvas.toBuffer(\"image/png\");\r\n}", "title": "" }, { "docid": "658e0b4946811e6a5afd5a75c355b29f", "score": "0.5788714", "text": "function Maps() {\n this.name = \"\";\n this.ground = 3;\n this.wall_height = 25;\n this.wall_thickness = 2;\n this.objects = [];\n this.wall_texture = 0;\n this.wall2_texture = 0;\n // Object => color in obj image\n this.objects[\"Agent\"] = { r: 0xFF, g: 0x00, b: 0x00 };\n this.objects[\"Greenie\"] = { r: 0xEE, g: 0x00, b: 0x00 };\n this.objects[\"Dudo\"] = { r: 0xDD, g: 0x00, b: 0x00 };\n this.objects[\"Hearty\"] = { r: 0xCC, g: 0x00, b: 0x00 };\n this.objects[\"AgentBlack\"] = { r: 0xBB, g: 0x00, b: 0x00 };\n this.objects[\"Lamp1\"] = { r: 0x00, g: 0xFF, b: 0x00 };\n this.objects[\"Portal\"] = { r: 0x00, g: 0xEE, b: 0x00 };\n this.objects[\"RadiationSign\"] = { r: 0x00, g: 0xDD, b: 0x00 };\n this.objects[\"UfoSign\"] = { r: 0x00, g: 0xCC, b: 0x00 };\n this.objects[\"DeadHearty\"] = { r: 0x00, g: 0xBB, b: 0x00 };\n this.objects[\"BarrelFire\"] = { r: 0x00, g: 0xAA, b: 0x00 };\n this.objects[\"StreetLamp\"] = { r: 0x00, g: 0x99, b: 0x00 };\n this.objects[\"Tree\"] = { r: 0x00, g: 0x88, b: 0x00 };\n this.objects[\"PaperAgent\"] = { r: 0x00, g: 0x77, b: 0x00 };\n this.objects[\"PaperPoliceCar\"] = { r: 0x00, g: 0x66, b: 0x00 };\n this.objects[\"Barrel\"] = { r: 0x00, g: 0x55, b: 0x00 };\n this.objects[\"Player\"] = { r: 0x00, g: 0x00, b: 0xFF };\n this.objects[\"PainKillers\"] = { r: 0x00, g: 0x00, b: 0xEE };\n\n this.walls = [];\n this.width = 0;\n this.height = 0;\n // Objects loaded \n this.loaded = [];\n\n this.ambient_light = 0;\n\n Maps.prototype.reset = function() {\n for(var i = 0; i < this.loaded.length; i++) {\n if(this.loaded[i].chunk) {\n game.scene.remove(this.loaded[i].chunk.mesh);\n }\n }\n this.loaded = [];\n this.walls = [];\n game.scene.remove(this.ambient_light);\n };\n\n Maps.prototype.update = function (time, delta) {\n var t1 = 0;\n for (var i = 0; i < this.loaded.length; i++) {\n if(this.loaded[i].chunk && this.loaded[i].chunk.dirty) {\n this.loaded[i].chunk.build();\n t1 = Date.now();\n if((Date.now() - t1) > 3) {\n break;\n }\n }\n t1 = Date.now();\n if (this.loaded[i].alive) {\n if(this.loaded[i].chunk) {\n if (this.loaded[i].chunk.mesh.position.distanceTo(game.player.chunk.mesh.position) < game.visible_distance) {\n this.loaded[i].update(time, delta);\n }\n } else if(this.loaded[i].x) {\n if (new THREE.Vector3(this.loaded[i].x, this.loaded[i].y, this.loaded[i].z).distanceTo(game.player.chunk.mesh.position) < game.visible_distance) {\n this.loaded[i].update(time, delta);\n }\n } else {\n this.loaded[i].update(time, delta);\n }\n }\n if((Date.now() - t1) > 3) {\n break;\n }\n }\n };\n\n Maps.prototype.init = function (name, ground, objects) {\n this.name = name;\n var that = this;\n\n // Load ground\n loadImageFile(ground, function (data, width, height, map) {\n that.width = width;\n that.height = height;\n var walls = [];\n var floor = [];\n var wall_map = new Array(width);\n for (var x = 0; x < width; x++) {\n wall_map[x] = new Array(height);\n }\n\n for (var x = 0; x < map.length; x++) {\n for (var z = 0; z < map[x].length; z++) {\n var p = map[x][z];\n if (p.a == 0) { continue; }\n\n // Black will dissapear in chunk algo.\n if (p.r == 0 && p.g == 0 && p.b == 0) {\n p.r = 1;\n p.g = 1;\n p.b = 1;\n }\n var wall_thickness = game.maps.wall_thickness;\n var wall_height = game.maps.wall_height;\n\n if(p.r == 0x22 && p.g == 0x22 && p.b == 0x22) {\n for (var y = 0; y < wall_height; y++) {\n var pix = game.textures.getPixel(y, x, that.wall2_texture);\n walls.push({ x: x, y: y, z: z, r: pix.r, g: pix.g, b: pix.b });\n wall_map[x][z] = 1;\n }\n }\n\n if (map[x + 1][z].a == 0) {\n for (var y = 0; y < wall_height; y++) {\n var pix = game.textures.getPixel(y, z, that.wall_texture);\n for (var xx = 0; xx < wall_thickness; xx++) {\n walls.push({ x: x + xx, y: y, z: z, r: pix.r, g: pix.g, b: pix.b });\n walls.push({ x: x + xx, y: y, z: z - 1, r: pix.r, g: pix.g, b: pix.b });\n walls.push({ x: x + xx, y: y, z: z + 1, r: pix.r, g: pix.g, b: pix.b });\n wall_map[x + xx][z - 1] = 1;\n wall_map[x + xx][z + 1] = 1;\n wall_map[x + xx][z] = 1;\n }\n }\n }\n if (map[x - 1][z].a == 0) {\n for (var y = 0; y < wall_height; y++) {\n var pix = game.textures.getPixel(y, z, that.wall_texture);\n for (var xx = 0; xx < wall_thickness; xx++) {\n walls.push({ x: x - xx, y: y, z: z, r: pix.r, g: pix.g, b: pix.b });\n walls.push({ x: x - xx, y: y, z: z - 1, r: pix.r, g: pix.g, b: pix.b });\n wall_map[x - xx][z - 1] = 1;\n wall_map[x - xx][z] = 1;\n }\n }\n }\n if (map[x][z + 1].a == 0) {\n for (var y = 0; y < wall_height; y++) {\n var pix = game.textures.getPixel(y, x, that.wall_texture);\n for (var zz = 0; zz < wall_thickness; zz++) {\n walls.push({ x: x - 1, y: y, z: z + zz, r: pix.r, g: pix.g, b: pix.b });\n walls.push({ x: x, y: y, z: z + zz, r: pix.r, g: pix.g, b: pix.b });\n wall_map[x - 1][z + zz] = 1;\n wall_map[x][z + zz] = 1;\n }\n }\n }\n if (map[x][z - 1].a == 0) {\n for (var y = 0; y < wall_height; y++) {\n var pix = game.textures.getPixel(y, x, that.wall_texture);\n for (var zz = 0; zz < wall_thickness; zz++) {\n walls.push({ x: x - 1, y: y, z: z - zz, r: pix.r, g: pix.g, b: pix.b });\n walls.push({ x: x, y: y, z: z - zz, r: pix.r, g: pix.g, b: pix.b });\n wall_map[x][z - zz] = 1;\n wall_map[x - 1][z - zz] = 1;\n }\n }\n }\n\n // Draw floor\n for (var y = 0; y < game.maps.ground; y++) {\n floor.push({ x: x, y: y, z: z, r: p.r, g: p.g, b: p.b });\n }\n }\n }\n\n // Find floor and create chunks for it.\n var total_chunks = 0;\n while (true) {\n var x = 0;\n var z = 0;\n var found = false;\n for (x = 0; x < width; x++) {\n for (z = 0; z < height; z++) {\n if (map[x][z].a != 0) {\n found = true;\n break;\n }\n }\n if (found) break;\n }\n if (!found) {\n break;\n }\n // We found a wall position.\n // Get how far on X the wall is.\n var max_x = 0;\n var max_z = 1000;\n var found = false;\n var max_width = 20;\n var max_height = 20;\n for (var x1 = 0; x + x1 < width && x1 < max_width; x1++) {\n if (map[x + x1][z].a != 0) {\n max_x++;\n // Check Z\n var mz = 0;\n for (var z1 = 0; z + z1 < height && z1 < max_height; z1++) {\n if (map[x + x1][z + z1].a != 0) {\n mz++;\n } else {\n break;\n }\n }\n if (mz < max_z) {\n max_z = mz;\n }\n } else {\n break;\n }\n }\n for (var x_ = x; x_ < x + max_x; x_++) {\n for (var z_ = z; z_ < z + max_z; z_++) {\n map[x_][z_].a = 0;\n }\n }\n\n // Now find all blocks within the range.\n var chunk = new Chunk(x, 0, z, max_x, game.maps.ground, max_z, \"floor\", 1, \"world\");\n chunk.init();\n for (var i = 0; i < floor.length; i++) {\n if (floor[i].x >= x && floor[i].x < x + max_x &&\n floor[i].z >= z && floor[i].z < z + max_z) {\n chunk.addBlock(floor[i].x, floor[i].y, floor[i].z, floor[i].r, floor[i].g, floor[i].b);\n }\n }\n\n //chunk.addBatch();\n game.world.addChunk(chunk);\n }\n\n\n // Find wall and create chunks for them.\n while (true) {\n var x = 0;\n var z = 0;\n var found = false;\n for (x = 0; x < width; x++) {\n for (z = 0; z < height; z++) {\n if (wall_map[x][z] == 1) {\n found = true;\n break;\n }\n }\n if (found) break;\n }\n if (!found) {\n break;\n }\n // We found a wall position.\n // Get how far on X the wall is.\n var max_x = 0;\n var max_z = 1000;\n var found = false;\n var max_width = 20;\n var max_height = 20;\n for (var x1 = 0; x + x1 < width && x1 < max_width; x1++) {\n if (wall_map[x + x1][z] == 1) {\n max_x++;\n // Check Z\n var mz = 0;\n for (var z1 = 0; z + z1 < height && z1 < max_height; z1++) {\n if (wall_map[x + x1][z + z1] == 1) {\n mz++;\n } else {\n break;\n }\n }\n if (mz < max_z) {\n max_z = mz;\n }\n } else {\n break;\n }\n }\n for (var x_ = x; x_ < x + max_x; x_++) {\n for (var z_ = z; z_ < z + max_z; z_++) {\n wall_map[x_][z_] = 0;\n }\n }\n\n // Now find all blocks within the range.\n // 0.01 = offset so we don't see black borders on the floor.\n var chunk = 0;\n if (max_x > max_z) {\n chunk = new Chunk(x - wall_thickness, that.ground, z - wall_thickness, max_x + wall_thickness, wall_height, max_z + wall_thickness, \"x\", 1, \"world\");\n } else {\n chunk = new Chunk(x - wall_thickness, that.ground, z, max_x + wall_thickness, wall_height, max_z + wall_thickness, \"x\", 1, \"world\");\n }\n chunk.init();\n for (var i = 0; i < walls.length; i++) {\n if (walls[i].x >= x && walls[i].x <= x + max_x &&\n walls[i].z >= z && walls[i].z <= z + max_z) {\n chunk.addBlock(walls[i].x, walls[i].y + that.ground, walls[i].z, walls[i].r, walls[i].g, walls[i].b);\n }\n }\n //chunk.addBatch();\n game.world.addChunk(chunk);\n }\n\n // Load objects + enemies + player\n loadImageFile(objects, function (data, width, height) {\n var list = [];\n for (var i = 0; i < data.length; i++) {\n if (data[i].a == 0) { continue; }\n var found = 0;\n for (var k in that.objects) {\n if (data[i].r == that.objects[k].r && data[i].g == that.objects[k].g && data[i].b == that.objects[k].b) {\n var o = new window[k]();\n o.create(data[i].y, 0, data[i].x);\n that.loaded.push(o);\n if (k == \"Player\") {\n game.player = o;\n }\n found = 0;\n }\n if (found) { break; }\n }\n }\n });\n });\n\n };\n}", "title": "" } ]
1e35ed751b079e57911952de708fd918
(protected) return x s.t. r^x < DV
[ { "docid": "0917058b298b138879582679ce383382", "score": "0.0", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" } ]
[ { "docid": "5f04847f058474244abc6954421fc5b9", "score": "0.650587", "text": "xCond(v) {\n return (\n this.p1.x > this.p2.x ?\n v < this.p1.x :\n this.p1.x < this.p2.x ?\n v > this.p1.x :\n true // in case it's horizontal only yCond\n )\n }", "title": "" }, { "docid": "1b3329a73b51481fe64e35fd4b5a234c", "score": "0.6016341", "text": "checkX() {\n if (validate.checkIfValidInput(this.x) === true && validate.isDecimal === false) {\n if (this.x < 1) return 1;\n return 3;\n }\n return 2;\n }", "title": "" }, { "docid": "c9723283e846849070661fbf1ac10f06", "score": "0.5914722", "text": "xLength() { const a = this.high.x - this.low.x; return a > 0.0 ? a : 0.0; }", "title": "" }, { "docid": "c9723283e846849070661fbf1ac10f06", "score": "0.5914722", "text": "xLength() { const a = this.high.x - this.low.x; return a > 0.0 ? a : 0.0; }", "title": "" }, { "docid": "2e62ae50a3df65226e200ffd1d302649", "score": "0.58339727", "text": "function mudapegog(x,x1,x2){\r\n if((x>=1)&&(x1>=1)&&(x2>=1))\r\n return 1\r\n else\r\n return 0\r\n }", "title": "" }, { "docid": "16842b70e271536a918d84bd368a276d", "score": "0.5797341", "text": "function tx(x){\n\t\tvar xx = (x-xmin)/(xmax-xmin)*(XMAX-XMIN)+XMIN;\n\t\treturn xx;\n\t}", "title": "" }, { "docid": "c012eec29e020a6cc995266331b0c235", "score": "0.57800007", "text": "get vx() {\n\t\treturn this.x + this.dx + this.z * Z_RATIO * Z_X;\n\t}", "title": "" }, { "docid": "dae9fd760a080fdcad34c90a1aaf7823", "score": "0.5756455", "text": "function getX(d) {\n return Math.round(x(d)) + x.rangeBand() / 2;\n }", "title": "" }, { "docid": "dae9fd760a080fdcad34c90a1aaf7823", "score": "0.5756455", "text": "function getX(d) {\n return Math.round(x(d)) + x.rangeBand() / 2;\n }", "title": "" }, { "docid": "4d733da07910a60c27146e69fc2d53a0", "score": "0.57427627", "text": "function erfc(x) {\n\tvar z = Math.abs(x);\n\tvar t = 1 / (1 + z / 2);\n\tvar r = t * Math.exp(-z * z - 1.26551223 + t * (1.00002368 +\n\t t * (0.37409196 + t * (0.09678418 + t * (-0.18628806 +\n\t t * (0.27886807 + t * (-1.13520398 + t * (1.48851587 +\n\t t * (-0.82215223 + t * 0.17087277)))))))))\n\treturn x >= 0 ? r : 2 - r;\n}", "title": "" }, { "docid": "92e54c9bbdf4b8a828c002fd3f4b4c31", "score": "0.5731887", "text": "function MinX() {\n return -20 ;\n}", "title": "" }, { "docid": "63b3e9c698d9c825fe92252f6f6d7daa", "score": "0.57217383", "text": "Kf(){\n\t\tif(this.SRy() > this.SRx() && this.noPly > 1){\n\t\t\treturn 0.6\n\t\t}\n\t\telse{\n\t\t\treturn 1\n\t\t}\n\t}", "title": "" }, { "docid": "f7020906f8698bcb747fcf4bc9756e51", "score": "0.56265706", "text": "function dpos(v, r) {\n var w1 = r.y - r.x, w2 = r.w - r.z, w = w1 + w2;\n var rr =\n v < r.x ? 0 : // just enough to be invisible, could be - infinity\n r.x <= v && v <= r.y ? ((v - r.x) / w) :\n r.y <= v && v <= r.z ? w1/w :\n r.z <= v && v <= r.w ? ((v - r.z + w1)/w) :\n 1.01; // just enough to be invisible, could be infinity\n return rr*2 - 1;\n}", "title": "" }, { "docid": "424dbf8bcfdd9b8e3557947b9d858ee0", "score": "0.5599658", "text": "function checkLtR(x1,x2){\n\tif(x1==x2){\n\t\treturn 0;\n\t}else if(x2>x1){\n\t\treturn 1;\n\t}else if(x2<x1){\n\t\treturn -1;\n\t}\n}", "title": "" }, { "docid": "b056dadeb1dcd3e0203ea8db88b19a72", "score": "0.5528899", "text": "function erfinv(x) {\n // beware that the logarithm argument must be\n // commputed as (1.0 - x) * (1.0 + x),\n // it must NOT be simplified as 1.0 - x * x as this\n // would induce rounding errors near the boundaries +/-1\n let w = -Math.log((1 - x) * (1 + x)),\n p;\n\n if (w < 6.25) {\n w -= 3.125;\n p = -3.6444120640178196996e-21;\n p = -1.685059138182016589e-19 + p * w;\n p = 1.2858480715256400167e-18 + p * w;\n p = 1.115787767802518096e-17 + p * w;\n p = -1.333171662854620906e-16 + p * w;\n p = 2.0972767875968561637e-17 + p * w;\n p = 6.6376381343583238325e-15 + p * w;\n p = -4.0545662729752068639e-14 + p * w;\n p = -8.1519341976054721522e-14 + p * w;\n p = 2.6335093153082322977e-12 + p * w;\n p = -1.2975133253453532498e-11 + p * w;\n p = -5.4154120542946279317e-11 + p * w;\n p = 1.051212273321532285e-09 + p * w;\n p = -4.1126339803469836976e-09 + p * w;\n p = -2.9070369957882005086e-08 + p * w;\n p = 4.2347877827932403518e-07 + p * w;\n p = -1.3654692000834678645e-06 + p * w;\n p = -1.3882523362786468719e-05 + p * w;\n p = 0.0001867342080340571352 + p * w;\n p = -0.00074070253416626697512 + p * w;\n p = -0.0060336708714301490533 + p * w;\n p = 0.24015818242558961693 + p * w;\n p = 1.6536545626831027356 + p * w;\n } else if (w < 16.0) {\n w = Math.sqrt(w) - 3.25;\n p = 2.2137376921775787049e-09;\n p = 9.0756561938885390979e-08 + p * w;\n p = -2.7517406297064545428e-07 + p * w;\n p = 1.8239629214389227755e-08 + p * w;\n p = 1.5027403968909827627e-06 + p * w;\n p = -4.013867526981545969e-06 + p * w;\n p = 2.9234449089955446044e-06 + p * w;\n p = 1.2475304481671778723e-05 + p * w;\n p = -4.7318229009055733981e-05 + p * w;\n p = 6.8284851459573175448e-05 + p * w;\n p = 2.4031110387097893999e-05 + p * w;\n p = -0.0003550375203628474796 + p * w;\n p = 0.00095328937973738049703 + p * w;\n p = -0.0016882755560235047313 + p * w;\n p = 0.0024914420961078508066 + p * w;\n p = -0.0037512085075692412107 + p * w;\n p = 0.005370914553590063617 + p * w;\n p = 1.0052589676941592334 + p * w;\n p = 3.0838856104922207635 + p * w;\n } else if (Number.isFinite(w)) {\n w = Math.sqrt(w) - 5.0;\n p = -2.7109920616438573243e-11;\n p = -2.5556418169965252055e-10 + p * w;\n p = 1.5076572693500548083e-09 + p * w;\n p = -3.7894654401267369937e-09 + p * w;\n p = 7.6157012080783393804e-09 + p * w;\n p = -1.4960026627149240478e-08 + p * w;\n p = 2.9147953450901080826e-08 + p * w;\n p = -6.7711997758452339498e-08 + p * w;\n p = 2.2900482228026654717e-07 + p * w;\n p = -9.9298272942317002539e-07 + p * w;\n p = 4.5260625972231537039e-06 + p * w;\n p = -1.9681778105531670567e-05 + p * w;\n p = 7.5995277030017761139e-05 + p * w;\n p = -0.00021503011930044477347 + p * w;\n p = -0.00013871931833623122026 + p * w;\n p = 1.0103004648645343977 + p * w;\n p = 4.8499064014085844221 + p * w;\n } else {\n p = Infinity;\n }\n\n return p * x;\n}", "title": "" }, { "docid": "f7df60e1e1e07055e44850fc152c0195", "score": "0.55284977", "text": "SRx(){\n return this.Kx*this.Lx/this.CH.RX\n }", "title": "" }, { "docid": "5a5b26a996419ac843c5d453e4339c52", "score": "0.54992676", "text": "function wedge( x ) {\n var slope = Math.sqrt(3) - 1;\n if ( x.re > 0 ) {\n var test = slope*x.re + useAsymptotic/2;\n return x.im > test || x.im < -test;\n } else {\n var test = -slope*x.re + useAsymptotic/2;\n return x.im > test || x.im < -test;\n }\n }", "title": "" }, { "docid": "52acf6cbcc919489a8b323de0fd7ec04", "score": "0.5478528", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "52acf6cbcc919489a8b323de0fd7ec04", "score": "0.5478528", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "52acf6cbcc919489a8b323de0fd7ec04", "score": "0.5478528", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "670d93ad7347526222222a4b1da145a4", "score": "0.54686695", "text": "function sign(x) {\n\treturn (x > 0) - (x < 0);\n}", "title": "" }, { "docid": "79d51f38e188663a3508e244a6830f26", "score": "0.54626805", "text": "function pointInCirOutRec() {\n var pointX = document.getElementById(\"pointX\").value;\n var pointY = document.getElementById(\"pointY\").value;\n var diametar = (pointX - 1) * (pointX - 1) + (pointY - 1) * (pointY - 1);\n\n //R(up=1, left=-1, right=5, down=-1)\n\n var result = ((diametar <= 1.5 * 1.5) && !(pointX <= 5 && pointX >= -1 && pointY <= 1 && pointY >= -1)) ? \"yes\" : \"no\";\n\n console.log(pointX + ' ' + pointY + ' ' + 'inside K & outside of R:' + ' ' + result);\n}", "title": "" }, { "docid": "cf38a4bbd7536ae0b296777cdc0e56af", "score": "0.54591554", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "cf38a4bbd7536ae0b296777cdc0e56af", "score": "0.54591554", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "cf38a4bbd7536ae0b296777cdc0e56af", "score": "0.54591554", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "25546256db5fd0c31d8ac1771fa167b0", "score": "0.54559904", "text": "function InSensor(obj)\n{\n // TODO: fine tune bound\n return true;\n return Math.abs(obj.x) < 1;\n}", "title": "" }, { "docid": "b1b77d488fa3189688e1888061104225", "score": "0.5449738", "text": "function GESTEP(x, y)\n{\n \n\n if(x>=y)\n {\n return 1;\n }\n \n\n return 0;\n}", "title": "" }, { "docid": "bbb0b34b6f09357d98df25c6c9a29095", "score": "0.54343873", "text": "lessEqual(x) {\n return ops.lessEqual(this, this.colocate(x, this.dtype));\n }", "title": "" }, { "docid": "9e11fad5e566c70c353b32b1da37f6c3", "score": "0.5422179", "text": "getMaxX(){\n return this.x.domain()[1];\n }", "title": "" }, { "docid": "7e0721e6974e92490617e85ed1175ab3", "score": "0.5415149", "text": "check_collide_x() {\r\n \r\n var check_x = Math.abs(this.item_x - this.item2_x)\r\n \r\n if (check_x <= this.range_x) {\r\n return true\r\n }\r\n return false\r\n }", "title": "" }, { "docid": "0e12af909ae0dacc74d98517ead720d2", "score": "0.5415136", "text": "function XC(x) {\n return (x - MinX()) / (MaxX() - MinX()) * Width ;\n}", "title": "" }, { "docid": "a11d449f7c79b3f0abf538d33d62f50f", "score": "0.53791034", "text": "function constrain(x, a, b){\n if (x < a) {\n\treturn a;\n } else if (x > b) {\n\treturn b;\n } else {\n\treturn x;\n }\n}", "title": "" }, { "docid": "70a03f14ca252c13a5f921c3f6c73b18", "score": "0.5378995", "text": "less(x) {\n return ops.less(this, this.colocate(x, this.dtype));\n }", "title": "" }, { "docid": "8e8d5091750cddc413893d58cc490325", "score": "0.5377844", "text": "function VF(t, x, y)\n{\n return Strength*U*(1/(2*PI))*( -(y-0)/pow((x-(-Distance))*(x-(-Distance))+(y-0)*(y-0),3/2) -(y-0)/pow((x-Distance)*(x-Distance)+(y-0)*(y-0),3/2) );\n}", "title": "" }, { "docid": "057d691c36bf9bdbe9821624dc696e23", "score": "0.53637207", "text": "function constrain(x, L, H) {\n if (x < L) return L\n if (x > H) return H\n return x\n}", "title": "" }, { "docid": "b1e6d7b8970fc8aa9ed4ee5fb6a17c37", "score": "0.5336229", "text": "Qa(){\n let f;\n if(this.SR() <= 4.71*Math.pow(this.E/this.Fy,0.5)){\n f = Math.pow(0.658,this.Fy/this.Fe())*this.Fy\n }\n else{\n f = 0.877*this.Fe()\n }\n \n if(this.H_TW()>=1.49*Math.pow(this.E/f,0.5)){\n var be = 1.92*this.CH.TW*Math.pow(this.E/f)*(1-0.34/this.BF_2TF()*Math.pow(this.E/f,0.5))\n var Aeff = be*this.CH.TW+2*bf*this.CH.TF\n return Aeff/A\n }\n else{\n return 1; \n }\n }", "title": "" }, { "docid": "9ee903f043cce4b24b9d872397fad6d2", "score": "0.53141606", "text": "D(){\n\t\t//return (5 * this.w * Math.pow(this.L, 4) * 1728) / (384 * this.E * this.Ix)\n\t\treturn Math.max(...this.Di())\n\t}", "title": "" }, { "docid": "bc5e8598e2d10efabae5e16904d84a43", "score": "0.5311349", "text": "function leftXoverflow(x,d)\n{\n minX=x+r*cosd(d);\n for (var i=1; i<4;i++)\n {\n if (minX>x+r*cosd(90*i+d))\n {\n minX=x+r*cosd(90*i+d);\n }\n }\n return minX;\n}", "title": "" }, { "docid": "1b6b776f226b2b473d00e91ec491cfda", "score": "0.5307185", "text": "function gr(x) {\n var t = [];\n t[0] = (x > 0.5 && x <= 1);\n t[1] = (x > 1 && x <= 5);\n t[2] = (x > 5 && x <= 10);\n t[3] = (x > 10 && x <= 15);\n t[4] = (x > 15);\n return t;\n}", "title": "" }, { "docid": "e706f3a03104cb6159e1ba04da394f8b", "score": "0.53047216", "text": "Asmin(){\r\n let k1 = 3*Math.pow(this.fc,0.5)/(this.Fy)\r\n let k2 = 200/(this.Fy)\r\n return Math.min(k1,k2)*this.b*this.d()\r\n }", "title": "" }, { "docid": "4923e93504809a111134de10dcf55a6f", "score": "0.52984613", "text": "static lexicalYXLessThan(a, b) {\n if (a.y < b.y)\n return -1;\n else if (a.y > b.y)\n return 1;\n if (a.x < b.x)\n return -1;\n else if (a.x > b.x)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "6a537a6f3da8d524e1d2dc53e96f2d35", "score": "0.5295975", "text": "function getCX() { return 1.5*(x - y) }", "title": "" }, { "docid": "21d82702e4fbc5d3d9e88f7a38a70af0", "score": "0.52938765", "text": "function exactSolution(x) { return 0.1 * Math.exp(x * (50 / 3 * x * x - 36.25 * x + 25.5)); }", "title": "" }, { "docid": "085eb523ae02bca1b6cefeabfe3bbc8b", "score": "0.52816665", "text": "distanceToX(x) {\n if (this.isNull)\n return RangeBase._EXTREME_POSITIVE;\n return RangeBase.coordinateToRangeAbsoluteDistance(x, this.low, this.high);\n }", "title": "" }, { "docid": "8b49ed88ab3ae5a11cb1afd7dce32f6b", "score": "0.5281401", "text": "equChk (V) {\n return V.x === this.x && V.y === this.y\n }", "title": "" }, { "docid": "889879e75d195f2e543cb811f91b2c16", "score": "0.5278478", "text": "get r() { return Math.hypot(this.x, this.y); }", "title": "" }, { "docid": "2307697afa916fc4fd9df3db690edcad", "score": "0.52736735", "text": "function findTrueXCoord(x){\n var xCoord = firstDotXPos + (x * xDistBetweenDots);\n return xCoord;\n}", "title": "" }, { "docid": "cca340b1aea540c65eee64394e991c4a", "score": "0.5258269", "text": "Mltb(){\n\t\t\n\t\tif(this.Lu <= this.Lp()){\n\t\t\treturn 0;\n\t\t}\n\t\telse if(this.Lu < this.Lr()){\n\t\t\tvar v1 = this.Cb*(this.Mpx()-(this.Mpx()-0.7*this.Fy*this.CH.SX)*((this.Lu-this.Lp())/(this.Lr()-this.Lp())));\n\t\t\treturn Math.min(v1,this.Mpx());\n\t\t}\n\t\telse{\n\t\t\treturn Math.min(this.Fcr()*this.CH.SX,this.Mpx());\n\t\t}\n\t}", "title": "" }, { "docid": "e964dcdb57dd39efe196da76d90c8c7e", "score": "0.52581066", "text": "function collide_x(d) {\n return d.x + d.vx;\n}", "title": "" }, { "docid": "e964dcdb57dd39efe196da76d90c8c7e", "score": "0.52581066", "text": "function collide_x(d) {\n return d.x + d.vx;\n}", "title": "" }, { "docid": "e964dcdb57dd39efe196da76d90c8c7e", "score": "0.52581066", "text": "function collide_x(d) {\n return d.x + d.vx;\n}", "title": "" }, { "docid": "e2622311abe0b6df36882cedadd539c0", "score": "0.52553695", "text": "getX() {\n return 4 * this.mp.q + 2 * this.mp.r + (this.dir === east ? 1 : 0);\n }", "title": "" }, { "docid": "8807db48d70eeb130d15b81e51073e86", "score": "0.5255279", "text": "vDistance(x, y) {\n\t\tif (x instanceof Point === true) {\n\t\t\treturn this.distance(x.vx, x.vy);\n\t\t} else {\n\t\t\treturn Math.sqrt(\n\t\t\t\tMath.pow(this.vx - x, 2) + Math.pow(this.vy - y, 2)\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "a370de30b885776e775de059953d9558", "score": "0.5251738", "text": "function calculateVx(K, ne, I) {\n return K * I / ne;\n}", "title": "" }, { "docid": "cac94528a4a4dd80aee10314b73fd0ab", "score": "0.52454406", "text": "function dfdx(x, y) { return 50 * (x - 0.85) * y + 50 * (x - 0.6) * y; }", "title": "" }, { "docid": "cfa6afb699b26ae18662c06d9015a810", "score": "0.52162606", "text": "function pGreaterThanXnorm(x, m, s)\r\n{\r\n\t//finds the z value corresponding to the value entered.\r\n\tvar p = (x-m)/s;\r\n\tvar rowId;\r\n\tvar colStep1 = Math.round(p * 100);\r\n\tvar colStep2 = Math.abs(colStep1 % 10);\r\n\tvar row;\r\n\r\n\t//reads the table to find the correct probability based on the calculations made.\r\n\tif(p < 0){\r\n\t\trowId = Math.ceil(p*10)/10;\r\n\t}\r\n\telse if (p > 0){\r\n\t\trowId = Math.floor(p*10)/10;\r\n\t}\r\n\telse{\r\n\t\trowId = 0.0;\r\n\t}\r\n\talert(p + \" \" + rowId + \" \" + colStep1 + \" \" + colStep2);\r\n\r\n\tif(p > 3.49){\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif(p < -3.49){\r\n\t\treturn 1;\r\n\t}\r\n\r\n\tif(rowId == 0.0){\r\n\t\tif (p >= 0.0){\r\n\t\t\trow = document.getElementById(\"0.0\");\r\n\t\t\tvar cells = row.getElementsByTagName(\"td\");\r\n\t\t\treturn 1 - cells[colStep2].innerText;\r\n\t\t}\r\n\t\telse{\r\n\t\t\trow = document.getElementById(\"-0.0\");\r\n\t\t\tvar cells = row.getElementsByTagName(\"td\");\r\n\t\t\treturn 1 - cells[colStep2].innerText;\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\trow = document.getElementById(rowId);\r\n\t\tvar cells = row.getElementsByTagName(\"td\");\r\n\t\treturn 1 - cells[colStep2].innerText;\r\n\t}\r\n}", "title": "" }, { "docid": "a94918633d42093e4f8b192afb64bdf8", "score": "0.5215343", "text": "function pLessThanXnorm(x, m, s)\r\n{\r\n\tvar p = (x-m)/s;\r\n\tvar rowId;\r\n\tvar colStep1 = Math.round(p * 100);\r\n\tvar colStep2 = Math.abs(colStep1 % 10);\r\n\tvar row;\r\n\r\n\t//reads the table to find the correct probability based on the calculations made.\r\n\tif(p < 0){\r\n\t\trowId = Math.ceil(p*10)/10;\r\n\t}\r\n\telse if (p > 0){\r\n\t\trowId = Math.floor(p*10)/10;\r\n\t}\r\n\telse{\r\n\t\trowId = 0.0;\r\n\t}\r\n\r\n\tif(p > 3.49){\r\n\t\treturn 1;\r\n\t}\r\n\r\n\tif(p < -3.49){\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif(rowId == 0.0){\r\n\t\tif (p >= 0.0){\r\n\t\t\trow = document.getElementById(\"0.0\");\r\n\t\t\tvar cells = row.getElementsByTagName(\"td\");\r\n\t\t\treturn cells[colStep2].innerText;\r\n\t\t}\r\n\t\telse{\r\n\t\t\trow = document.getElementById(\"-0.0\");\r\n\t\t\tvar cells = row.getElementsByTagName(\"td\");\r\n\t\t\treturn cells[colStep2].innerText;\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\trow = document.getElementById(rowId);\r\n\t\tvar cells = row.getElementsByTagName(\"td\");\r\n\t\treturn cells[colStep2].innerText;\r\n\t}\r\n}", "title": "" }, { "docid": "9c371fe3aba3e65057b553efdd2f63b1", "score": "0.51935345", "text": "checkX() {\n if (validate.checkIfValidInput(this.x) === true && validate.isDecimal === false) { // valid for X\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "7080d88e422681f035da32663f82a09c", "score": "0.51857513", "text": "function n$y(t){let n=t*t;return t<0&&(n*=-1),n}", "title": "" }, { "docid": "bc2a10e7b6c227a2360e5200c40f4fc4", "score": "0.5183004", "text": "X(d) { return this.xScale(d[0]); }", "title": "" }, { "docid": "a95734737f06b82cf354730d2aa2306f", "score": "0.51759684", "text": "camX(x)\n\t{\n\t\treturn x * this.zoomSmooth - this.xSmooth;\n\t}", "title": "" }, { "docid": "59d4b92ad42001dd17822197c22b28cd", "score": "0.51756454", "text": "containsX(x) {\n return x >= this.low\n && x <= this.high;\n }", "title": "" }, { "docid": "c2f76ba15654280779745f670d37222a", "score": "0.5170142", "text": "function p(x)\n{\n\tlet tempM0 = mapInputToOutputRange(params.chaos, 0, 100, -1.05, -2);\n\tlet tempM1 = mapInputToOutputRange(params.duality, 0, 100, -0.96, -0.5);\n\treturn tempM1 * x + (tempM0 - tempM1) / 2 * (Math.abs(x + 1) - Math.abs(x - 1));\n}", "title": "" }, { "docid": "4e4c4dcc150aa3cf386a056b74ee9e90", "score": "0.51590246", "text": "_computeRho(x) {\n if(!x) x = 0\n\n const a = this.props.low || 0\n const b = this.props.high || 100\n\n const range = b - a\n\n let rho = (x - a) / range\n rho = Math.max(rho, 0) // must be at least 0\n rho = Math.min(rho, 1) // and no greater than 1\n\n return rho\n }", "title": "" }, { "docid": "52251fc357a03005ea1b9a156c8a830a", "score": "0.5153984", "text": "swe_d2l(x) {\n if (x >=0.) {\n return (Math.floor(x + 0.5));\n } else {\n return (- Math.floor(0.5 - x));\n }\n }", "title": "" }, { "docid": "fd181d8b9e3d088d80d266d5aa05afe0", "score": "0.5152121", "text": "function sgn(x) {\n var rv;\n if (x > 0.0) rv = 1;\n else if (x < 0.0) rv = -1;\n else rv = 0;\n return rv;\n}", "title": "" }, { "docid": "03d7145ff4082b7272b8d10145cf2cef", "score": "0.51449287", "text": "function StandardNormalPx(x)\n{\n\treturn 1 - StandardNormalQx(x);\n}", "title": "" }, { "docid": "f7d293c13ab8fe8b8043816d65b6d381", "score": "0.51428986", "text": "Z(){\n return ArrayMin(this.Im(),this.Is(),this.II(),this.IIIm(),this.IIIs(),this.IV())\n }", "title": "" }, { "docid": "4823805cc79576c0e58b6656217d2818", "score": "0.51340836", "text": "fy ( x ) {\n return this.a.y+(x-this.a.x)*this.m;\n }", "title": "" }, { "docid": "46ae1d08a63a20bd1450aab5c4fe1602", "score": "0.5124676", "text": "function r(e,t){\n// SameValue algorithm\n// SameValue algorithm\nreturn e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}", "title": "" }, { "docid": "c789afb35b4df8642068cf046066370d", "score": "0.51184803", "text": "function ex(x) {\r\n return (x < -BIGX) ? 0.0 : Math.exp(x);\r\n}", "title": "" }, { "docid": "adc5f52a17eb2ff507f2ecd164329ee0", "score": "0.51167256", "text": "function r(e,t,n){return t>e?t:e>n?n:e}", "title": "" }, { "docid": "ede51aaa7acb7464fc8a18e3ac52e2d0", "score": "0.51147336", "text": "CPX() {\r\n var data = this.getData();\r\n this.compare(data, this.X);\r\n }", "title": "" }, { "docid": "914e9377f77be24c49f317def93bcda6", "score": "0.51116204", "text": "function inbetween(low, up, m, s){\r\n\t//the probability of a value being a < Z < b == p(x<b) - p(x<a)\r\n\treturn pLessThanXnorm(up, m, s) - pLessThanXnorm(low, m, s);\r\n}", "title": "" }, { "docid": "9cab478be2672a66e44ae8b8062454ab", "score": "0.5108255", "text": "function getX(a, b, D) {\n var x1 = (-b + Math.sqrt(D)) / (2 * a);\n var x2 = (-b - Math.sqrt(D)) / (2 * a);\n if (x1 != x2) {\n return [x1, x2];\n } else {\n return [x1];\n }\n}", "title": "" }, { "docid": "50b214898ddcb0acbaeeab29683e6265", "score": "0.51070523", "text": "Qs(){\n if(this.BF_2TF()<=0.56*Math.pow(this.E/this.Fy,0.5)){\n return 1;\n }\n else if(this.BF_2TF()<1.03*Math.pow(this.E/this.Fy,0.5)){\n return 1.415-0.74*(this.BF_2TF())*Math.pow(this.Fy/this.E,0.5)\n }\n else{\n return (0.69*this.E)/(this.Fy*Math.pow(this.BF_2TF(),2)) \n }\n }", "title": "" }, { "docid": "8135877c39a7430f6742440a6ef1d093", "score": "0.51033676", "text": "function NormalP( x ) {\n // Abramowitz & Stegun 26.2.19\n var\n d1 = 0.0498673470,\n d2 = 0.0211410061,\n d3 = 0.0032776263,\n d4 = 0.0000380036,\n d5 = 0.0000488906,\n d6 = 0.0000053830;\n\n var a = Math.abs(x);\n var t = 1.0 + a*(d1+a*(d2+a*(d3+a*(d4+a*(d5+a*d6)))));\n\n // to 16th power\n t *= t; t *= t; t *= t; t *= t;\n t = 1.0 / (t+t); // the MINUS 16th\n\n if (x >= 0) t = 1 - t;\n return t;\n }", "title": "" }, { "docid": "9946b2ec301426df61be41a0d96dd363", "score": "0.50958055", "text": "get midX() {\n return (this.x1 + this.x2) / 2;\n }", "title": "" }, { "docid": "146fa2506b9154c7e1e2bde9864f1dc7", "score": "0.5092181", "text": "get x() { return (this._x); }", "title": "" }, { "docid": "cba8d2b24fecb6b967dc97fb0192d800", "score": "0.50892776", "text": "function sc_less(x) {\n for (var i = 1; i < arguments.length; i++) {\n\tif (x >= arguments[i])\n\t return false;\n\tx = arguments[i];\n }\n return true;\n}", "title": "" }, { "docid": "be0e6ace45b8527fe52551f00b65936a", "score": "0.50891846", "text": "function calcExPressure() {\n // piston gone away ?\n if (Vnew > V0) {\n return calcInPressure();\n }\n\n return parseInt($(\"input[name='ex-pressure']:checked\")[0].value);\n }", "title": "" }, { "docid": "a6c953952b6adaf54ba8465d0328bf5e", "score": "0.50858253", "text": "function succesor(x) {\n if (x.right) {\n return findMin(x.right);\n }\n\n let y = x.p;\n while (y && y.right === x) {\n x = y;\n y = y.p;\n }\n return y;\n}", "title": "" }, { "docid": "cf9fa333815c11e95e0a9570a3cc4cd7", "score": "0.50749224", "text": "function X(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n }", "title": "" }, { "docid": "95d864f8e6a7c234576bde3983f415d6", "score": "0.5071169", "text": "function above(x, value) {\n return x == null ? false : +x >= value;\n}", "title": "" }, { "docid": "d568dc9313ff6303edaefda265170973", "score": "0.5063908", "text": "function l$r(){return !0}", "title": "" }, { "docid": "33277c74dca67417ac974bfab073c5e9", "score": "0.5057551", "text": "Cfu(){\n\t\tif(this.flat){\n\t\t\tif(this.d<=3){\n\t\t\t\treturn (this.b <= 3) ? 1:1\n\t\t\t}\n\t\t\tif(this.d<=4){\n\t\t\t\treturn (this.b <= 3) ? 1.1:1\n\t\t\t}\n\t\t\tif(this.d<=5){\n\t\t\t\treturn (this.b <= 3) ? 1.1:1.05\n\t\t\t}\n\t\t\tif(this.d<=10){\n\t\t\t\treturn (this.b <= 3) ? 1.15:1.05\n\t\t\t}\n\t\t\tif(this.d>=10){\n\t\t\t\treturn (this.b <= 3) ? 1.2:1.1\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treturn 1\n\t\t}\n\t}", "title": "" }, { "docid": "a1127c569ffcdaa2afdee234ad2f553a", "score": "0.5047527", "text": "static compareX(a, b) {\n return a.x - b.x;\n }", "title": "" }, { "docid": "6d6e9c80c2ca5eee2da6c2e0852c444d", "score": "0.5044306", "text": "function mudapego(x,y){\r\n if(((y>=450)&&(y<=550))||((y>=850)&&(y<=950))||((y>=1150)&&(y<=1250))){\r\n if((x>=1120)&&(x<=1205)){\r\n return 0\r\n }else{\r\n return 1\r\n }}else{\r\n return 1\r\n }\r\n }", "title": "" }, { "docid": "5670d0cd1d70abc0b71da86ab74770b5", "score": "0.5039993", "text": "abs(x) {\n return this.backend.abs(x);\n }", "title": "" }, { "docid": "e1a2bf147a901131ecd6f1a2a5e807bb", "score": "0.50383866", "text": "acamX(x)\n\t{\n\t\treturn (x + this.xSmooth) / this.zoomSmooth;\n\t}", "title": "" }, { "docid": "827a61bb1af4c4200c705e13d9b8ff9e", "score": "0.5032792", "text": "function cuberoot(x) {\n\t var y = Math.pow(Math.abs(x), 1 / 3);\n\t return x < 0 ? -y : y;\n\t}", "title": "" }, { "docid": "f3cf0ebe5b2e821810a320c736b8f244", "score": "0.50256777", "text": "innerTransfer() {\n let Q;\n Q = this.k * Math.abs(this.tempSide1 - this.tempSide2) / this.thickness;\n return Q;\n }", "title": "" }, { "docid": "3b3b7c45c33d11ac751917cd3940c770", "score": "0.5020766", "text": "function lo(t) {\n return fo(t) && !Do(t).ar() && t.qr.size > 0;\n }", "title": "" }, { "docid": "f41d9ad8f6af49d72060686f8c9938ff", "score": "0.5016946", "text": "function hasDX(node) {\n let len = node.args.length;\n if (node.op === Model.MUL && node.args[len - 1].op === Model.FRAC) {\n node = node.args[len - 1].args[0];\n len = node.args.length;\n } else if (node.op === Model.FRAC) {\n node = node.args[0]; // Numerator\n }\n let dvar = node.args[len - 2];\n let ivar = node.args[len - 1];\n return (\n node && node.op === Model.MUL &&\n dvar.op === Model.VAR && dvar.args[0] === \"d\" &&\n ivar.op === Model.VAR && ivar || null\n );\n }", "title": "" }, { "docid": "f50cc3c0bba3e1fdb2e1c3401e53765d", "score": "0.5013615", "text": "_linear_compute(x) {\n const [factor, offset] = this._linear_compute_state();\n return factor * x + offset;\n }", "title": "" }, { "docid": "56a0848b7a226b7f3a1f5660dbdef142", "score": "0.5005883", "text": "Lp(){\n\t\treturn 1.76*this.CH.RY*Math.pow(this.E/this.Fy,0.5);\n\t}", "title": "" }, { "docid": "d61f6093e707ac1b1817728dac7ded81", "score": "0.5003162", "text": "function isValide (x){\n if (x === null || Number(x) <= 0){\n return false;\n } else {\n return true; // validation function need both false and true value. if one is missing, it will return undifined. which is also a boolean false value.\n }\n}", "title": "" }, { "docid": "a589208dbfaf60b3bb9a07f90b4526e5", "score": "0.49919704", "text": "nextValue() {\n let x2, v0, v1, x, u, v;\n\n while (true) {\n do {\n x = this.randn.nextValue();\n v = 1 + this.c * x;\n } while (v <= 0);\n\n v *= v * v;\n x2 = x * x;\n v0 = 1 - 0.331 * x2 * x2;\n v1 = 0.5 * x2 + this.d * (1 - v + Math.log(v));\n u = this.randu();\n\n if (u < v0 || Math.log(u) < v1) {\n break;\n }\n }\n\n v = 1 / this.beta * this.d * v;\n\n if (this.alpha < 1) {\n v *= Math.pow(this.randu(), 1 / this.alpha);\n }\n\n return this.convertValue(v);\n }", "title": "" }, { "docid": "38bee11d9db8a6d7097842be0cdc99c0", "score": "0.49880403", "text": "get x()\n\t{\n\t\tif (this._x != null)\n\t\t\treturn this._x;\n\n\t\t/*\n\t\tif (this.isInput)\n\t\t\treturn this.node.posSmooth.x;\n\n\t\treturn this.node.posSmooth.x + this.node.width;\n\t\t*/\n\n\t\treturn this.node.input.plugPositions()[this.isInput ? 'inputs'\n\t\t\t: 'outputs'].filter(o => o.plug === this)[0].x;\n\t}", "title": "" }, { "docid": "a474805c76bffc03143044ffeb8ebd15", "score": "0.49861097", "text": "get isAlmostZeroX() { return Geometry_1.Geometry.isSmallMetricDistance(this.xLength()); }", "title": "" }, { "docid": "a474805c76bffc03143044ffeb8ebd15", "score": "0.49861097", "text": "get isAlmostZeroX() { return Geometry_1.Geometry.isSmallMetricDistance(this.xLength()); }", "title": "" } ]
34a48fed13cf0867f76dd208e0aed40f
Combination Functions Thanks to jQuery xColor for some of the ideas behind these <
[ { "docid": "c37e4c2f33f46531029a098b242a530a", "score": "0.0", "text": "function _complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n }", "title": "" } ]
[ { "docid": "53556018c97642d4bb0fa5dc77ed8eb8", "score": "0.6894803", "text": "function getColor2(x,a,b,c,d,e,f){\r\n\t return x === a ? \"#006600\" :\r\n x === b ? \"#2eb82e\" :\r\n x === c ? \"#ffcc00\" :\r\n x === d ? \"#ff3300\" :\r\n\t\t\t x === e ? \"#990000\" :\r\n \"#808080\";\r\n\t\t\t\t\t \r\n}", "title": "" }, { "docid": "c2f01b88f42c80fca40dc57af51502f7", "score": "0.65034235", "text": "function _generateColor() {\n\t\treturn [_getHexValue(),_getHexValue(),_getHexValue()];\n\t}", "title": "" }, { "docid": "3d5c9341e6e63042f3186a0186a3f83b", "score": "0.6371867", "text": "blendColors(x, y) {\n this.setWeight(this.calculateWeight());\n\n this.setColor(color(\n (this.getRed() * this.getWeight() + this.getRedAt(x, y) * this.getCount()) / this.getLength(),\n (this.getGreen() * this.getWeight() + this.getGreenAt(x, y) * this.getCount()) / this.getLength(),\n (this.getBlue() * this.getWeight() + this.getBlueAt(x, y) * this.getCount()) / this.getLength(),\n this.getAlpha()\n ));\n }", "title": "" }, { "docid": "8ad7d8c7a567567efd7d04ea49fa8fa8", "score": "0.62036765", "text": "function RGBColor(b){this.ok=!1;\"#\"==b.charAt(0)&&(b=b.substr(1,6));b=b.replace(/ /g,\"\");b=b.toLowerCase();var e={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"00ffff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000000\",blanchedalmond:\"ffebcd\",blue:\"0000ff\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"00ffff\",darkblue:\"00008b\",\ndarkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dodgerblue:\"1e90ff\",feldspar:\"d19275\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"ff00ff\",\ngainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgrey:\"d3d3d3\",lightgreen:\"90ee90\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",\nlightslateblue:\"8470ff\",lightslategray:\"778899\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"00ff00\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"ff00ff\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370d8\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",\noldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"d87093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",red:\"ff0000\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",\nslategray:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",violetred:\"d02090\",wheat:\"f5deb3\",white:\"ffffff\",whitesmoke:\"f5f5f5\",yellow:\"ffff00\",yellowgreen:\"9acd32\"},d;for(d in e)b==d&&(b=e[d]);var f=[{re:/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,example:[\"rgb(123, 234, 45)\",\"rgb(255,234,245)\"],process:function(b){return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]}},{re:/^(\\w{2})(\\w{2})(\\w{2})$/,\nexample:[\"#00ff00\",\"336699\"],process:function(b){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}},{re:/^(\\w{1})(\\w{1})(\\w{1})$/,example:[\"#fb0\",\"f0f\"],process:function(b){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}}];for(d=0;d<f.length;d++){var h=f[d].process,m=f[d].re.exec(b);m&&(channels=h(m),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=0>this.r||isNaN(this.r)?0:255<this.r?255:this.r;this.g=0>this.g||isNaN(this.g)?0:\n255<this.g?255:this.g;this.b=0>this.b||isNaN(this.b)?0:255<this.b?255:this.b;this.toRGB=function(){return\"rgb(\"+this.r+\", \"+this.g+\", \"+this.b+\")\"};this.toHex=function(){var b=this.r.toString(16),d=this.g.toString(16),e=this.b.toString(16);1==b.length&&(b=\"0\"+b);1==d.length&&(d=\"0\"+d);1==e.length&&(e=\"0\"+e);return\"#\"+b+d+e};this.getHelpXML=function(){for(var b=[],d=0;d<f.length;d++)for(var h=f[d].example,m=0;m<h.length;m++)b[b.length]=h[m];for(var u in e)b[b.length]=u;h=document.createElement(\"ul\");\nh.setAttribute(\"id\",\"rgbcolor-examples\");for(d=0;d<b.length;d++)try{var w=document.createElement(\"li\"),z=new RGBColor(b[d]),y=document.createElement(\"div\");y.style.cssText=\"margin: 3px; border: 1px solid black; background:\"+z.toHex()+\"; color:\"+z.toHex();y.appendChild(document.createTextNode(\"test\"));var G=document.createTextNode(\" \"+b[d]+\" -> \"+z.toRGB()+\" -> \"+z.toHex());w.appendChild(y);w.appendChild(G);h.appendChild(w)}catch(E){}return h}}", "title": "" }, { "docid": "8e5768c97dfec376f327afd7e176c27a", "score": "0.61820936", "text": "function bxcolor(mi) {if(mi==bzv){gcl(959);}else{gcl(990);}; }", "title": "" }, { "docid": "ec90ee3df0f5d73092c1047f1018a560", "score": "0.6131553", "text": "function colorize(){\n\n}", "title": "" }, { "docid": "e3feea1b020a76e87cdb81eb020870f4", "score": "0.6124649", "text": "function mixColors(primary, secondary) {\t\t\n\n\tvar r = Math.round( (primary[0] * .5) + (secondary[0] * .5) );\n\tvar g = Math.round( (primary[1] * .5) + (secondary[1] * .5) );\n\tvar b = Math.round( (primary[2] * .5) + (secondary[2] * .5) );\n\n\treturn 'rgb('+r+', '+g+', '+b+')';\n}", "title": "" }, { "docid": "447161e00b88b8d2a42fc52541b09f04", "score": "0.612317", "text": "function generateAllColors () {\n var colorMap = new Array(\n 'rgb(255, 255, 255)',\n 'rgb(0, 0, 0)',\n 'rgb(255, 0, 0)',\n 'rgb(0, 255, 0)',\n 'rgb(0, 0, 255)',\n 'rgb(255, 255, 0)',\n 'rgb(255, 0, 255)',\n 'rgb(0, 255, 255)',\n 'rgb(89, 211, 84)',\n 'rgb(89, 84, 216)',\n 'rgb(254, 254, 254)',\n 'rgb(191, 181, 173)',\n 'rgb(76, 76, 76)',\n 'rgb(102, 102, 102)',\n 'rgb(127, 127, 127)',\n 'rgb(153, 153, 153)',\n 'rgb(178, 178, 178)',\n 'rgb(204, 204, 204)',\n 'rgb(229, 229, 229)',\n 'rgb(242, 242, 242)',\n 'rgb(204, 198, 170)',\n 'rgb(204, 198, 170)',\n 'rgb(193, 191, 168)',\n 'rgb(186, 181, 163)',\n 'rgb(178, 165, 150)',\n 'rgb(183, 163, 155)',\n 'rgb(173, 153, 140)',\n 'rgb(155, 142, 130)',\n 'rgb(135, 102, 86)',\n 'rgb(175, 206, 198)',\n 'rgb(132, 193, 163)',\n 'rgb(137, 168, 160)',\n 'rgb(130, 158, 140)',\n 'rgb(173, 188, 198)',\n 'rgb(122, 142, 153)',\n 'rgb(117, 137, 145)',\n 'rgb(104, 130, 150)',\n 'rgb(109, 122, 132)',\n 'rgb(124, 153, 209)',\n 'rgb(127, 127, 155)',\n 'rgb(170, 165, 191)',\n 'rgb(211, 206, 135)',\n 'rgb(221, 186, 135)',\n 'rgb(188, 158, 130)',\n 'rgb(198, 153, 124)',\n 'rgb(191, 130, 119)',\n 'rgb(206, 94, 96)',\n 'rgb(170, 142, 147)',\n 'rgb(165, 119, 122)',\n 'rgb(147, 104, 112)',\n 'rgb(211, 89, 84)');\n\n var circleColors = [632, 416, 600, 400, 616, 432];\n\n var rectangleColors = [800, 820, 840, 860, 880, 900];\n\n var set1 = [ 255,204,204, 255,153,153, 204,153,153, 255,102,102, 204,102,102\n ,153,102,102, 255, 51, 51, 204, 51, 51, 153, 51, 51, 102, 51, 51\n ,255, 0, 0, 204, 0, 0, 153, 0, 0, 102, 0, 0, 51, 0, 0];\n var set2 = [ 204,255,204, 153,255,153, 153,204,153, 102,255,102, 102,204,102\n ,102,153,102, 51,255, 51, 51,204, 51, 51,153, 51, 51,102, 51\n , 0,255, 0, 0,204, 0, 0,153, 0, 0,102, 0, 0, 51, 0];\n var set3 = [ 204,204,255, 153,153,255, 153,153,204, 102,102,255, 102,102,204\n ,102,102,153, 51, 51,255, 51, 51,204, 51, 51,153, 51, 51,102\n , 0, 0,255, 0, 0,204, 0, 0,153, 0, 0,102, 0, 0, 51];\n var set4 = [ 255,255,204, 255,255,153, 204,204,153, 255,255,102, 204,204,102\n ,153,153,102, 255,255, 51, 204,204, 51, 153,153, 51, 102,102, 51\n ,255,255, 0, 204,204, 0, 153,153, 0, 102,102, 0, 51, 51, 0];\n var set5 = [ 255,204,255, 255,153,255, 204,153,204, 255,102,255, 204,102,204\n ,153,102,153, 255, 51,255, 204, 51,204, 153, 51,153, 102, 51,102\n ,255, 0,255, 204, 0,204, 153, 0,153, 102, 0,102, 51, 0, 51];\n var set6 = [ 204,255,255, 153,255,255, 153,204,204, 102,255,255, 102,204,204\n ,102,153,153, 51,255,255, 51,204,204, 51,153,153, 51,102,102\n , 0,255,255, 0,204,204, 0,153,153, 0,102,102, 0, 51, 51];\n\n var circleSets = new Array(set1, set2, set3, set4, set5, set6);\n\n var set7 = [ 255,204,153, 204,153,102, 153,102, 51, 153,102, 0, 204,153, 51\n ,255,204,102, 255,153, 0, 255,204, 51, 204,153, 0, 255,204, 0\n ,255,153, 51, 204,102, 0, 102, 51, 0, 153, 51, 0, 204,102, 51\n ,255,153,102, 255,102, 0, 255,102, 51, 204, 51, 0, 255, 51, 0];\n var set8 = [ 153,255, 51, 102,204, 0, 51,102, 0, 51,153, 0, 102,204, 51\n ,153,255,102, 102,255, 0, 102,255, 51, 51,204, 0, 51,255, 0\n ,204,255,153, 153,204,102, 102,153, 51, 102,153, 0, 153,204, 51\n ,204,255,102, 153,255, 0, 204,255, 51, 153,204, 0, 204,255, 0];\n var set9 = [ 153,255,204, 102,204,153, 51,153,102, 0,153,102, 51,204,153\n ,102,255,204, 0,255,102, 51,255,204, 0,204,153, 0,255,204\n , 51,255,153, 0,204,102, 0,102, 51, 0,153, 51, 51,204,102\n ,102,255,153, 0,255,153, 51,255,102, 0,204, 51, 0,255, 51];\n var set10 = [153,204,255, 102,153,204, 51,102,153, 0, 51,153, 51,102,204\n ,102,153,255, 0,102,255, 51,102,255, 0, 51,204, 0, 51,255\n , 51,153,255, 0,102,204, 0, 51,102, 0,102,153, 51,153,204\n ,102,204,255, 0,153,255, 51,204,255, 0,153,204, 0,204,255];\n var set11 = [204,153,255, 153,102,204, 102, 51,153, 102, 0,153, 153, 51,204\n ,204,102,255, 153, 0,255, 204, 51,255, 153, 0,204, 204, 0,255\n ,153, 51,255, 102, 0,204, 51, 0,102, 51, 0,153, 102, 51,204\n ,153,102,255, 102, 0,255, 102, 51,255, 51, 0,204, 51, 0,255];\n var set12 = [255, 51,153, 204, 0,102, 102, 0, 51, 153, 0, 51, 204, 51,102\n ,255,102,153, 255, 0,102, 255, 51,102, 204, 0, 51, 255, 0, 51\n ,255,153,204, 204,102,153, 153, 51,102, 153, 0,102, 204, 51,153\n ,255,102,204, 255, 0,153, 204, 0,153, 255, 51,204, 255, 0,153];\n\n var rectSets = new Array(set7, set8, set9, set10, set11, set12);\n\n /*\n * Define circle colors\n */\n for(var i = 0; i < 6; i++) {\n for(var j = 0; j < 15; j++) {\n var colorn = circleColors[i] + j - 10;\n colorMap[colorn] = 'rgb(' + circleSets[i][3*j] + ', ' + circleSets[i][3*j+1] + ', ' + circleSets[i][3*j+2] + ')';\n colorn = rectangleColors[i] + j - 9;\n colorMap[colorn] = 'rgb('+ rectSets[i][3*j] + ', ' + rectSets[i][3*j+1] + ', ' + rectSets[i][3*j+2] + ')';\n }\n }\n return colorMap;\n}", "title": "" }, { "docid": "72289b48769f665c535ea74365f8cdc6", "score": "0.61150336", "text": "function getColor(x) {\n return x > 5 ? \"#f40202\" :\n x > 4 ? \"#f45f02\" :\n x > 3 ? \"#f49702\" :\n x > 2 ? \"#F4bc02\" :\n x > 1 ? \"#d8f402\" :\n x > 0 ? \"#93f402\" :\n \"#FFEDA0\"\n }", "title": "" }, { "docid": "883d1f5427a76da5c0ffc44ad0e5d00d", "score": "0.61069185", "text": "function shadeBlend(p,c0,c1) {\n var n=p<0?p*-1:p,u=Math.round,w=parseInt;\n if(c0.length>7){\n var f=c0.split(\",\"),t=(c1?c1:p<0?\"rgb(0,0,0)\":\"rgb(255,255,255)\").split(\",\"),R=w(f[0].slice(4)),G=w(f[1]),B=w(f[2]);\n return \"rgb(\"+(u((w(t[0].slice(4))-R)*n)+R)+\",\"+(u((w(t[1])-G)*n)+G)+\",\"+(u((w(t[2])-B)*n)+B)+\")\"\n }else{\n var f=w(c0.slice(1),16),t=w((c1?c1:p<0?\"#000000\":\"#FFFFFF\").slice(1),16),R1=f>>16,G1=f>>8&0x00FF,B1=f&0x0000FF;\n return \"#\"+(0x1000000+(u(((t>>16)-R1)*n)+R1)*0x10000+(u(((t>>8&0x00FF)-G1)*n)+G1)*0x100+(u(((t&0x0000FF)-B1)*n)+B1)).toString(16).slice(1)\n }\n}", "title": "" }, { "docid": "9ae7157995c861d9884b9cebb27f452f", "score": "0.6074035", "text": "function getColorFunctions(){\n\treturn [test,waveCheckers,wavyRoundDiamond,wavyRoundDiamond2,randJag,randJag2,randVertWaves,randHorWaves,weirdBumps,roundedDiamonds,triangleFractal,quadx,quady,weirdTinyCircles,biggerCircles,sqrty,sqrtx,logy, logx, trippySwirls,nestedGradient,nonConstantLines,nonConstantLines2,nestedGradient2,checkerPattern,weirdCheckers,thinStripes2,thinStripes,white, black, time,random255, centerRadialStripes, verticalGradiantStripes, horizontalGradiantStripes,verticalGradiant, horizontalGradiant, leftDiagonalGradiant, rightDiagonalGradiant,diagonalStripes,diagonalStripes2];\n}", "title": "" }, { "docid": "1fa9509d1ba72d1af6032becf0820154", "score": "0.6043999", "text": "function colorBlend(r1, g1, b1, r2, g2, b2, shadow, alpha) {\r\n var r = (r1 * (1 - alpha) + alpha) * shadow * r2;\r\n var g = (g1 * (1 - alpha) + alpha) * shadow * g2;\r\n var b = (b1 * (1 - alpha) + alpha) * shadow * b2;\r\n\r\n return \"rgb(\" + Math.round(r) + \",\" + Math.round(g) + \",\" + Math.round(b) + \")\";\r\n}", "title": "" }, { "docid": "77ae914c1b9243642006f9e3c958a54f", "score": "0.6036762", "text": "function getColor(x) {\n return x > 5 ? \"#f40202\" :\n x > 4 ? \"#f45f02\" :\n x > 3 ? \"#f49702\" :\n x > 2 ? \"#F4bc02\" :\n x > 1 ? \"#d8f402\" :\n x > 0 ? \"#93f402\" :\n \"#FFEDA0\";\n }", "title": "" }, { "docid": "3efdb807f5bb8a9c8c6d670066869798", "score": "0.59931254", "text": "function get_colors()\n{\n\tmyColors=['aliceblue','antiquewhite','aqua','aquamarine','azure','beige','bisque',\n\t\t\t 'black','blanchedalmond','blue','blueviolet','brown','burlywood',\n\t\t\t 'cadetblue','chartreuse','chocolate','coral','cornflowerblue','cornsilk',\n\t\t\t 'crimson','cyan','darkblue','darkcyan','darkgoldenrod','darkgray',\n\t\t\t 'darkgreen','darkgrey','darkkhaki','darkmagenta','darkolivegreen',\n\t\t\t 'darkorange','darkorchid','darkred','darksalmon','darkseagreen',\n\t\t\t 'darkslateblue','darkslategray','darkturquoise','darkviolet','deeppink',\n\t\t\t 'deepskyblue','dimgray','dimgrey','dodgerblue','firebrick','floralwhite',\n\t\t\t 'forestgreen','fuchsia','gainsboro','ghostwhite','gold','goldenrod',\n\t\t\t 'gray','green','greenyellow','grey','honeydew','hotpink','indianred',\n\t\t\t 'indigo','ivory','khaki','lavender','lavenderblush','lawngreen',\n\t\t\t 'lemonchiffon','lightblue','lightcoral','lightcyan','lightgoldenrodyellow',\n\t\t\t 'lightgray','lightgreen','lightgrey','lightpink','lightsalmon',\n\t\t\t 'lightseagreen','lightskyblue','lightslategray','lightslategrey',\n\t\t\t 'lightsteelblue','lightyellow','lime','limegreen','linen','magenta',\n\t\t\t 'maroon','mediumaquamarine','mediumblue','mediumorchid','mediumpurple',\n\t\t\t 'mediumseagreen','mediumslateblue','mediumspringgreen','mediumturquoise',\n\t\t\t 'mediumvioletred','midnightblue','mintcream','mistyrose','moccasin',\n\t\t\t 'navajowhite','navy','oldlace','olive','olivedrab','orange','orangered',\n\t\t\t 'orchid','palegoldenrod','palegreen','paleturquoise','palevioletred',\n\t\t\t 'papayawhip','peachpuff','peru','pink','plum','powderblue','purple',\n\t\t\t 'RebeccaPurple','red','rosybrown','royalblue','saddlebrown','salmon',\n\t\t\t 'sandybrown','seagreen','seashell','sienna','silver','skyblue',\n\t\t\t 'slateblue','slategray','slategrey','snow','springgreen','steelblue',\n\t\t\t 'tan','teal','thistle','tomato','turquoise','violet','wheat','white',\n\t\t\t 'whitesmoke','yellow','yellowgreen']\n\t\n\t\n\tresult = myColors\n for (i = 0; i < result.length; i++)\n {\n \tmyDisplayText = result[i] + \" \"\n \tmyColorsDict.push({ text: \"'\"+result[i]+\"'\" , displayText: ''+myDisplayText.substr(0,18)+\" | Std-Color\" });\n \tmyCompleteDict.push({ text: \"\"+result[i]+\"\", displayText: ''+myDisplayText.substr(0,18)+\" | Std-Color\" });\n \tmyCompleteDictwithQuotes.push({ text: \"'\"+result[i]+\"'\", displayText: ''+myDisplayText.substr(0,18)+\" | Std-Color\" });\n \t\n }\n\n\tdocument.getElementById(\"colors_loaded\").src = 'pics/led/lamp_green.png'\n\tLabel=$(\"#colors_loaded\").closest(\"td\").html()\n\tnewLabel = Label.replace(\"Colors loaded\",\"Colors loaded [ \"+ myColorsDict.length +\" ]\")\n\t$(\"#colors_loaded\").closest(\"td\").html(newLabel)\n}", "title": "" }, { "docid": "99bbcbabb0842e4ad27ddc60e9282f30", "score": "0.5979247", "text": "function colorPicker(number){\nfor (i = 0; i<number; i++){\nr = Math.floor(Math.random() * 255)\ng = Math.floor(Math.random() * 255)\nb = Math.floor(Math.random() * 255)\nrandomColor = `rgb(${r},${g},${b})`;\n\n//this gets 2 sets so they can match each other\n COLORS.push(randomColor);\n COLORS.push(randomColor);\n}\n\n\n}", "title": "" }, { "docid": "0f6f01e9ab0673522a1bc24c9a7ee3a1", "score": "0.59761286", "text": "encodePickingColor(i) {\n const {uCount, vCount} = this.props;\n\n const xIndex = i % uCount;\n const yIndex = (i - xIndex) / uCount;\n\n return [(xIndex / (uCount - 1)) * 255, (yIndex / (vCount - 1)) * 255, 1];\n }", "title": "" }, { "docid": "6ef3f9ca3c85caf1b6f1a25164f28834", "score": "0.59468925", "text": "function getPickingColor(index) {\n index++;\n return [index & 255, index >> 8 & 255, index >> 16 & 255];\n}", "title": "" }, { "docid": "dca30336265f17a7152b2cb2f72502ea", "score": "0.59439933", "text": "function color(colorType, val) {\n\n // Colors for the parties\n if(colorType == \"PartyAbbreviation\") {\n if (val == 'PLD') {\n return '#3131BD'\n } else if (val == 'UDC') {\n return '#088A4B'\n } else if (val == 'PSS') {\n return '#FA1360'\n } else if (val == 'PDC') {\n return '#FE9A2E'\n } else if (val == 'PLR') {\n return '#0174DF'\n } else if (val == 'PES') {\n return '#01DF01'\n } else if (val == 'pvl') {\n return '#9AFE2E'\n } else if (val == 'PBD') {\n return '#FFFF00'\n } else if (val == 'PEV') {\n return '#FFD735'\n } else if (val == 'Lega') {\n return '#0B3861'\n } else if (val == 'csp-ow') {\n return '#E2563B'\n } else if (val == '-') {\n return '#CCCCCC'\n } else if (val == 'MCG') {\n return '#FECC01'\n } else if (val == 'BastA') {\n return '#DFDE00'\n } else if (val == 'PdT') {\n return '#FF0000'\n }\n // Color for the Parl groups\n } else if(colorType == \"ParlGroupAbbreviation\") {\n if(val == \"NaN\") {\n return '#CCCCCC'\n } else if (val == \"GL\") {\n return '#9AFE2E'\n } else if (val == \"BD\") {\n return '#FFFF00'\n } else if (val == \"C\") {\n return '#FE9A2E'\n } else if (val == \"S\") {\n return '#FA1360'\n } else if (val == \"G\") {\n return '#01DF01'\n } else if (val == \"RL\") {\n return '#0174DF'\n } else if (val == \"V\") {\n return '#088A4B'\n }\n // Colors for the councils\n } else if(colorType == \"CouncilAbbreviation\") {\n if (val == \"CN\") {\n return \"#ff1c14\";\n } else if (val == \"CE\") {\n return \"#3b5998\";\n } else if (val == \"CF\") {\n return \"#2ea52a\";\n }\n // Colors for the genders\n } else if(colorType == \"GenderAsString\") {\n if (val == \"m\") {\n return \"#00FFFF\";\n } else if (val == \"f\") {\n return \"#FF69B4\";\n }\n // Colors for the Native languages\n } else if(colorType == \"NativeLanguage\") {\n if (val == \"I\") {\n return \"#009246\";\n } else if (val == \"D\") {\n return \"#FFCC1E\";\n } else if (val == \"F\") {\n return \"#002395\";\n } else if (val == \"Tr\") {\n return \"#E30A17\";\n } else if (val == \"Sk\") {\n return \"#489DD3\";\n } else if (val == \"RM\") {\n return \"#E2017B\";\n }\n // Colors for the Age Category\n } else if(colorType == \"AgeCategory\") {\n if (val == 0 || val == \"-20\") {\n return \"#a65628\";\n } else if (val == 1 || val == \"20-29\") {\n return \"#b3b000\";\n } else if (val == 2 || val == \"30-39\") {\n return \"#81b300\";\n } else if (val == 3 || val == \"40-49\") {\n return \"#00b399\";\n } else if (val == 4 || val == \"50-59\") {\n return \"#0087b3\";\n } else if (val == 5 || val == \"60-69\") {\n return \"#0060b3\";\n } else if (val == 6 || val == \"70+\") {\n return \"#0003ff\";\n }\n }\n}", "title": "" }, { "docid": "a9f47da0c35ca642ba61019c933c99c4", "score": "0.5926293", "text": "function shiftColor(color) { //---no other occurrence in this lib\n var red_hex = parseInt(color.substring(1,3),16);\n var green_hex = parseInt(color.substring(3,5),16);\n var blue_hex = parseInt(color.substring(5,7),16);\n\n// an older use\n// red_hex = Math.round(red_hex + 0.5*(255-red_hex));\n// green_hex = Math.round(green_hex + 1.0*(255-green_hex));\n// blue_hex = Math.round(blue_hex + 0.5*(255-blue_hex));\n green_hex = 255;\n\n if(red_hex<0) red_hex=0;\n if(green_hex<0) green_hex=0;\n if(blue_hex<0) blue_hex=0;\n if(red_hex>255) red_hex=255;\n if(green_hex>255) green_hex=255;\n if(blue_hex>255) blue_hex=255;\n\n if(red_hex<16) var red_hex_str = \"0\" + red_hex.toString(16);\n else var red_hex_str = red_hex.toString(16);\n if(green_hex<16) var green_hex_str = \"0\" + green_hex.toString(16);\n else var green_hex_str = green_hex.toString(16);\n if(blue_hex<16) var blue_hex_str = \"0\" + blue_hex.toString(16);\n else var blue_hex_str = blue_hex.toString(16);\n\n return \"#\" + red_hex_str + green_hex_str + blue_hex_str;\n }", "title": "" }, { "docid": "daad60ac4cecdfb652aaaa9a1acf6969", "score": "0.5918049", "text": "function chooseColors() {\n brushHue += 1;\n if (brushHue > 359) {\n brushHue = 0;\n }\n stroke(brushHue, 50, 80);\n fill(brushHue, 50, 80);\n}", "title": "" }, { "docid": "996ed5cd0bae94452e029d7ed97d32fb", "score": "0.5903525", "text": "function Color(red, green, blue, alpha = 1) {\n var _red = 0;\n var _green = 0;\n var _blue = 0;\n var _alpha = 1;\n\n function GetColorValue(c) {\n if (typeof c == \"string\") {\n var re = /^\\s*#([0-9a-fA-F]{1,2})\\s*$/g;\n var rlt = re.exec(c);\n if (rlt && rlt.length == 2) {\n return parseInt(rlt[1], 16);\n } else c = parseInt(c);\n }\n\n if (typeof c == \"number\") return c > 255 ? 255 : c < 0 ? 0 : c;\n else return 0;\n }\n\n var rtn = {\n get red() {\n return _red;\n },\n get r() {\n return _red;\n },\n set red(r) {\n _red = GetColorValue(r);\n },\n set r(r) {\n this.red = r;\n },\n get green() {\n return _green;\n },\n get g() {\n return _green;\n },\n set green(g) {\n _green = GetColorValue(g);\n },\n set g(g) {\n this.green = g;\n },\n get blue() {\n return _blue;\n },\n get b() {\n return _blue;\n },\n set blue(b) {\n _blue = GetColorValue(b);\n },\n set b(b) {\n this.blue = b;\n },\n get alpha() {\n return _alpha;\n },\n get a() {\n return _alpha;\n },\n set alpha(a) {\n _alpha = GetColorValue(a > 1 ? 1 : a < 0 ? 0 : a);\n },\n set a(a) {\n this.alpha = a;\n },\n equals(...other) {\n return equalsTo(['red', 'green', 'blue', 'alpha'], {red: _red, green: _green, blue: _blue, alpha: _alpha}, \n Color.apply(null, other));\n },\n get hex(){\n return `#${this.r.toString(16).toUpperCase().padStart(2,\"0\")}${this.g.toString(16).toUpperCase().padStart(2,\"0\")}${this.b.toString(16).toUpperCase().padStart(2,\"0\")}`\n },\n get rgb(){\n return `rgb(${this.r}, ${this.g}, ${this.b})`\n },\n get rgba(){\n return `rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`\n },\n get name(){\n return hexColorNames[this.hex];\n },\n }\n\n if (typeof red == \"string\") {\n var re = /^\\s*#([0-9a-fA-F]{1,8})\\s*$/g;\n var rlt = re.exec(red);\n if (rlt && rlt.length == 2) {\n if (rlt[1].length == 1) rlt[1] = \"0\" + rlt[1];\n if (rlt[1].length == 2) rlt[1] = rlt[1] + rlt[1] + rlt[1];\n else if (rlt[1].length == 3) rlt[1] = rlt[1].split(\"\").map(c => c+c).join(\"\");\n if (rlt[1].length <= 6) {\n for (; rlt[1].length < 6;) rlt[1] = \"0\" + rlt[1];\n for (; rlt[1].length < 8;) rlt[1] = \"f\" + rlt[1];\n }\n for (; rlt[1].length < 8;) rlt[1] = \"0\" + rlt[1];\n\n _alpha = parseInt(rlt[1].substring(0, 2), 16) / 255.0;\n _red = parseInt(rlt[1].substring(2, 4), 16);\n _green = parseInt(rlt[1].substring(4, 6), 16);\n _blue = parseInt(rlt[1].substring(6), 16);\n return rtn;\n } else {\n var re = /^rgba*\\((\\d{1,3}\\.*\\d*),\\s*(\\d{1,3}\\.*\\d*),\\s*(\\d{1,3}\\.*\\d*),*\\s*(\\d*\\.*\\d*)\\)$/g;\n var rlt = re.exec(red);\n if (rlt && rlt.length == 5) {\n if(rlt[4] == \"\") rlt[4] = \"1\";\n for (var i = 1; i < 5; i++) {\n rlt[i] = parseFloat(rlt[i]);\n }\n _red = rlt[1];\n _green = rlt[2];\n _blue = rlt[3];\n _alpha = rlt[4];\n return rtn;\n } else {\n var clr = namedColors[red.toLowerCase()];\n if (clr) {\n _red = clr[0];\n _green = clr[1];\n _blue = clr[2];\n _alpha = 1;\n return rtn;\n }\n }\n }\n }\n\n var t = toNumberObject([\"red\", \"green\", \"blue\", \"alpha\"], red, green, blue, alpha);\n\n _red = t.red;\n _green = t.green;\n _blue = t.blue;\n _alpha = t.alpha;\n return rtn;\n}", "title": "" }, { "docid": "2bb9a030845e91ff417aca95b8caff89", "score": "0.5873394", "text": "function complementColor(_0xRRGGBB){\n\tvar complement = 0xffffff ^ _0xRRGGBB;\n}", "title": "" }, { "docid": "6b984e5c3b18ad0af5afaab7e5d0fb91", "score": "0.585679", "text": "function bindMouseOver2(firstColor, secondColor, thisColor){\n\tvar checkTr=$(\"table input[type=checkbox]\").parent().parent();\n\t\tcheckTr.each(function(index){\n\t\t!(index & 1) && $(this).children().css(\"backgroundColor\", secondColor);\n\t\t!(index & 1) && $(this).next().children().css(\"backgroundColor\", secondColor);\n\t\t$(this).bind(\"mouseover\", function(j){\n\t\t$(this).children().css(\"backgroundColor\", thisColor);\n\t\t$(this).next().children().css(\"backgroundColor\", thisColor);\n\t\t});\n\t\t$(this).next().bind(\"mouseover\", function(j){\n\t\t$(this).children().css(\"backgroundColor\", thisColor);\n\t\t$(this).prev().children().css(\"backgroundColor\", thisColor);\n\t\t});\n\t\t$(this).bind(\"mouseout\", function(){\n\t\tindex & 1 ? $(this).children().css(\"backgroundColor\", firstColor) : $(this).children().css(\"backgroundColor\", secondColor);\n\t\tindex & 1 ?$(this).next().children().css(\"backgroundColor\", firstColor) :$(this).next().children().css(\"backgroundColor\", secondColor);\n\t\t});\n\t\t$(this).next().bind(\"mouseout\", function(){\n\t\tindex & 1 ? $(this).children().css(\"backgroundColor\", firstColor) : $(this).children().css(\"backgroundColor\", secondColor);\n\t\tindex & 1 ?$(this).prev().children().css(\"backgroundColor\", firstColor) :$(this).prev().children().css(\"backgroundColor\", secondColor);\n\t\t});\n\t\n});\n}", "title": "" }, { "docid": "b1dd408885ebe4815df8ed443542a3e4", "score": "0.58224726", "text": "function changeColor() {\n //selects and assigns the values from each slider\n var r = $(\"#red\").val();\n var g = $(\"#green\").val();\n var b = $(\"#blue\").val();\n \n //sets the spam color to the combination of all the slide colors\n $(\"#newColor\").css(\"background-color\", \"rgb(\" + r + \",\" + g + \",\" + b + \")\");\n}", "title": "" }, { "docid": "e65e4ab1d8b92f65a7cba6fa91f3e1d2", "score": "0.5820982", "text": "function randomColorInputs() {\n targetColor1.value = '#' + genHex(6);\n targetColor2.value = '#' + genHex(6);\n}", "title": "" }, { "docid": "c2f6cda25d9a6393defec1ab6b63365e", "score": "0.58101326", "text": "function gclx(cs) { ifsx=Math.floor(cs/1000); cs=cs-ifsx*1000;ifs=(11*(9-ifsx))/100;prgbtx=\",\"+ifs.toString()+\") \";\n ifs=Math.floor(cs/100); cs=cs-ifs*100; pclrs=chex[ifs]+\",\";\n ifs=Math.floor(cs/10); cs=cs-ifs*10; pclrs+=chex[ifs]+\",\"+chex[cs]; \n pcolors=\"color:rgb(\"+pclrs+\"); \"; prgbx=\"rgba(\"+pclrs; }", "title": "" }, { "docid": "3660c1eb277042edeb1f51102b2e2a81", "score": "0.5809634", "text": "function encodePickingColor(i) {\n return [i + 1 & 255, i + 1 >> 8 & 255, i + 1 >> 16 & 255];\n} // Decodes a picking color in [r, g, b] format to an index", "title": "" }, { "docid": "f0c638bb4f8b9d242f32fee0696ac5fe", "score": "0.5803961", "text": "function getcolor(x){\n var color = \"\";\n if (x>= 20) {\n color = \"green\";\n }\n\n else if (x >= 15 & x <20) {\n color = \"yellow\";\n }\n\n else if (x >= 10 & x <15) {\n color = \"orange\";\n }\n\n else {\n color = \"red\";\n }\n return color\n }", "title": "" }, { "docid": "6147c8da9fe53649be7becb18e0659ed", "score": "0.5796799", "text": "function colorLibraryBjornPeters() {\n\n let settings = {\n headerColorSelector: '.header-color',\n mainColorSelector: '.main-color',\n accentColorSelector: '.accent-color'\n };\n\n let headerColor = '#303F9F';\n let mainColor = '#3F51B5';\n let accentColor = '#FF5252';\n\n let arraycolors = [\"red\", \"pink\", \"purple\", \"deeppurple\", \"indigo\", \"blue\", \"lightblue\", \"cyan\", \"teal\", \"green\", \"lightgreen\", \"lime\", \"yellow\", \"amber\", \"orange\", \"deeporange\", \"brown\", \"grey\", \"bluegrey\"];\n\n let headercolors = [\"#D32F2F\", \"#C2185B\", \"#7B1FA2\", \"#512DA8\", \"#303F9F\", \"#1976D2\", \"#0288D1\", \"#0097A7\", \"#00796B\", \"#388E3C\", \"#689F38\", \"#AFB42B\", \"#FBC02D\", \"#FFA000\", \"#F57C00\", \"#E64A19\", \"#5D4037\", \"#616161\", \"#455A64\"];\n let maincolors = [\"#F44336\", \"#E91E63\", \"#9C27B0\", \"#673AB7\", \"#3F51B5\", \"#2196F3\", \"#03A9F4\", \"#00BCD4\", \"#009688\", \"#4CAF50\", \"#8BC34A\", \"#CDDC39\", \"#FFEB3B\", \"#FFC107\", \"#FF9800\", \"#FF5722\", \"#795548\", \"#9E9E9E\", \"#607D8B\"];\n let accentcolors = [\"#FF5252\", \"#FF4081\", \"#E040FB\", \"#7C4DFF\", \"#536DFE\", \"#448AFF\", \"#03A9F4\", \"#00BCD4\", \"#009688\", \"#4CAF50\", \"#8BC34A\", \"#CDDC39\", \"#FFEB3B\", \"#FFC107\", \"#FF9800\", \"#FF5722\", \"#795548\", \"#9E9E9E\", \"#607D8B\"];\n\n let headerElements = document.querySelectorAll(settings.headerColorSelector);\n let mainElements = document.querySelectorAll(settings.mainColorSelector);\n let accentElements = document.querySelectorAll(settings.accentColorSelector);\n\n //header colors\n function headerColorFunc() {\n for (let i = 0; i < headerElements.length; i++) {\n // We need this i later. So let's put it in a variable\n let ibeforeheader = i;\n for (let i = 0; i < arraycolors.length; i++) {\n //The classname should have \"header-color color-of-your-chose\" so we split \"header-color\" without the \",\". The comma is removed because we used .join('')\n let getColor = headerElements[ibeforeheader].className.split(\"header-color \").join('');\n if (getColor === arraycolors[i]) {\n headerColor = headercolors[i];\n //we have two different i's so we use the ibefore i to get the right headerElements\n headerElements[ibeforeheader].style.backgroundColor = headerColor;\n } else {\n headerElements[ibeforeheader].style.backgroundColor = headerColor;\n }\n }\n }\n } headerColorFunc();\n\n //main colors\n function mainColorFunc() {\n for (let i = 0; i < mainElements.length; i++) {\n let ibeforemain = i;\n for (let i = 0; i < arraycolors.length; i++) {\n let getColor = mainElements[ibeforemain].className.split(\"main-color \").join('');\n if (getColor === arraycolors[i]) {\n mainColor = maincolors[i];\n mainElements[ibeforemain].style.backgroundColor = mainColor;\n } else {\n mainElements[ibeforemain].style.backgroundColor = mainColor;\n }\n }\n }\n } mainColorFunc();\n\n //accent colors\n function accentColorFunc() {\n for (let i = 0; i < accentElements.length; i++) {\n let ibeforeaccent = i;\n for (let i = 0; i < arraycolors.length; i++) {\n let getColor = accentElements[ibeforeaccent].className.split(\"accent-color \").join('');\n if (getColor === arraycolors[i]) {\n accentColor = accentcolors[i];\n accentElements[ibeforeaccent].style.backgroundColor = accentColor;\n } else {\n accentElements[ibeforeaccent].style.backgroundColor = accentColor;\n }\n }\n }\n } accentColorFunc();\n\n}", "title": "" }, { "docid": "23056129751fd756f26a55558254bf18", "score": "0.5779956", "text": "function joinColor(colors){\r\n var result = \"\";\r\n for( var i = 0; i<colors.length; i++) \r\n }\r\n }", "title": "" }, { "docid": "1d4368403feff1b458b481f47fb964c2", "score": "0.5769534", "text": "function generateColorClass(){\n var rgbNumbers = rgbCode();\n var color = \"rgb(\";\n\n for ( var i = 0; i < rgbNumbers.length; i++ ) {\n var oneCode = rgbNumbers[i];\n if ( i < 2 ) {\n color += oneCode + \", \";\n } else {\n color += oneCode;\n } \n }\n color += \")\"\n // console.log(color);\n return color;\n}", "title": "" }, { "docid": "4dbbb6852aec63389200e315b7d7ce07", "score": "0.57653016", "text": "function colorCombine(r, g, b, w) {\n return ((w & 0xff) << 24) + ((b & 0xff) << 16) + ((g & 0xff) << 8) + (r & 0xff)\n}", "title": "" }, { "docid": "78fd422b122246804d765926a4559d53", "score": "0.57592404", "text": "function getExtendedColors(numbers) {\n let r;\n let g;\n let b;\n const n = numbers.shift();\n if (n === 2 && numbers.length >= 3) {\n // 24-bit RGB\n r = numbers.shift();\n g = numbers.shift();\n b = numbers.shift();\n if ([r, g, b].some(c => c < 0 || 255 < c)) {\n throw new RangeError('Invalid range for RGB colors');\n }\n }\n else if (n === 5 && numbers.length >= 1) {\n // 256 colors\n const idx = numbers.shift();\n if (idx < 0) {\n throw new RangeError('Color index must be >= 0');\n }\n else if (idx < 16) {\n // 16 default terminal colors\n return idx;\n }\n else if (idx < 232) {\n // 6x6x6 color cube, see https://stackoverflow.com/a/27165165/500098\n r = Math.floor((idx - 16) / 36);\n r = r > 0 ? 55 + r * 40 : 0;\n g = Math.floor(((idx - 16) % 36) / 6);\n g = g > 0 ? 55 + g * 40 : 0;\n b = (idx - 16) % 6;\n b = b > 0 ? 55 + b * 40 : 0;\n }\n else if (idx < 256) {\n // grayscale, see https://stackoverflow.com/a/27165165/500098\n r = g = b = (idx - 232) * 10 + 8;\n }\n else {\n throw new RangeError('Color index must be < 256');\n }\n }\n else {\n throw new RangeError('Invalid extended color specification');\n }\n return [r, g, b];\n }", "title": "" }, { "docid": "50c1e916a7e3a1365c02728d39f84e0c", "score": "0.57590455", "text": "function initColorPicker() {\n [1, 2, 3].map(function(no) {\n $(\"#step\" + no).spectrum({\n color: \"rgb(\" + currentColor[no-1].join(\",\") + \")\",\n showButtons: false,\n move: function(c) { \n c = c.toRgb();\n currentColor[no-1] = [c.r, c.g, c.b];\n updateTransferFunction(currentColor, currentRatio);\n }\n });\n })\n}", "title": "" }, { "docid": "69510567bdc742af497258be04b79f53", "score": "0.575822", "text": "function __colourHash(red, green, blue) {\n return [red.toString(16), green.toString(16), blue.toString(16)].join();\n }", "title": "" }, { "docid": "9f5ef607f8ccf7ee2162adbb41c331a2", "score": "0.5755364", "text": "function injectSwatches(newColor, colorString) {\n var variant1 = new Color();\n var variant2 = new Color();\n var variant3 = new Color();\n\n\t// Set HSL of variants, changes the swatches to variant color, and adds text that displays the RGB and hex numbers\n\t//of the variants\n\tfor(var i = 1; i < 4; i++) {\n\t\tvar multiplier = (22.5 * i);\n\t\t\n\t\tif (i == 1) {\n\t\t\tif (newColor.h + multiplier > 360) {\n\t\t\t\tvariant1.setHSL(newColor.h + multiplier - 360, newColor.s, newColor.l);\n\t\t\t} else {\n\t\t\t\tvariant1.setHSL(newColor.h + multiplier, newColor.s, newColor.l);\n\t\t\t}\n\n var variantString1 = \"rgb(\" + variant1.r + \",\" + variant1.g + \",\" + variant1.b + \")\";\n $('p.black, p.white', '#1').text(variantString1 + ' OR ' + variant1.hex);\n //newSwatch\n $('#1').css('background-color', variantString1);\n\n\t\t} else if (i == 2) {\n\t\t\tif (newColor.h + multiplier > 360) {\n\t\t\t\tvariant2.setHSL(newColor.h + multiplier - 360, newColor.s, newColor.l);\n\t\t\t} else {\n\t\t\t\tvariant2.setHSL(newColor.h + multiplier, newColor.s, newColor.l);\n\t\t\t}\n\n var variantString2 = \"rgb(\" + variant2.r + \",\" + variant2.g + \",\" + variant2.b + \")\";\n $('p.black, p.white', '#2').text(variantString2 + ' OR ' + variant2.hex);\n //newSwatch\n $('#2').css('background-color', variantString2);\n\n\t\t} else {\n\t\t\tif (newColor.h + multiplier > 360) {\n\t\t\t\tvariant3.setHSL(newColor.h + multiplier - 360, newColor.s, newColor.l);\n\n\t\t\t} else {\n\t\t\t\tvariant3.setHSL(newColor.h + multiplier, newColor.s, newColor.l);\n\t\t\t}\n\n var variantString3 = \"rgb(\" + variant3.r + \",\" + variant3.g + \",\" + variant3.b + \")\";\n $('p.black, p.white', '#3').text(variantString3 + ' OR ' + variant3.hex);\n //newSwatch\n $('#3').css('background-color', variantString3);\n\t\t}\n\t}\n\t\n\t// Update the colors on the preview page\n\t$('#header, #footer').css('background-color', variantString3);\n\t$('#preview').css('background-color', colorString);\n\t$('#preview section').css('background-color', variantString2);\n\t$('#preview aside').css('background-color', variantString1);\n}", "title": "" }, { "docid": "f730ae4296fb31bc9ea54e5661ff629f", "score": "0.57502735", "text": "function showCombo(c1, c2, c3) {\n c1.style.backgroundColor = '#54D17A';\n c2.style.backgroundColor = '#54D17A';\n c3.style.backgroundColor = '#54D17A';\n}", "title": "" }, { "docid": "0d52709e5bd9b97f14a2470202429fd9", "score": "0.5748947", "text": "function shadeBlend(p, c0, c1) {\n let n = p < 0 ? p * -1 : p,\n u = Math.round,\n w = parseInt;\n let f = w(c0.slice(1), 16),\n t = w((c1 ? c1 : p < 0 ? \"#000000\" : \"#FFFFFF\").slice(1), 16),\n R1 = f >> 16,\n G1 = f >> 8 & 0x00FF,\n B1 = f & 0x0000FF;\n\n if (R1 > 255 || G1 > 255 || B1 > 255)\n return '#FFFFFF';\n\n return \"#\" + (0x1000000 + (u(((t >> 16) - R1) * n) + R1) * 0x10000 + (u(((t >> 8 & 0x00FF) - G1) * n) + G1) * 0x100 + (u(((t & 0x0000FF) - B1) * n) + B1)).toString(16).slice(1)\n}", "title": "" }, { "docid": "8d038810953fd39225432bd8ee1ef4f5", "score": "0.57478625", "text": "setColor(datum) {\n let sum = datum.a + datum.b + 1;\n let mix = ShadeBlendAndConvert.pSBC(this.getMixScale(datum.a / sum),\n MapConst.colorA, MapConst.colorB, true); //use linear pSBC mixing\n let shade = ShadeBlendAndConvert.pSBC(this.getGreyScale(sum), mix, false, true); //use linear pSBC mixing\n return shade;\n }", "title": "" }, { "docid": "44293945785a09575b46969ca757ba0f", "score": "0.5711803", "text": "function generateMainColors(){\n for(var i = 0; i < mode; i++){\n colorDisplay[i].style.backgroundColor = rgbColorGenerator();\n }\n }", "title": "" }, { "docid": "44ea4fe9d5ded4bbe0bf4a425af3f7a1", "score": "0.5709818", "text": "function reduceColor(start, factor) {\n if (start.substring(0,1) == \"#\") {\n var red = start.substring(1, 3);\n var green = start.substring(3, 5);\n var blue = start.substring(5, 7);\n if (start.length < 5) {\n red = start.substring(1,2);\n green = start.substring(2,3);\n blue = start.substring(3,4);\n } \n red = Math.max(parseInt(red, 16) - 16*factor, 0).toString(16);\n if (red.length < 2) {\n red = \"0\" + red;\n }\n blue = Math.max(parseInt(blue, 16) - 16*factor, 0).toString(16);\n if (blue.length < 2) {\n blue = \"0\" + blue;\n }\n green = Math.max(parseInt(green, 16) - 16*factor, 0).toString(16);\n if (green.length < 2) {\n green = \"0\" + green;\n }\n return \"#\" + red + green + blue;\n } else if (start == \"black\") {\n return \"#191616\";\n } else if (start == \"white\") {\n return \"#f5f5f5\";\n } else {\n return start;\n }\n \n\n}", "title": "" }, { "docid": "62d6fd2df9c99f22ac648ad4cb7b5787", "score": "0.5704264", "text": "function colorGrabber(magnitude) {\n if (magnitude > 5) {\n return 'red'\n } else if (magnitude > 4) {\n return 'orange'\n } else if (magnitude > 3) {\n return 'yellow'\n } else if (magnitude > 2) {\n return 'lightgreen'\n } else if (magnitude > 1) {\n return 'green'\n } else {\n return '#58C9CB'\n }\n}", "title": "" }, { "docid": "5af15155b2648b148f9a7093e43291eb", "score": "0.5702173", "text": "combineSimilarColors() {\n const combinedColorMap = new Map()\n \n let previousColor, previousCount\n this.formatAndGroupColors().forEach((currentCount, currentColor) => {\n\n if (!previousColor) {\n previousColor = currentColor\n previousCount = currentCount\n return \n }\n\n const currentRgbaValues = this.parseColorString(currentColor)\n const previousRgbaValues = this.parseColorString(previousColor)\n \n if (!previousRgbaValues || !currentRgbaValues) return\n\n const colorsAreSimilar = this.compareColorValues(currentRgbaValues, previousRgbaValues)\n let count = currentCount\n\n if (colorsAreSimilar) count = previousCount + currentCount\n\n if (count < COUNT_MIN) return\n combinedColorMap.set(currentColor, count)\n previousColor = currentColor\n previousCount = currentCount\n return\n })\n\n return combinedColorMap\n }", "title": "" }, { "docid": "cade81888d20e8352f73a46dc07ebf5a", "score": "0.5698586", "text": "function colors(d) {\nif (d < 1){\n return \"#B7DF5F\"\n}\nelse if ( d < 2){\n return \"#DCED11\"\n}\nelse if (d < 3){\n return \"#EDD911\"\n}\nelse if (d < 4){\n return \"#EDB411\"\n}\nelse if (d < 5 ){\n return \"#ED7211\"\n}\nelse {\n return \"#ED4311\"\n}\n}", "title": "" }, { "docid": "4e3e9edda5c8f50d5c994d6f9d1642df", "score": "0.5677776", "text": "function getColor(a) {\n return a == 5 ? '#a50f15' :\n a == 4 ? '#de2d26' :\n a == 3 ? '#fb6a4A' :\n a == 2 ? '#fcae91' :\n '#fee5d9';\n}", "title": "" }, { "docid": "0b58bbf878a2a69b67adf1a1933efb29", "score": "0.5677529", "text": "function get3DiffColors(){\n\tvar threecolors=[];\n\tgetColor: for(i=0; i<3;i++){\n\t\tvar randomColor = \"rgb(\"+Math.floor(Math.random()*256)+\", \"+Math.floor(Math.random()*256)+\", \"+Math.floor(Math.random()*256)+\")\";\n\t\tif(randomColor !=\"rgb(254, 166, 0)\"){\n\t\t\tif(threecolors.indexOf(randomColor)=== -1){\n\t\t\t\tthreecolors.push(randomColor);\n\t\t\t}else{ continue getColor;}\n\t\t}else{ continue getColor;}\n\t\t\n\t}\n\treturn threecolors;\n}", "title": "" }, { "docid": "821c61ab0f258b6a35cbdd0f6383121d", "score": "0.5676928", "text": "function drawNewColors() {\n var canvas = document.getElementById('canvas');\n var ctx = canvas.getContext('2d');\n var canvasWidth = canvas.width;\n var canvasHeight = canvas.height;\n \n const color48 = '#' + $('#color48')[0].jscolor.toString();\n const color49 = '#' + $('#color49')[0].jscolor.toString();\n const color62 = '#' + $('#color62')[0].jscolor.toString();\n const color72 = '#' + $('#color72')[0].jscolor.toString();\n //console.log(color48, color49, color62, color72);\n\n drawNewColor(ctx, canvasWidth, canvasHeight, color48, 'canvas1');\n drawNewColor(ctx, canvasWidth, canvasHeight, color49, 'canvas2');\n drawNewColor(ctx, canvasWidth, canvasHeight, color62, 'canvas3');\n drawNewColor(ctx, canvasWidth, canvasHeight, color72, 'canvas4');\n}", "title": "" }, { "docid": "eb593039f634027adc840e53e6653113", "score": "0.56708086", "text": "function initSliderColors(){\n sliderFill(red);\n sliderFill(green);\n sliderFill(blue);\n}", "title": "" }, { "docid": "b78d47408ec26f5f8e34ede1ba5bee94", "score": "0.566856", "text": "function merge_colors(hex) {\n var merge = [];\n for (i = 0; i < 3; i++) {\n color = parseInt(hex.substr(1 + i * 2, 2), 16);\n merge.push((color + rgb_base_color[i] + rgb_base_color[i]) / 3);\n }\n\n return `rgba(${merge.join(', ')})`;\n}", "title": "" }, { "docid": "b59f4674a971fa87d5d3c523cab9dc20", "score": "0.56569093", "text": "function getColor(i) {\n return i > 5 ? '#F30' :\n i > 4 ? '#F60' :\n i > 3 ? '#F90' :\n i > 2 ? '#FC0' :\n i > 1 ? '#FF0' :\n '#9F3';\n }", "title": "" }, { "docid": "9e19f140eddd9616a84858bea30f926d", "score": "0.5655163", "text": "function setDivColor(x, y) {\n // add more compex algorithms\n let rgbColor = 'rgb(255,' + x % 255 + ', ' + y % 255 + ')'\n return rgbColor;// returns the string above\n}", "title": "" }, { "docid": "b4c6cec1b8b39923f6109ab5ca493a70", "score": "0.56541395", "text": "function ChangeColor(val) {\r\n\tvar styles = \"\";\r\n\t\r\n\tif(val == 0) { //book\r\n\t\tstyles = '.adenosine { background-color: rgb(255,43,8); /* red */ } .thymine { background-color: rgb(0,188,13); /* green */ } .cytosine { background-color: rgb(0,154,255); /* blue */ } .guanine { background-color: rgb(255,181,7); /* orange */ }' \r\n\t} else if(val == 4) { //color by chemistry\r\n\t\tstyles = '.adenosine { background-color: rgb(255,109,109); /* red */ } .thymine { background-color: rgb(116,206,152); /* green */ } .cytosine { background-color: rgb(118,157,204); /* blue */ } .guanine { background-color: rgb(242,190,60); /* orange */ }' \r\n\t} else if(val == 3) { //shapely\r\n\t\tstyles = '.adenosine { background-color: rgb(160,160,255); /* purple */ } .thymine { background-color: rgb(160,255,160); /* green */ } .cytosine { background-color: rgb(255,140,75); /* orange */ } .guanine { background-color: rgb(255,112,122); /* red */ }' \r\n\t} else if(val == 2) { //taylor\r\n\t\tstyles = '.adenosine { background: none; background-color: rgb(102,255,0); /* green */ } .thymine { background: none; background-color: rgb(255,51,0); /* red */ } .cytosine { background: none; background-color: rgb(255,255,0); /* yellow */ } .guanine { background: none; background-color: rgb(102,0,255); /* purple */ }' \r\n\t} else if(val == 1) { //patterns\r\n\t\tstyles = '.adenosine { background-color: white; background: url(\"img/patt1.png\"); background-repeat: no-repeat; background-size: 100% 100%;} .thymine { background-color: white; background: url(\"img/patt4.png\"); background-repeat: no-repeat; background-size: 100% 100%;} .cytosine { background-color: white; background: url(\"img/patt3.png\"); background-repeat: no-repeat; background-size: 100% 100%;} .guanine { background-color: white; background: url(\"img/patt2.png\"); background-repeat: no-repeat; background-size: 100% 100%;}' \r\n\t} \r\n\t\r\n\tvar css = document.createElement('style'); \r\n\tcss.type = 'text/css'; \r\n \r\n\tif(css.styleSheet) \r\n\t\tcss.styleSheet.cssText = styles; \r\n\telse \r\n\t\tcss.appendChild(document.createTextNode(styles)); \r\n\t \r\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(css); \r\n}", "title": "" }, { "docid": "9a5f9ef8c7c2eb990ed955471d5b392b", "score": "0.5649889", "text": "function lightAllColors() {\n $(greenPad).addClass(\"green-light\");\n $(redPad).addClass(\"red-light\");\n $(yellowPad).addClass(\"yellow-light\");\n $(bluePad).addClass(\"blue-light\");\n}", "title": "" }, { "docid": "6c37cabe9c325b8f0ceb5fade305aaf3", "score": "0.5645465", "text": "operate(env, op, other) {\n var result = [];\n\n if (!(other instanceof CartoCSS.Tree.Color)) {\n other = other.toColor();\n }\n\n for (var c = 0; c < 3; c++) {\n result[c] = CartoCSS.Tree.operate(op, this.rgb[c], other.rgb[c]);\n }\n return new CartoCSS.Tree.Color(result);\n }", "title": "" }, { "docid": "386461e5d1673d6130a365581f83be54", "score": "0.5643571", "text": "function setColor(iterations) {\n switch (COLOR_SELECTOR){\n case 0:\n return juliaColors(iterations);\n case 1:\n return spectrumCycle(iterations);\n case 2:\n return burningColors(iterations);\n case 3:\n return singleHueStraightR(iterations);\n case 4:\n return singleHueStraightG(iterations);\n case 5:\n return singleHueStraightB(iterations);\n case 6:\n return singleHueStraightP(iterations);\n case 7:\n return singleHueStraightY(iterations);\n case 8:\n return singleHueStraightC(iterations);\n case 9:\n return singleHueStraightW(iterations);\n default:\n return spectrumCycle(iterations);\n } // switch \n}", "title": "" }, { "docid": "308e50be0353be78ef6296f10f57a45a", "score": "0.56417394", "text": "function colorGreen() {\r\r // =======================================================\r var idsetd = charIDToTypeID( \"setd\" );\r var desc999 = new ActionDescriptor();\r var idnull = charIDToTypeID( \"null\" );\r var ref347 = new ActionReference();\r var idPrpr = charIDToTypeID( \"Prpr\" );\r var idLefx = charIDToTypeID( \"Lefx\" );\r ref347.putProperty( idPrpr, idLefx );\r var idLyr = charIDToTypeID( \"Lyr \" );\r var idOrdn = charIDToTypeID( \"Ordn\" );\r var idTrgt = charIDToTypeID( \"Trgt\" );\r ref347.putEnumerated( idLyr, idOrdn, idTrgt );\r desc999.putReference( idnull, ref347 );\r var idT = charIDToTypeID( \"T \" );\r var desc1000 = new ActionDescriptor();\r var idScl = charIDToTypeID( \"Scl \" );\r var idPrc = charIDToTypeID( \"#Prc\" );\r desc1000.putUnitDouble( idScl, idPrc, 100.000000 );\r var idSoFi = charIDToTypeID( \"SoFi\" );\r var desc1001 = new ActionDescriptor();\r var idenab = charIDToTypeID( \"enab\" );\r desc1001.putBoolean( idenab, true );\r var idMd = charIDToTypeID( \"Md \" );\r var idBlnM = charIDToTypeID( \"BlnM\" );\r var idNrml = charIDToTypeID( \"Nrml\" );\r desc1001.putEnumerated( idMd, idBlnM, idNrml );\r var idOpct = charIDToTypeID( \"Opct\" );\r var idPrc = charIDToTypeID( \"#Prc\" );\r desc1001.putUnitDouble( idOpct, idPrc, 100.000000 );\r var idClr = charIDToTypeID( \"Clr \" );\r var desc1002 = new ActionDescriptor();\r var idRd = charIDToTypeID( \"Rd \" );\r desc1002.putDouble( idRd, 2.474708 );\r var idGrn = charIDToTypeID( \"Grn \" );\r desc1002.putDouble( idGrn, 210.000003 );\r var idBl = charIDToTypeID( \"Bl \" );\r desc1002.putDouble( idBl, 65.945522 );\r var idRGBC = charIDToTypeID( \"RGBC\" );\r desc1001.putObject( idClr, idRGBC, desc1002 );\r var idSoFi = charIDToTypeID( \"SoFi\" );\r desc1000.putObject( idSoFi, idSoFi, desc1001 );\r var idLefx = charIDToTypeID( \"Lefx\" );\r desc999.putObject( idT, idLefx, desc1000 );\r executeAction( idsetd, desc999, DialogModes.NO );\r\r // =======================================================\r var idsetd = charIDToTypeID( \"setd\" );\r var desc14 = new ActionDescriptor();\r var idnull = charIDToTypeID( \"null\" );\r var ref10 = new ActionReference();\r var idLyr = charIDToTypeID( \"Lyr \" );\r var idOrdn = charIDToTypeID( \"Ordn\" );\r var idTrgt = charIDToTypeID( \"Trgt\" );\r ref10.putEnumerated( idLyr, idOrdn, idTrgt );\r desc14.putReference( idnull, ref10 );\r var idT = charIDToTypeID( \"T \" );\r var desc15 = new ActionDescriptor();\r var idClr = charIDToTypeID( \"Clr \" );\r var idClr = charIDToTypeID( \"Clr \" );\r var idGrn = charIDToTypeID( \"Grn \" );\r desc15.putEnumerated( idClr, idClr, idGrn );\r var idLyr = charIDToTypeID( \"Lyr \" );\r desc14.putObject( idT, idLyr, desc15 );\r executeAction( idsetd, desc14, DialogModes.NO );\r\r}", "title": "" }, { "docid": "13941a5a5a1703ad77a432854623c0e8", "score": "0.5634717", "text": "function colorCombine(r, g, b) {\n return ((r & 0xff) << 16) + ((g & 0xff) << 8) + (b & 0xff)\n}", "title": "" }, { "docid": "6a033553cec4e94fe44f9bc954e6da41", "score": "0.5633421", "text": "color_partial(x, min, max) {\n if (min === undefined) { min = 0; }\n if (max === undefined) { max = 255; }\n const dir = x > 0 ? 1 : -1\n return math.round(min + (max - min) * (2 * sigmoid(dir * 5*x) - 1));\n }", "title": "" }, { "docid": "ea57effac3a6ff8778fc8485ca76fe8a", "score": "0.562939", "text": "function randomizeColors(gen_new_colors, received_colors, applet, r, g, b) {\n //cur_xml = appletName.getXML(); \n var minimum = 0, maximum = 255, colors = [], i;\n var default_point = [0,0,255];\n var default_line = [153,51,0];\n var regex = /[a-z]+/\n\n //If Colors Already Generated then Use the Colors sent in the Parameter\n if(gen_new_colors == true)\n {\n if (r != undefined && g != undefined && b != undefined){\n colors.push(r, g, b);\n } else {\n for(i = 0; i < 3; i++){\n colors.push(Math.floor(Math.random() * (maximum - minimum + 1)) + minimum);\n } //this is your color\n }\n }\n else\n {\n colors = received_colors;\n }\n\n applet.unregisterUpdateListener(\"checkUser\");\n var numelems = applet.getObjectNumber();\n for (i = 0; i < numelems; i++){\n var name = applet.getObjectName(i);\n if(r == \"default\"){\n if (regex.exec(name)){\n if(applet.getColor(name) != \"#\" + rgbToHex(default_line[0], default_line[1], default_line[2])){\n //console.log(\"Updating color for obj \" + name);\n applet.setColor(name, default_line[0], default_line[1], default_line[2]); \n }\n } else {\n if(applet.getColor(name) != \"#\" + rgbToHex(default_point[0], default_point[1], default_point[2])){\n //console.log(\"Updating color for obj \" + name);\n applet.setColor(name, default_point[0], default_point[1], default_point[2]); \n }\n }\n } else if(applet.getColor(name) != \"#\" + rgbToHex(colors[0], colors[1], colors[2])){\n //console.log(\"Updating color for obj \" + name);\n applet.setColor(name, colors[0], colors[1], colors[2]); \n }\n }\n applet.registerUpdateListener(\"checkUser\");\n return colors;\n}", "title": "" }, { "docid": "73f7a35d47d0a5ae1c613ec005c420b6", "score": "0.5626676", "text": "function displayColors(){\n\tconst selectedColor = `rgb(${red.value}, ${green.value}, ${blue.value})`;\n document.querySelector(\"#color-display\").style.backgroundColor = selectedColor; \n\tdocument.querySelector(\".arrow\").style.borderColor = selectedColor;\n\treturn selectedColor;\n}", "title": "" }, { "docid": "49510baa01578d8abf40227abc8626ca", "score": "0.5623743", "text": "colorTest() {\n this.helperMethod()\n this.eq(\"green\", \"green\")\n this.eq(\"blue\", \"blue\")\n this.ne(\"blue\", \"green\")\n this.lt(\"blue\", \"green\")\n }", "title": "" }, { "docid": "4f31aa37b51197ff29fc83bba7c60754", "score": "0.56214243", "text": "colorHex_(){\n var color = \"\";\n for(var index=0;index<6;index++){\n color= color + this.generar_();\n }\n return \"#\"+color;\n }", "title": "" }, { "docid": "d4785e0927ef89bc653e0b98aa5df2bb", "score": "0.5620248", "text": "function pickHex(color1, color2, weight) {\n var w1 = weight;\n var w2 = 1 - w1;\n var rgb = [Math.round(color1[0] * w1 + color2[0] * w2),\n Math.round(color1[1] * w1 + color2[1] * w2),\n Math.round(color1[2] * w1 + color2[2] * w2)];\n return rgb;\n}", "title": "" }, { "docid": "1f5bc970275363cde7b0002082edf12d", "score": "0.56148785", "text": "function uniteColors(color, num){\n\tfor (i = 0; i < num; i++){\n\t\tsq[i].style.backgroundColor = color\n\t}\n\tcont_1.style.backgroundColor=color\n}", "title": "" }, { "docid": "bcef73109fd244ec307df09703186834", "score": "0.56064767", "text": "function calculateColor(begin, end, pos) {\r\n\t\tvar color = 'rgb' + ($.support['rgba'] ? 'a' : '') + '('\r\n\t\t\t\t+ parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ','\r\n\t\t\t\t+ parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ','\r\n\t\t\t\t+ parseInt((begin[2] + pos * (end[2] - begin[2])), 10);\r\n\t\tif ($.support['rgba']) {\r\n\t\t\tcolor += ',' + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1);\r\n\t\t}\r\n\t\tcolor += ')';\r\n\t\treturn color;\r\n\t}", "title": "" }, { "docid": "83ba8b8c52fafd490c3147d33460ab2d", "score": "0.5605332", "text": "function assignColorXTimes(x){\n for(i = 0; i < x/2; i++){\n assignColorsToDivs(x)\n }\n}", "title": "" }, { "docid": "70f200d7eafd814c82841a060f8432e6", "score": "0.56041425", "text": "function getColor(d) {\n if (d==\"0-1\"|d < 1) return \"rgba(183,243,77)\";\n else if (d==\"1-2\"|d < 2) return \"rgba(225,243,77)\";\n else if (d==\"2-3\"|d < 3) return \"rgba(243,219,77)\";\n else if (d==\"3-4\"|d < 4) return \"rgba(243,186,77)\";\n else if (d==\"4-5\"|d < 5) return \"rgb(240,167,107)\";\n else return \"rgb(240,107,107)\" }", "title": "" }, { "docid": "a7c740a15d79b698340ec2bc455c0ddf", "score": "0.5597608", "text": "function colorize(r,g,b){\r\n\t//change color to orange(243,152,0)\r\n\tr = parseInt(r / 255 * 243,10);\r\n\tg = parseInt(g / 255 * 152,10);\r\n\tb = parseInt(b / 255 * 0,10);\r\n\r\n\treturn [r,g,b];\r\n}", "title": "" }, { "docid": "4397f189e0ce5a9bef210657f7668419", "score": "0.55971485", "text": "function getColor(f)\n{\n var r=hex2dec(f.color.slice(0,2));\n var g=hex2dec(f.color.slice(2,4));\n var b=hex2dec(f.color.slice(4,6));\n \n r2= Math.floor(f.r+(f.index*(r-f.r))/(f.steps) + .5);\n g2= Math.floor(f.g+(f.index*(g-f.g))/(f.steps) + .5);\n b2= Math.floor(f.b+(f.index*(b-f.b))/(f.steps) + .5);\n \n return(\"#\" + dec2hex(r2) + dec2hex(g2) + dec2hex(b2));\n}", "title": "" }, { "docid": "525cfc3f1e7e06ffdf76850bd2e0bb67", "score": "0.55959564", "text": "function _packColor(a, b, c) { return (a << 8) + b + (c >> 8) }", "title": "" }, { "docid": "f50c86600c221455dfb4d2a7737c9fc7", "score": "0.55958587", "text": "function showColor(...args) {\n let zeroCount = '';\n let interimRes = '';\n if (args.length > 6) {\n return 'is not a color';\n }\n\n for (let i = 0; i < 6 - args.length; i++) {\n zeroCount += '0';\n }\n\n args.reduce((acc, currentValue) => {\n interimRes = (acc + currentValue).toString();\n return interimRes;\n }, '#');\n return interimRes + zeroCount;\n}", "title": "" }, { "docid": "3a49fe26347d7898b6f4f521418fcfc2", "score": "0.5591248", "text": "function colorPriority() {\nreturn {\n1: [255, 0, 0], // Red\n2: [255, 127, 80], // Orange\n3: [255, 255, 0], // Yellow\n4: [0, 112, 255], // Blue\n5: [112, 173, 71] // Green\n}\n}", "title": "" }, { "docid": "b916d52f1a965f2f3bdc5de540d94f23", "score": "0.5590668", "text": "coef_color(coef) {\n let red, green, blue;\n if (coef > 0) {\n red = this.color_partial(coef, 220, 220);\n green = this.color_partial(coef, 200, 100);\n blue = this.color_partial(coef, 200, 100);\n } else {\n red = this.color_partial(coef, 220, 100);\n green = this.color_partial(coef, 200, 200);\n blue = this.color_partial(coef, 200, 100);\n }\n return 'rgb(' + red + ',' + green + ',' + blue + ')';\n }", "title": "" }, { "docid": "c51b6b90c60b130d11b79d3f00e5a088", "score": "0.55842006", "text": "function nextColor(pos, start, finish) {\n\t\t\t\t var r = [], i, e\n\t\t\t\t for (i = 0; i < 6; i++) {\n\t\t\t\t from = Math.min(15, parseInt(start.charAt(i), 16))\n\t\t\t\t to = Math.min(15, parseInt(finish.charAt(i), 16))\n\t\t\t\t e = Math.floor((to - from) * pos + from)\n\t\t\t\t e = e > 15 ? 15 : e < 0 ? 0 : e\n\t\t\t\t r[i] = e.toString(16)\n\t\t\t\t }\n\t\t\t\t return '#' + r.join('')\n\t\t\t\t}", "title": "" }, { "docid": "5c62919528168b0538ddc933cea46f09", "score": "0.5582445", "text": "function createColorpickers() {\n\t$(\"#act_family\").spectrum({\n\t\tchooseText: \"Set\",\n\t\tshowAlpha: true,\n\t\tshowPalette: true,\n\t\tpalette: color_palette,\n\t\tchange: function(color) {\n\t\t\tsetRoom(room_family, color);\n\t\t\tdisplayMessage(\"Set family room lights to \"+color.toHexString());\n\t\t\t$(\"#act_family\").css('background-color', color.toHexString());\n\t\t}\n\t});\n\t$(\"#act_living\").spectrum({\n\t\tchooseText: \"Set\",\n\t\tshowAlpha: true,\n\t\tshowPalette: true,\n\t\tpalette: color_palette,\n\t\tchange: function(color) {\n\t\t\tsetRoom(room_living, color);\n\t\t\tdisplayMessage(\"Set living room lights to \"+color.toHexString());\n\t\t\t$(\"#act_living\").css('background-color', color.toHexString());\n\t\t}\n\t});\n\t$(\"#act_midbed\").spectrum({\n\t\tchooseText: \"Set\",\n\t\tshowAlpha: true,\n\t\tshowPalette: true,\n\t\tpalette: color_palette,\n\t\tchange: function(color) {\n\t\t\tsetRoom(room_midbed, color);\n\t\t\tdisplayMessage(\"Set game room lights to \"+color.toHexString());\n\t\t\t$(\"#act_midbed\").css('background-color', color.toHexString());\n\t\t}\n\t});\n\n\tfor (var i in lightElements) {\n\t\t$(i).each(function(index) {\n\t\t\tlightColor = $(this).attr(\"data-initial-color\");\n\t\t\t$(this).spectrum({\n\t\t\t\tcolor: lightColor,\n\t\t\t\tchooseText: \"Set\",\n\t\t\t\tshowAlpha: true,\n\t\t\t\tshowPalette: true,\n\t\t\t\tpalette: color_palette,\n\t\t\t\tchange: setColor,\n\t\t\t});\n\t\t});\n\t}\n}", "title": "" }, { "docid": "0a81ec9c0f6181409ae45c5944f864e8", "score": "0.5579803", "text": "function generateColors() {\n $(board[11][0]).css(\"background-color\", randomColor());\n var match = true;\n\n while(match) {\n $(board[0][13]).css(\"background-color\", randomColor());\n if($(board[11][0]).css(\"background-color\") != $(board[0][13]).css(\"background-color\"))\n match = false;\n }\n\n for (var i=0; i<=11; i++){\n\t\tfor (var j=0; j<=13.; j++){\n\t\t\tif ((i === 0 && j === 13) || (i === 11 && j === 0)){}\n\t\t\telse {\n\t\t\t\tmatch = true;\n\t\t\t\twhile (match){\n $(board[i][j]).css(\"background-color\", randomColor());\n\t\t\t\t\tmatch = false;\n\t\t\t\t\tif (i >= 1){\n\t\t\t\t\t\tif ($(board[i-1][j]).css(\"background-color\") === $(board[i][j]).css(\"background-color\"))\n\t\t\t\t\t\t\tmatch = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (i <= 10){\n\t\t\t\t\t\tif ($(board[i+1][j]).css(\"background-color\") === $(board[i][j]).css(\"background-color\"))\n\t\t\t\t\t\t\tmatch = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (j >= 1){\n\t\t\t\t\t\tif ($(board[i][j-1]).css(\"background-color\") === $(board[i][j]).css(\"background-color\"))\n\t\t\t\t\t\t\tmatch = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (j <= 12){\n\t\t\t\t\t\tif ($(board[i][j+1]).css(\"background-color\") === $(board[i][j]).css(\"background-color\"))\n\t\t\t\t\t\t\tmatch = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n}", "title": "" }, { "docid": "69a60b0e38ab328fbfb31f252636438c", "score": "0.55797297", "text": "function xFun(i) {\n return i / (colors.n - 1);\n}", "title": "" }, { "docid": "1423cb125ecba7f675b5e6912ceee44d", "score": "0.5570642", "text": "function trainColor(r,g,b)\n{\n if((r + g + b) > 383)\n return [1,0];\n else {\n return [0,1];\n }\n\n}", "title": "" }, { "docid": "06404ad88ddda5aa0367b3a274bf4a3a", "score": "0.5561075", "text": "function high(val)\n{\n if(val==0)\n {\n $(\"#first\").css(\"background-color\",\" #ffab00\");\n }\n else if(val==1)\n {\n $(\"#second\").css(\"background-color\",\" #ffab00\");\n }\n else if(val==2)\n {\n $(\"#third\").css(\"background-color\",\"#ffab00\");\n }\n else if(val==3)\n {\n $(\"#fourth\").css(\"background-color\",\"#ffab00\");\n }\n else if(val==4)\n {\n $(\"#fifth\").css(\"background-color\",\"#ffab00\");\n }\n else if(val==5)\n {\n $(\"#sixth\").css(\"background-color\",\"#ffab00\");\n }\n else\n {\n $(\"#last\").css(\"background-color\",\" #ffab00\");\n }\n}", "title": "" }, { "docid": "c0a1d5d1746ab80d776d98de1975fc21", "score": "0.5556409", "text": "function preventDuplicates( previous )\n{\n\t//Variable declarations\n\tvar output = 'rgb(' + Math.random() * 255 + ',' + Math.random() * 255 + ',' + Math.random() * 255 + ')';\n\n\t//While the current color equals this color, try to find a new color\n\twhile( output == previous )\n\t{\n\t\toutput = 'rgb(' + Math.random() * 255 + ',' + Math.random() * 255 + ',' + Math.random() * 255 + ')';\n\t}\n\n\t//Return once a new color has been found\n\treturn output;\n}", "title": "" }, { "docid": "eda6b8faa4afee330eb13185ce9125ce", "score": "0.55526066", "text": "function colourNameToHex(colour)\n{\n var colours = {\"aliceblue\":\"#f0f8ff\",\"antiquewhite\":\"#faebd7\",\"aqua\":\"#00ffff\",\"aquamarine\":\"#7fffd4\",\"azure\":\"#f0ffff\",\n \"beige\":\"#f5f5dc\",\"bisque\":\"#ffe4c4\",\"black\":\"#000000\",\"blanchedalmond\":\"#ffebcd\",\"blue\":\"#0000ff\",\"blueviolet\":\"#8a2be2\",\"brown\":\"#a52a2a\",\"burlywood\":\"#deb887\",\n \"cadetblue\":\"#5f9ea0\",\"chartreuse\":\"#7fff00\",\"chocolate\":\"#d2691e\",\"coral\":\"#ff7f50\",\"cornflowerblue\":\"#6495ed\",\"cornsilk\":\"#fff8dc\",\"crimson\":\"#dc143c\",\"cyan\":\"#00ffff\",\n \"darkblue\":\"#00008b\",\"darkcyan\":\"#008b8b\",\"darkgoldenrod\":\"#b8860b\",\"darkgray\":\"#a9a9a9\",\"darkgreen\":\"#006400\",\"darkkhaki\":\"#bdb76b\",\"darkmagenta\":\"#8b008b\",\"darkolivegreen\":\"#556b2f\",\n \"darkorange\":\"#ff8c00\",\"darkorchid\":\"#9932cc\",\"darkred\":\"#8b0000\",\"darksalmon\":\"#e9967a\",\"darkseagreen\":\"#8fbc8f\",\"darkslateblue\":\"#483d8b\",\"darkslategray\":\"#2f4f4f\",\"darkturquoise\":\"#00ced1\",\n \"darkviolet\":\"#9400d3\",\"deeppink\":\"#ff1493\",\"deepskyblue\":\"#00bfff\",\"dimgray\":\"#696969\",\"dodgerblue\":\"#1e90ff\",\n \"firebrick\":\"#b22222\",\"floralwhite\":\"#fffaf0\",\"forestgreen\":\"#228b22\",\"fuchsia\":\"#ff00ff\",\n \"gainsboro\":\"#dcdcdc\",\"ghostwhite\":\"#f8f8ff\",\"gold\":\"#ffd700\",\"goldenrod\":\"#daa520\",\"gray\":\"#808080\",\"green\":\"#008000\",\"greenyellow\":\"#adff2f\",\n \"honeydew\":\"#f0fff0\",\"hotpink\":\"#ff69b4\",\n \"indianred \":\"#cd5c5c\",\"indigo\":\"#4b0082\",\"ivory\":\"#fffff0\",\"khaki\":\"#f0e68c\",\n \"lavender\":\"#e6e6fa\",\"lavenderblush\":\"#fff0f5\",\"lawngreen\":\"#7cfc00\",\"lemonchiffon\":\"#fffacd\",\"lightblue\":\"#add8e6\",\"lightcoral\":\"#f08080\",\"lightcyan\":\"#e0ffff\",\"lightgoldenrodyellow\":\"#fafad2\",\n \"lightgrey\":\"#d3d3d3\",\"lightgreen\":\"#90ee90\",\"lightpink\":\"#ffb6c1\",\"lightsalmon\":\"#ffa07a\",\"lightseagreen\":\"#20b2aa\",\"lightskyblue\":\"#87cefa\",\"lightslategray\":\"#778899\",\"lightsteelblue\":\"#b0c4de\",\n \"lightyellow\":\"#ffffe0\",\"lime\":\"#00ff00\",\"limegreen\":\"#32cd32\",\"linen\":\"#faf0e6\",\n \"magenta\":\"#ff00ff\",\"maroon\":\"#800000\",\"mediumaquamarine\":\"#66cdaa\",\"mediumblue\":\"#0000cd\",\"mediumorchid\":\"#ba55d3\",\"mediumpurple\":\"#9370d8\",\"mediumseagreen\":\"#3cb371\",\"mediumslateblue\":\"#7b68ee\",\n \"mediumspringgreen\":\"#00fa9a\",\"mediumturquoise\":\"#48d1cc\",\"mediumvioletred\":\"#c71585\",\"midnightblue\":\"#191970\",\"mintcream\":\"#f5fffa\",\"mistyrose\":\"#ffe4e1\",\"moccasin\":\"#ffe4b5\",\n \"navajowhite\":\"#ffdead\",\"navy\":\"#000080\",\n \"oldlace\":\"#fdf5e6\",\"olive\":\"#808000\",\"olivedrab\":\"#6b8e23\",\"orange\":\"#ffa500\",\"orangered\":\"#ff4500\",\"orchid\":\"#da70d6\",\n \"palegoldenrod\":\"#eee8aa\",\"palegreen\":\"#98fb98\",\"paleturquoise\":\"#afeeee\",\"palevioletred\":\"#d87093\",\"papayawhip\":\"#ffefd5\",\"peachpuff\":\"#ffdab9\",\"peru\":\"#cd853f\",\"pink\":\"#ffc0cb\",\"plum\":\"#dda0dd\",\"powderblue\":\"#b0e0e6\",\"purple\":\"#800080\",\n \"rebeccapurple\":\"#663399\",\"red\":\"#ff0000\",\"rosybrown\":\"#bc8f8f\",\"royalblue\":\"#4169e1\",\n \"saddlebrown\":\"#8b4513\",\"salmon\":\"#fa8072\",\"sandybrown\":\"#f4a460\",\"seagreen\":\"#2e8b57\",\"seashell\":\"#fff5ee\",\"sienna\":\"#a0522d\",\"silver\":\"#c0c0c0\",\"skyblue\":\"#87ceeb\",\"slateblue\":\"#6a5acd\",\"slategray\":\"#708090\",\"snow\":\"#fffafa\",\"springgreen\":\"#00ff7f\",\"steelblue\":\"#4682b4\",\n \"tan\":\"#d2b48c\",\"teal\":\"#008080\",\"thistle\":\"#d8bfd8\",\"tomato\":\"#ff6347\",\"turquoise\":\"#40e0d0\",\n \"violet\":\"#ee82ee\",\n \"wheat\":\"#f5deb3\",\"white\":\"#ffffff\",\"whitesmoke\":\"#f5f5f5\",\n \"yellow\":\"#ffff00\",\"yellowgreen\":\"#9acd32\"};\n\n if (typeof colours[colour.toLowerCase()] != 'undefined') {\n return colours[colour.toLowerCase()];\n }\n else {\n return '#000000'; // For some reason, checking the big file causes it to fail - make it black for now. \n // Check the big file as a fallback. \n var bigjson = JSON.parse(fs.readFileSync(bigbackupfile))\n if (typeof bigjson[colour] != 'undefined') {\n return `#${bigjson[colour].hex}`;\n }\n else {\n return '#000000'; // We can't find anything, just make it black\n }\n }\n}", "title": "" }, { "docid": "d39c8f452d79e8fd629a8882b9144fe0", "score": "0.5547552", "text": "function getColor(d) {\n return d < 1? '#66ff33':\n d >= 1 && d < 2? '#ccff33':\n d >= 2 && d < 3? '#ffcc66':\n d >= 3 && d < 4? '#ff6600':\n d >= 4 && d < 5? '#ff4000':\n d >= 5? '#ff0000':\n '#ff0000';\n }", "title": "" }, { "docid": "deeb30b95fd176e5c7e133d3950af948", "score": "0.55437064", "text": "function blend(oColorArray, brushArray, opcty) {\n var nColorArray = [];\n for (i=0; i < 3; i++) {\n difference = brushArray[i] - oColorArray[i];\n nColorArray[i] = oColorArray[i] + Math.round(difference * opcty);\n }\n \n return nColorArray;\n}", "title": "" }, { "docid": "ee5fc080d2f3e9aac2b08ae0a7b026a0", "score": "0.5540079", "text": "function colorSquare_pyramid(){\n\t\n\tquad(0,1,2,3,6);\n\ttri(1,3,4,2);\n\ttri(3,2,4,3);\n\ttri(2,0,4,4);\n\ttri(0,1,4,1);\n\t\n\n\t\n\t\n}", "title": "" }, { "docid": "8ddc2386b2a18720d6a73c7faee01510", "score": "0.5533861", "text": "function rgb(r, g, b){\n\n}", "title": "" }, { "docid": "e422e3a8960a9ad8a3cc5267adfdefb3", "score": "0.55310625", "text": "function color(){\r\n \tvar colors = window.colors;\r\n var regex = new RegExp( tag_pfx + \"[a-z]+\",\"i\");\r\n var eventowner = document.getElementById(\"eventowner\");\r\n if (eventowner != null) {\r\n\t\tvar chips = eventowner.childNodes;\r\n\t\tfor(var i = 0; i<chips.length;i++){\r\n\t \tvar elmts = chips[i].childNodes;\r\n\t\t\tvar match = elmts[2].innerHTML.match(regex);\r\n\t\t\tif(match){ \r\n\t\t\t\telmts[0].style.backgroundColor=colors[match][0];\r\n\t\t\t\telmts[1].style.backgroundColor=colors[match][0];\r\n\t\t\t\telmts[2].style.backgroundColor=colors[match][1];\r\n\t\t\t\telmts[2].childNodes[0].childNodes[0].style.backgroundColor=colors[match][0];\r\n\t\t\t\telmts[2].childNodes[0].style.borderColor=colors[match][0];\r\n\t\t\t\telmts[3].style.backgroundColor=colors[match][1];\r\n\t\t\t\telmts[3].style.borderColor=colors[match][0];\r\n\t\t\t\telmts[4].style.backgroundColor=colors[match][0];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar eventowner = document.getElementById(\"alldayeventowner\");\r\n if (eventowner != null) {\r\n\t\tvar chips = eventowner.childNodes;\r\n\t\tfor(var i = 0; i<chips.length;i++){\r\n\t \tvar elmts = chips[i].childNodes;\r\n\t\t\tvar match = elmts[1].innerHTML.match(regex);\r\n\t\t\tif(match){ \r\n\t\t\t\telmts[0].style.backgroundColor=colors[match][0];\r\n\t\t\t\telmts[1].style.backgroundColor=colors[match][0];\r\n\t\t\t\telmts[2].style.backgroundColor=colors[match][1];\r\n\t\t\t\t//elmts[2].childNodes[0].childNodes[0].style.backgroundColor=colors[match][0];\r\n\t\t\t\t//elmts[2].childNodes[0].style.borderColor=colors[match][0];\r\n\t\t\t\t//elmts[3].style.backgroundColor=colors[match][1];\r\n\t\t\t\t//elmts[3].style.borderColor=colors[match][0];\r\n\t\t\t\t//elmts[4].style.backgroundColor=colors[match][0];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n }", "title": "" }, { "docid": "b73825138575f0d79f83086cd27c25cd", "score": "0.5528101", "text": "function colorCode(x) {\n switch (true) {\n case x >= 100 && x < 200:\n return '#B4D5E0';\n case x >= 200 && x < 300:\n return 'rgb(0, 99, 0)';\n case x >= 300 && x < 400:\n return 'rgb(111, 0, 109)';\n case x >= 400 && x < 500:\n return 'rgb(117, 37, 0)';\n case x >= 500 && x < 600:\n return 'rgb(101, 84, 0)';\n default:\n return 'var(--vscode-input-background)';\n }\n }", "title": "" }, { "docid": "5c96d07bf3e9fe749f56d6beb1ff5fa9", "score": "0.5527265", "text": "function colorIntersection(intersections) {\n}", "title": "" }, { "docid": "821747558c761fab35f305ef74439730", "score": "0.55256385", "text": "function createColorpickers() {\n\t$(\"#act_kitchen\").spectrum({\n\t\tchooseText: \"Set\",\n\t\tshowAlpha: true,\n\t\tshowPalette: true,\n\t\tpalette: color_palette,\n\t\tchange: function(color) {\n\t\t\tsetRoom(kitchen, color);\n\t\t\tdisplayMessage(\"Set kitchen lights to \"+color.toHexString());\n\t\t\t$(\"#act_kitchen\").css('background-color', color.toHexString());\n\t\t}\n\t});\n\t$(\"#act_living\").spectrum({\n\t\tchooseText: \"Set\",\n\t\tshowAlpha: true,\n\t\tshowPalette: true,\n\t\tpalette: color_palette,\n\t\tchange: function(color) {\n\t\t\tsetRoom(living, color);\n\t\t\tdisplayMessage(\"Set living room lights to \"+color.toHexString());\n\t\t\t$(\"#act_living\").css('background-color', color.toHexString());\n\t\t}\n\t});\n\t$(\"#act_lamp\").spectrum({\n\t\tchooseText: \"Set\",\n\t\tshowAlpha: true,\n\t\tshowPalette: true,\n\t\tpalette: color_palette,\n\t\tchange: function(color) {\n\t\t\tsetRoom(lamp, color);\n\t\t\tdisplayMessage(\"Set lamp lights to \"+color.toHexString());\n\t\t\t$(\"#act_lamp\").css('background-color', color.toHexString());\n\t\t}\n\t});\n\t$(\"#act_bath\").spectrum({\n\t\tchooseText: \"Set\",\n\t\tshowAlpha: true,\n\t\tshowPalette: true,\n\t\tpalette: color_palette,\n\t\tchange: function(color) {\n\t\t\tsetRoom(bath, color);\n\t\t\tdisplayMessage(\"Set bathroom lights to \"+color.toHexString());\n\t\t\t$(\"#act_bath\").css('background-color', color.toHexString());\n\t\t}\n\t});\n\n\tfor (var i in lightElements) {\n\t\t$(i).each(function(index) {\n\t\t\tlightColor = $(this).attr(\"data-initial-color\");\n\t\t\t$(this).spectrum({\n\t\t\t\tcolor: lightColor,\n\t\t\t\tchooseText: \"Set\",\n\t\t\t\tshowAlpha: true,\n\t\t\t\tshowPalette: true,\n\t\t\t\tpalette: color_palette,\n\t\t\t\tchange: setColor,\n\t\t\t});\n\t\t});\n\t}\n}", "title": "" }, { "docid": "72a3e7e572da3fc8945d8d35b7806f2e", "score": "0.55232996", "text": "function light_unlit(char_index,state) {\n\t\t\t\t\n\t\t\t\tif(state==0) {\n\t\t\t\t\tstim_colour = \"white\";\n\t\t\t\t} else {\n\t\t\t\t\tstim_colour = \"red\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch(char_index) {\n\t\t\t\tcase 1: $(\"#A\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 2: $(\"#B\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 3: $(\"#C\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 4: $(\"#D\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 5: $(\"#E\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 6: $(\"#F\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 7: $(\"#G\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 8: $(\"#H\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 9: $(\"#I\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 10: $(\"#J\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 11: $(\"#K\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 12: $(\"#L\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 13: $(\"#M\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 14: $(\"#N\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 15: $(\"#O\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 16: $(\"#P\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 17: $(\"#Q\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 18: $(\"#R\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 19: $(\"#S\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 20: $(\"#T\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 21: $(\"#U\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 22: $(\"#V\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 23: $(\"#W\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 24: $(\"#X\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 25: $(\"#Y\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 26: $(\"#Z\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 27: $(\"#0\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 28: $(\"#1\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 29: $(\"#2\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 30: $(\"#3\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 31: $(\"#4\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 32: $(\"#5\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 33: $(\"#6\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 34: $(\"#7\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 35: $(\"#8\").css(\"color\",stim_colour); break;\n\t\t\t\tcase 36: $(\"#9\").css(\"color\",stim_colour); break;\n\t\t\t\tdefault: \n\t\t\t\t}\n\t\t\t\n\t\t\t}", "title": "" }, { "docid": "19c115433c27983b5c50c30907db5320", "score": "0.55212843", "text": "function getRgbColorCode() { \n h = color.value;\n \n let r = 0, g = 0, b = 0;\n\n // 3 digits\n if (h.length == 4) {\n r = \"0x\" + h[1] + h[1];\n g = \"0x\" + h[2] + h[2];\n b = \"0x\" + h[3] + h[3];\n \n // 6 digits\n } else if (h.length == 7) {\n r = \"0x\" + h[1] + h[2];\n g = \"0x\" + h[3] + h[4];\n b = \"0x\" + h[5] + h[6];\n }\n \n // RGB code, for example rgb(106,37,37)\n rgbValue = (\"rgb(\"+ +r + \",\" + +g + \",\" + +b + \")\");\n \n // Changes rgbValue to an object\n function getRGB(str){\n var match = str.match(/rgba?\\((\\d{1,3}), ?(\\d{1,3}), ?(\\d{1,3})\\)?(?:, ?(\\d(?:\\.\\d?))\\))?/);\n return match ? {\n red: match[1],\n green: match[2],\n blue: match[3]\n } : {};\n }\n\n const barvicky = getRGB(rgbValue);\n\n // Get thw individual color values (red, green, blue) in RGB\n const redCode = barvicky[Object.keys(barvicky)[0]];\n const greenCode = barvicky[Object.keys(barvicky)[1]];\n const blueCode = barvicky[Object.keys(barvicky)[2]];\n\n // Changes the RGB values on the right side\n var redColors = document.querySelectorAll('.border-shadow-content .demo6');\n redColors.forEach(redColor => redColor.innerHTML = redCode);\n document.documentElement.style.setProperty('--red', redCode);\n \n var greenColors = document.querySelectorAll('.border-shadow-content .demo7');\n greenColors.forEach(greenColor => greenColor.innerHTML = greenCode);\n document.documentElement.style.setProperty('--green', greenCode);\n\n var blueColors = document.querySelectorAll('.border-shadow-content .demo8');\n blueColors.forEach(blueColor => blueColor.innerHTML = blueCode);\n document.documentElement.style.setProperty('--blue', blueCode);\n}", "title": "" }, { "docid": "013714e1191153b7c75c5d7c68583b1a", "score": "0.55203545", "text": "function createColorGrid(allcolors, nolinks) {\n // nolinks is an optional vaiable\n var temp = [];\n var i = 0;\n $('#swatch_container').attr('innerHTML', '');\n counter = 0;\n for (i = 0; i < allcolors.length; i++) {\n // if (jQuery.inArray(allcolors[i][5], _seasons) != -1) { // in the seasons list\n // if (jQuery.inArray(allcolors[i][6], _tones) != -1) { // in the tones list\n counter++;\n if (jQuery.inArray(allcolors[i][1], temp) == -1) {\n $('#swatch_container').append(createColorSq(allcolors[i], nolinks));\n temp.push(allcolors[i][1]);\n }\n // }\n // }\n }\n}", "title": "" }, { "docid": "4fa9a5b6a1b406e3c901f2e5c3899694", "score": "0.55156285", "text": "function dynamicColors() {\n var r = Math.floor(Math.random() * 255);\n var g = Math.floor(Math.random() * 255);\n var b = Math.floor(Math.random() * 255);\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n }", "title": "" }, { "docid": "d782d2c5dc95b4408be5d09fa169f3c5", "score": "0.551375", "text": "function colourIt(text,decorate,l_grey){\n\t\tif(decorate){\n\n\t\t\t$(\".\"+text)[0].style.backgroundColor=colour;\n\t\t\t$(\".\"+text)[1].style.backgroundColor=colour;\n\t\t\t$(\".\"+text)[2].style.backgroundColor=colour;\n\t\t\t}\n\t\t\telse if(l_grey){\n\t\t\t$(\".\"+text)[0].style.backgroundColor=light_grey;\n\t\t\t$(\".\"+text)[1].style.backgroundColor=light_grey;\n\t\t\t$(\".\"+text)[2].style.backgroundColor=light_grey;\n\t\t\t}\n\t\t\telse{\n\t\t\t$(\".\"+text)[0].style.backgroundColor=dark_grey;\n\t\t\t$(\".\"+text)[1].style.backgroundColor=dark_grey;\n\t\t\t$(\".\"+text)[2].style.backgroundColor=dark_grey;\n\t\t\t\n\t\t\t}\n\t}", "title": "" }, { "docid": "ed5307a2d7c7ff41302459822441c787", "score": "0.5507681", "text": "_color(n) {\n // stay in range\n n = n % this.dots;\n // grayscale for starters\n let ratio = (n/this.dots);\n return `rgb(\n ${this.redd + ratio*(this.redl-this.redd)},\n ${this.greend + ratio*(this.greenl-this.greend)},\n ${this.blued + ratio*(this.bluel-this.blued)})`;\n }", "title": "" }, { "docid": "5f31e3d91f2810dee6d1a5aadbbac12f", "score": "0.550463", "text": "function setColors() {\r\n generate();\r\n}", "title": "" }, { "docid": "e18eded7f24ed6556bc46e5a2dbdf580", "score": "0.5499553", "text": "function circleColor(x){\n if(x < 1){\n return \"green\"}\n else if (x > 1 && x <2){\n return \"yellow\"\n } \n else if (x >2 && x <3){\n return \"orange\"\n }\n \n else if (x >3 && x <4){\n return \"red\"\n }\n \n else if (x >4 && x <5){\n return \"purple\"\n }\n\n else {\n return \"black\"\n } \n }", "title": "" }, { "docid": "f21b395da63ea59e13f7e67400473960", "score": "0.5498759", "text": "function addColors(){\n for(box of squares){\n switch (box.innerText) {\n case '0': box.style.backgroundColor = 'rgb(78, 33, 75)';\n box.style.color = 'rgb(78, 33, 75)';\n break;\n case '2': box.style.backgroundColor = '#eee4da';\n break;\n case '4': box.style.backgroundColor = '#ede0c8';\n break;\n case '8': box.style.backgroundColor = '#f2b179';\n break;\n case '16': box.style.backgroundColor = '#ffcea4';\n break;\n case '32': box.style.backgroundColor = '#e8c064';\n break;\n case '64': box.style.backgroundColor = '#ffab6e';\n break;\n case '128': box.style.backgroundColor = '#fd9982';\n break;\n case '256': box.style.backgroundColor = '#ead79c';\n break;\n case '512': box.style.backgroundColor = '#76daff';\n break;\n case '1024': box.style.backgroundColor = '#beeaa5';\n break;\n case '2048': box.style.backgroundColor = '#d7d4f0';\n break;\n default: box.style.backgroundColor = 'rgb(78, 33, 75)';\n break;\n }\n } \n }", "title": "" }, { "docid": "e7643a6cd1707649d7422a3a8271000f", "score": "0.5497136", "text": "function makeColor(red, green, blue, alpha){\n \t\t\tvar color='rgba('+red+','+green+','+blue+', '+alpha+')';\n \t\t\treturn color;\n\t\t}", "title": "" }, { "docid": "3b44a61d09b64d2b8a5aba2680605759", "score": "0.5492449", "text": "function colorTorus(){\n\t\n\tvar x= 0;\n\n\tfor(var i =0; i < 200; i++){\n\tif(x == 2){\n\t\tx = 0;\n\t}\n\t generatedColorsWire.push( vertexColors[6] ); \n\t // for solid colored faces use \n generatedColorsFill.push(vertexColors[x]);\n\t x++;\n\t\t\n\t}\n}", "title": "" }, { "docid": "591a40d4d3e367a010ad4c4caac4f4c1", "score": "0.5489332", "text": "function changeColors(option){\n\tfor(var i = 1; i <= 4; i++){\n\t\tconsole.log('#option'+i);\n\t\tif(option == i){\n\t\t\t$('#option'+i).css('background-color', 'rgba(35, 255, 46, 0.54)');\n\t\t}\n\t\telse{\n\t\t\t$('#option'+i).css('background-color', 'rgba(0, 0, 0, 0)');\n\t\t}\n\t}\n}", "title": "" } ]
82ef6e838eaf86f5e8ca5be2e12561e4
The panning model. Either "equalpower" or "HRTF".
[ { "docid": "036f48bc837dc7e80594fd62299388e3", "score": "0.7344327", "text": "get panningModel() {\n return this._panner.panningModel;\n }", "title": "" } ]
[ { "docid": "f38886baef626db61222e63437ac1447", "score": "0.6429921", "text": "function PanMode (model)\n{\n BaseMode.call (this, model);\n this.id = Maschine.MODE_PAN;\n}", "title": "" }, { "docid": "710222e359fdb1e5b95386121ac86fa4", "score": "0.5938638", "text": "get panningEnabled() {\n return this._getOption('panningEnabled');\n }", "title": "" }, { "docid": "193dbbeda020a7768e565162280ad4fc", "score": "0.5821707", "text": "get Pan() {}", "title": "" }, { "docid": "5ef67b946fb17dfe9f0004d5fac64e25", "score": "0.5578631", "text": "function panning(panX){\n gSilenceL.gain.value = Math.sqrt(1 - panX)/2\n gNoiseL.gain.value = Math.sqrt(panX)/2\n gSilenceR.gain.value = Math.sqrt(panX)/2\n gNoiseR.gain.value = Math.sqrt(1 - panX)/2\n}", "title": "" }, { "docid": "a41d2488db826c1892bb05ffcf00c0ff", "score": "0.54163486", "text": "setPersp() {\r\n this.projectionMatrix.setPerspective(90, 1, 1, 100);\r\n this.ortho = false;\r\n }", "title": "" }, { "docid": "61a3586699136488ccfe359c2c4d7550", "score": "0.5383454", "text": "set Pan(value) {}", "title": "" }, { "docid": "967a93d89cbf5dcef04d596a5e0bf56f", "score": "0.5372608", "text": "function TrackViewMode (model)\n{\n BaseMode.call (this, model);\n this.id = Maschine.MODE_PAN;\n}", "title": "" }, { "docid": "51184ab04e007671777d430b98dff8b6", "score": "0.52008104", "text": "function whichPenMode(){\n if (currentPenMode === 'black'){\n return blackPen(this)\n } else if (currentPenMode === 'colorful'){\n return colorfulPen(this)\n } else if (currentPenMode === 'user'){\n return userColorPen(this)\n }\n}", "title": "" }, { "docid": "833ab4cd7ff38a88f47c271076de5b73", "score": "0.515999", "text": "function ParametrePan(){\n\n\t// Heritage\n\tParametre.call(this);\n\n\t// Indiquer le nom du parametre\n\tthis.setNom(\"Pan\");\n\n\t// Creer le graphique associe (Instance fille de la classe GParametre)\n\tvar g = new GParametreKnob(-1, 1, 0, 0.01);\n\n\t// Indiquer le graphique du parametre\n\tthis.setGParametre(g);\n\n}", "title": "" }, { "docid": "7c9c606097386de9a57869cd75439239", "score": "0.50911045", "text": "get mode(): number {\n return Math.max(this.degrees - 2, 0);\n }", "title": "" }, { "docid": "58c9723dd414490271db27d9340f3491", "score": "0.50307983", "text": "getClippingStrategy() {\r\n return this._clippingStrategy;\r\n }", "title": "" }, { "docid": "7280dbdc3aaaa8c24634b082fc48ff71", "score": "0.5021029", "text": "function pickMode(){\n \n // pick scalemode\n\t\tswitch(scaleMode) {\n\n\t\t case 'chromatic':\n\t\t scalemode = 0;\n\t\t break;\n\t\t case 'ionian':\n\t\t scalemode = 1;\n\t\t break;\n\t\t case 'dorian':\n\t\t scalemode = 2;\n\t\t break;\n\t\t case 'phrygian':\n\t\t scalemode = 3;\n\t\t break;\n\t\t case 'lydian':\n\t\t scalemode = 4;\n\t\t break;\n\t\t case 'mixolydian':\n\t\t scalemode = 5;\n\t\t break; \n case 'aeolian':\n\t\t scalemode = 6;\n\t\t break;\n\t\t case 'locrian':\n\t\t scalemode = 7;\n\t\t break;\n\t\t case 'wholetone':\n\t\t scalemode = 8;\n\t\t break;\n\t\t case 'minor7':\n\t\t scalemode = 9;\n\t\t break;\n\t\t case 'dim7':\n\t\t scalemode = 10;\n\t\t break;\n\t\t case 'octatonic 2-1':\n\t\t scalemode = 11;\n\t\t break;\n\t\t case 'octatonic 1-2':\n\t\t scalemode = 12;\n\t\t break;\n\t\t case 'major pentatonic':\n\t\t scalemode = 13;\n\t\t break;\n\t\t case 'minor pentatonic':\n\t\t scalemode = 14;\n\t\t break;\n\t\t case 'invert':\n\t\t scalemode = 15;\n\t\t break;\n\t\t case 'random':\n\t\t scalemode = 16;\n\t\t break;\n\t\t case 'permute':\n\t\t scalemode = 17;\n\t\t break;\n\t\t case 'neighbour':\n\t\t scalemode = 18;\n\t\t break;\n\n\t\t}\n \n}", "title": "" }, { "docid": "b12c381dd8c8ce942cec57cdad9c0587", "score": "0.5011382", "text": "get rolloffFactor() {\n return this._panner.rolloffFactor;\n }", "title": "" }, { "docid": "b12c381dd8c8ce942cec57cdad9c0587", "score": "0.5011382", "text": "get rolloffFactor() {\n return this._panner.rolloffFactor;\n }", "title": "" }, { "docid": "5c22247016eb78514c6ce6085146e9fa", "score": "0.49734202", "text": "function limitPanning () {\n\n var dataMatrix = this.dataHandler.matrix,\n ctx = this.ctx,\n gridWidth = graphWidth + graphSpace,\n gridHeight = graphHeight + graphSpace;\n\n var topRightPoint = {\n x: gridWidth * ( dataMatrix.length - 0.5 ),\n y: gridHeight / 2\n };\n\n if ( topRightPoint.x < ctx.crossing.x ) {\n ctx.translate( ctx.crossing.x - topRightPoint.x, 0 );\n ctx.updateRefPoints();\n }\n\n if ( topRightPoint.y > ctx.crossing.y ) {\n ctx.translate( 0, ctx.crossing.y - topRightPoint.y );\n ctx.updateRefPoints();\n }\n }", "title": "" }, { "docid": "cbb6468b603f1ab27c403d53abd488e3", "score": "0.4938277", "text": "_getPositionStrategy() {\n return this._overlayRef.getConfig().positionStrategy;\n }", "title": "" }, { "docid": "cbb6468b603f1ab27c403d53abd488e3", "score": "0.4938277", "text": "_getPositionStrategy() {\n return this._overlayRef.getConfig().positionStrategy;\n }", "title": "" }, { "docid": "cbb6468b603f1ab27c403d53abd488e3", "score": "0.4938277", "text": "_getPositionStrategy() {\n return this._overlayRef.getConfig().positionStrategy;\n }", "title": "" }, { "docid": "a9ea8c2180e921211c42334565dde1f7", "score": "0.49153742", "text": "function getModeValue()\n\t{\n\t\t//Nabeel hardcoding crop value only\n\t\treturn \"crop\";\n\t}", "title": "" }, { "docid": "a8076eca2ece7968cb153679c78a87cb", "score": "0.49136874", "text": "function MQPan () {\r\n MQMapCommand.call(this);\r\n this.setM_Xpath(\"Pan\");\r\n this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getPAN()));\r\n /**\r\n * Value to represent center of the map\r\n * @type MQPoint\r\n */\r\n var m_Point = new MQPoint(\"DeltaPoint\");\r\n /**\r\n * Returns the m_Point.\r\n * @return The m_Point.\r\n * @type MQPoint\r\n *\r\n */\r\n this.getPoint = function(){\r\n return m_Point;\r\n };\r\n /**\r\n * Sets the Delta X and Delta Y variables, which are the number of\r\n * pixels that the map viewport is to be moved in the horizontal and\r\n * vertical direction respectively.\r\n * @param {Double} dblX The number of pixels that the map viewport is to be moved in\r\n * the horizontal direction. Negative indicates movement to the left,\r\n * positive to the right.\r\n * @param {Double} dblY The number of pixels that the map viewport is to be moved in\r\n * the vertical direction. Negative indicates movement upward, positive downward.\r\n * @type void\r\n */\r\n this.setDeltaXY = function(dblX, dblY){\r\n m_Point.setXY(dblX, dblY);\r\n };\r\n /**\r\n * Sets the Delta Y variable, which is the number of pixels that the\r\n * map viewport is to be moved in the vertical direction.\r\n * @param {Double} dblY The number of pixels that the map viewport is to be moved in\r\n * the vertical direction. Negative indicates movement upward,\r\n * positive downward.\r\n * @type void\r\n */\r\n this.setDeltaY = function(dblY){\r\n m_Point.setY(dblY);\r\n };\r\n /**\r\n * Sets the Delta X variable, which is the number of pixels that the\r\n * map viewport is to be moved in the horizontal direction.\r\n * @param {Double} dblX The number of pixels that the map viewport is to be moved in\r\n * the horizontal direction. Negative indicates movement to the\r\n * left, positive to the right.\r\n * @type void\r\n */\r\n this.setDeltaX = function(dblX){\r\n m_Point.setX(dblX);\r\n };\r\n}", "title": "" }, { "docid": "a26dc709260a77c26f28424f2f17775e", "score": "0.489269", "text": "function PanRecognizer() {\n\t\t\t\tAttrRecognizer.apply(this, arguments);\n\n\t\t\t\tthis.pX = null;\n\t\t\t\tthis.pY = null;\n\t\t\t}", "title": "" }, { "docid": "bd37991e1b70d1d202947d11f7047d87", "score": "0.48494312", "text": "function PanRecognizer(){AttrRecognizer.apply(this,arguments);this.pX=null;this.pY=null;}", "title": "" }, { "docid": "bd37991e1b70d1d202947d11f7047d87", "score": "0.48494312", "text": "function PanRecognizer(){AttrRecognizer.apply(this,arguments);this.pX=null;this.pY=null;}", "title": "" }, { "docid": "ceb1664e00eb2502ef149e96c81eda20", "score": "0.47982624", "text": "getMeltingPoint(){\n return this.solute.getMeltingPoint();\n }", "title": "" }, { "docid": "3a9de2bb9ca939aeb89acdbfd310e65b", "score": "0.47956863", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n }", "title": "" }, { "docid": "855ae288998bfa8225043c65b988639f", "score": "0.47932312", "text": "function PanRecognizer() {\r\n AttrRecognizer.apply(this, arguments);\r\n\r\n this.pX = null;\r\n this.pY = null;\r\n}", "title": "" }, { "docid": "855ae288998bfa8225043c65b988639f", "score": "0.47932312", "text": "function PanRecognizer() {\r\n AttrRecognizer.apply(this, arguments);\r\n\r\n this.pX = null;\r\n this.pY = null;\r\n}", "title": "" }, { "docid": "855ae288998bfa8225043c65b988639f", "score": "0.47932312", "text": "function PanRecognizer() {\r\n AttrRecognizer.apply(this, arguments);\r\n\r\n this.pX = null;\r\n this.pY = null;\r\n}", "title": "" }, { "docid": "4045344f6c532fe5f153546f23f8bd94", "score": "0.47929645", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n }", "title": "" }, { "docid": "bc480b484f1580b9928321345a596a4f", "score": "0.47867745", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n }", "title": "" }, { "docid": "bc480b484f1580b9928321345a596a4f", "score": "0.47867745", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n }", "title": "" }, { "docid": "b88ff08615f0c4bef0f73f2d3c836f4d", "score": "0.4771491", "text": "function PanRecognizer() {\n\t AttrRecognizer.apply(this, arguments);\n\t\n\t this.pX = null;\n\t this.pY = null;\n\t }", "title": "" }, { "docid": "b88ff08615f0c4bef0f73f2d3c836f4d", "score": "0.4771491", "text": "function PanRecognizer() {\n\t AttrRecognizer.apply(this, arguments);\n\t\n\t this.pX = null;\n\t this.pY = null;\n\t }", "title": "" }, { "docid": "a40033481552a36797427bc391388f2e", "score": "0.47658148", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n this.pX = null;\n this.pY = null;\n }", "title": "" }, { "docid": "a40033481552a36797427bc391388f2e", "score": "0.47658148", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n this.pX = null;\n this.pY = null;\n }", "title": "" }, { "docid": "c2408f73084022f0a0b26f451614340a", "score": "0.474836", "text": "function PanRecognizer() {\n\t AttrRecognizer.apply(this, arguments);\n\t\n\t this.pX = null;\n\t this.pY = null;\n\t}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "32db5d32815ce7b410245d4a303d1dfb", "score": "0.47437105", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "ce200f408f528b82fdf2c78e14695971", "score": "0.47383535", "text": "pan(deltaX, deltaY) {\n\n let element = this.domElement === document ? this.domElement.body : this.domElement;\n\n if ( this.object instanceof PerspectiveCamera ) {\n\n // perspective\n let position = this.object.position;\n this.offset.copy( position ).sub( this.target );\n let targetDistance = this.offset.length();\n\n // half of the fov is center to top of screen\n targetDistance *= Math.tan( ( this.object.fov / 2 ) * Math.PI / 180.0 );\n\n // we actually don't use screenWidth, since perspective camera is fixed to screen height\n this.panLeft( 2 * deltaX * targetDistance / element.clientHeight, this.object.matrix );\n this.panUp( 2 * deltaY * targetDistance / element.clientHeight, this.object.matrix );\n\n } else if ( this.object instanceof OrthographicCamera ) {\n\n // orthographic\n this.panLeft( deltaX * ( this.object.right - this.object.left ) / this.object.zoom / element.clientWidth, this.object.matrix );\n this.panUp( deltaY * ( this.object.top - this.object.bottom ) / this.object.zoom / element.clientHeight, this.object.matrix );\n\n } else {\n\n // camera neither orthographic nor perspective\n console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n this.enablePan = false;\n }\n }", "title": "" }, { "docid": "28af31f295c2e844a8dc019ba4c5d4a3", "score": "0.47354728", "text": "get _zoomLevelCurrent()\n {\n let level = this._zoomLevel;\n if(level == \"cover\")\n return this._zoomLevelCover;\n else if(level == \"actual\")\n return this._zoomLevelActual;\n else\n return level;\n }", "title": "" }, { "docid": "08a306ab11cd4dbfa99d52b354913737", "score": "0.4723775", "text": "function PanRecognizer() {\n\t AttrRecognizer.apply(this, arguments);\n\n\t this.pX = null;\n\t this.pY = null;\n\t}", "title": "" }, { "docid": "08a306ab11cd4dbfa99d52b354913737", "score": "0.4723775", "text": "function PanRecognizer() {\n\t AttrRecognizer.apply(this, arguments);\n\n\t this.pX = null;\n\t this.pY = null;\n\t}", "title": "" }, { "docid": "3d938d0674aa8a932cc18070a22f5b73", "score": "0.470667", "text": "function projectionClip(model) {\n const projection = model.component.projection;\n return projection && !projection.isFit ? true : undefined;\n }", "title": "" }, { "docid": "7f551837a40cc9780669a6662ef39261", "score": "0.47065562", "text": "function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n this.pX = null;\n this.pY = null;\n}", "title": "" }, { "docid": "56a0848b7a226b7f3a1f5660dbdef142", "score": "0.46991217", "text": "Lp(){\n\t\treturn 1.76*this.CH.RY*Math.pow(this.E/this.Fy,0.5);\n\t}", "title": "" }, { "docid": "56f4db1b562bb8d27f5e915ec2337539", "score": "0.46907303", "text": "get preferredDirection(){ return this.__preferredDirection; }", "title": "" }, { "docid": "f21ecf9d7f1adbb551d8dab73cc6192c", "score": "0.46804953", "text": "getDrawingMode() {\n return this.state[DRAWING_MANAGER].getDrawingMode()\n }", "title": "" }, { "docid": "1f90c3e6c289e5743c3c1380427525dc", "score": "0.46709013", "text": "shapeModel() {\n return _defaultsDeep(this.props.model, {\n autoload: true,\n type: 'fng',\n skinName: (this.props.model.overlayPlayButton) ? 'glass-ngs' : 'glass-ngs-no-overlay',\n layoutOptions: {\n tpShareFNG: (this.props.model.sharing !== undefined) ? this.props.model.sharing : true\n }\n });\n }", "title": "" }, { "docid": "113aac36bc69e0dd1e3ba0f131f17275", "score": "0.46646997", "text": "function resetModelPosition() {\n\t\t\ttargetRotation = 0;\n\t\t\ttargetYRotation = -(Math.PI / 2);\n\t\t}", "title": "" }, { "docid": "5456d86088709bdf1c956d5c65841914", "score": "0.46528006", "text": "get Zoom() {}", "title": "" }, { "docid": "e1a5ab302f221ee03c3f3d63d5a2e1a1", "score": "0.46451017", "text": "function ParametrePitch(){\n\n\t// Heritage\n\tParametre.call(this);\n\n\t// Indiquer le nom du parametre\n\tthis.setNom(\"Pitch\");\n\n\t// Creer le graphique associe (Instance fille de la classe GParametre)\n\tvar g = new GParametreKnob(0, 100, 0, 1);\n\n\t// Indiquer le graphique du parametre\n\tthis.setGParametre(g);\n\n}", "title": "" }, { "docid": "70893a94b712f9ca6cba251f6014891a", "score": "0.464172", "text": "get elevationMode() {\n return this.i.o;\n }", "title": "" }, { "docid": "772deebb987d34b8a425b0e9cabde3dc", "score": "0.46380353", "text": "set isPerspective(value) {}", "title": "" }, { "docid": "a5a3afa51212a5938a075406b5713de9", "score": "0.4626281", "text": "function projectionClip(model) {\n const projection = model.component.projection;\n return projection && !projection.isFit ? true : undefined;\n}", "title": "" }, { "docid": "d90c1835b96c30e4d01524b35e33b475", "score": "0.46195325", "text": "function manualMode() {\n if(inAuto) return;\n Output = manTemp * ( WindowSize / 100 );\n}", "title": "" }, { "docid": "5b085ff51dbda227c038a77fac6ba60e", "score": "0.46166092", "text": "function onChangeMode() {\r\n\tshow_perspective = this.checked;\r\n\tupdate_projection();\r\n}", "title": "" }, { "docid": "8296874fbeed631670b5fe4a2070600e", "score": "0.45945984", "text": "get isPerspective() {}", "title": "" }, { "docid": "319ec4e1d05d0f0b0491475e977514d8", "score": "0.45898682", "text": "getPose() {\n return this.pose;\n }", "title": "" }, { "docid": "cee337a7458d1469eb82091a07e81aba", "score": "0.45885262", "text": "function plat(x,y){var g=G(arguments)\n if(g.O_){g.e(function(g){plat(g[0], g[1])}); return}\n return w.S(x,y,'o', 500, 40).K('pf')}", "title": "" }, { "docid": "cee337a7458d1469eb82091a07e81aba", "score": "0.45885262", "text": "function plat(x,y){var g=G(arguments)\n if(g.O_){g.e(function(g){plat(g[0], g[1])}); return}\n return w.S(x,y,'o', 500, 40).K('pf')}", "title": "" }, { "docid": "4bae115f8487ab366a759b6eb9edb6a5", "score": "0.45866397", "text": "function panningMove(val){\n var x, y;\n switch (val){\n case 1:\n x = 0, y = 30;\n break;\n case 2:\n x = 30, y = 0;\n break;\n case 3:\n x = 0, y = -30;\n break;\n case 4:\n x = -30, y = 0;\n }\n fd.canvas.translate(x,y);\t\n}", "title": "" }, { "docid": "d618906eadf0cca35b9ae32d0e74c32d", "score": "0.45837036", "text": "mode () {\n // Altitude modal must be hidden if mode is not directions or roundTrip\n if (this.mode !== constants.modes.directions && this.mode !== constants.modes.roundTrip) {\n this.isAltitudeModalOpen = false\n }\n }", "title": "" }, { "docid": "645366e0a77cec029cb8239669028382", "score": "0.4583685", "text": "get preference() {\n return this.mode;\n }", "title": "" }, { "docid": "645366e0a77cec029cb8239669028382", "score": "0.4583685", "text": "get preference() {\n return this.mode;\n }", "title": "" }, { "docid": "3dfc8e26c5841bd36bcbdc8c74259624", "score": "0.45549893", "text": "getPacmanTargetPosition() {\n return this.pacman.tileFrom;//target pacman\n }", "title": "" }, { "docid": "7a9810c56b05f69236d94742b3a7b5e0", "score": "0.4552537", "text": "function panLimit() {\r\n\t\tty = 0;\r\n\r\n var divisor = { w: width / ((x.domain()[1]-x.domain()[0])*zoom.scale())},\r\n\t\tminX = -(((x.domain()[0]-x.domain()[1])*zoom.scale())+(panExtent.x[1]-(panExtent.x[1]-(width/divisor.w)))),\r\n maxX = -(((x.domain()[0]-x.domain()[1]))+(panExtent.x[1]-panExtent.x[0]))*divisor.w*zoom.scale(),\r\n\r\n //Resets timeline if domain limits are exceeded when panning\r\n tx = x.domain()[0] < panExtent.x[0] ?\r\n\t\t\t\tminX :\r\n\t\t\t\tx.domain()[x.length] > panExtent.x[1] ?\r\n\t\t\t\t\tmaxX :\r\n\t\t\t\t\tzoom.translate()[0];\r\n\r\n\treturn [tx,ty];\r\n}", "title": "" }, { "docid": "c2dbc0896986b30002fbeb187e30dff1", "score": "0.45459402", "text": "function pubCmdPan() {\n console.log(\"pubPanControl: pan value = \" + panAngle );\n var panSetting = panAngle;\n\n \n if (panSetting > panAngle_maximum) {\n panSetting = panAngle_maximum;\n } else\n if (panSetting < panAngle_minimum) {\n panSetting = panAngle_minimum;\n }\n var thisComment = 'Set camera pan angle to ' + panAngle;\n\n // Send to arm 2 for pan servo and use direct 0-127 position command\n var cmdPanControlMsg = new ROSLIB.Message({\n actionType : 6,\n armNumber : 2,\n value : panSetting,\n comment : thisComment\n });\n\n console.log('publish to /arm_control');\n cmdArmControlPub.publish(cmdPanControlMsg);\n}", "title": "" }, { "docid": "fa18a99b2a312472a94115a71d4ddb83", "score": "0.45225435", "text": "function setRopePosition() {\n let ratio = (DOMSlider.value - DOMSlider.min) / (DOMSlider.max - DOMSlider.min);\n // floating point correction\n if (ratio < 0.5) ratio += 0.01;\n if (ratio < 0.3) ratio += 0.01;\n if (ratio > 0.6) ratio -= 0.01;\n if (ratio > 0.8) ratio -= 0.02;\n rope.points[rope.points.length - 1].pos.x = (ratio * width);\n }", "title": "" } ]
fbad539f594888ae799b64836a08126d
Function that does error handling in the fetch calls
[ { "docid": "9cfd58d1fd5fd3bf33d3b5abbca38044", "score": "0.0", "text": "function error() { \n $(\"error-message\").classList.remove(\"hidden\");\n $(\"error-message\").innerHTML = \"Error!!! \"; \n }", "title": "" } ]
[ { "docid": "9973c61bf1d689d4410d509a0c8cfd3d", "score": "0.70372784", "text": "function handleError() {\n handleFeedParsingFailed(chrome.i18n.getMessage('fetchError'));\n}", "title": "" }, { "docid": "b6d90cd7a24cf2f542ca6d4d0293e89b", "score": "0.7010142", "text": "function fetchError(error){\n\tfetchResult = 'failure';\n\t// var errorMessage = error.message idk what the api returns\n\tdate = '0';\n}", "title": "" }, { "docid": "e000bc03f1ad5bedffcc8faa3b0ccca7", "score": "0.69549257", "text": "unhandledFetchError(err){\n console.error(\"Unhandled fetch error: \",err);\n this.setState({error:true});\n }", "title": "" }, { "docid": "6032204199defc02a15851e143f57c93", "score": "0.6845909", "text": "async function tryCatchExample() {\n try {\n let response = await fetch( `some url` );\n let user = await response.json();\n }\n catch ( error ) {\n // catches errors both in fetch and response.json\n console.log( error );\n }\n}", "title": "" }, { "docid": "6d8911776b752b9a27b0b8575e6c39a0", "score": "0.6786152", "text": "function error (err) {\n cleanup();\n reject(new Error('Fetching ' + src));\n }", "title": "" }, { "docid": "4ab323d25a842f7aad5aa3c55e831248", "score": "0.67663395", "text": "function fetch(_x) {\n return _fetch.apply(this, arguments);\n} // on error function", "title": "" }, { "docid": "f938a59799a038238e3a592c3ad698a9", "score": "0.6752758", "text": "function error (err) {\r\n cleanup();\r\n reject(new Error('Fetching ' + src));\r\n }", "title": "" }, { "docid": "efa081509fea98093ef85001b812730d", "score": "0.67257464", "text": "function fetchError() {\n return {\n type: FETCH_PROP_FAILURE\n };\n}", "title": "" }, { "docid": "493ebac0e2cbb1b94d16943a618cc6bd", "score": "0.6575492", "text": "async function tryCatch(){\n try{\n let dataTake = await fetch('http://no-such-url');\n }catch(error){\n alert('There is no such a url!');\n }\n}", "title": "" }, { "docid": "cfa45f047861b2873f3fbeaae6604554", "score": "0.65449005", "text": "function onDataFetchFailed(error) {}", "title": "" }, { "docid": "af9a4085582b4646d677fb55bd179881", "score": "0.639728", "text": "function fetchError(error) {\n\t\t\tself.isWaiting = false;\n\t\t\tself.waitingForUpdate = false;\n\t\t\tif (error && error.data) {\n\t\t\t\tif(error.data.message) {\n\t\t\t\t\tsetError(error.data.message);\n\t\t\t\t} else {\n\t\t\t\t\tsetError(error.data.error);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetError(\"An unknown error occurred.\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fe7b3ae4b1eb629b56bc83c124573673", "score": "0.6365392", "text": "function fetchError(error) {\n\t\t\tself.isWaiting = false;\n\t\t\tif (error && error.data) {\n\t\t\t\tif(error.data.message) {\n\t\t\t\t\tsetError(error.data.message);\n\t\t\t\t} else {\n\t\t\t\t\tsetError(error.data.error);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetError(\"An unknown error occurred.\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b80696e814dc46b059ab589fcca29a28", "score": "0.6330241", "text": "fetchFail(query, error) {\n var self = this;\n var key = self.toKey(query);\n console.warn(\"Error loading \" + key + \": \" + error);\n }", "title": "" }, { "docid": "3662cad470fdf8139800e2a3b6284680", "score": "0.61347675", "text": "async function getPhotos() {\n try {\n const response = await fetch(apiURL);\n photosArray = await response.json();\n displayPhotosFormAPI(photosArray);\n } catch (error) {\n // Catch error here\n console.log(\"Something Went Wrong \",error)\n }\n}", "title": "" }, { "docid": "e53bdba3538925b4c1a495c51ec0c2ac", "score": "0.61339414", "text": "async function getPhotos() {\n\n try {\n const respense = await fetch( apiUrl);\n photoArray = await respense.json();\n dispayPhotos();\n \n } catch {\n // catch the err here \n }\n\n}", "title": "" }, { "docid": "29c026cce43546c06183a724cef60779", "score": "0.606472", "text": "parseFetchResponseForError(response, payload) {\n return payload || response.statusText;\n }", "title": "" }, { "docid": "557a7ce13a70b5b353d4678ecea94856", "score": "0.6059383", "text": "fetchData(url, successCb){\n fetch(url)\n .then(response => response.json())\n .then(data => { \n successCb && successCb(data)\n this.setState({ data, loading: false, fetchError: false });\n })\n // Hanle exception\n .catch(err => { \n this.setState({loading: false, fetchError:true});\n })\n }", "title": "" }, { "docid": "cf5407bc785476e2a1f67c439034948f", "score": "0.60480285", "text": "function fetchFailed(error, request) {\n alert(\"lookup failed.\");\n }", "title": "" }, { "docid": "51ab46e95b5359ce1f019ad6b0515f21", "score": "0.60099316", "text": "function fetchFailed(error, request){\n alert(\"lookup failed.\");\n alert(error);\n }", "title": "" }, { "docid": "d807dbcfd7144b315a2ed233c16b6e05", "score": "0.59993005", "text": "fetchHTTPErrorCheck(res) {\n if (!res.ok) {\n return Promise.reject(res);\n } else {\n // returns a promise\n return res.json();\n }\n }", "title": "" }, { "docid": "dc51440b42fa7eef69a65c908ecfb876", "score": "0.5957399", "text": "function catchError(error) {\r\n \t \tconsole.log(\"Unable to retrieve data. \" + error);\r\n \t }", "title": "" }, { "docid": "55da31f78fa6aedd8244423f116c12ae", "score": "0.59344697", "text": "_tryFetchingFromURI(uri: string, callback: FetchCallback) {\n this._fetchFromURI(uri, (error, result) => {\n if (error != null) {\n this._processError(error);\n }\n callback(undefined, result);\n });\n }", "title": "" }, { "docid": "493a0a623865b99da33681cc1bcb8049", "score": "0.59104663", "text": "handleHTTPErrors(response) {\n if (!response.ok) throw Error(response.status + \": \" + response.statusText);\n return response;\n }", "title": "" }, { "docid": "5d571c0f244b7bd248216755cde137fa", "score": "0.5882892", "text": "handleHTTPError(pHTTPError) {\n let Error = {\n code: 0,\n desc: '' // Error Description\n };\n // format error received from request : \n // {\"code\":\"ECONNREFUSED\",\"errno\":\"ECONNREFUSED\",\"syscall\":\"connect\",\"address\":\"127.0.0.1\",\"port\":5678}\n // map HTTP Error\n if (pHTTPError.code === 'ECONNREFUSED') {\n Error.code = 106;\n Error.desc = 'CONNECTION REFUSED';\n }\n else {\n console.log(pHTTPError);\n }\n return Error;\n }", "title": "" }, { "docid": "ef1f62cb6feda0a136e5b428d0d58834", "score": "0.58827275", "text": "async function getQuotes() {\n showLoadingWheel();\n const apiUrl = 'https://type.fit/api/quotes';\n try {\n const responce = await fetch(apiUrl);\n apiQuotes = await responce.json();\n newQuote();\n } catch (error) {\n // Catch Error Here\n console.log('unable to load from api')\n errorCount++;\n if (errorCount < 3) {\n getQuotes();\n }\n else {\n console.log('api timeout - failover to local quotes')\n apiSwitch.checked = false;\n newQuote();\n }\n }\n}", "title": "" }, { "docid": "a41326e30733fcf7bb8d17a42ca49c7a", "score": "0.58636546", "text": "fetchDataErrorMsg(error){\n return error.response.data.errors.message[0];\n }", "title": "" }, { "docid": "a024316296ace8407339ff0fa96b50fd", "score": "0.5851862", "text": "function _fetchError(error) {\n if(error) {\n growl.error( error );\n }\n else {\n growl.error(\n LOCALE.maketext(\"The system failed to retrieve the list of your [asis,WordPress] installations from the server.\")\n );\n }\n\n $scope.doneRendering();\n $scope.ui.fetchHasFailed = true;\n }", "title": "" }, { "docid": "204ec04a7f3a62734340b7bf58031ae6", "score": "0.581539", "text": "function noFetch() {\n dx.fail('Do not call fetch() directly. Instead, call getServerModel().');\n }", "title": "" }, { "docid": "b1ba6f6031b4d0ae034d5b203d1bad73", "score": "0.5793492", "text": "async function getPhotos() {\n try {\n const response = await fetch (apiUrl);\n const data = await response.json();\n console.log(data);\n } catch (error) {\n //catch error here \n }\n}", "title": "" }, { "docid": "e03d1fa70475a1d17c98592107cf91fe", "score": "0.57807356", "text": "onRequestError(response) {\n console.log('ERROR FETCHING BOOK DATA!',response);\n }", "title": "" }, { "docid": "dcb93a3fec52e6b37cec2ad70d6e86cf", "score": "0.57323647", "text": "function brokenURL() {\n console.log('URL retrieve is broken, something wrong on the server');\n}", "title": "" }, { "docid": "328fe78de34d22c2733df306b3aecc22", "score": "0.5722766", "text": "function handleFailedRequestWithParsedResponse(error, hmpBatchSize, vistaResponse) {\n self.log.error('%s vistaResponse: %j', error, vistaResponse);\n self.metrics.debug('Vista Fetch Next (parsed response) in Error', metricsObj);\n var wrappedResponse = {\n data: null,\n hmpBatchSize: hmpBatchSize,\n rawResponse: null\n };\n return batchCallback(error, wrappedResponse);\n }", "title": "" }, { "docid": "9c8cb3b2b8661562cbb7c69c5906c06c", "score": "0.5709305", "text": "handleError() {\n\n }", "title": "" }, { "docid": "87f3d5da5ae4b5345dbdff43c304527e", "score": "0.57035595", "text": "static async getResponse(fetchFn, requestInput, requestInit, retryCount, retryDelay, throwOnServerError) {\n let lastError;\n // The retryCount is 0-based. Therefore, add 1 to triesLeft.\n let triesLeft = retryCount + 1;\n // When retry count is greater than 0, repeat fetch.\n while (triesLeft-- > 0) {\n try {\n const response = await fetchFn(requestInput, requestInit);\n // Check, if server sent a 5xx error response.\n if (throwOnServerError && response.status >= 500 && response.status < 600) {\n throw new Error(`Server replied with response code ${response.status}: ${response.statusText}`);\n }\n return response;\n }\n catch (error) {\n lastError = error;\n // If the fetch was aborted by timeout, we won't retry.\n if (requestInit.signal?.aborted) {\n throw error;\n }\n if (triesLeft > 0) {\n // Wait for specified delay, before retrying.\n await new Promise((resolve, reject) => {\n setTimeout(resolve, retryDelay);\n // Cancel waiting, if timeout is reached.\n requestInit.signal?.addEventListener('abort', () => {\n reject(new Error('Fetch aborted by timeout.'));\n });\n });\n }\n }\n }\n // The fetch was not successful. We throw.\n if (retryCount > 0) {\n // Feedback the last error, if there were retry attempts.\n throw new Error(`Number of fetch retries (${retryCount}) exceeded. Last error: ${String(lastError)}`);\n }\n else {\n throw lastError;\n }\n }", "title": "" }, { "docid": "8ab2f79a2976125bcfcb8b2a5f89be9a", "score": "0.5698215", "text": "function dealWithError({response, error}) {\n switch (response.status) {\n case 400:\n throw new Error(`Bad request. ${error}`);\n case 401:\n case 403:\n throw new Error(`Unauthorized access. ${error}`);\n default:\n throw new Error(error);\n }\n}", "title": "" }, { "docid": "12cd56a66f95debee52a3462def85982", "score": "0.56784743", "text": "async function fetchData() {\n //Variable res is used later, so it must be introduced before try block and so cannot be const.\n let res = null;\n try{\n //This will wait the fetch to be done - it is also timeout which might be a response (server timeouts)\n res=await fetch(\"https://ringed-bebop-293214.appspot.com/rest/Recipeservice/getRecipes\");\n }\n catch(error){\n setErrors(true);\n }\n\n try{\n //Getting json from the response\n const responseData = await res.json();\n console.log(responseData);//Just for checking.....\n setRecipes(responseData);\n }\n catch(err){\n setErrors(true);\n setSomeErrors(\"ERROR: \"+hasError+ \" my error \"+err);\n console.log(someError);\n }\n }", "title": "" }, { "docid": "4f890370dd0b21eb2227c9930d9354a1", "score": "0.5671243", "text": "@action(constants.FETCH_NODES_FAIL)\n handleFetchNodesFail(payload) {\n logger.warn('handleFetchNodesFail');\n }", "title": "" }, { "docid": "f1c6aefbd8c1e0ed9dcbc876eee01759", "score": "0.5632885", "text": "function unableToResolve() {\n // log the fail\n\n console.log('WORKER: fetch request failed in both cache and network.');\n\n // Show error message\n return new Response('<h1>Service Unavailable</h1>', {\n status: 503,\n statusText: 'Service Unavailable',\n headers: new Headers({\n 'Content-Type': 'text/html'\n })\n });\n }", "title": "" }, { "docid": "89918ecfc6704b170d021c1466055850", "score": "0.561651", "text": "checkErrorsInResult(result)\n {\n // return new Error('Any error could be thrown here');\n }", "title": "" }, { "docid": "e0a8b8fcf68a14713df1c151bab13cce", "score": "0.5602802", "text": "function getDataCoins(){\n// return initiates/ call function fetch(url) and gets the response.json in return from the fetch(url) function call.\n return fetch(coinsUrl)\n .then(res => {\n return res.json();\n })\n// Created an Error Handling Catch box\n .catch (err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "13dd4afd85299db3d5c7b505a1764f8c", "score": "0.5602043", "text": "function unableToResolve() {\n /* There's a couple of things we can do here.\n - Test the Accept header and then return one of the `offlineFundamentals`\n e.g: `return caches.match('/some/cached/image.png')`\n - You should also consider the origin. It's easier to decide what\n \"unavailable\" means for requests against your origins than for requests\n against a third party, such as an ad provider\n - Generate a Response programmaticaly, as shown below, and return that\n */\n\n console.log(\n 'WORKER: fetch request failed in both cache and network.'\n );\n\n /* Here we're creating a response programmatically. The first parameter is the\n response body, and the second one defines the options for the response.\n */\n let unavailable = new Response(\n '<h1>Service Unavailable</h1>',\n {\n status: 503,\n statusText: 'Service Unavailable',\n headers: new Headers({\n 'Content-Type': 'text/html',\n }),\n }\n );\n\n if (useIndexDB) {\n console.log(\n 'fetching from IndexedDB',\n event.request.url\n );\n return readtheDatafromIndexedDb(\n INDEXEDDB_NAME,\n 'dhis2',\n event.request.url\n )\n .then(function(response) {\n console.log('Respuesta de IndexedDB');\n return response;\n })\n .catch(error => {\n console.log('IndexedDB key unavailable');\n return unavailable;\n });\n } else {\n return unavailable;\n }\n }", "title": "" }, { "docid": "d8a15c2440259eaaed480e66ef593090", "score": "0.5596421", "text": "async function getUser() {\n try {\n const response = await fetch('https://jsonplaceholder.typicode.com/uses/3');//error here-uses/users\n if (!response.ok) {\n throw new Error(response.status);\n }\n const person = await response.json();\n console.log(person); \n }\n catch (error) {\n console.log(error);\n }\n\n}", "title": "" }, { "docid": "b7617a3584d4b3dd6c45a3ed794e73e0", "score": "0.5592057", "text": "fetchingData (url) {\n return fetch(url)\n .then(response => {\n if (response.status !== 200) {\n console.log('Problem ' + response.status)\n }\n return response.json()\n })\n }", "title": "" }, { "docid": "1a061ef7255c1ac259f4d9ee3fad7091", "score": "0.55912906", "text": "_handleResponseErrors() {\n if (!this._sendFlag) {\n return;\n }\n if (this._timedOutFlag) {\n // Timeout\n this._requestErrorSteps('timeout');\n } else if (this._isNetworkErrorResponse()) {\n // Network error\n this._requestErrorSteps('error');\n }\n }", "title": "" }, { "docid": "5472f4fd0d3f3401d30122a18df78ff7", "score": "0.55777913", "text": "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n unsplashDataArr = await response.json();\n displayPhotos();\n } catch (error) {\n // Catch Error here\n console.error(error);\n }\n}", "title": "" }, { "docid": "21388703b1253921d8169ec65b335543", "score": "0.5564063", "text": "@action(constants.FETCH_ASSIGNMENTS_FAIL)\n handleFetchAssignmentsFail(payload) {\n }", "title": "" }, { "docid": "9bb3c0b0b25692ab0b2fa7d1d60dcb28", "score": "0.556039", "text": "function onFetchHivSummaryFlatTableError(error){\n $scope.isBusy=false;\n $scope.experiencedLoadingErrors=true;\n }", "title": "" }, { "docid": "e6f2c1fbf44599b87ce18a7c04d58956", "score": "0.55602074", "text": "function handleFailedRequestWithRawResponse(error, hmpBatchSize, rawVistaResponse) {\n self.log.error('%s rawVistaResponse: %s', error, rawVistaResponse);\n self.metrics.debug('Vista Fetch Next (raw response) in Error', metricsObj);\n var wrappedResponse = {\n data: null,\n hmpBatchSize: hmpBatchSize,\n rawResponse: rawVistaResponse\n };\n return batchCallback(error, wrappedResponse);\n }", "title": "" }, { "docid": "7759f0abdd4443c7685d811afa374843", "score": "0.5557483", "text": "handleError(error) {\n let data = error.response.data;\n let categoryErrorMsg = data[\"category\"]\n let entryErrorMsg = data[\"entry\"]\n if (categoryErrorMsg) {\n this.setState({\n categoryError: true,\n categoryHelperText: categoryErrorMsg\n });\n }\n // Not reachable by the average user.\n if (entryErrorMsg) {\n this.setState({\n entryError: true,\n entryHelperText: entryErrorMsg\n });\n }\n }", "title": "" }, { "docid": "3c88917917757ed5a40df1cc0d7bb23a", "score": "0.5549846", "text": "static _handleFetch(url, params = {}, method=\"GET\"){\n url = apiBase + url;\n let queryString = \"\";\n\n if(method === 'GET'){ //builds query string based on params object\n queryString = '?' + Object.keys(params)\n .map(function(k){\n return encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);\n }).join('&');\n }\n return fetch(url + queryString, {\n method: method,\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n 'Token': token\n },\n body: (method === 'GET' ? null : JSON.stringify(params))\n })\n /* fetch only throws an error to our catch\n block if the server doesn't respond. So a 500 response\n from the server will still resolve in your promises \n success. The processStatus function handles that for us.\n */\n .then(ApiService._processStatus)\n .then(res => res.text()) // Sometimes servers return 200 with no response, we convert to text and make sure it has length or we return an empty object\n .then(response => response.length ? JSON.parse(response) : {})\n .catch((err)=>{\n throw err;\n });\n\n }", "title": "" }, { "docid": "5a088729d500b1b2b0b091769b6589e2", "score": "0.5548327", "text": "fetch(callback, progress) {\n callback(\"Not Implemented\");\n }", "title": "" }, { "docid": "93794a1ad37d4c5ca97b6200d821a6fb", "score": "0.55482215", "text": "onerror(socket, error) {\r\n //\r\n }", "title": "" }, { "docid": "aadd9e079b03e89f41a0b2f87f085be4", "score": "0.5545749", "text": "function unableToResolve () {\n \n \n console.log('WORKER: fetch request failed in both cache and network.');\n \n \n\n // construct self response\n return new Response('<h1>Service Unavailable</h1>', {\n status: 503,\n statusText: 'Service Unavailable',\n headers: new Headers({\n 'Content-Type': 'text/html'\n })\n });\n }", "title": "" }, { "docid": "2a72810d42a726f2e71088568a9b566c", "score": "0.5544103", "text": "function afgrab (rs) {\n if (rs.status !== 200) {\n om.grabError(ii,url);\n }\n }", "title": "" }, { "docid": "a042549dd7f3984c7bc7f7ad01c65956", "score": "0.5530391", "text": "async function getGithubUser() {\n try { \n const response = await fetch('https://api.github.com/users/laksjdflasjfdlkjadfjk');// error here\n if (!response.ok) {\n throw new Error(response.status); \n }\n } catch (error) {\n console.log('Could not fetch user, try resetting your connection');//showing eeror message in console\n//\t or alert('Could not fetch user, try resetting your connection');//showing eeror message to user\n// or alert(error.message);\n\n \n } \n}", "title": "" }, { "docid": "b711564bcc6daf89658527685299ace6", "score": "0.5527", "text": "function handleError(response) {\n\t\t\t\t// The API response from the server should be\n\t\t\t\t// returned in a\n\t\t\t\t// normalized format. However, if the request\n\t\t\t\t// was not handled by the\n\t\t\t\t// server (or what not handles properly - ex.\n\t\t\t\t// server error), then we\n\t\t\t\t// may have to normalize it on our end, as best\n\t\t\t\t// we can.\n\n\t\t\t\tif(response.status==422){\n\t\t\t\t\tif(response.data._issues){\n\t\t\t\t\t\treturn ($q.reject(\"Feil i dataformat fra klienten: \"+JSON.stringify(response.data._issues)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!angular.isObject(response.data) || angular.isUndefined(response.data._error) || !response.data._error.message) {\n\t\t\t\t\tconsole.log(response);\n\t\t\t\t\treturn ($q.reject(\"An unknown error occurred. \"+response.statusText));\n\t\t\t\t}\n\t\t\t\t// Otherwise, use expected error message.\n\t\t\t\tconsole.log(response.data._error.message);\n\t\t\t\treturn ($q.reject(response.data._error.message));\n\t\t\t}", "title": "" }, { "docid": "88425d91af11c2f045625793e5aac5a0", "score": "0.5526423", "text": "async function httpReject() {\n Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"error\"])('No HTTP fetch method available.');\n}", "title": "" }, { "docid": "8f51dc61799d33af03d7737924f6c938", "score": "0.5514366", "text": "async function httpReject() {\n vegaUtil.error('No HTTP fetch method available.');\n }", "title": "" }, { "docid": "061adab36761f7dacdafb76e9b214ead", "score": "0.5491627", "text": "function vote(id){\n event.preventDefault();\n const show = fetchShow(id);\n show.then(function(showData){\n const currentShow = new Show(showData.data)\n currentShow.title = showData.data.attributes[\"show-title\"];\n currentShow.type = showData.data.attributes[\"show-type\"];\n currentShow.genre = showData.data.attributes[\"genre\"];\n currentShow.watchlist = showData.data.attributes[\"watchlist-id\"];\n currentShow.vote = showData.data.attributes[\"vote\"];\n currentShow.upVote();\n })\n .catch(function(error){ //SHOULD IT GO HERE OR BELOW IN fetchShow?\n let e = \"vote Error\";\n alert(e);\n })\n}", "title": "" }, { "docid": "05d390c04bcb265aa942cc22ada52f17", "score": "0.549008", "text": "isFetchFailure(responseMessage) {\n return responseMessage === 'Unable to reach server';\n }", "title": "" }, { "docid": "17dcf5bf052b3547d7da08763e8d23a1", "score": "0.5465032", "text": "function fetchData(url) {\n fetch(url)\n .then(response => handleResponse(response))\n .catch(function() {alert('error !');});\n }", "title": "" }, { "docid": "c369f62d6f651c929c2667c4eecea9ca", "score": "0.5463537", "text": "function httpClientError(e) {\n Ti.API.debug(e.error);\n alert('Could not populate initial list');\n}", "title": "" }, { "docid": "6c4ae3cb9e84f0938ced23b70b955a6b", "score": "0.5462318", "text": "function doOnError() {\n revertToLastQueryParamsState.call(this);\n this.apiInProgress = false;\n}", "title": "" }, { "docid": "6c4ae3cb9e84f0938ced23b70b955a6b", "score": "0.5462318", "text": "function doOnError() {\n revertToLastQueryParamsState.call(this);\n this.apiInProgress = false;\n}", "title": "" }, { "docid": "7c2b620d19bb07816976a79cffacb80a", "score": "0.54614764", "text": "static async fetchRestaurantsFromNetwork() {\r\n try {\r\n const response = await window.fetch(DBHelper.DATABASE_URL) ;\r\n if (response.ok) return response.json() ;\r\n // response may occur but with the wrong status code\r\n // that wan't reject the promise\r\n return Promise.reject(`error returned with ${response.status} status code`);\r\n }\r\n // if any error happen while fetching\r\n // like internet connectivity or not valid url\r\n // reject error\r\n catch (e) {\r\n return Promise.reject(e);\r\n }\r\n\r\n\r\n }", "title": "" }, { "docid": "2977688707bab5a71c8085edd357c078", "score": "0.54607785", "text": "GetAttractions() {\n fetch('http://localhost:4200/api/attraction')\n.then(res => res.json())\n.then(data => {\n if(data.code === '404') {\n this.setState({\n isFetching: false,\n })\n } else {\n this.setState({\n isFetching: true,\n Attractions: data, \n });\n }\n})\n.catch(err => {\n console.log(err);\n })\t\n console.log(Attractions);\n}", "title": "" }, { "docid": "8060a8820b73c4dcbff0f96113afe7a3", "score": "0.5460425", "text": "function error_handler (loadcount, err) {\r\n console.log(\"Error loading batch #\" + loadcount + \": \" + err + \"\\n\");\r\n}", "title": "" }, { "docid": "7e691feebf3490428a62d395b5e0c1ec", "score": "0.54587495", "text": "function fetchAllApiError(error) {\n i18nNotifications.pushForCurrentRoute('crud.default.error', 'warning');\n }", "title": "" }, { "docid": "96cce1a521f4f4d2ab9c39ad48455342", "score": "0.5457524", "text": "async function getQuotes(){\r\n showLoading();\r\n const apiUrl='https://type.fit/api/quotes';\r\n try{\r\n const response = await fetch(apiUrl);\r\n apiQuotes = await response.json();\r\n newQuote();\r\n } catch(error){\r\n //Catch Error Here\r\n }\r\n}", "title": "" }, { "docid": "c15428e3c923bb75893a1bb24906807d", "score": "0.54464644", "text": "function fetchData(url) {\n return fetch(url)\n .then(response => {if (!response.ok) { throw Error(response.status); }\n else {return response.json();}})\n .catch(err => console.log(err.message));\n}", "title": "" }, { "docid": "e3c0a9d8c2c3ead5e65dc6ee024d25c7", "score": "0.5444363", "text": "async function getQuotes() {\n showLoadingSpin();\n const apiUrl = 'https://type.fit/api/quotes';\n try {\n const response = await fetch(apiUrl)\n apiQuotes = await response.json();\n newQuote();\n } catch (error) {\n console.log('whoops, no quote', error)\n errorCounter++\n console.log(errorCounter)\n if (errorCounter < 40) getQuotes();\n else noQuoteError();\n }\n\n}", "title": "" }, { "docid": "366d0bde0f22076c942db8f9ecdcd02a", "score": "0.5439027", "text": "fetchErrorMsg(error){\n return error.errors.message[0];\n }", "title": "" }, { "docid": "f4b2b895b42f6e1211be2d4eaea55d4c", "score": "0.54291767", "text": "function handleFetch(fetchReq) {\n return new Promise((resolve, reject) => {\n fetchReq.then(response => {\n const contentType = response.headers.get('content-type');\n if (contentType && contentType.indexOf('application/json') !== -1) {\n if (response.ok) {\n response.json().then(json => {\n handleSuccessFetch(response, json, resolve, reject);\n });\n } else {\n reject({\n code: 0, // non 2xx response\n status: response.status,\n url: response.url,\n message: 'Network response was not ok!',\n });\n }\n } else {\n reject({\n code: -1, // non json response\n status: response.status,\n url: response.url,\n message: 'Non-JSON response!',\n });\n }\n }).catch(err => {\n reject({\n code: -2, // cannot even fetch\n message: `There has been a problem with your fetch operation: ${err.message}`,\n });\n });\n });\n}", "title": "" }, { "docid": "eb1169f578cecf7aad1287811b45c5d8", "score": "0.54195315", "text": "function handleError() {\n if (onFailure instanceof Function) {\n onFailure();\n }\n }", "title": "" }, { "docid": "91b4edd9609a2f03b3f34a91d89cf6a7", "score": "0.5411", "text": "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n photosArray = await response.json();\n displayPhotos();\n } catch (error) {\n // Catch error here\n }\n}", "title": "" }, { "docid": "91b4edd9609a2f03b3f34a91d89cf6a7", "score": "0.5411", "text": "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n photosArray = await response.json();\n displayPhotos();\n } catch (error) {\n // Catch error here\n }\n}", "title": "" }, { "docid": "fa2f48cd0b1dde71c4fb385de8b21015", "score": "0.54106784", "text": "fetchMissingAsset( path ){ console.error(\"No fetch handler for \", path, \" you need to overwrite the fetchMissingAsset method\"); }", "title": "" }, { "docid": "e8f5a67892ebfec32b6b72a7b2a3e51c", "score": "0.54104096", "text": "async function functionCatchesErrorMixin() {\n const data = await throwError().catch(e => {\n var listItem = document.createElement('li');\n var text = document.createTextNode(`I was properly handled with a mixed promise and async/await syntax!`);\n listItem.className = 'list-item-good';\n listItem.appendChild(text);\n document.getElementById('all-promise-results').appendChild(listItem);\n })\n}", "title": "" }, { "docid": "5d09e0e3a6d6b76f8fd3e7ed1ddbd937", "score": "0.5409416", "text": "async handleResponseError(response) {\n if (!response.ok) {\n let json, errorMessage;\n errorMessage = response.statusText || response.Message;\n try {\n json = await response.json();\n } catch (e) {\n throw new Error(errorMessage);\n }\n throw json;\n }\n }", "title": "" }, { "docid": "75d026acf38df7a58ea3622bc0d1b8a9", "score": "0.5408102", "text": "function fetchFailed(error, request) {\n\t\t //hide throbber\n\t\t dojo.style(dojo.byId(\"gpGalleryAnimLoading\"), \"display\", 'none');\n\t\t console.log(error);\n\t\t alert(error);\n\t\t}", "title": "" }, { "docid": "60fcef3d82ad18df4b45001fce13f82a", "score": "0.54056525", "text": "async catchErrors(e,response,code,detail) {\n\n // Error messages should never be base64 encoded\n response._isBase64 = false\n\n // Strip the headers (TODO: find a better way to handle this)\n response._headers = {}\n\n let message\n\n // Set the status code\n response.status(code ? code : this._errorStatus)\n\n let info = {\n detail,\n statusCode: response._statusCode,\n coldStart: response._request.coldStart,\n stack: this._logger.stack && e.stack || undefined\n }\n\n if (e instanceof Error) {\n message = e.message\n this.log.fatal(message,info)\n } else {\n message = e\n this.log.error(message,info)\n }\n\n // If first time through, process error middleware\n if (response._state === 'processing') {\n\n // Flag error state (this will avoid infinite error loops)\n response._state = 'error'\n\n // Execute error middleware\n for (const err of this._errors) {\n if (response._state === 'done') break\n // Promisify error middleware\n await new Promise(r => {\n let rtn = err(e,response._request,response,() => { r() })\n if (rtn) response.send(rtn)\n })\n } // end for\n }\n\n // Throw standard error unless callback has already been executed\n if (response._state !== 'done') response.json({'error':message})\n\n }", "title": "" }, { "docid": "0a1cca425b9e00dd4ed01bb47fc0cf64", "score": "0.54002947", "text": "componentDidMount() {\n fetch(\"https://dog.ceo/api/breeds/list/all\")\n .then(res => res.json())\n .then(\n (result) => {\n if (result.status !== \"success\") {\n console.log('not success')\n this.setState({\n isLoaded: true,\n error: true\n });\n } else {\n // this is not a fetch error, but an error from the API\n console.log(result);\n this.setState({\n isLoaded: true,\n breeds: result.message\n });\n }\n },\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n );\n }", "title": "" }, { "docid": "b43b4afe7b9ca881abc61f49f1a5701a", "score": "0.5387482", "text": "handleHTTPErrorResponse(pHTTPErrorResponse) {\n let Error = {\n code: 0,\n desc: '' // Error Description\n };\n // format error received from response :\n // {\n // \t\"statusCode\":404,\n // \t\"body\":\"\",\n // \t\"headers\":{\n // \t\t\"content-type\":\"text/html;charset=iso-8859-1\",\n // \t\t\"cache-control\":\"must-revalidate,no-cache,no-store\",\n // \t\t\"content-length\":\"1401\",\n // \t\t\"connection\":\"close\",\n // \t\t\"server\":\"Jetty(6.1.x)\"\n // \t},\n // \t\"request\":{\n // \t\t\"uri\":{\n // \t\t\t\"protocol\":\"http:\",\n // \t\t\t\"slashes\":true,\n // \t\t\t\"auth\":null,\n // \t\t\t\"host\":\"localhost:5678\",\n // \t\t\t\"port\":\"5678\",\n // \t\t\t\"hostname\":\"localhost\",\n // \t\t\t\"hash\":null,\n // \t\t\t\"search\":null,\n // \t\t\t\"query\":null,\n // \t\t\t\"pathname\":\"/OPISNET/services/idsp/userValidation\",\n // \t\t\t\"path\":\"/OPISNET/services/idsp/userValidation\",\n // \t\t\t\"href\":\"http://localhost:5678/OPISNET/services/idsp/userValidation\"\n // \t\t},\n // \t\t\"method\":\"POST\",\n // \t\t\"headers\":{\n // \t\t\t\"Content-Type\":\"application/json\",\n // \t\t\t\"content-length\":42\n // \t\t}\n // \t}\n // }\n switch (pHTTPErrorResponse.statusCode) {\n case 404:\n Error.code = 116;\n Error.desc = 'SERVICE_NOT_FOUND';\n break;\n case 403:\n Error.code = 117;\n Error.desc = 'FORBIDDEN_REQUEST';\n break;\n default:\n console.log(pHTTPErrorResponse);\n Error.code = 120;\n Error.desc = \"UNHANDLED_ERROR\";\n break;\n }\n return Error;\n }", "title": "" }, { "docid": "fbd8bb408d47ecdf5137767e35c1a9bf", "score": "0.5383648", "text": "function dealWithError({response, json, credentials}) {\n switch (response.status) {\n case 401:\n throw new Error(\n `Unauthorized access to Maps API: invalid combination of user ('${\n credentials.username\n }') and apiKey ('${credentials.apiKey}')`\n );\n case 403:\n throw new Error(\n `Unauthorized access to dataset: the provided apiKey('${\n credentials.apiKey\n }') doesn't provide access to the requested data`\n );\n\n default:\n const e =\n credentials.apiVersion === _maps_api_common__WEBPACK_IMPORTED_MODULE_1__[\"API_VERSIONS\"].V1 ? JSON.stringify(json.errors) : json.error;\n throw new Error(e);\n }\n}", "title": "" }, { "docid": "df4000b0aa0cc210d5719f2a44253603", "score": "0.53774875", "text": "async function getPages (){\n const myurl2 = `http://localhost:5002/select/page/${title.value}`\n const requestOptions2 = {\n 'content-type': 'application/json',\n method: 'GET',\n redirect: 'follow'\n };\n\n fetch(myurl2,requestOptions2)\n .then(response => response.json())\n .then(data => {\n console.log(data)\n\n console.log(\"Findes allerede\")\n document.getElementById('alreadyExists').innerHTML = \"Aktivitet Eksistere allerede\";\n }).catch(async function(e){\n await insertPage();\n\n console.log(e)\n })\n}", "title": "" }, { "docid": "48ae71bac907e416ec7ce13979ebc53b", "score": "0.5375092", "text": "function _handleConnectError (err) {\n\t\t// we can't complete out promise\n\t\t// so reject it\n\t\tdefer.reject(err)\n\t}", "title": "" }, { "docid": "016e89dd15010a8689fc8387e372de41", "score": "0.5364908", "text": "function catchError(response) {\n return response.json().catch(function () {});\n }", "title": "" }, { "docid": "a3e6c255f046170e6b3ed32d3a52765b", "score": "0.53625304", "text": "function handleFail() {\n try {\n // Fallback mechanism is to take the previously-stored list from chrome.storage.local\n chrome.storage.local.get([\"domains\"], function(result) {\n domains = result.domains;\n }); \n } catch (err) {\n // Only runs once\n if (!failureHandledOnce) {\n loadDomains();\n }\n }\n failureHandledOnce = true;\n}", "title": "" }, { "docid": "b593182abb7dfd27c591f8824bc4eeb4", "score": "0.53586304", "text": "function networkThenFallback(event) {\n event.respondWith(\n fetch(event.request)\n .then(function (response) {\n return response;\n }, unableToFetch)\n .catch(unableToFetch)\n );\n}", "title": "" }, { "docid": "22b384067026fe8c45af4289e46171d0", "score": "0.5350361", "text": "unhandled() {\n throw new Error('request for ' + this.hash + ' UNHANDLED');\n }", "title": "" }, { "docid": "4f8208b8252360ab99429659f91b823f", "score": "0.5349451", "text": "function treatFetch (response) {\n if (response && response.status == 200) {\n let done = _=>{\n resolve(response);\n };\n\n // store it in the indexedDB\n indexedDBManager.save(rule.name, response.clone())\n .then(done)\n .catch(done); // if failed saving, we still have the reponse to deliver\n }else{\n debugger;\n // TODO: treat the not found requests\n }\n }", "title": "" }, { "docid": "8a6f6fea61f3b330c8d1397ab9d5ef53", "score": "0.5345569", "text": "function fetchAndProcessArticle(targetElm, artIdFromHash, offsetFromHash, totalCountFromHash,forEdit) {\n const url = `${urlBase}/article/${artIdFromHash}`;\n //const url = \"https://wt.kpi.fei.tuke.sk/api/article\";\n\n fetch(url)\n .then(response =>{\n if(response.ok){\n return response.json();\n }else{ //if we get server error\n return Promise.reject(new Error(`Server answered with ${response.status}: ${response.statusText}.`));\n }\n })\n .then(responseJSON => {\n\n if(forEdit){\n responseJSON.formTitle=\"Article Edit\";\n responseJSON.formSubmitCall =\n `processArtEditFrmData(event,${artIdFromHash},${offsetFromHash},${totalCountFromHash},'${urlBase}','PUT')`;\n responseJSON.submitBtTitle=\"Save article\";\n responseJSON.urlBase=urlBase;\n\n responseJSON.backLink=`#article/${artIdFromHash}/${offsetFromHash}/${totalCountFromHash}`;\n\n document.getElementById(targetElm).innerHTML =\n Mustache.render(\n document.getElementById(\"template-article-form\").innerHTML,\n responseJSON\n );\n }else{\n responseJSON.backLink=`#articles/${offsetFromHash}/${totalCountFromHash}`;\n responseJSON.editLink=`#artEdit/${responseJSON.id}/${offsetFromHash}/${totalCountFromHash}`;\n responseJSON.deleteLink=`#artDelete/${responseJSON.id}/${offsetFromHash}/${totalCountFromHash}`;\n responseJSON.addCommentLink=`#addComment/${responseJSON.id}/${offsetFromHash}/${totalCountFromHash}`;\n comment(targetElm, artIdFromHash, responseJSON, offsetFromHash, totalCountFromHash);\n }\n\n })\n .catch (error => { ////here we process all the failed promises\n const errMsgObj = {errMessage:error};\n document.getElementById(targetElm).innerHTML =\n Mustache.render(\n document.getElementById(\"template-articles-error\").innerHTML,\n errMsgObj\n );\n });\n\n}", "title": "" }, { "docid": "7a7ef1754c65e3d69bde1ee8b715aa13", "score": "0.5343488", "text": "function getSubmissions(url){\ntry{\n fetch(url ,{ headers : { \n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n }}).then((result , err)=>{ \n result.json().then((ress , status)=>{\n console.log(ress);\n let submissions = ress.result ;\n if(ress.status === \"OK\" && submissions.length > 0){\n submissions.forEach((currSubmission)=>{\n if(currSubmission.verdict === \"OK\"){\n let currProblem = currSubmission.problem;\n let contestIndex = currProblem.contestId;\n contestIndex = contestIndex.toString();\n let problemIndex = currProblem.index;\n let now = contestIndex + problemIndex;\n changeClass(now);\n }\n })}\n })\n //.catch((err)=>{\n // console.log(\"An error occured\" +'\\n');\n // })\n })\n //.catch((err)=>{\n // console.log(\"An error occured\" +'\\n');\n //})\n}\ncatch (err){\n console.log('some error occured' +'\\n');\n}\n}", "title": "" }, { "docid": "958300a2c7cbe21be144b8a1539322f2", "score": "0.53421634", "text": "function locationFetchFailed(error) {\n if (error.code === error.PERMISSION_DENIED) {\n console.log(\"Geolocation permission denied\");\n if (typeof(Storage) !== \"undefined\") {\n localStorage.setItem(\"geolocation.permission.denieddate\", new Date());\n }\n } else {\n console.warn(\"Accessing geolocation failed.\", error);\n }\n}", "title": "" }, { "docid": "d0c9c7e5ff558c8842839f28cd60a2be", "score": "0.533536", "text": "onerror(err) {\n void err\n }", "title": "" }, { "docid": "c5bc1bdc1ae60ca59eda51e55a98965a", "score": "0.533249", "text": "function handleFailedRequestWithRawResponse(error, rawVistaResponse) {\n self.metrics.debug('Vista Fetch Appointment in Error', metricsObj);\n self.log.error('%s rawVistaResponse: %s', error, rawVistaResponse);\n return batchCallback(error, rawVistaResponse);\n }", "title": "" }, { "docid": "97595bbcb0418ea7b1e9fcdf4bc1590f", "score": "0.533143", "text": "function handleErrorResponse(xhr, textStatus, error) {\r\n // error handling\r\n if (xhr.status === 404) {\r\n throw new Error('This Ajax call has not been implemented.');\r\n } else if (xhr.status === 500) {\r\n throw new Error('This Ajax call threw an exception: ' + error);\r\n } else if (xhr.status === 0) {\r\n throw new Error('The WebCheckers server is down.');\r\n } else {\r\n throw new Error(`Unknown error (status=${xhr.status}) error: '${error}'`);\r\n }\r\n }", "title": "" }, { "docid": "e1a4f501edbdeefdf86711d08cdab61b", "score": "0.532646", "text": "function checkFetchStatus(response) {\n if (response.status !== 200) {\n console.log(\"Failed to get data from API. Status code: \" + response.status);\n return Promise.reject(response);\n } else {\n return Promise.resolve(response);\n }\n}", "title": "" }, { "docid": "4becb4a55263cd60da72ef0a7107bada", "score": "0.5323336", "text": "function error() {\n notificationEl.innerHTML = \"Unable to retrieve your location. Here, have Helsinki's weather instead.\"\n\n let lat = 60.1695;\n let lon = 24.9355;\n\n fetch(`http://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&APPID=${API_KEY}&units=metric`)\n .then(data => {\n return data.json();\n })\n .then(displayWeather);\n }", "title": "" }, { "docid": "93aa561c698c2e9e80eb8ce72739a23b", "score": "0.53188586", "text": "handleError(r, reject) {\n if (!r.ok) {\n HttpRequestError.init(r).then(reject);\n }\n return r.ok;\n }", "title": "" }, { "docid": "93aa561c698c2e9e80eb8ce72739a23b", "score": "0.53188586", "text": "handleError(r, reject) {\n if (!r.ok) {\n HttpRequestError.init(r).then(reject);\n }\n return r.ok;\n }", "title": "" } ]
78e3da60b635922439381993f169063e
Returns if the given service is advertising on the provided network interface.
[ { "docid": "0663810875fa6a2d2526e3dc5448be87", "score": "0.550891", "text": "advertisesOnInterface(name, skipAddressCheck) {\n var _a, _b, _c, _d;\n return !this.restrictedAddresses || this.restrictedAddresses.has(name) && (skipAddressCheck ||\n // must have at least one address record on the given interface\n !!((_a = this.serviceRecords) === null || _a === void 0 ? void 0 : _a.a[name]) || !!((_b = this.serviceRecords) === null || _b === void 0 ? void 0 : _b.aaaa[name])\n || !!((_c = this.serviceRecords) === null || _c === void 0 ? void 0 : _c.aaaaR[name]) || !!((_d = this.serviceRecords) === null || _d === void 0 ? void 0 : _d.aaaaULA[name]));\n }", "title": "" } ]
[ { "docid": "12f4d0c4a8d55c47c8343622269a4442", "score": "0.58190423", "text": "async hasWirelessInterface () {\n const interfaces = await this.getDbusInterfaces()\n return interfaces.includes(this.dbusConfig.name + '.Wireless')\n }", "title": "" }, { "docid": "8781becbced25e00c4bb7c2a961d7cd4", "score": "0.496209", "text": "function hasInterface(obj, interfaceName) {\n if (interfaceName === \"System.Collections.Generic.IEnumerable\") {\n return typeof obj[Symbol.iterator] === \"function\";\n }\n else if (typeof obj[FSymbol.reflection] === \"function\") {\n const interfaces = obj[FSymbol.reflection]().interfaces;\n return Array.isArray(interfaces) && interfaces.indexOf(interfaceName) > -1;\n }\n return false;\n}", "title": "" }, { "docid": "5a1b0e03d0d8364813716f3ad6d6d43d", "score": "0.48636818", "text": "has(identifier) {\n return !!this.findService(identifier);\n }", "title": "" }, { "docid": "37426c76e9f8a45a3117b996d8d76ff8", "score": "0.48179904", "text": "function isServicedCountry(){\r\n var userCountry = this.attributes[constants.ATTRIBUTES.COUNTRY];\r\n if(__.isUndefined(userCountry) || __.isNull(userCountry)) return false;\r\n var servicedCountries = cfg.APP.SERVICE_COUNTRIES;\r\n var strippedCountry = _.trim(userCountry);\r\n return !__.isEmpty(servicedCountries) && __.contains(servicedCountries, strippedCountry);\r\n}", "title": "" }, { "docid": "9bb76c05809f2482f58790ab8156ea4c", "score": "0.479803", "text": "function isIndependentInterface(symbol) {\n for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n var declaration = _a[_i];\n if (declaration.kind === 230 /* InterfaceDeclaration */) {\n if (declaration.flags & 64 /* ContainsThis */) {\n return false;\n }\n var baseTypeNodes = ts.getInterfaceBaseTypeNodes(declaration);\n if (baseTypeNodes) {\n for (var _b = 0, baseTypeNodes_1 = baseTypeNodes; _b < baseTypeNodes_1.length; _b++) {\n var node = baseTypeNodes_1[_b];\n if (ts.isEntityNameExpression(node.expression)) {\n var baseSymbol = resolveEntityName(node.expression, 793064 /* Type */, /*ignoreErrors*/ true);\n if (!baseSymbol || !(baseSymbol.flags & 64 /* Interface */) || getDeclaredTypeOfClassOrInterface(baseSymbol).thisType) {\n return false;\n }\n }\n }\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "3e163b347d8d00c5ec6a16bf8781c044", "score": "0.4797251", "text": "function internetAvailable() {\n try {\n var networkStatus = navigator.connection;\n if ((networkStatus.type == Connection.UNKNOWN) || (networkStatus.type == Connection.NONE)) {\n return false;\n } else {\n return true;\n }\n } catch (e) {\n console.log('Error caught: ' + e);\n return false;\n }\n}", "title": "" }, { "docid": "7a4d9ee81a7bdb7fa3e0ca0b84ac1af4", "score": "0.47620732", "text": "function isAccessible(aAccOrElmOrID, aInterfaces)\n{\n return getAccessible(aAccOrElmOrID, aInterfaces, null,\n DONOTFAIL_IF_NO_ACC | DONOTFAIL_IF_NO_INTERFACE) ?\n true : false;\n}", "title": "" }, { "docid": "dd219ff70b2554225eae7273051fc11f", "score": "0.47535062", "text": "function _isInSelectedNetwork(host) {\n var interfaceKeys = Object.keys(host.networks),\n len = interfaceKeys.length,\n flag = false,\n i;\n\n for (i = 0; i < len; i++) {\n\n if (host.networks[interfaceKeys[i]].subnet === selectedCluster.clusterNetwork) {\n flag = true;\n host.provisioningIP = host.networks[interfaceKeys[i]].ipv4[0];\n return flag;\n }\n }\n\n return flag;\n }", "title": "" }, { "docid": "7ee0c35a7879662dd3bde9857cc0fa5f", "score": "0.47495356", "text": "function isDeviceOnline(applianceId) {\n return true;\n}", "title": "" }, { "docid": "e909887219409a677af6de9b91b826b4", "score": "0.47227526", "text": "function detect(ip, device, options, callback) {\n let foundInstance = false;\n\n device._upnp.forEach(upnp => {\n if (!foundInstance && (upnp['GWID.PHOSCON.DE'] || upnp['gwid.phoscon.de'])) {\n if (addDeconz(ip, device, options)) {\n foundInstance = true;\n }\n }\n });\n\n callback(null, foundInstance, ip);\n}", "title": "" }, { "docid": "d828fb9e60332a5fd739849c574ea47b", "score": "0.46294647", "text": "isDialing (peerInfo) {\n return this._dialing.has(peerInfo.id.toB58String())\n }", "title": "" }, { "docid": "f82ea19f5d339ec7cd87b9b933a1747b", "score": "0.4599066", "text": "function isServiceRequestPending()\n{\n\treturn service_request_counter > 0;\n}", "title": "" }, { "docid": "5cbfbb3432dccf7e5e1abc28a8d5b6e2", "score": "0.45958883", "text": "async function isGanacheRunning() {\n const suggestedFreePort = await detect(port);\n return suggestedFreePort !== port;\n}", "title": "" }, { "docid": "f641c4b8c739431f4996f6359dde0765", "score": "0.45861873", "text": "isConnected() {\n return this.client !== null;\n }", "title": "" }, { "docid": "2744c5f46830f5ad0bea7fafde0eb6f3", "score": "0.45845363", "text": "static hasAgent(id) {\n return isAgent(this[id]);\n }", "title": "" }, { "docid": "5f5842d03210d9e6dd0d307bb01a3c3d", "score": "0.45635808", "text": "isXbeeAp(input) {\n let ssid = input;\n if (input instanceof Object) {\n // check for mac mactching\n ssid = input.SSID;\n }\n ssid = ssid.replace('\"', '');\n if (ssid.startsWith(XBEE_AP_PREFIX)\n && ssid.length === XBEE_AP_PREFIX.length + 12)\n return true;\n\n // if all checks failed\n return false;\n }", "title": "" }, { "docid": "969dd08e419d244e44395261eee2daa3", "score": "0.45107618", "text": "function isInNet(target, address, mask)\n{\n try\n {\n var destAddr = resolve(target)._integers[0];\n var maskAddr = resolve(mask)._integers[0];\n return (_ipv4From(destAddr & maskAddr) == address);\n }\n catch(e)\n {\n return (false);\n }\n}", "title": "" }, { "docid": "436bd76ba24a52f2808b015eab1351ec", "score": "0.44649082", "text": "function isConnected() {\n var networkState = navigator.network.connection.type;\n var states = {};\n states[Connection.UNKNOWN] = 'Unknown connection';\n states[Connection.ETHERNET] = 'Ethernet connection';\n states[Connection.WIFI] = 'WiFi connection';\n states[Connection.CELL_2G] = 'Cell 2G connection';\n states[Connection.CELL_3G] = 'Cell 3G connection';\n states[Connection.CELL_4G] = 'Cell 4G connection';\n states[Connection.NONE] = 'No network connection';\n\n //alert('Connection type: ' + states[networkState]);\n\n if(stats[networkState] == Connection.NONE)\n return false;\n else\n return true;\n}", "title": "" }, { "docid": "1bc9092a2c9839167d29d7b70a493633", "score": "0.445192", "text": "async function isService(headers, cookie, body) {\n return false;\n }", "title": "" }, { "docid": "d93fbd1d76f8c13769e02e830002a36a", "score": "0.44435063", "text": "function implementsInterface(controller) {\n if (typeof controller.resourceName === 'string' &&\n typeof controller.findProject === 'function' &&\n typeof controller.retrieveEmail === 'function' &&\n typeof controller.retrieveFirstName === 'function' &&\n typeof controller.retrieveLocation === 'function' &&\n typeof controller.submitDonation === 'function' &&\n typeof controller.setHost === 'function') {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "81f7bc3dc213694b403fb29ceabdf7a6", "score": "0.44068086", "text": "mayImplement(type: CompositeTypeID, interfaceType: InterfaceTypeID): boolean {\n return (\n this.areEqualTypes(type, interfaceType) ||\n this.implementsInterface(type, interfaceType) ||\n (this.isAbstractType(type) &&\n hasConcreteTypeThatImplements(this, type, interfaceType))\n );\n }", "title": "" }, { "docid": "6c67eeed97f8dd5f7b29b836aab4ed62", "score": "0.4388169", "text": "supportsAPL(handlerInput) {\n const {supportedInterfaces} = handlerInput.requestEnvelope.context.System.device;\n return !!supportedInterfaces['Alexa.Presentation.APL'];\n }", "title": "" }, { "docid": "8a4e04d973067462a6cd13f09be2e68e", "score": "0.43773642", "text": "hasAttached() {\n return this._portalOutlet.hasAttached();\n }", "title": "" }, { "docid": "8a4e04d973067462a6cd13f09be2e68e", "score": "0.43773642", "text": "hasAttached() {\n return this._portalOutlet.hasAttached();\n }", "title": "" }, { "docid": "241293b7da74ee40f441381e6658f9cd", "score": "0.43689355", "text": "function stanzaExists (id) {\n if (id === undefined || id === '') {\n return false\n }\n\n return (id in getCurrentProcess().flow)\n}", "title": "" }, { "docid": "d942bb5c1938e4bba86707d107089fe7", "score": "0.43683758", "text": "show_ads(){\n\t\tif(location.hostname === \"localhost\"){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "8e561ea93c7a36c89860c38a10f130f8", "score": "0.43654844", "text": "function isAGif(url) {\n var splitUrl = url.split('.');\n var fileExtension = splitUrl[splitUrl.length - 1];\n if (fileExtension.indexOf('gif') !== -1) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "a7769559b2e194ae23e68d12448c4b38", "score": "0.43510818", "text": "isServiceEnabled() {\n return window.matchMedia('(max-width: 991px)').matches\n }", "title": "" }, { "docid": "8110ac361ea4704fa50879c126c85b60", "score": "0.43476465", "text": "function isReachable(segment) {\n return segment.reachable;\n}", "title": "" }, { "docid": "e58801a9d68994fe7e89c608ed5cdc7d", "score": "0.43349403", "text": "function isIndependentInterface(symbol){for(var _i=0,_a=symbol.declarations;_i<_a.length;_i++){var declaration=_a[_i];if(declaration.kind===230/* InterfaceDeclaration */){if(declaration.flags&64/* ContainsThis */){return false;}var baseTypeNodes=ts.getInterfaceBaseTypeNodes(declaration);if(baseTypeNodes){for(var _b=0,baseTypeNodes_1=baseTypeNodes;_b<baseTypeNodes_1.length;_b++){var node=baseTypeNodes_1[_b];if(ts.isEntityNameExpression(node.expression)){var baseSymbol=resolveEntityName(node.expression,793064/* Type */,/*ignoreErrors*/true);if(!baseSymbol||!(baseSymbol.flags&64/* Interface */)||getDeclaredTypeOfClassOrInterface(baseSymbol).thisType){return false;}}}}}}return true;}", "title": "" }, { "docid": "e2a1503b61cb5fd9b5133b79f7bb0258", "score": "0.4327747", "text": "hasAttributeNS(namespace, name) {\n return (this.getAttributeNS(namespace, name) != null);\n }", "title": "" }, { "docid": "204e4d6cf6cc8d4173cd84050ded96cd", "score": "0.43247965", "text": "isSIPCallingSupported () {\n if(this.moderator)\n return this.moderator.isSipGatewayEnabled();\n return false;\n }", "title": "" }, { "docid": "15a0fea57622c4bb493fd87de67c4023", "score": "0.43190476", "text": "function makeSureDiscoveryServiceIsConnected() {\n return checkOrPairDevice(self.code)\n .then((correspondent) => {\n const discoveryServiceDeviceAddress = correspondent.device_address;\n\n if (!discoveryServiceAddresses.includes(discoveryServiceDeviceAddress)) {\n discoveryServiceAddresses.push(discoveryServiceDeviceAddress);\n }\n\n if (discoveryServiceAvailabilityCheckingPromise !== null) {\n console.log('ALREADY WAITING FOR THE DISCOVERY SERVICE TO REPLY');\n return discoveryServiceAvailabilityCheckingPromise;\n }\n\n const promise = new Promise((resolve) => {\n const listener = function (message, fromAddress) {\n if (fromAddress === discoveryServiceDeviceAddress) {\n console.log(`THE DISCOVERY SERVICE (${discoveryServiceDeviceAddress}) IS ALIVE`);\n eventBus.removeListener('dagcoin.connected', listener);\n resolve(correspondent);\n }\n };\n\n eventBus.on('dagcoin.connected', listener);\n });\n\n const keepAlive = {\n protocol: 'dagcoin',\n title: 'is-connected'\n };\n\n const device = require('byteballcore/device.js');\n device.sendMessageToDevice(discoveryServiceDeviceAddress, 'text', JSON.stringify(keepAlive));\n\n const attempts = 12;\n\n const timeoutMessage = `THE DISCOVERY SERVICE ${discoveryServiceDeviceAddress} DID NOT REPLY AFTER 10 SECONDS`;\n const finalTimeoutMessage = `THE DISCOVERY SERVICE DID NOT REPLY AFTER ${attempts} ATTEMPS`;\n\n const timeoutMessages = { timeoutMessage, finalTimeoutMessage };\n\n discoveryServiceAvailabilityCheckingPromise = promiseService.repeatedTimedPromise(promise, 10000, attempts, timeoutMessages);\n\n // After ten minutes will be needed to make sure the discovery service is connected\n setTimeout(() => {\n discoveryServiceAvailabilityCheckingPromise = null;\n }, 10 * 60 * 1000);\n\n return discoveryServiceAvailabilityCheckingPromise;\n });\n }", "title": "" }, { "docid": "bf9d083daa7c314b4d1a9e527e1a0d17", "score": "0.43103588", "text": "function isAudioEnabled() {\n // TODO: optimize test after Chrome will support fn:matches()\n if (getStreamControlButton(\" + d\") || getStreamControlButton(\"+d\")) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "04c209865dc80721732104cedd5f4fda", "score": "0.43050808", "text": "function isListenAllAddress(ip) {\n return exports.controllerToolsInternal.isListenAllAddress(ip);\n}", "title": "" }, { "docid": "68d842507b3360c84ea9fb55f1f7d2ff", "score": "0.43046582", "text": "get isAttached() {\n return this._attachedHost != null;\n }", "title": "" }, { "docid": "68d842507b3360c84ea9fb55f1f7d2ff", "score": "0.43046582", "text": "get isAttached() {\n return this._attachedHost != null;\n }", "title": "" }, { "docid": "8f006c942cbfd59cdf21b78201e012f6", "score": "0.42884883", "text": "function detect(ip, device, options, callback) {\n let foundInstance = false;\n\n device._upnp.forEach(upnp => {\n if (!foundInstance && upnp.USN && upnp.USN.includes('BO5E') && upnp._location) {\n const name = upnp._location.substring(upnp._location.indexOf('<friendlyName>') + 14);\n device.bosename = name.substring(0, name.indexOf('<'));\n options.log.debug('Bode discovered: ' + device.bosename);\n\n if (addbosesoundtouch(ip, device, options)) {\n foundInstance = true;\n }\n }\n });\n\n callback(null, foundInstance, ip);\n}", "title": "" }, { "docid": "c4f8d850ddd6c17749e17bbde6701bf2", "score": "0.4286373", "text": "static async isDevicePresent(ip, port) {\n try {\n await this.connect(ip, port);\n await this.disconnect();\n return true;\n } catch (error) {\n return false;\n }\n }", "title": "" }, { "docid": "a81ed48e38fe534a812b0e73e9900946", "score": "0.42749134", "text": "async function isService(headers, cookie, body) {\n let controller = new AbortController(); //NO IE support\n let signal = controller.signal;\n return timeout(1000, fetch(`http://169.254.169.254/latest/meta-data/`, {\n mode: 'no-cors',\n credentials: 'omit',\n signal\n }), controller)\n .then(response => {\n return true;\n })\n .catch(e => { return (false); })\n }", "title": "" }, { "docid": "df7eaa0d7cc584044008350b0967b92c", "score": "0.42715362", "text": "get isApiAvailable() {\n if (this._ApiAvailable === ApiStatus.AVAILABLE) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "a99636e486fa5ab417cb90a1d2a787c0", "score": "0.42695317", "text": "function isGoogleSearchApp(ua) {\n return /\\bGSA\\b/.test(ua);\n}", "title": "" }, { "docid": "6d73ba15e19201d30a90d2e295a3f9c3", "score": "0.42686912", "text": "function isEndpointDiscoveryEnabled(request) {\n var service = request.service || {};\n if (service.config.endpointDiscoveryEnabled === true) return true;\n\n //shared ini file is only available in Node\n //not to check env in browser\n if (util.isBrowser()) return false;\n\n for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) {\n var env = endpointDiscoveryEnabledEnvs[i];\n if (Object.prototype.hasOwnProperty.call(process.env, env)) {\n if (process.env[env] === '' || process.env[env] === undefined) {\n throw util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'environmental variable ' + env + ' cannot be set to nothing'\n });\n }\n if (!isFalsy(process.env[env])) return true;\n }\n }\n\n var configFile = {};\n try {\n configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[AWS.util.sharedConfigFileEnv]\n }) : {};\n } catch (e) {}\n var sharedFileConfig = configFile[\n process.env.AWS_PROFILE || AWS.util.defaultProfile\n ] || {};\n if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) {\n if (sharedFileConfig.endpoint_discovery_enabled === undefined) {\n throw util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'config file entry \\'endpoint_discovery_enabled\\' cannot be set to nothing'\n });\n }\n if (!isFalsy(sharedFileConfig.endpoint_discovery_enabled)) return true;\n }\n return false;\n}", "title": "" }, { "docid": "6169d5950d2a62e161543e6453be0cd3", "score": "0.42663816", "text": "function IsSubscribeEnabled() {\n // If there are any IMAP or News servers, we can show the dialog any time and\n // it will properly show those.\n for (let server of MailServices.accounts.allServers) {\n if (server.type == \"imap\" || server.type == \"nntp\") {\n return true;\n }\n }\n\n // RSS accounts use a separate Subscribe dialog that we can only show when\n // such an account is selected.\n let preselectedFolder = GetFirstSelectedMsgFolder();\n if (preselectedFolder && preselectedFolder.server.type == \"rss\") {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "77ff14fb371626be5e66d242451b40b2", "score": "0.4257333", "text": "hasInstance(service) {\n NotImplemented.throw();\n }", "title": "" }, { "docid": "e44a9caaec2896fb7e3ef15a76fbcbc5", "score": "0.4256543", "text": "function implementsInterfaceFunction(interfaces) {\n return function(i) {\n var j, n = interfaces.length;\n for (j = 0; j < n; j++) {\n if (interfaces[j] === i) {\n return true;\n }\n }\n return false;\n }\n }", "title": "" }, { "docid": "9d581ea92567ab3acc76c6557f154116", "score": "0.42413723", "text": "function accessibilityEnabled() {\n var result = false;\n\n if (typeof (GLOBAL_ACCESSIBILITY_ENABLED) != \"undefined\") {\n result = GLOBAL_ACCESSIBILITY_ENABLED;\n }\n\n return result;\n}", "title": "" }, { "docid": "3875569e538f56cb7471753f419520b3", "score": "0.42400602", "text": "function DetectIpod()\n {\n if (uagent.search(deviceIpod) > -1)\n return true;\n else\n return false;\n }", "title": "" }, { "docid": "f630a72bb0489058c725eabb45792cc3", "score": "0.4239898", "text": "function isAvailable(host) {\n return (!isOffline(host));\n}", "title": "" }, { "docid": "005f574ad5f5200c897209e8b4f0697e", "score": "0.42290634", "text": "function dobLayerOn(map) {\n for (var l in map._layers) {\n if (map._layers[l] === dobLayer) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "e8d828f970c7004887ae3912639f5079", "score": "0.42212343", "text": "hasConnection (selectedAdvisor) {\n return this.state.connections.includes(selectedAdvisor.key) || this.props.currentUser.uid == selectedAdvisor.key;\n }", "title": "" }, { "docid": "dd3c127e89142f817811777c9d26cbb7", "score": "0.4217237", "text": "function showAd(){\n admob.isInterstitialReady(function(isReady){\n if(isReady){\n admob.showInterstitial();\n }\n });\n}", "title": "" }, { "docid": "893185c67f9b977535886a0863e84f92", "score": "0.42124176", "text": "hasTag(tag) {\n return this.tags.includes(tag);\n }", "title": "" }, { "docid": "342e58ee845359faeb512fc2c76ec810", "score": "0.42102045", "text": "async function isContract(address) {\n const code = await ethers.provider.getCode(address);\n return code.slice(2).length > 0;\n}", "title": "" }, { "docid": "fcf7fc1492221dc6cc295bc12cce9ae6", "score": "0.42083758", "text": "function isConnection(element) {\n return element.waypoints;\n}", "title": "" }, { "docid": "fcf7fc1492221dc6cc295bc12cce9ae6", "score": "0.42083758", "text": "function isConnection(element) {\n return element.waypoints;\n}", "title": "" }, { "docid": "07c25a9e829d03baf383cd5b61e84a2e", "score": "0.42076972", "text": "static async isRunning() {\n return await ForegroundServiceModule.isRunning();\n }", "title": "" }, { "docid": "52fc98263c304208dfac05b14a674bfd", "score": "0.41971886", "text": "function _isClientConnected(scope) {\n return scope.wsClient && scope.wsClient.connected === true;\n }", "title": "" }, { "docid": "4e53e838ada1f4220efd92fef7a9eff1", "score": "0.41818035", "text": "doesClientExist(rinfo)\r\n\t{\r\n\t\tlet value = false;\r\n\r\n\r\n\t\tthis.clients.forEach(c=>{\r\n\t\t\tif(c.address == rinfo.address && c.port == rinfo.port) value = true; \r\n\t\t});//this.clients forEach loop\r\n\r\n\t\treturn value;\r\n\t}", "title": "" }, { "docid": "cde39d2bbeb7e2d6917814c775c25b32", "score": "0.4175909", "text": "has(namespace) {\n return this.list.has(namespace);\n }", "title": "" }, { "docid": "d892ee9989d2a12d9290faa2c8a4b6d1", "score": "0.4167163", "text": "isDelegateMessage() {\n let delegates = app.config[app.consensus_name].delegates;\n let key = this.getKey();\n if (delegates instanceof Array) {\n if (delegates.indexOf(key) >= 0)\n return true;\n return false;\n }\n\n return false;\n }", "title": "" }, { "docid": "d116978c281c6456e8e7d66763ea500a", "score": "0.41648608", "text": "function serviceExists(userInput) {\n let exists = false;\n $.each($('.service'), function () {\n exists = $(this).val() === userInput ? true : exists;\n });\n $.each($('.new_service'), function () {\n exists = $(this).val() === userInput ? true : exists;\n });\n return exists;\n}", "title": "" }, { "docid": "f2713dcf1b79eb125c510e3850fce399", "score": "0.41614717", "text": "async function checkOnlineStatus() {\n const status = await Network.getNetworkStateAsync();\n const { isConnected } = status;\n return isConnected;\n }", "title": "" }, { "docid": "92abf42215a1c1b528c47beda58904b3", "score": "0.41558737", "text": "function isMyself(name, ipAddress, port) {\n if (ipAddress === HOST && port === multicastPort) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "f6868fad852bc48ac2c70da9b285178f", "score": "0.41542104", "text": "function check_InstantAds() {\n\t\t\tif (myFT.instantAdsLoaded) {\n\t\t\t\tconsole.log(\"myFT.instantAdsLoaded checkIA yes: \" + myFT.instantAdsLoaded);\n\t\t\t\tinstantAds_Implementation();\n\t\t\t} else {\n\t\t\t\tmyFT.addEventListener('instantads', instantAds_Implementation);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f6868fad852bc48ac2c70da9b285178f", "score": "0.41542104", "text": "function check_InstantAds() {\n\t\t\tif (myFT.instantAdsLoaded) {\n\t\t\t\tconsole.log(\"myFT.instantAdsLoaded checkIA yes: \" + myFT.instantAdsLoaded);\n\t\t\t\tinstantAds_Implementation();\n\t\t\t} else {\n\t\t\t\tmyFT.addEventListener('instantads', instantAds_Implementation);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f6868fad852bc48ac2c70da9b285178f", "score": "0.41542104", "text": "function check_InstantAds() {\n\t\t\tif (myFT.instantAdsLoaded) {\n\t\t\t\tconsole.log(\"myFT.instantAdsLoaded checkIA yes: \" + myFT.instantAdsLoaded);\n\t\t\t\tinstantAds_Implementation();\n\t\t\t} else {\n\t\t\t\tmyFT.addEventListener('instantads', instantAds_Implementation);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f6868fad852bc48ac2c70da9b285178f", "score": "0.41542104", "text": "function check_InstantAds() {\n\t\t\tif (myFT.instantAdsLoaded) {\n\t\t\t\tconsole.log(\"myFT.instantAdsLoaded checkIA yes: \" + myFT.instantAdsLoaded);\n\t\t\t\tinstantAds_Implementation();\n\t\t\t} else {\n\t\t\t\tmyFT.addEventListener('instantads', instantAds_Implementation);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f6868fad852bc48ac2c70da9b285178f", "score": "0.41542104", "text": "function check_InstantAds() {\n\t\t\tif (myFT.instantAdsLoaded) {\n\t\t\t\tconsole.log(\"myFT.instantAdsLoaded checkIA yes: \" + myFT.instantAdsLoaded);\n\t\t\t\tinstantAds_Implementation();\n\t\t\t} else {\n\t\t\t\tmyFT.addEventListener('instantads', instantAds_Implementation);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f6868fad852bc48ac2c70da9b285178f", "score": "0.41542104", "text": "function check_InstantAds() {\n\t\t\tif (myFT.instantAdsLoaded) {\n\t\t\t\tconsole.log(\"myFT.instantAdsLoaded checkIA yes: \" + myFT.instantAdsLoaded);\n\t\t\t\tinstantAds_Implementation();\n\t\t\t} else {\n\t\t\t\tmyFT.addEventListener('instantads', instantAds_Implementation);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f6868fad852bc48ac2c70da9b285178f", "score": "0.41542104", "text": "function check_InstantAds() {\n\t\t\tif (myFT.instantAdsLoaded) {\n\t\t\t\tconsole.log(\"myFT.instantAdsLoaded checkIA yes: \" + myFT.instantAdsLoaded);\n\t\t\t\tinstantAds_Implementation();\n\t\t\t} else {\n\t\t\t\tmyFT.addEventListener('instantads', instantAds_Implementation);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "90f5cc6bbd54541b73b42cbb73692900", "score": "0.41508228", "text": "async function isContract(address) {\n const code = await web3.eth.getCode(address)\n return code.slice(2).length > 0\n}", "title": "" }, { "docid": "4be352d3f0b02967e93ef23f61b79ac1", "score": "0.41459024", "text": "function is_found_on_arp_table(mac_addr) {\n var i = -1; // Availability\n main_arp_table.every(function(data, index){\n if (data['mac_addr'] === mac_addr) {\n i = index;\n console.log('mac address:' + data['mac_addr'] + ' available on ARP table.');\n return false; // break every()\n } else {\n return true; // continue every()\n }\n });\n\n return i;\n}", "title": "" }, { "docid": "113e1aa3642a1ad947779ff702384f19", "score": "0.41434282", "text": "hasDependency (key) {\n\t\treturn Boolean(this.injected[key]);\n\t}", "title": "" }, { "docid": "272b0dc11d216a7d3e25871c205e0272", "score": "0.41325533", "text": "has(ns, localName) {\n if (ns === null) {\n return this._nullItems[localName] === true;\n }\n else if (this._items[ns]) {\n return this._items[ns][localName] === true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "17385ac4485a3a6606d7136e82e64d32", "score": "0.41275042", "text": "function _isAvailable ( { doctorId, dateTime } ) {\n const unix = moment(dateTime, DATETIME_FORMAT).format('x');\n if (\n doctors[doctorId] && \n doctors[doctorId].appointments[unix] && \n doctors[doctorId].appointments[unix].length === MAX_APPOINTMENT_COUNT\n ) { \n return false;\n }\n return true;\n}", "title": "" }, { "docid": "61a77d81cc34e540fa7ac8b5a21b5142", "score": "0.41262078", "text": "inChannel() {\n return this.connection != null;\n }", "title": "" }, { "docid": "d169cc0621ecd2dadd0237075fc5d81e", "score": "0.4108903", "text": "hasAttached() {\n return !!this._attachedPortal;\n }", "title": "" }, { "docid": "d169cc0621ecd2dadd0237075fc5d81e", "score": "0.4108903", "text": "hasAttached() {\n return !!this._attachedPortal;\n }", "title": "" }, { "docid": "f4fd2ba469b488335820bd5453d61069", "score": "0.40963325", "text": "isConnected() {}", "title": "" }, { "docid": "cf32f026b21a573025f16b433737f7f9", "score": "0.409047", "text": "async isUnlockContractDeployed(network) {\n if (!this.networks[network]) {\n throw new Error(`Missing config for ${network}`);\n }\n\n let opCode = await this.providerForNetwork(network).getCode(this.networks[network].unlockAddress);\n return opCode !== '0x';\n }", "title": "" }, { "docid": "5081d8eb9ff3dd1da1e231dcb1c8dedb", "score": "0.40873396", "text": "function isBreakpoint(alias) {\r\n return $('.device-' + alias).is(':visible');\r\n}", "title": "" }, { "docid": "94d18ac6fa0594689f449c02cdae925e", "score": "0.40840274", "text": "function isNICGraphsSupported(element) {\n var history = retrieveLastHistoryRecord(element)\n if (history) {\n return $.inArray(history.VM_MAD, ['vcenter', 'az']) == -1;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "538975cb1e8ca615eb49f88d9084449a", "score": "0.40839913", "text": "IsUISupported(string, Variant, IUnknown) {\n\n }", "title": "" }, { "docid": "4fac745171122756f8c428e7c04e9203", "score": "0.4077384", "text": "function hasAvahi() {\n return file.exists(AVAHI_PATH);\n}", "title": "" }, { "docid": "865bca5fb7f2c8259bc119f1d23bce18", "score": "0.40764567", "text": "hasCapability (capability) {\n return this.supports (capability);\n }", "title": "" }, { "docid": "0ac6959ff3c6fdd3f06a422b8887b05d", "score": "0.40704766", "text": "function isApplicable(configurationItem, event){\r\n checkDefined(configurationItem, \"configurationItem\");\r\n checkDefined(event, \"event\");\r\n var status = configurationItem.configurationItemStatus;\r\n var eventLeftScope = event.eventLeftScope;\r\n return ('OK' === status || 'ResourceDiscovered' === status) && false === eventLeftScope;\r\n}", "title": "" }, { "docid": "7d3ff12fbeef13a2a9da901954a73336", "score": "0.406943", "text": "checkTranslinkAPIConnection() {\n if (isAPIConnectionActive == true) {\n console.log('Connection is active');\n } else {\n console.log('Connection is not active');\n }\n }", "title": "" }, { "docid": "49b3c8370fd91db510bf17fc08a8e15e", "score": "0.40675652", "text": "function BShouldUseInfiniscroll()\n{\n\t// InfiniScroll is enabled by default.\n\tvar bEnable = true;\n\n\tvar url = new URL( window.location.href );\n\n\t// If infinite scroll is forced on, then it's forced on.\n\tif ( url.searchParams.get( 'force_infinite' ) )\n\t\treturn true;\n\n\t// If we see a page number, we'd normally disable InfiniScroll...\n\tif ( url.searchParams.get('page') )\n\t\tbEnable = false;\n\n\t// But if the user has hit back and originally came from infiniscroll, reanable it.\n\tif ( IsNavFromBackButton() && history.state && history.state.infiniscroll )\n\t\tbEnable = true;\n\n\treturn bEnable;\n}", "title": "" }, { "docid": "b6ed9e00861c870c0f5e5ee7560b9e10", "score": "0.40644255", "text": "function DetectaIpad(){\n\n if (uagent.search(dispositivoIpad) > -1 && DetectaWebkit())\n\n return true;\n\n else\n\n return false;\n\n}", "title": "" }, { "docid": "d39ebeeb9b4acae2f36b914e8d900880", "score": "0.4038613", "text": "function supportsDisplay(handlerInput) {\n var hasDisplay =\n handlerInput.requestEnvelope.context &&\n handlerInput.requestEnvelope.context.System &&\n handlerInput.requestEnvelope.context.System.device &&\n handlerInput.requestEnvelope.context.System.device.supportedInterfaces &&\n handlerInput.requestEnvelope.context.System.device.supportedInterfaces.Display\n console.log(\"Supported Interfaces are\" + JSON.stringify(handlerInput.requestEnvelope.context.System.device.supportedInterfaces));\n\n return hasDisplay;\n}", "title": "" }, { "docid": "0c8985739aa0868cb668b30f6d2f93d4", "score": "0.40383413", "text": "function is(node) {\n return !!node && 'decorationData' in node;\n }", "title": "" }, { "docid": "80edf97002de0973a55798f39b96896c", "score": "0.40382746", "text": "isConnected() {\n return this.connectionState() === CONNECTION_STATE.Open;\n }", "title": "" }, { "docid": "83b823873d6fbfc097f5b1cf34859e18", "score": "0.40371096", "text": "fetchingDdahs() {\n return this.get('ddahs.fetching') > 0;\n }", "title": "" }, { "docid": "4ee9a2dd18e0d94ba83123f87d86736f", "score": "0.40360498", "text": "isClient(source) { return (source instanceof Client); }", "title": "" }, { "docid": "3569171b90ca36fb34ebb14ecb9f1383", "score": "0.40340915", "text": "function isConnected() {\n\treturn gSerialPort && gSerialPort.isOpen();\n}", "title": "" }, { "docid": "acc23d6ab579d1647df899124b6b49e8", "score": "0.40268523", "text": "function DetectaAndroid(){\n\n if (uagent.search(dispositivoAndroid) > -1)\n\n return true;\n\n else\n\n return false;\n\n}", "title": "" }, { "docid": "a45566185bb32217ff437f70d0ec894b", "score": "0.40247697", "text": "get isConnected() {\n return (this.client != null);\n }", "title": "" }, { "docid": "0754095780a476c74c15f40e64a5a84f", "score": "0.4022777", "text": "async isDisabled() {\n const hostEl = await this.host();\n return (await hostEl.getAttribute('aria-disabled')) === 'true';\n }", "title": "" } ]
10215a0d69842dd6185ea46ecb49b5cf
this function is a travesty, maybe it'll get cleaned up some day
[ { "docid": "6b7c4cc71b1226b49710e04f2e4bb21c", "score": "0.0", "text": "function stitcher(parts, data, priceOverride, numRangeOverride) {\n let name = \"\"\n let word\n let numWords = 0\n let a_an_flag = false\n let isTitle = false\n\n if (parts === null || parts === undefined) return \"\" \n\n for (let part of parts) {\n if (part.length === 0) continue;\n switch (part[0]) {\n case 'pick':\n if (part.length !== 2) break;\n word = picker(part[1], data)\n name += do_a_an(word, a_an_flag)\n a_an_flag = false\n break;\n\n case 'pick-pluralize':\n if (part.length !== 2) break;\n if (a_an_flag) {\n name += \"some \"\n a_an_flag = false\n }\n name += plural(picker(part[1], data))\n break;\n\n case 'pick-pluralize-optional':\n if (part.length !== 2) break;\n word = picker(part[1], data)\n\n if (Math.random() >= 0.5) {\n if (a_an_flag) {\n name += \"some \"\n a_an_flag = false\n }\n name += plural(word)\n break;\n }\n\n name += do_a_an(word, a_an_flag)\n a_an_flag = false\n break;\n\n case 'pick-pastTense':\n if (part.length !== 2) break;\n name += tensify(picker(part[1], data))\n break;\n\n case 'pick-verber':\n if (part.length !== 2) break;\n name += verber(picker(part[1], data))\n break;\n\n case 'pick-gerund':\n if (part.length !== 2) break;\n name += gerund(picker(part[1], data))\n break;\n\n case 'pick-multi':\n if (part.length !== 4) break;\n let minWords = part[2]\n let maxWords = part[3]\n if (isNaN(minWords) || isNaN(maxWords)) break;\n\n numWords = Math.floor(Math.random() * (maxWords - minWords + 1)) + minWords\n if (numWords <= 0) {\n if (name[name.length-1] === ' ') {\n name = name.slice(0, name.length-1)\n }\n break;\n }\n\n word = picker(part[1], data)\n name += do_a_an(word, a_an_flag)\n a_an_flag = false\n numWords--\n\n while (numWords > 0) {\n name += ' ' + picker(part[1], data)\n numWords--\n }\n break;\n\n case 'static':\n if (part.length !== 2) break;\n name += part[1]\n break;\n\n case 'a(n)':\n if (part.length !== 1) break;\n name += \" \"\n a_an_flag = true\n break;\n\n case 'title':\n if (part.length !== 1) break;\n isTitle = true\n break;\n\n case 'number': \n if (part.length < 3) break;\n let numParts = [...part]\n if (numRangeOverride) {\n if (!isNaN(numRangeOverride.min)) numParts[1] = numRangeOverride.min\n if (!isNaN(numRangeOverride.max)) numParts[2] = numRangeOverride.max\n if (numRangeOverride.zeroString) numParts[3] = numRangeOverride.zeroString\n }\n const rng = Math.floor(Math.random() * (numParts[2] - numParts[1] + 1)) + numParts[1]\n name += (rng === 0 && numParts[3]) ? numParts[3] : rng\n break;\n\n case 'price':\n if (!(part.length === 3 || part.length === 4)) break;\n let priceParts = [...part]\n if (priceOverride) {\n if (!isNaN(priceOverride.min)) priceParts[1] = priceOverride.min\n if (!isNaN(priceOverride.max)) priceParts[2] = priceOverride.max\n if (priceOverride.denomination) priceParts[3] = priceOverride.denomination\n }\n const price = rollPrice(priceParts)\n name += formatPrice(price)\n break;\n\n case 'format':\n if (part.length !== 2) break;\n let formatParts\n\n // if descriptor type, build format map and roll for format\n // TODO: mapFormats here should be redundant after it is moved to server\n if (Object.hasOwn(data.dfMap, part[1])) {\n const res = mapFormats(data.dfMap[part[1]])\n formatParts = data.formats[pickFormat(res.formatMap, res.totalWeight)]\n } else {\n formatParts = data.formats[part[1]]\n }\n\n if (formatParts) {\n name += stitch(formatParts, data, priceOverride, numRangeOverride)\n }\n break;\n\n default:\n break;\n }\n }\n\n return (isTitle ? title(name) : name).trim()\n}", "title": "" } ]
[ { "docid": "255592ec516d37740c1bb01fe457cf43", "score": "0.5840006", "text": "function __bRsBIa0_bqDi8hIGe5YJ9Ww(){}", "title": "" }, { "docid": "10d5627078b78749ec09d72a3aae1520", "score": "0.5686244", "text": "function() {\n\t\t//...\n\t}", "title": "" }, { "docid": "5852fe94875c5318206fbb0d492e7530", "score": "0.56719774", "text": "function NuJ_bf11a_aj69OXVnEw9Zyw(){}", "title": "" }, { "docid": "48fba5370d7a70153b5329cdad4d8cae", "score": "0.53623945", "text": "function VGX8xIjO_ajuOQX_bPc98Q5g(){}", "title": "" }, { "docid": "dff228621940d716f0e7460bf8561881", "score": "0.526642", "text": "static manages() { return false; }", "title": "" }, { "docid": "3aebd98f9e4590985fc8ee500b625ac0", "score": "0.5233208", "text": "function worthless(){}", "title": "" }, { "docid": "685d09267a5f3b0bc0093f9650660417", "score": "0.51871204", "text": "function tCNi6i2NYji15JvNCZ5JWQ(){}", "title": "" }, { "docid": "77ff8110cfcddb2cbffad04f9640382d", "score": "0.5156272", "text": "function ej_8() {}", "title": "" }, { "docid": "50ade5d3e622801b058d4271f7805030", "score": "0.5138581", "text": "function inizio_gioco() {\n\t\n}", "title": "" }, { "docid": "e7b25bd71da894d26e16b4ef4c28e8cc", "score": "0.5137538", "text": "function __f_9() {}", "title": "" }, { "docid": "69bd595e2a0e49d4380dc91029c88bfd", "score": "0.5124127", "text": "function HelperFunctions (){}", "title": "" }, { "docid": "7482be04b8afeec0d110707e2b5b3ef6", "score": "0.5063197", "text": "function prepareDough() {\n\n}", "title": "" }, { "docid": "43fc1531d79bdc6e74ad916b320bc812", "score": "0.505789", "text": "function ctF4trntqzuZkWDL8ubK6Q(){}", "title": "" }, { "docid": "79e75f3255ba93f5015a28971728be70", "score": "0.5052562", "text": "prepare() {\n\n\t}", "title": "" }, { "docid": "22495c668e66b783acc5d3fd2919d29d", "score": "0.50175184", "text": "__previnit(){}", "title": "" }, { "docid": "992d5dd206023ae42cfdf225af45a08d", "score": "0.50041974", "text": "function mHiloh5gQTCBd66HofULNg(){}", "title": "" }, { "docid": "20924f7c22a802dfa6011b200bc17b7d", "score": "0.49912205", "text": "function CFsqc0GjlTKl11x0SjZu8g(){}", "title": "" }, { "docid": "9930310f591fe68a86cdf1054548af7f", "score": "0.49755263", "text": "function util() {\n }", "title": "" }, { "docid": "d63972b6c215b4730b68eea47d4e6e18", "score": "0.49491644", "text": "function krumo() {\n }", "title": "" }, { "docid": "43ff965c3063f616a30e394ca4639fe9", "score": "0.49245346", "text": "function DWRUtil() { }", "title": "" }, { "docid": "a3f114045d61ac2df24b169dafe39a44", "score": "0.4896669", "text": "function dude(){ }", "title": "" }, { "docid": "cceba6dfda8b5c5815eb95bbd26e9456", "score": "0.4878204", "text": "function o0()\n{\n var o1 = o1(\"onMSVideoOptimalLayoutChanged\");\n var o587 = o342.type === 'remote' ? o342.o587 : o584.o587;\n try {\nfor(var o51 = \"foo27\" in o2)\n { \n try {\nif(o1[o2[e]] !== undefined)\n { \n try {\no4.o5(\"propertyFound\");\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o2;\n}catch(e){}\n}", "title": "" }, { "docid": "532a66db437937b1c5e25179b89b3dcb", "score": "0.4868187", "text": "function _beeswarm() {}", "title": "" }, { "docid": "e54af112a66a6d9c34f3e6d3f8e10236", "score": "0.48357612", "text": "function o810() {}", "title": "" }, { "docid": "1b4d5db31653cbb2f8d5342f0c0e2905", "score": "0.48273727", "text": "function CombatUtils() {}", "title": "" }, { "docid": "e3d31bbff4b24a04b2f84a1e477d1eba", "score": "0.48212436", "text": "processInternal() {}", "title": "" }, { "docid": "e8063c4090d7b1dab974475df5dfd479", "score": "0.48155642", "text": "function noJumpsHuhJavaScript_CloneFunctionForAsynchronousGarbage(selectedpage, sb, sbpersistent, result)\r\n{\r\n while (document.getElementById(\"mppane\").firstChild) {\r\n document.getElementById(\"mppane\").removeChild(document.getElementById(\"mppane\").firstChild);\r\n }\r\n // history_entry_list = result\r\n var HistoryMenuArray;\r\n\r\n try {\r\n //sort array by date\r\n //for each history menu in result\r\n\r\n HistoryMenuArray = combineHistoryMenuArrays(result)\r\n\r\n HistoryMenuArray.list.sort(function(a, b){return b.date - a.date});\r\n\r\n result = HistoryMenuArray;\r\n\r\n history_entry_list = result;\r\n\r\n console.log(result)\r\n \r\n //add pages by length / page_image_limit\r\n if (!sb)\r\n {\r\n if (!pages_added){\r\n pages_added = true;\r\n addpages(Math.ceil(result.list.length/page_image_limit))\r\n }\r\n }\r\n\r\n //god fuck i hate the way indexes are counted\r\n\r\n if (sb)\r\n {\r\n var excluded_items_array = {};\r\n excluded_items_array.list = [];\r\n var split_strings_array = sb_text.split(/ +/)\r\n var tagvpairstagarray = [];\r\n for (let index = 0; index < split_strings_array.length; index++) {\r\n const str = split_strings_array[index];\r\n var x = str.replace(\"(\", \"\\\\(\")\r\n var x2 = x.replace(\")\", \"\\\\)\")\r\n split_strings_array[index] = x2\r\n }\r\n\r\n result.list.forEach(HistoryMenuEntry => {\r\n\r\n try {\r\n\r\n HistoryMenuEntry.tags.forEach(tag => {\r\n if (tag.tag.match(\"(^\"+split_strings_array[0]+\")\"))\r\n {\r\n if(!excluded_items_array.list.includes(HistoryMenuEntry))\r\n {\r\n excluded_items_array.list.push(HistoryMenuEntry)\r\n }\r\n }\r\n });\r\n \r\n } catch (error) {\r\n console.log (\"many images don't have tags! old version images must be updated if you want to search for them by tags!\")\r\n }\r\n\r\n });\r\n\r\n console.log(excluded_items_array.list)\r\n\r\n excluded_items_array.list = returnFilteredArray(excluded_items_array.list, split_strings_array)\r\n\r\n console.log(excluded_items_array.list)\r\n\r\n }\r\n\r\n if ((sb == true) && (sbpersistent == false))\r\n {\r\n addpages(Math.ceil(excluded_items_array.list.length/page_image_limit))\r\n }\r\n\r\n if (sb)\r\n {\r\n var use_array = excluded_items_array\r\n }\r\n\r\n if(!sb)\r\n {\r\n var use_array = result\r\n }\r\n\r\n // if (sb_text == \"\")\r\n // {\r\n // addpages(Math.ceil(result[x].list.length/page_image_limit))\r\n // }\r\n\r\n return_Limited_Array(selectedpage, use_array).forEach(obj => {\r\n if (!obj.hidden || document.getElementById(\"showhidden\").checked)\r\n {\r\n var image = new Image();\r\n image.id = obj.pid\r\n try {\r\n var tTitle = []\r\n obj.tags.forEach(tagObj => {\r\n if (tagObj.type == \"metadata_tag\")\r\n {\r\n if ((tagObj.tag.match(\"^animated\")) )//|| (tagObj.tag.match(\"video$\")))\r\n {\r\n tTitle.push(tagObj.tag)\r\n }\r\n }\r\n else if (tagObj.type == \"general_tag\")\r\n {\r\n\r\n }\r\n else\r\n {\r\n tTitle.push(tagObj.tag)\r\n }\r\n });\r\n image.title = tTitle.join(\" \")\r\n } catch (error) {\r\n \r\n }\r\n image.className = \"preview_image\"\r\n parent_div = $(\"<div></div>\").attr({\"id\": obj.pid+\"_parent\", \"class\": \"preview-parent_div\"})\r\n $(parent_div).append(image)\r\n $(\"#mppane\").append(parent_div)\r\n updateImagewithBase64(obj.pid, image.className, image.title, obj.hidden)\r\n mb = createPreviewMenuBar(obj.posturl)\r\n $(\"#\"+obj.pid+\"_parent\").append(mb)\r\n }\r\n else{console.log(\"hid \"+obj.pid)}\r\n });\r\n\r\n //assign transform to images\r\n var preview_images = Array.prototype.slice.call(document.getElementsByClassName(\"preview_image\"))\r\n\r\n preview_images.forEach(element => {\r\n element.onclick = function() {toggleTransform(element.parentElement)}\r\n });\r\n\r\n //track which image to hide\r\n Array.prototype.slice.call(document.getElementsByClassName(\"preview_image\")).forEach(element => {\r\n $(element).mousedown(function(e){\r\n if (e.which == 3)\r\n {\r\n image_postid = e.currentTarget.id;\r\n console.log(image_postid)\r\n }\r\n })\r\n });\r\n \r\n } catch (error) {\r\n console.log(error)\r\n console.log(\"history list not defined\")\r\n }\r\n}", "title": "" }, { "docid": "5d3425bba74be52029422c3252cc69de", "score": "0.48069644", "text": "function preheatOven() {\n\n}", "title": "" }, { "docid": "a07c756a97e324a1a2aa690cc9683a8c", "score": "0.48040894", "text": "updated () {}", "title": "" }, { "docid": "df02d9531af40582a991141d86d81699", "score": "0.47934154", "text": "testStuff()\n {\n var aSource = Game.getObjectById('57ef9ea886f108ae6e60fae0');\n var aStorage = Game.getObjectById('584576e702fc59d80d3a56ff');\n\n\n var aPath = Util.getPath(aStorage.pos,aSource.pos);\n\n var aLen = aPath.path.length;\n\n aPath.path = [];\n logDERP('HAULER: '+aLen+' path='+JSON.stringify(aPath));\n }", "title": "" }, { "docid": "129a83bac1a9c65d7bb3abea96d3fa92", "score": "0.47925708", "text": "conflicts() {}", "title": "" }, { "docid": "30687d52c86355e0623e93345432c1aa", "score": "0.47856176", "text": "function _fn029() {\r\n _fn027(), markerArray = []\r\n }", "title": "" }, { "docid": "ec50a383c89c429edbd2a01c01a44a6c", "score": "0.4782914", "text": "function logic()\r\n{\t\t\t\t\r\n}", "title": "" }, { "docid": "35e368551cd956c8d1d9b8661040a15e", "score": "0.47624037", "text": "function question9() {\n // TODO\n }", "title": "" }, { "docid": "85fc4112e6994a5933086235a37be2d9", "score": "0.47557658", "text": "function ex13_0() {\n\n}", "title": "" }, { "docid": "658eab77d6c094b2f96702ed7cd4e583", "score": "0.47521222", "text": "function CheckPre() { return null; }", "title": "" }, { "docid": "502eaa82d6d070bb36626c3cad493f87", "score": "0.474712", "text": "prepare() { }", "title": "" }, { "docid": "b6e812c21d652271d72daf30023defe7", "score": "0.47438416", "text": "function SEA () {}", "title": "" }, { "docid": "692c2ecffddda755b3d35bf7f7cdc31a", "score": "0.4724301", "text": "function Cauldron() {}", "title": "" }, { "docid": "58b1076fb10837307cd9b14d22372fa6", "score": "0.4713527", "text": "function Wc9jUXzJ4DW0TmzxD3LiJg(){}", "title": "" }, { "docid": "f4826ba75e50c3beaaab2ccb4b1f58e1", "score": "0.46904832", "text": "function index(o9,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o35 = o479.o524 = [];\n //views\n var o3 =filter.call;\n\n var o733 = 0\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.4685756", "text": "_firstRendered() { }", "title": "" }, { "docid": "fb8cc4491063371feda006635b032f46", "score": "0.46848935", "text": "implied() {\n return null;\n }", "title": "" }, { "docid": "ac7dab3ce635f4c1a6ea1905ae5580ca", "score": "0.46844462", "text": "function cambiarLimiteDeExtraccion() {\n\n}", "title": "" }, { "docid": "2f969410c4e4484b9774b865a4f64f01", "score": "0.46687078", "text": "j(t){t.approximateByteSize()>0&&(this.U=!0,this.L=t);}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.46627375", "text": "function miFuncion(){}", "title": "" }, { "docid": "1e09bc5137168d474157a1b50adec15d", "score": "0.4655202", "text": "getSupports(){\n //g for grounded\n this.supports=new Map()\n this.inverseSupport=new Map()//same as supports but inverted\n this.groundLevel=[]//used for later stuff\n this.survayQ={\n 0:[],\n 1:[],\n 2:[],\n 3:[],\n 4:[],\n 5:[]\n }\n for(const block of this.phenotype.entries()){\n const splitLoc= block[0].split(\",\")\n const x=float(splitLoc[0])\n const y=float(splitLoc[1])\n if(y==0){\n //add to ground level\n this.groundLevel.push(block[0])\n //set supported off ground\n this.supports.set(block[0],\"G\")\n //getSupports\n this.getSupportsOfBlock(block[0])\n }\n }\n //loop through survay Q\n while (true){\n if(this.survayQ[0][0]!=undefined){\n this.getSupportsOfBlock(this.survayQ[0][0])\n this.survayQ[0].splice(0,1)\n continue\n }\n if(this.survayQ[1][0]!=undefined){\n this.getSupportsOfBlock(this.survayQ[1][0])\n this.survayQ[1].splice(0,1)\n continue\n }\n if(this.survayQ[2][0]!=undefined){\n this.getSupportsOfBlock(this.survayQ[2][0])\n this.survayQ[2].splice(0,1)\n continue\n }\n if(this.survayQ[3][0]!=undefined){\n this.getSupportsOfBlock(this.survayQ[3][0])\n this.survayQ[3].splice(0,1)\n continue\n }\n if(this.survayQ[4][0]!=undefined){\n this.getSupportsOfBlock(this.survayQ[4][0])\n this.survayQ[4].splice(0,1)\n continue\n }\n if(this.survayQ[5][0]!=undefined){\n this.getSupportsOfBlock(this.survayQ[5][0])\n this.survayQ[5].splice(0,1)\n continue\n }\n break\n }\n \n //find unsupported blocks and remove them from the phenotype\n for( const block of this.phenotype.entries()){\n if(this.supports.get(block[0])==undefined&&block[0].split(\",\")[1]!=\"0\"){\n this.phenotype.delete(block[0])\n }\n }\n }", "title": "" }, { "docid": "d5a6cfddf7a27663c90ec74bbf75833e", "score": "0.4637946", "text": "function awaitingRuleL24ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(){;}", "title": "" }, { "docid": "9213a984ec155ec32344f7169d80a463", "score": "0.4610983", "text": "function DisplacementFormater() { }", "title": "" }, { "docid": "b020f505bcc9f0f178e9945540500e8b", "score": "0.45961645", "text": "function stub() {\r\n}", "title": "" }, { "docid": "b020f505bcc9f0f178e9945540500e8b", "score": "0.45961645", "text": "function stub() {\r\n}", "title": "" }, { "docid": "367e9e1c0f4ef7259f8d24067a4b93f0", "score": "0.45958272", "text": "postinit() {}", "title": "" }, { "docid": "91de56a0217085b5bf84716f2ccd33cc", "score": "0.45947066", "text": "function Reloaddata(){}", "title": "" }, { "docid": "2604b4e5b375a3d8afbf36de6ca5e0a9", "score": "0.45879078", "text": "_processUnexpectedPkt(packet){\n return;\n }", "title": "" }, { "docid": "dba0958d858d6187c7250132927fe259", "score": "0.45863324", "text": "function bo(e,t){0}", "title": "" }, { "docid": "f504c92f94d917eee2c2bb71014c6504", "score": "0.45810628", "text": "function OldCompare() {\n}", "title": "" }, { "docid": "4b14f6df5d3e5a7f7052df0b79ba1c8d", "score": "0.4571091", "text": "function convertEarlyArv() {\n\n\n\n }", "title": "" }, { "docid": "cf579ea131eefc1dc9fb9ba71ae42536", "score": "0.45674145", "text": "function KocoUtilities() {}", "title": "" }, { "docid": "1e95f4775258e98246653515bf7d39d5", "score": "0.455612", "text": "function _ap() {\n\n}", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.45532936", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "ceabd37911e97af31174ff9ee8c04530", "score": "0.45481944", "text": "parseHabitsToDnD() {\n\n }", "title": "" }, { "docid": "e2da717fd4d65fb545c7a9f1b2f40584", "score": "0.45291847", "text": "isGMOnly() { return false }", "title": "" }, { "docid": "da9ec1a7374ab8c7f1a20825a838e40f", "score": "0.45273232", "text": "function PrependImagesToLinks(element){ \n$(element).find(\"a\").each(function(){\nif($(this).is(\":visible\") && $(this).css(\"opacity\")>0 && $(this).parent().css(\"opacity\")>0 && !$(this).hasClass(\"image\") && !$(this).hasClass(\"gamepedia_pro_user\") && !$(this).hasClass(\"gamepedia_user\") && $(this).length==1 && !$(this).attr(\"accesskey\")){\n \n if($(this).attr(\"href\")&&$(this).attr(\"href\")!=\"\"){\n var thishref=$(this).attr(\"href\");\n if(thishref.indexOf(\"https://\")==0){\n thishref=thishref.replace(\"https://empyrion.gamepedia.com\",\"\");\n }else if(thishref.indexOf(\"http://\")==0){\n thishref=thishref.replace(\"http://empyrion.gamepedia.com\",\"\");\n }\n \n if(thishref&&thishref!=\"\"&&thishref.indexOf(\"/\")==0&&!thishref.indexOf(\"/Category\")==0){\n if($(this).text().length>3&&!$(this).find(\"img\").length){ \n //It's visible, it's not an image wrapper, it shouldn't be user related, it is in the body, it contains exactly one hit, it have a href, that is a gamepedia link, and isn't a category. And it have a text of more than 3 characters. And it does not contain an image already\n\n var tl=thishref.replace(\"/\",\"\");\n var ref=$(this);\n if(ref.prev().text()!=\"\"||!ref.prev().html()){\n //The previous element is not just an image\n //Try resolve the link\n var url = \"/index.php?title=\" + encodeURIComponent(decodeURIComponent(tl)) + \"&action=render \" + 'table[class*=\"infobox\"]'; \n if (!Linktips.cache[tl]) {\n $('<div style=\"display: none\"/>').load(url, function(text) {\n if (!text) return; // Occurs when navigating away from the page cancels the XHR\n Linktips.cache[tl] = $(this); \n showLinktipFromCacheEntry(url,tl,ref); \n });\n } else {\n showLinktipFromCacheEntry(url,tl,ref); \n }\n }\n }\n }\n }\n }\n});\n}", "title": "" }, { "docid": "da01933f6cf64c21ae7038a82fba0a17", "score": "0.45198616", "text": "function Se(){}", "title": "" }, { "docid": "b666e5feadde13089dd41945e9d022b3", "score": "0.45111075", "text": "update()\n\t{\n\t\t//TODO:\n\t}", "title": "" }, { "docid": "e69e87ba219c4abdbc1ff791682988bb", "score": "0.4509077", "text": "function fireworkArk() { // laggy\r\n arcCount = 300;\r\n fireworkCount = 15;\r\n }", "title": "" }, { "docid": "1b3a681edba165545dbe9cd1427248ab", "score": "0.45049876", "text": "function mostPainting() {\n\treturn\n}", "title": "" }, { "docid": "cf0e8c3cadb65602323c4187184bcf27", "score": "0.4501298", "text": "function fc(){}", "title": "" }, { "docid": "46b3f93a5f76bf4070ef752130130dac", "score": "0.45012563", "text": "function ResolveOverset(currDoc)\r\n{\r\n try{\r\n newFilexmlDOM = currDoc.xmlElements[0];\r\n var currFrameParaLen;\r\n app.alignDistributePreferences.alignDistributeBounds=AlignDistributeBounds.MARGIN_BOUNDS;\r\n currDoc.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin;\r\n currDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;\r\n currDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;\r\n currDoc.zeroPoint = new Array (0,0);\r\n//~ var myNoOfColumn=currDoc.pages[1].marginPreferences.columnCount;\t\r\n currDoc.layoutWindows[0].zoom(ZoomOptions.fitSpread);\r\n app.activeWindow.zoomPercentage = 100;\r\n var addedPageCt = 0;//To avoid pages flowing contionously, we have updated the script so that proofing will stop saying \"Proofing stopped! Float element is keep on flowing-Please do appropriate changes\"\r\n var mycurrentFrameCont = 'Unassinged';\r\n if (retriggeringFloatPlacer){\r\n firstFrame = currTxtFrm;\r\n }//end of IF\r\n if (firstFrame.isValid == false){\r\n firstFrame = currDoc.pages[0].textFrames[0];\r\n }\r\n var preTxtFrm, currFrame = '';\r\n var testPreFrm;\r\n var trigger = 0;\r\n while (((firstFrame.endTextFrame.overflows) && trigger < 2) || (trigger < 2 && (firstFrame.overflows) && (retriggeringFloatPlacer)))\r\n {\r\n preTxtFrm = currFrame;\r\n var pg = currDoc.pages.add();\r\n pg.appliedMaster = currDoc.masterSpreads.item(\"A-TXT\")\r\n var mypage = currDoc.pages[-1];\r\n var mycurrentFrame;\r\n var myMasterPage = mypage.appliedMaster;\r\n if (pg.side == PageSideOptions.leftHand)\r\n {\r\n var tFrames = myMasterPage.pages[0].pageItems;\r\n var tFramesLen = tFrames.length;\r\n for (var f = 0; f < tFramesLen; f ++){\r\n var fLabel = tFrames[f].label;\r\n if (fLabel == 'VERSO'){\r\n var currFrame = tFrames[f];\r\n f = tFramesLen;\r\n }\r\n } \r\n currFrame.override(pg);\r\n currDoc.recompose();\r\n var frmOnPage = currDoc.pages[-1].textFrames.itemByName(\"VERSO\");\r\n frmOnPage.geometricBounds = currDoc.masterSpreads.item(\"A-TXT\").pages[0].textFrames.itemByName(\"VERSO\").geometricBounds;\r\n }\r\n else{\r\n var tFrames = myMasterPage.pages[1].pageItems;\r\n var tFramesLen = tFrames.length;\r\n for (var f = 0; f < tFramesLen; f ++){\r\n var fLabel = tFrames[f].label;\r\n if (fLabel == 'RECTO'){\r\n var currFrame = tFrames[f];\r\n f = tFramesLen;\r\n }\r\n } \r\n //myMasterPage.pages[1].pageItems.item(\"RECTO\").override(pg);\r\n currFrame.override(pg);\r\n currDoc.recompose();\r\n var frmOnPage = currDoc.pages[-1].textFrames.itemByName(\"RECTO\");\r\n frmOnPage.geometricBounds = currDoc.masterSpreads.item(\"A-TXT\").pages[1].textFrames.itemByName(\"RECTO\").geometricBounds;\r\n }\r\n myPage = currDoc.pages[-1];\r\n if (myPage.side == PageSideOptions.leftHand){\r\n var tFrames = myPage.pageItems;\r\n var tFramesLen = tFrames.length;\r\n for (var f = 0; f < tFramesLen; f ++){\r\n var fLabel = tFrames[f].label;\r\n if (fLabel == 'VERSO'){\r\n var currFrame = tFrames[f];\r\n f = tFramesLen;\r\n }\r\n } \r\n \r\n mycurrentFrame = currFrame;\r\n mycurrentFrame.previousTextFrame = firstFrame.endTextFrame;\r\n mycurrentFrameCont = mycurrentFrame.contents;\r\n if (mycurrentFrameCont >= ''){\r\n addedPageCt = 0;\r\n }\r\n }//end of IF\r\n else{\r\n var tFrames = myPage.pageItems;\r\n var tFramesLen = tFrames.length;\r\n for (var f = 0; f < tFramesLen; f ++){\r\n var fLabel = tFrames[f].label;\r\n if (fLabel == 'RECTO'){\r\n var currFrame = tFrames[f];\r\n f = tFramesLen;\r\n }\r\n } \r\n mycurrentFrame = currFrame;\r\n mycurrentFrame.previousTextFrame = firstFrame.endTextFrame;\r\n mycurrentFrameCont = mycurrentFrame.contents;\r\n if (mycurrentFrameCont >= ''){\r\n addedPageCt = 0;\r\n }\r\n }//end of ELSE\r\n //code has been modifed here to ensure whether the current frame or the first frames parent's master page name is not null to avoid text linking to master page \r\n //if the below condition is true then stopping script and exiting\r\n if (mycurrentFrame.parentPage.appliedMaster == null || firstFrame.parentPage.appliedMaster == null ||mycurrentFrame.previousTextFrame.parentPage.appliedMaster == null){\r\n debuggerMSG(\"Error: Resolving overset failed\\tfailed\");\r\n displayMSG(\"Error: Resolving overset\\tfailed\\t0\");\r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }\r\n try{\r\n currFrameParaLen= currFrame.paragraphs.length } catch(e) {currFrameParaLen = 0}\r\n \r\n //======================================//to stop process if pages keep on adding for resolving overset\r\n if ((preTxtFrm.isValid) && (currFrameParaLen > 0)){\r\n var maxRowHt = preTxtFrm.geometricBounds[2] - preTxtFrm.geometricBounds[0];\r\n var currFrmParas = preTxtFrm.paragraphs;\r\n var currFrmParasLen = currFrmParas.length;\r\n if (currFrmParasLen == 1){\r\n if (currFrmParas[0].tables.length > 0){\r\n var currFrmParasTblRw = currFrmParas[0].tables[0].rows;\r\n var currFrmParasTblRwLen = currFrmParasTblRw.length;\r\n for (var rw = 0; rw < currFrmParasTblRwLen - 1; rw ++){\r\n var currRwHt = currFrmParasTblRw[rw].height;\r\n if (currRwHt > maxRowHt){\r\n displayMSG(\"Error: Proofing failed - Tables overflows\\tfailed\\t\" + Math.round(currProgressPercent));\r\n app.activeDocument.close(SaveOptions.YES);\r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }//end of if\r\n }//end of for\r\n }//end of if\r\n else if (currFrmParas[0].allGraphics.length > 0){\r\n try{\r\n var currFrmParasGr = currFrmParas[0].allGraphics[0].geometricBounds;}\r\n catch (e) {\r\n debuggerMSG(\"Proofing failed - Graphic size more than text area\");\r\n app.activeDocument.close(SaveOptions.YES);\r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }\r\n }//end of else if \r\n else if (currFrmParas[0].lines.length > 0){\r\n var currFrmFirstParaStyle = currFrmParas[0].paragraphs[0].appliedParagraphStyle.name;\r\n if (currFrmParas[0].lines.lastItem().parentTextFrames.isValid || (currFrmFirstParaStyle == 'TOC_TTL' || currFrmFirstParaStyle == 'FM_TTL')){\r\n }\r\n else{\r\n debuggerMSG(\"Proofing failed - String length (line) exceeds text area or can't fit inside text frame\");\r\n app.activeDocument.close(SaveOptions.YES);\r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }\r\n }//end of else if \r\n }//end of if\r\n }\r\n //====================================== \r\n }//end of while \r\n if(retriggeringFloatPlacer){\r\n var docFirstFrame = currTxtFrm;\r\n var currLastFrame = docFirstFrame.endTextFrame;\r\n }//end of IF\r\n else {\r\n var docFirstFrame = currDoc.pages[0].textFrames.itemByName('FIRST_FRAME');\r\n //checking whether the endTextFrame has paragraphs, if not the previious frame might be the last frame\r\n var currLastFrame = docFirstFrame.endTextFrame;\r\n while(currLastFrame.paragraphs.length == 0){\r\n currLastFrame = currLastFrame.previousTextFrame;\r\n }\r\n }//end of ELSE \r\n if (currLastFrame.paragraphs.lastItem().isValid){\r\n var currLastFrameParas = currLastFrame.paragraphs;\r\n var currLastFrameParasLen = currLastFrameParas.length;\r\n var currLastFrameLastPara = currLastFrame.paragraphs.lastItem();\r\n var currLastFrameLastParaStyle = currLastFrameLastPara.appliedParagraphStyle.name;\r\n var currLastFrameLastParaLastChar = currLastFrameLastPara.characters.lastItem();\r\n if (currLastFrameParasLen > 1){\r\n var penultPara = currLastFrame.paragraphs[currLastFrameParasLen - 2];\r\n var penultParaStyle = penultPara.appliedParagraphStyle.name;\r\n var currLastFrameLastParaChars = currLastFrameLastPara.characters;\r\n var currLastFrameLastParaCharsLen = currLastFrameLastParaChars.length;\r\n //checking whether the para's all characters are empty, then all characters should be empty xml nodes\r\n if (/^[\\uFFFC\\uFEFF\\t\\s\\r\\n]*$/.test(currLastFrameLastPara.contents)){\r\n //Indesign quits while removing the entermark from penultimate para if the last para empty para has span style, so removing span property from the last paragraph \r\n currLastFrameLastPara.appliedParagraphStyle = myDoc.paragraphStyles.itemByName(\"TXT\");//sometimes application close while removing if the last para has span style, so applying TXT first and then proceeding further\r\n currLastFrameLastPara.spanSplitColumnCount = SpanColumnCountOptions.ALL;\r\n currLastFrameLastPara.spanColumnType = SpanColumnTypeOptions.SINGLE_COLUMN;\r\n penultPara.characters.lastItem().contents = '';\r\n penultPara.applyParagraphStyle = currDoc.paragraphStyles.itemByName(penultParaStyle)\r\n }//end of IF\r\n else if(currLastFrameLastParaChars.lastItem().contents == '\\r'){\r\n currLastFrameLastParaChars.lastItem().contents = '';\r\n //currLastFrameLastPara.appliedParagraphStyle = currDoc.paragraphStyles.itemByName(currLastFrameLastParaStyle);\r\n }//end of ELSE IF\r\n }//end of IF\r\n else if (currLastFrameParasLen == 1){//some times the last frame would have only one enter mark (the last enter mark), then need to last para of previous text frame as penultimate para\r\n var preTextFrame = currLastFrame.previousTextFrame;\r\n if (preTextFrame.paragraphs.length > 0){\r\n var penultPara = preTextFrame.paragraphs.lastItem();\r\n var penultParaStyle = penultPara.appliedParagraphStyle.name;\r\n var currLastFrameLastParaChars = currLastFrameLastPara.characters;\r\n var currLastFrameLastParaCharsLen = currLastFrameLastParaChars.length;\r\n //checking whether the para's all characters are empty, then all characters should be empty xml nodes\r\n if (/^[\\uFFFC\\uFEFF\\t\\s\\r\\n]*$/.test(currLastFrameLastPara.contents)){\r\n //Indesign quits while removing the entermark from penultimate para if the last para empty para has span style, so removing span property from the last paragraph \r\n currLastFrameLastPara.appliedParagraphStyle = myDoc.paragraphStyles.itemByName(\"TXT\");//sometimes application close while removing if the last para has span style, so applying TXT first and then proceeding further\r\n currLastFrameLastPara.spanSplitColumnCount = SpanColumnCountOptions.ALL;\r\n currLastFrameLastPara.spanColumnType = SpanColumnTypeOptions.SINGLE_COLUMN;\r\n penultPara.characters.lastItem().contents = '';\r\n penultPara.applyParagraphStyle = currDoc.paragraphStyles.itemByName(penultParaStyle);\r\n }//end of IF\r\n else if(currLastFrameLastParaChars.lastItem().contents == '\\r'){\r\n currLastFrameLastParaChars.lastItem().contents = '';\r\n //currLastFrameLastPara.appliedParagraphStyle = currDoc.paragraphStyles.itemByName(currLastFrameLastParaStyle);\r\n }//end of ELSE IF\r\n }//end of IF\r\n }//end of IF\r\n }//end of IF\r\n } catch (e){debuggerMSG(\"Resolve overset function failed ...\" + e);}\r\n }", "title": "" }, { "docid": "029d34e02ba047333d452b5bb9fe36af", "score": "0.45004", "text": "function o34(o35) {\n // WScript.Echo(\".\");\n try {\no35.o19(function () {try {\n\"use strict\";\n}catch(e){}\n try {\nif (this.o536) {\n try {\nthis.o800();\n}catch(e){}\n }\n}catch(e){}\n});\n}catch(e){}\n }", "title": "" }, { "docid": "6c5a53bf946ffe731fdd062534b8391f", "score": "0.44978017", "text": "selfUpdated() { }", "title": "" }, { "docid": "f4fb45a56733e2a0ffffe2fd824d2149", "score": "0.4496009", "text": "function gvjs_wM(a,b){this.lf=[];this.dga=a;this.Eaa=b||null;this.yJ=this.gC=!1;this.Kt=void 0;this.v6=this.Fna=this.vY=!1;this.SW=0;this.Fd=null;this.FY=0}", "title": "" }, { "docid": "45a3c34a325d270160a885c6a6c27c60", "score": "0.44924897", "text": "function TmpResult() {\n }", "title": "" }, { "docid": "5f4be0b21fe1fa89d06d92dcb6565bd7", "score": "0.44902682", "text": "function cb(){this.za=this.root=null;this.da=!1;this.N=this.$=this.ma=this.assignedSlot=this.assignedNodes=this.S=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.V=void 0;this.Ea=this.ta=!1;this.Z={}}", "title": "" }, { "docid": "c5e542bba836f3e922d0583b49fbe0ec", "score": "0.44831753", "text": "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "title": "" }, { "docid": "2e3582a22a72c64130a4aa13afd3360c", "score": "0.4480505", "text": "function Helpers() {}", "title": "" }, { "docid": "92ef85638ca22690f6889518b6d727af", "score": "0.44777602", "text": "function wtm() {\r\n return;\r\n}", "title": "" }, { "docid": "2e422e308883953df504b1070edd4812", "score": "0.44742057", "text": "function randomsOperations( ){\n\n }", "title": "" }, { "docid": "b3227f414e06973a78399dbeb6f54cb7", "score": "0.4473503", "text": "function RubJoPHbnD_aKnm3Q_bA_bQ8w(){}", "title": "" }, { "docid": "f2b37f02e2f99ee0769b2816c9a28510", "score": "0.44732627", "text": "fixIssues(){\n if (!this.creator[1]){this.creator = 60598;}\n if (!this.town[1]){this.town = 50500;}\n if (this.creator[0].length < 1){this.creator = \"Unknown\";}\n if (this.town[0].length < 1){this.town = \"Unknown\";}\n //End town with wide-zero\n this.dataBytes[0x42+18] = 0;\n this.dataBytes[0x42+19] = 0;\n //End creator with valid gender and zero pad\n if (this.dataBytes[0x2C+18] > 1){this.dataBytes[0x2C+18] = 0;}\n this.dataBytes[0x2C+19] = 0;\n //End title with wide-zero\n this.dataBytes[40] = 0;\n this.dataBytes[41] = 0;\n }", "title": "" }, { "docid": "a10787b0a1949b6e03443c92376b8141", "score": "0.4472225", "text": "function _fn058() {\r\n var t = $.grep(tdPedList, function (t) {\r\n return \"B\" == t.Status\r\n });\r\n waypts = [];\r\n var e, s = {\r\n StartAddresse: \"\",\r\n EndAddresse: \"\",\r\n GPSGeolocalization: \"\",\r\n Waypoints: [],\r\n Ways: []\r\n };\r\n return $.each(t, function (t, a) {\r\n var n = a.Address + \", \" + a.City + \", \" + a.Zip + \", \" + a.Region,\r\n r = {\r\n Id: a.Id,\r\n InternId: a.InternId,\r\n OrderDate: a.OrderDate,\r\n CustomerId: a.CustomerId,\r\n CustomerName: a.CustomerName,\r\n Address: n,\r\n Geolocalization: a.Geolocalization,\r\n Status: \"A\",\r\n OrderDetails: a.OrderDetails,\r\n DeliveryDate: a.DeliveryDate,\r\n CodeCaptcha: a.CodeCaptcha,\r\n DocumentImage: a.DocumentImage,\r\n WaypointNumberId: null,\r\n WayNumberId: null\r\n },\r\n i = new google.maps.LatLng(a.Geolocalization.split(\",\")[0], a.Geolocalization.split(\",\")[1]),\r\n o = !1;\r\n waypts.length > 0 ? ($.each(waypts, function (t, e) {\r\n var s = getDistance(e.location, i);\r\n return 200 > s ? (r.WaypointNumberId = t, r.WayNumberId = t, void (o = !0)) : void 0\r\n }), o || (r.WaypointNumberId = waypts.length, r.WayNumberId = waypts.length, s.Waypoints.push({\r\n NumberId: r.WaypointNumberId,\r\n Address: r.Address,\r\n Geolocalization: r.Geolocalization\r\n }), waypts.push({\r\n location: i,\r\n stopover: !0\r\n }))) : (r.WaypointNumberId = t, r.WayNumberId = t, s.Waypoints.push({\r\n NumberId: r.WaypointNumberId,\r\n Address: r.Address,\r\n Geolocalization: r.Geolocalization\r\n }), waypts.push({\r\n location: i,\r\n stopover: !0\r\n })), o || (void 0 != e && (e.NumberId = s.Ways.length, s.Ways.push(e)), e = {\r\n NumberId: null,\r\n NumberIdCalc: \"\",\r\n OriginAddress: \"\",\r\n OriginGeolocalization: \"\",\r\n DestinationAddress: r.Address,\r\n DestinationGeolocalization: r.Geolocalization,\r\n Star: null,\r\n End: null,\r\n Duration: {\r\n deal: {\r\n text: null,\r\n value: null\r\n },\r\n real: {\r\n text: null,\r\n value: null\r\n }\r\n },\r\n Distance: {\r\n deal: {\r\n text: null,\r\n value: null\r\n },\r\n real: {\r\n text: null,\r\n value: null\r\n }\r\n },\r\n Orders: [],\r\n Interruptions: []\r\n }), e.Orders.push(r)\r\n }), void 0 != e && (e.NumberId = s.Ways.length, s.Ways.push(e)), s\r\n }", "title": "" }, { "docid": "f752e14fe23b52a2193789159a2bf52f", "score": "0.44711962", "text": "function makeInstrumentObjects(musicObj){++cov_1iewdnji11.f[2];const partNames=(++cov_1iewdnji11.s[10],[]);const instrumentObjects=(++cov_1iewdnji11.s[11],{});function searchForInstruments(obj){++cov_1iewdnji11.f[3];++cov_1iewdnji11.s[12];Object.keys(obj).forEach(key=>{++cov_1iewdnji11.f[4];const value=(++cov_1iewdnji11.s[13],obj[key]);++cov_1iewdnji11.s[14];if(key===\"part-name\"){++cov_1iewdnji11.b[2][0];++cov_1iewdnji11.s[15];partNames.push(value);}//the actual parts data are in an ordered array found via key \"part\"\n//bc they\"re ordered, they correspond to the ordering of the part-names\nelse{++cov_1iewdnji11.b[2][1];++cov_1iewdnji11.s[16];if(key===\"part\"){++cov_1iewdnji11.b[3][0];let index=(++cov_1iewdnji11.s[17],0);++cov_1iewdnji11.s[18];partNames.forEach(name=>{++cov_1iewdnji11.f[5];++cov_1iewdnji11.s[19];instrumentObjects[name]=value[index];//value is array of parts\n++cov_1iewdnji11.s[20];index++;});++cov_1iewdnji11.s[21];return;//avoid redundant traversal- VERY IMPORTANT\n}else{++cov_1iewdnji11.b[3][1];++cov_1iewdnji11.s[22];if((++cov_1iewdnji11.b[5][0],value!==null)&&(++cov_1iewdnji11.b[5][1],typeof value===\"object\")){++cov_1iewdnji11.b[4][0];++cov_1iewdnji11.s[23];searchForInstruments(value);}else{++cov_1iewdnji11.b[4][1];}}}});}++cov_1iewdnji11.s[24];searchForInstruments(musicObj);//if there's a single instrument we need to do some hacking...\n++cov_1iewdnji11.s[25];if(Object.keys(instrumentObjects).length===1){++cov_1iewdnji11.b[6][0];const instrumentName=(++cov_1iewdnji11.s[26],Object.keys(instrumentObjects)[0]);++cov_1iewdnji11.s[27];instrumentObjects[instrumentName]=musicObj;}else{++cov_1iewdnji11.b[6][1];}++cov_1iewdnji11.s[28];return instrumentObjects;}//=============================================================================", "title": "" }, { "docid": "ba2bf96cab72cceb44e51667b5470b41", "score": "0.4470135", "text": "prepare() {\n }", "title": "" }, { "docid": "ada96a4f5b3b7595141299efd9e005e5", "score": "0.44693393", "text": "function previousLengths() {\n\n }", "title": "" }, { "docid": "c8de363e62c93143dc2922f8fb7ea31f", "score": "0.4467783", "text": "function _fn027() {\r\n _fn026(null)\r\n }", "title": "" }, { "docid": "01df61dcffe72d2bab2f8507f37d11db", "score": "0.44668317", "text": "reflecting() {\n return false;\n }", "title": "" }, { "docid": "54f5673896b0dbbc22727e2217d7f6a0", "score": "0.4459772", "text": "function fnc_child_cargar_valores_iniciales() {\n\n\n}", "title": "" }, { "docid": "8db0a0cb27dbd6a9d4d44f68abe61b0d", "score": "0.44566277", "text": "_addedHook() {}", "title": "" }, { "docid": "34b42e6b63edc9f21c643d3ecc8aa19e", "score": "0.4443588", "text": "function Mechanism() {}", "title": "" }, { "docid": "34b42e6b63edc9f21c643d3ecc8aa19e", "score": "0.4443588", "text": "function Mechanism() {}", "title": "" }, { "docid": "a76968d967d4f7205da090126e8cff25", "score": "0.44375896", "text": "ce(t,e){let n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n;}", "title": "" } ]
cd4bd5a5df44f8c22d0b600120231451
Function for determining if two URLs are identical. Ignores 'www' and trailing slashes. Treats 'http' and 'https' the same.
[ { "docid": "722d9b1f4981341587a9a1a4c9218457", "score": "0.82762134", "text": "function sameUrl (url1, url2) {\n // remove www if www is present\n url1 = removeWWW(url1);\n url2 = removeWWW(url2);\n\n // remove trailing slash if one is present\n url1 = removeTrailingSlash(url1);\n url2 = removeTrailingSlash(url2);\n\n // remove protocol of http or https\n url1 = removeProtocol(url1);\n url2 = removeProtocol(url2);\n\n return url1 === url2;\n}", "title": "" } ]
[ { "docid": "0f8c477e6c13a42ca7cc46c320d2453c", "score": "0.72127265", "text": "function urlsEqual(url1, url2) {\n if (url1 === url2) {\n return true;\n }\n let u1, u2;\n try {\n u1 = new url_1.URL(url1);\n u2 = new url_1.URL(url2);\n }\n catch (_a) {\n return false;\n }\n return ((u1.protocol === u2.protocol) &&\n (u1.hostname === u2.hostname) &&\n ((u1.port || \"80\") === (u2.port || \"80\")) &&\n (u1.pathname === u2.pathname));\n}", "title": "" }, { "docid": "9fa5982474841cc405bd6ae1405b11db", "score": "0.71870816", "text": "function urlsEqual(a, b) {\n return a === b || urlResolve(a).href === urlResolve(b).href;\n }", "title": "" }, { "docid": "9fa5982474841cc405bd6ae1405b11db", "score": "0.71870816", "text": "function urlsEqual(a, b) {\n return a === b || urlResolve(a).href === urlResolve(b).href;\n }", "title": "" }, { "docid": "99153be0077d7ef015c0274f1a840f46", "score": "0.71549267", "text": "function urlsEqual(a, b) {\n return a === b || urlResolve(a).href === urlResolve(b).href;\n }", "title": "" }, { "docid": "68021335acdbd45a7b161d424c8c334e", "score": "0.6630286", "text": "function compareURL(stringA, stringB) {\n var urlA = url.parse(stringA);\n var urlB = url.parse(stringB);\n new Set([\n 'protocol',\n 'host',\n 'hostname',\n 'path',\n 'port',\n ]).forEach(function (key) {\n var aValue = urlA[key];\n var bValue = urlB[key];\n if (key === 'port') {\n if (aValue === null && urlA.protocol) {\n aValue = getDefaultPort(urlA.protocol);\n }\n if (bValue === null && urlB.protocol) {\n bValue = getDefaultPort(urlB.protocol);\n }\n }\n if (aValue && !bValue) {\n urlB[key] = aValue;\n }\n else if (!aValue && bValue) {\n urlA[key] = bValue;\n }\n });\n return url.format(urlA) === url.format(urlB);\n}", "title": "" }, { "docid": "fadb6afdeff9bd08d02ab72fb77aea0a", "score": "0.61106074", "text": "function urlCheck(str) {\n var parsed = url.parse(str);\n\n return (!!parsed.hostname && !!parsed.protocol && str.indexOf(' ') < 0);\n }", "title": "" }, { "docid": "ddcb18313d524ad8aeac7dc6f5c5a381", "score": "0.6089713", "text": "restricted(href) {\n const parsedUrl = url.parse(href);\n const protocol = parsedUrl.protocol || '';\n if (!protocol.match(/^https?/)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "7c6847113bdc593bfff7c4ec69b6e60d", "score": "0.608621", "text": "function isUrlForSamePage(url, originalUrl)\n{\n var normalizedUrl = normalizeUrl(url);\n var normalizedOriginalUrl = normalizeUrl(originalUrl);\n\n console.log('isUrlForSamePage: normalizedUrl=' + normalizedUrl + ' --- normalized origin=' + normalizedOriginalUrl);\n\n return (normalizedUrl.localeCompare(normalizedOriginalUrl) == 0);\n}", "title": "" }, { "docid": "9affba89d1d0a7673e44f9ebaf8cafe9", "score": "0.5930952", "text": "isSameHost (url) {\n return (new URL(url)).hostname === this.urlOriginHost\n }", "title": "" }, { "docid": "61c6be05ed7f27d021bc5aface833296", "score": "0.59119225", "text": "function isSameOrigin(baseUrl, otherUrl) {\n try {\n var base = new URL(baseUrl);\n if (!base.origin || base.origin === 'null') {\n return false; // non-HTTP url\n }\n } catch (e) {\n return false;\n }\n\n var other = new URL(otherUrl, base);\n return base.origin === other.origin;\n}", "title": "" }, { "docid": "36b7ba66a4acb0adff3747faa1df20a7", "score": "0.5906297", "text": "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname\n if (location.port) origin += ':' + location.port\n return (href && (0 === href.indexOf(origin)))\n}", "title": "" }, { "docid": "317cceb135143efefe6193a507bb71cb", "score": "0.58927536", "text": "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "title": "" }, { "docid": "317cceb135143efefe6193a507bb71cb", "score": "0.58927536", "text": "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "title": "" }, { "docid": "317cceb135143efefe6193a507bb71cb", "score": "0.58927536", "text": "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "title": "" }, { "docid": "317cceb135143efefe6193a507bb71cb", "score": "0.58927536", "text": "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "title": "" }, { "docid": "317cceb135143efefe6193a507bb71cb", "score": "0.58927536", "text": "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "title": "" }, { "docid": "317cceb135143efefe6193a507bb71cb", "score": "0.58927536", "text": "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "title": "" }, { "docid": "fc75b53a376fb892d3b9905c9b296a03", "score": "0.5867104", "text": "function isHttp() {\n //return true;\n if(window.location.href.split('/')[0].indexOf(\"http\") === 0) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "c3a341db2760946249c2e02bbde3444e", "score": "0.5864589", "text": "function isAbsLink(url)\n{\n var retVal = false;\n if (url.length > 0 && (url.substring(0,7).toLowerCase()==\"http://\" || url.substring(0,8).toLowerCase()==\"https://\")){\n retVal=true;\n }\n return retVal;\n}", "title": "" }, { "docid": "34c65862dcf25b1e02b4a7d0ddd60a15", "score": "0.5856055", "text": "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return 0 == href.indexOf(origin);\n }", "title": "" }, { "docid": "0165de9dcbb5212eeb9b9ebb3a070e53", "score": "0.5798396", "text": "function isSameBaseUrl(oldItemUrl, newItemUrl) {\n if (!oldItemUrl || !newItemUrl) {return false;}\n var baseOldItemUrl = oldItemUrl.indexOf('#') == -1 ? oldItemUrl : oldItemUrl.substr(0, oldItemUrl.indexOf('#'));\n var baseNewItemUrl = newItemUrl.indexOf('#') == -1 ? newItemUrl : newItemUrl.substr(0, newItemUrl.indexOf('#'));\n return baseNewItemUrl == baseOldItemUrl;\n }", "title": "" }, { "docid": "a8acc537f6076239af6eedb2a1727ef0", "score": "0.5784336", "text": "function goodUrl(u, s) {\n if (!u.protocol.startsWith(\"http\"))\n return false;\n\n if (u.pathname.endsWith(\"/chrome/newtab\"))\n return false;\n\n const tokens = s.hostname.split(\".\");\n const domain = tokens[tokens.length - 2];\n\n if (!u.host.includes(domain))\n return false;\n\n return true;\n}", "title": "" }, { "docid": "85d91b10d7faf46094811f8216ef3b58", "score": "0.57801867", "text": "function isSamePort(protocol1, port1, protocol2, port2) {\r\n if (port1 === port2) {\r\n return true;\r\n } else if (protocol1 === protocol2) {\r\n if (protocol1 === 'http') {\r\n return useDefault(port1, '80') === useDefault(port2, '80');\r\n } else if (protocol1 === 'https') {\r\n return useDefault(port1, '443') === useDefault(port2, '443');\r\n }\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "aa95e2db3fec0d581132089512908dac", "score": "0.5769621", "text": "function isCommonReqEqual(url, serverInstance) {\n try{\n url = url.replace('https://', '').replace('http://', ''); // only the remained path is required\n let isEqual = true;\n\n const directReqObj = serverInstance.getRequestRecord(url);\n const proxyReqObj = serverInstance.getProxyRequestRecord(url);\n\n // ensure the proxy header is correct\n isEqual = isEqual && proxyReqObj.headers['via-proxy'] === 'true';\n delete proxyReqObj.headers['via-proxy'];\n\n // exclued accept-encoding from comparing, since the proxy will remove it before sending it out\n delete directReqObj.headers['accept-encoding'];\n\n // per undefined header, proxy will set it with 0, and an empty request body\n if (typeof directReqObj.headers['content-length'] === 'undefined') {\n\n directReqObj.headers['content-length'] = \"0\";\n }\n\n directReqObj.headers['content-type'] = trimFormContentType(directReqObj.headers['content-type']);\n proxyReqObj.headers['content-type'] = trimFormContentType(proxyReqObj.headers['content-type']);\n\n isEqual = isEqual && directReqObj.url === proxyReqObj.url;\n isEqual = isEqual && isObjectEqual(directReqObj.headers, proxyReqObj.headers, url);\n isEqual = isEqual && directReqObj.body === proxyReqObj.body;\n return isEqual;\n } catch (e) {\n console.error(e);\n }\n\n}", "title": "" }, { "docid": "e52001d079776653ef509e5f1ab09830", "score": "0.57637095", "text": "function isSamePort(protocol1, port1, protocol2, port2) {\n if (port1 === port2) {\n return true;\n } else if (protocol1 === protocol2) {\n if (protocol1 === 'http') {\n return useDefault(port1, '80') === useDefault(port2, '80');\n } else if (protocol1 === 'https') {\n return useDefault(port1, '443') === useDefault(port2, '443');\n }\n }\n return false;\n }", "title": "" }, { "docid": "e52001d079776653ef509e5f1ab09830", "score": "0.57637095", "text": "function isSamePort(protocol1, port1, protocol2, port2) {\n if (port1 === port2) {\n return true;\n } else if (protocol1 === protocol2) {\n if (protocol1 === 'http') {\n return useDefault(port1, '80') === useDefault(port2, '80');\n } else if (protocol1 === 'https') {\n return useDefault(port1, '443') === useDefault(port2, '443');\n }\n }\n return false;\n }", "title": "" }, { "docid": "45b3e646dd54ba5454ea1f82fc43637b", "score": "0.57184654", "text": "function isURL(str) {\n if (str.includes(' ')) {\n return false;\n }\n if (typeof URL !== 'undefined') {\n try {\n const url = new URL(str);\n return ['https:', 'http:', 'ftp:', 'file:', 'rtmp:'].includes(url.protocol);\n }\n catch (e) {\n return false;\n }\n }\n const a = document.createElement('a');\n a.href = str;\n return Boolean(a.hostname);\n}", "title": "" }, { "docid": "6f9178c39c84fe907eb2cc0be75fe4de", "score": "0.5717081", "text": "function sameOrigin(href) {\n\t var origin = location.protocol + '//' + location.hostname;\n\t if (location.port) origin += ':' + location.port;\n\t return (href && (0 === href.indexOf(origin)));\n\t }", "title": "" }, { "docid": "6f9178c39c84fe907eb2cc0be75fe4de", "score": "0.5717081", "text": "function sameOrigin(href) {\n\t var origin = location.protocol + '//' + location.hostname;\n\t if (location.port) origin += ':' + location.port;\n\t return (href && (0 === href.indexOf(origin)));\n\t }", "title": "" }, { "docid": "6f9178c39c84fe907eb2cc0be75fe4de", "score": "0.5717081", "text": "function sameOrigin(href) {\n\t var origin = location.protocol + '//' + location.hostname;\n\t if (location.port) origin += ':' + location.port;\n\t return (href && (0 === href.indexOf(origin)));\n\t }", "title": "" }, { "docid": "6f9178c39c84fe907eb2cc0be75fe4de", "score": "0.5717081", "text": "function sameOrigin(href) {\n\t var origin = location.protocol + '//' + location.hostname;\n\t if (location.port) origin += ':' + location.port;\n\t return (href && (0 === href.indexOf(origin)));\n\t }", "title": "" }, { "docid": "6f9178c39c84fe907eb2cc0be75fe4de", "score": "0.5717081", "text": "function sameOrigin(href) {\n\t var origin = location.protocol + '//' + location.hostname;\n\t if (location.port) origin += ':' + location.port;\n\t return (href && (0 === href.indexOf(origin)));\n\t }", "title": "" }, { "docid": "4aebe9e534b550e29560c322a2548658", "score": "0.5680394", "text": "function checkHttps(){\r\n\t\thttpsOn = ('https:' == document.location.protocol ? 1 : 0);\r\n\t\treturn httpsOn;\r\n\t}", "title": "" }, { "docid": "c4b40c92df3a5dc111ffc8e2f4391f3e", "score": "0.5662901", "text": "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str[0] === '/');\n }", "title": "" }, { "docid": "c4b40c92df3a5dc111ffc8e2f4391f3e", "score": "0.5662901", "text": "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str[0] === '/');\n }", "title": "" }, { "docid": "c4b40c92df3a5dc111ffc8e2f4391f3e", "score": "0.5662901", "text": "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str[0] === '/');\n }", "title": "" }, { "docid": "c4b40c92df3a5dc111ffc8e2f4391f3e", "score": "0.5662901", "text": "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str[0] === '/');\n }", "title": "" }, { "docid": "632f8871ae3b1b7aa27d50ba02f32372", "score": "0.5643337", "text": "function checkValidURL(string) {\n try {\n let protocols = [\"https\"];\n new URL(string);\n const parsed = parse(string);\n return protocols\n ? parsed.protocol\n ? protocols.map((x) => `${x.toLowerCase()}:`).includes(parsed.protocol)\n : false\n : true;\n } catch (err) {\n console.log(err);\n return false;\n }\n}", "title": "" }, { "docid": "f2d1534f4f46b0d981b6f4ba6e9e6083", "score": "0.5638512", "text": "function areCookiesEqual(a, b) {\n var sameSiteSame = a.sameSite === b.sameSite;\n if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {\n sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();\n }\n return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);\n}", "title": "" }, { "docid": "fa953b68d93f6410f327a98daa105f8c", "score": "0.55928224", "text": "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str.charAt(0) === '/');\n }", "title": "" }, { "docid": "fa953b68d93f6410f327a98daa105f8c", "score": "0.55928224", "text": "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str.charAt(0) === '/');\n }", "title": "" }, { "docid": "e755587daf52f4f93f59c5eb835dfa6a", "score": "0.5565391", "text": "function isSameSrc(srcA, srcB) {\r\n\t\tif (srcA.indexOf(thisURL) === -1)\r\n\t\t\tsrcA = thisURL+srcA;\r\n\t\tif (srcB.indexOf(thisURL) === -1)\r\n\t\t\tsrcB = thisURL+srcB;\r\n\t\tif (srcA === srcB)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "be0f3bd18b4f968e4e231e87ac107a4a", "score": "0.5548143", "text": "function checkURL(address){\n\tvar satisfactory = false,\n\t\tsize = address.indexOf(\":\"),\n\t\tprotocol = address.substr(0, size);\n\t\t\n\t\tif (protocol === \"http\"){\n\t\t\tsatisfactory = true;\n\t\t}\n\t\telse if (protocol ===\"https\"){\n\t\t\tsatisfactory = true;\n\t\t}\n\t\treturn satisfactory;\n}", "title": "" }, { "docid": "63381ae2507fa955010d7b85ffa514b8", "score": "0.5523355", "text": "function isSubDomain(url1, url2){\n url2 = url2.toString();\n if (url1===url2){\n return true;\n }\n else if (url2.includes(url1)){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "36b50c5d4f0301d6085acc4fdb06e254", "score": "0.5517772", "text": "function IsUrlPath(strFilePath)\n{\n\tvar blnIs = false;\n\ttry\t\n\t{\n\t\tvar strUrlPrefix = \"\";\n\t\tif (strFilePath.length >= 6) \n\t\t{\n\t\t\tstrUrlPrefix = strFilePath.substring(0,5);\n\t\t\tif (strUrlPrefix.toUpperCase() == \"HTTP:\")\n\t\t\t\tblnIs = true;\n\t\t\tif (! blnIs) \n\t\t\t{\n\t\t\t\tstrUrlPrefix = strFilePath.substring(0,6);\n\t\t\t\tif (strUrlPrefix.toUpperCase() == \"HTTPS:\")\n\t\t\t\t\tblnIs = true;\n\t\t\t}\n\t\t}\n\t}\n\tcatch (e) {}\n\treturn blnIs;\n}", "title": "" }, { "docid": "d66acf1afa8c0d4edf4c54d6ddce721f", "score": "0.55071485", "text": "function fnCheckURL(sFieldValue)\n{\n\tbValidFlag=true;\n\tsFieldValue=fnTrim(sFieldValue)\n\tfor(i=0;i<sFieldValue.length-1;i++)\n\t{\n\t\tif(sFieldValue.substr(i,4) == \"www.\")\n\t\t{\n\t\t\tfor(j=i+5;j<sFieldValue.length-1;j++)\n\t\t\t{\n\t\t\t\tif(sFieldValue.substr(j,1) == \".\")\n\t\t\t\t{\n\t\t\t\t\tbValidFlag=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn (bValidFlag)\n }", "title": "" }, { "docid": "c92a88d41c5e2afca18b077ee8951054", "score": "0.5489262", "text": "function testSameOrigin(url) {\n\t\tvar loc = window.location,\n\t\t\ta = document.createElement('a');\n\t\ta.href = url;\n\t\treturn a.hostname == loc.hostname &&\n\t\t\t a.port == loc.port &&\n\t\t\t a.protocol == loc.protocol;\n\t}", "title": "" }, { "docid": "4927a4d8b0318a0989ea3410b10d42ef", "score": "0.5482346", "text": "function urlValid(url)\n{\n let regexUrl1 = /^http:\\/\\/.+\\..+/;\n let regexUrl2 = /^https:\\/\\/.+\\..+/;\n\n if (!regexUrl1.test(url) && !regexUrl2.test(url))\n url = `http://${url}`;\n return (url);\n}", "title": "" }, { "docid": "34da4b2d34f40e771ce67bcb04da92f0", "score": "0.54752046", "text": "function testSameOrigin(url) {\n\t\tvar loc = window.location;\n\t\tvar a = document.createElement('a');\n\n\t\ta.href = url;\n\n\t\treturn a.hostname == loc.hostname &&\n\t\ta.port == loc.port &&\n\t\ta.protocol == loc.protocol;\n\t}", "title": "" }, { "docid": "f0b9fe62a783258f726d02e3773a1333", "score": "0.5459092", "text": "function isUrl(string) {\n return string && !!string.match(/\\/|:|\\./g);\n}", "title": "" }, { "docid": "a9386c0617bc3f08945c6e8856680d01", "score": "0.54556966", "text": "function isUrlOK(compareChar)\n{\n\tvar charCode = compareChar.charCodeAt(0);\n\n\tif ((charCode >= 97 && charCode <= 122)\t\t// 'a'-'z'\n\t\t || (charCode >= 65 && charCode <= 90)\t// 'A'-'Z'\n\t\t || (charCode >= 48 && charCode <= 57)\t// '0'-'9'\n\t\t || charCode == 46\t\t\t\t// '.'\n\t\t || charCode == 45\t\t\t\t// '-'\n\t\t || charCode == 95\t\t\t\t// '_'\n\t\t || charCode == 42)\t\t\t\t// '*'\n\t{\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "bb963d1ede387a0b0e3703732a4dd635", "score": "0.5455277", "text": "isURI(input) {\n // todo: maybe better check with a regExp\n return input.startsWith('http://') || input.startsWith('https://');\n }", "title": "" }, { "docid": "f903aae91c9da71ced8bf3838a10817c", "score": "0.54498976", "text": "function isHttpsProtocal(){\n\n }", "title": "" }, { "docid": "23d8085185724654b47c434cf7d8d476", "score": "0.5417255", "text": "function isRelativeUrl(url) {\r\n return url.protocol === \"\" &&\r\n url.separator === \"\" &&\r\n url.authority === \"\" &&\r\n url.domain === \"\" &&\r\n url.port === \"\";\r\n}", "title": "" }, { "docid": "ec552caa8658d380561d02ee2d328bd0", "score": "0.5410086", "text": "static links(x) {\n\t\ttry {\n\t\t\treturn /\\w+\\.ly\\//.test(x) || x.match(/https?\\:\\/\\//g).length >= 4;\n\t\t} catch (e) { return false; }\n\t}", "title": "" }, { "docid": "cf84c1734198ad2a19c8e39302af8835", "score": "0.5380108", "text": "function webUrl (thing) {\n return unemptyString(thing) && /^https?:\\/\\/.+/.test(thing);\n }", "title": "" }, { "docid": "923f8d0c17eaae0da3684da71039dcea", "score": "0.537809", "text": "function properURL(url) {\n return url.includes('http') ? url : 'http://' + url;\n}", "title": "" }, { "docid": "ce8ac787ffbfdf339af2ba3c8ec7b48c", "score": "0.5376593", "text": "function isurl(theurl) {\n\treturn /^\\s*https?:\\/\\//.test(theurl);\n}", "title": "" }, { "docid": "276aed7fbf8bd1d6b3a630d0b0518c42", "score": "0.537552", "text": "function is_link(url)\r\n {\r\n return /^https?:\\/\\//.test(url);\r\n }", "title": "" }, { "docid": "f8bd8cf770392f3ca0cd2004ac0f2629", "score": "0.5374948", "text": "function isUrl(s) {\n let regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-/]))?/\n return !s[0] === '#' || regexp.test(s)\n}", "title": "" }, { "docid": "4b3fb1fc08f3788853917155af9760d9", "score": "0.53552246", "text": "isUrl(str) {\n // Must not contain spaces\n if (str.includes(\" \")) return false;\n\n // Starts with a scheme: URL\n if (this.hasFullUrlPrefix(str)) return true;\n\n // More or less RFC compliant URL host part parsing. This should be sufficient for our needs\n const urlRegex = new RegExp(\n \"^(?:([^:]+)(?::([^:]+))?@)?\" + // user:password (optional) => \\1, \\2\n \"([^:]+|\\\\[[^\\\\]]+\\\\])\" + // host name (IPv6 addresses in square brackets allowed) => \\3\n \"(?::(\\\\d+))?$\", // port number (optional) => \\4\n );\n\n // Official ASCII TLDs that are longer than 3 characters + inofficial .onion TLD used by TOR\n const longTlds = [\n \"arpa\",\n \"asia\",\n \"coop\",\n \"info\",\n \"jobs\",\n \"local\",\n \"mobi\",\n \"museum\",\n \"name\",\n \"onion\",\n ];\n\n const specialHostNames = [\"localhost\"];\n\n // Try to parse the URL into its meaningful parts. If matching fails we're pretty sure that we\n // don't have some kind of URL here.\n const match = urlRegex.exec((str.split(\"/\"))[0]);\n if (!match) return false;\n const hostName = match[3];\n\n // Allow known special host names\n if (specialHostNames.includes(hostName)) return true;\n\n // Allow IPv6 addresses (need to be wrapped in brackets as required by RFC). It is sufficient to\n // check for a colon, as the regex wouldn't match colons in the host name unless it's an v6\n // address\n if (hostName.includes(\":\")) return true;\n\n // At this point we have to make a decision. As a heuristic, we check if the input has dots in\n // it. If yes, and if the last part could be a TLD, treat it as an URL\n const dottedParts = hostName.split(\".\");\n\n if (dottedParts.length > 1) {\n const lastPart = dottedParts.pop();\n if ((2 <= lastPart.length && lastPart.length <= 3) || longTlds.includes(lastPart)) {\n return true;\n }\n }\n\n // Allow IPv4 addresses\n if (/^(\\d{1,3}\\.){3}\\d{1,3}$/.test(hostName)) return true;\n\n // Fallback: no URL\n return false;\n }", "title": "" }, { "docid": "a66fc9593783c8edab432c26e836f875", "score": "0.53495073", "text": "function isURL(url) {\n\t\n\tvar urlIs = url.split(\":\");\n\t\n\t\tif(urlIs[0].length === 4) {\n\t\t\tif(urlIs[0] === \"http\") {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t\t\n\t\tif(urlIs[0].length === 5) {\n\t\t\tif(urlIs[0] === \"https\") {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t} return false;\n\t\n\t\n}", "title": "" }, { "docid": "d3e582c37884ad78f491f152570cccfb", "score": "0.5304072", "text": "function protocol(value) {\n var val = value.slice(-6).toLowerCase()\n return val === mailto || val.slice(-5) === https || val.slice(-4) === http\n}", "title": "" }, { "docid": "d3e582c37884ad78f491f152570cccfb", "score": "0.5304072", "text": "function protocol(value) {\n var val = value.slice(-6).toLowerCase()\n return val === mailto || val.slice(-5) === https || val.slice(-4) === http\n}", "title": "" }, { "docid": "1f2c7cd9ee23d45a700b5bbfba5cfda8", "score": "0.5283039", "text": "function checkDomain(url) {\n // CONVERT LINK INTO OBJECT\n var link = parseUri(url);\n // CHECK THAT LINK IS FOR SECURE FACEBOOK SITE\n if ((link.protocol === 'https') && link.host.includes('facebook.com')) {\n return 'facebook';\n } else if ((link.protocol === 'https') && link.host.includes('twitter.com')) {\n return 'twitter';\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "8a14ac04dab5ed5497bf05f5a30de966", "score": "0.52642447", "text": "function isURL(str) {\n\treturn /^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$/.test(str); \n}", "title": "" }, { "docid": "8c856742fe700734ebd6f6771c5cf562", "score": "0.5243469", "text": "function stripProtocolFromUrl(loc) {\n if (loc === undefined) {\n return false;\n }\n\n var prot = loc.substring(0, 5);\n if (prot === 'http:') {\n return loc.substring(7);\n }\n\n if (prot === 'https') {\n return loc.substring(8);\n }\n\n // No http or https, no lookup\n return false;\n}", "title": "" }, { "docid": "23c9c11b91350ffb1b3f0fd151170e29", "score": "0.5241472", "text": "function isUrl(s) {\n\t\t var regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n\t\t return regexp.test(s);\n\t\t}", "title": "" }, { "docid": "5f85ee5a46d775cb499488d95cee3b15", "score": "0.5235412", "text": "function IsURL(a) {\n //URL have to has '.' or '。'\n if (!RegExp('[.。]').test(a)){ return false; }\n //URL can`t have any space\n if (RegExp(' ').test(a)){ return false; }\n //URL have to start with letter,digital or chinese simplified character\n if (!RegExp('^[A-Za-z0-9\\u4e00-\\u9fa5]').test(a)){\n return false;\n }\n //common domain name\n if (RegExp('.+[.。](com|cn|org|net|info|club|edu|gov|io)/?(/.+)?$').test(a)){ return true; }\n //IP address\n if (RegExp('^((http|https)://)?((2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[.。]){3}(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)/?([:/].+)?$').test(a)){ return true; }\n //have chinese simplified character but not domain name\n if (RegExp('[\\u4e00-\\u9fa5]').test(a)){\n if (RegExp('.+[.。](测试|佛山|慈善|集团|在线|八卦|公益|公司|移动|我爱你|时尚|淡马锡|商标|商店|商城|工行|中文网|中信|中国|中國|娱乐|谷歌|測試|网店|网络|香港|飞利浦|台湾|台灣|手机|澳門|政府|机构|组织机构|健康|世界|网址|游戏|企业|信息|广东|新加坡|政务)/?(/.+)?$').test(a)){\n return true;\n }else{\n return false;\n }\n }\n\n//all of domain name\n//this also work quickly...\n switch(RegExp('.+[.。](.)').exec(a)[1]){\n /*A*/case 'a': if (RegExp('.+[.。](abb|abbott|abogado|ac|academy|accenture|accountant|accountants|active|actor|ad|ads|adult|ae|aero|af|afl|ag|agency|ai|aig|airforce|al|allfinanz|alsace|am|amsterdam|an|android|ao|apartments|aq|aquarelle|ar|archi|army|arpa|as|asia|associates|at|attorney|au|auction|audio|auto|autos|aw|ax|axa|az)/?(/.+)?$').test(a)){ return true; }; break;\n /*B*/case 'b': if (RegExp('.+[.。](ba|band|bank|bar|barclaycard|barclays|bargains|bauhaus|bayern|bb|bbc|bd|be|beer|berlin|best|bf|bg|bh|bi|bid|bike|bingo|bio|biz|bj|bl|black|blackfriday|bloomberg|blue|bm|bmw|bn|bnpparibas|bo|boats|bond|boo|boutique|bq|br|bridgestone|broker|brother|brussels|bs|bt|budapest|build|builders|business|buzz|bv|bw|by|bz|bzh)/?(/.+)?$').test(a)){ return true; }; break;\n /*C*/case 'c': if (RegExp('.+[.。](ca|cab|cafe|cal|camera|camp|cancerresearch|canon|capetown|capital|caravan|cards|care|career|careers|cars|cartier|casa|cash|casino|cat|catering|cbn|cc|cd|center|ceo|cern|cf|cfa|cfd|cg|ch|channel|chat|cheap|chloe|christmas|chrome|church|ci|cisco|citic|city|ck|cl|claims|cleaning|click|clinic|clothing|club|cm|cn|co|coach|codes|coffee|college|cologne|com|community|company|computer|condos|construction|consulting|contractors|cooking|cool|coop|corsica|country|coupons|courses|cr|credit|creditcard|cricket|crs|cruises|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz)/?(/.+)?$').test(a)){ return true; }; break;\n /*D*/case 'd': if (RegExp('.+[.。](dabur|dad|dance|date|dating|datsun|day|dclk|de|deals|degree|delivery|democrat|dental|dentist|desi|design|dev|diamonds|diet|digital|direct|directory|discount|dj|dk|dm|dnp|do|docs|dog|doha|domains|doosan|download|durban|dvag|dz)/?(/.+)?$').test(a)){ return true; }; break;\n /*E*/case 'e': if (RegExp('.+[.。](earth|eat|ec|edu|education|ee|eg|eh|email|emerck|energy|engineer|engineering|enterprises|epson|equipment|er|erni|es|esq|estate|et|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express)/?(/.+)?$').test(a)){ return true; }; break;\n /*F*/case 'f': if (RegExp('.+[.。](fail|faith|fan|fans|farm|fashion|feedback|fi|film|finance|financial|firmdale|fish|fishing|fit|fitness|fj|fk|flights|florist|flowers|flsmidth|fly|fm|fo|foo|football|forex|forsale|foundation|fr|frl|frogans|fund|furniture|futbol|fyi)/?(/.+)?$').test(a)){ return true; }; break;\n /*G*/case 'g': if (RegExp('.+[.。](ga|gal|gallery|garden|gb|gbiz|gd|gdn|ge|gent|gf|gg|ggee|gh|gi|gift|gifts|gives|gl|glass|gle|global|globo|gm|gmail|gmo|gmx|gn|gold|goldpoint|golf|goo|goog|google|gop|gov|gp|gq|gr|graphics|gratis|green|gripe|gs|gt|gu|guge|guide|guitars|guru|gw|gy)/?(/.+)?$').test(a)){ return true; }; break;\n /*H*/case 'h': if (RegExp('.+[.。](hamburg|hangout|haus|healthcare|help|here|hermes|hiphop|hitachi|hiv|hk|hm|hn|hockey|holdings|holiday|homes|honda|horse|host|hosting|house|how|hr|ht|hu)/?(/.+)?$').test(a)){ return true; }; break;\n /*I*/case 'i': if (RegExp('.+[.。](ibm|icbc|icu|id|ie|ifm|il|im|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insure|int|international|investments|io|iq|ir|irish|is|it|iwc)/?(/.+)?$').test(a)){ return true; }; break;\n /*J*/case 'j': if (RegExp('.+[.。](java|jcb|je|jetzt|jewelry|jll|jm|jo|jobs|joburg|jp|juegos)/?(/.+)?$').test(a)){ return true; }; break;\n /*K*/case 'k': if (RegExp('.+[.。](kaufen|kddi|ke|kg|kh|ki|kim|kitchen|kiwi|km|kn|koeln|komatsu|kp|kr|krd|kred|kw|ky|kyoto|kz)/?(/.+)?$').test(a)){ return true; }; break;\n /*L*/case 'l': if (RegExp('.+[.。](la|lacaixa|land|lat|latrobe|lawyer|lb|lc|lds|lease|leclerc|legal|lgbt|li|liaison|lidl|life|lighting|limited|limo|link|lk|loan|loans|lol|london|lotte|lotto|love|lr|ls|lt|ltda|lu|lupin|luxe|luxury|lv|ly)/?(/.+)?$').test(a)){ return true; }; break;\n /*M*/case 'm': if (RegExp('.+[.。](ma|madrid|maif|maison|management|mango|market|marketing|markets|marriott|mba|mc|md|me|media|meet|melbourne|meme|memorial|men|menu|mf|mg|mh|miami|mil|mini|mk|ml|mm|mma|mn|mo|mobi|moda|moe|monash|money|mormon|mortgage|moscow|motorcycles|mov|movie|mp|mq|mr|ms|mt|mtn|mtpc|mu|museum|mv|mw|mx|my|mz)/?(/.+)?$').test(a)){ return true; }; break;\n /*N*/case 'n': if (RegExp('.+[.。](na|nadex|nagoya|name|navy|nc|ne|nec|net|network|neustar|new|news|nexus|nf|ng|ngo|nhk|ni|nico|ninja|nissan|nl|no|np|nr|nra|nrw|ntt|nu|nyc|nz)/?(/.+)?$').test(a)){ return true; }; break;\n /*O*/case 'o': if (RegExp('.+[.。](okinawa|om|one|ong|onl|online|ooo|org|organic|osaka|otsuka|ovh)/?(/.+)?$').test(a)){ return true; }; break;\n /*P*/case 'p': if (RegExp('.+[.。](pa|page|panerai|paris|partners|parts|party|pe|pf|pg|ph|pharmacy|philips|photo|photography|photos|physio|piaget|pics|pictet|pictures|pink|pizza|pk|pl|place|plumbing|plus|pm|pn|pohl|poker|porn|post|pr|praxi|press|pro|prod|productions|prof|properties|property|ps|pt|pub|pw|py)/?(/.+)?$').test(a)){ return true; }; break;\n /*Q*/case 'q': if (RegExp('.+[.。](qa|qpon|quebec)/?(/.+)?$').test(a)){ return true; }; break;\n /*R*/case 'r': if (RegExp('.+[.。](racing|re|realtor|recipes|red|redstone|rehab|reise|reisen|reit|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rich|rio|rip|ro|rocks|rodeo|rs|rsvp|ru|ruhr|run|rw|ryukyu)/?(/.+)?$').test(a)){ return true; }; break;\n /*S*/case 's': if (RegExp('.+[.。](sa|saarland|sale|samsung|sap|sarl|saxo|sb|sc|sca|scb|schmidt|scholarships|school|schule|schwarz|science|scot|sd|se|seat|sener|services|sew|sex|sexy|sg|sh|shiksha|shoes|show|shriram|si|singles|site|sj|sk|sky|sl|sm|sn|so|soccer|social|software|sohu|solar|solutions|sony|soy|space|spiegel|spreadbetting|sr|ss|st|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swiss|sx|sy|sydney|systems|sz)/?(/.+)?$').test(a)){ return true; }; break;\n /*T*/case 't': if (RegExp('.+[.。](taipei|tatar|tattoo|tax|taxi|tc|td|team|tech|technology|tel|temasek|tennis|tf|tg|th|thd|theater|tickets|tienda|tips|tires|tirol|tj|tk|tl|tm|tn|to|today|tokyo|tools|top|toray|toshiba|tours|town|toys|tp|tr|trade|trading|training|travel|trust|tt|tui|tv|tw|tz)/?(/.+)?$').test(a)){ return true; }; break;\n /*U*/case 'u': if (RegExp('.+[.。](ua|ug|uk|um|university|uno|uol|us|uy|uz)/?(/.+)?$').test(a)){ return true; }; break;\n /*V*/case 'v': if (RegExp('.+[.。](va|vacations|vc|ve|vegas|ventures|versicherung|vet|vg|vi|viajes|video|villas|vision|vlaanderen|vn|vodka|vote|voting|voto|voyage|vu)/?(/.+)?$').test(a)){ return true; }; break;\n /*W*/case 'w': if (RegExp('.+[.。](wales|wang|watch|webcam|website|wed|wedding|weir|wf|whoswho|wien|wiki|williamhill|win|wme|work|works|world|ws|wtc|wtf)/?(/.+)?$').test(a)){ return true; }; break;\n /*X*/case 'x': if (RegExp('.+[.。](xerox|xin|xxx|xyz)/?(/.+)?$').test(a)){ return true; }; break;\n /*Y*/case 'y': if (RegExp('.+[.。](yachts|yandex|ye|yodobashi|yoga|yokohama|youtube|yt)/?(/.+)?$').test(a)){ return true; }; break;\n /*Z*/case 'z': if (RegExp('.+[.。](za|zip|zm|zone|zuerich|zw)/?(/.+)?$').test(a)){ return true; }; break;\n }\n\n return false;\n}", "title": "" }, { "docid": "8a0591986b8332e5e0a6df18ccaa3d9b", "score": "0.5234968", "text": "function geturl(){\n var url = document.getElementById(\"urlinput\").value;\n var protocol_ok = url.startsWith(\"http://\") || url.startsWith(\"https://\");\n if(!protocol_ok){\n newurl = \"http://\"+url;\n return newurl;\n } else {\n return url;\n } \n}", "title": "" }, { "docid": "de08ed1cb0d521bcda12c907d2d60d23", "score": "0.52191603", "text": "function stringsEqual(xs, ys) {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (var i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "b9ec6c1aeff9d3502baee6e55a03fe20", "score": "0.52134866", "text": "function stripLeadingProtocolAndTrailingSlash(uri) {\n return uri.replace(/^(https?:\\/\\/)?(www\\.)?/, '').replace(/\\/$/, '');\n }", "title": "" }, { "docid": "b794e67303f842e7c4c84dc1a1e1c4d0", "score": "0.5196554", "text": "static isDockerServerMatch(a, b) {\n if (a === b) return true;\n if (a.includes(constants.defaultDockerHubHostname) && b.includes(constants.defaultDockerHubHostname)) return true;\n\n let reg = new RegExp(/^(?:https?:\\/\\/)?(.*?)\\/?$/);\n let aMatch = reg.exec(a);\n let bMatch = reg.exec(b);\n if (aMatch == null || bMatch == null) return false;\n return aMatch[1] === bMatch[1];\n }", "title": "" }, { "docid": "13e07bdf1084f8e2585d7c6862630ba9", "score": "0.518247", "text": "function isUrl(s) {\n\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n\treturn regexp.test(s);\n}", "title": "" }, { "docid": "df10995736f24e677b66ba155591dfd7", "score": "0.5178296", "text": "function appendHttps() {\n\tif (\n\t\tsiteUrlInput.value.includes('https://') ||\n\t\tsiteUrlInput.value.includes('http://')\n\t) {\n\t\tsiteUrlInput.value = siteUrlInput.value;\n\t} else {\n\t\tsiteUrlInput.value = 'https://' + siteUrlInput.value;\n\t}\n}", "title": "" }, { "docid": "85c64b85a62854ce3d06151eea82a07f", "score": "0.5175057", "text": "function isValidHttpUrl(string) {\r\n let url;\r\n\r\n try {\r\n url = new URL(string);\r\n } catch (_) {\r\n return false;\r\n }\r\n\r\n return url.protocol === \"http:\" || url.protocol === \"https:\";\r\n}", "title": "" }, { "docid": "891f80a2d9da6384783cba0317bf4da2", "score": "0.514762", "text": "function shouldBeBlocked(in_url) {\n // web_url will never have https or anything after .com\n var web_url = window.location.hostname;\n var splitted = in_url.split('/'); // split url from blocklist on forward slash\n //console.log(splitted);\n\n var firstfour_web_url = web_url.substring(0, 4);\n var firstfour_in_url = in_url.substring(0, 4);\n\n // check if http is in url. If yes, get only website url\n if (firstfour_in_url.localeCompare('http') === 0) {\n in_url = splitted[2];\n }\n\n if (web_url.localeCompare(in_url) === 0) {\n return 1;\n }\n // --- everything past here means in_url and web_url don't match ---\n\n // convert url to lowercase and try again\n in_url = in_url.toLowerCase();\n if (web_url.localeCompare(in_url) === 0) {\n return 1;\n }\n // add www. to in_url if it doesn't have it but web_url does\n else if (firstfour_web_url.localeCompare('www.') === 0) {\n in_url = 'www.' + in_url;\n if (web_url.localeCompare(in_url) === 0) {\n return 1;\n }\n }\n // remove www. from in_url if web_url doesn't have it\n else {\n in_url = in_url.substring(4); // get url after www.\n if (web_url.localeCompare(in_url) === 0) {\n return 1;\n }\n }\n return 0;\n\n}", "title": "" }, { "docid": "1e34652744c31b85f8a56331fd28df07", "score": "0.5091781", "text": "function omn_deleteHttp(url){\n var subString=\"\";\n var posicion= url.indexOf(\"http://\", 0);//search sub-string http:// in start of the string\n var posicionSSL= url.indexOf(\"https://\", 0);//search sub-string https:// in start of the string\n if(posicion==0){//if found, then delete the sub-string http\n subString= url.substring(7);\n url= subString;\n }\n if(posicionSSL==0){//if found, then delete the sub-string https\n subString= url.substring(8);\n url= subString;\n }\n return url;\n}", "title": "" }, { "docid": "1e34652744c31b85f8a56331fd28df07", "score": "0.5091781", "text": "function omn_deleteHttp(url){\n var subString=\"\";\n var posicion= url.indexOf(\"http://\", 0);//search sub-string http:// in start of the string\n var posicionSSL= url.indexOf(\"https://\", 0);//search sub-string https:// in start of the string\n if(posicion==0){//if found, then delete the sub-string http\n subString= url.substring(7);\n url= subString;\n }\n if(posicionSSL==0){//if found, then delete the sub-string https\n subString= url.substring(8);\n url= subString;\n }\n return url;\n}", "title": "" }, { "docid": "dae8873be8fb100459cdcd4e501d1fdb", "score": "0.5089779", "text": "function isUrl(s) {\n var regexp = /^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$/\n return regexp.test(s);\n }", "title": "" }, { "docid": "649608aae21c93e4dda0ffbf55293819", "score": "0.5084771", "text": "function validUrl() {\n var re = /^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;\n return re.test(urlText);\n }", "title": "" }, { "docid": "26206058dddcf258b11fba35f41a5f81", "score": "0.50836104", "text": "function addhttp(url) {\r\n if (!/^(f|ht)tps?:\\/\\//i.test(url) && \"\"!= url) {\r\n url = \"http://\" + url;\r\n }\r\n return url;\r\n}", "title": "" }, { "docid": "010e4cf7055880a5929c0ecb7671a95d", "score": "0.5079156", "text": "static isValidUrl(string) { try { new URL(string); } catch (_) { return false; } return true; }", "title": "" }, { "docid": "d3e60d83d190e643e0911af6fae5da37", "score": "0.50787127", "text": "function needtofix(link){\r\n\t//the set of wikipedia sister projects that support secure http\r\n\tvar keywords =\t'wikipedia,wiktionary,wikinews,wikibooks,wikiquote,wikisource,wikiversity,commons,species,meta';\r\n\tvar keyword = keywords.split(',');\r\n\tvar linkslash =link.split('/');\r\n\tvar domainlevel = '';\r\n\r\n\r\n\tif (linkslash[0]=='https:')\r\n\t\treturn false;\r\n\tif (linkslash.length > 1)\r\n\t\tdomainlevel = linkslash[2].split('.');\r\n\tif (domainlevel[0]=='www')\r\n\t\treturn false;\r\n\tfor(var i=0; i < keyword.length; i++){\r\n\t\tif (keyword[i] == domainlevel[1] || keyword[i] == domainlevel[0])\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "30ebfd112536c8f59f43495f1bb162c5", "score": "0.50615925", "text": "function isURL(s) {\n var regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(s);\n }", "title": "" }, { "docid": "544551fefa36844dc07fcf754aeb4838", "score": "0.50592273", "text": "function isOnline(){\n\t\tswitch(window.location.protocol) {\n\t\t case 'http:':\n\t\t \t\treturn true;\n\t\t case 'https:':\n\t\t \treturn true;\n\t\t case 'file:':\n\t\t \treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "74f376150f11a365c52fd24e59578161", "score": "0.5049986", "text": "function protocol(value) {\n var val = value.slice(-6).toLowerCase();\n return val === 'mailto' || val.slice(-5) === 'https' || val.slice(-4) === 'http';\n}", "title": "" }, { "docid": "74f376150f11a365c52fd24e59578161", "score": "0.5049986", "text": "function protocol(value) {\n var val = value.slice(-6).toLowerCase();\n return val === 'mailto' || val.slice(-5) === 'https' || val.slice(-4) === 'http';\n}", "title": "" }, { "docid": "c816516884793dcab8c36fd47e772a1b", "score": "0.50452733", "text": "function checkUrl(semver) {\n // check for anything that's <protocol>:\n // semver.startsWith(\"http:\") ||\n // semver.startsWith(\"https:\") ||\n // semver.startsWith(\"git:\") ||\n // semver.startswith(\"git+\") ||\n // semver.startsWith(\"github:\")\n // local links: symlink:, weaklink:, hardlink:\n\n const ix = semver.indexOf(\":\");\n if (ix > 1) {\n return semver.substr(0, ix);\n }\n\n //\n // check for github simple form, ie: `username/repo`\n // - it should not look like a path to a local package\n // - it's in the form of `x/y`\n //\n if (!isSemverLookLikePath(semver) && semver.indexOf(\"/\") > 1) {\n return \"github\";\n }\n\n return false;\n}", "title": "" }, { "docid": "f335906ffedda8aae55b7fd75c9b5c49", "score": "0.50420207", "text": "function isAbsoluteUrl(url: string): boolean {\n return /^https?:/.test(url);\n}", "title": "" }, { "docid": "f6c20e56a3a3c75cc71d9ed6fba4867d", "score": "0.5041128", "text": "function sameLength(str1, str2) {\r\n if (str1.length === str2.length) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "1200b3788e3a348d7491797aa241249a", "score": "0.5040961", "text": "checkURL(str) {\n try {\n new URL(string);\n return true;\n } catch (error) {\n return false;\n }\n }", "title": "" }, { "docid": "12cc1583467dc7e279f871e7a3d08185", "score": "0.50341874", "text": "function oneWay(str1, str2) {\n let lenDiff = Math.abs(str1.length - str2.length);\n if (lenDiff > 1) return false;\n\n let diffCount = 0;\n // for same str length, iterate each char one by one (no shifting needed)\n if (lenDiff === 0) {\n for (let i = 0; i < str1.length; i++) {\n if (str1[i] !== str2[i]) diffCount++;\n if (diffCount > 1) return false;\n }\n }\n // for str length diff of 1, after finding one diff instance, must shift index to check the rest.\n else {\n let smallerStr =\n str1.length < str2.length ? str1 : str2;\n let biggerStr = str1.length > str2.length ? str1 : str2;\n for (\n let i = 0, p = 0;\n i < smallerStr.length;\n i++, p++\n ) {\n if (smallerStr[i] !== biggerStr[p]) {\n diffCount++;\n if (diffCount > 1) return false;\n i--;\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "451df73de779462eb222698761922d0c", "score": "0.5027731", "text": "normalizeLink(inputStr) {\n if (inputStr?.includes('http') ||\n inputStr?.includes('tel:') ||\n inputStr?.includes('mailto:') ||\n inputStr == undefined) {\n return inputStr;\n }\n else {\n return `http://${inputStr}`;\n }\n }", "title": "" }, { "docid": "57b0071e48e87e255e5188d659b5ce7c", "score": "0.50245357", "text": "function checkCorrectPassword(prevLink) {\n if(document.URL!=prevLink) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "6123d96a29597d4a0256bbe4d32f94ff", "score": "0.50200486", "text": "function equalSpaceNormalized (string1, string2) {\r\n\tif (typeof string1 != \"string\" || typeof string2 != \"string\") return false\r\n\tvar str1 = string1.replace(/\\s+/ig,\" \")\r\n\tvar str2 = string2.replace(/\\s+/ig,\" \")\r\n\treturn str1 == str2\r\n}", "title": "" }, { "docid": "bfbf52faf4e1100d1a1a8b8b7e9cdc8f", "score": "0.5016124", "text": "function ajaxUtils_isHTTPReference(feedURL)\n{\n\tvar isHTTPReference = false;\n\tif (feedURL && feedURL.length)\n\t{\n\t\tisHTTPReference = ((feedURL.indexOf(\"http://\") != -1) || (feedURL.indexOf(\"https://\") != -1));\n\t}\n\treturn isHTTPReference;\n}", "title": "" }, { "docid": "b66da5efb547707cb1f47a9e5f652a65", "score": "0.50089586", "text": "function is_url(str)\n{\n regexp = /^(?:(?:https?):\\/\\/)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:\\/\\S*)?$/;\n if (regexp.test(str)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "d64f330d5462fa60841059dc7e2b6030", "score": "0.49897555", "text": "function equivalentDnsQueries(query1, query2) {\n var query1HexString = ArrayBuffers.arrayBufferToHexString(query1);\n var query2HexString = ArrayBuffers.arrayBufferToHexString(query2);\n return query1HexString.substring(7,query1HexString.length) ===\n query2HexString.substring(7,query2HexString.length);\n }", "title": "" }, { "docid": "0b7e7698cac4a9aefdb296ae1ce11e3e", "score": "0.49875167", "text": "function checkFileUrlsOrPath(s)\r\n {\r\n s = s.substr(0,1024)\r\n a = s.split(\"\\n\")\r\n for(var i = 0; i < a.length; i++)\r\n {\r\n if(a[i].match(/file\\:\\/\\/|\\/.*|\\\\.*|[A-Za-z]\\:\\\\.*/))\r\n return true;\r\n }\r\n return false;\r\n }", "title": "" } ]
1c86806a6860d9881eabb592454699fe
request a list of channels
[ { "docid": "e79d50670d5233055bd5aa070a6f53e4", "score": "0.68950695", "text": "function load_channels() {\n const request = new XMLHttpRequest();\n request.open('GET', '/channels');\n request.onload = () => {\n const data = JSON.parse(request.responseText);\n data.forEach(add_channel);\n };\n request.send();\n}", "title": "" } ]
[ { "docid": "65a5dfcd642d6895e080e04c7bd43cfa", "score": "0.7580498", "text": "function get_channels() {\n let req_channels = new XMLHttpRequest();\n req_channels.open(\"POST\", \"/all_channels\");\n\n req_channels.onload = () => {\n let data = JSON.parse(req_channels.responseText) \n if (data.success) {\n data.channels.forEach(channel => {\n create_new_channel(channel)\n })\n activate_channel(current_channel);\n }\n }\n req_channels.send();\n}", "title": "" }, { "docid": "7916309eb82e01b99367b3ebc2e41281", "score": "0.7509508", "text": "function listChannels(callback) {\n }", "title": "" }, { "docid": "75bf2da6ecff1928524b9ab6fc01d366", "score": "0.7309901", "text": "getChannels() {\n return __awaiter(this, void 0, void 0, function* () {\n this.validationClient();\n const page = yield this.client.getPublicChannelDescriptors();\n return this.sortChannelsByDate(this.sortChannelsByName(page.items).map(this.convertToChannel));\n });\n }", "title": "" }, { "docid": "5d0e4e74927836c7f99b2e1d34a18ef1", "score": "0.7291715", "text": "async queryChannels() {\n\t\t/**\n\t\t * @type {BuildProposalRequest}\n\t\t */\n\t\tconst buildProposalRequest = {\n\t\t\tfcn: GetChannels,\n\t\t\targs: [],\n\t\t};\n\t\treturn this.send(buildProposalRequest);\n\t}", "title": "" }, { "docid": "1e0373cc7e998383055ca21fefdaf3f3", "score": "0.71588534", "text": "list(/* paramN */) {\n const args = Array.prototype.slice.call(arguments);\n this.command_handler.cache('chanlist').channels = [];\n args.unshift('LIST');\n this.raw(args);\n }", "title": "" }, { "docid": "780924b87d4e1255523f743496e0e4e1", "score": "0.70805466", "text": "async listChannels() {\n console.debug(`Calling listChannels to ${this.getServiceUrl()} using username ${this._username}`);\n let resp = await this._restClient.get(\"channel/list\");\n if (resp.status != 200)\n throw new Error(`Error calling SPV Channels API. Invalid status code received: ${resp.status.toString()}`);\n return resp.data.channels;\n }", "title": "" }, { "docid": "bc782d71635a652500421e13bfaa91cd", "score": "0.69146794", "text": "function getChannels(req, res) {\n\tdb('channels')\n\t\t.select('*')\n\t\t.then((channel) => {\n\t\t\tres.status(200).json(channel);\n\t\t})\n\t\t.catch((err) => res.send(err));\n}", "title": "" }, { "docid": "2e91e9c60c5baa2df604bbb385ef9714", "score": "0.67971396", "text": "fetchChannels() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.channelIds) {\n return;\n }\n const channels = [];\n for (let i = 0; i < this.channelIds.length; i++) {\n channels.push(yield this.youtube.getChannel(this.channelIds[i]));\n }\n this.channels = channels;\n return this.channels;\n });\n }", "title": "" }, { "docid": "48faf2e8fc7696329c17704c83ced98b", "score": "0.6774465", "text": "get channels() {\n return Controller.list.filter(item => !item.isPrivate && item.connected);\n }", "title": "" }, { "docid": "f17cfd5fcdbe56563fd314e5c2e1ccea", "score": "0.6748953", "text": "function requestChannelLength() {\n //clearTimeout(initTimeoutid);\n var wixpcmd = new baseWIXPobject();\n wixpcmd.Cookie = 1050;\n wixpcmd.CmdType = \"Request\";\n wixpcmd.Fun = wixp.FUN_CHANNELLIST;\n wixpcmd.CommandDetails = {\n \"ContentLevel\": \"NumberOfChannels\",\n \"Filter\": filters\n };\n mRequestForNumberOfChannels = true;\n send2Queue(wixpcmd);\n}", "title": "" }, { "docid": "f659a555cd290a714fb7729464f2a537", "score": "0.66850185", "text": "async function channels(params) {\n const channels = Object.keys(retroList)\n if (channels.length === 0) {\n await params.say(':shrug: There are no retro sessions currently running.')\n return\n }\n\n return handleChannels(params)\n}", "title": "" }, { "docid": "768d0c350a3b7e949ad7a34892f2dd6a", "score": "0.6660331", "text": "getChannels () {\n return [\n {\n id: 1,\n name: 'HBO',\n number: 54\n },\n {\n id: 2,\n name: 'Cine Canal',\n number: 52\n }\n ];\n }", "title": "" }, { "docid": "bd2e935d3384ca61c18a9d02f78af97d", "score": "0.6651809", "text": "function listChannels (token, id) {\n\n var params = querystring.stringify({\n token : token\n });\n \n // Get channels from Slack API\n request({\n method : \"GET\",\n uri : \"https://slack.com/api/channels.list?\" + params\n }, \n function(err, res, d){\n if(err) throw err;\n\n // upsert channels list\n Database.upsert(slackMetaData, \n {\n channels : JSON.parse(d).channels\n },id);\n }\n );\n}", "title": "" }, { "docid": "ac1bf8e67dd86835c3abd27670d4a897", "score": "0.6643821", "text": "function notifyListChannels(callback) {\n validateArgs(arguments, \"notifyListChannels\", 1, 1, [null]);\n mc.notify.service.listChannels(function(error, channels) {\n callback.resume(error ? { message: error} : channels);\n });\n }", "title": "" }, { "docid": "31c0748a3b6d6802fce2fe711255e0ee", "score": "0.6633051", "text": "function getAllChannels(req, res, next) {\n db.any('SELECT \"sensorid\", \"channel\", \"power\", \"earfcn\", \"freq\", \"ch_scan_bw\", \"timestamp\", \"latitude\", \"longitude\", \"ant_height\" as \"antHeight\", \"ant_gain\" as \"antGain\", \"area_type\" as \"areaType\" from sensors')\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n channels: data,\n message: 'Retrieved all channles'\n });\n })\n .catch(function (err) {\n return next(err);\n });\n}", "title": "" }, { "docid": "fef477b01cc11e7189014300624896b0", "score": "0.6598272", "text": "static listAction(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('externalchannelprofile', 'list', kparams);\n\t}", "title": "" }, { "docid": "00f4c1785e68716f5c6deb1339307d96", "score": "0.6579395", "text": "getChannels() {\n var guild = this;\n return new Promise(function(resolve) {\n guild.client.getGuildChannels(guild.id).then(resolve);\n });\n }", "title": "" }, { "docid": "da4173e9d87a2ade588d36e22de815fd", "score": "0.6576881", "text": "function getChannelsSubscribed() {\n const options = {\n url: \"https://api.twitch.tv/helix/eventsub/subscriptions\",\n method: \"GET\",\n headers: {\n \"Client-ID\": process.env.TWITCH_CLIENT_ID,\n Authorization: `Bearer ${clientAuthToken}`,\n },\n params: {\n status: \"enabled\",\n },\n };\n\n axios(options)\n .then(function (response) {\n response.data.data.forEach(async function (value) {\n if (\n value.condition !== undefined &&\n value.condition.broadcaster_user_id !== undefined\n ) {\n const broadcaster_id = value.condition.broadcaster_user_id;\n channelsSubscribed[broadcaster_id] = {\n channel: await getChannelInformation(broadcaster_id),\n joined: false,\n };\n // TODO: Cache this information, so we don't have to call it everytime\n }\n });\n })\n .catch(logRequestError);\n}", "title": "" }, { "docid": "3a773ca4e8c1583981a5538d090dc100", "score": "0.656772", "text": "createChannels() {\n\t\tconst channels = this.state.channels;\n\t\tthis.props.request && \n\t\tthis.props.request.conversations.map(conv => {\n\t\t\tconst id = Object.values(conv);\t\t\t\n\t\t\tchannels.push(id[0])\t\t\t\n\t\t\treturn channels\n\t\t})\n\t\tthis.setState({channels})\t\t\n\t}", "title": "" }, { "docid": "b2fadd8f7ecec4ff275dfb4db0ad9476", "score": "0.6562008", "text": "function requestChannelSelection() {\n var wixpcmd = new baseWIXPobject();\n wixpcmd.Cookie = 1050;\n wixpcmd.CmdType = \"Request\";\n wixpcmd.Fun = wixp.FUN_CHANNELSELECTION;\n send2Queue(wixpcmd);\n}", "title": "" }, { "docid": "6f873ea16f2fb256ea71ee8bb01a51e9", "score": "0.6536702", "text": "function updateChannelList(channels) {\n channels.forEach(function(channel) {\n addChannel(channel);\n });\n}", "title": "" }, { "docid": "49a067a8636c7f5ea59fa0ac10343f0b", "score": "0.65314734", "text": "updateChannelLists () {\n clearTimeout(this.channelUpdateTimeout);\n\n this.broadcast({\n type: 'channels',\n channels: _.map(this.channels, (v) => {\n return {\n id : v.id,\n name : v.name,\n count : v.clients.length\n }\n })\n });\n\n this.channelUpdateTimeout = setTimeout(\n () => this.updateChannelLists(),\n 5 * 60 * 1000\n );\n }", "title": "" }, { "docid": "729d7ae509b725feb7f2930424e958b3", "score": "0.64914644", "text": "function execute() {\n return gapi.client.youtube.channels.list({\n \"id\": \"UC_x5XG1OV2P6uZZ5FSM9Ttw\"\n })\n .then(function(response) {\n // Handle the results here (response.result has the parsed body).\n console.log(\"Response\", response);\n },\n function(err) { console.error(\"Execute error\", err); });\n }", "title": "" }, { "docid": "5a6a6aed57b081bf754e85b2e50dff9c", "score": "0.6410936", "text": "function generate_channel_list(channels, nopresence) {\n\t\t var list = [];\n\t\t utils.each(channels, function (channel, status) {\n\t\t if (nopresence) {\n\t\t if (channel.search('-pnpres') < 0) {\n\t\t if (status.subscribed) list.push(channel);\n\t\t }\n\t\t } else {\n\t\t if (status.subscribed) list.push(channel);\n\t\t }\n\t\t });\n\t\t return list.sort();\n\t\t}", "title": "" }, { "docid": "6233b6f88ad65d1054f8b125ae8c92d3", "score": "0.64024925", "text": "getChannels () {\n unimplemented(this, 'getChannels')\n }", "title": "" }, { "docid": "729c1817ac23021182c549f52b1a33b3", "score": "0.63802534", "text": "function getCachedChannels() {\n return cachedListChannels;\n } //FETCHES PROGRAMS ON FOR A FILTER STRING AND RETURNED FORMATTED OBJECT", "title": "" }, { "docid": "65bd9154fb22d3c0702e29b4b498369b", "score": "0.636111", "text": "function addChannels (channels) {\n const select = document.querySelector(\"#channel_list\");\n for (let key in channels) {\n const option = document.createElement('option');\n option.innerHTML = key;\n select.add(option);\n }\n}", "title": "" }, { "docid": "78412390766d429d749cdde0ec0348d8", "score": "0.63144386", "text": "function handle_queryChannels(params, res, req) {\n\tlogger.debug('================ GET CHANNELS ======================');\n\n var body = {\n code : retCode.OK,\n msg : \"OK\",\n };\n\n\tlogger.debug('params= \\n', params);\n\n\tvar peer = params.peer;\n\n\tif (!peer) {\n\t\tpeer = 'peer0'\n\t}\n\n var username = params.usr;\n\tif (!username) {\n\t\tusername = 'admin'\n\t}\n\n var orgname = params.org;\n\tif (!orgname) {\n orgname = 'org1'\n\t}\n\n\treturn hfc_wrap.getChannels(peer, username, orgname)\n\t.then((response)=>{\n logger.debug('queryChannels success, response=', response)\n body.msg = 'ok'\n body.result = response\n res.send(body);\n })\n .catch((err)=>{\n logger.error('queryChannels failed, err=%s', err)\n body.code = retCode.ERROR\n body.msg = '' + err\n res.send(body);\n });\n}", "title": "" }, { "docid": "d3f53248cf05a83dd2680bcd4623ac91", "score": "0.6269161", "text": "function Channels( args ) {\n this.channels = {};\n}", "title": "" }, { "docid": "5b3a468ef7709dda65962ea4ea3f9ca0", "score": "0.6247424", "text": "static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\tkparams.pager = pager;\n\t\treturn new kaltura.RequestBuilder('channel', 'list', kparams);\n\t}", "title": "" }, { "docid": "d7f0276e4bedff6e692f050edd929ba2", "score": "0.62259656", "text": "function getList() {\n stream.send({ message:{\n request : \"list\"\n } \n });\n}", "title": "" }, { "docid": "fcf13aa05cd4eb499da71a32b3761c1f", "score": "0.62118405", "text": "function getStream(){\n channels.forEach(function(channel){\n getToTheData(channel);\n }); \n } //end getStream", "title": "" }, { "docid": "82fb86ea7d66451e11e5da5348debd38", "score": "0.6186757", "text": "getChannel() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.channelId) {\n return (_a = this.client) === null || _a === void 0 ? void 0 : _a.channels.fetch(this.channelId);\n }\n return undefined;\n });\n }", "title": "" }, { "docid": "4ae1f89e98a791092637360668b026d1", "score": "0.61519575", "text": "function getInputChannels() {\r\n\t\t\t filterDataFactory.getInputChannels()\r\n\t\t \t .success(function (inputChannelList) {\r\n\t\t \t $scope.inputChannelList = inputChannelList;\r\n\t\t \t })\t \r\n\t\t\t .error(function (error) {\r\n\t\t $scope.alert.msg = 'Unable to load input channel data: ' + error.message;\r\n\t\t });\r\n\t\t }", "title": "" }, { "docid": "08e98fa095d7b970187d7150d92a8624", "score": "0.6135754", "text": "function getStreams() {\r\n var stream = '';\r\n for (var i = 0; i < channels.length; i++) {\r\n stream = urlStreams + channels[i];\r\n getData(stream, checkOnline);\r\n }\r\n}", "title": "" }, { "docid": "24e8e7d9acf23b0bfe6d47df7396b14a", "score": "0.61196864", "text": "function listChannels(criterion) {\n /* sort channels by 'new', 'trending' or 'favorites' criteria */\n channels.sort(criterion);\n\n $('#channels ul').empty();\n\n for (var i=0; i < channels.length; i++) {\n console.log('add channel:', channels[i]);\n $('#channels ul').append(createChannelElement(channels[i]));\n };\n switchChannel(currentChannel, $(this));\n}", "title": "" }, { "docid": "b3ca9201e703b1dae96302c155c34dff", "score": "0.611793", "text": "function Channels() {\n this.channels = {};\n }", "title": "" }, { "docid": "cbddd51bd5a989648c4df2f0061e8277", "score": "0.6095798", "text": "function runChannels() {\n\tvar promises = [];\n\n\t//Create promise for each channel\n\tfor (var i = 0, len = TWITCH_TARGET_CHANNEL.length; i < len; i++) {\n\n\t\t//Add each promise to promise array\n\t\tpromises.push(new Promise(function (resolve, reject) {\n\t\t\t\tvar channelname = TWITCH_TARGET_CHANNEL[i];\n\t\t\t\t//Check channel status\n\t\t\t\ttwitchclient.api({\n\t\t\t\t\turl: \"https://api.twitch.tv/kraken/streams/\" + channelname,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t\"Client-ID\": TWITCH_APP_CLIENT_ID\n\t\t\t\t\t}\n\t\t\t\t}, function (err, res, body) {\n\n\t\t\t\t\tif (body[\"stream\"] == null) {\n\t\t\t\t\t\t//Channel is OFFLINE\n\t\t\t\t\t\tresult = 'offline';\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t//Channel is ONLINE\n\t\t\t\t\t\tresult = 'online';\n\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(result);\n\n\t\t\t\t})\n\t\t\t}));\n\t}\n\n\t//Execute all promises in promise array\n\t//results is an array of all the responses, in order\n\tPromise.all(promises).then(function (results) {\n\t\t//Check for any online channel\n\t\tif (_.indexOf(results, 'online') != (-1)) {\n\t\t\t//Upload online icon when necessary\n\t\t\tif (lasticon != \"online\") {\n\t\t\t\tdiscordclient.guilds.get(DISCORD_TARGET_GUILD_ID).setIcon(ICON_ONLINE)\n\t\t\t\t.then(updated => console.log('Updated the guild icon to online'))\n\t\t\t\t.catch (console.error);\n\t\t\t\t\n\t\t\t\t//Set last uploaded icon to online\n\t\t\t\tlasticon = \"online\";\n\t\t\t}\n\t\t} else {\n\t\t\t//Only upload offline icon when necessary\n\t\t\tif (lasticon != \"offline\") {\n\t\t\t\tdiscordclient.guilds.get(DISCORD_TARGET_GUILD_ID).setIcon(ICON_OFFLINE)\n\t\t\t\t.then(updated => console.log('Updated the guild icon to offline'))\n\t\t\t\t.catch (console.error);\n\t\t\t\t\n\t\t\t\t//Set last uploaded icon to offline\n\t\t\t\tlasticon = \"offline\";\n\t\t\t}\n\t\t}\n\n\t}, function (err) {\n\t\tconsole.log(err);\n\t});\n}", "title": "" }, { "docid": "aeafd5792ab018354e6c629cdb06ee29", "score": "0.6073671", "text": "function fchannelM() {\n var conName;\n var channelM;\n channelM = [];\n jq('.channelList').hide();\n jq(\".channelList input:checkbox:checked\").each(function() {\n channelM.push(jq(this).val());\n });\n conName = channelM.toString();\n createCustomChannels(conName);\n}", "title": "" }, { "docid": "6d7ccc8dc8208c45bda67bcc4d670977", "score": "0.6031471", "text": "searchChannels(options) {\n return __awaiter(this, void 0, void 0, function* () {\n options.query = encodeURIComponent(options.query);\n const query = \"?\" + util_1.parseOptions(options);\n const endpoint = `/search/channels${query}`;\n return this._get(endpoint);\n });\n }", "title": "" }, { "docid": "e5e92bd706284b23b2c9e8060b8d6e2a", "score": "0.5986594", "text": "getSubscriptions() {\n return this.realtime.channels;\n }", "title": "" }, { "docid": "34f704078dd476feffe393ae53da721b", "score": "0.597681", "text": "function getChannelsForGoogleUser(token, sendResponse, callback) {\n $.ajax({\n type: \"GET\",\n url: `https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true&access_token=${token}`,\n success: (data) => {\n if(!data.error) {\n callback(data);\n } else {\n // problem retrieving data from Youtube\n handleYTChannelConnectionFailure(sendResponse);\n }\n },\n error: () => {\n // request to Youtube failed\n handleYTChannelConnectionFailure(sendResponse);\n }\n });\n }", "title": "" }, { "docid": "9a8d50f8b370bf0656e60daf33170b77", "score": "0.59623784", "text": "static listAction(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('couponsgroup', 'list', kparams);\n\t}", "title": "" }, { "docid": "3187472207aa2c7845194dc18f5565db", "score": "0.5932464", "text": "getChannels() {\n throw new Error(\"Cannot return channels of abstract Task\");\n }", "title": "" }, { "docid": "ee1e94e06de21d3e14e5faf4ca95ac08", "score": "0.59186393", "text": "inputChannels() {}", "title": "" }, { "docid": "03d92a3ab64205962a3346951557a95d", "score": "0.5916307", "text": "function getChannelData() {\n if (Titanium.Network.online == true) {\n \n showMessage('Loading channel data...');\n \n xhr.open('POST', \"http://dev.vaultechnology.com/lm/services/json-rpc\");\n \n xhr.send({\n \"version\": \"1.1\", \n \"method\": \"views.get\", \n \"id\": Math.floor(Math.random()*1001),\n \"params\": JSON.stringify({\"view_name\":\"channel_data\",\"display_id\":\"Defaults\",\"args\":[\"1\"]})\n });\n \n } else {\n \n flashWarning('Unable to access netowrk');\n \n }\n}", "title": "" }, { "docid": "3ee4db8245e01a1fa88954b538982b4a", "score": "0.59133554", "text": "function getChannelsToJoin() {\n var chnls = [];\n var json = jsonParse(\"./userData/activeChannels.json\");\n for (var c in json.activeChannels) {\n //console.log(json.activeChannels[c].username);\n // TODO: if the username is active add to list, if not skip.\n chnls.push(json.activeChannels[c].username);\n }\n return chnls;\n}", "title": "" }, { "docid": "0961ba8905ce72160a5e8c21b10f55c0", "score": "0.591103", "text": "function channels(state, action) {\n\tstate = state || Set();\n\tswitch (action.type) {\n\t\t// case 'LOAD_CHANNELS':\n\t\t// \treturn Set.of();\n\t\t// case 'ADD_ITEM':\n\t\t// \treturn state.add(action.itemId);\n\t\t// case 'REMOVE_ITEM':\n\t\t// \treturn state.delete(action.itemId);\n\t\t// case 'CLEAR_ITEMS':\n\t\t// \treturn state.clear();\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}", "title": "" }, { "docid": "ffb0023446dbee1f82148edb82c1a86b", "score": "0.58903307", "text": "function getUserChannel() {\r\n // Also see: https://developers.google.com/youtube/v3/docs/channels/list\r\n var request = gapi.client.youtube.channels.list({\r\n // Setting the \"mine\" request parameter's value to \"true\" indicates that\r\n // you want to retrieve the currently authenticated user's channel.\r\n mine: true,\r\n part: 'id,contentDetails'\r\n });\r\n\r\n request.execute(function(response) {\r\n if ('error' in response) {\r\n displayMessage('Error, se requiere iniciar sesión');\r\n } else {\r\n // We need the channel's channel ID to make calls to the Analytics API.\r\n // The channel ID value has the form \"UCdLFeWKpkLhkguiMZUp8lWA\".\r\n channelId = response.items[0].id;\r\n // Retrieve the playlist ID that uniquely identifies the playlist of\r\n // videos uploaded to the authenticated user's channel. This value has\r\n // the form \"UUdLFeWKpkLhkguiMZUp8lWA\".\r\n \r\n \r\n var uploadsListId = response.items[0].contentDetails.relatedPlaylists.uploads;\r\n // Use the playlist ID to retrieve the list of uploaded videos.\r\n getPlaylistItems(uploadsListId);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "7a7b8adc41a6ce765034213444bfb662", "score": "0.58866185", "text": "getActiveVoiceChannels() {\n return Array.from(this.#channels.keys());\n }", "title": "" }, { "docid": "592fc1fc044454e12caee152291358bf", "score": "0.5885668", "text": "getVoiceChannels(server) {\n return server.channels.cache.filter((channel) => channel.type === \"voice\");\n }", "title": "" }, { "docid": "8d087d4e3e757fb2182f2a689dc99119", "score": "0.58784723", "text": "function getChannelsWithName(name) {\n return client.channels.filter(channel => channel.name === name);\n}", "title": "" }, { "docid": "bfe80497b068f5c87cfdcfb1b02be622", "score": "0.58782136", "text": "async function updateChannels(payload){\n\n\t// Populate dropbox with channel selections\n\tif (channelSelectBox.size == 0){\n\t\tvar channels = JSON.parse(payload.body);\n\t\tvar docfrag = document.createDocumentFragment();\n\t\t\n\t\t// General channel will always be visible, ID of 0\n\t\tvar messageUL = document.createElement('ul');\n\t\tmessageUL.setAttribute('id', 'messageArea0');\n\t\tmessageUL.setAttribute('class', 'hidden');\n\t\tmessageRoom.appendChild(messageUL);\n\t\tdocfrag.appendChild(new Option('General', '0'));\n\t\t\n\t\t\n\t\tfor(var i = 0; i < channels.length; i++){\n\t\t\tdocfrag.appendChild(new Option(channels[i].name, channels[i].id));\n\t\t\t\n\t\t\tmessageUL = document.createElement('ul');\n\t\t\tmessageUL.setAttribute('id', 'messageArea'+channels[i].id);\n\t\t\tmessageUL.setAttribute('class', 'hidden');\n\t\t\tmessageRoom.appendChild(messageUL);\n\t\t}\n\t\tmessageArea = document.querySelector('#messageArea0');\n\t\tdocument.querySelector('#messageArea0').setAttribute('class', 'list-unstyled');\n\t\t\n\t\tchannelSelectBox.appendChild(docfrag);\t\t\n\t\tchannelSub.unsubscribe();\n\t}\n\n}", "title": "" }, { "docid": "1fa034656a1c629657f1e1d88410635f", "score": "0.58724767", "text": "function listCommand(discordID, ircID) {\n if (discordID === 'DMserver') return;\n const nickname = ircDetails[discordID].ircDisplayName;\n const channels = discordClient.guilds.get(discordID).channels.array();\n let listResponse = [`:${configuration.ircServer.hostname} 321 ${nickname} Channel :Users Name\\r\\n`];\n\n channels.forEach(function(channel) {\n if (channel.type === 'text') {\n const channelname = channel.name,\n memberCount = channel.members.array().length,\n channeltopic = channel.topic;\n\n const channelDetails = `:${configuration.ircServer.hostname} 322 ${nickname} #${channelname} ${memberCount} :${channeltopic}\\r\\n`;\n listResponse.push(channelDetails);\n }\n });\n\n const endlist = `:${configuration.ircServer.hostname} 323 ${nickname} :End of channel list.\\r\\n`;\n\n listResponse.push(endlist);\n\n listResponse.forEach(function(line) {\n sendToIRC(discordID, line, ircID);\n });\n\n}", "title": "" }, { "docid": "535707bb47f78559a77ec6a07c68e37e", "score": "0.58671844", "text": "function getUserChannel() {\n\n container.classList.add(\"loading\");\n clearList();\n hideMessage();\n // Also see: https://developers.google.com/youtube/v3/docs/channels/list\n var request = gapi.client.youtube.channels.list({\n // Setting the \"mine\" request parameter's value to \"true\" indicates that\n // you want to retrieve the currently authenticated user's channel.\n mine: true,\n part: 'id,contentDetails'\n });\n\n request.execute(function(response) {\n if ('error' in response) {\n displayMessage(response.error.message);\n } else {\n // We need the channel's channel ID to make calls to the Analytics API.\n // The channel ID value has the form \"UCdLFeWKpkLhkguiMZUp8lWA\".\n myChannelId = response.items[0].id;\n // Retrieve the playlist ID that uniquely identifies the playlist of\n // videos uploaded to the authenticated user's channel. This value has\n // the form \"UUdLFeWKpkLhkguiMZUp8lWA\".\n var value = comboSelection.value;\n var uploadsListId = response.items[0].contentDetails.relatedPlaylists[value];\n // Use the playlist ID to retrieve the list of uploaded videos.\n getPlaylistItems(uploadsListId);\n }\n });\n }", "title": "" }, { "docid": "67cfbd0af0e8b6207fbb2c33e8d31bb7", "score": "0.5857841", "text": "choicesChannel() {\n\t\treturn Object.keys(this.state.channels).map((id) => {\n\t\t\treturn { id, label: this.state.channels[id].name }\n\t\t})\n\t}", "title": "" }, { "docid": "7eefa3500b6b9fc998e48bda61959f4a", "score": "0.5811729", "text": "function setChannels() {\n document.querySelector('#chnl1').addEventListener('click', onPlayChannel1);\n document.querySelector('#chnl2').addEventListener('click', onPlayChannel2);\n document.querySelector('#chnl3').addEventListener('click', onPlayChannel3);\n document.querySelector('#chnl4').addEventListener('click', onPlayChannel4);\n document.querySelector('#rchnl1').addEventListener('click', onRecordChannel1);\n document.querySelector('#rchnl2').addEventListener('click', onRecordChannel2);\n document.querySelector('#rchnl3').addEventListener('click', onRecordChannel3);\n document.querySelector('#rchnl4').addEventListener('click', onRecordChannel4);\n document.querySelector('#stopr').addEventListener('click', onStopRecord);\n}", "title": "" }, { "docid": "5943f0a8af4394ea3c217b4d97667d22", "score": "0.5795414", "text": "function channelServiceFunc($q, socketService) { \n var services = {\n getChannels: function () {\n var deferred = $q.defer();\n var channelsAll = [];\n\n socketService.emit('channel:get', '', function (channels) {\n angular.forEach(channels, function(v, k) {\n channelsAll.push({ id: k, name: v });\n });\n deferred.resolve(channelsAll);\n });\n \n return deferred.promise;\n }\n };\n\n return services;\n }", "title": "" }, { "docid": "53ee1fc66f2fda03a14952969a71d7ef", "score": "0.57699555", "text": "function sendMessageToChannels() {\n for(var i=0; i< activeChannels.length; i++) {\n const currentChannelObj = activeChannels[i];\n queryElasticSearch(currentChannelObj.searchQuery, currentChannelObj.filterQuery).then(function(response) {\n const totalHits = response.hits.hits.map(function(el) { return el._source});\n const responseObj = {\n channelName : currentChannelObj.channelName,\n // data : totalHits\n data : [{timestamp : 1499613990526 + (counterNew * 60000) , value : 100 + Math.floor(Math.random() * 1500)}]\n }\n counterNew++;\n socketConnection.emit('data', responseObj);\n console.log('Pushing data!!');\n }, function(err) {\n console.error(\"!!! Error Retrieving consecutive socket data form ES : \" + err);\n });\n\n }\n}", "title": "" }, { "docid": "86a695654fc5ef2d9ddc75232a88b0bf", "score": "0.5767432", "text": "function getchannels (user){\n\tvar dataChannel={};\n\t$.ajax({\n\t\turl:'https://wind-bow.gomix.me/twitch-api/channels/'+user+'?callback=?',\n\t\tdata:dataChannel,\n\t\tdataType:'jsonp',\n\t\tsuccess: function(dataChannel){\n\t\t \tif (dataChannel['status']===null) {\n\t\t \t\tdataChannel['status']=user\n\n\t\t \t}\n\t\t \tvar html=\"\"\n\t\t\thtml='<div class=\"container\" id=\"'+user+'\">'+\n\t \t\t \" <a href='\"+dataChannel['url']+\"'> <img src='\"+dataChannel['logo']+\"' alt='Avatar' style='width:90px'></a>\"+\n\t \t\t \"<p><span >\"+dataChannel['display_name']+\"</span><span>followers: \"+dataChannel['followers']+\"</span></p>\"+\n\t \t\t \"<p>Status: \"+dataChannel['status']+\"</p>\"\n\t \t\t +\"</div>\";\n\t\t\t$(\".listOfUsers\").append(html);\n \t\t\tvar line= document.getElementById(user);\n \t\t\t line.style.cssText=\"background: linear-gradient(rgba(67, 74, 84, 0.5),rgba(5, 14, 28, 0.8)) ,url(\"+dataChannel['profile_banner']+\") no-repeat center/cover\" ;\n\t\t\t}\n\t})\n\t}", "title": "" }, { "docid": "801dfcc24f3135f6d5e5d3c53660031f", "score": "0.5764821", "text": "function crawlSubscribedChannels()\r\n{\r\n\tperson.subscribersList = [];\r\n\tconst Http = new XMLHttpRequest();\r\n\tconst url= \"https://www.youtube.com/subscription_manager?action_takeout=1\";\r\n\tHttp.open(\"GET\", url);\r\n\tHttp.send();\r\n\tHttp.onreadystatechange = function () {\r\n\t\tif(this.readyState == HTTP_READYSTATE_DONE && this.status == HTTP_STATUS_OK){\t\r\n\t\t\tvar data = Http.responseText;\r\n\t\t\tvar regex_channelIDs = /channel_id=([^\"]+)\"/g;\r\n\t\t\tvar regex_channelNames = /title=\"([^\"]+)\"/g;\r\n\t\t\tvar channelIDs = getAllRegexMatches(regex_channelIDs, data);\r\n\t\t\tvar channelNames = getAllRegexMatches(regex_channelNames, data);\r\n\r\n\t\t\tconsole.log(\"Storing Subscribers\");\r\n\r\n\t\t\tfor (i=0; i<channelIDs.length; i++) {\r\n\t\t\t\tperson.subscribersList.push({\r\n\t\t\t\t\t'channelName': channelNames[i],\r\n\t\t\t\t\t'channelID': channelIDs[i],\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tDONE_STATUSES.SUBSCRIBERS_DONE = true;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "c316e0895f4afda786702a198c9ad032", "score": "0.573562", "text": "installedChannelsWithResources(state) {\n return state.channelList.filter(channel => channel.available);\n }", "title": "" }, { "docid": "acc155ef6a222cd16b4e68256c08fa13", "score": "0.5712703", "text": "async getChannelData(channelsList){\n\t\t//Build up a list of the IDs we want to get data for, separated by a comma\n\t\tvar channelIds = channelsList.map((channel) => channel.ChannelId).join();\n\t\t\n\t\t//Fetch the data and then fill out the objects\n\t\tvar youtubeChannelData = \n\t\t\tfetch(`https://www.googleapis.com/youtube/v3/channels?part=statistics&id=${channelIds}&key=${this.apiKey}`)\n\t\t\t.then(response => {\n\t\t\t\treturn response.json()\n\t\t\t})\n\t\t\t.then(data => {\n\t\t\t\tconsole.log(data);\n\n\t\t\t\t//Map the data from YouTube into a new array of channel objects\n\t\t\t\tvar channelData = data[\"items\"].map(item => \n\t\t\t\t{\n\t\t\t\t\t//Find the matching channel in the list that was provided\n\t\t\t\t\tvar matchedChannel = channelsList.find(channel => channel.ChannelId === item.id);\n\n\t\t\t\t\t//Create a new object combining existing config data and the data from the YouTube API\n\t\t\t\t\treturn {\n\t\t\t\t\tChannelId: item.id,\n\t\t\t\t\tLabel: matchedChannel.Label,\n\t\t\t\t\tSubscriberCount: item.statistics.subscriberCount,\n\t\t\t\t\tViewCount: item.statistics.viewCount,\n\t\t\t\t\tVideoCount: item.statistics.videoCount,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\treturn channelData;\n\t\t\t});\n\n\t\treturn youtubeChannelData;\n\t}", "title": "" }, { "docid": "1c5ab44b998aba7e727a6ab260df98f1", "score": "0.5710002", "text": "function refreshChannelInfo() {\n return __awaiter(this, void 0, void 0, function () {\n var resp, err_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, request('get', \"/channels/\" + apiData.value.channelID)];\n case 1:\n resp = _a.sent();\n if (resp.statusCode !== 200) {\n throw new Error(JSON.stringify(resp.body));\n }\n channelInfo.value = resp.body;\n channelInfoTO = setTimeout(refreshChannelInfo, 60 * 1000);\n return [3 /*break*/, 3];\n case 2:\n err_3 = _a.sent();\n // Try again after 10 seconds.\n nodecg.log.warn('[Twitch] Error getting channel information');\n nodecg.log.debug('[Twitch] Error getting channel information:', err_3);\n channelInfoTO = setTimeout(refreshChannelInfo, 10 * 1000);\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "0fb3318295206b846ce8cc0cb1c2b373", "score": "0.56802356", "text": "getChannelIDByName(name)\n {\n let deferred = promise.defer();\n let requestUrl = `https://api.twitch.tv/kraken/search/channels?query=${name}&client_id=${this._client_id}`;\n\n request(requestUrl, async (error, response) => {\n if (response.statusCode === 200) {\n deferred.resolve(response.body.channels && response.body.channels[0] ? response.body.channels[0] : null);\n } else {\n deferred.reject(response);\n }\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "73a27c0433a54f7e97077996a3fe4648", "score": "0.56050235", "text": "function setupChatroomChannels() {\n var domain = window.location.origin;\n var chatroomEnpoint = domain + \"/api/v1/chatrooms?api_key=\"+item_search_key;\n $.getJSON(chatroomEnpoint, function(data) {\n data.forEach(function(chatroom) {\n App['room' + chatroom.id ] = App.cable.subscriptions.create({\n channel: 'MessagesChannel',\n room: chatroom.id},\n {\n received: function(data) {\n var payload = JSON.parse(data.message)\n $(\"#messages\").append(payload[\"user\"] + \": \" + payload[\"message\"] + \"<br>\");\n $(\"#messages\").scrollTop($('#messages')[0].scrollHeight);\n },\n setChatroomId: function(chatroomId) {\n this.chatroomId = chatroomId\n }\n });\n })\n })\n}", "title": "" }, { "docid": "fd1f658494f7c8ec2e4a0016d50eaf17", "score": "0.55677056", "text": "function getTwitchData() {\n var providedChannelsArr = [\n \"ESL_SC2\",\n \"OgamingSC2\",\n \"cretetion\",\n \"freecodecamp\",\n \"storbeck\",\n \"habathcx\",\n \"RobotCaleb\",\n \"noobs2ninjas\",\n \"brunofin\",\n \"comster404\"\n ];\n providedChannelsArr.forEach(function(channel) {\n var apiUrl = 'https://wind-bow.hyperdev.space/twitch-api/streams/' + channel + '?callback=?';\n $.getJSON(apiUrl, function(data) {\n // Channel is offline\n if (data.stream === null) {\n buildOfflineChannel(channel);\n }\n // Account doesn't exist\n else if (data.stream === undefined) {\n buildClosedChannel(channel);\n }\n // Channel is online\n else {\n buildOnlineChannel(data);\n }\n });\n });\n}", "title": "" }, { "docid": "602675790c2eeb532566e4e07e94b987", "score": "0.5566565", "text": "function listChats() {\n // TODO - Return all public chats (from /chats) [RTC-1]\n return [];\n }", "title": "" }, { "docid": "ca24b408b50277fcba072ba960c823a8", "score": "0.5551931", "text": "async getChannel() {\n return await this._client.kraken.channels.getChannel(this);\n }", "title": "" }, { "docid": "a11dde852c30c49d52eb6ac0266c5dfb", "score": "0.5543251", "text": "function buildYTChannelDocuments(channelsFromAPI) {\n const channels = [];\n channelsFromAPI.forEach((el) => {\n channels.push({\n channelId: el.id,\n channelName: el.snippet.title,\n channelIcon: el.snippet.thumbnails.default.url\n });\n });\n return channels;\n }", "title": "" }, { "docid": "87197c74d22bcc047f7e4658fd71e3f6", "score": "0.5532522", "text": "static getChannel(key) {\n return this.channels[key]\n }", "title": "" }, { "docid": "f3338d3a1179f6429271ee59592a154b", "score": "0.5526788", "text": "function getChannelInfo() {\n channels.forEach(function(channel) {\n // Function to Make URL\n function makeURL(type,name) {\n return `https://twitch-proxy.freecodecamp.rocks/twitch-api/${type}/${name}?callback=?`;\n }\n\n // GET JSON for Streams \n $.getJSON(makeURL(\"streams\",channel), function(data) {\n let game,status;\n if (data.stream === null) {\n game = \"Offline\";\n status = \"offline\";\n } else if (data.stream === undefined) {\n game = \"Account Closed\";\n status = \"offline\";\n } else {\n game = data.stream.game;\n status = \"online\";\n }\n\n // GET JSON for Channels\n $.getJSON(makeURL(\"channels\",channel), function(data) {\n let logo = data.logo != null ? data.logo : \"https://www.dummyimage.com/50x50/000/fff.jpg&text=channel\",\n name = data.display_name != null ? data.display_name : channel,\n description = status === 'online' ? `: ${data.status}` : \"\";\n let html = `<article class=\"row players-${status}\">\n <article class=\"col-xs-2 col-sm-1\">\n <img src=\"${logo}\" alt=\"Channel Logo\"></article>\n <article class=\"col-sm-3 col-xs-10\" id=\"name\">\n <a href=\"${data.url}\" target=\"_blank\">${name}</a></article>\n <article class=\"col-xs-10 col-sm-8\" id=\"streaming\">${game}\n <span> ${description}</span></article></article>`;\n status === \"online\" ? $(\"#display\").prepend(html) : $(\"#display\").append(html);\n });\n\n });\n\n });\n }", "title": "" }, { "docid": "7849f1e92558ce7be289f85c35f00901", "score": "0.55230093", "text": "function displayList(data) {\n log('<kbd>Channel\\'s List','info');\n for(var val of data.room) {\n log(val, 'info');\n }\n}", "title": "" }, { "docid": "584723e96ec724419ab13f2c0da1a1e0", "score": "0.55218357", "text": "function refreshChannelInfo() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n try {\r\n const resp = yield request('get', `/channels/${apiData.value.channelID}`);\r\n if (resp.statusCode !== 200) {\r\n throw new Error(JSON.stringify(resp.body));\r\n }\r\n channelInfo.value = resp.body;\r\n channelInfoTO = setTimeout(refreshChannelInfo, 60 * 1000);\r\n }\r\n catch (err) {\r\n // Try again after 10 seconds.\r\n nodecg.log.warn('[Twitch] Error getting channel information');\r\n nodecg.log.debug('[Twitch] Error getting channel information:', err);\r\n channelInfoTO = setTimeout(refreshChannelInfo, 10 * 1000);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "fd28f9cb7ad3a98a8a1e97cabad531a0", "score": "0.5521655", "text": "function mapStateToProps ({channels, messages}) {\n console.log('channelList channels: ', channels)\n return {\n channels,\n messages\n }\n}", "title": "" }, { "docid": "d763c3c77d2ff64c246517ad8ec5e327", "score": "0.5520463", "text": "clearChannels() {\n for (let channel of this.channels) {\n channel.deleteChannel();\n }\n }", "title": "" }, { "docid": "ef8466439dff7e9cda4b4c8a725abc20", "score": "0.5498438", "text": "function listClients(commands)\n{\n\tlwm2mServer.listClients(resourceShow);\n}", "title": "" }, { "docid": "016be46099062e4045d3b640ffdc19ee", "score": "0.54908967", "text": "startConversationChannel(channelName) { //nameChannel\n this.setState({ actual: 'channel' });\n this.props.getChannels(channelName);\n }", "title": "" }, { "docid": "2d0852ed98ac4495a8dc22cfd2b0d06b", "score": "0.54857117", "text": "function channelSearch() {\n if (getUrlVars()['list'] == 'covers') {\n var channels = [\n 'UCplkk3J5wrEl0TNrthHjq4Q', //KurtHugoSchneider\n 'UCWrtsravWX0ANhHiJXNlyXw', //TheSamTsui\n 'UCmv1CLT6ZcFdTJMHxaR9XeA', //PTXofficial\n 'UCgc00bfF_PvO_2AvqJZHXFg', //boyceavenue\n 'UChWmYNTHQpLmJdkScwNrgcA', //megannicolesite\n 'UCLRpI5yd10aJxSel3e6MlNw', //gootmusic\n 'UCmKurapML4BF9Bjtj4RbvXw', //ThePianoGuys\n 'UCQIRM93QxhQ4pGm0cxuCXDw', //MaxSchneider1\n 'UC4vT3qTr8fwVS7IsPgqaGCQ', //TylerWardMusic\n 'UCZH4EVUqljV-zkZEd0Ot7EQ', //MadilynBailey\n 'UCyC_4jvPzLiSkJkLIkA7B8g', //lindseystomp\n 'UCgITW_70LNZFkNna7VsXbuQ' //peterhollens\n ];\n if (getUrlVars()['amount'] == 'all') {\n channels = channels.concat([\n 'UC9trcENZCwj4ZKIH1lm-WuQ', //Kurt\n 'UCUudDyi0JiVmSxarvU98YYQ', //zeldaxlove64\n 'UCxCSUWkrFwSnYxCOWO-dXtw', //officialcoreygray\n 'UCoZz9G7PyY9siwzOH8jFadg', //JuliaSheer\n 'UC7OlHCKh1QLUGpVfRQwKA-g', //miniachilles\n 'UCdAFRh3rxx0Q_xxkS2_N2PA', //Jayesslee\n 'UCrY87RDPNIpXYnmNkjKoCSw', //AlexGMusic7\n 'UCQIP6tGA4AQEIkABgb1AlhQ', //chestersee\n 'UCyJEAZW-4U9wK30v-OqG59g', //hoorahjencar\n 'UCznVM0EC0LnGxBZLwTqRIhg', //ahmirTV\n 'UCaaLeJT7Q6bh1XaHWzmRDCw', //jakecoco\n 'UCfYReF1e8lI85qH8FndkqBw', //BethOfficial\n 'UCwXrgBTQivCdSRBck6-oRYQ', //TannerPatrick\n 'UCR-ENZ64WL1vB8KU4YzdmTQ', //TiffanyAlvord\n 'UCj-ZvTVcl9mphVZiRlcNS-Q', //chrissycostanza\n 'UCVPbYft7bolH_jOEZ3Ec51A' //cimorellitheband\n ]); \n }\n } else if (getUrlVars()['list'] == 'fashion') {\n var channels = [\n 'UCRXiA3h1no_PFkb1JCP0yMA', //Americanvogue\n 'UCZyQcFvEE8VWNheDYyAHUzg', //wwd\n 'UCV8Do0nwSrYP7lwPBS4LWpw', //ElleMagazine\n 'UCk1IXTn78FtPm8p6ytbvwog', //style\n 'UC1QXhnP2qTw3ZbZ8Zikgz9w'/*, //victoriabeckham\n 'UCj6iVt0NLGyj406r2kD161g', //instyle\n 'UCZ8TREbPfawhSvayVe5pqKg', //vogue\n 'UCB_TGajnJymiSmu6zWkjW2Q', //wmagazinedotcom\n 'UClct1lanlIBzT7JUo2UQnjw', //WhoWhatWear\n 'UCli6Q1pd3DitknGEuMKnAVA', //Vogueparisfr\n 'UCzsF1ghKHeif7AmTNlRYAzQ', //harpersbazaar\n 'UCZprVLJfXNuCO50MAnXL_CQ', //netaporter\n 'UCsXb1jdMa3ybPw4eiT_2g-A', //NylonMagazineTV\n 'UCjZASCo852vWcsN8xRAOEWA', //cosmopolitan\n 'UCoc8tpGCY1wrp8pV7mI0scA' //hennesandmauritz\n */\n ];\n if (getUrlVars()['amount'] == 'all') {\n channels = channels.concat([\n ''\n ]);\n }\n } else if (getUrlVars()['list'] == 'blogosphere') {\n var channels = new Array (\n 'UCswDowOOvJ-fkCgH9YAITjQ', //upworthy \n 'UCL8Nxsa1LB9DrMTHtt3IKiw', //Mashable \n 'UCpko_-a4wgz2u_DgDgd9fqA', //BuzzFeedVideo \n 'UCK0z0_5uL7mb9IjntOKi5XQ', //TheAtlantic \n 'UCcyq283he07B7_KUX07mmtA', //Business Insider \n 'UCCjyq_K1Xwfg8Lndy7lKMpA', //TechCrunch \n 'UC-6OW5aJYBFM33zXQlBKPNA', //Engadget \n 'UCYGnmkFGP4EgAOqu58JA_lg', //Lifehacker \n 'UCUgrUBKwSnXwQOBG4v3igMg', //reddit \n 'UCay_OLhWtf9iklq8zg_or0g' //BuzzFeedYellow \n );\n } else {\n\n }\n \n // comment out for get channel ids\n for (i = 0; i < channels.length; i++) {\n search(channels[i]);\n }\n \n // get channel ids\n /*\n console.log('temp');\n for (i = 0; i < channels.length; i++) {\n var request = gapi.client.youtube.channels.list({\n part: 'snippet',\n forUsername: channels[i],\n maxResults: 5\n });\n //console.log(channels[i]);\n //https://www.googleapis.com/youtube/v3/channels?key=AIzaSyDGVGXXtr8g-z6pirjLe98-gDF5PavMHrg&forUsername= USERNAME &part=id\n request.execute(onChannelId);\n }\n */\n}", "title": "" }, { "docid": "7ad475f4e628b36d8a5c3a369e2eeffd", "score": "0.5476293", "text": "function requestUserUploadsPlaylistId() {\r\n \"use strict\";\r\n // See https://developers.google.com/youtube/v3/docs/channels/list\r\n var request = gapi.client.youtube.channels.list({\r\n mine: true,\r\n part: 'contentDetails'\r\n });\r\n}", "title": "" }, { "docid": "a282d00dd38528a033e5e4b5f7c2d553", "score": "0.5474337", "text": "componentDidMount() {\n //calling the function that gets the channedls\n this.loadChannels();\n }", "title": "" }, { "docid": "aa4c4dacf716423181625fc93a15ae3a", "score": "0.5465612", "text": "static listAction(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('devicefamily', 'list', kparams);\n\t}", "title": "" }, { "docid": "61e75db2dac635f54a61b775c410525a", "score": "0.54593337", "text": "static async list () {\n debug('list()')\n // Local Socket defined in folders and in project deps\n const localSocketsList = utils.listLocal()\n return Promise.all(localSocketsList.map((socketName) => Socket.get(socketName)))\n }", "title": "" }, { "docid": "f54aacece7363a5bfac14ff9a57deea7", "score": "0.54537773", "text": "renderChannels() {\n console.log('CHANNELS: ', this.props.channels);\n return _.map(this.props.channels, channel => {\n this.props.socket.emit('subscribe', channel.id);\n return (\n <Menu.Item \n key={channel.id}\n active={this.state.activeItem === channel.name}\n value={channel.id}\n name={channel.name}\n onClick={(e, d) => {\n this.handleItemClick(e, d),\n this.props.handleMessage(e, d); \n }}\n >\n {channel.name}\n </Menu.Item>\n );\n });\n }", "title": "" }, { "docid": "9876cc1947075185e3d012548427f0c0", "score": "0.54530716", "text": "_makeChannelsComponents() {\n \n //return an array of <Channel /> components\n return this.state.streamsDetails.map((streamsItem, index) => {\n\n let streamingState = streamsItem.stream ? \"online\" : \"offline\",\n channel = streamsItem.stream ? streamsItem.stream.channel : null,\n logoUrl = channel ? channel.logo : this.defaultLogo;\n\n // set title and description only when the channel is online\n let title = streamingState === \"online\" ? channel.game : \"\",\n description = streamingState === \"online\" ? channel.status : \"\";\n\n // when the channel is offline\n if (streamsItem.stream === null) {\n\n let startIndex = this.apiLink.length + 1;\n\n let channelName = streamsItem._links.self.substr(startIndex);\n \n return <Channel state={streamingState} url={\"https://twitch.tv/\" + channelName} logo={logoUrl} name={channelName}/>\n }\n\n //when the channel is closed\n if(streamsItem.stream === undefined) {\n return <Channel state=\"closed\" url=\"/\" name={this.streamers[index]} title=\"Account closed\" logo={logoUrl}/>\n }\n \n return <Channel state={streamingState} url={channel.url} logo={channel.logo} name={channel.display_name} title={title} description={description} />\n })\n }", "title": "" }, { "docid": "9c4c75724a648fcc82bee2f9da20f1c6", "score": "0.5451272", "text": "getHubs (token) {\n\n var url = this._config.endPoints.hubs\n\n return requestAsync({\n token: token,\n json: true,\n url: url\n })\n }", "title": "" }, { "docid": "3aa53da36a173266b87b8ce37ecc8765", "score": "0.5450771", "text": "getConversationsChats() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/conversations/chats', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}", "title": "" }, { "docid": "abfafeee19385b7e6ef6e9231eef9753", "score": "0.54413867", "text": "function checkAllChannels() {\n return ChannelService.find({ query: { $limit: 1000, twitchName: { $not: '' } } }) // Grab all the channels\n .then((channels) => channels.data)\n .then((channels) =>\n Promise.all(\n _.chain(channels)\n .map('twitchName')\n .map(checkChannel) // Map to promises that check to see if the channel is streaming\n .value())\n .then((streams) =>\n _.chain(channels)\n .zip(streams)\n .filter(_.spread((channel, stream) => channel.isStreaming !== stream.isStreaming || channel.twitchViewers !== stream.twitchViewers))\n .map(_.spread((channel, stream) => _.assign({ id: channel.id }, stream)))\n .value()))\n .then((updates) =>\n Promise.all(\n _.map(updates, (obj) => ChannelService.patch(obj.id, _.omit(obj, 'id')))))\n .then(() => app.logger.info('Successfully queried Twitch'), (err) => app.logger.error('Twitch service failed', err))\n // No matter what, set us up to check again in a few minutes\n .then(() => setTimeout(checkAllChannels, POLL_INTERVAL), () => setTimeout(checkAllChannels, POLL_INTERVAL));\n }", "title": "" }, { "docid": "c8e6fc59a48c0fa81c9f946920b053fe", "score": "0.54408675", "text": "connect() {\n let request = new ChannelStreamRequest();\n request.url = this.connectUrl;\n request.body = {\n username: this.username,\n channels: this.channels\n };\n for (let callable of this.mutators.connect) {\n callable(request);\n }\n request.handleError = this._handleConnectError.bind(this);\n request.handleResponse = this._handleConnect.bind(this);\n request.execute();\n }", "title": "" }, { "docid": "03827d24407f9d5a9b51e2f6d2285f11", "score": "0.5438147", "text": "function givechannelid()\n{\n\ttypeid=getrequest(\"typeid\");\n\turls=getrequest(\"imgurl\");\n\tif(typeid!=0)\n\t{\n\tgetallqi(typeid);\n\t}else\n\t{\n\tgetallchannel(lu_id);\n\t}\n}", "title": "" }, { "docid": "ce2749dbc04c2c92dd84a41163cfc2ff", "score": "0.54180735", "text": "static listAction(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('mediaconcurrencyrule', 'list', kparams);\n\t}", "title": "" }, { "docid": "a98c96797f04d76b914385bd9d5795cc", "score": "0.5411906", "text": "function requestDataList() {\n io.emit('data_list_request', { heartbeat: true });\n\t//console.log(\"Requesting Dataset List\");\n}", "title": "" }, { "docid": "3042c43e4d2e1c202845d3032b189fd6", "score": "0.54060847", "text": "function channelSetPrograms() {\r\n var deferred = $.Deferred(),\r\n actChannelCount = 0,\r\n actChannel = [],\r\n setId = currentSetId;\r\n\r\n nn.log(\"5: channelSetPrograms\");\r\n if (setId > 0) {\r\n $.each($page.removeList, function (i, channel) {\r\n if (channel > 0) {\r\n actChannel.push({\r\n chAction: \"DELETE\",\r\n chId: channel\r\n });\r\n }\r\n });\r\n\r\n $.each($page.addList, function (i, channel) {\r\n if (channel > 0) {\r\n actChannel.push({\r\n chAction: \"POST\",\r\n chId: channel\r\n });\r\n }\r\n });\r\n\r\n $page.removeList = [];\r\n $page.addList = [];\r\n\r\n actChannelCount = actChannel.length;\r\n\r\n if (actChannelCount > 0) {\r\n $.each(actChannel, function (i, channel) {\r\n\r\n nn.api(channel.chAction, cms.reapi('/api/sets/{setId}/channels', {\r\n setId: setId\r\n }), {\r\n channelId: channel.chId\r\n }, function (msg) {\r\n actChannelCount = actChannelCount - 1;\r\n if (actChannelCount === 0) {\r\n // update channelCnt\r\n nn.api('PUT', cms.reapi('/api/sets/{setId}', {\r\n setId: setId\r\n }), null, null);\r\n deferred.resolve();\r\n }\r\n });\r\n\r\n });\r\n } else {\r\n deferred.resolve();\r\n }\r\n } else {\r\n $page.removeList = [];\r\n $page.addList = [];\r\n\r\n deferred.resolve();\r\n }\r\n return deferred.promise();\r\n }", "title": "" }, { "docid": "ad0455e2456a6252ecbc1878dfbd8018", "score": "0.5391586", "text": "function getPickLists()\n{\n\tvar url =\"pickingqcmain.do?callback=popPickList&uAction=popPickList&hub=\" + $(\"hub\").value;\n\tcallToServer(url);\n}", "title": "" }, { "docid": "270616ae4cb51b758251f261436e2e9a", "score": "0.53882146", "text": "function requestNext() {\n channelFocus = true;//Settings the channel focus\n if (channelList.length == 0 || channeltuning == true) return;\n if (currentIndex >= channelList.length - 1) {\n currentIndex = 0;\n } else {\n currentIndex = getChannelIndex();\n currentIndex++;\n }\n showCurrentChannelSet(currentIndex);\n goto(currentIndex , \"\", true);\n}", "title": "" }, { "docid": "a3804a2ce1012116eab8f40710e5df10", "score": "0.5359736", "text": "updateSocketChannel() {\n for (let key in this.channels) {\n if (this.channels.hasOwnProperty(key)) {\n let channel = this.channels[key];\n channel.setSocket(this.ws);\n }\n }\n }", "title": "" }, { "docid": "0b5338fe744af68f73840b403d371171", "score": "0.53591245", "text": "function fetchProtocolList() {\n const transport = lookup('service:transport');\n return transport.send('/logcollection', {\n message: 'ls'\n });\n}", "title": "" }, { "docid": "6a95899ebc849a4e754517c862ddec50", "score": "0.5354136", "text": "function inChannel(requesterId, channelId, n=50, beforeId){\n return authenticate(requesterId)\n .then(() => {\n const q = SQL`\n SELECT * FROM message\n WHERE \"channelId\"=${channelId}\n `\n if(beforeId) q.append(SQL`AND id < ${beforeId}`)\n q.append(SQL`\n ORDER BY id DESC\n LIMIT ${n}\n `)\n return q\n })\n .then(query.many)\n}", "title": "" }, { "docid": "3c7b2e0434da7b9f9307392daa786674", "score": "0.5341068", "text": "function fetchProtectedChannels()\r\n{\r\n console.log(\"Fetching protected channels...\");\r\n dbo.collection(\"BindedChannels\").find({}).toArray(function(err, result) {\r\n if (err) throw err;\r\n protectedChannels = result;\r\n console.log(\"Channels fetched!\");\r\n });\r\n}", "title": "" }, { "docid": "936301cdd24fbe01fae26d3e257c3af7", "score": "0.5340722", "text": "static listAction(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('cdnadapterprofile', 'list', kparams);\n\t}", "title": "" } ]
a4e9a178da9f6005547b5853d831371f
Functions to set up serial port Lists ports available.
[ { "docid": "29de1f8cbbdc8f88d49d30844fc7fdc3", "score": "0.5645148", "text": "function printList(portList) {\n for (var i = 0; i < portList.length; i++) {\n print(i + \" \" + portList[i]);\n }\n}", "title": "" } ]
[ { "docid": "1efa7eb9a73ee300621f0fb587b45525", "score": "0.7548545", "text": "function setPortList() {\r\n // Fill in the port entries from the config object\r\n for (let port of Object.keys(config.portList).sort()) {\r\n portList.appendChild(makePortEntry(port, config.portList[port]))\r\n }\r\n\r\n // Add a blank port entry in the last row\r\n const blankPortEntry = makePortEntry('', '')\r\n portList.appendChild(blankPortEntry)\r\n\r\n // Focus on the port input field in the blank entry\r\n blankPortEntry.firstChild.focus()\r\n }", "title": "" }, { "docid": "7b3ac3105558e3be5f60d76c7731c798", "score": "0.69529766", "text": "async function listport(serial) {\n return serial.list()\n}", "title": "" }, { "docid": "d2a44f254965669458708a67f411b7e8", "score": "0.68702364", "text": "list() {\n\n return new Promise( function( resolve, reject ){\n SerialPort.list( function( err, ports ) {\n if( err ) {\n reject( err );\n }\n else {\n resolve( ports );\n }\n });\n });\n }", "title": "" }, { "docid": "4fc7dca9b483277b92950098c1667084", "score": "0.67926544", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n console.log(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "4fc7dca9b483277b92950098c1667084", "score": "0.67926544", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n console.log(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "84ce3156960b5d10f89c9211beb10c99", "score": "0.66768116", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n print(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "84ce3156960b5d10f89c9211beb10c99", "score": "0.66768116", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n print(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "1f46932d499801bf72d6046df77434b0", "score": "0.6643591", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n print(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "6a8ed9415a51a4fbbb163aee875dfd32", "score": "0.65605456", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {}\n }", "title": "" }, { "docid": "a0edb053c144e93aaa26a391a7f3008b", "score": "0.648699", "text": "function listArduinoPorts(callback) {\n return serialport.list(function(err, ports) {\n if (err) {\n return callback(err);\n }\n var devices = [];\n for (var i = 0; i < ports.length; i++) {\n if (/usb|acm|com\\d+/i.test(ports[i].comName)) {\n devices.push(ports[i].comName);\n }\n }\n return callback(null, devices);\n });\n}", "title": "" }, { "docid": "b84cc7a8f055c10393440b94a43d08ba", "score": "0.64669734", "text": "function sendChangedPorts() {\r\n config.portList = {}\r\n for (let i = 0; i < portList.children.length; i++) {\r\n const item = portList.children[i]\r\n if (item.tagName === 'LI') {\r\n const portInput = item.querySelector('.portNumber')\r\n const descriptionInput = item.querySelector('.portDescription')\r\n const port = (portInput && portInput.value) || ''\r\n const description = (descriptionInput && descriptionInput.value) || ''\r\n if (port) {\r\n config.portList[port] = description\r\n }\r\n }\r\n }\r\n ipcRenderer.send('portListChanged', JSON.stringify(config.portList))\r\n }", "title": "" }, { "docid": "2aa47ddcf770dc15d6c97e37f77b0a24", "score": "0.6389508", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n print(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "7fe3ff6d6d3e12883400db82307bcf78", "score": "0.63809854", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n print(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "a0a0462d557829d8602aa757d9786e26", "score": "0.63162005", "text": "function printList(portList) {\n // portList is an array of serial port names\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n print(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "0fddeecda2dfaf372b2b0a34c61cb732", "score": "0.61092263", "text": "function list(val) {\n print(\"Available ports:\");\n\n for (let i = 0; i < val.length; i++) {\n print(i + \" \" + val[i]);\n }\n}", "title": "" }, { "docid": "7c8bf9ecc60444da4c3c4d6c5a376b32", "score": "0.6058763", "text": "scanSerial(serial) {\n serial.list(\n (err, ports) => {\n var portSet = new Set();\n ports.forEach((port) => {\n // console.log(port.comName);\n // console.log(port.pnpId);\n // console.log(port.manufacturer);\n portSet.add(port.comName);\n });\n // console.log(\"==>\", this.state.ports, \"<==\");\n if (this.portChanged(this.state.ports, portSet)) {\n this.setState({\n ports: portSet\n });\n // console.log(\"changed\");\n }\n }\n );\n }", "title": "" }, { "docid": "8c42e5992659bcd55390b945d2bff134", "score": "0.5956474", "text": "async autoConnectAndOpenPreviouslyApprovedPort(serialOptions = { baudRate: 9600 }) {\n if (navigator.serial) {\n const approvedPortList = await navigator.serial.getPorts();\n console.log(\"approvedPortList\", approvedPortList);\n\n if (approvedPortList.length > 0) {\n console.log(\"Trying to auto-connect to:\", approvedPortList[0].getInfo());\n await this.connect(approvedPortList[0]);\n\n console.log(\"Attempting to open port:\")\n this.open(serialOptions);\n }\n }\n }", "title": "" }, { "docid": "a43134baa215c286647c74f9da59fb26", "score": "0.5844444", "text": "_findPort() {\n LOG.debug('Searching for port...');\n return SerialPort.list().then(ports => {\n LOG.debug('Listing available ports:', ports);\n return new Promise((resolve, reject) => {\n const port = ports.find(port => port.vendorId === HornbyConstants.VENDOR_ID);\n if (!port) {\n return reject(new Error('Did not find serial port with expected vendor id: ' + HornbyConstants.VENDOR_ID));\n }\n LOG.debug('Found port:', port);\n return resolve(port);\n });\n });\n }", "title": "" }, { "docid": "59a9615e3dff6bca8c6237f09b361ae5", "score": "0.5836147", "text": "function openPort() {\n console.log('Arduino serial port '+portName+' open');\n}", "title": "" }, { "docid": "4cd9e8785fbbdc1d09d19f623a760af9", "score": "0.58316165", "text": "makeConnection() {\n var self = this;\n SerialPort.list((err, ports) => {\n\n // This if is triggered when there is no ports or any error is throwed\n if (err || ports.length === 0) {\n this.arduinoPortName = FIND_PORT_ERROR;\n this.triggerEvent('connectionStateChange',FIND_PORT_ERROR);\n return;\n }\n\n ports.forEach((port) => {\n // Where he should put a condition to identify microncontroller\n if (port['manufacturer'] === \"wch.cn\") {\n this.arduinoPortName = port[\"comName\"].toString();\n this.serialPort = new SerialPort(this.arduinoPortName, {\n buadRate: this.baudRate\n });\n this.triggerEvent('connectionStateChange',CONNECTED);\n this.parser = this.serialPort.pipe(new Readline());\n }\n });\n\n // Listeners defenitions\n this.parser.on('data', function (data) {\n self.triggerEvent(\"dataReceived\", data);\n });\n\n this.serialPort.on('close', function(){\n self.triggerEvent('connectionStateChange',FIND_PORT_ERROR);\n });\n });\n }", "title": "" }, { "docid": "8849bfa27fe91b1927b7775de3f4b464", "score": "0.57182986", "text": "function openPort() {\n var macAddress = \"B8:27:EB:B3:1B:FA\";\n // if you get a good Bluetooth serial connection:\n display(\"Connecté à: \" + macAddress);\n // set up a listener to listen for newlines\n // and display any new data that's come in since\n // the last newline:\n bluetoothSerial.subscribe('\\n', function (data) {\n clear();\n display(data);\n });\n setTimeout(function() { send(); }, 2000);\n\n }", "title": "" }, { "docid": "b54ba7463cd240a492e2982cb72bac68", "score": "0.5674872", "text": "function setupListeners() {\n jazzInstance.OnDisconnectMidiIn(function (name) {\n var port = getPortByName(midiInputs, name);\n if (typeof port !== 'undefined') {\n port.state = 'disconnected';\n port.close();\n port._jazzInstance.inputInUse = false;\n midiInputs.delete(port.id);\n dispatchEvent(port);\n }\n });\n\n jazzInstance.OnDisconnectMidiOut(function (name) {\n var port = getPortByName(midiOutputs, name);\n if (typeof port !== 'undefined') {\n port.state = 'disconnected';\n port.close();\n port._jazzInstance.outputInUse = false;\n midiOutputs.delete(port.id);\n dispatchEvent(port);\n }\n });\n\n jazzInstance.OnConnectMidiIn(function (name) {\n createMIDIPort('input', name, function (port) {\n dispatchEvent(port);\n });\n });\n\n jazzInstance.OnConnectMidiOut(function (name) {\n createMIDIPort('output', name, function (port) {\n dispatchEvent(port);\n });\n });\n}", "title": "" }, { "docid": "2799914886bbc00a0a30b85263821a71", "score": "0.5670456", "text": "function showPortItems (rowId)\n{\n var comboAddId = \"\";\n var i = 0;\n var j = 0;\n var nInstanceCount = 0;\n var portItemCount = 0;\n var spanObj = null;\n var tableId = \"\";\n var tableObj = null;\n var trObj = null;\n var type = \"\";\n var strDynDisable\t= \"N\";\n\n var instancePropSet = m_UIFramework.m_controlPropSet.GetChildByType (rowId);\n var fieldListPropSet = new JSSCfgPropertySet ();\n var strFieldList = instancePropSet.GetProperty (\"FieldList\");\n fieldListPropSet.DecodeFromString (strFieldList); \n \n tableId = instancePropSet.GetProperty (\"Parent Path\") + _underscore + \"PORTITEM\" + _pipe +\n instancePropSet.GetProperty (\"Port Item Id\");\n comboAddId = instancePropSet.GetProperty (\"Parent Path\") + _underscore + \"PORT\" + _pipe +\n instancePropSet.GetProperty (\"Port Item Id\"); \n \n //the table for Port Items are already created.\n tableObj = document.getElementById (tableId);\n \n comboAddPS = m_UIFramework.m_controlPropSet.GetChildByType (comboAddId);\n portItemCount = comboAddPS.GetProperty (\"PortItemCount\");\n if (portItemCount == \"0\")\n {\n //Set up the field headers\n trObj = tableObj.insertRow (-1);\n trObj.id = tableId + _underscore + \"FIELDHEADER\";\n displayFieldHeader (trObj, fieldListPropSet); \n }\n portItemCount++;\n comboAddPS.SetProperty (\"PortItemCount\", portItemCount); \n \n var domainPropSet = comboAddPS.GetChildByType (\"Domain\");\n strDynDisable = domainPropSet.GetProperty (\"DynDisable\");\n \n if(strDynDisable == \"Y\")\n instancePropSet.SetProperty (\"DynDisable\", \"Y\"); \n\n addPortItem (tableId, instancePropSet);\n}", "title": "" }, { "docid": "a8eae985887514215190721be882c617", "score": "0.5664502", "text": "function setupListeners() {\n jazzInstance.OnDisconnectMidiIn(function (name) {\n var port = getPortByName(midiInputs, name);\n if (port !== undefined) {\n port.state = 'disconnected';\n port.close();\n port._jazzInstance.inputInUse = false;\n midiInputs['delete'](port.id);\n dispatchEvent(port);\n }\n });\n\n jazzInstance.OnDisconnectMidiOut(function (name) {\n var port = getPortByName(midiOutputs, name);\n if (port !== undefined) {\n port.state = 'disconnected';\n port.close();\n port._jazzInstance.outputInUse = false;\n midiOutputs['delete'](port.id);\n dispatchEvent(port);\n }\n });\n\n jazzInstance.OnConnectMidiIn(function (name) {\n createMIDIPort('input', name, function (port) {\n dispatchEvent(port);\n });\n });\n\n jazzInstance.OnConnectMidiOut(function (name) {\n createMIDIPort('output', name, function (port) {\n dispatchEvent(port);\n });\n });\n }", "title": "" }, { "docid": "30a95150536fad7c429bebc7ac728a72", "score": "0.5661239", "text": "function printList(portList) {\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n println(i + \" \" + portList[i]);\n }\n}", "title": "" }, { "docid": "751e0d7b94cbe59db5603ec90f079759", "score": "0.5655467", "text": "changePort(port) {\n this.closePort();\n\n this.port = new SerialPort(port, {\n 'baudRate': 250000,\n 'dataBits': 8,\n 'stopBits': 2,\n 'parity': 'none'\n });\n }", "title": "" }, { "docid": "83410eba3e3a2fb30f77db4491e05273", "score": "0.56339556", "text": "async function fetchPorts() {\n const res = await fetch(API_Route + \"/ports\");\n const content = await res.json();\n setPorts(JSON.parse(content).port);\n }", "title": "" }, { "docid": "4e31482aad70e67670eaf039e252cd07", "score": "0.56042826", "text": "enterPorts(ctx) {\n\t}", "title": "" }, { "docid": "72e9ac8c668039306449a3c9712b72dc", "score": "0.5600997", "text": "function connectSerial(options){\r\n var autoDetect = false;\r\n var stat = false;\r\n\r\n // Attempt to auto detect EBB Board via PNPID\r\n if (gConf.get('serialPath') == \"\" || gConf.get('serialPath') == '{auto}') {\r\n autoDetect = true;\r\n console.log('Finding available serial ports...');\r\n } else {\r\n console.log('Using passed serial port \"' + gConf.get('serialPath') + '\"...');\r\n }\r\n\r\n require(\"serialport\").list(function (err, ports) {\r\n var portNames = ['None'];\r\n console.log('Full Available Port Data:', ports);\r\n for (var portID in ports){\r\n portNames[portID] = ports[portID].comName;\r\n\r\n // Sanity check manufacturer (returns undefined for some devices in Serialport 1.2.5)\r\n if (typeof ports[portID].manufacturer != 'string') {\r\n ports[portID].manufacturer = '';\r\n }\r\n\r\n // Specific board detect for linux\r\n if (ports[portID].pnpId.indexOf(botConf.get('controller').name) !== -1 && autoDetect) {\r\n gConf.set('serialPath', portNames[portID]);\r\n // All other OS detect\r\n } else if (ports[portID].manufacturer.indexOf(botConf.get('controller').manufacturer) !== -1 && autoDetect) {\r\n gConf.set('serialPath', portNames[portID]);\r\n }\r\n }\r\n\r\n console.log('Available Serial ports: ' + portNames.join(', '));\r\n\r\n // Try to connect to serial, or exit with error codes\r\n if (gConf.get('serialPath') == \"\" || gConf.get('serialPath') == '{auto}') {\r\n console.log(botConf.get('controller').name + \" not found. Are you sure it's connected? Error #22\");\r\n if (options.error) options.error(botConf.get('controller').name + ' not found.');\r\n } else {\r\n console.log('Attempting to open serial port: \"' + gConf.get('serialPath') + '\"...');\r\n try {\r\n serialPort = new SerialPort(gConf.get('serialPath'), {\r\n baudrate : Number(botConf.get('controller').baudRate),\r\n parser: serialport.parsers.readline(\"\\r\")\r\n });\r\n\r\n if (options.connect) serialPort.on(\"open\", options.connect);\r\n if (options.disconnect) serialPort.on(\"close\", options.disconnect);\r\n\r\n console.log('Serial connection open at ' + botConf.get('controller').baudRate + 'bps');\r\n pen.simulation = 0;\r\n if (options.success) options.success();\r\n } catch(e) {\r\n console.log(\"Serial port failed to connect. Is it busy or in use? Error #10\");\r\n console.log('SerialPort says:', e);\r\n if (options.error) options.error(e);\r\n }\r\n }\r\n\r\n // Complete callback\r\n if (options.complete) options.complete(stat);\r\n });\r\n}", "title": "" }, { "docid": "eee5ba90b35c4d0324b0ee4c2926847e", "score": "0.55971014", "text": "portOpen(baudRate, dataBits, parity, stopBits, flowControl, callback = null) {\r\n const device = new this.serial(this.portNum, {\r\n baudRate: baudRate,\r\n dataBits: dataBits,\r\n parity: parity,\r\n stopBits: stopBits,\r\n flowControl: flowControl\r\n });\r\n this.port = device;\r\n var self = this;\r\n\r\n self.port.on('open', function(error) {\r\n // var res = false;\r\n if (error) {\r\n console.log(\">serial_port: open error\");\r\n } else {\r\n if (callback != null) {\r\n // console.log(device.path);\r\n callback(self.port);\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "88f4c437616628d731da895ed5854369", "score": "0.55970144", "text": "function gotList(thelist) {\n // theList is an array of their names\n for (let i = 0; i < thelist.length; i++) {\n // Display in the console \n print(thelist[i]); \n if(thelist[i].startsWith('/dev/tty.usbmodem')) {\n portName = thelist[i];\n }\n }\n}", "title": "" }, { "docid": "089e05abc27a75527c0bfc47f9eed84b", "score": "0.5550674", "text": "_openClusterPortListeners()\n {\n const ports = {};\n const clusterPorts = this.config.CLUSTERPORTS || \"\";\n log(`Listen to cluster ports: ${clusterPorts}`);\n const a = clusterPorts.split(\",\");\n a.forEach( item => {\n if (item.indexOf(\"-\") > -1) {\n /* Port ranges */\n const b = item.split(\"-\");\n for (let i = parseInt(b[0]); i<=parseInt(b[1]); i++) {\n ports[i] = true;\n }\n }\n else {\n /* Single port */\n ports[parseInt(item)] = true;\n }\n });\n\n const uniquePorts = Object.keys(ports).map( Number );\n\n this.clusterPortListeners = uniquePorts.map( port => {\n try {\n const config = {\n host: this.config.HOST,\n port: port\n };\n const clusterPortListener = new TCPServer(config);\n clusterPortListener.listen();\n clusterPortListener.onConnection( clusterPortSocket => this._handleClusterPortConnection(clusterPortSocket, port) );\n return clusterPortListener;\n }\n catch(e) {\n logError(`Could not listen to cluster port ${this.config.HOST}:${port}`);\n }\n\n return null;\n }).filter( listener => listener !== null );\n }", "title": "" }, { "docid": "829be364dc22bbbe7564a5883b85dead", "score": "0.55034775", "text": "function addReceivers(ports) {\n if ('log' in ports) {\n ports.log.subscribe(function(v) { console.log(v) });\n }\n if ('stdout' in ports) {\n var process = process || {};\n var handler = process.stdout\n ? function(v) { process.stdout.write(v); }\n : function(v) { console.log(v); };\n ports.stdout.subscribe(handler);\n }\n if ('stderr' in ports) {\n var process = process || {};\n var handler = process.stderr\n ? function(v) { process.stderr.write(v); }\n : function(v) { console.log('Error:' + v); };\n ports.stderr.subscribe(handler);\n }\n if ('title' in ports) {\n if (typeof ports.title === 'string') {\n document.title = ports.title;\n } else {\n ports.title.subscribe(function(v) { document.title = v; });\n }\n }\n if ('redirect' in ports) {\n ports.redirect.subscribe(function(v) {\n if (v.length > 0) window.location = v;\n });\n }\n if ('favicon' in ports) {\n if (typeof ports.favicon === 'string') {\n changeFavicon(ports.favicon);\n } else {\n ports.favicon.subscribe(changeFavicon);\n }\n }\n function changeFavicon(src) {\n var link = document.createElement('link');\n var oldLink = document.getElementById('elm-favicon');\n link.id = 'elm-favicon';\n link.rel = 'shortcut icon';\n link.href = src;\n if (oldLink) {\n document.head.removeChild(oldLink);\n }\n document.head.appendChild(link);\n }\n }", "title": "" }, { "docid": "d77ea67170244989a41253671c7a3639", "score": "0.54940856", "text": "function _setupSerialConnection() {\n var port = availablePorts[0];\n\n debug.log('Trying to connect to Smart Meter via port: ' + port);\n\n // Go to the next port if this one didn't respond within the timeout limit\n timer = setTimeout(function() {\n if (!serialPortUsed) {\n _tryNextSerialPort();\n }\n }, config.connectionSetupTimeout);\n\n // Open serial port connection\n var sp = new serialPort(port, config.serialPort);\n\n var received = '';\n\n sp.on('open', function () {\n debug.log('Serial connection established');\n\n sp.on('data', function (data) {\n received += data.toString();\n\n var startCharPos = received.indexOf(config.startCharacter);\n var endCharPos = received.indexOf(config.stopCharacter);\n\n // Package is complete if the start- and stop character are received\n if (startCharPos >= 0 && endCharPos >= 0) {\n var packet = received.substr(startCharPos, endCharPos - startCharPos);\n var parsedPacket = parsePacket(packet);\n\n received = '';\n\n // Verify if connected to the correct serial port at initialization\n if (!serialPortUsed) {\n if (parsedPacket.timestamp !== null) {\n debug.log('Connection with Smart Meter established');\n serialPortUsed = port;\n\n constructor.emit('connected', port);\n } else {\n _tryNextSerialPort();\n }\n }\n\n debug.writeToLogFile(packet, parsedPacket);\n\n constructor.emit('reading-raw', packet);\n\n if (parsedPacket.timestamp !== null) {\n constructor.emit('reading', parsedPacket);\n } else {\n constructor.emit('error', 'Invalid reading');\n }\n }\n });\n });\n\n sp.on('error', function (error) {\n constructor.emit('error', error);\n\n // Reject this port if we haven't found the correct port yet\n if (!serialPortUsed) {\n _tryNextSerialPort();\n }\n });\n\n sp.on('close', function () {\n constructor.emit('close');\n });\n}", "title": "" }, { "docid": "2ac8f1be5fa3784b297c1b4bdaef4236", "score": "0.54888076", "text": "function gotList(thelist) {\n\n console.log(\"Got List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n console.log(i + \" \" + thelist[i]);\n }\n}", "title": "" }, { "docid": "0dfdfb45c11152dbfb4c3893a878c3f5", "score": "0.54798436", "text": "function updateDeviceList() {\n /* Clear device list */\n let table = document.getElementById('bt_dev_list');\n while(table.rows[0]) table.deleteRow(0);\n\n /* launch `mrbwrite list` */\n let cmd = getToolPath() + '/mrbwrite list 3000';\n launchApplication(cmd, function(error, stdout, stderr) {\n if (stdout !== null) {\n devs = stdout.split(/\\n/);\n devs.forEach(line => {\n dev = line.split(':'); /* [0]:addr, [1]:name */\n /* format device address */\n if (dev.length >= 2) {\n addrs = [];\n for (hex=dev[0]; hex; hex=hex.substr(2)) {\n addrs.push(hex.substr(0, 2));\n }\n /* Add device list */\n addBTDevice({name: dev[1], addr: addrs.join(':')});\n }\n });\n }\n console.log('stderr: ' + (stderr||'none'));\n if (error !== null) console.log('exec error: '+error);\n });\n}", "title": "" }, { "docid": "c4f9cc2d13a374e3347ede1876a8fb55", "score": "0.5445112", "text": "open( port ) {\n\n var me = this;\n\n return new Promise( function( resolve, reject ){\n \n let serialOptions = {\n baudRate: me.options.baudRate\n };\n\n // Do this last, since the caller will have their callback called\n // when the port is opened\n me.port = new SerialPort( port, serialOptions, function( err ) {\n\n if( err ) {\n me.emit( 'error', err );\n reject( err );\n }\n else {\n me.emit( 'open' );\n\n me.configure()\n .then( function() {\n\n // board configured, now do CAN instance\n return me.can1.configure();\n })\n .then( function() {\n // if second instance, configure it\n if( me.can2 ) {\n return me.can2.configure();\n }\n })\n .then( function() {\n // success!\n resolve();\n })\n .catch( function(err) {\n // configure failed\n reject( err );\n });\n }\n\n });\n\n me.parser = me.port.pipe( new JcomParser() ); \n\n // call the onData function when data is received\n me.parser.on('data', me.onData.bind(me));\n\n // Call event handler on serial port error\n me.port.on( 'error', me.onSerialError.bind(me));\n\n });\n\n }", "title": "" }, { "docid": "b961956cb5bfeba5b4ba079930b0e118", "score": "0.5397592", "text": "function onAddClick(e) {\r\n // Create a new, blank port entry for user input of a new port\r\n const portEntry = makePortEntry('', '')\r\n // Insert the new entry to the end of the port list\r\n portList.appendChild(portEntry, portList.firstChild)\r\n // Focus on the Port input field in the entry that was just added\r\n portEntry.firstChild.focus()\r\n }", "title": "" }, { "docid": "d09a887a26388b34456b421676c285b4", "score": "0.53821784", "text": "function open() {\n print(\"Serial port open\");\n}", "title": "" }, { "docid": "d6ecc50b04f9da2822b135d7e6d6a43d", "score": "0.53806317", "text": "async function connect() {\n\n //Optional filter to only see relevant boards\n const filter = {\n usbVendorId: 0x2341 // Arduino SA\n };\n\n //Try to connect to the Serial port\n try {\n port = await navigator.serial.requestPort(/*{ filters: [filter] }*/);\n // Continue connecting to |port|.\n\n // - Wait for the port to open.\n await port.open({ baudRate: 1200 });\n await port.setSignals({ dataTerminalReady: true });\n\n statusBar.innerText = \"Connected\";\n connectButton.innerText = \"Disconnect\"\n\n let decoder = new TextDecoderStream();\n inputDone = port.readable.pipeTo(decoder.writable);\n inputStream = decoder.readable;\n\n const encoder = new TextEncoderStream();\n outputDone = encoder.readable.pipeTo(port.writable);\n outputStream = encoder.writable;\n \n writeToByte(\"0x00, 0x02\");\n writeToByte(\"0x02, 0x00\");\n\n $('#winkey_buttons').show();\n\n reader = inputStream.getReader();\n readLoop();\n } catch (e) {\n //If the pipeTo error appears; clarify the problem by giving suggestions.\n if (e == \"TypeError: Cannot read property 'pipeTo' of undefined\") {\n e += \"\\n Use Google Chrome and enable-experimental-web-platform-features\"\n }\n connectButton.innerText = \"Connect\"\n statusBar.innerText = e;\n }\n}", "title": "" }, { "docid": "3f635037edafcd4b274c7b40dd91f5de", "score": "0.53728527", "text": "function showPorts(node, show) {\n\t\tvar diagram = node.diagram;\n\t\tif (!diagram || diagram.isReadOnly || !diagram.allowLink) return;\n\t\tvar it = node.ports;\n\t\twhile (it.next()) {\n\t\t var port = it.value;\n\t\t port.stroke = (show ? \"white\" : null);\n\t\t port.fill = (show ? \"white\" : null);\n\t\t}\n\t }", "title": "" }, { "docid": "d84feca873574c9e12964dfd9bd0488d", "score": "0.5367728", "text": "function selectPort() {\n ctx.port = this.options[this.selectedIndex].value;\n }", "title": "" }, { "docid": "9de3c403cf133f9a3be6a1d37fb18d9f", "score": "0.53564274", "text": "function setup() {\n createCanvas(640, 480); // make canvas\n background(0); // black background\n serial = new p5.SerialPort(); // make a new instance of the serialport library\n serial.on('list', printList); // set a callback function for the serialport list event\n serial.on('connected', serverConnected); // callback for connecting to the server\n serial.on('open', portOpen); // callback for the port opening\n serial.on('data', serialEvent); // callback for when new data arrives\n serial.on('error', serialError); // callback for errors\n serial.on('close', portClose); // callback for the port closing\n serial.list(); // list the serial ports\n serial.open(portName); // open a serial port\n}", "title": "" }, { "docid": "bf2b0e1b1d0c29fd0e8b8d830b3efe31", "score": "0.5337014", "text": "async function reservePorts(count) {\n\tconst port = await getPort()\n\tconst ports = [port]\n\tconst tryAgain = () => {\n\t\treturn reservePorts(count)\n\t}\n\n\tfor (let i = 1; i < count; i++) {\n\t\tconst targetConsecutivePort = port + i\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst openPort = await getPort({ port: targetConsecutivePort })\n\n\t\tif (openPort !== targetConsecutivePort) {\n\t\t\t// can't reserve next port, bail and get another set\n\t\t\treturn tryAgain()\n\t\t}\n\n\t\tports.push(openPort)\n\t}\n\n\treturn ports\n}", "title": "" }, { "docid": "0673ce52c00c94fc1e2243e3af0a84d9", "score": "0.53018576", "text": "static createPort(path, opt) {\n serialNumber++;\n opt = Object.assign({\n echo: false,\n record: false,\n readyData: Buffer.from('READY')\n }, opt);\n\n ports[path] = {\n data: Buffer.alloc(0),\n echo: opt.echo,\n record: opt.record,\n readyData: Buffer.from(opt.readyData),\n info: {\n comName: path,\n manufacturer: 'The J5 Robotics Company',\n serialNumber,\n pnpId: undefined,\n locationId: undefined,\n vendorId: undefined,\n productId: undefined\n }\n };\n debug(serialNumber, 'created port', JSON.stringify({ path, opt }));\n }", "title": "" }, { "docid": "de2e40d0676721c51d09f499dcc19f5d", "score": "0.5298019", "text": "function setPort(env) {\n var basePort = config.get(`PORTS.${env['ADAPTER']}`)\n return portscanner.findAPortNotInUseAsync(basePort, basePort + 50, '127.0.0.1')\n .then((port) => {\n env['PORT'] = port\n log.debug(`Set ${env['ADAPTER']} PORT: ${port}`)\n return env\n })\n}", "title": "" }, { "docid": "4a19a5e7aef43baaa0b6c209e5368223", "score": "0.5290101", "text": "function showPortOpen() {\n console.log('port open. Data rate: ' + myPort.options.baudRate);\n}", "title": "" }, { "docid": "645f1ade67ae06428f0273fbf5889d5f", "score": "0.5252753", "text": "function onPortOpen(){\r\n console.log('port Open');\r\n }", "title": "" }, { "docid": "8004ca694c6e81b38f52e35b7f095f09", "score": "0.5244212", "text": "function serialPortReadyCallback() {\n\n console.log('CNC server API listening on ' +\n (cncserver.gConf.get('httpLocalOnly') ? 'localhost' : '*') +\n ':' + cncserver.gConf.get('httpPort')\n );\n\n // Is the serialport ready? Start reading\n if (!cncserver.pen.simulation) {\n serialPort.on(\"data\", serialReadline);\n }\n\n sendBotConfig();\n startServer();\n\n // Scratch v2 endpoint & API =================================================\n if (cncserver.gConf.get('scratchSupport')) {\n scratch.initAPI(cncserver);\n }\n\n // CNC Server API ============================================================\n // Return/Set CNCServer Configuration ========================================\n cncserver.createServerEndpoint(\"/v1/settings\", function(req, res){\n if (req.route.method === 'get') { // Get list of tools\n return {code: 200, body: {\n global: '/v1/settings/global',\n bot: '/v1/settings/bot'\n }};\n } else {\n return false;\n }\n });\n\n cncserver.createServerEndpoint(\"/v1/settings/:type\", function(req, res){\n // Sanity check type\n var setType = req.params.type;\n if (setType !== 'global' && setType !== 'bot'){\n return [404, 'Settings group not found'];\n }\n\n var conf = setType === 'global' ? cncserver.gConf : cncserver.botConf;\n\n function getSettings() {\n var out = {};\n // Clean the output for global as it contains all commandline env vars!\n if (setType === 'global') {\n var g = conf.get();\n for (var i in g) {\n if (i === \"botOverride\") {\n break;\n }\n out[i] = g[i];\n }\n } else {\n out = conf.get();\n }\n return out;\n }\n\n // Get the full list for the type\n if (req.route.method === 'get') {\n return {code: 200, body: getSettings()};\n } else if (req.route.method === 'put') {\n for (var i in req.body) {\n conf.set(i, req.body[i]);\n }\n return {code: 200, body: getSettings()};\n } else {\n return false;\n }\n });\n\n // Return/Set PEN state API =================================================\n cncserver.createServerEndpoint(\"/v1/pen\", function(req, res){\n if (req.route.method === 'put') {\n // SET/UPDATE pen status\n setPen(req.body, function(stat){\n if (!stat) {\n res.status(500).send(JSON.stringify({\n status: \"Error setting pen!\"\n }));\n } else {\n if (req.body.ignoreTimeout){\n res.status(202).send(JSON.stringify(cncserver.pen));\n }\n res.status(200).send(JSON.stringify(cncserver.pen));\n }\n });\n\n return true; // Tell endpoint wrapper we'll handle the response\n } else if (req.route.method === 'delete'){\n // Reset pen to defaults (park)\n setHeight('up', function(){\n setPen({\n x: cncserver.bot.park.x,\n y: cncserver.bot.park.y,\n park: true,\n ignoreTimeout: req.body.ignoreTimeout,\n skipBuffer: req.body.skipBuffer\n }, function(stat){\n if (!stat) {\n res.status(500).send(JSON.stringify({\n status: \"Error parking pen!\"\n }));\n }\n res.status(200).send(JSON.stringify(cncserver.pen));\n });\n }, req.body.skipBuffer);\n\n return true; // Tell endpoint wrapper we'll handle the response\n } else if (req.route.method === 'get'){\n if (req.query.actual) {\n return {code: 200, body: cncserver.actualPen};\n } else {\n return {code: 200, body: cncserver.pen};\n }\n } else {\n return false;\n }\n });\n\n // Return/Set Motor state API ================================================\n cncserver.createServerEndpoint(\"/v1/motors\", function(req, res){\n // Disable/unlock motors\n if (req.route.method === 'delete') {\n run('custom', cmdstr('disablemotors'));\n return [201, 'Disable Queued'];\n } else if (req.route.method === 'put') {\n if (req.body.reset == 1) {\n // ZERO motor position to park position\n var park = centToSteps(cncserver.bot.park, true);\n // It is at this point assumed that one would *never* want to do this as\n // a buffered operation as it implies *manually* moving the bot to the\n // parking location, so we're going to man-handle the variables a bit.\n // completely not repecting the buffer (as really, it should be empty)\n\n // EDIT: There are plenty of queued operations that don't involve moving\n // the pen that make sense to have in the buffer after a zero operation,\n // not to mention if there are items in the queue during a pause, we\n // should still want the ability to do this.\n\n // Set tip of buffer to current\n cncserver.pen.x = park.x;\n cncserver.pen.y = park.y;\n\n run('callback', function(){\n // Set actualPen position. This is the ONLY place we set this value\n // without a movement, because it's assumed to have been moved there\n // physically by a user. Also we're assuming they did it instantly!\n cncserver.actualPen.x = park.x;\n cncserver.actualPen.y = park.y;\n cncserver.actualPen.lastDuration = 0;\n\n sendPenUpdate();\n if (cncserver.gConf.get('debug')) console.log('Motor offset reset to park position');\n });\n return [201, 'Motor offset reset to park position queued'];\n } else {\n return [406, 'Input not acceptable, see API spec for details.'];\n }\n } else {\n return false;\n }\n });\n\n // Command buffer API ========================================================\n cncserver.createServerEndpoint(\"/v1/buffer\", function(req, res){\n if (req.route.method === 'get' || req.route.method === 'put') {\n // Pause/resume (normalize input)\n if (typeof req.body.paused === \"string\") {\n req.body.paused = req.body.paused === \"true\" ? true : false;\n }\n\n if (typeof req.body.paused === \"boolean\") {\n if (req.body.paused != bufferPaused) {\n bufferPaused = req.body.paused;\n console.log('Run buffer ' + (bufferPaused ? 'paused!': 'resumed!'));\n bufferRunning = false; // Force a followup check as the paused var has changed\n\n bufferNewlyPaused = bufferPaused; // Changed to paused!\n sendBufferVars();\n\n // Hold on the current actualPen to return to before resuming\n if (bufferPaused) {\n bufferPausePen = extend({}, cncserver.actualPen);\n sendBufferVars();\n setHeight('up', null, true); // Pen up for safety!\n }\n }\n }\n\n // Did we actually change position since pausing?\n var changedSincePause = false;\n if (bufferPausePen) {\n if (bufferPausePen.x != cncserver.actualPen.x ||\n bufferPausePen.y != cncserver.actualPen.y ||\n bufferPausePen.height != cncserver.actualPen.height){\n changedSincePause = true;\n } else {\n // If we're resuming, and there's no change... clear the pause pen\n if (!bufferPaused) {\n bufferPausePen = null;\n sendBufferVars();\n }\n }\n }\n\n // Resuming? Move back to position we paused at (if changed)\n if (!bufferPaused && changedSincePause) {\n bufferPaused = true; // Pause for a bit until we move back to last pos\n sendBufferVars();\n console.log('Moving back to pre-pause position...');\n\n // Set the pen up before moving to resume position\n setHeight('up', function(){\n actuallyMove(bufferPausePen, function(){\n // Set the height back to what it was AFTER moving\n actuallyMoveHeight(bufferPausePen.height, bufferPausePen.state, function(){\n console.log('Resuming buffer!');\n bufferPaused = false;\n bufferPausePen = null;\n sendBufferVars();\n res.status(200).send(JSON.stringify({\n running: bufferRunning,\n paused: bufferPaused,\n count: buffer.length,\n buffer: buffer\n }));\n });\n });\n }, true); // Skipbuffer on setheight!\n\n return true; // Don't finish the response till after move back ^^^\n }\n\n\n if (!bufferNewlyPaused || buffer.length === 0) {\n bufferNewlyPaused = false; // In case paused with 0 items in buffer\n sendBufferVars();\n return {code: 200, body: {\n running: bufferRunning,\n paused: bufferPaused,\n count: buffer.length\n }};\n } else { // Buffer isn't empty and we're newly paused\n // Wait until last item has finished before returning\n console.log('Waiting for last item to finish...');\n\n bufferPauseCallback = function(){\n res.status(200).send(JSON.stringify({\n running: bufferRunning,\n paused: bufferPaused,\n count: buffer.length\n }));\n sendBufferVars();\n bufferNewlyPaused = false;\n };\n\n return true; // Don't finish the response till later\n }\n } else if (req.route.method === 'post') {\n // Create a status message/callback and shuck it into the buffer\n if (typeof req.body.message === \"string\") {\n run('message', req.body.message);\n return [200, 'Message added to buffer'];\n } else if (typeof req.body.callback === \"string\") {\n run('callbackname', req.body.callback);\n return [200, 'Callback name added to buffer'];\n } else {\n return [400, '/v1/buffer POST only accepts data \"message\" or \"callback\"'];\n }\n } else if (req.route.method === 'delete') {\n cncserver.clearBuffer();\n bufferRunning = false;\n\n bufferPausePen = null; // Resuming with an empty buffer is silly\n bufferPaused = false;\n\n sendBufferComplete(); // SHould be fine to send as buffer is empty.\n\n console.log('Run buffer cleared!');\n return [200, 'Buffer Cleared'];\n } else {\n return false;\n }\n });\n\n // Get/Change Tool API =======================================================\n cncserver.createServerEndpoint(\"/v1/tools\", function(req, res){\n if (req.route.method === 'get') { // Get list of tools\n return {code: 200, body:{tools: Object.keys(cncserver.botConf.get('tools'))}};\n } else {\n return false;\n }\n });\n\n cncserver.createServerEndpoint(\"/v1/tools/:tool\", function(req, res){\n var toolName = req.params.tool;\n // TODO: Support other tool methods... (needs API design!)\n if (req.route.method === 'put') { // Set Tool\n if (cncserver.botConf.get('tools:' + toolName)){\n setTool(toolName, function(data){\n cncserver.pen.tool = toolName;\n res.status(200).send(JSON.stringify({\n status: 'Tool changed to ' + toolName\n }));\n }, req.body.ignoreTimeout);\n return true; // Tell endpoint wrapper we'll handle the response\n } else {\n return [404, \"Tool: '\" + toolName + \"' not found\"];\n }\n } else {\n return false;\n }\n });\n\n // ===========================================================================\n // UTILITY FUNCTIONS =========================================================\n // ===========================================================================\n\n /**\n * Run to the buffer direct low level setup commands (for EiBotBoard only).\n *\n * @param {integer} id\n * Numeric ID of EBB setting to change the value of\n * @param {integer} value\n * Value to set to\n */\n exports.sendSetup = sendSetup;\n function sendSetup(id, value) {\n // TODO: Make this WCB specific, or refactor to be general\n run('custom', 'SC,' + id + ',' + value);\n }\n\n /**\n * General logic sorting function for most \"pen\" requests.\n *\n * @param {object} inPen\n * Raw object containing data from /v1/pen PUT requests. See API spec for\n * pen to get an idea of what can live in this object.\n * @param callback\n * Callback triggered when intended action should be complete.\n */\n exports.setPen = setPen;\n cncserver.setPen = setPen;\n function setPen(inPen, callback) {\n // Force the distanceCounter to be a number (was coming up as null)\n cncserver.pen.distanceCounter = parseFloat(cncserver.pen.distanceCounter);\n\n // Counter Reset\n if (inPen.resetCounter) {\n cncserver.pen.distanceCounter = Number(0);\n callback(true);\n return;\n }\n\n // Setting the value of the power to the pen\n if (typeof inPen.power !== \"undefined\") {\n var powers = cncserver.botConf.get('penpower');\n if(typeof powers === \"undefined\") { // We have no super powers\n powers = {min: 0, max: 0}; // Set the powers to zero\n }\n\n run('custom', cmdstr('penpower', {p: Math.round(inPen.power * powers.max) + Number(powers.min)}));\n cncserver.pen.power = inPen.power;\n if (callback) callback(true);\n return;\n }\n\n // Setting the value of simulation\n if (typeof inPen.simulation != \"undefined\") {\n\n // No change\n if (inPen.simulation === cncserver.pen.simulation) {\n callback(true);\n return;\n }\n\n if (inPen.simulation === '0') { // Attempt to connect to serial\n connectSerial({complete: callback});\n } else { // Turn off serial!\n // TODO: Actually nullify connection.. no use case worth it yet\n simulationModeInit();\n }\n\n return;\n }\n\n\n // State/z position has been passed\n if (typeof inPen.state != \"undefined\") {\n // Disallow actual cncserver.pen setting when off canvas (unless skipping buffer)\n if (!cncserver.pen.offCanvas || inPen.skipBuffer) {\n setHeight(inPen.state, callback, inPen.skipBuffer);\n } else {\n // Save the state anyways so we can come back to it\n cncserver.pen.state = inPen.state;\n if (callback) callback(1);\n }\n return;\n }\n\n // Absolute positions are set\n if (inPen.x !== undefined){\n // Input values are given as percentages of working area (not max area)\n\n // Don't accept bad input\n if (isNaN(inPen.x) || isNaN(inPen.y) || !isFinite(inPen.x) || !isFinite(inPen.y)) {\n callback(false);\n return;\n }\n\n // Convert the percentage values into real absolute and appropriate values\n var absInput = centToSteps(inPen);\n absInput.limit = 'workArea';\n\n // Are we parking?\n if (inPen.park) {\n // Don't repark if already parked (but not if we're skipping the buffer)\n var park = centToSteps(cncserver.bot.park, true);\n if (cncserver.pen.x === park.x && cncserver.pen.y === park.y && !inPen.skipBuffer) {\n if (callback) callback(false);\n return;\n }\n\n // Set Absolute input value to park position in steps\n absInput.x = park.x;\n absInput.y = park.y;\n absInput.limit = 'maxArea';\n }\n\n // Sanity check and format ignoreTimeout as clean triple equals boolean.\n if (typeof inPen.ignoreTimeout !== 'undefined') {\n inPen.ignoreTimeout = parseInt(inPen.ignoreTimeout) === 1 ? true : false;\n }\n\n movePenAbs(absInput, callback, inPen.ignoreTimeout, inPen.skipBuffer);\n return;\n }\n\n if (callback) callback(cncserver.pen);\n }\n\n\n /**\n * Run a servo position from a given percentage or named height value into\n * the buffer, or directly via skipBuffer.\n *\n * @param {number|string} state\n * Named height preset machine name, or float between 0 & 1.\n * @param callback\n * Callback triggered when operation should be complete.\n * @param skipBuffer\n * Set to true to skip adding the command to the buffer and run it\n * immediately.\n */\n exports.setHeight = setHeight;\n cncserver.setHeight = setHeight;\n function setHeight(state, callback, skipBuffer) {\n var stateValue = null; // Placeholder for what to normalize the pen state to\n var height = 0; // Placeholder for servo height value\n var servoDuration = cncserver.botConf.get('servo:duration');\n\n // Convert the incoming state\n var conv = stateToHeight(state);\n height = conv.height;\n stateValue = conv.state;\n\n // If we're skipping the buffer, just set the height directly\n if (skipBuffer) {\n console.log('Skipping buffer to set height:', height);\n actuallyMoveHeight(height, stateValue, callback);\n return;\n }\n\n // Pro-rate the duration depending on amount of change from current to tip of buffer\n if (cncserver.pen.height) {\n var range = parseInt(cncserver.botConf.get('servo:max')) - parseInt(cncserver.botConf.get('servo:min'));\n servoDuration = Math.round((Math.abs(height - cncserver.pen.height) / range) * servoDuration)+1;\n }\n\n // Actually set tip of buffer to given sanitized state & servo height.\n cncserver.pen.height = height;\n cncserver.pen.state = stateValue;\n\n // Run the height into the command buffer\n run('height', height, servoDuration);\n\n // Height movement callback servo movement duration offset\n if (callback) {\n setTimeout(function(){\n callback(1);\n }, Math.max(servoDuration - cncserver.gConf.get('bufferLatencyOffset'), 0));\n }\n }\n\n /**\n * Perform conversion from named/0-1 number state value to given pen height\n * suitable for outputting to a Z axis control statement.\n *\n * @param state\n * @returns {object}\n * Object containing normalized state, and numeric height value. As:\n * {state: [integer|string], height: [float]}\n */\n cncserver.stateToHeight = stateToHeight;\n function stateToHeight(state) {\n // Whether to use the full min/max range (used for named presets only)\n var fullRange = false;\n var min = parseInt(cncserver.botConf.get('servo:min'));\n var max = parseInt(cncserver.botConf.get('servo:max'));\n var range = max - min;\n var normalizedState = state; // Normalize/sanitize the incoming state\n\n var presets = cncserver.botConf.get('servo:presets');\n var height = 0; // Placeholder for height output\n\n // Validate Height, and conform to a bottom to top based percentage 0 to 100\n if (isNaN(parseInt(state))){ // Textual position!\n if (typeof presets[state] !== 'undefined') {\n height = parseFloat(presets[state]);\n } else { // Textual expression not found, default to UP\n height = presets.up;\n normalizedState = 'up';\n }\n\n fullRange = true;\n } else { // Numerical position (0 to 1), moves between up (0) and draw (1)\n height = Math.abs(parseFloat(state));\n height = height > 1 ? 1 : height; // Limit to 1\n normalizedState = height;\n\n // Reverse value and lock to 0 to 100 percentage with 1 decimal place\n height = parseInt((1 - height) * 1000) / 10;\n }\n\n // Lower the range when using 0 to 1 values to between up and draw\n if (!fullRange) {\n min = ((presets.draw / 100) * range) + min;\n max = ((presets.up / 100) * range) + parseInt(cncserver.botConf.get('servo:min'));\n\n range = max - min;\n }\n\n // Sanity check incoming height value to 0 to 100\n height = height > 100 ? 100 : height;\n height = height < 0 ? 0 : height;\n\n // Calculate the final servo value from percentage\n height = Math.round(((height / 100) * range) + min);\n return {height: height, state: normalizedState};\n }\n\n\n /**\n * Run the operation to set the current tool (and any aggregate operations\n * required) into the buffer\n *\n * @param toolName\n * The machine name of the tool (as defined in the bot config file).\n * @param callback\n * Triggered when the full tool change is to have been completed, or on\n * failure.\n * @returns {boolean}\n * True if success, false if failuer\n */\n exports.setTool = setTool;\n cncserver.setTool = setTool;\n function setTool(toolName, callback, ignoreTimeout) {\n var tool = cncserver.botConf.get('tools:' + toolName);\n\n // No tool found with that name? Augh! Run AWAY!\n if (!tool) {\n if (callback) run('callback', callback);\n return false;\n }\n\n if (cncserver.gConf.get('debug')) console.log('Changing to tool: ' + toolName);\n\n // Set the height based on what kind of tool it is\n // TODO: fold this into bot specific tool change logic\n var downHeight = toolName.indexOf('water') !== -1 ? 'wash' : 'draw';\n\n // Pen Up\n setHeight('up');\n\n // Move to the tool\n movePenAbs(tool);\n\n // \"wait\" tools need user feedback to let cncserver know that it can continue\n if (typeof tool.wait !== \"undefined\") {\n\n if (callback){\n run('callback', callback);\n }\n\n // Pause or resume continued execution based on tool.wait value\n // In theory: a wait tool has a complementary resume tool to bring it back\n if (tool.wait) {\n bufferPaused = true;\n } else {\n bufferPaused = false;\n executeNext();\n }\n\n sendBufferVars();\n } else { // \"Standard\" WaterColorBot toolchange\n\n // Pen down\n setHeight(downHeight);\n\n // Wiggle the brush a bit\n wigglePen(tool.wiggleAxis, tool.wiggleTravel, tool.wiggleIterations);\n\n // Put the pen back up when done!\n setHeight('up');\n\n // If there's a callback to run...\n if (callback){\n if (!ignoreTimeout) { // Run inside the buffer\n run('callback', callback);\n } else { // Run as soon as items have been buffered\n callback(1);\n }\n }\n return true;\n }\n }\n\n /**\n * \"Move\" the pen (tip of the buffer) to an absolute point inside the maximum\n * available bot area. Includes cutoffs and sanity checks.\n *\n * @param {{x: number, y: number, [limit: string]}} inPoint\n * Absolute coordinate measured in steps to move to. src is assumed to be\n * \"pen\" tip of buffer. Also can contain optional \"limit\" key to set where\n * movement should be limited to. Defaults to none, accepts \"workArea\".\n * @param {function} callback\n * Callback triggered when operation should be complete.\n * @param {boolean} immediate\n * Set to true to trigger the callback immediately.\n * @param {boolean} skipBuffer\n * Set to true to skip adding to the buffer, simplifying this function\n * down to just a sanity checker.\n * @returns {number}\n * Distance moved from previous position, in steps.\n */\n cncserver.movePenAbs = movePenAbs;\n function movePenAbs(inPoint, callback, immediate, skipBuffer) {\n // Something really bad happened here...\n if (isNaN(inPoint.x) || isNaN(inPoint.y)){\n console.error('INVALID Move pen input, given:', inPoint);\n if (callback) callback(false);\n return 0;\n }\n\n // Make a local copy of point as we don't want to mess with its values ByRef\n var point = extend({}, inPoint);\n\n // Sanity check absolute position input point and round everything (as we\n // only move in whole number steps)\n point.x = Math.round(Number(point.x));\n point.y = Math.round(Number(point.y));\n\n // If moving in the workArea only, limit to allowed workArea, and trigger\n // on/off screen events when we go offscreen, retaining suggested position.\n var startOffCanvasChange = false;\n if (point.limit === 'workArea') {\n // Off the Right\n if (point.x > cncserver.bot.workArea.right) {\n point.x = cncserver.bot.workArea.right;\n startOffCanvasChange = true;\n }\n\n // Off the Left\n if (point.x < cncserver.bot.workArea.left) {\n point.x = cncserver.bot.workArea.left;\n startOffCanvasChange = true;\n }\n\n // Off the Top\n if (point.y < cncserver.bot.workArea.top) {\n point.y = cncserver.bot.workArea.top;\n startOffCanvasChange = true;\n }\n\n // Off the Bottom\n if (point.y > cncserver.bot.workArea.bottom) {\n point.y = cncserver.bot.workArea.bottom;\n startOffCanvasChange = true;\n }\n\n // Are we beyond our workarea limits?\n if (startOffCanvasChange) { // Yep.\n // We MUST trigger the start offscreen change AFTER the movement to draw\n // up to that point (which happens later).\n } else { // Nope!\n // The off canvas STOP trigger must happen BEFORE the move happens\n // (which is fine right here)\n offCanvasChange(false);\n }\n }\n\n sanityCheckAbsoluteCoord(point); // Ensure values don't go off the rails\n\n // If we're skipping the buffer, just move to the point\n // Pen stays put as last point set in buffer\n if (skipBuffer) {\n console.log('Skipping buffer for:', point);\n actuallyMove(point, callback);\n return 0; // Don't return any distance for buffer skipped movements\n }\n\n // Calculate change from end of buffer pen position\n var change = {\n x: Math.round(point.x - cncserver.pen.x),\n y: Math.round(point.y - cncserver.pen.y)\n };\n\n // Don't do anything if there's no change\n if (change.x === 0 && change.y === 0) {\n if (callback) callback(cncserver.pen);\n return 0;\n }\n\n /*\n Duration/distance is only calculated as relative from last assumed point,\n which may not actually ever happen, though it is likely to happen.\n Buffered items may not be pushed out of order, but previous location may\n have changed as user might pause the buffer, and move the actualPen\n position.\n @see executeNext - for more details on how this is handled.\n */\n var distance = getVectorLength(change);\n var duration = getDurationFromDistance(distance);\n\n // Only if we actually moved anywhere should we queue a movement\n if (distance !== 0) {\n // Set the tip of buffer pen at new position\n cncserver.pen.x = point.x;\n cncserver.pen.y = point.y;\n\n // Adjust the distance counter based on movement amount, not if we're off\n // the canvas though.\n if (cncserver.penDown() && !cncserver.pen.offCanvas && cncserver.bot.inWorkArea(point)) {\n cncserver.pen.distanceCounter = parseFloat(Number(distance) + Number(cncserver.pen.distanceCounter));\n }\n\n // Queue the final absolute move (serial command generated later)\n run('move', {x: cncserver.pen.x, y: cncserver.pen.y}, duration);\n }\n\n // Required start offCanvas change -after- movement has been queued\n if (startOffCanvasChange) {\n offCanvasChange(true);\n }\n\n if (callback) {\n if (immediate === true) {\n callback(cncserver.pen);\n } else {\n // Set the timeout to occur sooner so the next command will execute\n // before the other is actually complete. This will push into the buffer\n // and allow for far smoother move runs.\n\n var cmdDuration = Math.max(duration - cncserver.gConf.get('bufferLatencyOffset'), 0);\n\n if (cmdDuration < 2) {\n callback(cncserver.pen);\n } else {\n setTimeout(function(){callback(cncserver.pen);}, cmdDuration);\n }\n\n }\n }\n\n return distance;\n }\n\n /**\n * Util function to buffer the \"wiggle\" movement for WaterColorBot Tool\n * changes. TODO: Replace this with a real API for tool changes.\n *\n * @param {string} axis\n * Which axis to move along. Either 'xy' or 'y'\n * @param travel\n * How much to move during the wiggle.\n * @param iterations\n * How many times to move.\n */\n function wigglePen(axis, travel, iterations){\n var start = {x: Number(cncserver.pen.x), y: Number(cncserver.pen.y)};\n var i = 0;\n travel = Number(travel); // Make sure it's not a string\n\n // Start the wiggle!\n _wiggleSlave(true);\n\n function _wiggleSlave(toggle){\n var point = {x: start.x, y: start.y};\n\n if (axis === 'xy') {\n var rot = i % 4; // Ensure rot is always 0-3\n\n // This convoluted series ensure the wiggle moves in a proper diamond\n if (rot % 3) { // Results in F, T, T, F\n if (toggle) {\n point.y+= travel/2; // Down\n } else {\n point.x-= travel; // Left\n }\n } else {\n if (toggle) {\n point.y-= travel/2; // Up\n } else {\n point.x+= travel; // Right\n }\n }\n } else {\n point[axis]+= (toggle ? travel : travel * -1);\n }\n\n movePenAbs(point);\n\n i++;\n\n if (i <= iterations){ // Wiggle again!\n _wiggleSlave(!toggle);\n } else { // Done wiggling, go back to start\n movePenAbs(start);\n }\n }\n }\n}", "title": "" }, { "docid": "35a8f490f8648d2122eabac8eeb41cc4", "score": "0.5240434", "text": "function gotList(thelist) {\n console.log(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n console.log(i + \" \" + thelist[i]);\n }\n}", "title": "" }, { "docid": "35a8f490f8648d2122eabac8eeb41cc4", "score": "0.5240434", "text": "function gotList(thelist) {\n console.log(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n console.log(i + \" \" + thelist[i]);\n }\n}", "title": "" }, { "docid": "35a8f490f8648d2122eabac8eeb41cc4", "score": "0.5240434", "text": "function gotList(thelist) {\n console.log(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n console.log(i + \" \" + thelist[i]);\n }\n}", "title": "" }, { "docid": "6524078350954db0d039fed5d9e23734", "score": "0.522804", "text": "function configureSocketListener (port) {\n\n\t// establish socket connection on port provided\n\tvar socket = io(\":\" + port);\n\tlogger (\"Socket listening on port \" + port);\n\n\t// set up listener for event \"new-plist\"\n\tsocket.on('new-plist', function(obj) {\n\t\tvar sel;\n\t\tvar jobj;\n\n\t\tlogger (\"NEW PLIST EMITTED\");\n\t\tjobj = JSON.parse(obj);\n\t\tlogger(jobj);\n\n\t\t// update the selector list in the UI\n\t\tsel = $('#proj-sel-list').val();\n\t\tupdateSelList(jobj);\n\t\tif (exists(sel)) {\n\t\t\t$(\"#proj-sel-list\").val(sel);\n\t\t}\n\t\t// \"flash\" the list to indicate the change\n\t\t$(\"#proj-sel-list\").removeClass(\"flash-anim\");\n\t\t$(\"#proj-sel-list\").addClass(\"flash-anim\");\n\t\t$(\"#fbrowser-btn\").removeClass(\"pulse-anim\");\n\t\t$(\"#fbrowser-btn\").addClass(\"pulse-anim\");\n\t});\n}", "title": "" }, { "docid": "a0f308d361349284948304153e48eef5", "score": "0.52148414", "text": "function gotList(thelist) {\n console.log(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n console.log(i + \" \" + thelist[i]);\n }\n}", "title": "" }, { "docid": "a0f308d361349284948304153e48eef5", "score": "0.52148414", "text": "function gotList(thelist) {\n console.log(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n console.log(i + \" \" + thelist[i]);\n }\n}", "title": "" }, { "docid": "1dd336be2b33b0fc32ed1de5add38db9", "score": "0.5211423", "text": "updateConnections() {\n let outPorts, inPorts, outPortDom, inPortDom;\n\n let modulesDom = document.getElementById('modules');\n let modules = get(this, 'patch.modules');\n set(this, 'connections', []);\n let self = this;\n\n modules.forEach((module) => {\n\n outPorts = get(module, 'enabledOutPorts');\n outPorts.forEach((outPort) => {\n\n outPortDom = modulesDom.getElementsByClassName(outPort.uniqueCssIdentifier)[0];\n\n inPorts = get(outPort, 'connections');\n inPorts.forEach((inPort) => {\n\n inPortDom = modulesDom.getElementsByClassName(inPort.uniqueCssIdentifier)[0];\n get(self, 'connections').addObject({\n inPortDom,\n outPortDom,\n inPort,\n outPort\n });\n });\n });\n });\n }", "title": "" }, { "docid": "0ad352fe6244c3de9e5a6e80b847406b", "score": "0.5197589", "text": "function showPortOpen() {\n console.log('port open. Data rate: ' + myPort.options.baudRate);\n }", "title": "" }, { "docid": "03dd25f8550907456d2b0a5cac02a523", "score": "0.5196955", "text": "function getPorts (port) {\n let { PORT, ARC_EVENTS_PORT, ARC_TABLES_PORT, ARC_INTERNAL } = process.env\n\n // CLI config (which are passed to this fn) > env var config\n let httpPort = port || Number(PORT) || 3333\n let eventsPort = Number(ARC_EVENTS_PORT) || httpPort + 1\n let tablesPort = Number(ARC_TABLES_PORT) || 5000\n let _arcPort = Number(ARC_INTERNAL) || httpPort - 1\n\n // Always set main HTTP / WebSocket port env vars\n process.env.PORT = httpPort\n process.env.ARC_WSS_URL = `ws://localhost:${httpPort}`\n\n // Port was reconfigured by the user\n let userSetPort = httpPort !== 3333\n\n // Set non-conflicting service ports for running multiple simultaneous Architect projects\n // Only set events / tables port env vars if necessary; rely on consumers to use known defaults\n if (userSetPort && !ARC_EVENTS_PORT) {\n eventsPort = process.env.ARC_EVENTS_PORT = httpPort + 1\n }\n if (userSetPort && !ARC_TABLES_PORT) {\n tablesPort = process.env.ARC_TABLES_PORT = httpPort + 2\n }\n\n // Validate\n let notNum = e => e && isNaN(e)\n if (notNum(httpPort) ||\n notNum(eventsPort) ||\n notNum(tablesPort) ||\n notNum(_arcPort)) {\n throw ReferenceError('Ports must be numbers')\n }\n\n return {\n httpPort,\n eventsPort,\n tablesPort,\n _arcPort,\n }\n}", "title": "" }, { "docid": "144c726c07cc3d62d26e81ffe349bf7f", "score": "0.51850474", "text": "function showPortOpen() {\n console.log('port open. Data rate: ' + myPort.baudRate);\n}", "title": "" }, { "docid": "868faefd7c4b87f70602825a2b5711b2", "score": "0.5182623", "text": "function showPorts(node, show) {\r\n var diagram = node.diagram;\r\n if (!diagram || diagram.isReadOnly || !diagram.allowLink) return;\r\n node.ports.each(function(port) {\r\n port.stroke = (show ? \"white\" : null);\r\n });\r\n }", "title": "" }, { "docid": "40e4ddf7ba0d1805b053d8228f034332", "score": "0.5169556", "text": "function showPorts(node, show) {\n var diagram = node.diagram;\n if (!diagram || diagram.isReadOnly || !diagram.allowLink) return;\n node.ports.each(function(port) {\n port.stroke = (show ? \"white\" : null);\n });\n }", "title": "" }, { "docid": "390a425c6c8d67a29a47b31a4610bcaa", "score": "0.516793", "text": "function showPortItemsNoHeader (rowId)\n{\n var comboAddId = \"\";\n var i = 0;\n var j = 0;\n var nInstanceCount = 0;\n var portItemCount = 0;\n var spanObj = null;\n var tableId = \"\";\n var tableObj = null;\n var trObj = null;\n var type = \"\";\n var strDynDisable = \"N\";\n\n var instancePropSet = m_UIFramework.m_controlPropSet.GetChildByType (rowId);\n var fieldListPropSet = new JSSCfgPropertySet ();\n var strFieldList = instancePropSet.GetProperty (\"FieldList\");\n fieldListPropSet.DecodeFromString (strFieldList); \n \n tableId = instancePropSet.GetProperty (\"Parent Path\") + _underscore + \"PORTITEM\" + _pipe +\n instancePropSet.GetProperty (\"Port Item Id\");\n comboAddId = instancePropSet.GetProperty (\"Parent Path\") + _underscore + \"PORT\" + _pipe +\n instancePropSet.GetProperty (\"Port Item Id\"); \n \n //the table for Port Items are already created.\n tableObj = document.getElementById (tableId);\n \n comboAddPS = m_UIFramework.m_controlPropSet.GetChildByType (comboAddId);\n portItemCount = comboAddPS.GetProperty (\"PortItemCount\");\n if (portItemCount == \"0\")\n {\n //Set up the field headers\n //trObj = tableObj.insertRow (-1);\n //trObj.id = tableId + _underscore + \"FIELDHEADER\";\n //displayFieldHeader (trObj, fieldListPropSet); \n }\n portItemCount++;\n comboAddPS.SetProperty (\"PortItemCount\", portItemCount); \n\n var domainPropSet = comboAddPS.GetChildByType (\"Domain\");\n strDynDisable = domainPropSet.GetProperty (\"DynDisable\");\n \n if(strDynDisable == \"Y\")\n instancePropSet.SetProperty (\"DynDisable\", \"Y\"); \n \n addPortItem (tableId, instancePropSet);\n}", "title": "" }, { "docid": "858e3f45e3177e99c518dc0e6163512c", "score": "0.5139676", "text": "getIOKitPorts() {\n\n var self = this;\n\n /*\n Most function calls need a pointer to RoseController later on, save it.\n */\n var _RoseController_PerformCommand_addr = Module.getExportByName('RoseControllerLib', '_ZN14RoseController14PerformCommandEhPKhmPvmPmy');\n var _RoseController_ptr = 0;\n Interceptor.attach(_RoseController_PerformCommand_addr, {\n onEnter: function() {\n if (! self._RoseController_ptr) {\n console.log(' * LibRoseController: PerformCommand, saving RoseController pointer and IOConnection');\n self._RoseController_ptr = new NativePointer(this.context.x0);\n // offset in struct, hope it's generic across versions\n self.AppleSPURoseDriverUserClient_port = self._RoseController_ptr.add(480).readU16();\n }\n }\n });\n\n /*\n We also want to talk to the generic AppleSPUUserClient via IOKit but there are no exports in\n nearbyd, so we need to hook a function by address.\n\n This function here can be found by looking for the string \"com.apple.nearbyd.RoseSupervisorCommandError\".\n */\n\n Interceptor.attach(self._RoseSupervisorCommand_addr, {\n onEnter: function() {\n if (! self.AppleSPUUserClient_port) {\n console.log(' * nearbyd: saving RoseSupervisorCommand IOConnection');\n self.AppleSPUUserClient_port = this.context.x0.add(8).readU16();\n }\n }\n });\n }", "title": "" }, { "docid": "1d48304adcc686acfddb8b17d3a86ea7", "score": "0.5138026", "text": "function showPorts(node, show) {\n var diagram = node.diagram;\n if (!diagram || diagram.isReadOnly || !diagram.allowLink)\n return;\n node.ports.each(function(port) {\n port.stroke = (show ? \"white\" : null);\n });\n}", "title": "" }, { "docid": "969390f4726126a596463bb0059256ad", "score": "0.513697", "text": "function assignPorts ( assigned_callback ) {\n\n var servers = [];\n\n function set_server ( config,callback ) {\n var server = http.createServer();\n servers.push ( server );\n var port = config.port;\n config.port = 0;\n server.listen({\n host : config.host,\n port : port,\n exclusive : config.exclusive\n },function(){\n config.port = server.address().port;\n callback();\n });\n }\n\n function setServer ( key,n ) {\n\n switch (key) {\n\n case 0: if (fe_server.port>0)\n set_server ( fe_server,function(){ setServer(1,0); } );\n else setServer(1,0);\n break;\n\n case 1: if (n<nc_servers.length) {\n if (nc_servers[n].port>0)\n set_server ( nc_servers[n],function(){ setServer(1,n+1); } );\n else setServer(1,n+1);\n } else\n setServer ( 2,0 );\n break;\n\n case 2: if ((fe_server.host=='localhost') && (fe_server.port<=0))\n set_server ( fe_server,function(){ setServer(3,0); } );\n else setServer(3,0);\n break;\n\n case 3: if (n<nc_servers.length) {\n if ((nc_servers[n].host=='localhost') && (nc_servers[n].port<=0))\n set_server ( nc_servers[n],function(){ setServer(3,n+1); } );\n else setServer(3,n+1);\n } else\n setServer ( 4,0 );\n break;\n\n case 4: default:\n break;\n\n }\n\n }\n\n setServer ( 0,0 );\n\n // ===========================================================================\n\n function checkServers ( callback ) {\n var b = (fe_server.host!='localhost') || (fe_server.port>0);\n nc_servers.forEach ( function(config){\n b = b && ((config.host!='localhost') || (config.port>0));\n });\n if (b)\n callback();\n else\n setTimeout ( function(){checkServers(callback)},50 );\n }\n\n checkServers ( function(){\n\n log.standard ( 1,'FE: url=' + fe_server.url() );\n for (var i=0;i<nc_servers.length;i++)\n log.standard ( 2,'NC[' + i + ']: name=' + nc_servers[i].name +\n ' type=' + nc_servers[i].exeType +\n ' url=' + nc_servers[i].url() );\n\n var nServers = servers.length;\n function oneDown() {\n nServers--;\n if ((nServers<=0) && (assigned_callback))\n assigned_callback();\n }\n\n servers.forEach ( function(server){\n server.close ( oneDown );\n });\n\n });\n\n}", "title": "" }, { "docid": "05a95d5a84977e27e658b692c20f45da", "score": "0.5122117", "text": "function generateStartPortSelectionList()\n{\n let portList = mainMap.portList;\n\tlet output = \"\";\n let startDisplayEnd;\n if (portList.length < startDisplay + numDisplay){\n startDisplayEnd = portList.length;\n }\n else{\n startDisplayEnd = startDisplay + numDisplay\n }\n\n\tfor (let i = startDisplay; i < startDisplayEnd; i++)\n\t{\n\t\toutput += \"<tr>\";\n\t\toutput += \"<td>\"+portList[i].name+\"</td>\";\n\t\toutput += \"<td>\"+portList[i].country+\"</td>\";\n output += \"<td>\"+portList[i].type+\"</td>\";\n output += \"<td>\"+portList[i].size+\"</td>\";\n output += \"<td>\"+portList[i].locationPrecision+\"</td>\";\n output += \"<td><a class=\\\"mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect\\\" onclick=\\\"selectStartPort(\"+i+\")\\\">Select</a></td>\";\n\t\toutput += \"</tr>\";\n\t}\n\treturn output;\n}", "title": "" }, { "docid": "7fd926c6310f1dac02fa68a5da3a8b4c", "score": "0.51211625", "text": "function connect(port = \"\", baud = 115200) {\n /**\n * \n * @param {string} port Serial port number\n * @param {number} baud Baud rate\n * @return {object} returns a serial port object\n */\n return createSerial.createSerial(port, baud)\n}", "title": "" }, { "docid": "7144e8c8a5dea605656cc178cb043659", "score": "0.5119152", "text": "connect(baudrate) {\n this.connectToPort(baudrate);\n }", "title": "" }, { "docid": "a628cc909bc6c86556849d43d6e4cc81", "score": "0.51188874", "text": "function showPorts(node, show) {\n var diagram = node.diagram;\n if (!diagram || diagram.isReadOnly || !diagram.allowLink) return;\n node.ports.each(function (port) {\n port.stroke = (show ? \"white\" : null);\n });\n}", "title": "" }, { "docid": "e56942a665d964cd2a5009d2e81439d1", "score": "0.51154834", "text": "function serialPortReadyCallback() {\r\n\r\n console.log('CNC server API listening on ' +\r\n (gConf.get('httpLocalOnly') ? 'localhost' : '*') +\r\n ':' + gConf.get('httpPort')\r\n );\r\n\r\n // Is the serialport ready? Start reading\r\n if (!pen.simulation) {\r\n serialPort.on(\"data\", serialReadline);\r\n }\r\n\r\n\r\n sendBotConfig();\r\n startServer();\r\n\r\n // CNC Server API ============================================================\r\n // Return/Set CNCServer Configuration ========================================\r\n createServerEndpoint(\"/v1/settings\", function(req, res){\r\n if (req.route.method == 'get') { // Get list of tools\r\n return {code: 200, body: {\r\n global: '/v1/settings/global',\r\n bot: '/v1/settings/bot'\r\n }};\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n createServerEndpoint(\"/v1/settings/:type\", function(req, res){\r\n // Sanity check type\r\n var setType = req.params.type;\r\n if (setType !== 'global' && setType !== 'bot'){\r\n return [404, 'Settings group not found'];\r\n }\r\n\r\n var conf = setType == 'global' ? gConf : botConf;\r\n\r\n function getSettings() {\r\n var out = {};\r\n // Clean the output for global as it contains all commandline env vars!\r\n if (setType == 'global') {\r\n var g = conf.get();\r\n for (var i in g) {\r\n if (i == \"botOverride\") {\r\n break;\r\n }\r\n out[i] = g[i];\r\n }\r\n } else {\r\n out = conf.get();\r\n }\r\n return out;\r\n }\r\n\r\n // Get the full list for the type\r\n if (req.route.method == 'get') {\r\n return {code: 200, body: getSettings()};\r\n } else if (req.route.method == 'put') {\r\n for (var i in req.body) {\r\n conf.set(i, req.body[i]);\r\n }\r\n return {code: 200, body: getSettings()};\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n // Return/Set PEN state API =================================================\r\n createServerEndpoint(\"/v1/pen\", function(req, res){\r\n if (req.route.method == 'put') {\r\n // SET/UPDATE pen status\r\n setPen(req.body, function(stat){\r\n if (!stat) {\r\n return [500, \"Error setting pen!\"];\r\n } else {\r\n if (req.body.ignoreTimeout){\r\n return {code: 202, body: pen};\r\n }\r\n }\r\n });\r\n } else if (req.route.method == 'delete'){\r\n // Reset pen to defaults (park)\r\n setHeight('up');\r\n setPen({x: 0, y:0, park: true}, function(stat){\r\n if (!stat) {\r\n return [500, \"Error parking pen!\"];\r\n }\r\n });\r\n } else if (req.route.method !== 'get') {\r\n return false;\r\n }\r\n\r\n // Default return, just return the pen!\r\n return {code: 200, body: pen};\r\n });\r\n\r\n // Return/Set Motor state API ================================================\r\n createServerEndpoint(\"/v1/motors\", function(req, res){\r\n // Disable/unlock motors\r\n if (req.route.method == 'delete') {\r\n run('custom', 'EM,0,0');\r\n return [201, 'Disable Queued'];\r\n } else if (req.route.method == 'put') {\r\n if (req.body.reset == 1) {\r\n // TODO: This could totally break queueing as movements are queued with\r\n // offsets that break if the relative position doesn't match!\r\n pen.x = 0;\r\n pen.y = 0;\r\n console.log('Motor offset reset to zero')\r\n return [200, 'Motor offset zeroed'];\r\n } else {\r\n return [406, 'Input not acceptable, see API spec for details.'];\r\n }\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n // Command buffer API ========================================================\r\n createServerEndpoint(\"/v1/buffer\", function(req, res){\r\n if (req.route.method == 'get' || req.route.method == 'put') {\r\n\r\n // Pause/resume\r\n if (typeof req.body.paused == \"boolean\") {\r\n if (req.body.paused != bufferPaused) {\r\n bufferPaused = req.body.paused;\r\n console.log('Run buffer ' + (bufferPaused ? 'paused!': 'resumed!'));\r\n bufferRunning = false; // Force a followup check as the paused var has changed\r\n }\r\n }\r\n\r\n return {code: 200, body: {\r\n running: bufferRunning,\r\n paused: bufferPaused,\r\n count: buffer.length,\r\n buffer: buffer\r\n }};\r\n } else if (req.route.method == 'delete') {\r\n buffer = [];\r\n console.log('Run buffer cleared!')\r\n return [200, 'Buffer Cleared'];\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n // Get/Change Tool API =======================================================\r\n createServerEndpoint(\"/v1/tools\", function(req, res){\r\n if (req.route.method == 'get') { // Get list of tools\r\n return {code: 200, body:{tools: Object.keys(botConf.get('tools'))}};\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n createServerEndpoint(\"/v1/tools/:tool\", function(req, res){\r\n var toolName = req.params.tool;\r\n // TODO: Support other tool methods... (needs API design!)\r\n if (req.route.method == 'put') { // Set Tool\r\n if (botConf.get('tools:' + toolName)){\r\n setTool(toolName, function(data){\r\n pen.tool = toolName;\r\n res.status(200).send(JSON.stringify({\r\n status: 'Tool changed to ' + toolName\r\n }));\r\n });\r\n return true; // Tell endpoint wrapper we'll handle the response\r\n } else {\r\n return [404, \"Tool: '\" + toolName + \"' not found\"];\r\n }\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n\r\n // UTILITY FUNCTIONS =======================================================\r\n\r\n // Send direct setup var command\r\n exports.sendSetup = sendSetup;\r\n function sendSetup(id, value) {\r\n // TODO: Make this WCB specific, or refactor to be general\r\n run('custom', 'SC,' + id + ',' + value);\r\n }\r\n\r\n function setPen(inPen, callback) {\r\n // Force the distanceCounter to be a number (was coming up as null)\r\n pen.distanceCounter = parseInt(pen.distanceCounter);\r\n\r\n // Counter Reset\r\n if (inPen.resetCounter) {\r\n pen.distanceCounter = Number(0);\r\n callback(true);\r\n return;\r\n }\r\n\r\n // Setting the value of simulation\r\n if (typeof inPen.simulation != \"undefined\") {\r\n\r\n // No change\r\n if (inPen.simulation == pen.simulation) {\r\n callback(true);\r\n return;\r\n }\r\n\r\n if (inPen.simulation == 0) { // Attempt to connect to serial\r\n connectSerial({complete: callback});\r\n } else { // Turn off serial!\r\n // TODO: Actually nullify connection.. no use case worth it yet\r\n simulationModeInit();\r\n }\r\n\r\n return;\r\n }\r\n\r\n\r\n // State has changed\r\n if (typeof inPen.state != \"undefined\") {\r\n if (inPen.state != pen.state) {\r\n setHeight(inPen.state, callback);\r\n return;\r\n }\r\n }\r\n\r\n // Absolute positions are set\r\n if (inPen.x !== undefined){\r\n // Input values are given as percentages of working area (not max area)\r\n\r\n // Don't accept bad input\r\n if (isNaN(inPen.x) || isNaN(inPen.y) || !isFinite(inPen.x) || !isFinite(inPen.y)) {\r\n callback(false);\r\n return;\r\n }\r\n\r\n // Sanity check incoming values\r\n inPen.x = inPen.x > 100 ? 100 : inPen.x;\r\n inPen.x = inPen.x < 0 ? 0 : inPen.x;\r\n\r\n inPen.y = inPen.y > 100 ? 100 : inPen.y;\r\n inPen.y = inPen.y < 0 ? 0 : inPen.y;\r\n\r\n // Convert the percentage values into real absolute and appropriate values\r\n var absInput = {\r\n x: BOT.workArea.left + ((inPen.x / 100) * (BOT.maxArea.width - BOT.workArea.left)),\r\n y: BOT.workArea.top + ((inPen.y / 100) * (BOT.maxArea.height - BOT.workArea.top))\r\n }\r\n\r\n if (inPen.park) {\r\n absInput.x-= BOT.workArea.left;\r\n absInput.y-= BOT.workArea.top;\r\n\r\n // Don't repark if already parked\r\n if (pen.x == 0 && pen.y == 0) {\r\n callback(false);\r\n return;\r\n }\r\n }\r\n\r\n // Actually move the pen!\r\n var distance = movePenAbs(absInput, callback, inPen.ignoreTimeout);\r\n if (pen.state === 'draw' || pen.state === 1) {\r\n pen.distanceCounter = parseInt(Number(distance) + Number(pen.distanceCounter));\r\n }\r\n return;\r\n }\r\n\r\n if (callback) callback(true);\r\n }\r\n\r\n // Set servo position\r\n exports.setHeight = setHeight;\r\n function setHeight(height, callback) {\r\n var fullRange = false; // Whether to use the full min/max range\r\n var min = parseInt(botConf.get('servo:min'));\r\n var max = parseInt(botConf.get('servo:max'));\r\n var range = max - min;\r\n var stateValue = null; // Placeholder for what to set pen state to\r\n var p = botConf.get('servo:presets');\r\n var servoDuration = botConf.get('servo:duration');\r\n\r\n // Validate Height, and conform to a bottom to top based percentage 0 to 100\r\n if (isNaN(parseInt(height))){ // Textual position!\r\n if (p[height]) {\r\n stateValue = height;\r\n height = parseFloat(p[height]);\r\n } else { // Textual expression not found, default to UP\r\n height = p.up;\r\n stateValue = 'up';\r\n }\r\n fullRange = true;\r\n } else { // Numerical position (0 to 1), moves between up (0) and draw (1)\r\n height = Math.abs(parseFloat(height));\r\n height = height > 1 ? 1 : height; // Limit to 1\r\n stateValue = height;\r\n\r\n // Reverse value and lock to 0 to 100 percentage with 1 decimal place\r\n height = parseInt((1 - height) * 1000) / 10;\r\n }\r\n\r\n // Lower the range when using 0 to 1 values\r\n if (!fullRange) {\r\n min = ((p.draw / 100) * range) + min;\r\n max = ((p.up / 100) * range) + parseInt(botConf.get('servo:min'));\r\n\r\n range = max - min;\r\n }\r\n\r\n // Sanity check incoming height value to 0 to 100\r\n height = height > 100 ? 100 : height;\r\n height = height < 0 ? 0 : height;\r\n\r\n // Calculate the servo value from percentage\r\n height = Math.round(((height / 100) * range) + min);\r\n\r\n\r\n // Pro-rate the duration depending on amount of change\r\n if (pen.height) {\r\n range = parseInt(botConf.get('servo:max')) - parseInt(botConf.get('servo:min'));\r\n servoDuration = Math.round((Math.abs(height - pen.height) / range) * servoDuration)+1;\r\n }\r\n\r\n pen.height = height;\r\n pen.state = stateValue;\r\n\r\n // Run the height into the command buffer\r\n run('height', height, servoDuration);\r\n\r\n // Pen lift / drop\r\n if (callback) {\r\n // Force the EBB block buffer for the pen change state\r\n setTimeout(function(){\r\n callback(1);\r\n }, Math.max(servoDuration - gConf.get('bufferLatencyOffset'), 0));\r\n }\r\n }\r\n\r\n // Tool change\r\n exports.setTool = setTool;\r\n function setTool(toolName, callback) {\r\n var tool = botConf.get('tools:' + toolName);\r\n\r\n console.log('Changing to tool: ' + toolName);\r\n\r\n // Set the height based on what kind of tool it is\r\n // TODO: fold this into bot specific tool change logic\r\n var downHeight = toolName.indexOf('water') != -1 ? 'wash' : 'draw';\r\n\r\n // Pen Up\r\n setHeight('up');\r\n\r\n // Move to the tool\r\n movePenAbs(tool);\r\n\r\n // \"wait\" tools need user feedback to let cncserver know that it can continue\r\n if (typeof tool.wait != \"undefined\") {\r\n\r\n if (callback){\r\n run('callback', callback);\r\n }\r\n\r\n // Pause or resume continued execution based on tool.wait value\r\n // In theory: a wait tool has a complementary resume tool to bring it back\r\n if (tool.wait) {\r\n bufferPaused = true;\r\n } else {\r\n bufferPaused = false;\r\n executeNext();\r\n }\r\n\r\n } else { // \"Standard\" WaterColorBot toolchange\r\n // Pen down\r\n setHeight(downHeight);\r\n\r\n // Wiggle the brush a bit\r\n wigglePen(tool.wiggleAxis, tool.wiggleTravel, tool.wiggleIterations);\r\n\r\n // Put the pen back up when done!\r\n setHeight('up');\r\n\r\n if (callback){\r\n run('callback', callback);\r\n }\r\n }\r\n }\r\n\r\n // Move the Pen to an absolute point in the entire work area\r\n // Returns distance moved, in steps\r\n function movePenAbs(point, callback, immediate) {\r\n\r\n // Something really bad happened here...\r\n if (isNaN(point.x) || isNaN(point.y)){\r\n console.error('INVALID Move pen input, given:', point);\r\n if (callback) callback(false);\r\n return 0;\r\n }\r\n\r\n // Sanity check absolute position input point\r\n point.x = Number(point.x) > BOT.maxArea.width ? BOT.maxArea.width : point.x;\r\n point.x = Number(point.x) < 0 ? 0 : point.x;\r\n\r\n point.y = Number(point.y) > BOT.maxArea.height ? BOT.maxArea.height : point.y;\r\n point.y = Number(point.y) < 0 ? 0 : point.y;\r\n\r\n var change = {\r\n x: Math.round(point.x - pen.x),\r\n y: Math.round(point.y - pen.y)\r\n }\r\n\r\n // Don't do anything if there's no change\r\n if (change.x == 0 && change.y == 0) {\r\n if (callback) callback(true);\r\n return 0;\r\n }\r\n\r\n var distance = Math.sqrt( Math.pow(change.x, 2) + Math.pow(change.y, 2));\r\n var speed = pen.state ? botConf.get('speed:drawing') : botConf.get('speed:moving');\r\n speed = (speed/100) * botConf.get('speed:max'); // Convert to steps from percentage\r\n\r\n // Sanity check speed value\r\n speed = speed > botConf.get('speed:max') ? botConf.get('speed:max') : speed;\r\n speed = speed < botConf.get('speed:min') ? botConf.get('speed:min') : speed;\r\n\r\n var duration = Math.abs(Math.round(distance / speed * 1000)); // How many steps a second?\r\n\r\n // Don't pass a duration of 0! Makes the EBB DIE!\r\n if (duration == 0) duration = 1;\r\n\r\n // Save the duration state\r\n pen.lastDuration = duration;\r\n\r\n pen.x = point.x;\r\n pen.y = point.y;\r\n\r\n if (botConf.get('controller').position == \"relative\") {\r\n // Invert X or Y to match stepper direction\r\n change.x = gConf.get('invertAxis:x') ? change.x * -1 : change.x;\r\n change.y = gConf.get('invertAxis:y') ? change.y * -1 : change.y;\r\n } else { // Absolute! Just use the \"new\" absolute X & Y locations\r\n change.x = pen.x;\r\n change.y = pen.y;\r\n }\r\n\r\n // Swap motor positions\r\n if (gConf.get('swapMotors')) {\r\n change = {\r\n x: change.y,\r\n y: change.x\r\n }\r\n }\r\n\r\n // Queue the final serial command\r\n run('move', {x: change.x, y: change.y}, duration);\r\n\r\n if (callback) {\r\n if (immediate == 1) {\r\n callback(1);\r\n } else {\r\n // Set the timeout to occur sooner so the next command will execute\r\n // before the other is actually complete. This will push into the buffer\r\n // and allow for far smoother move runs.\r\n\r\n var cmdDuration = Math.max(duration - gConf.get('bufferLatencyOffset'), 0);\r\n\r\n if (cmdDuration < 2) {\r\n callback(1);\r\n } else {\r\n setTimeout(function(){callback(1);}, cmdDuration);\r\n }\r\n\r\n }\r\n }\r\n\r\n return distance;\r\n }\r\n\r\n // Wiggle Pen for WCB toolchanges\r\n function wigglePen(axis, travel, iterations){\r\n var start = {x: Number(pen.x), y: Number(pen.y)};\r\n var i = 0;\r\n travel = Number(travel); // Make sure it's not a string\r\n\r\n // Start the wiggle!\r\n _wiggleSlave(true);\r\n\r\n function _wiggleSlave(toggle){\r\n var point = {x: start.x, y: start.y};\r\n\r\n if (axis == 'xy') {\r\n var rot = i % 4; // Ensure rot is always 0-3\r\n\r\n // This confuluted series ensure the wiggle moves in a proper diamond\r\n if (rot % 3) { // Results in F, T, T, F\r\n if (toggle) {\r\n point.y+= travel/2; // Down\r\n } else {\r\n point.x-= travel; // Left\r\n }\r\n } else {\r\n if (toggle) {\r\n point.y-= travel/2; // Up\r\n } else {\r\n point.x+= travel; // Right\r\n }\r\n }\r\n } else {\r\n point[axis]+= (toggle ? travel : travel * -1);\r\n }\r\n\r\n movePenAbs(point);\r\n\r\n i++;\r\n\r\n if (i <= iterations){ // Wiggle again!\r\n _wiggleSlave(!toggle);\r\n } else { // Done wiggling, go back to start\r\n movePenAbs(start);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "4276180e80399c37a0e3a8bfeb601c34", "score": "0.51117676", "text": "enterPr_port(ctx) {\n\t}", "title": "" }, { "docid": "838a384ef36aa8b6dc340352c44420d0", "score": "0.5103752", "text": "function setup() {\n createCanvas(400, 300);\n serial = new p5.SerialPort(); // make a new instance of the serialport library\n //serial.on('list', printList); // set a callback function for the serialport list event\n serial.on('connected', serverConnected); // callback for connecting to the server\n serial.on('open', portOpen); // callback for the port opening\n serial.on('data', serialEvent); // callback for when new data arrives\n serial.on('error', serialError); // callback for errors\n serial.on('close', portClose); // callback for the port closing\n \n serial.list(); // list the serial ports\n serial.open(portName); // open a serial port\n song1.setVolume(0.5);\n song2.setVolume(0.5);\n song3.setVolume(0.5);\n song4.setVolume(0.5);\n \n}", "title": "" }, { "docid": "ca2fa553ac601afd5c0ff1b52c3e0fbe", "score": "0.5068601", "text": "function listen() {\n\tconsole.log('port open');\n\tconsole.log('baud rate: ' + myPort.options.baudRate);\n\tmyPort.on('data', printIncoming);\t// called when there's new incoming serial data\n\t\n\t// you only need this function if your port is open,\n\t// so it's local to the listen() function:\n\tfunction printIncoming(data) {\n\t\t// data buffer will be variable length\n\t\t// depending on how fast the transmitting device is sending. \n\t\t// read each byte of the buffer:\n\t\tfor (var c=0; c<data.length; c++) {\n\t\t\tconsole.log(data.readUInt8(c));\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "700f2e4769b37a192497fd83e1d5e614", "score": "0.5057867", "text": "open() {\n return new Promise((resolve, reject) => {\n try {\n this.serialport.open(() => {\n this.events.on('ready', () => {\n resolve();\n });\n });\n } catch (error) {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "b3a7b1e1eb0a0155f982e4b29f500406", "score": "0.50559896", "text": "function Port(data) {\n this.self = this;\n this.isTcp = this.isSerial = this.isPortless = false;\n this.parse(data);\n }", "title": "" }, { "docid": "974fe126a79472b6a4d06088082b9995", "score": "0.5017594", "text": "function addPortlet(destinationList,type,settings){\n var isDefault=true;\n if (settings){\n\n isDefault=false\n }\n settings = settings || {type:type,\n testID: 1, \n order:1, \n devID:1, \n speed:50, \n freq:1, \n actTarget:50,\n stepTarget:90,\n errCheck:1,\n errType:1,\n errCnt:1};\n var output=\"1\";\n var title=\"1\";\n var devName='1';\n\n switch(parseInt(settings.type)){\n case 1:\n title=\"Actuator\";\n devName= \"Actuator\";\n break;\n case 2:\n title=\"Step\";\n devName= \"Actuator\";\n break;\n case 3:\n title=\"Force\";\n devName= \"Actuator\";\n break;\n case 4:\n title=\"Force\";\n devName= \"Actuator\";\n break;\n default:\n title=\"Default\";\n devName= \"Actuator\";\n break;\n };\n\nvar portletStart=\n '<li class=\"\">'+\n '<div class=\"portlet\">'+\n ' <div class=\"portlet-header\">'+title+'</div>'+\n '<div class=\"portlet-content\" style=\"display:none\"> ' +\n '<ul>';\n\n\n\nvar frequency= '<li>'+\n '<div>frequency:every </div>' +\n '<div><input name=\"freq\" class=\"spinner freqInput\" value=1></div>'+\n '<div>nth cycle</div>'+\n '</li>';\nvar devID= '<li><label>'+devName+' #</label>'+\n '<select name=\"devid\" class=\"devIDInput\">'+\n '<option value=\"1\">1</option>'+\n '<option value=\"2\">2</option>'+\n '<option value=\"3\">3</option>'+\n '</select>'+\n '</li>';\nvar actThrow= '<li>'+\n '<div>Throw</div>'+\n '<div class=\"slider actuatorSlider\" name=\"actTarg\"></div>'+\n '<div class=\"testBtn button\">test</div>'+\n '</li>';\n\n\nvar currentBtn= '<li>'+\n '<div class=\"button actuatorBtn\">use current</div>'+\n '</li>';\n\nvar speedSlider= '<li>'+\n '<div>Speed</div>'+\n '<div class=\"slider actuatorSlider\" name=\"speed\"></div>'+\n '</li>';\n\nvar portletEnd= '<form class=\"actionSettings\">'+\n '<input type=\"hidden\" name=\"testID\" value='+settings.testID+'>'+\n '<input type=\"hidden\" name=\"order\" value='+settings.order+'>'+\n '<input type=\"hidden\" name=\"type\" value='+settings.type+'>'+\n '<input type=\"hidden\" class=\"speedVal\" name=\"speed\" value='+settings.speed+'>'+\n '<input type=\"hidden\" class=\"devIDVal\" name=\"devID\" value='+settings.devID+'>'+\n '<input type=\"hidden\" class=\"freqVal\" name=\"freq\" value='+settings.freq+'>'+\n '<input type=\"hidden\" class=\"actTargVal\" name=\"actTarg\" value='+settings.actTarget+'>'+\n '<input type=\"hidden\" class=\"stepTargVal\" name=\"stepTarg\" value='+settings.stepTarget+'>'+\n '<input type=\"hidden\" class=\"errCheckVal\" name=\"errCheck\" value='+settings.errCheck+'>'+\n '<input type=\"hidden\" class=\"errTypeVal\" name=\"errType\" value='+settings.errType+'>'+\n '<input type=\"hidden\" class=\"errCntVal\" name=\"errCnt\" value='+settings.errCnt+'>'+\n '</form>'+\n '</ul>'+\n '</div>'+\n '</div>'+\n '</li>';\n\n switch(parseInt(settings.type)){\n case 1:\n output= portletStart+\n frequency+\n devID+\n actThrow+\n currentBtn+\n speedSlider+\n portletEnd;\n break;\n default:\n output= portletStart+\n frequency+\n devID+\n actThrow+\n currentBtn+\n speedSlider+\n portletEnd;\n break;\n };\n //$(destinationList).find(ul).append(output);\n\n if (isDefault){\n $('#'+destinationList).find('.leftList').append(output);\n }\n else{\n $('#'+destinationList).find('.actionList').append(output);\n }\n \n}", "title": "" }, { "docid": "2e8065a14f5b34ec2fe7c170695600cf", "score": "0.5017091", "text": "function startEditorServers(ports) {\n ports.forEach(function (port) {\n // Setup HTTP Server\n var httpServer = http.createServer(function(req, res) {\n // Output the port number the server is running on\n res.writeHead(200, {'Content-Type': 'text/plain'});\n res.end(port.toString());\n });\n\n // Listen on assigned port\n httpServer.listen(port);\n });\n}", "title": "" }, { "docid": "05c11d51729c20083df457f4f3b1d149", "score": "0.49963677", "text": "function start(port) {\n\tif (!port) {\n\t\tport = DEFAULT_SERIAL_PORT;\n\t}\n\n\t// Init serial port connection\n\tgSerialPort = new SerialPort(port, {\n\t baudRate: BAUD_RATE,\n\t parser: SP.parsers.readline(\"\\r\")\n\t});\n\n\t// Listen for \"open\" event form serial port\n\tgSerialPort.on('open', () => {\n\t console.log('Serial Port opened');\n\n\t \t\t// Start watchdog timer.\n\t \t\tgWatchdogTimer = new Watchdog();\n\n\t \t\t// Notify app if watchdog timer expires.\n\t \t\tgWatchdogTimer.on('timeout', () => {\n\t \t\t\tconsole.error('Gateway watchdog timer expired!');\n\t \t\t\treconnect(port);\n\t \t\t\tWS.sendDeadGatewayMessage();\n\t \t\t});\n\n\t // Listen for \"data\" event from serial port\n\t gSerialPort.on('data', handleData);\n\t});\n\n\tgSerialPort.on('error', (err) => {\n\t\tconsole.error('Serial Port Error: ', err);\n\t});\n\n\tgSerialPort.on('close', () => {\n\t\tconsole.log('Serial Port connection closed.');\n\t\tgWatchdogTimer.dispose();\n\t});\n}", "title": "" }, { "docid": "21399b6f2789be478901387070d879b1", "score": "0.4995266", "text": "function openPort(sock, portName, baudrate, connMode) {\n/* Return a promise to open wired or wireless port at portName with baudrate and connect to browser sock. If wireless, the port is opened\n as a Telnet-based debug service.\n sock can be null to open port without an associated browser socket\n portName is the string name of the wired or wireless port\n baudrate is optional; defaults to initialBaudrate\n connMode is the current point of the connection; 'debug', 'programming'\n Resolves (with nothing); rejects with Error*/\n return new Promise(function(resolve, reject) {\n baudrate = baudrate ? parseInt(baudrate) : initialBaudrate;\n var port = findPort(byName, portName);\n if (port) {\n if (port.isWired) { /*Wired port*/\n if (port.connId) {\n //Already open; ensure correct baudrate, socket, and connMode, then resolve.\n updatePort(port, {bSocket: sock, mode: connMode, baud: baudrate})\n .then(function() {resolve()})\n .catch(function(e) {reject(e)});\n } else {\n //Not already open; attempt to open it\n chrome.serial.connect(port.path, {bitrate: baudrate, dataBits: 'eight', parityBit: 'no', stopBits: 'one', ctsFlowControl: false},\n function (openInfo) {\n if (!chrome.runtime.lastError) {\n // No error; update serial port object\n updatePort(port, {connId: openInfo.connectionId, bSocket: sock, mode: connMode});\n port.baud = baudrate; //Update baud; does not use updatePort() to avoid unnecessary port activity\n log(\"Port \" + portName + \" open with ID \" + openInfo.connectionId + \" at \" + baudrate + \" baud\", mDbug);\n resolve();\n } else {\n // Error\n reject(Error(notice(neCanNotOpenPort, [port.name])));\n }\n }\n );\n }\n } else { /*Wireless port*/\n openSocket(port, false)\n .then(updatePort(port, {bSocket: sock, mode: connMode, baud: baudrate})\n .then(function() {resolve()})\n .catch(function (e) {reject(e)}));\n }\n } else {\n // Error; port record not found\n reject(Error(notice(neCanNotFindPort, [portName])));\n }\n });\n}", "title": "" }, { "docid": "fbe2de7f7b50e97f0285e7e6e626ba89", "score": "0.49949634", "text": "async connect() {\n return new Promise((resolve, reject) => {\n this.serialPort.open((error) => {\n if (error) {\n return reject(`Error connecting to serial port: '${error}'`)\n }\n this.connected = true\n resolve()\n })\n\n this.serialPort.on('close', () => {\n this.connected = false\n console.debug(\"Serial port closed\")\n })\n\n this.serialPort.on('error', (error) => {\n this.connected = false\n console.debug(`Serial port error: ${error}`)\n })\n })\n }", "title": "" }, { "docid": "5194e52aefddae3f4a7e277667143cad", "score": "0.4987497", "text": "portFind(callback = null) {\r\n var portNum = this.portNum;\r\n var manufacturerName = 'Moxa'; // manufacture name\r\n this.serial.list(function(err, ports) {\r\n var allports = ports.length;\r\n var count = 0;\r\n ports.forEach(function(port) {\r\n count += 1;\r\n var pm = port['manufacturer'];\r\n // console.log(pm)\r\n if (typeof pm !== 'undefined' && pm.includes(manufacturerName)) {\r\n var moxaport = port.comName.toString();\r\n var res = false;\r\n if (portNum == moxaport) {\r\n res = true;\r\n } else {\r\n res = false;\r\n }\r\n if (callback != null) {\r\n callback(res);\r\n }\r\n }\r\n });\r\n });\r\n }", "title": "" }, { "docid": "2268f2fe8497463fc560ba052b6e8269", "score": "0.4974886", "text": "function validatePorts() {\r\n let valid = true\r\n let portErrorDisplayed = ''\r\n\r\n // Validate each port entry\r\n const queryList = portList.querySelectorAll('.portNumber')\r\n for (let i = 0; i < queryList.length; i++) {\r\n const portInput = queryList[i]\r\n const errorMessage = validPortInput(portInput)\r\n if (errorMessage !== '') {\r\n valid = false\r\n // Highlight the erroneous port\r\n portInput.classList.add('invalidPort')\r\n // Only display the first error message\r\n if (portErrorDisplayed === '') {\r\n portErrorDisplayed = errorMessage\r\n }\r\n }\r\n else {\r\n portInput.classList.remove('invalidPort')\r\n }\r\n }\r\n\r\n // Remove any existing error message\r\n while (portError.firstChild) {\r\n portError.removeChild(portError.firstChild)\r\n }\r\n\r\n // If we have an error, display it\r\n if (portErrorDisplayed !== '') {\r\n portError.appendChild(document.createTextNode(portErrorDisplayed))\r\n }\r\n\r\n return valid\r\n }", "title": "" }, { "docid": "ec23c1995a30a787f9ba0a63aab5ffea", "score": "0.49485996", "text": "function integrationTest(platform, testPort, Binding) {\n const testFeature = makeTestFeature(platform);\n\n describe(`${platform} SerialPort Integration Tests`, () => {\n if (!testPort) {\n it(`${platform} tests requires an Arduino loaded with the arduinoEcho program on a serialport set to the TEST_PORT env var`);\n return;\n }\n\n before(() => {\n if (Binding === MockBinding) {\n MockBinding.createPort(testPort, { echo: true, readyData });\n }\n SerialPort.Binding = Binding;\n });\n\n describe('static Method', () => {\n describe('.list', () => {\n it('contains the test port', (done) => {\n function normalizePath(name) {\n const parts = name.split('.');\n return parts[parts.length - 1].toLowerCase();\n }\n\n SerialPort.list((err, ports) => {\n assert.isNull(err);\n let foundPort = false;\n ports.forEach((port) => {\n if (normalizePath(port.comName) === normalizePath(testPort)) {\n foundPort = true;\n }\n });\n assert.isTrue(foundPort);\n done();\n });\n });\n });\n });\n\n describe('constructor', () => {\n it('provides an error in callback when trying to open an invalid port', function(done) {\n this.port = new SerialPort('COMBAD', (err) => {\n assert.instanceOf(err, Error);\n done();\n });\n });\n\n it('emits an error event when trying to open an invalid port', (done) => {\n const port = new SerialPort('COM99');\n port.on('error', (err) => {\n assert.instanceOf(err, Error);\n done();\n });\n });\n });\n\n describe('opening and closing', () => {\n it('can open and close', (done) => {\n const port = new SerialPort(testPort);\n port.on('open', () => {\n assert.isTrue(port.isOpen);\n port.close();\n });\n port.on('close', () => {\n assert.isFalse(port.isOpen);\n done();\n });\n });\n\n it('cannot be opened again after open', (done) => {\n const port = new SerialPort(testPort, (err) => {\n assert.isNull(err);\n port.open((err) => {\n assert.instanceOf(err, Error);\n port.close(done);\n });\n });\n });\n\n it('cannot be opened while opening', (done) => {\n const port = new SerialPort(testPort, { autoOpen: false });\n port.open((err) => {\n assert.isNull(err);\n });\n port.open((err) => {\n assert.instanceOf(err, Error);\n });\n port.on('open', () => {\n port.close(done);\n });\n });\n\n it('can open and close ports repetitively', (done) => {\n const port = new SerialPort(testPort, { autoOpen: false });\n port.open((err) => {\n assert.isNull(err);\n port.close((err) => {\n assert.isNull(err);\n port.open((err) => {\n assert.isNull(err);\n port.close(done);\n });\n });\n });\n });\n\n it('can be read after closing and opening', function(done) {\n this.timeout(6000);\n const port = new SerialPort(testPort, { autoOpen: false });\n port.on('error', done);\n\n port.open((err) => {\n assert.isNull(err);\n });\n port.once('data', () => {\n port.close();\n });\n\n port.once('close', (err) => {\n assert.isNull(err);\n port.open((err) => {\n assert.isNull(err);\n });\n port.once('data', () => {\n port.close(done);\n });\n });\n });\n\n it('errors if closing during a write', (done) => {\n const port = new SerialPort(testPort, { autoOpen: false });\n port.open(() => {\n port.on('error', err => {\n assert.instanceOf(err, Error);\n port.close(() => done());\n });\n port.write(Buffer.alloc(1024 * 5, 0));\n port.close();\n });\n });\n });\n\n describe('#update', () => {\n testFeature('port.update-baudrate', 'allows changing the baud rate of an open port', (done) => {\n const port = new SerialPort(testPort, () => {\n port.update({ baudRate: 57600 }, (err) => {\n assert.isNull(err);\n port.close(done);\n });\n });\n });\n });\n\n describe('#read and #write', () => {\n it('2k test', function(done) {\n this.timeout(20000);\n // 2k of random data\n const input = crypto.randomBytes(1024 * 2);\n const port = new SerialPort(testPort);\n port.on('error', done);\n const ready = port.pipe(new SerialPort.parsers.Ready({ delimiter: readyData }));\n\n // this will trigger from the \"READY\" the arduino sends when it's... ready\n ready.on('ready', () => {\n port.write(input);\n });\n\n const readData = Buffer.alloc(input.length, 0);\n let bytesRead = 0;\n ready.on('data', (data) => {\n bytesRead += data.copy(readData, bytesRead);\n if (bytesRead >= input.length) {\n try {\n assert.equal(readData.length, input.length, 'write length matches');\n assert.deepEqual(readData, input, 'read data matches expected readData');\n port.close(done);\n } catch (e) {\n done(e);\n }\n }\n });\n });\n });\n\n describe('#flush', () => {\n it('discards any received data', (done) => {\n const port = new SerialPort(testPort);\n port.on('open', () => process.nextTick(() => {\n port.flush(err => {\n port.on('readable', () => {\n try {\n assert.isNull(port.read());\n } catch (e) {\n return done(e);\n }\n done(new Error('got a readable event after flushing the port'));\n });\n try {\n assert.isNull(err);\n assert.isNull(port.read());\n } catch (e) {\n return done(e);\n }\n port.close(done);\n });\n }));\n });\n it('deals with flushing during a read', (done) => {\n const port = new SerialPort(testPort);\n port.on('error', done);\n const ready = port.pipe(new SerialPort.parsers.Ready({ delimiter: 'READY' }));\n ready.on('ready', () => {\n // we should have a pending read now since we're in flowing mode\n port.flush((err) => {\n try {\n assert.isNull(err);\n } catch (e) {\n return done(e);\n }\n port.close(done);\n });\n });\n });\n });\n\n describe('#drain', () => {\n it('waits for in progress or queued writes to finish', (done) => {\n const port = new SerialPort(testPort);\n port.on('error', done);\n let finishedWrite = false;\n port.write(Buffer.alloc(10), () => {\n finishedWrite = true;\n });\n port.drain((err) => {\n assert.isNull(err);\n assert.isTrue(finishedWrite);\n done();\n });\n });\n });\n });\n}", "title": "" }, { "docid": "f5871366b25095b3e7b694a731107194", "score": "0.49330992", "text": "scan (){\r\n this.comm.getDeviceList().then(result => {\r\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\r\n });\r\n }", "title": "" }, { "docid": "fe58e48a35a3d44838e4bb6093813ebf", "score": "0.49309188", "text": "function initArduino() {\n const arduino = usb.findByIds(aVID, aPID);\n arduino.open();\n const arduinoInterface = arduino.interfaces[aInterface];\n // USB port can be busy, so we free them\n if (arduinoInterface.isKernelDriverActive) {\n try {\n arduinoInterface.detachKernelDriver();\n }\n catch (err) { }\n }\n arduinoInterface.claim();\n arduinoEndpoint = arduinoInterface.endpoints[aOutEndpoint];\n arduinoEndpoint.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\n}", "title": "" }, { "docid": "0af042d1676e428c337bf40a0956df15", "score": "0.4911943", "text": "function populatePortList(result, aNode){\n\t$('#portDropDown').empty();\n\t$('#displayPort').empty();\n\t$('#portStatInfoTable').empty();\n\t\n\tconsole.log(result);\n\t$.each(result.Port_Names, function(i,port) {\n\t\t$.getJSON(\"./?a=ws&wspath=synchronize_network_node_\"+aNode+\"_port_\"+result.Port_Index[i], function(data1) {\n\t\t\t$('#portDropDown').append('<li><a onClick=PortSelectStat(\"'+port+'\",\"'+result.Port_Index[i]+'\");>'+port+'</a></li>');\n\t })\n\t .fail(function (jqxhr, textStatus, error){\n\t \talertMessage(\"Could not retrieve network nodes. Reason: \"+jqxhr.status+\" (\"+error+\")\",false);\n\t });\n\t});\n}", "title": "" }, { "docid": "a53dbfaadb872828048573c931ba24d1", "score": "0.4908936", "text": "function init(){\n app = Elm.Main.fullscreen();\n app.ports.getScrollbarWidth.subscribe(function(){\n setTimeout(function(){\n sendScrollBarWidth();\n },4);\n });\n\n app.ports.saveSettingsDbUrl.subscribe(function(dbUrl){\n saveSettingsDbUrl(dbUrl);\n });\n app.ports.saveSettingsApiServer.subscribe(function(apiServer){\n saveSettingsApiServer(apiServer);\n });\n app.ports.getSettingsDbUrl.subscribe(function(){\n setTimeout(function(){//TODO: had to put timeout, seems curtain.js ports calls are not received\n sendSettingsDbUrl();\n }, 4);\n });\n app.ports.getSettingsApiServer.subscribe(function(){\n setTimeout(function(){//TODO: had to put timeout, seems curtain.js ports calls are not received\n sendSettingsApiServer();\n }, 4);\n });\n}", "title": "" }, { "docid": "06d0ba0c883667d31fc7d89428591b28", "score": "0.48990455", "text": "function initializeInputPort(name){\n\t\t\tconst input = findInputPort(name);\n\t\t\tif (input){\n\t\t\t\tinput.addEventListener('midimessage', onMIDIMessage);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f9ba2cd4e45f799ac0f7dfc478d91ba6", "score": "0.4896232", "text": "portOpen() {\n\t\t\n\t\t//*******Serial port open\n\t\tport.open( (err) => {\n\t\t\t\n\t\t\t// 에러 발생으로 포트를 오픈하지 못했을 때 포트오픈 다시 시도\n\t\t\tif(err) {\n\t\t\t\terrlog.error(err.message);\n\t\t\t\temitter.emit('portOpen');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tlogger.info('serial port open!');\n\t\t\t\n\t\t\t// 신호세기 설정\n\t\t\tport.write(config_command, (err) => {\n\t\t\t\t\n\t\t\t\tif(err){\n\t\t\t\t\terrlog.error(err.message);\n\t\t\t\t}\t\n\t\t\t});\n\t\t\t\n\t\t\t// Write Count 0 으로 리셋\n\t\t\twriteCnt = 0;\n\t\t\t\n\t\t\t// Write 최초 실행\n\t\t\tport.write(command_read, (err) => {\n\t\t\t\t\n\t\t\t\tif(err){\n\t\t\t\t\terrlog.error(err.message);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twriteCnt += 1;\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\t// Write Interval\n\t\t\t// 0.5초 간격으로 Write 실행\n\t\t iv = setInterval(() => {\n\t\t\t\tport.write(command_read, (err) => {\n\t\t\t\t\t\n\t\t\t\t\tif(err){\n\t\t\t\t\t\terrlog.error(err.message);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// readable 이벤트 발생 시 writeCount가 0으로 리셋됨\n\t\t\t\t\t// readable 이벤트가 발생하지 않고 write만 할 경우 Count가 계속 올라가며\n\t\t\t\t\t// 이 경우 리더기의 전원이 켜지지 않은 것으로 보고 에러메세지 출력\n\t\t\t\t\tif(writeCnt > 3){\n\t\t\t\t\t\t\n\t\t\t\t\t\terrlog.error('Read Fail.... Try Turn On The Rfid Reader');\n\t\t\t\t\t\terrlog.error('Write Count : ', writeCnt);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// write Count 가 100을 넘으면 포트를 닫고 다시 오픈\n\t\t\t\t\t\tif(writeCnt > 100){\n\t\t\t\t\t\t\tport.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// body 데이터와 tag id를 초기화\n\t\t\t\t\t\tresponse_body = [];\n\t\t\t\t\t\ttag_id = null;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\twriteCnt += 1;\n\t\t\t\t});\n\t\t }, 500);\n\t\t});\n\t}", "title": "" }, { "docid": "d0a72ede48c0fc2edfde50e3ac2cc63e", "score": "0.48731107", "text": "function SendPortSync() {\n}", "title": "" }, { "docid": "5de2b7758dca75fa8ca34fae4b0d6512", "score": "0.48594207", "text": "function createMIDIPorts(callback) {\n var inputs = jazzInstance.MidiInList();\n var outputs = jazzInstance.MidiOutList();\n var numInputs = inputs.length;\n var numOutputs = outputs.length;\n\n loopCreateMIDIPort(0, numInputs, 'input', inputs, function () {\n loopCreateMIDIPort(0, numOutputs, 'output', outputs, callback);\n });\n }", "title": "" }, { "docid": "392711aa1161390392b7a2d3f35e5439", "score": "0.48504752", "text": "function makePortEntry(portValue, descriptionValue) {\r\n const li = document.createElement('LI')\r\n\r\n const portInput = document.createElement('INPUT')\r\n portInput.className = 'portNumber'\r\n portInput.value = portValue\r\n portInput.addEventListener('input', onInput)\r\n li.appendChild(portInput)\r\n\r\n const descriptionInput = document.createElement('INPUT')\r\n descriptionInput.className = 'portDescription'\r\n descriptionInput.value = descriptionValue\r\n descriptionInput.addEventListener('input', onInput)\r\n li.appendChild(descriptionInput)\r\n\r\n const deleteIcon = document.createElement('DIV')\r\n deleteIcon.className = 'deleteIcon'\r\n deleteIcon.title = 'Delete port'\r\n deleteIcon.addEventListener('click', onDeleteClick)\r\n li.appendChild(deleteIcon)\r\n\r\n return li\r\n }", "title": "" }, { "docid": "bcf889eb47e1ac3356fc18cb9afc7a07", "score": "0.48321944", "text": "function selectPort(port) {\n port.open().then(function (midiPort) {\n if (isValidInput(midiPort)) {\n $scope.midiSelectedInput = midiPort;\n WebMidi.setSelectedMIDIInput(midiPort);\n midiPort.onmidimessage = function (note) {\n $scope.lastCommand = Array.from(note.data);\n $rootScope.$broadcast('keyevent', note);\n $scope.$applyAsync();\n };\n } else if (isValidOutput(midiPort)) {\n $scope.midiSelectedOutput = midiPort;\n WebMidi.setSelectedMIDIOutput(midiPort);\n } else {\n console.error('Not a MIDIPort');\n }\n\n if (hasValidSelectedOutput()) {\n renderKeyboard();\n }\n\n $scope.$applyAsync();\n console.log('Successfully opened port for ' + midiPort.constructor.name + ' | ' + midiPort.id);\n }, function (error) {\n console.error(error);\n });\n }", "title": "" }, { "docid": "afc68ed6d7b157a25910a7e6d8b24e9d", "score": "0.4830735", "text": "function getListPrinters() {\n let listDeviceDsc = [];\n const escpos = require('escpos');\n escpos.USB = require('escpos-usb');\n try {\n new escpos.USB();\n var listDevice = escpos.USB.findPrinter();\n } catch (error) {\n console.log('No se puedieron obtener impresoras', error);\n return listDeviceDsc;\n }\n for (let i = 0; i < listDevice.length; i++) {\n let idVendor = listDevice[i].deviceDescriptor['idVendor'];\n let idProduct = listDevice[i].deviceDescriptor['idProduct'];\n listDeviceDsc.push(findPrinterProperties(idVendor, idProduct))\n }\n return listDeviceDsc;\n}", "title": "" }, { "docid": "18d6e8f69ff058ec275524d8662a9cb8", "score": "0.4828726", "text": "function readSerial(){\n\t\nvar myPort=new serialPort('/dev/ttyACM0',{baudRate:9600, parser:serialPort.parsers.readline});\n\nmyPort.on('open',function(){\n\tconsole.log('Serial Port Open');\n\n\tmyPort.on('data',function(data){ \n\t\tdataarray.push(data.toString().split('\\r\\n'));\n\t\tconsole.log(dataarray[0][0]+\" \"+dataarray[0][1]+\" \"+dataarray[0][2]+\" \"+dataarray[0][3]);\n\t\ttest();\n});\n\t\n});\n\n}", "title": "" }, { "docid": "d8dc261be868455eaadfa44eb6ef568e", "score": "0.4825828", "text": "function gotOpen() {\n print(\"Serial Port is open!\");\n}", "title": "" }, { "docid": "74acc30faf09f9ddfc3d597ee4db4251", "score": "0.4821521", "text": "initialize()\n {\n /** @ignore */\n this.model = InputPortType;\n this._route = 'inputporttypes';\n }", "title": "" }, { "docid": "f81f73720d67a7a30f8202385484aadb", "score": "0.48212078", "text": "function portOptionsDialog() {\n\n // invoked when the OK button is pressed on this dialog\n function dOk() {\n $log.debug('Port Options Dialog OK button pressed');\n $log.debug('Sending event', portsOp, ctx);\n wss.sendEvent(portsOp, ctx);\n }\n\n tds.openDialog()\n .setTitle('Select Port Options')\n .addContent(createPortOptionsContent())\n .addCancel()\n .addOk(dOk) // NOTE: NOT the \"chained\" version!\n .bindKeys();\n }", "title": "" }, { "docid": "8cec66bb26301dd084f55e6c051862d1", "score": "0.48178154", "text": "function onInput(e) {\r\n validatePorts()\r\n }", "title": "" }, { "docid": "38e7fd02245f283cb1f338b6ee736f6b", "score": "0.4815476", "text": "function devicelistListener() {\n var args = Array.prototype.slice.call(arguments, 0);\n for (var i = 0; i < args.length; i += 2) {\n var deviceId = args[i];\n var deviceName = args[i + 1];\n self.devices.push(new Device(liveosc, deviceId, self, 'master', deviceName));\n }\n }", "title": "" } ]
cfb552cbbade27d311402c84c4688d84
we will not fire anything until users of this library explicitly call `on()` method.
[ { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.0", "text": "function noop() {}", "title": "" } ]
[ { "docid": "23d8f6c8dd457ed315fa9ee7f7d3425d", "score": "0.7543314", "text": "function _onNothing() {}", "title": "" }, { "docid": "d0361a4de9299ce1f97f4679ab2ffd43", "score": "0.66344833", "text": "onNotification() {}", "title": "" }, { "docid": "babe160411eae8c9f83b15c8a8005938", "score": "0.6604336", "text": "onEvent() {\n\n }", "title": "" }, { "docid": "84127ad4a3697baf3d7221ffa07fe74e", "score": "0.65991163", "text": "on(event, callback) {\n // Do nothing as request already fired with appropriate handling\n }", "title": "" }, { "docid": "1feb5b354711a68e21b3031d4568b930", "score": "0.65681905", "text": "on(...args) {\n\t\treturn this.evH.on(...args)\n\t}", "title": "" }, { "docid": "c64837a23c9c5295b63a6acdac4369a8", "score": "0.64728457", "text": "constructor () {\n this._onTriggered = null;\n }", "title": "" }, { "docid": "76a717b27e7475e6f9353d0f498a7d73", "score": "0.64158094", "text": "static soloOn(name, callback) {\n eventBus.off(name, callback);\n eventBus.on(name, callback);\n }", "title": "" }, { "docid": "369c4ab82759e80c2107fac643ce20b2", "score": "0.637886", "text": "onPing() {\n this.sendEvent('pong', null);\n }", "title": "" }, { "docid": "1e52a43a4d86e99452f8273243e5712b", "score": "0.6353033", "text": "_onSomething () {\n // Do something\n }", "title": "" }, { "docid": "faedec86b12db9bb041cd22c260353a0", "score": "0.6342317", "text": "onEnable() { }", "title": "" }, { "docid": "83dc74f0dfe53d6b3f7d1698f2da6f8b", "score": "0.6340345", "text": "async on_trigger() {\n // wakeup the caller and wait for it to ack back\n this.notifier.wakeup();\n await this.holder.wait();\n\n this.counter += 1;\n\n // wakeup the caller and wait for it to ack back\n this.notifier.wakeup();\n await this.holder.wait();\n\n // fail only after the last ack so the caller can be ready\n if (this.fail) {\n throw error_utils.stackless(new Error('TEST ERROR INJECTION'));\n }\n }", "title": "" }, { "docid": "4fd9700bb49ea5159ae93bed89bd9c7d", "score": "0.63109726", "text": "function whenUserDoesA(e,o,h){\r\n on(e,o,h);\r\n}", "title": "" }, { "docid": "ae8fd1c46d2e7be020481e40e6e19206", "score": "0.63044655", "text": "on(name, fn) {\n\t\tthis.ee.on(name, fn)\n\t}", "title": "" }, { "docid": "68d09d84e7c2e1619ab4f477bcd2b921", "score": "0.6244257", "text": "onNotification () {\n }", "title": "" }, { "docid": "84d27cceed02c9a6c1888987c4faf8a0", "score": "0.6241643", "text": "onRun() {}", "title": "" }, { "docid": "161e278620733589c2368d8b6274d61c", "score": "0.6233577", "text": "onStarting() {\r\n // Stub\r\n }", "title": "" }, { "docid": "c9cc1f75012ec20f28c628449f3c76c2", "score": "0.62278664", "text": "onStarted() {\r\n // Stub\r\n }", "title": "" }, { "docid": "a7c7c8a604f2ac93c89f3c814e586425", "score": "0.6195697", "text": "function onReady() {}", "title": "" }, { "docid": "549f3a353164d1055abb02ab4faf78e0", "score": "0.61640614", "text": "on(name, fn) {\n this.ee.on(name, fn);\n }", "title": "" }, { "docid": "1df69eed0ebedcb4d6ac93efe2f7e3c9", "score": "0.6133709", "text": "trackEvent() {}", "title": "" }, { "docid": "3b9ac7e971c10be7f59a9304817af3b5", "score": "0.611525", "text": "on(...args)\n {\n }", "title": "" }, { "docid": "97675823863b5021b2b867af0b9de429", "score": "0.610163", "text": "function on(e){return(on=\"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)}", "title": "" }, { "docid": "8a5f38af2acf1b300a4bc9369e155066", "score": "0.6096079", "text": "function onTick() {\n var notis;\n if (notTicked) {\n notis = notTicked;\n notTicked = undefined;\n notis.forEach(doNotify);\n }\n }", "title": "" }, { "docid": "4e4e748a148fccf877874812448c1633", "score": "0.60800916", "text": "initializeEvents() {\n console.warn(\"This method should be overridden by the implementation.\");\n }", "title": "" }, { "docid": "760100822c09bcfc38ade323ce26df4a", "score": "0.60606724", "text": "onSync() {}", "title": "" }, { "docid": "0e38fe4b97aa75c01947837814a146ed", "score": "0.6059497", "text": "run() {\n // if (!this.trigger) return\n // todo\n // this.trigger\n }", "title": "" }, { "docid": "f84e4cb40a4e22b95dfce042cc25d885", "score": "0.605685", "text": "function on (event, cb) {\n emitter.on(event, cb)\n }", "title": "" }, { "docid": "407967732ae1159437a2acb14ab67d6d", "score": "0.60421693", "text": "force() {\n\t\tthis.toggleListeners();\n\t}", "title": "" }, { "docid": "7fbda4f5e2d1eba7b891534e55e651cd", "score": "0.60245776", "text": "notify() {\n }", "title": "" }, { "docid": "9e799401020321b238e6154fd136410a", "score": "0.6005141", "text": "superceded() {\n this.invoked = true;\n }", "title": "" }, { "docid": "644e6b1666d1bda8a1e3eb1e5e3c5311", "score": "0.60005623", "text": "onCallback () {}", "title": "" }, { "docid": "c44d0c88b8c0d9c07a51e240655d9bcc", "score": "0.5974528", "text": "function notify() {\n listeners.forEach(listener => listener());\n }", "title": "" }, { "docid": "d3ec0c052e42253e67bfc359ed4daadd", "score": "0.59703976", "text": "onEmit(){\n\n\t}", "title": "" }, { "docid": "ab059d07ac6486774f899ff5d3e10159", "score": "0.59542257", "text": "$onStarting() {\r\n debug('On starting');\r\n }", "title": "" }, { "docid": "35cb55d442671c8901efd50b6e004095", "score": "0.59528315", "text": "onStarted() {\n }", "title": "" }, { "docid": "89c6c662684c57850e4a4c1bbe09fa74", "score": "0.5944744", "text": "function onready() {\n if (self._boundCount < self.sockets.length) return;\n\n self._bound = true;\n self._queue.forEach(function(item) {\n return self[item.action](item.device, item.promise);\n });\n }", "title": "" }, { "docid": "004f2d8c91fdc887339a11d45954e703", "score": "0.59420013", "text": "notify (evt) {\n this.readyStates.push(evt)\n this.callbacks.forEach(clb => {\n if (clb.event === evt) {\n if (clb.once && clb.called) {\n return\n }\n clb.called = true\n clb.callback()\n }\n })\n }", "title": "" }, { "docid": "c1586d6bae3a6b8251caedbe062877af", "score": "0.5937521", "text": "function main() {\n disableDef();\n eventing();\n }", "title": "" }, { "docid": "853720cfe401a741729c055ad3b3527b", "score": "0.59203935", "text": "on(...args) {\n\t\treturn this.tesseracts.on(...args)\n\t}", "title": "" }, { "docid": "bff8b64d0a09825d67b3af6fbd8731eb", "score": "0.5916733", "text": "onActivated() {\r\n // Stub\r\n }", "title": "" }, { "docid": "ec85017bcc5269b7ed9f26fdad38933e", "score": "0.59122384", "text": "on(level, callback) {}", "title": "" }, { "docid": "fa5185eb23f0f5208fbde21abe562a84", "score": "0.59039015", "text": "function applicationHandler ()\n{\n // Application level events\n app.host.on(\"reon\", function ()\n {\n console.log(\"Reconnect\");\n statusEl.textContent = \"Online \" + app.host.isUplinked();\n\n handleItemsDraw(items);\n });\n\n app.host.on(\"off\", function (spec, val)\n {\n statusEl.textContent = \"Offline \" + app.host.isUplinked();\n });\n\n app.host.on(\"reoff\", function (spec, val)\n {\n statusEl.textContent = \"Offline \" + app.host.isUplinked();\n });\n}", "title": "" }, { "docid": "35fd3459a539924c19cafb14515236d1", "score": "0.58849925", "text": "take_off(){\n this.on_signal(Remote.signals().up, 100);\n }", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.58558357", "text": "handleEvent() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.58558357", "text": "handleEvent() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.58558357", "text": "handleEvent() {}", "title": "" }, { "docid": "78200f7e9252f2483e4ab6a8f2a2e063", "score": "0.58470523", "text": "events() {}", "title": "" }, { "docid": "4a94f8abbba64c5e8ed47f79d512e1b4", "score": "0.58381724", "text": "function InternalEvent() { }", "title": "" }, { "docid": "06564ab3e71b4ca0b1def5751dfb1613", "score": "0.5837478", "text": "_registerEvent () {}", "title": "" }, { "docid": "e76ae6c42a9d87092a2e940c5e3e66e7", "score": "0.58302176", "text": "defer(cb) {\n this.event.once(\"*\", cb);\n }", "title": "" }, { "docid": "a4914208ba6693d69cab4fb6f05f1457", "score": "0.5822038", "text": "onReady(){ \n console.log(\"Hook ready\"); \n }", "title": "" }, { "docid": "f9e3fc7c6e230d783cdb221695898c14", "score": "0.5806668", "text": "on (eventName, handler){\n this._handlers[ eventName ] = handler; \n }", "title": "" }, { "docid": "5291b95a2fa13813ba76e5967741d5ec", "score": "0.57946485", "text": "run() {\n\n this.bot.on('start', this.onStart.bind(this));\n this.bot.on('message', this.onMessage.bind(this));\n this.bot.on('open', function() {});\n this.bot.on('close', function() {});\n\n }", "title": "" }, { "docid": "d0dac2594eaffd96174b0efb16e906ca", "score": "0.57865953", "text": "function userEvents() {\n}", "title": "" }, { "docid": "236c317ae6eab261c6a3a60a643c9958", "score": "0.5782904", "text": "function mitt(){const all=Object.create(null);return{on(type,handler){;(all[type]||(all[type]=[])).push(handler);},off(type,handler){if(all[type]){all[type].splice(all[type].indexOf(handler)>>>0,1);}},emit(type,...evts){// eslint-disable-next-line array-callback-return\n;(all[type]||[]).slice().map(handler=>{handler(...evts);});}};}", "title": "" }, { "docid": "18e1b897f4e54871bcd3a48cbd15f0cb", "score": "0.57798505", "text": "function IsOn() { return on; }", "title": "" }, { "docid": "101a7d3d7dcff206d2ac00354c33d5c2", "score": "0.57774186", "text": "onOpen() {}", "title": "" }, { "docid": "42a2b69fddca571206f91a03b3b06ee9", "score": "0.57695365", "text": "ready(){super.ready()}", "title": "" }, { "docid": "dafa7a14575338667027f56822d72fe8", "score": "0.5768051", "text": "_setupTriggerEventsIfEnabled() {\n if (!this.disabled && this._isInitialized) {\n this._rippleRenderer.setupTriggerEvents(this.trigger);\n }\n }", "title": "" }, { "docid": "dafa7a14575338667027f56822d72fe8", "score": "0.5768051", "text": "_setupTriggerEventsIfEnabled() {\n if (!this.disabled && this._isInitialized) {\n this._rippleRenderer.setupTriggerEvents(this.trigger);\n }\n }", "title": "" }, { "docid": "fae3ac73f71b7e0064687125a99c3a16", "score": "0.57637656", "text": "onMotorStart() {\n // Optional function.\n }", "title": "" }, { "docid": "6c9c81d85f6905e6136c59cf7659f564", "score": "0.5752349", "text": "enable() {\n if (!this.enabled) {\n this.bindEvents('on');\n }\n\n this.enabled = true;\n }", "title": "" }, { "docid": "386269e68063dd829a8df0f9dff4a1d3", "score": "0.5747523", "text": "execute() {\n assert && assert( false, 'This should not be called, use Emitter.emit() instead.' );\n }", "title": "" }, { "docid": "0fc3f8cffb4a18375b924805e00d925f", "score": "0.5745648", "text": "function trigger() {\n\t //\n\t}", "title": "" }, { "docid": "4a841ea0702a7f75c6e7a004d5496969", "score": "0.57456183", "text": "onMotorStart() {\n // Optional function.\n }", "title": "" }, { "docid": "35724e4397bd83f1b8e657f93ed7beee", "score": "0.57444954", "text": "function on(eventName, callBack){\n\t\tif(eventSupported.indexOf(eventName) == -1){\n\t\t\tconsole.log(\"Event: \" + eventName + \" currently not supported.\");\n\t\t\treturn;\n\t\t}\n\t\tif(typeof callBack == \"function\" && gameEndReason != \"Unknown\"){\n\t\t\tcallBack(gameEndReason);\n\t\t}\n\t}", "title": "" }, { "docid": "72a86e810f355a3a1d8ce2e87e17aa05", "score": "0.5738097", "text": "onLoad() {\n emitter.on(this, \"itemChange\", this.onItemChanged);\n emitter.on(this, \"itemEffect\", this.onItemEffect);\n }", "title": "" }, { "docid": "768d1f33212d21ff82d358ebd9953687", "score": "0.5736435", "text": "_addDefaultEvents () {\n\t\tthis.discord.on('error', console.error);\n\n\t\tthis.discord.on('message', (message) => {\n\t\t\t/* Ignore other bots and self */\n\t\t\tif (message.author.bot) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const caster of this._casters) {\n\t\t\t\tcaster.dispatchIncoming(\n\t\t\t\t\tnew DiscordMessageContext(caster, message, this.options.id)\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "baa94e5fdb2ee9d11564cf6ee8920065", "score": "0.572962", "text": "onSetup() {\n\n }", "title": "" }, { "docid": "7115f17f8c632ccf87bc9b19066470f8", "score": "0.5722953", "text": "on(playerid, eventname, _callback) {\n if (!this.initialized) {\n this.afterinit.push(() => {\n this.on(playerid, eventname, _callback);\n });\n } else {\n EventBus.subscribe(playerid, eventname, _callback);\n if (eventname === 'ready' && this.getPlayer(playerid) && this.getPlayer(playerid).alive) {\n EventBus.execute(_callback, 'ready', playerid);\n }\n }\n }", "title": "" }, { "docid": "5172baebb82712759023bbbf55c6931c", "score": "0.5717538", "text": "function onceHandler() {\n handler.apply(context || element, arguments);\n off(element, types, onceHandler, context);\n }", "title": "" }, { "docid": "66c3c69fbdc216bc17abd1747aa55305", "score": "0.5715156", "text": "onUp( callback ) {\n this._addCallback( 'up', 0, callback );\n }", "title": "" }, { "docid": "951dbb82cfee504a353142774ffc0061", "score": "0.5714979", "text": "initializeEvents () {\n }", "title": "" }, { "docid": "95d69b47f3a66e9dc181bf4dc21c60d6", "score": "0.5713362", "text": "on(event, handler) {\n\t\tthis.events.on(event, handler);\n\t}", "title": "" }, { "docid": "95d69b47f3a66e9dc181bf4dc21c60d6", "score": "0.5713362", "text": "on(event, handler) {\n\t\tthis.events.on(event, handler);\n\t}", "title": "" }, { "docid": "9be0ba13882635b5adb1370ca201b795", "score": "0.5711637", "text": "onping() {\n this.emitReserved(\"ping\");\n }", "title": "" }, { "docid": "9be0ba13882635b5adb1370ca201b795", "score": "0.5711637", "text": "onping() {\n this.emitReserved(\"ping\");\n }", "title": "" }, { "docid": "9be0ba13882635b5adb1370ca201b795", "score": "0.5711637", "text": "onping() {\n this.emitReserved(\"ping\");\n }", "title": "" }, { "docid": "9be0ba13882635b5adb1370ca201b795", "score": "0.5711637", "text": "onping() {\n this.emitReserved(\"ping\");\n }", "title": "" }, { "docid": "5642efe067245e6f46263d087db9b4a8", "score": "0.57094324", "text": "fireEvents() {\n const events = this.$$eventListeners.$$global\n , hasEvents = !!events\n ;\n\n if ( hasEvents ) {\n events.forEach( callback => {\n callback( this );\n } );\n }\n }", "title": "" }, { "docid": "a78ba36f3a9e4a8fc2c9a24c60f5f70c", "score": "0.5704771", "text": "onSilence(silent) {\n }", "title": "" }, { "docid": "62e1a59b0082804dda3382fecd762db6", "score": "0.57045573", "text": "onReady() { }", "title": "" }, { "docid": "7f9ec93330811834a0c4e6bfe63c53bf", "score": "0.5689709", "text": "init() {\n\t\tthis.onAddress();\n\t\tthis.onAddressNew();\n\t\tthis.onCheckMandatory();\n\t}", "title": "" }, { "docid": "bcd562eeaafaeed85fd5ed4ce586f80d", "score": "0.56893873", "text": "function fire(){\n \n}", "title": "" }, { "docid": "ae31ae8f8cd796cf8f0475417c5e22b3", "score": "0.56750315", "text": "function SauronListener() {\n var isInDOM = inDOM();\n\n // If we are in the DOM, fire the fn\n if (isInDOM) {\n fn.call(that);\n unbindListeners();\n }\n }", "title": "" }, { "docid": "8c2c043caffc7705abb7e8fde50ae051", "score": "0.566959", "text": "function dummyEvent() {\n console.log(\"It's me\");\n}", "title": "" }, { "docid": "6560efbf6a127791f22d97de55dd78c4", "score": "0.56634843", "text": "bindEvents() {}", "title": "" }, { "docid": "e557bc0a458357cf1158f70201bcc751", "score": "0.5661323", "text": "_onChanged() { }", "title": "" }, { "docid": "3cea3c1dc4f2042e79e2effba9ad6a49", "score": "0.5659306", "text": "onTick() {}", "title": "" }, { "docid": "ff3d0cfd7ffe644e366fe7fd9c05c8d7", "score": "0.5658679", "text": "function onAction() {\n // This is executed when the event is triggered\n}", "title": "" }, { "docid": "7ae3b651c7bc54f6b1fcea33c42705f4", "score": "0.564663", "text": "get onStateChanged() {}", "title": "" }, { "docid": "f3aaffc8e6d80837c72361357c892ab2", "score": "0.5641734", "text": "onRegister() { }", "title": "" }, { "docid": "f9fab561a597bb9586ed1e0bf5a6a99a", "score": "0.5639806", "text": "function observeEvents(_self) {\n _self.on('callApp', _self.catchCallApp, _self);\n }", "title": "" }, { "docid": "f4e0f4462492f6ae252d910a968f2cae", "score": "0.5636084", "text": "_on(name: string, cb: () => {}) {\n const oldSub = this._eventHandlers[name];\n\n if (oldSub) {\n oldSub.remove();\n this._eventHandlers[name] = null;\n }\n\n this._eventHandlers[name] = TapjoyModuleEvt.addListener(name, cb);\n\n return this._eventHandlers[name];\n }", "title": "" }, { "docid": "83c529f7c13ab6f98bd33860368717ea", "score": "0.563557", "text": "$n(t){this.On=t;}", "title": "" }, { "docid": "c29e71ab4bad727edb27b3436ff4956c", "score": "0.56339824", "text": "_attachToEventBus() {\n this.eventBus.on('changeCheckedLegends', this.onChangeCheckedLegends, this);\n\n if (this.onZoom) {\n this.eventBus.on({\n zoom: this.onZoom,\n resetZoom: this.onResetZoom\n }, this);\n }\n }", "title": "" }, { "docid": "bc4469658219c51eec7b8fcf145ce474", "score": "0.56240565", "text": "userInteractionObserver() {\n run.once(this, this.userInteractionObserverOnce);\n }", "title": "" }, { "docid": "71bc4e50a236c9f4e8cece437000afe6", "score": "0.5622404", "text": "assignCallbacks() {\n this.namespace.on('connection', (socket) => {\n this.onWhisper(socket);\n });\n }", "title": "" }, { "docid": "9dac5e40c36c92d842ffbd75118ca4d2", "score": "0.5622209", "text": "onNo() { // 'onNo' can be function, string, or array\n Logger.warn('Okay, as you wish...');\n\n // if you return here something it'll be executed\n }", "title": "" }, { "docid": "2380a1bc6803ef6d900b39d267e05879", "score": "0.5620815", "text": "async _onInternalTick() {\n //Invoking only if sampler is active\n if (this.Active) {\n let tickNumber = Sampler.convertDateToTickNumber(Date.now());\n if (\n this._shouldExternalTickBeEmitted(tickNumber) &&\n exists(this.ExternalTickHandler)\n ) {\n //Preventing tick method for throwing\n try {\n this._lastExternalTickNumber = tickNumber;\n await this.ExternalTickHandler(tickNumber);\n } catch (err) {}\n }\n }\n }", "title": "" }, { "docid": "0716ad593bab263961a17822c82f80b0", "score": "0.5619936", "text": "function handlePusher() {\n setPusher();\n }", "title": "" } ]
825cdab26e837bafe387ea5c3136fee1
DRAG RESTRICTION NOT WORKING
[ { "docid": "bb85050c7eef7d47c4dfa7f37e5c59a5", "score": "0.0", "text": "function dragElement(elmnt) {\n console.log('Configuring position of the drag');\n elmnt = document.getElementById(event.target.id);\n let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;\n // console.log('element', elmnt);\n\n elmnt.onmousedown = dragMouseDown;\n\n function dragMouseDown(e) {\n console.log('dragMouseDown!');\n e = e || window.event;\n e.preventDefault();\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n pos4 = e.clientY;\n\n console.log(pos3, pos4);\n document.onmouseup = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementDrag;\n }\n\n function elementDrag(e) {\n console.log('Dragging the element!')\n e = e || window.event;\n e.preventDefault();\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos2 = pos4 - e.clientY;\n pos3 = e.clientX;\n pos4 = e.clientY;\n\n console.log(pos3, pos4);\n // set the element's new position:\n // elmnt.style.top = (elmnt.offsetTop - pos2) + \"px\";\n // elmnt.style.left = (elmnt.offsetLeft - pos1) + \"px\";\n console.log('elmnt.style.left', elmnt.style.left);\n }\n function closeDragElement() {\n /* stop moving when mouse button is released:*/\n document.onmouseup = null;\n document.onmousemove = null;\n }\n}", "title": "" } ]
[ { "docid": "c078ad74418448d08178a1aade891610", "score": "0.65426344", "text": "function CdkDragDrop() {}", "title": "" }, { "docid": "c078ad74418448d08178a1aade891610", "score": "0.65426344", "text": "function CdkDragDrop() {}", "title": "" }, { "docid": "fe2d7034644736322ec2ff63594ac407", "score": "0.6519973", "text": "function DragRefInternal() {}", "title": "" }, { "docid": "fe2d7034644736322ec2ff63594ac407", "score": "0.6519973", "text": "function DragRefInternal() {}", "title": "" }, { "docid": "d380e07939b0082d70a6a4a953994c17", "score": "0.64719653", "text": "static AcceptDrag() {}", "title": "" }, { "docid": "4137beebb4b25b5976ccb1864c15f7ee", "score": "0.6466213", "text": "function drag(ev) {\r\n \tev.dataTransfer.effectAllowed = \"move\";\r\n \tsource =ev.target;\r\n }", "title": "" }, { "docid": "387a1046228fbfb67980d0dd74201f47", "score": "0.6455816", "text": "function dragShip(ev) {\n // ev.preventDefault();\n // if (!ev.target.classList.contains(\"grip\")) return;\n ev.dataTransfer.setData(\"ship\", ev.target.id);\n }", "title": "" }, { "docid": "8d5c5eddb6e77e57b915d45baab26ad2", "score": "0.6434435", "text": "_onDragStart ( event ) {\n event.stopPropagation();\n\n let selection = Editor.Selection.curSelection('asset');\n EditorUI.DragDrop.start(\n event.dataTransfer,\n 'copyMove',\n 'asset',\n selection.map(uuid => {\n let itemEL = this._id2el[uuid];\n return {\n id: uuid,\n name: itemEL.name,\n icon: itemEL.$.icon,\n };\n })\n );\n }", "title": "" }, { "docid": "404d5ce771e8994c02a1167b48e7d8d4", "score": "0.6433515", "text": "onDrag(e) {\n e.dataTransfer.setData(\"piece\", this)\n e.dataTransfer.setData(\"initcoords\", this.props.coords)\n let moves = this.validMoves()\n this.props.highlightSpaces(moves);\n }", "title": "" }, { "docid": "9623ada2981c8f16df90fecec267f76b", "score": "0.64021593", "text": "function drag(event) {}", "title": "" }, { "docid": "05111d7954e40d20eade2af95cf2089f", "score": "0.6370373", "text": "function onDragStart(event) {\n // event.dataTransfer.setData(\"text/plain\", event.target.id);\n dragged = event.target;\n oldPath = encryptChildPath(dragged);\n }", "title": "" }, { "docid": "19260f51c8a8cdcb4f672e35e4c16d3c", "score": "0.6318562", "text": "function drag(ev) {\r\n //establece el tipo de dato y valor del elemento capturado, en este caso el valor del atributo id\r\n ev.dataTransfer.setData(\"text\", ev.target.id); \r\n ev.effectAllowed = \"copyMove\";\r\n }", "title": "" }, { "docid": "09ff9cb0cec47e6b292eded17e830300", "score": "0.6298575", "text": "function drag(ev) {\n ev.dataTransfer.setData(\"text\", ev.target.id);\n ev.target.parentElement.classList.remove(\"populated\");\n}", "title": "" }, { "docid": "5407757702a48219c852e0ed7431b292", "score": "0.6278275", "text": "function dragStart(event){\n event.dataTransfer.effectAllowed = 'move';\n event.dataTransfer.setData('text/plain', this.id.slice(0, this.id.indexOf('PaleteBadge')));\n}", "title": "" }, { "docid": "30a0c0021a568b80d13a0c71e2262749", "score": "0.6276809", "text": "function DragHelperTemplate() {}", "title": "" }, { "docid": "30a0c0021a568b80d13a0c71e2262749", "score": "0.6276809", "text": "function DragHelperTemplate() {}", "title": "" }, { "docid": "df93d36d184806f776a4be868114944b", "score": "0.62563324", "text": "function drop(e) {\n const offset = e.dataTransfer.getData(\"text/plain\").split(',');\n dm[parseInt(offset[2])].style.left = (e.clientX + parseInt(offset[0], 10)) + 'px';\n dm[parseInt(offset[2])].style.top = (e.clientY + parseInt(offset[1], 10)) + 'px';\n e.preventDefault();\n return false;\n}", "title": "" }, { "docid": "834c1dfba895393ef858237761429c6e", "score": "0.62545806", "text": "drag(event) {\n var column = getColumnName(event.target);\n event.dataTransfer.setData(\"transfer\", JSON.stringify({ id: event.target.id, column: column }));\n }", "title": "" }, { "docid": "cedbe125ccf120d19eb3d88f7eb321de", "score": "0.62265265", "text": "function drag(event) {\n drag_id = event.target.id;\n var drag_el=document.getElementById(drag_id);\n\n if($(drag_el).has('.c_resize').length!=0){\n if($('.c-resize').hasClass('resizer_on')){\n $('.c-resize').removeClass('resizer_on');\n $('.c-resize').addClass('resizer_off');\n }\n for (var i = 0; i < 8; i++) {\n drag_el.removeChild(resizer_array[i]);\n }\n resizer_status[0] = false;\n }\n\n var style = window.getComputedStyle(event.target, null);;\n \n style = window.getComputedStyle(event.target, null);\n event.dataTransfer.setData(drag_id,\n (parseInt(style.getPropertyValue(\"left\"), 10) - event.pageX) + ',' + (parseInt(style.getPropertyValue(\"top\"), 10) - event.pageY) + ',');\n}", "title": "" }, { "docid": "508bfa0e955e905ac83eec127f6d7752", "score": "0.6222903", "text": "function drag() {\n // log(\"CARD: Start dragging!\");\n}", "title": "" }, { "docid": "2fdd223b92d677e554a6d6307efad65d", "score": "0.622245", "text": "function drag() {\n\t\t$(\"img, a\").on(\"dragstart\", function(event) { event.preventDefault(); });\n\t}", "title": "" }, { "docid": "2fdd223b92d677e554a6d6307efad65d", "score": "0.622245", "text": "function drag() {\n\t\t$(\"img, a\").on(\"dragstart\", function(event) { event.preventDefault(); });\n\t}", "title": "" }, { "docid": "a5979a9785251754509c15aa428de483", "score": "0.6221013", "text": "function drag(ev) {\n ev.dataTransfer.setData(\"text\", ev.target.id);\n $$('div.droparea').setStyle('background-color','#cccccc');\n}", "title": "" }, { "docid": "69d3f656d8144a9fce8e65ce4d3733dc", "score": "0.61865985", "text": "function onDragStart(e) {\n //Mozilla Hack\n e.originalEvent.dataTransfer.setData(\"Text\", \"\");\n\n if (!sourceParent) {\n // Set selected element's parent id\n sourceParent = tbody.attr(\"drag-id\")\n ? tbody.attr(\"drag-id\")\n : void 0;\n\n // Set selected element's index\n sourceIndex = $scope.$index;\n\n // This don't support in IE but other browser support it\n // This will set drag Image with it's position\n // IE automically set image by himself\n typeof e.originalEvent.dataTransfer.setDragImage !== \"undefined\"\n ? e.originalEvent.dataTransfer.setDragImage(e.target, -10, -10)\n : void 0;\n\n // This element will only drop to the element whose have drop effect 'move'\n e.originalEvent.dataTransfer.effectAllowed = \"move\";\n }\n return true;\n }", "title": "" }, { "docid": "b50c8bc6d982e073bcd53d502fe9213f", "score": "0.6185937", "text": "function dragstart(event){\n event.dataTransfer.setData(\"elementoOriginalId\",event.srcElement.id);\n}", "title": "" }, { "docid": "1901f7070870e83703b06071ade04b3b", "score": "0.6172877", "text": "handleDragStart(e) {\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.dropEffect = 'move';\n e.dataTransfer.setData('text/html', e.currentTarget);\n e.dataTransfer.setData('text/plain', JSON.stringify({\n origin: this.props.tree.id,\n nodeData: this.props.index\n }));\n var dom = this.refs.inner;\n if (this.props.onDragStart) {\n this.props.onDragStart(this.props.index.id, dom, e);\n }\n }", "title": "" }, { "docid": "61e6e23ae59892cbe1b86f547258ef19", "score": "0.6170402", "text": "drag(e) {\n e.dataTransfer.setData(\"text\", e.target.id);\n }", "title": "" }, { "docid": "22f221328fe37b5fc71acef1fdb8d8bc", "score": "0.61696774", "text": "function editOnDragStart() {\n this._internalDrag = !0, this.setMode(\"drag\");\n }", "title": "" }, { "docid": "e7a14283772a980c606ffc0cdecdb064", "score": "0.6162697", "text": "_setupDragging() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\t\tconst modelDocument = model.document;\n\t\tconst view = editor.editing.view;\n\t\tconst viewDocument = view.document;\n\n\t\t// The handler for the drag start; it is responsible for setting data transfer object.\n\t\tthis.listenTo( viewDocument, 'dragstart', ( evt, data ) => {\n\t\t\tconst selection = modelDocument.selection;\n\n\t\t\t// Don't drag the editable element itself.\n\t\t\tif ( data.target && data.target.is( 'editableElement' ) ) {\n\t\t\t\tdata.preventDefault();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO we could clone this node somewhere and style it to match editing view but without handles,\n\t\t\t// selection outline, WTA buttons, etc.\n\t\t\t// data.dataTransfer._native.setDragImage( data.domTarget, 0, 0 );\n\n\t\t\t// Check if this is dragstart over the widget (but not a nested editable).\n\t\t\tconst draggableWidget = data.target ? findDraggableWidget( data.target ) : null;\n\n\t\t\tif ( draggableWidget ) {\n\t\t\t\tconst modelElement = editor.editing.mapper.toModelElement( draggableWidget );\n\n\t\t\t\tthis._draggedRange = _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__[\"default\"].fromRange( model.createRangeOn( modelElement ) );\n\n\t\t\t\t// Disable toolbars so they won't obscure the drop area.\n\t\t\t\tif ( editor.plugins.has( 'WidgetToolbarRepository' ) ) {\n\t\t\t\t\teditor.plugins.get( 'WidgetToolbarRepository' ).forceDisabled( 'dragDrop' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If this was not a widget we should check if we need to drag some text content.\n\t\t\telse if ( !viewDocument.selection.isCollapsed ) {\n\t\t\t\tconst selectedElement = viewDocument.selection.getSelectedElement();\n\n\t\t\t\tif ( !selectedElement || !(0,_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__.isWidget)( selectedElement ) ) {\n\t\t\t\t\tthis._draggedRange = _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__[\"default\"].fromRange( selection.getFirstRange() );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !this._draggedRange ) {\n\t\t\t\tdata.preventDefault();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._draggingUid = (0,_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_4__[\"default\"])();\n\n\t\t\tdata.dataTransfer.effectAllowed = this.isEnabled ? 'copyMove' : 'copy';\n\t\t\tdata.dataTransfer.setData( 'application/ckeditor5-dragging-uid', this._draggingUid );\n\n\t\t\tconst draggedSelection = model.createSelection( this._draggedRange.toRange() );\n\t\t\tconst content = editor.data.toView( model.getSelectedContent( draggedSelection ) );\n\n\t\t\tviewDocument.fire( 'clipboardOutput', { dataTransfer: data.dataTransfer, content, method: evt.name } );\n\n\t\t\tif ( !this.isEnabled ) {\n\t\t\t\tthis._draggedRange.detach();\n\t\t\t\tthis._draggedRange = null;\n\t\t\t\tthis._draggingUid = '';\n\t\t\t}\n\t\t}, { priority: 'low' } );\n\n\t\t// The handler for finalizing drag and drop. It should always be triggered after dragging completes\n\t\t// even if it was completed in a different application.\n\t\t// Note: This is not fired if source text node got removed while downcasting a marker.\n\t\tthis.listenTo( viewDocument, 'dragend', ( evt, data ) => {\n\t\t\tthis._finalizeDragging( !data.dataTransfer.isCanceled && data.dataTransfer.dropEffect == 'move' );\n\t\t}, { priority: 'low' } );\n\n\t\t// Dragging over the editable.\n\t\tthis.listenTo( viewDocument, 'dragenter', () => {\n\t\t\tif ( !this.isEnabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tview.focus();\n\t\t} );\n\n\t\t// Dragging out of the editable.\n\t\tthis.listenTo( viewDocument, 'dragleave', () => {\n\t\t\t// We do not know if the mouse left the editor or just some element in it, so let us wait a few milliseconds\n\t\t\t// to check if 'dragover' is not fired.\n\t\t\tthis._removeDropMarkerDelayed();\n\t\t} );\n\n\t\t// Handler for moving dragged content over the target area.\n\t\tthis.listenTo( viewDocument, 'dragging', ( evt, data ) => {\n\t\t\tif ( !this.isEnabled ) {\n\t\t\t\tdata.dataTransfer.dropEffect = 'none';\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._removeDropMarkerDelayed.cancel();\n\n\t\t\tconst targetRange = findDropTargetRange( editor, data.targetRanges, data.target );\n\n\t\t\t// If this is content being dragged from another editor, moving out of current editor instance\n\t\t\t// is not possible until 'dragend' event case will be fixed.\n\t\t\tif ( !this._draggedRange ) {\n\t\t\t\tdata.dataTransfer.dropEffect = 'copy';\n\t\t\t}\n\n\t\t\t// In Firefox it is already set and effect allowed remains the same as originally set.\n\t\t\tif ( !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__[\"default\"].isGecko ) {\n\t\t\t\tif ( data.dataTransfer.effectAllowed == 'copy' ) {\n\t\t\t\t\tdata.dataTransfer.dropEffect = 'copy';\n\t\t\t\t} else if ( [ 'all', 'copyMove' ].includes( data.dataTransfer.effectAllowed ) ) {\n\t\t\t\t\tdata.dataTransfer.dropEffect = 'move';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* istanbul ignore else */\n\t\t\tif ( targetRange ) {\n\t\t\t\tthis._updateDropMarkerThrottled( targetRange );\n\t\t\t}\n\t\t}, { priority: 'low' } );\n\t}", "title": "" }, { "docid": "8ff696cfed489ff5f1592b3998b7d465", "score": "0.614154", "text": "function dropPiece(event) {\r\n event.preventDefault();\r\n let data = event.dataTransfer.getData(\"text\");\r\n let sourceRow = parseInt(data[0]);\r\n let sourceColumn = parseInt(data[1]);\r\n let destRow = parseInt(getChar(event.target.id, -2));\r\n let destColumn = parseInt(getChar(event.target.id, -1));\r\n if (validateMove(sourceRow, sourceColumn, destRow, destColumn)) {\r\n requestMove(sourceRow, sourceColumn, destRow, destColumn);\r\n }\r\n}", "title": "" }, { "docid": "143f98b59d63b4cd6616cff41162d68e", "score": "0.61391383", "text": "onDragStartCallback(a){a.dataTransfer.setDragImage(new Image,0,0)}", "title": "" }, { "docid": "2a103a271b0a45432988295a8f5b8231", "score": "0.6132411", "text": "function makeDraggable() {\n $(\"#fs-content\")\n .attr(\"ondrop\", \"drop(event)\")\n .attr(\"ondragover\", \"allowDrop(event)\")\n .attr(\"draggable\", \"true\")\n .attr(\"ondragstart\", \"drag(event)\")\n}", "title": "" }, { "docid": "55285f4df31627a6919176a7b61166f9", "score": "0.6121047", "text": "function editOnDragStart() {\n this._internalDrag = true;\n this.setMode('drag');\n}", "title": "" }, { "docid": "bd1e176d1a28fefb60fafc62c0748f6f", "score": "0.61146605", "text": "'dragover'(event) {\r\n event.preventDefault();\r\n }", "title": "" }, { "docid": "842ec30231a8ebed67318b9899ddf9f9", "score": "0.61138976", "text": "function drag2(event) {\n event.dataTransfer.setData(\"text\", event.target.id);\n }", "title": "" }, { "docid": "2e88a7ccba3735de822273c5050d24ca", "score": "0.6109443", "text": "function dragShip(ev){\n ev.dataTransfer.setData(\"ship\", ev.target.parentNode.id)\n \n }", "title": "" }, { "docid": "4036a33a9c4eef756cd15bf8ae2714ef", "score": "0.6106027", "text": "function DragDropConfig() {}", "title": "" }, { "docid": "4036a33a9c4eef756cd15bf8ae2714ef", "score": "0.6106027", "text": "function DragDropConfig() {}", "title": "" }, { "docid": "532d7378db6a88c92732ddd5fa5b7520", "score": "0.60976315", "text": "draggable(node) {\n return !filters.isRoot(node) && node.write;\n }", "title": "" }, { "docid": "4855567e4e4e9f54dc043c87d61525fd", "score": "0.6083486", "text": "onDragStart(e) {\n e.dataTransfer.setData(\"text/plain\", e.target.getAttribute(\"id\"));\n }", "title": "" }, { "docid": "e07fb6444c1088405dd6370edd9164cf", "score": "0.60782665", "text": "onDragOver(e) {\n e.preventDefault();\n }", "title": "" }, { "docid": "f6fb1e3b3096a677014accd2ecd562ee", "score": "0.60753995", "text": "dragover(event: MouseEvent) {\n event.stopPropagation();\n event.preventDefault();\n }", "title": "" }, { "docid": "f6fb1e3b3096a677014accd2ecd562ee", "score": "0.60753995", "text": "dragover(event: MouseEvent) {\n event.stopPropagation();\n event.preventDefault();\n }", "title": "" }, { "docid": "cadb0160585170762d430679c1fc92c0", "score": "0.60705006", "text": "function clipDragStart(event) {\n event.dataTransfer.setData('text/html', event.target.outerHTML);\n event.dataTransfer.dropEffect = 'copy';\n }", "title": "" }, { "docid": "852ef70eb860ad17e9713bcce1568327", "score": "0.606189", "text": "function lineStationDraggable() {\n $(\"#line_configurations td .station_items\").draggable({\n cancel: \"a.ui-icon\", // clicking an icon won't initiate dragging\n revert: \"invalid\", // when not dropped, the item will revert back to its initial position\n containment: \"document\",\n helper: \"clone\",\n cursor: \"move\"\n });\n }", "title": "" }, { "docid": "0a10662b53ddb2916c573bd5afef6c18", "score": "0.605588", "text": "static PrepareStartDrag() {}", "title": "" }, { "docid": "ea82731384780bb9c14a815eb62fa936", "score": "0.6053595", "text": "function dragOverHandler(ev) {\r\n //console.log('File(s) in drop zone');\r\n ev.preventDefault();\r\n}", "title": "" }, { "docid": "519309743693ca5c705ac60ff563ecf4", "score": "0.6048774", "text": "dragEnter(event) {\n if (!event.dataTransfer.getData) {\n useEvent(event);\n return event.dropEffect = 'none';\n }\n }", "title": "" }, { "docid": "1ca5990adcb69987794c3853ecbe439a", "score": "0.6045064", "text": "function dragStart(e) {\n e.dataTransfer.setData('text', e.target.id)\n e.dataTransfer.dropEffect = 'move'\n}", "title": "" }, { "docid": "99ade0b2cef286d4ee4d0cbdc15d195b", "score": "0.60416603", "text": "function dragstart(e) {\n e.dataTransfer.setData(\"text/plain\", e.target.getAttribute(\"data-pion\") + \":\" + e.target.getAttribute(\"data-column\") + \":\" + e.target.getAttribute(\"data-row\"));\n}", "title": "" }, { "docid": "ddf1624e8f157d543af12a6ed825a9c3", "score": "0.6041389", "text": "function handleDragStart(e) {\n\t\tthis.style.border = \"2px red solid\";\n\t\t\n\t\tdragSrcEl = this;\n\t\te.stopPropagation();\n\t\t\n\t\te.dataTransfer.effectAllowed = 'move';\n\t\te.dataTransfer.setData('text/html', this.innerHTML);\n\t}", "title": "" }, { "docid": "5eb8e64635679a8e1c1c1ae7ff33e90e", "score": "0.60410917", "text": "function allowDropCommand(ev) {\n ev.preventDefault();\n}", "title": "" }, { "docid": "e9293c3cd069c56d8c026ffd06cca2b4", "score": "0.60360175", "text": "function makeDragAndDrop() {\n\n $(\".container\").sortable({\n placeholder: \"ui-state-highlight\",\n connectWith: \".container\",\n items: \"div.visual-content-layout-element\",\n axis: \"y\",\n opacity: 0.5,\n cursor: \"move\",\n handle: \"span\",\n stop: function( event, ui ) {\n var visualHelpArea = $(ui.item[0]).parents('.visual-content-layout-visual-help'),\n addButton = $(visualHelpArea[0]).find('a'),\n textArea = $(addButton[0]).data('textarea'),\n text = getTextFromVisual($(visualHelpArea[0]));\n $(\"#\" + textArea).val(text);\n }\n });\n\n }", "title": "" }, { "docid": "b060c2f4292643866a7cd3e641997abc", "score": "0.60357714", "text": "dragOver(e){\n e.preventDefault();\n return false;\n }", "title": "" }, { "docid": "f7f83e7016a9f3b3f182065ca9a01643", "score": "0.6030563", "text": "function drag(event){\n event.dataTransfer.setData(\"message\", event.target.childNodes[1].innerHTML.replace(/<br>/g, \"\"));\n event.dataTransfer.setData(\"writer\", event.target.childNodes[0].innerHTML.replace(/<br>/g, \"\"));\n}", "title": "" }, { "docid": "ade9641827579b97686715582ad2f1d1", "score": "0.6026088", "text": "function onDragOver(e) {\n // Prevent Default actions\n e.preventDefault ? e.preventDefault() : void 0;\n e.stopPropagation ? e.stopPropagation() : void 0;\n\n // This get current elements parent id\n var targetParent = tbody.attr(\"drag-id\")\n ? tbody.attr(\"drag-id\")\n : void 0;\n\n // If user drag elemnt from its boundary then cursor will show block icon else it will show move icon [ i.e : this effect work perfectly in google chrome]\n e.originalEvent.dataTransfer.dropEffect =\n sourceParent !== targetParent ||\n typeof attr.ngRepeat === \"undefined\"\n ? \"none\"\n : \"move\";\n\n return false;\n }", "title": "" }, { "docid": "83d43102fc2e40845d2410001dc0d76d", "score": "0.6019397", "text": "onDragMove() {\n if (this.dragging) {\n var newPosition = this.data.getLocalPosition(this.parent);\n this.x = newPosition.x - this.dragPoint.x;\n this.y = newPosition.y - this.dragPoint.y;\n\n that.reboundImage(this);\n\n this.cursor = 'move';\n }\n }", "title": "" }, { "docid": "dd889b2c738a83ae78e808dd47cc11df", "score": "0.6019044", "text": "function dragStart(event) {\n // console.log(\"ok\")\n if (event.target.id == \"V\" || event.target.id == \"V+\" || event.target.id == \"CNOT\" || event.target.id == \"NOT\" || event.target.id == \"up\" || event.target.id == \"down\")\n event.dataTransfer.setData(\"text1\", event.target.id); // or \"text/plain\" but just \"text\" would also be fine since we are not setting any other type/format for data value\n\n\n}", "title": "" }, { "docid": "15aa71577d92e12a087a246d6a1d7ed3", "score": "0.6018296", "text": "function op_enabledrag() {\n d3.event.stopPropagation();\n d3.event.preventDefault();\n\n d3.select('#DataDrop')\n .classed('ready', true)\n ;\n}", "title": "" }, { "docid": "4a6998995088df283adc646db6104d2a", "score": "0.60114473", "text": "_onMouseDown () {\n Actions.changeDragging(true);\n }", "title": "" }, { "docid": "3018df63d1c89163b25725d5758117e9", "score": "0.6010781", "text": "dragOver(event) {\n if (!event.dataTransfer.getData) {\n useEvent(event);\n return event.dropEffect = 'none';\n }\n }", "title": "" }, { "docid": "5552c0c6ce9e779214627825a3805975", "score": "0.6006095", "text": "function EditorDragAndDropDisabled() {\n try {\n $(\".assetseditor\").attr(\"ondragstart\", \"return false;\");\n $(\".assetseditor\").attr(\"ondrop\", \"return false;\");\n } catch (err) {\n console.log(err.message)\n }\n }", "title": "" }, { "docid": "57f0c87f07ccebdc9b5995ea1e357a39", "score": "0.60057294", "text": "function onDragOver(ev)\n{\n ev.preventDefault();\n}", "title": "" }, { "docid": "3897a42f0d71ae43df1837298556cbfe", "score": "0.59897923", "text": "function handleDragStart(e) {\n this.style.opacity = '0.4';\n dragSrcEl = this;\n\t\n\tvar toSearch = this.id;\n\tvar searching = this.parentNode.firstElementChild;\n\tposBeforDrag=1;\n\t\n\twhile (searching && searching.id != toSearch){\n\t\tsearching = searching.nextElementSibling;\n\t\tposBeforDrag++;\n\t\t\n\t}\n\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text', this.innerHTML);\n}", "title": "" }, { "docid": "110ebe6583ba84fe7bd5642b95ebeb09", "score": "0.5988229", "text": "function dropAble(mimeTypes, onDrop) {\r\n return ($node) => {\r\n $node.on('dragenter', function () {\r\n const e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\r\n //var xy = mouse($node.node());\r\n if (hasDnDType(e, mimeTypes) || isEdgeDnD(e)) {\r\n Object(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', true);\r\n //sounds good\r\n return false;\r\n }\r\n //not a valid mime type\r\n Object(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\r\n return;\r\n }).on('dragover', function () {\r\n const e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\r\n if (hasDnDType(e, mimeTypes) || isEdgeDnD(e)) {\r\n e.preventDefault();\r\n updateDropEffect(e);\r\n Object(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', true);\r\n return false;\r\n }\r\n return;\r\n }).on('dragleave', function () {\r\n //\r\n Object(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\r\n }).on('drop', function (d) {\r\n const e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\r\n e.preventDefault();\r\n Object(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\r\n //var xy = mouse($node.node());\r\n if (isEdgeDnD(e)) {\r\n const base = e.dataTransfer.getData('text/plain');\r\n const id = base.indexOf(':') >= 0 ? base.substring(0, base.indexOf(':')) : base;\r\n if (dndTransferStorage.has(id)) {\r\n const data = dndTransferStorage.get(id);\r\n dndTransferStorage.delete(id);\r\n return onDrop(data, d, copyDnD(e));\r\n }\r\n }\r\n if (hasDnDType(e, mimeTypes)) {\r\n const data = {};\r\n //selects the data contained in the data transfer\r\n mimeTypes.forEach((mime) => {\r\n const value = e.dataTransfer.getData(mime);\r\n if (value !== '') {\r\n data[mime] = value;\r\n }\r\n });\r\n return onDrop(data, d, copyDnD(e));\r\n }\r\n return;\r\n });\r\n };\r\n}", "title": "" }, { "docid": "c81af733d9ee1aebb0fead0ccb31e6c4", "score": "0.59874326", "text": "function DragPreviewTemplate() {}", "title": "" }, { "docid": "c81af733d9ee1aebb0fead0ccb31e6c4", "score": "0.59874326", "text": "function DragPreviewTemplate() {}", "title": "" }, { "docid": "fb6a61933c0d221a1028f21d2d2d7431", "score": "0.5983088", "text": "_onDrop(ev) {\n ev.preventDefault();\n const sel = this.document.getSelection();\n let isInEditor = false;\n let ancestor = sel.anchorNode;\n while (ancestor && !isInEditor) {\n if (ancestor === this.editable) {\n isInEditor = true;\n }\n ancestor = ancestor.parentNode;\n }\n const transferItem = [...(ev.originalEvent || ev).dataTransfer.items].find(\n item => item.type === 'text/html',\n );\n if (transferItem) {\n transferItem.getAsString(pastedText => {\n if (isInEditor && !sel.isCollapsed) {\n this.deleteRange(sel);\n }\n if (this.document.caretPositionFromPoint) {\n const range = this.document.caretPositionFromPoint(ev.clientX, ev.clientY);\n setCursor(range.offsetNode, range.offset);\n } else if (this.document.caretRangeFromPoint) {\n const range = this.document.caretRangeFromPoint(ev.clientX, ev.clientY);\n setCursor(range.startContainer, range.startOffset);\n }\n this.execCommand('insertHTML', this._prepareClipboardData(pastedText));\n });\n }\n this.historyStep();\n }", "title": "" }, { "docid": "bf88c266343d3e47724ce7e5a724deb5", "score": "0.5972276", "text": "function dragOver(e) {\n e.preventDefault();\n}", "title": "" }, { "docid": "1ea0c6960418c5a5bee755f8cb76aedd", "score": "0.5970228", "text": "handleDragStart(event) {\n event.dataTransfer.dropEffect = 'move';\n event.dataTransfer.setData('text', JSON.stringify(this.selectedItems));\n }", "title": "" }, { "docid": "0d267ff23fda8350c81c109a26d44e07", "score": "0.5968427", "text": "function dragover(e) {\n e.stopPropagation();\n e.preventDefault();\n}", "title": "" }, { "docid": "2267da3b515d9745396f254d742c2ca8", "score": "0.596815", "text": "function dragOver(e) {\n e.preventDefault()\n}", "title": "" }, { "docid": "528e59f0b298cd38f457e3c29a896d70", "score": "0.59673697", "text": "function BindDragAndDrop() {\n $('.draggable').bind('dragstart', function (event) {\n event.originalEvent.dataTransfer.setData(\"text\", event.target.getAttribute('id'));\n });\n $('.board-space.isTurntrue, .letter-rack').bind('dragover', function (event) {\n event.preventDefault();\n });\n $('.board-space, .letter-rack').bind('drop', function (event) {\n var notecard = event.originalEvent.dataTransfer.getData(\"text\");\n if ($(event.target).hasClass('draggable')) {\n var parent = $(event.target).parent()[0];\n\n $(document.getElementById(notecard)).parent()[0].appendChild(event.target);\n parent.appendChild(document.getElementById(notecard));\n } else {\n event.target.appendChild(document.getElementById(notecard));\n }\n event.preventDefault();\n });\n }", "title": "" }, { "docid": "a69f86d7cb4c6aac605b2cb50788e29c", "score": "0.5966425", "text": "attachDragAndDrop() {\n\n const self=this;\n \n let HandleFiles = function (files, e) {\n let count = 0;\n if (self.num_independent_viewers > 1) {\n if (self.VIEWERS[0].getInsideViewer(e.offsetX))\n count = 0;\n else\n count = 1;\n }\n \n let ext=files[0].name.split(\".\").pop();\n if (ext===self.getApplicationStateFilenameExtension(true)) {\n self.loadApplicationState(files[0]);\n } else {\n self.loadImage(files[0], count, false).then( () => {\n if (files.length>1) {\n self.loadOverlay(files[1],count,false);\n }\n });\n }\n };\n webutil.createDragAndCropController(HandleFiles);\n }", "title": "" }, { "docid": "e0d1ac20cef55845c6950f3d9e2ce28e", "score": "0.5964012", "text": "function my_DragFunc()\n{\n\t//window.status = 'dd.elements.' + dd.obj.name + '.x = ' + dd.obj.x + ' dd.elements.' + dd.obj.name + '.y = ' + dd.obj.y;\n}", "title": "" }, { "docid": "0ca5b49bd2fe39511f86527e65eefaba", "score": "0.59634435", "text": "drag(line, evnt) {\n const data = {};\n data.name = line.children[3].textContent;\n data.type = line.children[4].textContent;\n data.nodeID = line.children[2].textContent;\n data.comment = line.children[5].textContent;\n data.sourceID = app.domFunctions.widgetGetId(line);\n data.sourceType = \"widgetRelations\";\n data.sourceTag = line.tagName;\n evnt.dataTransfer.setData(\"text/plain\", JSON.stringify(data));\n\n const obj = {};\n obj.id = app.domFunctions.widgetGetId(line);\n obj.idr = line.getAttribute(\"idr\");\n obj.action = \"dragstart\";\n app.regression.log(JSON.stringify(obj));\n app.regression.record(obj);\n}", "title": "" }, { "docid": "dc4a21dfa60b6d2440f60c2b13c73a1c", "score": "0.59602785", "text": "function makeDraggable() {\n $(\".select-drag\").draggable({\n cursor: \"move\",\n revert: \"invalid\",\n }\n );\n }", "title": "" }, { "docid": "dcfd6ffdb8b0fd74590bac311ef45260", "score": "0.59582466", "text": "emulateDragging(x,y){\n if(x === -1 && y === -1){\n this.props.actions.dropPanel(this.props.heldPanelId);\n }else{\n this.identifyWhatsUnderThisPosition(x,y);\n }\n }", "title": "" }, { "docid": "2c36651ef14ea324eade42f238f066d5", "score": "0.5948824", "text": "function drag(ev) \n{\n ev.dataTransfer.setData(\"Text\",ev.target.id); //Put the name (id) of the thing you are dragging in the dataTransfer location in memeory for future use\n}", "title": "" }, { "docid": "408dba9587a037b6e7fa963382e4f0e6", "score": "0.5947976", "text": "function bindDragEvents(view) {\n view.find(\".data-row .entry-link\").each(function() {\n this.setAttribute(\"draggable\", \"true\");\n });\n view.off(\"dragstart\").on(\"dragstart\", (event) => {\n const row = $(event.target).hasClass(\"data-row\") ? $(event.target) : $(event.target).parents(\".data-row\");\n\n if (event.ctrlKey || event.metaKey || event.altKey) {\n view[0].dragAction = \"copy\";\n } else if (event.shiftKey) {\n view[0].dragAction = \"cut\";\n }\n\n droppy.dragTimer.refresh(row[0].dataset.id);\n event.originalEvent.dataTransfer.setData(\"text\", JSON.stringify({\n type: row[0].dataset.type,\n path: row[0].dataset.id,\n }));\n event.originalEvent.dataTransfer.effectAllowed = \"copyMove\";\n if (\"setDragImage\" in event.originalEvent.dataTransfer) {\n event.originalEvent.dataTransfer.setDragImage(row.find(\".sprite\")[0], 0, 0);\n }\n });\n}", "title": "" }, { "docid": "1583641f6268fee235570eeb4d7e5be8", "score": "0.59470105", "text": "function dragstart_handler(ev) {\n ev.dataTransfer.setData('application/my-app', ev.target.id);\n ev.dataTransfer.dropEffect = \"move\";\n\n document.querySelectorAll('.kanbanLayout').forEach((col) => {\n if(col != ev.target) col.style.opacity = 0.4;\n });\n\n}", "title": "" }, { "docid": "ad9dad5192eba642bb6cda52514f3381", "score": "0.594628", "text": "function CdkDragMove() {}", "title": "" }, { "docid": "ad9dad5192eba642bb6cda52514f3381", "score": "0.594628", "text": "function CdkDragMove() {}", "title": "" }, { "docid": "b4f85163aafc577452ebb35f9462b271", "score": "0.5945356", "text": "function dragstart_handler(e) {\n e.dataTransfer.setData(\"text/plain\", e.target.dataset.jsDraggable);\n}", "title": "" }, { "docid": "aed7d6a4c9833d7b330a8a26379e044a", "score": "0.59388286", "text": "function enable_drag_drop() {\n chanaka.select(document.getElementById(\"viz\")).selectAll(\"svg\").selectAll(\".dragme\").call(drag), chanaka.select(document.getElementById(\"viz\")).selectAll(\"svg\").selectAll(\".dragme\").on(\"mousemove\", function(e) {\n var t = chanaka.select(this)[0][0].id;\n if (\"tree\" != t) {\n var a = chanaka.select(document.getElementById(\"viz\")).selectAll(\"svg\").select(\"g#\" + t).append(\"g\").attr(\"class\", \"delete_class\");\n chanaka.xml(\"plugins/eximage/svg/close.svg\", \"image/svg+xml\", function(e) {\n document.importNode(e.documentElement, !0);\n a.node().appendChild(e.documentElement);\n var l = a.select(\"svg\");\n l.attr(\"class\", \"delete_sub_class\"), l.attr(\"x\", 60), l.attr(\"y\", 0).on(\"click\", function(e) {\n remove_draggable_samples(chanaka.select(document.getElementById(\"viz\")).selectAll(\"svg\").select(\"g#\" + t), t), a.transition().duration(600).style(\"opacity\", 0).remove()\n })\n })\n }\n });\n var e = chanaka.select(document.getElementById(\"viz\")).selectAll(\"svg\").selectAll(\".dragme\").on(\"mouseout\", function(t) {\n e.selectAll(\".delete_class\").transition().duration(600).style(\"opacity\", 0).remove()\n });\n $(\"#close-button\").click(function() {\n $(\"#sample_holder\").hide(\"slide\", {\n direction: \"left\"\n }, 400)\n }), $(\"#open-button\").click(function() {\n $(\"#sample_holder\").show(\"slide\", {\n direction: \"left\"\n }, 400)\n })\n}", "title": "" }, { "docid": "aa550ec5cfeded7e6769b8e8f9714f99", "score": "0.59368587", "text": "handleDrag(event) {\n if (this.state.isDragging) {\n event.preventDefault();\n const { action } = this.state;\n\n if (!action) return this.cropFromNewRegion(event);\n this.moveCropper(action, event);\n }\n }", "title": "" }, { "docid": "0985da51224bafaa10458cef5288482a", "score": "0.59365755", "text": "function dragStart(ev) {\n ev.dataTransfer.setData(\"text/plain\", ev.target.id.replace(\"screenshot_link_\", \"\").replace(\"screenshot_\", \"\"));\n $('#deleteZone').text(\"Drop here to delete\")\n $(\"#deleteZone\").attr('class', 'btn btn-success mb-4');\n}", "title": "" }, { "docid": "b905851e441404af0df98f6f015ec11e", "score": "0.5935548", "text": "get dragAndDrop() {\n return true;\n }", "title": "" }, { "docid": "c414c72c87bab3e316df0d4f1ee5e745", "score": "0.59301066", "text": "function updateDropEffect(e) {\r\n const dT = e.dataTransfer;\r\n if (copyDnD(e)) {\r\n dT.dropEffect = 'copy';\r\n }\r\n else {\r\n dT.dropEffect = 'move';\r\n }\r\n}", "title": "" }, { "docid": "2ec5a75276e9f807421b49b5d49834de", "score": "0.5929589", "text": "function dragstart_digimon_handler(e){\n let identification = JSON.stringify({from:e.target.parentElement.id, id: e.target.innerHTML})\n e.dataTransfer.setData(\"text/plain\", identification);\n e.dataTransfer.setDragImage(e.target, -10, -10);\n}", "title": "" }, { "docid": "655bbd9eb373737733558f95cf336fdc", "score": "0.59294784", "text": "function op_disabledrag() {\n d3.event.stopPropagation();\n d3.event.preventDefault();\n\n d3.select('#DataDrop')\n .classed('ready', false)\n ;\n}", "title": "" }, { "docid": "2e73f73f0d51acb49f72a61b435b4bae", "score": "0.5917357", "text": "function dragstarted() {\n if (d3.event.sourceEvent) {\n d3.event.sourceEvent.preventDefault();\n d3.event.sourceEvent.stopPropagation();\n }\n\n var selection = d3.select(this);\n\n if (dragEnabled) {\n selection\n .classed('dragging', true)\n .style('filter', 'url(#shadow)');\n }\n\n if (selectEnabled) {\n $rootScope.$apply(function () {\n $rootScope.$emit('go:campaignDesignerSelect', selection.datum());\n });\n }\n }", "title": "" }, { "docid": "f6cf0140ddfdc66740cf5d9126000025", "score": "0.5913879", "text": "function ieInternalDragAndDrop() {\n editor.on('dragstart', function (e) {\n setMceInternalContent(e);\n });\n\n editor.on('drop', function (e) {\n if (!isDefaultPrevented(e)) {\n var internalContent = getMceInternalContent(e);\n\n if (internalContent && internalContent.id != editor.id) {\n e.preventDefault();\n\n var rng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, editor.getDoc());\n selection.setRng(rng);\n insertClipboardContents(internalContent.html, true);\n }\n }\n });\n }", "title": "" }, { "docid": "3aae7870f9b2cf000e62a974b32b3ea8", "score": "0.59110767", "text": "function newDrag(event) {\n isValid = false;\n event.dataTransfer.setData('target_id', event.target.id);\n}", "title": "" }, { "docid": "99a9ca395ffba6267f1519d9842d88a9", "score": "0.59025973", "text": "dragN(e){\n\t\t\n\t\tif (e.type.slice(-4) == 'down') {\n\t\t\t\n\t\t\tthis.backUpCrop();\n\t\t}\t\tif (e.type.slice(-4) == 'move') {\n\t\t\t\n\t\t\treturn this.moveN(e);\n\t\t}\t}", "title": "" }, { "docid": "9ed5cb9b0276f3e8c9fbf0a8b453a114", "score": "0.59009266", "text": "function dragDimensionCard(ev){\n \n ev.dataTransfer.setData('dimensionName',ev.target.getAttribute('data-dimensionname'));\n \n}", "title": "" }, { "docid": "80d5699d3c5d1f534ffed9858e957760", "score": "0.58989155", "text": "handleDragOver(e) {\n var dom = this.refs.inner;\n e.dataTransfer.dropEffect = 'move';\n if (this.props.onDragOver) {\n this.props.onDragOver(this.props.index.id, dom, e, this.props.tree.id);\n }\n }", "title": "" }, { "docid": "1ca4d7f54bf988075d36e657840b604d", "score": "0.5896341", "text": "function drag_start(event) {\n var style = window.getComputedStyle(event.target, null);\n event.dataTransfer.setData(\"text/plain\",\n (parseInt(style.getPropertyValue(\"left\"),10) - event.clientX) + ',' + (parseInt(style.getPropertyValue(\"top\"),10) - event.clientY));\n}", "title": "" }, { "docid": "df95e764dc631a88f905f2187704b8c1", "score": "0.5895747", "text": "effortDragged (effort) {\n //trace && console.log(Util.timestamp(), 'D3CapacityPlanBlockHandler.dragged:', effort);\n let self = this,\n chart = this.chart,\n dragX = d3.event.x - chart.drag.offsetX,\n dragY = d3.event.y - chart.drag.offsetY;\n \n trace && console.log(Util.timestamp(), 'D3CapacityPlanEffortListHandler.dragged:', dragX, dragY);\n chart.drag.dragElement.attr('transform', 'translate(' + dragX + ', ' + dragY + ')');\n }", "title": "" }, { "docid": "016f2cfaea62ca72afb23decacb8b990", "score": "0.58953536", "text": "function drag3(event) {\n event.dataTransfer.setData(\"text\", event.target.id);\n }", "title": "" }, { "docid": "2e9be7c8bdb92a4b77ccb40742e768f7", "score": "0.58950573", "text": "SWITCH_DRAGGING(state) {\n state.dragging = !state.dragging;\n }", "title": "" } ]
2ecc6165d4d6c1203fc8b162b6774ca4
Devuelve las identificaciones de los profesores seleccionados
[ { "docid": "4ee094f601890326ffc357cbddec7c85", "score": "0.6031969", "text": "function guardarProfesoresAsociar() {\n\n let listaCheckboxProfesores = document.querySelectorAll('#tblProfesores tbody input[type=checkbox]:checked');\n let profesoresSeleccionados = [];\n let idProfesor;\n\n //Este ciclo for debe empezar en 1, ya que en el cero \"0\" se encuentra el id unico del elemento al que se le desea agregar elementos\n for (let i = 0; i < listaCheckboxProfesores.length; i++) {\n idProfesor = listaCheckboxProfesores[i].dataset.identificacion;\n profesoresSeleccionados.push(idProfesor);\n }\n\n return profesoresSeleccionados;\n\n\n}", "title": "" } ]
[ { "docid": "5b606e31ebad3ba9242faa0fa4c1bfed", "score": "0.6529826", "text": "function mostrarProfesoresSede() {\n let sedeSelect = this.dataset.nombre;\n let sede = buscarSedePorNombre(sedeSelect);\n let listaProfesores = getListaProfesores();\n let listaCheckboxProfesores = document.querySelectorAll('#tblProfesores tbody input[type=checkbox]');\n let cedProfs = [];\n\n for (let i = 0; i < sede[10].length; i++) {\n cedProfs.push(sede[10][i]);\n }\n\n for (let j = 0; j < listaProfesores.length; j++) {\n for (let k = 0; k < cedProfs.length; k++) {\n if (listaProfesores[j][0] == cedProfs[k]) {\n listaCheckboxProfesores[j].checked = true;\n }\n }\n }\n verificarCheckSedes();\n}", "title": "" }, { "docid": "4577e16627321c68e54ff7c04bc1a02b", "score": "0.5726405", "text": "function fnProfesiones(){\n var pregProfesiones = prompt(\"Introduzca las profesiones separadas por comas. Ej. Ingniero, Músico...\");\n //corta los valores de las profesiones y crea un arreglo\n var profesiones = pregProfesiones.split(\",\");\n //crea el arreglo de las profesiones que queremos, todas en falso\n var objProfesiones = {\n ingeniero: false,\n doctor: false,\n musico: false,\n escritor: false,\n futbolista: false\n }\n\n //comprueba si las profesiones que introdujo el usuario las tiene el objeto creado anteriormente\n for(var i=0; i < profesiones.length; i++)\n if(objProfesiones.hasOwnProperty(profesiones[i].trim()))\n objProfesiones[profesiones[i]] = true; //si las tiene las pone en true\n\n return objProfesiones;\n}", "title": "" }, { "docid": "1ba096a2e93984d7428f0c832d6de703", "score": "0.5672476", "text": "function collectID() {\r\n if(document.body.innerHTML.match(/keine Treffer/)) return false;\r\n try {\r\n var docIH = document.getElementById('my-profile').innerHTML;\r\n } catch(e) {\r\n var docIH = '';\r\n }\r\n vars.owndata = Object();\r\n var highscore_table = document.getElementsByTagName('table')[0];\r\n try {\r\n vars.ownid = Boolean(docIH.match(/profil\\/id:(\\d+)/)[1]) ? docIH.match(/profil\\/id:(\\d+)/)[1] : false;\r\n vars.owndata.name = vars.ownid ? document.getElementById('my-profile').getElementsByTagName('a')[0].innerHTML : false;\r\n } catch(e) {\r\n vars.ownid = false;\r\n vars.owndata.name = false;\r\n }\r\n vars.select_html = document.getElementById('search_stadtteil').innerHTML;\r\n vars.userids = [];\r\n if(vars.ownid!=false) {\r\n vars.owndata.cash = trim(document.getElementsByClassName('money')[0].textContent);\r\n vars.owndata.cash_1 = vars.owndata.cash.match(/\\d+/g).join('');\r\n vars.owndata.permil = trim(document.getElementsByClassName('beer')[0].textContent);\r\n var overview = document.getElementById('my-profile');\r\n var data = overview.getElementsByClassName('el2');\r\n vars.owndata.platz = data[1].textContent;\r\n vars.owndata.punkte = data[2].textContent;\r\n vars.owndata.limits = [parseInt(vars.owndata.punkte*1.5),parseInt(vars.owndata.punkte*0.8)];\r\n } else {\r\n vars.owndata.cash = '';\r\n vars.owndata.cash_1 = 0;\r\n vars.owndata.permil = '';\r\n vars.owndata.punkte = '';\r\n vars.owndata.platz = '';\r\n vars.owndata.won = vars.owndata.lost = '';\r\n vars.owndata.limits = [1E15,0]\r\n vars.owndata.att = vars.owndata.def = vars.owndata.fightval = '';\r\n vars.owndata.percwon = vars.owndata.perclost = 50;\r\n }\r\n if(!highscore_table.innerHTML.match(/profil/)) {\r\n return false;\r\n }\r\n vars.userdata = [];\r\n var table_rows = highscore_table.getElementsByTagName('tr');\r\n for(var a = 1; a < table_rows.length; a++) {\r\n var td = table_rows[a].getElementsByTagName('td');\r\n var current_id = table_rows[a].innerHTML.match(/profil\\/id:(\\d+)/)[1];\r\n vars.userids.push(current_id);\r\n vars.userdata[a-1] = [];\r\n vars.userdata[a-1].push(current_id);\r\n vars.userdata[a-1].push(trim(td[0].className));\r\n vars.userdata[a-1].push(td[3].innerHTML);\t\t\r\n\t\tvar points = td[4].textContent.replace(/Billiarden/,'000000000000').replace(/Billionen/,'000000000').replace(/Milliarden/,'000000').replace(/(Millionen|Millones|Millions)/,'000');\r\n\t\tpoints = parseInt(points.match(/\\d+/g).join(\"\"),10);\r\n vars.userdata[a-1].push(points);\r\n }\r\n changePage();\r\n GM_xmlhttpRequest\r\n ({\r\n method: 'get',\r\n url: vars.updateXML,\r\n headers: {\r\n 'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.8',\r\n 'Accept': 'application/atom+xml,application/xml,text/xml',\r\n },\r\n onload: function(response) {\r\n if(response.status!=200) {\r\n GM_log('Fehler: HTTP Code '+response.status+' beim Abruf von \"'+vars.updateXML+'\"');\r\n } else {\r\n\t var cont = response.responseText;\r\n var dom = setParser(cont,'XML');\r\n var dom = dom.getElementsByTagName('pghs_2010')[0];\r\n var vers = dom.getElementsByTagName('current')[0].textContent;\r\n var info = dom.getElementsByTagName('info')[0].textContent;\r\n var changes = dom.getElementsByTagName('changes')[0].textContent;\r\n if(vers!=vars.version) {\r\n vars.updateIt = '<span class=\"bann\"><a href=\"'+vars.download+'\">'+lang.update+'</a></span><br /><i>'+info+'</i><br /><small>'+changes+'</small>';\r\n } else {\r\n vars.updateIt = '<span class=\"on\">'+lang.no_update+'</span>';\r\n }\r\n }\r\n getDashboardData();\r\n }\r\n });\r\n return true;\r\n}", "title": "" }, { "docid": "60354dcfec35999f165ca77fce2d9ce3", "score": "0.5671745", "text": "function asociarSedeProfesor() {\n let nombreSede = guardarSedeAsociar();\n\n let sede = buscarSedePorNombre(nombreSede);\n\n let profesoresSeleccionados = guardarProfesoresAsociar();\n\n\n\n\n let listaSede = [];\n\n let sNombre = sede[0];\n let sTipo = sede[1];\n let sProvincia = sede[2];\n let sCanton = sede[3];\n let sDistrito = sede[4];\n let sDireccion = sede[5]\n let bEstado = sede[6];\n let bMostrarMapa = sede[7];\n let latitud = sede[8];\n let longitud = sede[9];\n let profesoresAsociados = profesoresSeleccionados;\n\n if (profesoresAsociados.length == 0) {\n swal({\n title: \"Asociación inválida\",\n text: \"No se le asignó ningun profesor al curso.\",\n buttons: {\n confirm: \"Aceptar\",\n },\n });\n } else {\n listaSede.push(sNombre, sTipo, sProvincia, sCanton, sDistrito, sDireccion, bEstado, bMostrarMapa, latitud, longitud, profesoresAsociados);\n actualizarSede(listaSede);\n\n swal({\n title: \"Asociación registrada\",\n text: \"Se le asignó un curso a un profesor exitosamente.\",\n buttons: {\n confirm: \"Aceptar\",\n },\n });\n limpiarCheckbox();\n }\n}", "title": "" }, { "docid": "bac1754560ff8e5d5e1c25dbe78f493b", "score": "0.56659776", "text": "function personselect() {\r\n var personId = document.getElementById(\"pers-id\").innerHTML;\r\n var tempObj = {};\r\n\r\n for (let i=0; i < listUser.length; i++) {\r\n tempObj = listUser[i];\r\n if (tempObj.personnummer == personId) {\r\n document.getElementById(\"pers-id\").innerHTML = tempObj.personnummer;\r\n document.getElementById(\"fname\").innerHTML = tempObj.förnamn;\r\n document.getElementById(\"lname\").innerHTML = tempObj.efternamn;\r\n document.getElementById(\"adress\").innerHTML = tempObj.adress;\r\n document.getElementById(\"coadress\").innerHTML = tempObj.coadress;\r\n document.getElementById(\"postnummer\").innerHTML = tempObj.postnummer;\r\n document.getElementById(\"postadress\").innerHTML = tempObj.postadress;\r\n document.getElementById(\"telefon\").value = tempObj.telefon;\r\n document.getElementById(\"mobil\").value = tempObj.mobil;\r\n document.getElementById(\"epost1\").value = tempObj.epostadress;\r\n document.getElementById(\"epost2\").value = tempObj.epostadress2;\r\n document.getElementById(\"kommun\").innerHTML = tempObj.hemkommun;\r\n setSelectedIndex(document.getElementById(\"modersmål\"), tempObj.modersmål);\r\n return;\r\n }\r\n }\r\n return;\r\n}", "title": "" }, { "docid": "00800e274355e91b8e9bf739765433a2", "score": "0.55964583", "text": "function SelectProfile(ctx) {\n PicMSG(\n ctx,\n imgOptions,\n () => {\n let menuMSG = \"►<strong>Selección del perfil de importación</strong>\\n\";\n menuMSG +=\n \" \\tLa mayoría de los tipos de servidores poseen 2 tipos de perfiles de importación, los cuales definen la cantidad de datos que se pueden importar y el nivel de detalles de los mismos.\\n\";\n menuMSG +=\n \" ◦ <b>Detallado</b>: Procesa y obtiene imformación con gan nivel de detalle desde los archivos de trazas, lo cual a su vez limita la cantidad de elementos que se pueden importar.\\n\";\n menuMSG +=\n \" ◦ <b>General</b>: Obtiene información simplificada y agrupada estadísticamente, lo que a su vez posibilita importar un volumen enorme de trazas.\\n\";\n\n ctx.replyWithHTML(menuMSG).then(() => {\n return ShowMenu(ctx);\n });\n },\n \"./public/import_profile.png\",\n \"Menú: Importar, Sección: Seleccionar perfiles\"\n );\n}", "title": "" }, { "docid": "e7faa616369c9bddd12c0f84bc53f8a3", "score": "0.5558556", "text": "function selectProfiles() {\n $(\".eh_checkbox_container\").unbind().click(function() {\n checkbox = $(this).find(\".fa\").first();\n if (checkbox.hasClass(\"fa-square\")) {\n checkbox.removeClass(\"fa-square\").addClass(\"fa-check-square\").css({ 'color': '#e86240' });\n }\n else {\n checkbox.removeClass(\"fa-check-square\").addClass(\"fa-square\").css({ 'color': '#ddd' });\n }\n\n updateSelection();\n updateSelectionView();\n });\n}", "title": "" }, { "docid": "c07e334fb29f64c3f2917fecd2cae609", "score": "0.5469203", "text": "function mostrarProfesores() {\n let sBuscar = document.querySelector('#txtBuscarProfesores').value;\n let listaProfesores = getListaProfesores();\n let cuerpoTabla = document.querySelector('#tblProfesores tbody');\n\n cuerpoTabla.innerHTML = '';\n\n for (let i = 0; i < listaProfesores.length; i++) {\n\n if (listaProfesores[i][0].toLowerCase().includes(sBuscar.toLowerCase())) {\n if (listaProfesores[i][30] == true) {\n let fila = cuerpoTabla.insertRow();\n\n let checkSeleccion = document.createElement('input');\n checkSeleccion.setAttribute('type', 'checkbox');\n checkSeleccion.classList.add('checkbox');\n checkSeleccion.dataset.identificacion = listaProfesores[i][0];\n\n let cSeleccionar = fila.insertCell();\n let cIdentificacion = fila.insertCell();\n cIdentificacion.dataset.id = listaProfesores[i][0];\n cIdentificacion.setAttribute('data-tooltip', 'Ver profesor');\n cIdentificacion.classList.add('tooltip-bottom');\n //cIdentificacion.addEventListener('click', visualizar);\n let cPNombre = fila.insertCell();\n let cPApellido = fila.insertCell();\n\n let sIdentificacion = document.createTextNode(listaProfesores[i][0]);\n let sPNombre = document.createTextNode(listaProfesores[i][2]);\n let sPApellido = document.createTextNode(listaProfesores[i][4]);\n\n let listaCheckboxProfesores = document.querySelectorAll('#tblProfesores tbody input[type=checkbox]');\n\n cSeleccionar.appendChild(checkSeleccion);\n cIdentificacion.appendChild(sIdentificacion);\n cPNombre.appendChild(sPNombre);\n cPApellido.appendChild(sPApellido);\n }\n }\n }\n}", "title": "" }, { "docid": "65993d8f0fd0ed440014b40deef561c8", "score": "0.544349", "text": "function selectFriends() {\n for (var i = 0; i < this.numFriendsInCity; i++) {\n var selected = document.getElementById(\"friend\" + i).checked;\n if (selected) {\n return this.filterFriends[i].id\n }\n }\n }", "title": "" }, { "docid": "4575d03d4862fee9e959584d23b4a76c", "score": "0.54428273", "text": "function mostrarPantallaProfesorIniciada(data){\n $('#granCabeceraProfesor').remove();\n $(\"#granCabecera\").remove();\n $('#mostrarAciertosFallos').remove();\n $('#mostrarDatos').remove();\n $('#mostrarDatos2').remove();\n $('#mostrarEjerciciosProfesor').remove();\n $('#tabla').remove();\n $('#tablaTodos').remove();\n $('#tablaAlumnos').remove();\n $('#tablaResultados').remove();\n $('#formRegistro').remove();\n mostrarNavProfesor(data);\n rest.obtenerEjerciciosProfesor();\n}", "title": "" }, { "docid": "f16ae5394c32387492e648bd56fb9b20", "score": "0.54260695", "text": "function capturarIdentificadorCorregimiento(){\n if(selectCorregimientos){\n selectCorregimientos.addEventListener('change',(e)=>{\n e.preventDefault(); \n let dato=e.target.value;\n let identificador1=e.target.id;\n // console.log(identificador1);\n cargarVeredas(dato,identificador1);\n })\n }\n}", "title": "" }, { "docid": "47f81ddc5a5e9f5dee465601dc70e7b5", "score": "0.5385548", "text": "selectProfile(profile){\n app.currentProfile = profile;\n }", "title": "" }, { "docid": "f8d076e7a42ef0b1e9a48f75ff7c428e", "score": "0.5344519", "text": "function setUpMarkerProfils(){\n let selectedGermplasms = $(\"select#Germplasms option:selected\").map(function () {\n return $(this).val().split(\",\");\n }).get();\n selectedGermplasms=removeAll(selectedGermplasms,\"\");\n\tlet htmlStringBuffer = new StringBuffer();\n\tselectedGermplasms.forEach(function(element){\n\t\thtmlStringBuffer.append('<option selected value=\"'+element+'\">'+element+'</option>\\n');\n\t});\n\t$('#MarkersProfils').html(htmlStringBuffer.toString());\n updateSelection('markerProfileLabel','MarkersProfils');\n\tif ($('#MarkersProfils>option').length===$('#Germplasms>option:selected').length){\n\t\t$('#MarkersProfils').attr(\"disabled\", true);\n\t}else{\n\t\t$('#MarkersProfils').attr(\"disabled\", false);\n\t}\n}", "title": "" }, { "docid": "1bd9627994843b621887b1097c175512", "score": "0.5299359", "text": "function selecter1(channelNumber){\n let listAvatar1 = document.getElementById(\"avatarSelector1\").getElementsByTagName(\"li\");\n for (let i = 0; i< avatarNumber; i++){\n listAvatar1[i].className = i+1 == channelNumber ? \"selected\":\"\";\n }\n choosenAvatarPlayer1 = document.getElementById(\"avatarSelector1\").getElementsByClassName(\"selected\")[0].id\n}", "title": "" }, { "docid": "7533a70a1383d2eb8e7d0e32de2d054c", "score": "0.52401495", "text": "function update_prof_filter() {\n // Get all unique professors for current class\n var ratings = Object.values(data);\n profs = new Set();\n ratings.forEach(rating => profs.add(rating.prof));\n\n // Add options to filter dropdown \n profs.forEach(function(prof) {\n $(\"#select_filter\").append(`<option value=\"` + prof + `\">` + prof + `</option>`)\n });\n}", "title": "" }, { "docid": "b74e5849f69470eaf3a38cd947e923a1", "score": "0.52394533", "text": "function select_professor(profesor) {\n /*código a implementar*/\n curs = document.getElementById(\"curs\").value;\n var lista = document.getElementById(\"lista_prof\");\n var ajax3 = objetoAjax();\n var option;\n ajax3.open(\"POST\", \"../services/consulta_form_sortides.php\", true);\n ajax3.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n ajax3.send(\"accion=professor&id_clase=\" + curs);\n ajax3.onreadystatechange = function () {\n if (ajax3.readyState == 4 && ajax3.status == 200) {\n var respuesta = JSON.parse(this.responseText);\n if (respuesta.length === 0) {\n option = '<option value=\"0\">No hi ha professors</option>';\n lista.innerHTML = option;\n } else {\n for (var i = 0; i < respuesta.length; i++) {\n \n if (profesor != undefined && profesor != \"\" && respuesta[i].id_usuari == profesor[i]) {\n option += '<option selected value=\"' + respuesta[i].id_usuari + '\">' + respuesta[i].nom_usuari + ' ' + respuesta[i].cognom_usuari + '</option>';\n } else {\n option += '<option value=\"' + respuesta[i].id_usuari + '\">' + respuesta[i].nom_usuari + ' ' + respuesta[i].cognom_usuari + '</option>';\n }\n lista.innerHTML = option;\n \n \n\n }\n }\n\n }\n }\n}", "title": "" }, { "docid": "98b3c99ae50a25a0be47963325c643e4", "score": "0.52355826", "text": "function selectTipoPersonal(identificador) {\n\t $.ajax({\n\t \n\t url: '/ProyEscalafon/public/listarTipoPersonal',\n\t type: 'GET',\n\t success: function(respuesta){\n\t \n\t let registro = '';\n\t \n\t respuesta.forEach(obj_json =>{\n\t obj_json.forEach(obj_json => {\n\n\t registro += `<option value='${obj_json.id}'>${obj_json.nombre}</option>`\n\n\t });\n\t });\n\t \n\t identificador.html(registro);\n\t \n\t }\n\t \n\t });\t\n\t}//Fin de llenar select", "title": "" }, { "docid": "11336d54ab13421f2b24f4bf3633db5f", "score": "0.5210378", "text": "function get_id(evt) {\n //se recive el id del ultimo registro enviado\n id_selected = evt.data;\n}", "title": "" }, { "docid": "729e508fad427587e516dde33f7aeb57", "score": "0.52066773", "text": "function showColorProfiles( container ) {\n var m = jQuery( 'select#mfg', container ).empty();\n var opt;\n for ( var ix=0; ix<colorProfiles.manufacturers.length; ix++ ) {\n if ( ( colorProfiles.profiles[ colorProfiles.manufacturers[ix].id ] || [] ).length > 0 ) {\n opt = jQuery( '<option/>' ).val( colorProfiles.manufacturers[ix].id ).text( colorProfiles.manufacturers[ix].name );\n m.append( opt );\n }\n }\n jQuery( 'option:first', m ).prop( 'selected', true ); /* Force select first */\n\n updateProfileMenu( container );\n }", "title": "" }, { "docid": "67d66b0b1dff4b5c7227073b72d0c37e", "score": "0.5199488", "text": "function GetSelectedFriend()\n{\n //haal het id op\n let id = slcVrienden.options[slcVrienden.selectedIndex].value;\n //haal de vriend op uit de array\n //met high order function find\n let selectedFriend = vrienden.find(friend =>\n {\n //voorwaarde om te zoeken\n return friend.Id == id;\n });\n //Geef door aan FillForm om het formulier te vullen\n FillForm(selectedFriend);\n}", "title": "" }, { "docid": "f924ad526db1c027473659c0fd6abb51", "score": "0.5182636", "text": "function getPersonasSelect(ctx) {\n\t\tsedroGetPersonas(ctx, function (data) {\n\t\t\tvar pselect = \"\";\n\t\t\tif (data && data.list) {\n\t\t\t\tfor (var i=0;i<data.list.length;i++) {\n\t\t\t\t\tpselect += \"<option value='\"+data.list[i]+\"'>\"+data.list[i]+\"</option>\";\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$(\"#persona\").html(pselect);\n\t\t});\t\t\t\n\t}", "title": "" }, { "docid": "ace013185bd671296a4841c86c6c28e7", "score": "0.5146196", "text": "renderUserSelected () {\n if (this.state.userSelected.nombre) {\n var arrIds = [];\n arrIds.push(this.state.userSelected._id);\n return(\n <UserSelected\n usuario={this.state.userSelected}\n datos={{filas: [\n { seccion:[\n {etiqueta: 'matrícula', dato: this.state.userSelected.academico[0].matricula},\n {etiqueta: 'curp', dato: this.state.userSelected.curp},\n {etiqueta: 'gpo. sanguíneo', dato: this.state.userSelected.sanguineo},\n ]},\n { seccion:[\n {etiqueta: 'email', dato: this.state.userSelected.contacto[0].email},\n {etiqueta: 'tel / tel. Emergencia', dato: `${this.state.userSelected.contacto[0].telefono} | ${this.state.userSelected.contacto[0].telEmergencia}`}\n ]},\n { seccion:[\n {etiqueta: 'dirección', dato: `${this.state.userSelected.direccion[0].calle} ${this.state.userSelected.direccion[0].numero}, ${this.state.userSelected.direccion[0].localidad}, ${this.state.userSelected.direccion[0].ciudad}, ${this.state.userSelected.direccion[0].estado}. C.P. ${this.state.userSelected.direccion[0].cp}`}\n ]}\n ]}}\n botones={['Eliminar', 'Editar', 'Credencial']}\n permisos={this.state.permisos}\n eliminarClick={() => this.setState({modalEliminar:true})}\n btnCardDisabled={this.state.btnMuchasCredDisabled}\n cardClick={() => {\n this.getCredenciales(arrIds, this.props.profesores ? 'UPPCredencial2' : 'UPPCredencial1');\n alert('Se está generando el archivo para su descarga.');\n }}\n />\n )\n }\n return(\n <div className=\"centrado\">\n <span className=\"text no-seleccionado\">No ha seleccionado un {this.props.profesores ? 'profesor' : 'alumno'}.</span>\n </div>\n )\n }", "title": "" }, { "docid": "7430c88cb73d08ae76d8596fe96061f4", "score": "0.51224774", "text": "function main() {\n letUsername();\n let divAllUserList = document.getElementById(\"allUserList\");\n listAllUser(divAllUserList);\n let hauptProfilNavi = document.getElementById(\"hauptProfil\");\n hauptProfilNavi.addEventListener(\"click\", function funcProfil() {\n sessionStorage.setItem(\"profilname\", sessionStorage.getItem(\"username\"));\n });\n /* später\n //1. Seite laden mit allen Usern + btn hinzufügen zum FOlgen und entfolgen\n //2. Nur alle die man folgt oben rechts\n //3. Alle die einen FOlgen (Follower) untern rechts\n //punkt 1 und 2 werden beim folgen und entfolgen neugeformt (gelöscht und wieder hinzugefügt)\n let divFollowedUserList: HTMLDivElement = <HTMLDivElement>document.getElementById(\"allFollowedList\");\n let divFollowersList: HTMLDivElement = <HTMLDivElement>document.getElementById(\"allFollowersList\");\n */\n }", "title": "" }, { "docid": "4534e75f16dcbe0b0303874be8aba2d8", "score": "0.51105094", "text": "function listadoIdsConsultas(arrConsultas){\n\n\t//presentara todas las id de las consultas del usuario para generar el drop down\n\tvar listado = [];\n\tvar paciente = usuarioIngresado ;\n\t//buscamos el index del paciente dentro del array comparando la propiedad nombre completo \n\tvar pacienteIndex = buscarPacienteEnArray();\n\t\n\t//recorremos el array consultas\n\t\tfor(var i = 0; i < arrConsultas.length; i++){\n\t\t\t// si la consulta es del paciente, añadimos el identificador al listado\n\t\t\t\tif(arrConsultas[i][\"paciente\"] === pacienteIndex){\n\t\t\t\t\tlistado.push(arrConsultas[i][\"identificador\"]);\n\t\t\t\t}\n\t\t\t\n\t\t}\n\treturn listado;\n}", "title": "" }, { "docid": "44b3bff9334a74569b4320a0632de318", "score": "0.5072573", "text": "function eachPerson() {\n\n\t\tvar stepOne = document.getElementsByTagName(\"ul\");\n\n\t\t\tfor (var a=0, b=stepOne.length; a<b; a++) {\n\t\t\t\tvar theDoer = stepOne[a].getAttribute(\"id\");\n\t\t\t\t\tfor (var c=0, d=choreDoer.length; c<d; c++) {\n\n \t\t\t\t\t\tif (theDoer == choreDoer[c]) {\n\n\t \t\t\t\t\t\tshowPerson(theDoer);\n\n\t \t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t}", "title": "" }, { "docid": "b4ed65a74d2e0ff22347ba392394f25e", "score": "0.5069282", "text": "function activityStudentSelection(){\n var objStudents = findCookie(\"estudiantes\"); // Obtener la lista de estudiantes\n if (objStudents != null) {\n var arrayStudentEmails = Object.keys(objStudents); // get array of keys (emails)\n var selection = document.getElementById(\"studentSelection\");\n selection.innerHTML = \"\";\n for (var i = 0; i < arrayStudentEmails.length; i++) {\n var studentFullName = objStudents[arrayStudentEmails[i]].name + \" \" + objStudents[arrayStudentEmails[i]].surname + \", \" + objStudents[arrayStudentEmails[i]].NIA + \", \" + arrayStudentEmails[i];\n var option = document.createElement(\"OPTION\");\n option.text = studentFullName;\n selection.add(option);\n }\n }\n}", "title": "" }, { "docid": "457299a2def93b5612583335c7b664c0", "score": "0.506376", "text": "peliSeleccionada(event) {\n var idPelicula = event.currentTarget.id;\n for (let i=0;i<=this.datapeliculas.length-1;i++){\n if (idPelicula==this.datapeliculas[i].id){\n this.titulo = this.datapeliculas[i].title;\n this.imagen=\"https://image.tmdb.org/t/p/original/\" + this.datapeliculas[i].poster_path;\n this.sinopsis = this.datapeliculas[i].overview;\n this.porcentaje1 = parseInt(this.datapeliculas[i].popularity);\n this.porcentaje2 = (parseInt(this.datapeliculas[i].vote_average)*100)/10;\n this.fecha = this.datapeliculas[i].release_date;\n this.tituloOriginal=this.datapeliculas[i].original_title;\n this.votomedio=this.datapeliculas[i].vote_average;\n this.totalvotos=this.datapeliculas[i].vote_count;\n sessionStorage.setItem('porcentaje1',this.porcentaje1);\n sessionStorage.setItem('porcentaje2',this.porcentaje2); \n sessionStorage.setItem('titulo1',this.titulo); \n\n }\n \n }\n\n }", "title": "" }, { "docid": "0ca4ca4db8c73d0bcc992b5dab0fb533", "score": "0.5058199", "text": "function PersoProchain(){\n\tif(iValeurArrayPerso < iLengthPerso-1){\n\t\tiValeurArrayPerso ++;\n\t\tdocument.getElementById(\"nomPerso\").innerHTML = Personnages[iValeurArrayPerso][0];\n\t\tdocument.getElementById(\"especePerso\").innerHTML = Personnages[iValeurArrayPerso][1];\n\t\tdocument.getElementById(\"nivPerso\").innerHTML = Personnages[iValeurArrayPerso][2];\n\t\tsSrcImgPersoHD.src = Personnages[iValeurArrayPerso][4];\n\t\t//alert(iValeurArrayPerso);\n\t}\n}", "title": "" }, { "docid": "354f9507b661cbb3ac9f483a96a4cd95", "score": "0.50406235", "text": "function displayMembershipDetails(id) {\n const details = [\n {\n id: 1,\n heading: \"Som aktiv medlem får du:\",\n perks: [\n \"Fri adgang til klubbens faciliteter på åbningsdage\",\n \"Mulighed for at spille med i løbende turnering under Dartfyn og DDU\",\n \"Betalt licens hvis du ønsker at spille med i Dartfyn eller DDU.\",\n \"Stemmeret til klubbens årlige generalforsamling.\",\n ],\n },\n {\n id: 2,\n heading: \"Som passiv medlem får du:\",\n perks: [\"Fri adgang til klubbens faciliteter på åbningsdage\"],\n },\n {\n id: 3,\n heading: \"Som pensionist får du:\",\n perks: [\n \"Fri adgang til klubbens faciliteter på åbningsdage\",\n \"Mulighed for at spille med i løbende turnering under Dartfyn og DDU\",\n \"Betalt licens hvis du ønsker at spille med i Dartfyn eller DDU.\",\n \"Stemmeret til klubbens årlige generalforsamling.\",\n ],\n },\n {\n id: 4,\n heading: \"Som junior får du:\",\n perks: [\n \"Fri adgang til klubbens faciliteter på åbningsdage\",\n \"Mulighed for at spille med i løbende turnering under Dartfyn og DDU\",\n \"Betalt licens hvis du ønsker at spille med i Dartfyn eller DDU.\",\n ],\n },\n ];\n\n /*\n *** Signup for membership\n */\n\n /* Show membership benefits when membership is selected */\n const container = document.querySelector(\"#member-details\");\n const heading = document.querySelector(\"#membership-heading\");\n const list = document.querySelector(\"#membership-details\");\n const perks = details[id - 1].perks;\n const parents = document.querySelector(\"#parents-radio\");\n // Show details container\n container.style.display = \"block\";\n\n // Set heading in HTML\n heading.innerHTML = details[id - 1].heading;\n // Reset list\n list.innerHTML = \"\";\n // Set new values\n for (let i = 0; i < perks.length; i++) {\n $(\"#membership-details\").append(\"<li>\" + perks[i] + \"</li>\");\n }\n\n // If membership type is Junior, show extra input for discount\n if (id == 4) {\n parents.style.display = \"block\";\n } else {\n parents.style.display = \"none\";\n }\n }", "title": "" }, { "docid": "b6c0b2b15014dab119b2b12c36dfb622", "score": "0.5035365", "text": "function selectGestor(gestor){\r\n\t$('id_responsable').value = gestor.id;\r\n\t$('responsable').value = gestor.nombre;\r\n}", "title": "" }, { "docid": "db2e0338c74a506718a2d69feddd60db", "score": "0.50233257", "text": "function selectRegimen(identificador){\n\t $.ajax({\n\t \n\t url: '/ProyEscalafon/public/listarRegimen',\n\t type: 'GET',\n\t success: function(respuesta){\n\t \n\t let registro = '';\n\t \n\t respuesta.forEach(obj_json =>{\n\t obj_json.forEach(obj_json => {\n\n\t registro += `<option value='${obj_json.id}'>${obj_json.nombre}</option>`\n\n\t });\n\t });\n\t \n\t identificador.html(registro);\n\t \n\t }\n\t \n\t });\n\t}", "title": "" }, { "docid": "574d37eca6c3b6f52960e0a3f58fa90d", "score": "0.5012849", "text": "onLocalProfileChange() {\n this.populateProfileSelector();\n }", "title": "" }, { "docid": "69593c0c355c121f434c3e5e6bc48593", "score": "0.5011528", "text": "function buscarProfesor(idInput){\n\tidInput = \"#\"+idInput;\n\tvar idResults = idInput.replace(\"txt\", \"res\");\n var resInvitados = document.querySelector(idResults);\n var input = document.querySelector(idInput);\n\tvar hiddenId = input.parentNode.querySelector('.hidden');\n\tif(hiddenId!=null){\n\t\thiddenId.parentNode.removeChild(hiddenId);\n\t}\n\tautocompletar(resInvitados, input, obtenerProfesores()[0], obtenerProfesores()[1]);\n}", "title": "" }, { "docid": "4a06098dcf49705a0e730522a5bbbf1e", "score": "0.49927792", "text": "function selectSamplesUser() {\n\tvar parent=document.getElementsByClassName('userFil')[0];\n\tvar users=[],organisms=[];\n\tvar j=0,k=0;\n\tfor(var i=0;i<samples.length;i++)\n\t{\n\t\tif (users.indexOf(samples[i][\"Owner\"])==-1) {\n\t\t\tusers[j]=samples[i][\"Owner\"];\n\t\t\tj++;\n\t\t}\n\t\t//console.log(samples[i][\"Organism\"]);\n\t\tif (samples[i][\"Organism\"]!==undefined) {\n\t\t\tif (organisms.indexOf(samples[i][\"Organism\"])==-1) {\n\t\t\torganisms[k]=samples[i][\"Organism\"];\n\t\t\tk++;\n\t\t}\n\t\t}\n\n\t}\n\tfor(var i=0;i<users.length;i++)\n\t{\n\t\tvar input=document.createElement(\"input\");\n\t\tvar label=document.createElement(\"label\");\n\t\tinput.setAttribute(\"type\",\"checkbox\");\n\t\tinput.setAttribute(\"checked\",\"true\");\n\t\tinput.setAttribute(\"value\",users[i]);\n\t\tinput.setAttribute(\"name\",\"user\");\n\t\tinput.setAttribute(\"onchange\",\"plotSamples()\");\n\t\tlabel.appendChild(input);\n\t\ttext=users[i];\n\t\tvar t=document.createTextNode(text);\n\t\tvar br=document.createElement(\"br\");\n\t\tlabel.appendChild(t);\n\t\tparent.appendChild(label);\n\t}\n\tparent=document.getElementsByClassName('orgaFil')[0];\n\tfor(var i=0;i<organisms.length;i++)\n\t{\n\t\tvar input=document.createElement(\"input\");\n\t\tvar label=document.createElement(\"label\");\n\t\tinput.setAttribute(\"type\",\"checkbox\");\n\t\tinput.setAttribute(\"checked\",\"true\");\n\t\tinput.setAttribute(\"value\",organisms[i]);\n\t\tinput.setAttribute(\"name\",\"organism\");\n\t\tinput.setAttribute(\"onchange\",\"plotSamples()\");\n\t\tlabel.appendChild(input);\n\t\ttext=organisms[i];\n\t\tvar t=document.createTextNode(text);\n\t\tvar br=document.createElement(\"br\");\n\t\tlabel.appendChild(t);\n\t\tparent.appendChild(label);\n\t}\n\tcreateSamplePlots();\n}", "title": "" }, { "docid": "92deac843b5d3c19d48fd2a7121c30c6", "score": "0.49885163", "text": "function makeSelected(painel) {\n var painelEscolhido = document.createElement(\"div\");\n painelEscolhido.className = painel.className;\n painelEscolhido.id = painel.id;\n painelEscolhido.dataset.id = $(painel).data('id');\n painelEscolhido.dataset.state = 'escolhido';\n painelEscolhido.innerHTML = painel.innerHTML;\n\n painelEscolhido.addEventListener('click', function(e){\n e.preventDefault();\n var removerEscolhido = document.getElementById(this.id);\n document.getElementById(\"showPaineis\").removeChild(removerEscolhido);\n makeDisponivel(this);\n });\n\n document.getElementById(\"showPaineis\").appendChild(painelEscolhido);\n var lista = document.getElementById('showPaineis').childNodes;\n var idPainel = [];\n $.each(lista, function(k,item){\n idPainel.push($(item).data('id'));\n });\n for(var i=0; i<idPainel.length; i++){\n $('#idPainel'+(i+1).toString()).val(idPainel[i]);\n }\n\n}", "title": "" }, { "docid": "00da4f8c589e1335b3f10c9a47306626", "score": "0.49693003", "text": "onSelectCandidate(){\n var e = document.getElementById(\"candtowinSelect\");\n var strUser = e.options[e.selectedIndex].value;\n\n \n this.props.set_candidate_to_win(strUser);\n }", "title": "" }, { "docid": "37e29045a24529e77ad25161f735ec71", "score": "0.49626735", "text": "function showPhotographerMainSection(array, id)\n{\n document.getElementById(\"photographer-indivisual-main\").innerHTML = array.find(photographer => photographer.photographer.id === id).showIndividualProfile(id);\n}", "title": "" }, { "docid": "2e146419674d0913ba2128ca64e6bdac", "score": "0.49532357", "text": "function selectProveedor(datos) {\n\n var dt = tblProveedores.row($(datos).parents('tr')).data();\n id_proveedor=dt[0];\n proveedor(id_proveedor)\n }", "title": "" }, { "docid": "dac7c544c24159cffa90dd8d6d5617d0", "score": "0.4945507", "text": "function buildProfile()\n {\n // Determine what type of person\n var form = {};\n if (listType === \"Doctor\" || searchType === \"Specialty\")\n {\n form = {personID : currentID};\n\n // Load script that builds profile for doctor\n $(\"#profileView\").empty().load(\"php/profileDoctor.php\", form);\n }\n else if (listType === \"Patient\" || searchType === \"Illness\")\n {\n form = {personID : currentID};\n\n // Load script that builds profile for patient\n $(\"#profileView\").empty().load(\"php/profilePatient.php\", form);\n }\n }", "title": "" }, { "docid": "7cb9888b235343c0f24a63936d5ca7bf", "score": "0.49351403", "text": "function selectCondicion(identificador) {\n\t $.ajax({\n\t \n\t url: '/ProyEscalafon/public/listarCondicion',\n\t type: 'GET',\n\t success: function(respuesta){\n\t \n\t let registro = '';\n\t \n\t respuesta.forEach(obj_json =>{\n\t obj_json.forEach(obj_json => {\n\n\t registro += `<option value='${obj_json.id}'>${obj_json.nombre}</option>`\n\n\t });\n\t });\n\t \n\t identificador.html(registro);\n\t \n\t }\n\t \n\t });\t\n\t}//Fin de llenar select", "title": "" }, { "docid": "6f14cd63e115c425284f868c7264c405", "score": "0.49247688", "text": "function selectionID() {\n idSelected = d3.event.target.value;\n console.log(\"This is the id Selected:\" + idSelected)\n\n // Calls to later function in which we gather information from id selected\n demoInfo(idSelected)\n\n }", "title": "" }, { "docid": "1ff65aed9dbae55d0cb28c6092e81c1a", "score": "0.49235016", "text": "chooseProfile(index, playerType) {\n let profilesList = JSON.parse(localStorage.getItem(\"profilesList\"));\n\n switch (playerType) {\n case 'main': \n profilesList.active = index;\n //Carga el nombre en New game.\n $('.player-name:eq(0)').css('color', 'green');\n $('.player-name:eq(0)').html(profilesList.profiles[index].name);\n break;\n case 'guest': \n profilesList.guestActive = index; \n break;\n }\n \n localStorage.setItem('profilesList', JSON.stringify(profilesList));\n }", "title": "" }, { "docid": "c0208ae6ff351b664d417f2f9eb659b2", "score": "0.4922254", "text": "function setDivisionPolitica(data) {\n\n function setProvincias(idSelectProvincia, idSelectCanton, idSelectDistrito) {\n\n let provincia;\n let htmlProvincias;\n htmlProvincias += \"<option value=''>\" + 'Provincia' + \"</option>\";\n for (var i = 0; i < data.provincias.length; i++) {\n // htmlProvincias += \"<option value='\" + data.provincias[i].title + \"'>\" + data.provincias[i].title + \"</option>\";\n htmlProvincias += `<option value=\"${data.provincias[i].title}\" ${data.provincias[i].title == user.provincia ? 'selected' : ''}>` + data.provincias[i].title + \"</option>\";\n\n }\n const selectProvincias = document.querySelector('#' + idSelectProvincia);\n selectProvincias.innerHTML = htmlProvincias;\n selectProvincias.addEventListener('change', setCantones);\n setCantones();\n\n function setCantones() {\n provincia = data.provincias.find(function (current, index, arr) {\n return current.title === selectProvincias.options[selectProvincias.selectedIndex].value;\n });\n let htmlCantones;\n for (var i = 0; i < provincia.cantones.length; i++) {\n // htmlCantones += \"<option value='\" + provincia.cantones[i].title + \"'>\" + provincia.cantones[i].title + \"</option>\";\n htmlCantones += `<option value=\"${provincia.cantones[i].title}\" ${provincia.cantones[i].title == user.canton ? 'selected' : ''}>` + provincia.cantones[i].title + \"</option>\";\n\n }\n const selectCantones = document.querySelector('#' + idSelectCanton);\n selectCantones.innerHTML = htmlCantones;\n selectCantones.addEventListener('change', setDistritos);\n setDistritos();\n\n function setDistritos() {\n const canton = provincia.cantones.find(function (current, index, arr) {\n return current.title === selectCantones.options[selectCantones.selectedIndex].value;\n });\n\n let htmlDistritos;\n for (var i = 0; i < canton.distritos.length; i++) {\n // htmlDistritos += \"<option value'\" + canton.distritos[i].title + \"'>\" + canton.distritos[i].title + \"</option>\";\n htmlDistritos += `<option value=\"${canton.distritos[i].title}\" ${canton.distritos[i].title == user.distrito ? 'selected' : ''}>` + canton.distritos[i].title + \"</option>\";\n\n }\n const selectDistritos = document.querySelector('#' + idSelectDistrito);\n selectDistritos.innerHTML = htmlDistritos;\n }\n }\n }\n\n setProvincias(\"selectProvincias\", \"selectCantones\", \"selectDistritos\")\n setProvincias(\"selectProvinciasCE\", \"selectCantonesCE\", \"selectDistritosCE\")\n setProvincias(\"selectProvinciasSA\", \"selectCantonesSA\", \"selectDistritosSA\")\n}", "title": "" }, { "docid": "1b0f3cefdfef6b4879c4decb3f62b4a8", "score": "0.49212757", "text": "function selectPerson () {\n // Update the selected people based on the checked checkboxes\n const checkboxesArray = Array.prototype.slice.call(document.getElementsByName('personSelect'))\n selectedPeople = checkboxesArray.filter((checkbox) => {\n return checkbox.checked === true\n }).map((element) => {\n return element.value\n })\n\n gotoUpdate(queuedUpdateIndex + 1)\n}", "title": "" }, { "docid": "38d20104275e6d34e25d0e9aab832448", "score": "0.4901864", "text": "function selectTipoDocIdentidad(identificador){\n\t $.ajax({\n\t \n\t url: '/ProyEscalafon/public/listarTipoDocIdentidad',\n\t type: 'GET',\n\t success: function(respuesta){\n\t \n\t let registro = '';\n\t \n\t respuesta.forEach(obj_json =>{\n\t obj_json.forEach(obj_json => {\n\n\t registro += `<option value='${obj_json.id}'>${obj_json.nombre}</option>`\n\n\t });\n\t });\n\t \n\t identificador.html(registro);\n\t \n\t }\n\t \n\t });\n\t}", "title": "" }, { "docid": "ce00d515a53e8ed9123bd23b32501c94", "score": "0.48989785", "text": "get_ProfileID() { \n\t\treturn this.profilefields.get(0).getText().then(function(returnValue) {\n\t\t\treturn returnValue;\n\t\t});\n\t}", "title": "" }, { "docid": "6cd968aa826f62971c91d3931d518212", "score": "0.48925275", "text": "function updateEzProfileList() {\n var selectElement = document.querySelector(\"#joypad-config-form #ez-profile-select\");\n if( selectElement ) {\n var currentValue = selectElement.options[selectElement.selectedIndex].value;\n var curLabel = selectElement.parentNode.querySelector(\"span\").innerText;\n var profileOptions = Object.keys(profilesDict);\n profileOptions.unshift(\"\");\n selectElement.parentNode.replaceWith( createMenu( currentValue, profileOptions, selectElement.getAttribute(\"id\"), curLabel, selectElement.onchange, selectElement.getAttribute(\"required\") ) );\n }\n}", "title": "" }, { "docid": "c030556c3032d1dcfdd0903ee39f8360", "score": "0.48885736", "text": "function select(idusuario) {\n // aqui registramos los datos del usuario y validamos.\n base.get(\"SELECT * FROM perfiles WHERE idusu = ?\", idusuario, function (err, filas) {\n //hacemos una consulta a la db si el usuario ya esta registrado, enviandole el idusuario..\n if(err){ //aqui verificamos si existe algun error con las SENTENCIAS.\n console.log(err.message) \n } else {\n // si no existe ningun error \n if(!filas){\n //usuario No esta registrado\n // si no esta registrado ps! lo registramos no ?\n let sentencia = base.prepare(\"INSERT INTO perfiles VALUES (?, ?, ?, ?, ?, ?, ?)\");\n //aqui para registrar a la tabla perfiles requiere de 5 parametros:\n sentencia.run(idusuario, 0, 1, 'Sin información previa.', 0, 0, 0); // No tocar - Crater\n // id nivel: 0, exp: 1, info: cualquiera de inicio estado: 0\n \n //basicamente lo que hiso fue añadir algo a la tabla\n //lo de base.run idusu = idusuario etc etc\n //para aclarar al que no entendio\n \n \n base.get(\"SELECT * FROM perfiles WHERE idusu = ?\", idusuario, function (err, _filas) {\n if(err){ //aqui verificamos si existe algun error con las SENTENCIAS.\n console.log(err.message)\n }\n let datos = _filas;\n \n let expT = Math.trunc(Math.pow((Number(_filas.nivel)) / 0.1, 2)).toString(); \n let frameFactor = Math.trunc(Math.pow((Number(_filas.nivel) + 1) / 0.1, 2)) - Math.trunc(Math.pow((Number(_filas.nivel)) / 0.1, 2));\n\n let nPorcent = (((Number(_filas.xp) - Number(expT)) / frameFactor) * 100).toFixed(0);\n let xpStats = `${_filas.xp - expT}/${frameFactor}`;\n \n\n let embed = new Discord.RichEmbed()\n .setAuthor('Perfil de ' + message.author.username, message.author.displayAvatarURL)\n .addField('Nivel', datos.nivel, true)\n .addField('Porcentaje', nPorcent+`%`, true)\n .addField('XP', xpStats +` (Tot. ${datos.xp})`, true)\n .addField('Reputación', datos.rep, true)\n .addField('Likes', datos.like, true)\n .addField('Descripción', datos.info, true)\n .setColor(\"ff7b00\")\n enviar.local(embed);\n \n \n });\n \n \n \n } else {\n // Si el usuario esta registrado, solo obtenemos sus datos.\n \n base.get(\"SELECT * FROM perfiles WHERE idusu = ?\", idusuario, function (err, __filas) {\n if(err){ //aqui verificamos si existe algun error con las SENTENCIAS.\n console.log(err.message)\n }\n \n let datos = __filas;\n\n let expT = Math.trunc(Math.pow((Number(__filas.nivel)) / 0.1, 2)).toString(); \n let frameFactor = Math.trunc(Math.pow((Number(__filas.nivel) + 1) / 0.1, 2)) - Math.trunc(Math.pow((Number(__filas.nivel)) / 0.1, 2));\n\n let nPorcent = (((Number(__filas.xp) - Number(expT)) / frameFactor) * 100).toFixed(0);\n let xpStats = `${__filas.xp - expT}/${frameFactor}`;\n \n let embed = new Discord.RichEmbed()\n .setAuthor('Perfil de ' + message.author.username, message.author.displayAvatarURL)\n .addField('Nivel', datos.nivel, true)\n .addField('Porcentaje', nPorcent+`%`, true)\n .addField('XP', xpStats +` (Tot. ${datos.xp})`, true)\n .addField('Reputación', datos.rep, true)\n .addField('Likes', datos.like, true)\n .addField('Descripción', datos.info, true)\n .setColor(\"ff7b00\")\n enviar.local(embed);\n \n }); \n \n }\n \n }\n \n });\n }", "title": "" }, { "docid": "dca856e4e45c02573d979f3532d9c5c3", "score": "0.4887975", "text": "getSceneClass() {\n return Profil;\n }", "title": "" }, { "docid": "dfbc53e09ff03bbebc5ac3b746037cda", "score": "0.48803464", "text": "function nextProfile() {\n var numProfiles;\n \n if (!gameMode) {\n numProfiles = agileModel.PROFILES.length;\n } else {\n numProfiles = agileModel.activeProfiles.length;\n }\n \n if (session.selectedProfile >= numProfiles - 1) {\n session.setProfile(session.selectedProfile = 0);\n } else {\n session.setProfile(session.selectedProfile + 1);\n }\n \n print(\"Profile: \" + (session.selectedProfile+1));\n}", "title": "" }, { "docid": "b9a0845dd4b35fc5d2f96d1b7e88e0a0", "score": "0.48796138", "text": "function OnOccupancyUse_Change( e )\r\n{\r\n current_occupancy_use = e.id ;\r\n}", "title": "" }, { "docid": "6166c3c9b67a10be347b14fb23263c61", "score": "0.48787415", "text": "function typepersoonSelectCheck(nameSelect)\n{\n // Als er voor persooon is gekozen, de optie \"Beoordeling\" weglaten\n if(nameSelect){\n admOptionValue = document.getElementById(\"uitnodigen_student\").value;\n if(admOptionValue == nameSelect.value){\n document.getElementById(\"uitnodigen_feedback\").style.display = \"block\";\n document.getElementById(\"uitnodigen_beoordeling\").style.display = \"none\";\n document.getElementById(\"uitnodigen_groepsopdracht\").style.display = \"block\";\n\n // to select the first visible option\n$('uitnodigen_student').first().attr('selected', 'selected');\n }\n // Als een andere optie is gekozen (docent), de optie groepsopdracht weglaten\n else{\n document.getElementById(\"uitnodigen_feedback\").style.display = \"block\";\n document.getElementById(\"uitnodigen_beoordeling\").style.display = \"block\";\n document.getElementById(\"uitnodigen_groepsopdracht\").style.display = \"none\";\n\n // to select the first visible option\n$('uitnodigen_student').first().attr('selected', 'selected');\n }\n }\n}", "title": "" }, { "docid": "cf58d44f806a0c7196fc5bf6bc9affce", "score": "0.48783433", "text": "selectedProfile(event){\n\n // USER'S SELECTION\n let id = event.target.value\n\n // PUT SELECTED PROFILE IN THIS ARRAY\n let selectedProfile = [];\n\n // AJAX CALL (ACTUALLY MIGHT NOT NEED THIS, REFACTOR NEXT TIME)\n const url = '/reactInfo.json';\n axios.get(url)\n .then((response) => {\n\n const data = response.data\n\n if(data.loggedIn === \"coders\"){\n for(let i=0; i < data.searchers.length; i++){\n if(parseInt(data.searchers[i].id) === parseInt(id)){\n selectedProfile.push(data.searchers[i])\n }\n }\n this.setState({ selectedProfile: selectedProfile })\n } else {\n for(let i=0; i < data.coders.length; i++){\n if(parseInt(data.coders[i].id) === parseInt(id)){\n selectedProfile.push(data.coders[i])\n }\n }\n this.setState({ selectedProfile: selectedProfile })\n }\n\n console.log(\"selectedProfile state\")\n console.log(this.state)\n\n }).catch((error)=>{\n console.log(error);\n })\n\n }", "title": "" }, { "docid": "1c261b07a13e42ed731f90c5b7136a2f", "score": "0.48761332", "text": "function findProfile(id) {\n return (\n db(\"student as s\")\n .join(\"volunteer as v\", \"v.id\", \"s.volunteerId\")\n .select(\n //student info\n \"s.id as IDNumber\",\n \"s.username as Username\",\n \"s.forename as FirstName\",\n \"s.surname as LastName\",\n //volunteer info\n \"v.id as TeacherIdNumber\",\n \"v.forename as TeacherFirstName\",\n \"v.surname as TeacherLastName\",\n \"s.country as Country\"\n )\n //filtered by student id number\n .where(\"s.id\", id)\n );\n}", "title": "" }, { "docid": "1353422ad4ee287adabbe7b19b6169be", "score": "0.4875515", "text": "function selectGrupo(identificador) {\n\t $.ajax({\n\t \n\t url: '/ProyEscalafon/public/listarGrupo',\n\t type: 'GET',\n\t success: function(respuesta){\n\t \n\t let registro = '';\n\t \n\t respuesta.forEach(obj_json =>{\n\t obj_json.forEach(obj_json => {\n\n\t registro += `<option value='${obj_json.id}'>${obj_json.nombre}</option>`\n\n\t });\n\t });\n\t \n\t identificador.html(registro);\n\t \n\t }\n\t \n\t });\t\n\t}//Fin de llenar select", "title": "" }, { "docid": "03650a8e38aee6862de4e4095f425b64", "score": "0.48557186", "text": "selectProfile(card) {\n const queryEmail = card.lastElementChild.children[1].innerHTML //the email of the card selected\n this.selectedUserIndex = this.model.visibleData.findIndex(index => index.email == queryEmail) //find the index of the user based on their email\n this.createModal(this.view, this.model.visibleData[this.selectedUserIndex]) //calls for the select modal\n }", "title": "" }, { "docid": "2936dc5319a3d272e95ca428109aafed", "score": "0.48523974", "text": "function seleccionar(id_fila) {\n //2702id_fila_selected=id_fila;\n id_fila_selected.push(id_fila);\n console.log(\"fila seleccionadda\");\n console.log(id_fila);\n console.log(id_fila_selected);\n\n}//--/.Fin function------------------", "title": "" }, { "docid": "37e3df0330dc2d7575e20bd5b52ebe04", "score": "0.4845534", "text": "function printa_user() {\n //pega o valor do ID do usuario selecionado\n/* let user_id = document.getElementById(\"select_user\").value;\n */ //acha o index no banco de dados cujo ID é o do usuario selecionado\n/* let user_dados_index = db_user.data.findIndex(x => x.id == user_id);\n */ //joga na variavel todo o objeto cujo ID eh o do usuario\n/* let user_dados = db_user.data[user_dados_index]; */\n \n //altera os campos com os valores\n $(\"#nome\").val(`${usuarioCorrente.nome} ${usuarioCorrente.sobrenome}`);\n $(\"#status\").val(`${usuarioCorrente.status}`);\n $(\"#sobre\").val(`${usuarioCorrente.sobre}`);\n $(\"#anonimato\").val(`${usuarioCorrente.anonimato}`);\n $(\"#valor\").val(`${usuarioCorrente.valor}`);\n $(\"#celular\").val(`${usuarioCorrente.celular}`);\n $(\"#cep\").val(`${usuarioCorrente.cep}`);\n $(\"#email\").val(`${usuarioCorrente.email}`);\n $(\"#senha\").val(`${usuarioCorrente.senha}`);\n}", "title": "" }, { "docid": "2aa053ba0425f6103a732a101b589016", "score": "0.48439354", "text": "function selectEstudiante(id_grupoestudiante){\n\tgrupoestudianteNota.id_grupoestudiante=id_grupoestudiante;\n\t\n\t$(\".id_grupoestudiante\").val(id_grupoestudiante);\n\tid=$(\".id_grupoestudiante\").val();\n\t//alert(id);\n\tconsole.log(id_grupoestudiante);\n}", "title": "" }, { "docid": "9e89e0f3754c81cbee85ab4e4da9d398", "score": "0.48349404", "text": "function fnLlenaDatos(){\n //crea objeto a mostrar\n var persona = {\n nombre: prompt(\"Introduce tu nombre:\"),\n edad : prompt(\"Introduce tu edad:\"),\n profesiones: fnProfesiones() //llena con subojeto con base en este método que recibe las profesiones\n }\n\n fnImprimeDatos(persona);\n}", "title": "" }, { "docid": "9a28fb7cc12bf6ca09a6d8b631da5802", "score": "0.48310336", "text": "function loadEzProfile() {\n var selectElement = document.querySelector(\"#joypad-config-form #ez-profile-select\");\n var name = selectElement.options[selectElement.selectedIndex].value;\n if( name ) {\n var profile = profilesDict[name];\n if( profile ) {\n for( var i=0; i<EZ_EMULATOR_CONFIG_BUTTONS.length; i++ ) {\n var curInput = document.querySelector(\"#ez-input-\" + i);\n curInput.value = profile[EZ_EMULATOR_CONFIG_BUTTONS[i]];\n updateEzControlSimpleView( curInput );\n }\n var inputElement = document.querySelector(\"#joypad-config-form #ez-profile-input\");\n inputElement.value = name;\n inputElement.oninput();\n var nunchukSelectMenu = document.querySelector(\"#nunchuk-select-menu\");\n if( profile.nunchuk && profile.noExtension ) nunchukSelectMenu.selectedIndex = 2;\n else if( profile.nunchuk ) nunchukSelectMenu.selectedIndex = 1;\n else nunchukSelectMenu.selectedIndex = 0;\n createToast( \"Profile loaded\" );\n }\n }\n}", "title": "" }, { "docid": "3be4effa7e0edc1e2ca37b2c75857d60", "score": "0.4830144", "text": "function exibirPerfil() {\n\t\ttrocar(\"#form-login\", \"#form-perfil\");\n\t\tfocus(\"#Perfil\");\n\n\t\tvar params = {};\n\n\t\t// Carrega os perfis\n\t\t$.ajax({\n\t\t\turl : \"login.perfis.admin\",\n\t\t\ttype : \"POST\",\n\n\t\t\tbeforeSend : function(data) {\n\t\t\t\tconsole.log(\"loading...\");\n\t\t\t},\n\n\t\t\tsuccess : function(data) {\n\t\t\t\tvar retorno = $.parseJSON(data);\n\n\t\t\t\tfillSelect(\"#Perfil\", retorno,\n\t\t\t\t\t\t\"CodigoEmpresa;CodigoLoja;CodigoPerfil\", \"NomePerfil\",\n\t\t\t\t\t\t\"\");\n\n\t\t\t\t$(\"#Perfil\").focus();\n\t\t\t},\n\t\t\terror : function(erro) {\n\t\t\t\tconsole.log(\"Erro no load ajax! \" + erro);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "8189de43d2c951595977ca3d0ee7bc4f", "score": "0.48283428", "text": "function select_conversation(other_prof_ID){\n\t// Make the corresponding conversation active and the rest hidden\n\t$(\".conversation\").hide();\n\t$(\".conversation\").removeClass(\"active_conv\");\n\t$(\".conv_li\").css(\"background-color\", \"#fbfcff\");\n\t$(\"#conversation\" + other_prof_ID).show();\n\t$(\"#conversation\" + other_prof_ID).addClass(\"active_conv\");\n\t$(\"#conv\" + other_prof_ID).css(\"background-color\", \"#b2cdff\");\n\t// load the conversation from server using AJAX\n\t$.ajax({\n\t\turl: \"/TEDProject/AJAXServlet?action=loadConvo\",\n\t\ttype: \"post\",\n\t\tdata: { homeprof: profID, awayprof: other_prof_ID },\n\t\tsuccess: function(response){\n\t\t\t$(\"#conversation\" + other_prof_ID).html(response);\n\t\t\tupdateScroll();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f7c38960b2d6ba7993b17ba442239050", "score": "0.4827167", "text": "function ListarPreferencias(nidusuario, nombres) {\n\n var vnombres = $(nombres).attr(\"name\");\n\n $(\"#txt_nidusuariopreferencia\").val(nidusuario);\n $(\"#txt_nombresusuariopreferencia\").val(vnombres);\n var nombreusuario = $(\"#txt_nombresusuariopreferencia\").val();\n $(\"#tituloPopupPreferencias\").html('PREFERENCIAS DEL USUARIO: ' + nombreusuario);\n\n SelectUsuarioPreferenciaMercado(nidusuario);\n NoSelectUsuarioPreferenciaMercado(nidusuario);\n if (idmercado == undefined) {\n idmercado = 0;\n } \n SelectUsuarioPreferenciaProducto(nidusuario,idmercado);\n NoSelectUsuarioPreferenciaProducto(nidusuario,idmercado);\n MostrarPopupPreferencias(1000, 520);\n}", "title": "" }, { "docid": "cac766f9856104935eda82f323c97cb9", "score": "0.4818923", "text": "function persoChoisi(persoId)\n{\n\ttry{ socket.send(\"persoChoisi:\" + persoId); } catch(ex){ }\n\tfor(i = 0 ; i < listePersos.length ; i++)\n\t{\n\t\tif (listePersos[i].id == persoId)\n\t\t{\n\t\t\tpersoSelf = listePersos[i];\n\t\t}\n\t}\n}", "title": "" }, { "docid": "831d3c0e2951cfe9e6a1f70c8c109400", "score": "0.48173678", "text": "function cambiarEstado() {\n\n let id = this.id\n let colaboradorBuscado = id.substring(6);\n\n for (let i = 0; i < colaboradores.length; i++) {\n if (colaboradores[i].id == colaboradorBuscado) {\n if (colaboradores[i].estado == true) {\n colaboradores[i].estado = false;\n }\n else {\n colaboradores[i].estado = true;\n }\n\n }\n }\n\n mostrarColaboradores(colaboradores)\n\n}", "title": "" }, { "docid": "b34a825723d7b9e53b32a9c646bfb3c8", "score": "0.48153967", "text": "function listarProvincias(provincias){\n provincias.forEach(function(provincia, index) {\n $('#provincia').append($('<option>', {\n value: provincia['id_provincia'],\n text: provincia['nombre_provincia']\n }));\n })\n }", "title": "" }, { "docid": "01d7889d562ea847b5e75306276ac8cf", "score": "0.48148236", "text": "function showBonusTemp(){\n\tvar slideGenListe = document.getElementsByClassName(\"menuGen\");\n\tfor (let entry of slideGenListe){\n\t\tentry.classList.add(\"notSelect\");\n\t\tentry.classList.remove(\"select\");\n\t}\n\tdocument.getElementById(\"buffTemporaire\").classList.replace(\"notSelect\", \"select\");\n}", "title": "" }, { "docid": "15a1e6806ae80d87122b61ca277f536c", "score": "0.48145995", "text": "function alreadySelectedLecture() {\n selectedLecture.forEach(function(majorName, lectureNumber){\n\n var eachLecture = $(\"div.each-subject.modal-subject-name[lecture-number='\"+lectureNumber+\"']\");\n var lectureName = eachLecture.attr(\"lecture-name\");\n\n eachLecture.addClass(\"selected\");\n $(\"td.selectable[lecture-name='\" + lectureName + \"']\").addClass(\"selected\");\n });\n}", "title": "" }, { "docid": "f7156ff2b126cabe28976f33f52146b2", "score": "0.48086676", "text": "async function getProfId(name) {\n try {\n const snapshot = await profsRef\n .orderByChild('name')\n .equalTo(name)\n .once('value');\n const prof = Object.keys(snapshot.val())[0];\n return { err: null, prof };\n } catch (err) {\n console.error(err);\n return { err: err.message, prof: null };\n }\n}", "title": "" }, { "docid": "f7af02b701837348907014d078e9773e", "score": "0.48021433", "text": "function _loadSelectedId(name, data) {\r\n\r\n var selectedId = data[1];\r\n\r\n vm.data.FriendRecursionLevel = 2;\r\n vm.data.CurrentPage = 1;\r\n vm.data.ItemsPerPage = 25;\r\n vm.data.selectedId = selectedId;\r\n\r\n vm.$personalizedService.getFriendsOfFriendsRatingsAll(vm.data, vm.getSpecificFriendData, vm.onLoadError);\r\n }", "title": "" }, { "docid": "b88b088c70e6e768414df3ce132d4edd", "score": "0.4802137", "text": "function myFunctionDesplegable(){ // ESTA SERVIRÁ PARA EL DESPLEGABLE (tal vez)\r\n var inputElements = document.getElementByClassName('desp'); \r\n for(var i=0; inputElements[i]; ++i){\r\n if(inputElements[i].selected){\r\n posicionDesplegable = inputElements[i].value;\r\n }\r\n }\r\n console.log(\"Posicion \" + posicionDesplegable + \" del desplegable\");\r\n render() \r\n }", "title": "" }, { "docid": "e5e7768003e4598348ba42e8859f2524", "score": "0.48021078", "text": "function selectOponent() {\n $('li').bind('click', function() {\n $('.hints').empty();\n $('li').css('background-color', '');\n $(this).css('background-color', 'rgb(101, 49, 94)');\n if($(this).hasClass('friend')) {\n game_type = 'friend';\n aiOrHuman(game_type);\n console.log(game_type);\n } else if($(this).hasClass('ai')) {\n game_type = 'ai';\n aiOrHuman(game_type);\n console.log(game_type);\n }\n })\n }", "title": "" }, { "docid": "2d5baaf948d5f2e21f29b9ef7ccd63f9", "score": "0.47986627", "text": "function seleccioneProveedor(){\n elementos.mensajePanel.find('h3').text('Seleccione un proveedor para ver las boletas y devoluciones pendientes');\n elementos.mensajePanel.find('.seleccionar-panel i').removeClass('fa-list').addClass('fa-search');\n elementos.mensajePanel.removeClass('hide');\n elementos.boletasPanel.addClass('hide');\n elementos.detallesPanel.addClass('hide');\n elementos.mensajePanel.find('.overlay').addClass('hide');\n }", "title": "" }, { "docid": "ebcf4a4af837d671b989772e2af7f48c", "score": "0.4797475", "text": "constructor(profesor){\n this.profesor = profesor;\n }", "title": "" }, { "docid": "5bd54bd1e11aafe79b9ca5ffdffd0b11", "score": "0.47954786", "text": "async populateProfileSelector() {\n this.clearSelectedProfile();\n this.handednessSelectorElement.innerHTML = '';\n\n // Load and clear local storage\n const storedProfileId = window.localStorage.getItem('profileId');\n window.localStorage.removeItem('profileId');\n\n // Load the list of profiles\n if (!this.profilesList) {\n try {\n this.profileIdSelectorElement.innerHTML = '<option value=\"loading\">Loading...</option>';\n this.profilesList = await fetchProfilesList(profilesBasePath);\n } catch (error) {\n this.profileIdSelectorElement.innerHTML = 'Failed to load list';\n AssetError.log(error.message);\n throw error;\n }\n }\n\n // Add each profile to the dropdown\n this.profileIdSelectorElement.innerHTML = '';\n Object.keys(this.profilesList).forEach((profileId) => {\n const profile = this.profilesList[profileId];\n if (!profile.deprecated) {\n this.profileIdSelectorElement.innerHTML += `\n <option value='${profileId}'>${profileId}</option>\n `;\n }\n });\n\n // Add the local profile if it isn't already included\n if (this.localProfile.profileId\n && !Object.keys(this.profilesList).includes(this.localProfile.profileId)) {\n this.profileIdSelectorElement.innerHTML += `\n <option value='${this.localProfile.profileId}'>${this.localProfile.profileId}</option>\n `;\n this.profilesList[this.localProfile.profileId] = this.localProfile;\n }\n\n // Override the default selection if values were present in local storage\n if (storedProfileId) {\n this.profileIdSelectorElement.value = storedProfileId;\n }\n\n // Manually trigger selected profile to load\n this.onProfileIdChange();\n }", "title": "" }, { "docid": "5b1e09140be802d57255adf15ddf94fc", "score": "0.47944912", "text": "function loadProfileList() {\n}", "title": "" }, { "docid": "1d15d2fb36a15af2d914ad30fc073ed4", "score": "0.47944814", "text": "function selecionar_seccion(pk,table){\t\n\tseccion=pk;\t\n}", "title": "" }, { "docid": "98d9b800b2fb5b51c4cdc5dd46502aea", "score": "0.47934595", "text": "function checkCharSex(male, female, select){\n\n var selected_chars = []\n for (var i = 0; i < select.length; i++){\n if (select[i][0] == \"sex\"){\n selected_chars.push(select[i][1])\n }\n else{\n selected_chars.push(select[i][0])\n }\n }\n\n if (female.some(v=> selected_chars.indexOf(v) !== -1) == true){\n console.log(\"female character is in selected\");\n var to_hide = $('div[data-sex=\"male\"]')\n var to_show = $('div[data-sex=\"female\"]')\n\n for (var i = 0; i < to_hide.length; i++){\n to_hide[i].style.display = \"none\";\n }\n for (var i = 0; i < to_show.length; i++){\n to_show[i].style.display = \"block\";\n }\n if ((selected_chars.indexOf(\" Female\") !== -1) != true){\n descripSelect('Sex: female', 'Sex-panel', `sex! Female`)\n console.log(\"calulating female input...\")\n }\n }\n else if (male.some(v=> selected_chars.indexOf(v) !== -1)){\n console.log(\"male character is in selected\")\n var to_hide = $('div[data-sex=\"female\"]')\n var to_show = $('div[data-sex=\"male\"]')\n for (var i = 0; i < to_hide.length; i++){\n to_hide[i].style.display = \"none\";\n }\n for (var i = 0; i < to_show.length; i++){\n to_show[i].style.display = \"block\";\n }\n if ((selected_chars.indexOf(\" Male\") !== -1) != true){\n descripSelect('Sex: male', 'Sex-panel', `sex! Male`)\n console.log(\"calulating Male input...\")\n }\n\n }\n else {\n console.log(\"No male or female characters in selected\")\n var to_show1 = $('div[data-sex=\"male\"]')\n var to_show2 = $('div[data-sex=\"female\"]')\n\n for (var i = 0; i < to_show1.length; i++){\n to_show1[i].style.display = \"block\";\n }\n\n for (var i = 0; i < to_show2.length; i++){\n to_show2[i].style.display = \"block\";\n }\n }\n\n }", "title": "" }, { "docid": "92cb54095e2b9f52a49dbb9173264ffe", "score": "0.47927117", "text": "function loadSexSelect(){\n var sexServices = new SexService();\n sexServices.getSexs().then(function(sexs) {\n sexs.forEach(function(sexo) {\n $sexSelect.append($('<option>').val(sexo.id_sexo).text(sexo.sexo));\n });\n });\n }", "title": "" }, { "docid": "6ec3aed93119554a506dae9a82fe7d88", "score": "0.47904587", "text": "function selectSede() {\n // Para obtener el valor\n cohortsSeleccionado = document.getElementById(\"selectSede\").value;\n //obtiene lo seleccion en el select conjuntoBootcamp\n select = document.getElementById('conjuntoBootcamp');\n select.innerHTML = \"\";\n if (courses != undefined) {\n for (let i = 0; i < courses.length; i++) {\n\n let anio = courses[i].start.substring(0, 4);\n let primerSegmentoCohort = courses[i].id.split(\"-\");\n let cohort = primerSegmentoCohort[0];\n\n if (cohort === cohortsSeleccionado && anio === anioSeleccionado) {\n let opt = document.createElement('option');\n opt.value = courses[i].id;\n opt.innerHTML = courses[i].id;\n select.appendChild(opt);\n }\n }\n }\n}", "title": "" }, { "docid": "c569aa33b5ef92f9ed946cc00f7454af", "score": "0.47875163", "text": "function seleccioneProveedor(){\n elementos.mensajePanel.find('h3').text('Seleccione un proveedor para ver las boletas para la devolucion');\n elementos.mensajePanel.find('.seleccionar-panel i').removeClass('fa-list').addClass('fa-search');\n elementos.mensajePanel.removeClass('hide');\n elementos.boletasPanel.addClass('hide');\n elementos.detallesPanel.addClass('hide');\n elementos.mensajePanel.find('.overlay').addClass('hide');\n }", "title": "" }, { "docid": "aa8a65b1f0af92cbaac37faa7dd54b43", "score": "0.47818795", "text": "function iniciar() {\n\t\tdocument.querySelectorAll('.borrar').forEach(item => {\n\t\t\t item.addEventListener('click', event => {\n\t\t\t\t\tvar a = item.getAttribute(\"data-id\");\n\t\t\t\t\tvar eliminate = document.getElementById(\"delete\");\n\t\t\t\t\teliminate.href = \"/admin/deleteUser?id=\" + a;\n\t\t\t });\n\t\t});\n\t\t\n\t\tdocument.querySelectorAll('.deshabilitar').forEach(item => {\n\t\t\t item.addEventListener('click', event => {\n\t\t\t\t\tvar a = item.getAttribute(\"data-id\");\n\t\t\t\t\tvar eliminate = document.getElementById(\"toggle\");\n\t\t\t\t\teliminate.href = \"/admin/toggleuser?id=\" + a;\n\t\t\t });\n\t\t});\n\t\t\n\t\tdocument.querySelectorAll('.renovar').forEach(item => {\n\t\t\t item.addEventListener('click', event => {\n\t\t\t\t\tvar a = item.getAttribute(\"data-id\");\n\t\t\t\t\tdocument.getElementById(\"ID\").value = a;\n\t\t\t });\n\t\t});\n\t}", "title": "" }, { "docid": "f8ab57cfe29bdffe96d08b7f586b6d04", "score": "0.47775227", "text": "function _profilecodeselector(strType,strFilter, strInitialCode, fCallback, srcEle, fromWin)\r\n{\r\n\tif(strType==\"lcf\")\r\n\t{\r\n\t\t _lfc_profilepicker(strFilter,strInitialCode,fCallback,srcEle,fromWin);\r\n\t}\r\n\telse if(strType==\"cdf\")\r\n\t{\r\n\t\t _cdf_profilechanger(strFilter,strInitialCode,fCallback,srcEle,fromWin);\r\n\t}\r\n\telse if(strType==\"fix\")\r\n\t{\r\n\t\t _res_profilepicker(strFilter,strInitialCode,fCallback,srcEle,fromWin);\r\n\t}\r\n}", "title": "" }, { "docid": "11ae4f0608651e9a920d74deaa473aa6", "score": "0.47765616", "text": "anadeProfesores(data) {\n this.refProfesores.push(data);\n }", "title": "" }, { "docid": "69d240650f548b4077f041ae4b648f2f", "score": "0.4772693", "text": "function getFacultyInfo(id) {\n\tconsole.log(\"target: \" + id);\t\n\tvar match = '';\n\n\tmyXHR('get', {'path':'/people/faculty/username='+id}).done(function(json){\n\t\tvar x='';\n\t\tx+='<h3>'+json.name+'</h3>';\n\t\tx+='<img src=\"https://ist.rit.edu/assets/img/people/'+id+'.jpg\"></img>';\n\t\tx+='<h4>'+json.title+'</h4>';\n\t\tx+='<ul id=\"people-list\">';\n\t\tx+='<li>'+json.office+'</li>';\n\t\tx+='<li>'+json.phone+'</li>';\n\t\tx+='<li>'+json.email+'</li>';\n\t\tx+='</ul>';\n\t\t$('#modal-text').html(x);\n\t\t$('#modal').iziModal('setTitle', json.title);\n $('#modal').iziModal('open');\n\n\t});\n}", "title": "" }, { "docid": "1bccf84ceb5199d92596a32d859261f4", "score": "0.4769006", "text": "function getAddUserPolId() {\n\t$(\".trAddUserAccRi\").on(\"click\",function(){\n\t\tvar id = $(this).attr('accrigid');\n\t\tif (globalDeviceType == 'Mobile'){\n\t\t\tvar cond = $('.trAddUserAccRi').hasClass('highlight');\n\t\t}else{\n\t\t\tvar cond = $('#trAddUserAccRi'+id).children().find('input').is(':checked');\n\t\t}\n\t\tif (cond){\n\t\t\tif($.inArray(id, globalAddUserPolIds) == -1){\n\t\t\t\tglobalAddUserPolIds.push(id);\n\t\t\t\tif(globalDeviceType != \"Mobile\"){\n\t\t\t\t\t$('#trAddUserAccRi'+id).addClass('highlight');\n\t\t\t\t}else{\n\t\t\t\t\t$(this).addClass('highlight');\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tvar pos = globalAddUserPolIds.indexOf(id);\n\t\t\tglobalAddUserPolIds.splice(pos,1);\n\t\t\tif(globalDeviceType != \"Mobile\"){\n\t\t\t\t$('#trAddUserAccRi'+id).removeClass('highlight');\n\t\t\t}else{\n\t\t\t\t$(this).removeClass('highlight');\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1a8dd1c0be11852506e1f21278e8908e", "score": "0.47689733", "text": "function IdentifyWinnersTree() { }", "title": "" }, { "docid": "e844656cb3b9629a343945abdd603975", "score": "0.47667775", "text": "function elegirp(){\n var activeUser = JSON.parse(sessionStorage.getItem('usuario'));\n\n document.getElementById(\"usertypeheading\").innerHTML = activeUser[0].tipo;\n\n document.getElementById(\n \"usernametxt\"\n ).innerText = `${activeUser[0].nombre} ${activeUser[0].apellido}`;\n\n let navitems = [];\n\n switch (activeUser[0].tipo) {\n case \"operador\":\n navitems = document.getElementsByClassName(\"op\");\n break;\n case \"administrador\":\n navitems = document.getElementsByClassName(\"admin\");\n break;\n case \"superusuario\":\n navitems = document.getElementsByClassName(\"su\");\n break;\n }\n\n for (let i = 0; i < navitems.length; i++) {\n navitems[i].style.display = \"list-item\";\n }\n}", "title": "" }, { "docid": "632e1a8aaf12aabad95323c3bc0c32ba", "score": "0.4762841", "text": "function formPerfil(id) {\n $('#contenedor_home').empty();\n\n\n $.ajax({\n\n url: \"./php/form_perfil.php\", //formulario de subida de cursos\n type: \"post\",\n data: {\n \"userid\": id\n },\n\n\n beforeSend: function () { //Previo a la peticion tenemos un cargando\n\n $('#contenedor_home').empty(); //vaciamos el contenedor en el cual van a cargarse los cursos\n $('#carga_cursos').show(\"fast\"); //mostramos rapidamente los elementos que representan a los cursos\n },\n error: function (error) { //Si ocurre un error en el ajax\n //alert(\"Error, reintentar. \"+error);\n\n },\n complete: function () { //Al terminar la peticion, sacamos la \"carga\" visual\n\n },\n\n success: function (data) {\n\n $('#carga_cursos').hide(\"fast\"); //escondemos rapidamente los elementos que representan a los cursos\n //console.log(data);\n //$('#alert').addClass('alert-warning');\n $('#contenedor_home').empty().append(data);\n\n //buscamos el id traido de la BD de las profesiones dentro de los values del select de profesiones\n $('#input-select-formacion option').each(function () {\n //console.log($(this).val() + \" \" + $(this).text());\n let idprofesion = $('#input-select-formacion').attr(\"idprofesion\");\n\n if ($(this).val() == idprofesion) {\n\n $(this).attr(\"selected\", idprofesion);\n\n }\n });\n\n $.getScript(\"./vendor/vitalets-bootstrap-datepicker-c7af15b/js/bootstrap-datepicker.js\", function () {\n $.getScript(\"./vendor/vitalets-bootstrap-datepicker-c7af15b/js/locales/bootstrap-datepicker.es.js\", function () {\n $('.datepicker').datepicker({\n uiLibrary: 'bootstrap4',\n language: 'es',\n format: 'dd-mm-yyyy'\n });\n });\n });\n $('#change-pass').click(function (e) {\n $('#loginbox1').removeClass('d-block');\n $('#loginbox1').addClass('d-none');\n $('#loginbox2').removeClass('d-none');\n $('#loginbox2').addClass('d-block');\n\n });\n $('#back-perfil').click(function (e) {\n $('#loginbox2').removeClass('d-block');\n $('#loginbox2').addClass('d-none');\n $('#loginbox1').removeClass('d-none');\n $('#loginbox1').addClass('d-block');\n\n });\n\n $('#guardarDatos').click(function (e) {\n e.preventDefault();\n datoPerfil(\"modificar\", \"\");\n });\n $('#cambiarPass').click(function (e) {\n e.preventDefault();\n datoPerfil(\"modificar\", \"contraseña\");\n });\n\n }\n\n });\n\n}", "title": "" }, { "docid": "000fbd2c9a4a6b40a6910041045a201a", "score": "0.47624218", "text": "function filtrar(id){\n nuevoPremium = users.find(function(user){return user.id === id})\n users = users.filter((user) => {return user !== nuevoPremium})\n premiumUsers = premiumUsers.concat(nuevoPremium)\n\n console.log('Usuarios Normales\\n')\n users.forEach(function(user){console.log(user.id + ' - ' +user.name)})\n\n console.log('\\n\\nUsuarios Premium \\n')\n premiumUsers.forEach(function(user){console.log(user.id + ' - ' +user.name)})\n }", "title": "" }, { "docid": "83fe3d7b4f3e030c84033292ab7d1c47", "score": "0.47604984", "text": "onProfileIdChange() {\n this.clearSelectedProfile();\n this.handednessSelectorElement.innerHTML = '';\n\n const profileId = this.profileIdSelectorElement.value;\n window.localStorage.setItem('profileId', profileId);\n\n if (profileId === this.localProfile.profileId) {\n this.profile = this.localProfile.profile;\n this.populateHandednessSelector();\n } else {\n // Attempt to load the profile\n this.profileIdSelectorElement.disabled = true;\n this.handednessSelectorElement.disabled = true;\n fetchProfile({ profiles: [profileId], handedness: 'any' }, profilesBasePath, null, false).then(({ profile }) => {\n this.profile = profile;\n this.populateHandednessSelector();\n })\n .catch((error) => {\n AssetError.log(error.message);\n throw error;\n })\n .finally(() => {\n this.profileIdSelectorElement.disabled = false;\n this.handednessSelectorElement.disabled = false;\n });\n }\n }", "title": "" }, { "docid": "0d0ce8073556aca1cd80e2b3ba1b6913", "score": "0.4755822", "text": "function select_prov(self){\n var a = self.value;\n //Tomo el json incrustado en el html y lo analizo\n var j = document.getElementById(\"proveedor\").innerHTML;\n var k = JSON.parse(j);\n var ename = document.getElementById(\"name\");\n var erif = document.getElementById(\"rif\");\n var etype = document.getElementById(\"spe_type\");\n var edesc = document.getElementById(\"desc\");\n var eop = document.getElementById(\"up_op\");\n var op;\n if (a != 0){\n //Reviso todo el json hasta encontrar donde se igualan los datos del\n //parámetro, luego paso nombre y rif al DOM\n for(var i = 0; i < k.length; i++){\n if(k[i].up_id == a){\n ename.value = k[i].up_name;\n erif.value = k[i].up_rif;\n etype.value = k[i].spe_name;\n edesc.value = k[i].up_desc;\n op = k[i].up_op;\n document.getElementById('up_op_'+ k[i].up_op).setAttribute('selected', true);\n document.getElementById('up_fk_type_' + k[i].up_fk_type).setAttribute('selected', true);\n }\n }\n }else{\n ename.value = '';\n erif.value = '';\n etype.value = '';\n edesc.value = '';\n }\n //Si paso nombre y rif almacenados hago que los campos sean inmodificables\n if(a != 0){\n ename.setAttribute('readonly', 'true');\n erif.setAttribute('readonly', 'true');\n eop.setAttribute('readonly', true);\n\n if(op != 2){\n etype.setAttribute('readonly', 'true');\n }else{\n etype.removeAttribute('readonly');\n }\n }else{\n ename.removeAttribute('readonly');\n erif.removeAttribute('readonly');\n etype.removeAttribute('readonly');\n eop.removeAttribute('readonly');\n }\n}", "title": "" }, { "docid": "a4b0cc19e134e36067d86db67f5faa46", "score": "0.47558084", "text": "function rellenaProvincias(datos) {\n let htmlContent = '<option value=\"-1\"> </option>';\n\n for (let dato of datos) {\n let provincia = JSON.parse(dato);\n if ($('span#id_provincia').length && provincia.id === +$('span#id_provincia').html) {\n htmlContent += '<option value=\"'+provincia.id+'\" selected>' + provincia.provincia + '</option>';\n } else {\n htmlContent += '<option value=\"'+provincia.id+'\">' + provincia.provincia + '</option>';\n }\n }\n\n $('#provincias').html(htmlContent);\n}", "title": "" }, { "docid": "9fafb18ddf02df8f416286562c0883b6", "score": "0.47519237", "text": "function popolateUI () {\n const selectedSeats = JSON.parse(localStorage.getItem(\"selectedSeats\"))\n\n if (selectedSeats !== null & selectedSeats.length > 0) {\n seats.forEach((seat, index) => {\n seat.classList.add (\"selected\");\n })\n }\n\n const selectedMovieIndex = localStorage.getItem (\"selectedMovieIndex\");\n if (selectedMovieIndex !== null) {\n movieSelect.selectedindex = selectedMovieIndex;\n }\n}", "title": "" }, { "docid": "0549f2051bf236c525f0ff3b9d41344d", "score": "0.47468048", "text": "function getGenresIDs() {\n\n var genresIDs = [];\n //get all selected artists\n var elements = $(\"#musical-genres\").children(\".genre-selected\");\n for (var i = 0; i < elements.length; i++) {\n var id = $(elements[i]).text();\n genresIDs.push(id);\n }\n\n return genresIDs;\n }", "title": "" }, { "docid": "ac877b98ff7e9fb34d8ef988a48aa366", "score": "0.47416466", "text": "function imprimirProfesiones(persona) {\n console.log(`${persona.nombre} es:`);\n\n // condicional if\n if (persona.ingeniero) {\n console.log('ingeniero');\n } else {\n console.log('no es ingeniero');\n }\n\n if (persona.cocinero) {\n console.log('cocinero');\n }\n\n if (persona.cantante) {\n console.log('cantante');\n }\n\n if (persona.guitarrista) {\n console.log('guitarrista');\n }\n}", "title": "" }, { "docid": "c481d8667311866f3ce0d8f565cbbb16", "score": "0.4733372", "text": "function statusMenuPowerupTracker() {\r\n document.getElementById(\"selected\").setAttribute(\"id\", \"\");\r\n statusSelectCounter = state;\r\n statusSelect[statusSelectCounter].setAttribute(\"id\", \"selected\");\r\n }", "title": "" }, { "docid": "c712a5ba82d568bea7c56c07f7017445", "score": "0.47321627", "text": "function mapIds() {\n inputSearch = document.querySelector('#inputSearch');\n buttonSearch = document.querySelector('#buttonSearch');\n spinnerLoading = document.querySelector('#spinnerLoading');\n divUsers = document.querySelector('#divUsers');\n divStatistics = document.querySelector('#divStatistics');\n}", "title": "" }, { "docid": "ff9de797bd9b4ac044d21408e10c1858", "score": "0.47169596", "text": "function selectAvatar() {\n let avatars = qsa(\"#avatars img\");\n for(let i = 0; i < avatars.length; i++) {\n avatars[i].classList.remove(\"selected\");\n }\n this.classList.add(\"selected\");\n window.localStorage.setItem(\"avatar\", this.alt);\n }", "title": "" } ]
b3aea1d90761c7f7b47e7b12e88cdecd
Hello, Again. 3 points.
[ { "docid": "353915f1117311370ab36b7d070c1345", "score": "0.0", "text": "function helloAgain() {\n\n //////////// DO NOT MODIFY\n let name; // DO NOT MODIFY\n //////////// DO NOT MODIFY\n\n name= prompt(\"What's your Name?\");\n p= document.getElementById(\"output2\");\n p.innerHTML= \"Hello, \" + name + \"!\";\n // WRITE YOUR EXERCISE 2 CODE HERE\n\n ///////////////////////////// DO NOT MODIFY\n check(\"helloAgain\", name); // DO NOT MODIFY\n ///////////////////////////// DO NOT MODIFY\n}", "title": "" } ]
[ { "docid": "35b9992385c2acb6dc1bc09f2cb009b6", "score": "0.73692966", "text": "function sayHelloThreeTimes() {\n\n console.log(\"hello!\");\n console.log(\"hello!\");\n console.log(\"hello!\");\n\n}", "title": "" }, { "docid": "42d1c6ae2b93cab3dc9ef7553fe64d78", "score": "0.7117857", "text": "function sayHello3() {\n console.log(\"hi there\");\n}", "title": "" }, { "docid": "a25714bbe06790216726ef52739a0619", "score": "0.7117127", "text": "function greet3(firstName, lastName) {\n return 'Hello ' + firstName + ' ' + lastName;\n}", "title": "" }, { "docid": "7c411d137fe9292e55dbc010a37c2a95", "score": "0.68264985", "text": "function greet(word){ // 2nd step\n console.log(\"HEllo\" + word);\n}", "title": "" }, { "docid": "153b4ba97cff5b5f27fe31bc45710380", "score": "0.6752665", "text": "function greetings () {\n\tname = \"ralph\"\n\trandom = \"bread\"\n\treturn \"Hello \" + name;\n}", "title": "" }, { "docid": "2b3688190fc7d4b421cc6414140088de", "score": "0.66516954", "text": "function sayHi2(phrase, name) {\n console.log(phrase + ' ' + name);\n}", "title": "" }, { "docid": "82132b17a8408837be9c09c3be6e76bd", "score": "0.6622566", "text": "function message3(arg) {\n return `Hello ${arg}`;\n}", "title": "" }, { "docid": "7739e56136280f7e86dd99a5325add90", "score": "0.6582284", "text": "function greet1() {\n console.log('Iam ')\n}", "title": "" }, { "docid": "67de02ede440299ca381c2e9ae8e0ca3", "score": "0.6580946", "text": "function promisedHello(what) {\n}", "title": "" }, { "docid": "2cb524350a81020e37c1369b67b76629", "score": "0.6574478", "text": "function KenalanV3 (name, hobby) {\n console.log(`Hello, my name is ${name}`)\n console.log(`saya suka ${hobby}`)\n console.log(`bye bye`)\n}", "title": "" }, { "docid": "72b29f735aea8c20dfdf5be0f52551ee", "score": "0.6569464", "text": "function sayHello(){}", "title": "" }, { "docid": "c8bbebfcaaae15954d692a78a87f6d62", "score": "0.65518075", "text": "function greet(single){\n return \"Hello, \" + single + \"!\";\n}", "title": "" }, { "docid": "9805a19977202cc5f0caf3f8a8ea69fa", "score": "0.6542879", "text": "function sayHello(name){\n return (\"Hello, \" + name);\n}", "title": "" }, { "docid": "28423b12d4f32f69a4139419b9734fd8", "score": "0.6541127", "text": "function greet (myFirstGreet, mySecondGreet, myThirdGreet){\n var myFullGreet = \"Hi,\" + myFirstGreet + mySecondGreet + myThirdGreet;\n console.log(myFullGreet);\n}", "title": "" }, { "docid": "4d8c57c32c5f2ee154351845aa8730b2", "score": "0.6535176", "text": "shout() {return 'Im drunk like alwayz'}", "title": "" }, { "docid": "27fa3d149bede275cdecbd4087a72d79", "score": "0.6502475", "text": "function greet(pram) {\n return \"Hello\" + pram;\n}", "title": "" }, { "docid": "4d69293fba595c9626171faddab38479", "score": "0.64963174", "text": "function sayHello(name) {\n console.log(\"Hello\",name)\n console.log(\"How are you?\")\n console.log(\"I am fine. Thank you.\")\n}", "title": "" }, { "docid": "992a70ed3914e041296d144005bb7e67", "score": "0.64876604", "text": "function sayHelloD(){}", "title": "" }, { "docid": "9069ec0a459576ce3324c4a5b7df0f83", "score": "0.64714724", "text": "function hello(who) {\n\treturn \"Let me introduce: \" + who;\n}", "title": "" }, { "docid": "296ff91003e85d86dc6ff4eb682e74b0", "score": "0.6467409", "text": "function hello() {\n chatter[chatpoint] = \"> Hello, I am Eliza.\";\n chatpoint = 1;\n return write();\n}", "title": "" }, { "docid": "374062e9eef0eb6912b8bd9330951677", "score": "0.64646924", "text": "function sayHello () {\n return \"Hello, \";\n}", "title": "" }, { "docid": "00a494e0328a49c2d4f363af9604dd38", "score": "0.6461738", "text": "function sayHello(args) {\n return 'Hello, ' + args + '!';\n}", "title": "" }, { "docid": "208506686a6e0fb1597e7512e284d19b", "score": "0.6457198", "text": "function sayHello() {}", "title": "" }, { "docid": "13df28dc4ce751f2ec98e50ccd0e667c", "score": "0.64566463", "text": "function sayHello() {\n return \"Hello, \";\n }", "title": "" }, { "docid": "13df28dc4ce751f2ec98e50ccd0e667c", "score": "0.64566463", "text": "function sayHello() {\n return \"Hello, \";\n }", "title": "" }, { "docid": "b3f8c0f7a2e1383ed26e5d3be6ca98d1", "score": "0.6452554", "text": "function greet() {\n return \"greeting .... Hello World\";\n}", "title": "" }, { "docid": "a83685e321ecc96af5aa565dfe1986f7", "score": "0.64506805", "text": "function hello(who) {\r\n return \"let me introduce: \" + who;\r\n}", "title": "" }, { "docid": "997ab4520743550159a5202dc62f873f", "score": "0.64461994", "text": "function greet (a) {\n return (\"Hello,\" + a + \"!\")\n}", "title": "" }, { "docid": "835dc7e470edc4f5205cafd9f49a941e", "score": "0.64397484", "text": "function greetings(name)\n{\n return \"F2: Hello \" + name + \"!\";\n}", "title": "" }, { "docid": "26f5ee021db245579761fe669cbb7323", "score": "0.6438631", "text": "function greet(name) {\n\treturn 'Hello,' + (name) + '!'\n}", "title": "" }, { "docid": "7545056525a262d7912cc7f791c6f523", "score": "0.6435292", "text": "function greetings() {\n return('Hello Paul');\n}", "title": "" }, { "docid": "0318b4d0e1a6e71182601380b3a33638", "score": "0.64231765", "text": "function greet(x) {\n return \"Hello, \" + x + \"!\";\n}", "title": "" }, { "docid": "5ca5d2a4ef3fdb5c833d375bb7b027f4", "score": "0.6406244", "text": "function sayHello(name) {\n return \"Hello, \" + name + \"!\";\n\n}", "title": "" }, { "docid": "460d4791e60c0c39b72ad27db1f2fa31", "score": "0.64019644", "text": "function sayBye() {\n console.log(\"Bye \" + name); \n }", "title": "" }, { "docid": "558a708746e63c2dc62dbe0c0c7637da", "score": "0.63950604", "text": "function sayThis(text) {\n p(text)\n}", "title": "" }, { "docid": "00bf5ee6da4b7733ed26f4a469967474", "score": "0.63713634", "text": "function sayHello(msg) {\r\n return \"Hello! \" + msg;\r\n}", "title": "" }, { "docid": "5e7a1f0d08dcb1392129c7a324229a13", "score": "0.63712656", "text": "function sayHello(name) {\n return \"Welcome user \" + name;\n}", "title": "" }, { "docid": "c18bffecd30a2d7de816226cd4f0a698", "score": "0.63689005", "text": "function sayHello (name) {\n return (\"Hello, \" + name + \"!\");\n}", "title": "" }, { "docid": "8826a01f56c72af0268f6e611dbfd3df", "score": "0.63662666", "text": "function tellFortune (x, y, z, n){\nreturn 'You will be a ' + x + ' in ' + y + ', ' + 'and married to ' + z + ' with ' + n + ' kids.'; \n}", "title": "" }, { "docid": "73f2286e9ae0b01e2de54b135e48e44f", "score": "0.63642126", "text": "function hi3(name) {\n return \"hello\";\n}", "title": "" }, { "docid": "ab38a0bdfa86496584b9d5bb83fe5205", "score": "0.636129", "text": "function sayHello(greet) {\n console.log(`${greet}!`);\n}", "title": "" }, { "docid": "106c1e8e4c3cfe4d821b6156dbf2ddda", "score": "0.63610613", "text": "function imprimeFrase(){\n console.log('Hello World');\n }", "title": "" }, { "docid": "482ec2880edd67bcc0b37e87274b4fef", "score": "0.63608414", "text": "function greet1(name,subject){\n console.log(`Hi ${name} my name is Ranjan. Thanks for enrolling in ${subject}`)\n}", "title": "" }, { "docid": "b32fa4106a247d075c72f3a07d6932cc", "score": "0.63481677", "text": "function greet() {\n return \"hello world!\";\n }", "title": "" }, { "docid": "45551fcd4c115ab8799a00163939299c", "score": "0.63325346", "text": "function sayHello(name) {\n return 'hello ' + name;\n}", "title": "" }, { "docid": "0d94ec304e62e44087e1c89aa8382a2c", "score": "0.6331872", "text": "function sayHello(name, age){\n console.log('Hello!', name, \" you are \", age, \" years old.\");\n}", "title": "" }, { "docid": "6e7406697e8aa81a770a6e2adb1e8c6e", "score": "0.63277835", "text": "function sayHello(name){\n return \"Hello, \" + name;\n}", "title": "" }, { "docid": "cb7b6852c38cf08903539fbed7620a9f", "score": "0.6321245", "text": "function greeting(name){\n return 'Hi ,' + name;\n}", "title": "" }, { "docid": "6907f069ae888e1bdeb447a33b593f95", "score": "0.63205975", "text": "function greet() {\n return 'Hello All';\n}", "title": "" }, { "docid": "194664f51527a649ef607a1c1461e0ea", "score": "0.6319755", "text": "function sayHello(greet) {\n greet('hello');\n}", "title": "" }, { "docid": "3a64fd26cd938263f7a03a828cdf4ef9", "score": "0.6319344", "text": "function sayHello(name) {\nconsole.log(\"hello \" + name)\n}", "title": "" }, { "docid": "279e678a50ee57a8f8fbf35be6acfc68", "score": "0.631825", "text": "function sayHello(name) {\n return \"Hello \" + name;\n}", "title": "" }, { "docid": "448bb403518cd5e7c7a9ba75d53f61cd", "score": "0.6314687", "text": "function sayWelcome(firstName, middleName, lastName) {\n \"use strict\";\n //return \"Welcome \" + firstName + \" , How are you?\"; // demo6\n return \"Welcome \" + firstName + \" \" + middleName + \", How are you today?\";\n}", "title": "" }, { "docid": "edc63e052594ed4c51d5edad68fb9390", "score": "0.6310013", "text": "function sayHi1(name, message) {\n console.log(`Hello ${name}, ${message}`);\n}", "title": "" }, { "docid": "0e46f35eb86859ab1046d84090a613d3", "score": "0.63085556", "text": "function printGreetings(name ){\n console.log(\"hello\",name);\n console.log(\"hola\",name);\n console.log(\"bonjour\",name);\n}", "title": "" }, { "docid": "f83cd78f6b624d787c912a0417f3bbbd", "score": "0.63078606", "text": "function sayHelloTo(name) \n{\n\treturn 'Hello!, ' + name;\n}", "title": "" }, { "docid": "185d2fa6d332525a877a00f3fd083fa5", "score": "0.62984264", "text": "function greetLessArgs(name, age) {\n var greetMsg = 'Hello ' +name+ ' You are ' +age+ ' years of old : ';\n console.log(greetMsg);\n document.getElementById('display').innerHTML = greetMsg;\n}", "title": "" }, { "docid": "bbabe59ed2458c04f8e59cba4c838f2e", "score": "0.6291678", "text": "function sayHello(name) {\n return \"Hello, \" + name + \"!\";\n}", "title": "" }, { "docid": "bbabe59ed2458c04f8e59cba4c838f2e", "score": "0.6291678", "text": "function sayHello(name) {\n return \"Hello, \" + name + \"!\";\n}", "title": "" }, { "docid": "bbabe59ed2458c04f8e59cba4c838f2e", "score": "0.6291678", "text": "function sayHello(name) {\n return \"Hello, \" + name + \"!\";\n}", "title": "" }, { "docid": "db57d7322dc2214d1e1d81dcf284c32d", "score": "0.6288903", "text": "function sayHi3(){\n alert(\"Hello\");\n}", "title": "" }, { "docid": "092e3393ec588cc71604353e6946809e", "score": "0.62879586", "text": "function sayHelloBye(name, num) {\n\tlet sentence = '';\n\tlet nameCapitalized = name.charAt(0).toUpperCase() + name.slice(1)\n\n\tif(num == 1)\n\t\t{\n\t\t\tsentence = 'Hello ' + nameCapitalized;\n\t\t\treturn sentence;\n\t\t}\n\telse\n\t\t{\n\t\t\tsentence = 'Bye ' + nameCapitalized;\n\t\t\treturn sentence;\n\t\t}\n}", "title": "" }, { "docid": "9ac4ed2958fb9cd881278393e6ceb454", "score": "0.62756217", "text": "function intruductionToPlayer() {\n console.log(\"Hello and welcome to Hangman\")\n console.log(\"You will be givinh a random word and u have to guess that word\")\n console.log(\"You will be givien 7 wrong guesses before the man is hanged\")\n console.log(\"U have to guess in all lowercase characters, one character at a time.\")\n console.log(\"GL HF\")\n}", "title": "" }, { "docid": "a79094927014a178203d307fc6bf2cdc", "score": "0.6268465", "text": "function greet1(name) {\n console.log('Iam from greet1 ' + name);\n}", "title": "" }, { "docid": "53fa3ea55a3cc13dbb7b9ff83291493b", "score": "0.6259136", "text": "function hello3(msg){\n log(msg)\n}", "title": "" }, { "docid": "e2b9b6e7b969e2742ee34ea118cee8a2", "score": "0.6255223", "text": "function sayHello() {\n console.log(`Hello! My name is ${name}`);\n }", "title": "" }, { "docid": "c2ce3537280ab5dce25692f610af1b36", "score": "0.62550575", "text": "function sayHello(name){\n\tvar text = \"Hello \" + name;\n\tconsole.log(text);\n}", "title": "" }, { "docid": "8cfc2ab8486a3665562591effec0482f", "score": "0.62532437", "text": "function greet(name) {\n return \"Hello, \" + name + \" how are you doing today?\";\n}", "title": "" }, { "docid": "034fcf4b97a917290c2233e050672660", "score": "0.62463295", "text": "function goodbye(){\n var text= \"goodbye\";\n return 1000;\n}", "title": "" }, { "docid": "51ff7699b1218eba438dc5803897f7f4", "score": "0.6237188", "text": "function laugh() {\r\n return (\"hahahahahahahahahaha!\");\r\n}", "title": "" }, { "docid": "66eccbddeb0414e66355ab69ff9ac0a1", "score": "0.6235965", "text": "function sayHello(name) {\n return \"Hello, \" + name + \"!\";\n}", "title": "" }, { "docid": "d682d60a4ea200e956e3623650a0c766", "score": "0.62344444", "text": "function greet(string){\n\n return (\"Hello, \" + string);\n}", "title": "" }, { "docid": "275fd05f6713ee8bf17b9eda9820dfd0", "score": "0.62342817", "text": "function sayHello(){\n console.log('hello little fella');\n }", "title": "" }, { "docid": "c3858790d7bd4ac1f2bea1cb88032f29", "score": "0.6232944", "text": "function sayHelloBye(name, num) {\n\tlet a = name.charAt(0).toUpperCase() + name.slice(1);\n\tif (num === 1) {\n\t\treturn `Hello ${a}`;\n\t} else {\n\t\treturn `Bye ${a}`;\n\n\t}\n}", "title": "" }, { "docid": "320dc617fa885928324f5cff2e0d60ea", "score": "0.62327236", "text": "function sayHello(name){\n //console.log('Hello,'+ name);\n}", "title": "" }, { "docid": "7dd1fe42ae616295e686d3a6015e51bb", "score": "0.6228817", "text": "function hello(){\n\tconsole.log(\"Type 2th\");\n}", "title": "" }, { "docid": "0b4b7913cce3ef21a2275f8e35969723", "score": "0.6228262", "text": "function sayHello(Monica, age) {\n document.write(Monica + \" is \" + 27 + \n \" years old. \" );\n}", "title": "" }, { "docid": "bf43dbb4214cf27da42143d61d0a8b47", "score": "0.622489", "text": "function greetMe(name) {\n console.log(\"What up \" + name);\n}", "title": "" }, { "docid": "c9190365d59e047a6aa6cf4bc5cc706e", "score": "0.6217867", "text": "function greet(name) {\n\treturn 'Hello, ' + name;\n}", "title": "" }, { "docid": "f29e53072e5ea2eb3ebdbda794e1632a", "score": "0.6216698", "text": "function laugh() {\r\n return \"hahahahahahahahahaha!\";\r\n}", "title": "" }, { "docid": "301eec50bc88a24b9f3b716f85a79369", "score": "0.62154186", "text": "function greetPlus() {}", "title": "" }, { "docid": "85d009486257038ddd4584c64a867ee2", "score": "0.62118465", "text": "function greeting2(name){\n\tconsole.log(\"Time to start coding\" + name);\n}", "title": "" }, { "docid": "22ad44f8db438a6aca16d9d5b31c056b", "score": "0.62112164", "text": "function printGreeting() {\r\n\r\n}", "title": "" }, { "docid": "ac0ac287c294238e4d790e233bfecd3c", "score": "0.6210698", "text": "function greet(a, b){\n console.log('Hi ' + a + ', you are ' + b);\n}", "title": "" }, { "docid": "7eeae93ea0197b1ab52f08ec7792cede", "score": "0.620473", "text": "function greet(who) {\n\tconsole.log(\"Hello \" + who);\n}", "title": "" }, { "docid": "1b7cf18d8dc2d8a3453c3319a5aa46ed", "score": "0.6201069", "text": "function greet(name){\n console.log('knock knock knock' + name)\n console.log('knock knock knock' + name)\n console.log('knock knock knock' + name)\n \n}", "title": "" }, { "docid": "eb842fc8c3b4a64fe99068cab9f91610", "score": "0.6193307", "text": "function greeter(name){\n return \"Hello, \" + name\n}", "title": "" }, { "docid": "312289aeb7e47ed9254bf74a88c9cc22", "score": "0.6189529", "text": "function helloX(howManyTimes){\n var hello = 'Hello ';\n console.log(hello.repeat(howManyTimes));\n }", "title": "" }, { "docid": "d5b00f210f263a324b8df747bbb09e6d", "score": "0.61895096", "text": "function said_to_utter(said) {\n\n}", "title": "" }, { "docid": "0910a30788a4005eb896c9de89de40e7", "score": "0.61764884", "text": "function sayHello(message,wish) {\n\treturn message +\" \"+\n\t this.name +\" \"+\n\t this.age+\" \"+wish\n}", "title": "" }, { "docid": "b028f1a116cbf1aae47ce7e9e0f281b5", "score": "0.6171077", "text": "function sayHi(name, age) {\n return \"Hi. My name is \" + name + \" and I'm \" + age + \" years old\";\n}", "title": "" }, { "docid": "300be63cac69a78cfba2b426b530fb68", "score": "0.61695665", "text": "function printHello() {\n return \"Hello there!\";\n }", "title": "" }, { "docid": "300be63cac69a78cfba2b426b530fb68", "score": "0.61695665", "text": "function printHello() {\n return \"Hello there!\";\n }", "title": "" }, { "docid": "a4e23c70b1da497f0cf1abc316ca2cf3", "score": "0.61645603", "text": "function greet(name){\n console.log('Hello,' + name);\n}", "title": "" }, { "docid": "c9fa9a0b3688f3d133987e9a7093a5d7", "score": "0.61619157", "text": "function greet(name, lastName){\n console.log( ' Hello ' + name + ' ' + lastName)\n}", "title": "" }, { "docid": "2a6702eb4822436af0e04772356ca930", "score": "0.6151729", "text": "function greeter(name) {\n return \"Hello \" + name + \"!\";\n}", "title": "" }, { "docid": "981a8d82ac7c9eda1a9a26fa080d23d0", "score": "0.6149459", "text": "function greet(name) {\n return \"Hello, \" + name + \"!\";\n}", "title": "" }, { "docid": "d2280528f93ebddd936c3db6eac3bbb3", "score": "0.6146033", "text": "function printGreeting() {\n\n}", "title": "" }, { "docid": "46d68ae7022d819bd53dd5c2b6c4210f", "score": "0.61447275", "text": "function greet(name){\r\n console.log('Hello ' + name);\r\n}", "title": "" }, { "docid": "b9e3fc6ab6b2c69e811fbb097e182dea", "score": "0.6144098", "text": "function sayHello() {\n return 'Hello!'\n}", "title": "" }, { "docid": "8f5d4a45f6d38413e39de63ded836983", "score": "0.61382854", "text": "sayGreet() {\n return 'Greet,Molecular'\n }", "title": "" } ]
f30bba73b61ac186e4db4d4e5289bf41
helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
[ { "docid": "8313f661f0b4d307a4ddcd099bb9d55c", "score": "0.0", "text": "function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }", "title": "" } ]
[ { "docid": "4fb3bcf305dafb8b888846998ccef191", "score": "0.6524437", "text": "function human_time_diff( $from, $to = '' ) {\n if ( empty( $to ) )\n $to = time();\n \n $diff = (int) abs( $to - $from );\n \n if ( $diff < HOUR_IN_SECONDS ) {\n $mins = round( $diff / MINUTE_IN_SECONDS );\n if ( $mins <= 1 )\n $mins = 1;\n /* translators: min=minute */\n $since = sprintf( _n( '%s min', '%s mins', $mins ), $mins );\n } elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) {\n $hours = round( $diff / HOUR_IN_SECONDS );\n if ( $hours <= 1 )\n $hours = 1;\n $since = sprintf( _n( '%s hour', '%s hours', $hours ), $hours );\n } elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) {\n $days = round( $diff / DAY_IN_SECONDS );\n if ( $days <= 1 )\n $days = 1;\n $since = sprintf( _n( '%s day', '%s days', $days ), $days );\n } elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {\n $weeks = round( $diff / WEEK_IN_SECONDS );\n if ( $weeks <= 1 )\n $weeks = 1;\n $since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks );\n } elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) {\n $months = round( $diff / ( 30 * DAY_IN_SECONDS ) );\n if ( $months <= 1 )\n $months = 1;\n $since = sprintf( _n( '%s month', '%s months', $months ), $months );\n } elseif ( $diff >= YEAR_IN_SECONDS ) {\n $years = round( $diff / YEAR_IN_SECONDS );\n if ( $years <= 1 )\n $years = 1;\n $since = sprintf( _n( '%s year', '%s years', $years ), $years );\n }\n \n return $since;\n }", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63280445", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.6123644", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.6123644", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.6123644", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.6123644", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "2704add16a7e525b02ca7370153085f9", "score": "0.609248", "text": "function momentDateFormatter(date, dateString) {\n return moment(dateString).fromNow();\n}", "title": "" }, { "docid": "2543f0f752e9d293750c04ceaf97977a", "score": "0.60814667", "text": "function formatHumanReadable() {\nvar durationFormatted = '';\nif (days > 0) {\ndurationFormatted += days;\nif (days === 1) {\ndurationFormatted += ' ' + message('date.duration.Tag') + ' ';\n} else {\ndurationFormatted += ' ' + message('date.duration.Tagen') + ' ';\n}\n} else if (hours > 0) {\ndurationFormatted += hours + ' ' + message('date.duration.Std') + ' ';\n} else {\ndurationFormatted += minutes + ' ' + message('date.duration.Min') + ' ';\n}\nreturn durationFormatted;\n}", "title": "" }, { "docid": "d4f7d94e20c207a2de5e68dcd24bb98a", "score": "0.60550904", "text": "function fromNow() {\n return function(date) {\n return moment(new Date(date*1000)).fromNow();\n }\n }", "title": "" }, { "docid": "27816c834f1d5e35cd7f1c6d7bf6baed", "score": "0.6022187", "text": "function S(a,b,c,d,e){var f;// works with moment-pre-2.8\n// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\"\n// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n// or non-zero areas in Moment's localized format strings.\nreturn a=Ja.moment.parseZone(a),b=Ja.moment.parseZone(b),f=(a.localeData||a.lang).call(a),c=f.longDateFormat(c)||c,d=d||\" - \",T(a,b,V(c),d,e)}// expose", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.60125697", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.60125697", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.60125697", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.60125697", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.60125697", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.60125697", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.60125697", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "67cdffd1dc63fa0444040dd701929b40", "score": "0.5913384", "text": "function qa(a,b,c,d,e){var f;// works with moment-pre-2.8\r\n// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\"\r\n// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\r\n// or non-zero areas in Moment's localized format strings.\r\nreturn a=Ta.moment.parseZone(a),b=Ta.moment.parseZone(b),f=(a.localeData||a.lang).call(a),c=f.longDateFormat(c)||c,d=d||\" - \",ra(a,b,ta(c),d,e)}// expose", "title": "" }, { "docid": "250cdd8947d78a2e137e051496022126", "score": "0.5843603", "text": "function toDuration() {\n return function(seconds) {\n return moment.duration(seconds, \"seconds\").humanize();\n }\n }", "title": "" }, { "docid": "51aa2e374c67875884211b95ac9a2277", "score": "0.5822632", "text": "function time(dateFilter) {\n return function (input, showRelTimes, about) {\n var day = moment.unix(input);\n var daysFromToday = moment().diff(day, 'days');\n var absolutelyToday = daysFromToday === 0 && day.dayOfYear() === moment().dayOfYear();\n\n return absolutelyToday && showRelTimes ? day.fromNow() : (about ? dateFilter(input, true) + ' about ' : '') + day.format('h:mma');\n }\n }", "title": "" }, { "docid": "8797d6827c0bea0dbb0a6dfa7a785307", "score": "0.582155", "text": "function relativeTimeWithPlural(e,r,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.5813121", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.5813121", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.5813121", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.5813121", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.5813121", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.5813121", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "a00b679acde2685aa4d0839f9e775db5", "score": "0.57782036", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number || 1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "0740e945ac5c90d61f29eb401b79ded4", "score": "0.5732695", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n\t var result = number + ' ';\n\t switch (key) {\n\t case 's':\n\t return withoutSuffix || isFuture\n\t ? 'nekaj sekund'\n\t : 'nekaj sekundami';\n\t case 'ss':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'sekundo' : 'sekundi';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n\t } else {\n\t result += 'sekund';\n\t }\n\t return result;\n\t case 'm':\n\t return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\t case 'mm':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'minuta' : 'minuto';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n\t }\n\t return result;\n\t case 'h':\n\t return withoutSuffix ? 'ena ura' : 'eno uro';\n\t case 'hh':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'ura' : 'uro';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'uri' : 'urama';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'ure' : 'urami';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'ur' : 'urami';\n\t }\n\t return result;\n\t case 'd':\n\t return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\t case 'dd':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n\t }\n\t return result;\n\t case 'M':\n\t return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\t case 'MM':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n\t }\n\t return result;\n\t case 'y':\n\t return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\t case 'yy':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'leto' : 'letom';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'leta' : 'leti';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'let' : 'leti';\n\t }\n\t return result;\n\t }\n\t }", "title": "" }, { "docid": "e0fe0702b980987347948cdd01aa4237", "score": "0.5719234", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ?\n 'nekaj sekund' :\n 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;}\n\n }", "title": "" }, { "docid": "e0fe0702b980987347948cdd01aa4237", "score": "0.5719234", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ?\n 'nekaj sekund' :\n 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;}\n\n }", "title": "" }, { "docid": "b6ba6d6f75b40f553a8f9269853a76dc", "score": "0.56914204", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n\n return result;\n\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n\n return result;\n\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n\n return result;\n\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n\n return result;\n\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n\n return result;\n\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682212", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "2cf1fa378fff61b0c2b0fc08bd3300bb", "score": "0.56515837", "text": "function humanizer(passedOptions) {\n\n var result = function humanizer(ms, passedOptions) {\n var options = extend({}, result, passedOptions || {});\n return doHumanization(ms, options);\n };\n\n extend(result, {\n language: \"en\",\n delimiter: \", \",\n units: [\n \"year\",\n \"month\",\n \"week\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\"\n ],\n languages: {}\n }, passedOptions);\n\n return result;\n\n }", "title": "" }, { "docid": "54ab5019be1bbb04a46c2995fce1e41b", "score": "0.5634294", "text": "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return currentHours > 11 ? meridiem.pm : meridiem.am;\n case 'A' :\n return currentHours > 11 ? meridiem.PM : meridiem.AM;\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // TIMEZONE\n case 'zz' :\n // depreciating 'zz' fall through to 'z'\n case 'z' :\n return (m._d.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(charactersToReplace, replaceFunction);\n }", "title": "" }, { "docid": "819c205ee7baeb57615a90829dd3894a", "score": "0.5607113", "text": "function v(e,t,n){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}//! moment.js locale configuration", "title": "" }, { "docid": "eae35fd188508f027837fc2999cafb7d", "score": "0.5540375", "text": "function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n\t return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n\t }", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.5520554", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "f7e6e0ddf70727822a7bef8ffa7bf7ef", "score": "0.55090743", "text": "function lb__processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n 'm': ['eng Minutt', 'enger Minutt'],\n 'h': ['eng Stonn', 'enger Stonn'],\n 'd': ['een Dag', 'engem Dag'],\n 'M': ['ee Mount', 'engem Mount'],\n 'y': ['ee Joer', 'engem Joer']\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n }", "title": "" } ]
9551b51c8911be5da3ae736d5b5620df
if no streams are set, perform like the global console
[ { "docid": "dd6174b7ed64d394df9b386795f90f9d", "score": "0.5681211", "text": "static setStreams(outputStream, errorStream) {\n Logger.outputStream = outputStream || process.stdout;\n Logger.errorStream = errorStream || process.stderr;\n }", "title": "" } ]
[ { "docid": "75bb423047d021c0db5aa23df35bff68", "score": "0.64642537", "text": "consoleLog(string) {\n if (!this.muteStream) {\n console.log(string)\n }\n }", "title": "" }, { "docid": "f79282a1f1fe71592af7d7c9d45e01cb", "score": "0.63489467", "text": "function stdioe(){\n var stdin = new stream.Readable({ read:function(size) {} });\n var io = new stream.Duplex({\n allowHalfOpen:false,\n read: function(size) { },\n write:function(chunk, encoding, callback) {\n stdin.push(chunk);\n callback()\n }\n })\n var stdout = new stream.Writable({\n write:function(chunk, encoding, callback) {\n io.push(chunk);\n callback()\n }\n });\n var stderr = new stream.Writable({\n write:function(chunk, encoding, callback) {\n io.push(chunk);\n callback()\n }\n });\n //TTY stream\n stdout.setTTYMode = function(value) {\n stdout.isTTY = !!value;\n if(stdout.isTTY){\n stdout.columns = 80\n stdout.rows = 24\n }\n \n };\n stdout.setMouseMode = function(value) {\n stdout.isMouse = !!value;\n if(stdout.isMouse){\n stdout.write('\\x1b[?1000h')\n }else{\n stdout.write('\\x1b[?1000l');\n }\n \n };\n stdout.setSize = function(size){\n stdout.columns = size.columns\n stdout.rows = size.rows\n stdout.emit('resize')\n }\n stdout.setTTYMode(true)\n stdout.setMouseMode(false)\n \n io.on('pipe',function(source){\n var kill = function(){};\n if(source===process.stdin){\n kill = process.exit\n }else{\n source.setRawMode = function(value) {\n source.isRaw = !!value;\n };\n }\n source.setRawMode(true)\n source.isTTY = true\n io.exit = function(){\n io.end();\n source.setRawMode(false);\n source.end();\n kill();\n };\n })\n io.on('close',function(){\n stdin.destroy()\n stdout.destroy()\n stderr.destroy()\n })\n io.stdin = stdin;\n io.stdout = stdout;\n io.stderr = stderr;\n io.id = uuidV4()\n return io\n}", "title": "" }, { "docid": "2376b50b8feb9999a94b70746d847ab4", "score": "0.63271064", "text": "_flushStdio() {\n\t\tthis._stdioAll\n\t\t\t.filter(stream => stream.readable && !stream._readableState.readableListening)\n\t\t\t.forEach(stream => stream.resume())\n\t}", "title": "" }, { "docid": "5dc5050d3b70d4c0be2a6fce0bcc02eb", "score": "0.6314602", "text": "static get stream () { return 'main' }", "title": "" }, { "docid": "2be2d24062252dfc1fe7eefb1961a423", "score": "0.61242336", "text": "_connectStd(stream) {\n // Show outputs\n stream.pipe(process.stdout);\n\n // Connect stdin\n this.isRaw = process.stdin.isRaw;\n process.stdin.resume();\n process.stdin.setEncoding('utf8');\n process.stdin.setRawMode(true);\n process.stdin.pipe(stream);\n\n process.stdin.on('data', key => {\n if (this.previousKey === CTRL_P && key === CTRL_Q) this._exit(stream);\n this.previousKey = key;\n });\n }", "title": "" }, { "docid": "3f01a9a17ea79bb572a321943f3b0884", "score": "0.59574604", "text": "function console() {}", "title": "" }, { "docid": "98011a0ec8a8d2db424aec3779d11408", "score": "0.5882674", "text": "start () {\n process.stdin.resume();\n readline.emitKeypressEvents(process.stdin);\n process.stdin.setRawMode(true);\n\n if (this.hideCursor)\n process.stderr.write('\\x1B[?25l');\n }", "title": "" }, { "docid": "a4695139f978cd1198d2811f782bee7f", "score": "0.5853534", "text": "function echo() {\n\n // create a stream through which each file will pass\n var stream = through.obj(function(file, enc, callback) {\n\n var type = file.isStream() ? 'Stream' : (file.isBuffer() ? 'Buffer' : 'Unknown');\n var hint = file.jshint ? (file.jshint.success ? 'hint:OK' : 'hint:FAIL') : 'no hint';\n console.log('(%s) %s : %s', type, hint, file.path);\n\n this.push(file);\n return callback();\n });\n\n // return the file stream\n return stream;\n}", "title": "" }, { "docid": "959623a088738524fd8fd4922656baff", "score": "0.5827851", "text": "function ConsoleComponent() {\n textStore.listen(function(text) {\n console.log('text: ', text);\n });\n statusStore.listen(function(status) {\n console.log('status: ', status);\n });\n storyStore.listen(function(story) {\n console.log('story: ', story);\n });\n}", "title": "" }, { "docid": "52d4a79b279329133269caef5a3fe156", "score": "0.58047897", "text": "function puts(error, stdout, stderr) { /* sys.puts(stdout) */ }", "title": "" }, { "docid": "ceb87be85e6bd4e6107649ef4c4463d5", "score": "0.57925814", "text": "_forceCloseStdio() {\n\t\tthis._stdioAll\n\t\t\t.filter(stream => stream.readable && !stream._readableState.ended)\n\t\t\t.forEach(stream => stream.push(null))\n\t}", "title": "" }, { "docid": "9de143f4e9e98057401bb3691dcd7284", "score": "0.56260484", "text": "function puts(error, stdout, stderr) { sys.puts(stdout) }", "title": "" }, { "docid": "7c1042d3ab416c327cda05d7aa69aa4d", "score": "0.5614773", "text": "function stdout (...args) {\n\t// @todo format!!\n\tconsole.log(...args);\n}", "title": "" }, { "docid": "e2528533990d62981f801a71072358a3", "score": "0.560208", "text": "function stdout() {\n\t//check if overflow\n\tif(terminal.length > maxHistory)\n\t\tterminal.shift();\n\n\t//setup\n\tctx.font = \"18px Fixedsys\";\n \t\n\n \t//find counting index\n \tvar ct = (terminal.length > maxTerm ? terminal.length-maxTerm : 0);\n \tvar dt = 0;\n\n \twhile(ct < terminal.length){\n \t\tctx.fillStyle = terminal[ct].color;\n \t\tctx.fillText(terminal[ct].text, 16, 230+(dt*23));\n \t\tct++;\n \t\tdt++;\n \t}\n}", "title": "" }, { "docid": "6c89940022a61b76bf8e6a65ae213426", "score": "0.5595067", "text": "function consoleCall () {\n \n}", "title": "" }, { "docid": "c6429a8d367badff326e983480f13cff", "score": "0.5588729", "text": "onOpenConsole() {\n\t\tthis.unreadCount = 0;\n\t\tthis.opened = true;\n\t}", "title": "" }, { "docid": "75b3eb3d00a4a571bfc58bb8296083eb", "score": "0.55808955", "text": "function HowToStreamBasic(){\n\tvar file = process.argv[2];\n\n\tvar stream = fs.createReadStream(file);\n\n\tstream.pipe(process.stdout);\n}", "title": "" }, { "docid": "1eea7ab2e59ffa27877562d30b834697", "score": "0.5570068", "text": "_stdout(message) {\n process.stdout.write('stdout: ' + message);\n }", "title": "" }, { "docid": "74f954e1abd89059978f4cd426265683", "score": "0.55248654", "text": "stdout(a){\r\n console.log.apply(console, arguments)\r\n this.addText(a)\r\n }", "title": "" }, { "docid": "2bcd36baec8e89ece9d2ca04d5e63ae1", "score": "0.5521589", "text": "function mock(std) {\n let writes = [];\n return {\n stripColor: true,\n print: false,\n start() {\n debug('start', std);\n writes = [];\n process[std].write = (data, ...args) => {\n writes.push(bufToString(data));\n if (this.print)\n g['stdout-stderr'][std].apply(process[std], [data, ...args]);\n return true;\n };\n },\n stop() {\n process[std].write = g['stdout-stderr'][std];\n debug('stop', std);\n },\n get output() {\n let o = this.stripColor ? writes.map(stripAnsi) : writes;\n return o.join('');\n },\n };\n}", "title": "" }, { "docid": "ff2afd7cc7f05bde0cafb57308ddcaa8", "score": "0.5491605", "text": "function consoleOutput(str){\n if(window.console){\n console.log(str);\n }\n}", "title": "" }, { "docid": "6b83d8408e30b6ab2af79007fe1a330e", "score": "0.5463391", "text": "function pipeStream()\n{\n\tprocess.stdin.pipe(process.stdout);\n}", "title": "" }, { "docid": "fa5dc3d1653908550971c9c19af7b69c", "score": "0.54551345", "text": "function stdout(source) {\n csp.go(function*() {\n var x;\n\n while ((x = yield source) != csp.CLOSED) {\n console.log(x);\n }\n });\n}", "title": "" }, { "docid": "533bab247fe823268306f1d3d8863e33", "score": "0.5449924", "text": "function initializeStream(input, output) {\n input.on(\"error\", err => console.error);\n input.pipe(output);\n input.start();\n }", "title": "" }, { "docid": "b9921f3bd6c0bd753f51df049b7a3bf6", "score": "0.54497", "text": "function show() {\n\tconsole.log('\\033[34m hello\\033[0m');\n\tconsole.log(456)\n\tconsole.log('\\033[34;1m hello\\033[0m');\n\tconsole.log('\\033[34m hello\\033[0m');\n}", "title": "" }, { "docid": "ab4cc7ae22ace327a8a707334156d880", "score": "0.5437891", "text": "function testConsoles (test) {\n casper.then(function () { // test existence and toggling of console\n loadConsole(test, 'pythonConsoleButton', \"pythonConsole\");\n });\n casper.then(function () { // test existence and toggling of console\n loadConsole(test, 'consoleButton', \"console\");\n });\n}", "title": "" }, { "docid": "3318e23946b273db87a4c8a7f2274221", "score": "0.5436253", "text": "setVerboseShell() {}", "title": "" }, { "docid": "6d91d7e13eb17cb5e367022cf82d22ca", "score": "0.54285663", "text": "function consoleNothing() {\n\n}", "title": "" }, { "docid": "fd00b42797789411ac8988d7203ce718", "score": "0.53842354", "text": "static createStdoutInterface () {\n return new Writable({\n write: function (chunk, encoding, callback) {\n if (!this.muted) process.stderr.write(chunk, encoding);\n callback();\n }\n });\n }", "title": "" }, { "docid": "dc03e60183ca890c84691fbb37fecebb", "score": "0.53607666", "text": "function StdoutStreamListener(cmdObj)\n{\n this._cmdObj = cmdObj;\n this._reqObserver = null;\n}", "title": "" }, { "docid": "3cc4f3e54b92b82a51e04026c8c77c91", "score": "0.53581005", "text": "function toggleConsoles() {\r\n\tif (consolesFlag) {\r\n\t\tconsolesFlag = false;\r\n\t\tdocument.getElementById(\"consoles\").style.visibility = \"hidden\";\r\n\t}\r\n\telse {\r\n\t\tconsolesFlag = true;\r\n\t\tdocument.getElementById(\"consoles\").style.visibility = \"visible\";\r\n\t}\r\n}", "title": "" }, { "docid": "79cea2bf3e096f7389891564e290d08d", "score": "0.5357786", "text": "function consoleAll(msg) {\n console.clear(\"console.clear()\",msg)\n console.assert(\"console.assert()\",msg)\n console.count(\"console.count()\",msg)\n console.countReset(\"console.countReset()\",msg)\n console.debug(\"console.debug()\",msg)\n console.dir(\"console.dir()\",msg)\n console.dirxml(\"console.dirxml()\",msg)\n console.error(\"console.error()\",msg)\n console.group(\"console.group()\",msg)\n console.groupCollapsed(\"console.groupCollapsed()\",msg)\n console.info(\"console.info()\",msg)\n console.log(\"console.log()\",msg)\n console.table(\"console.table()\",msg)\n console.time(\"console.time()\",msg)\n console.timeEnd(\"console.timeEnd()\",msg)\n console.timeLog(\"console.timeLog()\",msg)\n console.trace(\"console.trace()\",msg)\n console.warn(\"console.warn()\",msg)\n console.groupEnd(\"console.groupEnd()\",msg)\n}", "title": "" }, { "docid": "c9b936ac56d80c3c8ae2eaee8e26a01e", "score": "0.5357227", "text": "function tty(stream) {\n\n /* istanbul ignore next: no colors in tests */\n if(this.color === false) {\n return false; \n // force colors\n }else if(this.color === true) {\n return true; \n }\n\n /* istanbul ignore next: shouldn't get this far in tests */\n return stream.isTTY;\n}", "title": "" }, { "docid": "3646bcfc9376af30631cae8c57b83a15", "score": "0.53245234", "text": "function fconsole(thing) {\n\tif (typeof(window[\"console\"]) != \"undefined\") {\n\t\tconsole.log(thing);\n\t}\n}", "title": "" }, { "docid": "390ed1fce10ecd18f03b639ecffa576e", "score": "0.5322743", "text": "function sing(){\n console.log|(\"twinkle, twinkle...\");\n console.log|(\"little star...\");\n}", "title": "" }, { "docid": "a814ceb11efde35b2261257412612b51", "score": "0.53167343", "text": "function ConsoleProxy() {\n \"use strict\";\n var self = this;\n self.logs = [];\n self.error = null;\n self.output = null;\n}", "title": "" }, { "docid": "cb01a7d94e5d02f35d2ec5e1457c3de2", "score": "0.53161204", "text": "interceptConsoleOutput() {\n for (const key of Object.keys(console)) {\n if (typeof console[key] === 'function') {\n this.originalFunctions[key] = console[key];\n console[key] = new Proxy(console[key], {\n apply: (target, thisArg, argArray) => {\n this.bufferedConsole.console[key](...argArray);\n if (this.pendingConsoleFlush) {\n return;\n }\n this.pendingConsoleFlush = true;\n setTimeout(() => {\n this.flushConsoleOutput();\n }, 0);\n },\n });\n }\n }\n }", "title": "" }, { "docid": "a51dec9577bf7a79cf02e5fe75e2ed40", "score": "0.53039324", "text": "function showAllVideoStreams() {\n showLocalVideo();\n showRemoteVideo();\n }", "title": "" }, { "docid": "7a73fb1778975580194a676af43ef00f", "score": "0.5297583", "text": "function stdout_w( outbuf ) {\n process.stdout.write(outbuf);\n}", "title": "" }, { "docid": "5e419c1f0e77426263578939f968a1e7", "score": "0.52971566", "text": "function _read () {\n /* istanbul ignore else */\n if (!this.options.streamOut) {\n this.options.streamOut = true;\n this._pipeline();\n }\n}", "title": "" }, { "docid": "aef07ceb15a2a64da11d8740ba6472eb", "score": "0.52971137", "text": "function rawLog() {\n\tif (Array.isArray(process.loadfile) === true) {\n\t\tshell.openItem(process.loadfile[0]);\n\t} else if (typeof process.loadfile === 'string') {\n\t\tshell.openItem(process.loadfile);\n\t} else {\n\t\tconsole.log(process.loadfile);\n\t}\n}", "title": "" }, { "docid": "2f265af554ccc5904fcf7d62541714b9", "score": "0.5267529", "text": "pauseEvents () {\n\t\tif (this.process == null) {\n\t\t\treturn;\n\t\t}\n\t\tthis.isReadPaused = true;\n\t\tthis.process.stdout.pause ();\n\t\tthis.process.stderr.pause ();\n\t}", "title": "" }, { "docid": "2657e83d981fb2a5cce462761ee7f53c", "score": "0.52534306", "text": "function Stream() {\n EE.call(this || _global$L);\n }", "title": "" }, { "docid": "c5c3a00b9d32cbaf6c3b758577b739e6", "score": "0.5227944", "text": "function ansi(stream, options) {\n if (stream._ansicursor) {\n return stream._ansicursor\n } else {\n return stream._ansicursor = new Cursor(stream, options)\n }\n }", "title": "" }, { "docid": "ee4bad29e8415bff1ad83b9fd3688235", "score": "0.5227133", "text": "function writeLines() {\n for (var arg = 0; arg < arguments.length; ++arg) {\n var val = arguments[arg];\n if (arg === 0) {\n console.writeln(concatenateStr('<b>', TITLE, '</b>: ', val));\n }\n else {\n console.writeln(val);\n }\n }\n console.flush();\n}", "title": "" }, { "docid": "cfcf272f3655bd3baf58e2708e829132", "score": "0.52196574", "text": "function streamClose(stream) {\n if (stream) {\n if (stream != java.lang.System[\"in\"] &&\n stream != java.lang.System.out &&\n stream != java.lang.System.err) {\n try {\n stream.close();\n } catch (e) {\n println(e);\n }\n }\n }\n}", "title": "" }, { "docid": "caacb81f9d841c365bea93328f25b366", "score": "0.5213904", "text": "function sing() {\n\tconsole.log('twinkle, twinkle...');\n\tconsole.log('how i wonder');\n}", "title": "" }, { "docid": "a7f04cd7a3acddbc2d250104b20123b4", "score": "0.5210717", "text": "function MsgConsole() {\n if (!window.console) {\n return;\n }\n var i = 0;\n if (!i) {\n setTimeout(function() {\n console.log(\"%cWelcome to fidget Cube Experience\", \"font: 2em sans-serif; color: red; \");\n console.log(\"%cHello, and welcome to the console. The fidget cube was made in Cinema4D and all interaction was made with Threejs [https://github.com/mrdoob/three.js/]\", \"font: 1.5 sans-serif; color: black;\");\n console.log(\"%cEnjoy the experience and if you like it you can go check the code on our Github [https://github.com/FrostOne/hetic-p2019-11].\", \"font: 1.25 sans-serif; color: black;\");\n console.log(\"%c[If you want to show message like that go check https://github.com/stml/welcomejs]\", \"font: 1 sans-serif; color: grey;\");\n }, 1);\n i = 1;\n }\n}", "title": "" }, { "docid": "ade522377fe43d1b3701baf97447ae0f", "score": "0.52087784", "text": "_setupStdio(stdio) {\n\t\t// Create streams for communication with the child process.\n\t\t// These are the one representing child's stdin, stdout, stderr and other custom pipes\n\t\t// that pierce the boundary of main processes and serve as sink/source for child.\n\t\tthis._stdioAll = stdio.map((type, fd) => {\n\t\t\tif (type === 'ignore')\n\t\t\t\treturn null\n\t\t\tif (fd === STDIN)\n\t\t\t\tvar stream = new Writable\n\t\t\telse if (fd === STDOUT || fd === STDERR)\n\t\t\t\tvar stream = new Readable\n\t\t\telse\n\t\t\t\tvar stream = new Duplex\n\t\t\tif (type === 'ipc') stream.ipc = true\n\t\t\tstream.fd = fd\n\t\t\treturn stream\n\t\t})\n\n\t\tthis._stdioAll\n\t\t\t.filter(stream => stream instanceof Readable)\n\t\t\t.forEach(stream => {\n\t\t\t\t// Reading can't be forced\n\t\t\t\tstream._read = () => {}\n\t\t\t\t// Process only emits 'close' when all stdio (readable or duplex) pipes are closed.\n\t\t\t\tthis._closesNeeded++\n\t\t\t\t// Broker is only capable of ending the stream (pushing null results in 'end' event)\n\t\t\t\t// but we have to take care of emitting 'close' on each stream ourselves.\n\t\t\t\tstream.once('end', () => setTimeout(() => stream.emit('close')))\n\t\t\t\tstream.once('close', this._maybeClose)\n\t\t\t})\n\n\t\t// Reroutes all writes from stdio pipes to the broker process.\n\t\tthis._stdioAll\n\t\t\t.filter(stream => stream instanceof Writable)\n\t\t\t.forEach(stream => {\n\t\t\t\tstream.connected = true\n\t\t\t\tstream._write = (chunk, encoding, cb) => {\n\t\t\t\t\tvar req = {\n\t\t\t\t\t\tcid: this.cid,\n\t\t\t\t\t\tfd: stream.fd,\n\t\t\t\t\t\tdata: chunk,\n\t\t\t\t\t}\n\t\t\t\t\tbroker.send(req).then(cb)\n\t\t\t\t}\n\t\t\t})\n\n\t\t// this._stdioAll represents all process' stream instances, including those usually hidden by IPC, ignore or FD.\n\t\t// this.stdio is list of streams accessible by user, some of which might be null (managed by Node)\n\t\t// for example IPC stream (usually fd 3) is null and inaccessible, because it's build into the child process object.\n\t\t// If FDs or 'ignore' instead of 'pipe' these pipes are also null in this.stdio.\n\t\tthis.stdio = this._stdioAll.slice(0)\n\n\t\t// Iterate over stdio array (types, FDs, custom streams) and use it to hide unreachable streams\n\t\t// from this.stdio which only includes child's streams.\n\t\tstdio.forEach((type, fd) => {\n\t\t\tif (type === 'ignore' || typeof type === 'number') {\n\t\t\t\t// 'ignore'/null don't exist to begin with, numeric FDs signify routing which makes it unaccessible.\n\t\t\t\tthis.stdio[fd] = null\n\t\t\t} else if (type === 'ipc') {\n\t\t\t\t// IPC channel is integrated into the process object. The stream is not directly available.\n\t\t\t\tthis.stdio[fd] = null\n\t\t\t\t// Create Duplex stream on which messages will be received,\n\t\t\t\tvar ipc = this._stdioAll[fd]\n\t\t\t\t// Attaches Duplex IPC stream to this.channel, creates send() and disconnect() methods,\n\t\t\t\t// handles and parses incomming data and re-emit it as 'message' events on this.\n\t\t\t\tsetupChannel(this, ipc)\n\t\t\t}\n\t\t})\n\n\t\t// Assign basic stdio to child process instance.\n\t\tthis.stdin = this.stdio[0] || null\n\t\tthis.stdout = this.stdio[1] || null\n\t\tthis.stderr = this.stdio[2] || null\n\n\t\t// Wire stdio and inherit-targets together by piping data between them.\n\t\tstdio\n\t\t\t// Array of user defined streams that are piped to/from child process' stdio streams.\n\t\t\t// i.e. FD numbers, custom Stream instances\n\t\t\t.map(streamOrFd => {\n\t\t\t\t// User can specify FD numbers 0-2 signifying main process' stdin, stdout and stderr.\n\t\t\t\t// Node also handles more FDs beyond 2, but we don't have access to real FDs. So only 1-2 are supported.\n\t\t\t\tif (streamOrFd === STDIN) return process.stdin\n\t\t\t\tif (streamOrFd === STDOUT) return process.stdout\n\t\t\t\tif (streamOrFd === STDERR) return process.stderr\n\t\t\t\tif (streamOrFd instanceof Readable || streamOrFd instanceof Writable)\n\t\t\t\t\treturn streamOrFd\n\t\t\t})\n\t\t\t// Take the targets and pipe matching child's stdio into the targets.\n\t\t\t.map((target, fd) => {\n\t\t\t\tlet source = this._stdioAll[fd]\n\t\t\t\tif (source === null || source === undefined || target === null || target === undefined)\n\t\t\t\t\treturn\n\t\t\t\tif (source instanceof Readable && target instanceof Writable)\n\t\t\t\t\tsource.pipe(target)\n\t\t\t\telse if (target instanceof Readable && source instanceof Writable)\n\t\t\t\t\ttarget.pipe(source)\n\t\t\t})\n\n\t}", "title": "" }, { "docid": "b54bf87b11fc9b888a06cab14b2040d2", "score": "0.5200324", "text": "function EmitLn(s) {\n\tif ((EmitMethod & EmitFlags.EmitScreen) === EmitFlags.EmitScreen) {\n\t\tconsole.log(s);\n\t}\n\n\tif ((EmitMethod & EmitFlags.EmitFile) === EmitFlags.EmitFile) {\n\t\tfileOutput += s + \"\\r\\n\";\n\t}\n}", "title": "" }, { "docid": "bed478a5dbfb02c3c20220f9a89e6fb1", "score": "0.5186159", "text": "function stdout(context, file, fileSet, next) {\n if (!file.data.unifiedEngineGiven) {\n debug('Ignoring programmatically added file')\n next()\n } else if (stats(file).fatal || context.output || !context.out) {\n debug('Ignoring writing to `streamOut`')\n next()\n } else {\n debug('Writing document to `streamOut`')\n context.streamOut.write(file.toString(), next)\n }\n}", "title": "" }, { "docid": "2a031ba09c9f08b4aa71034fdfc000fe", "score": "0.5181237", "text": "function Stream() {\n emitter.call(this);\n }", "title": "" }, { "docid": "9fb0cec0b5aa48377cda1f0fc4e87718", "score": "0.51770294", "text": "function init(){\n \"use strict\";\n \n // Create the actual console element, in this case in the document's body.\n var consoleElement = document.createElement(\"div\");\n consoleElement.setAttribute(\"id\",\"consoleElement\");\n \n // You can apply your own logo, if you want\n var consoleHeaderImage = document.createElement(\"img\");\n consoleHeaderImage.setAttribute(\"id\",\"terminalHeaderImage\");\n consoleHeaderImage.setAttribute(\"src\",\"res/stxlogo.png\");\n \n document.body.appendChild(consoleElement);\n consoleElement.appendChild(consoleHeaderImage);\n \n //MOTD\n outputToConsole(\n consoleEdition + \" \" + currVersion + \"<br>\" + motd\n );\n \n // Show a new command line\n showNewCommandLine();\n \n //Mobile compatibility events\n if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\n mobileClickEvent();\n }\n\n // Checks all key inputs and will also launch the command parser.\n keyboardEvents();\n \n // Checks if something was pasted on screen (known to work in Chrome);\n desktopPasteEvent();\n \n}", "title": "" }, { "docid": "c29917c3bad3c82593bfcdc336632bb0", "score": "0.5169899", "text": "function beginStream() {\n client.stream('statuses/filter', { track: trendList.join(',') }, function(stream) {\n stream.on('data', function(data) {\n //console.log(data.text);\n io.emit('tweet', {'message': data.text});\n });\n \n stream.on('error', function(error) {\n throw error; \n });\n }); \n}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5167923", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5167923", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5167923", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5167923", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5167923", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5167923", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5167923", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5167923", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "7bac791e0673d68abc96ca5a03e037d1", "score": "0.5148309", "text": "function startOutput(obj,msg)\n{ _outputObj = obj;\n _outputBuffer = '';\n _outputObj.innerHTML = msg;\n}", "title": "" }, { "docid": "cb9ded2b5cea4b732e1990bd4e1b411c", "score": "0.51324487", "text": "function printUsage() {\n console.error(\"Capture and echo binary websocket messages to base64 text.\");\n console.error(\"Capture usage: node ws-util.js capture hostname:port\");\n console.error(` node ws-util.js capture localhost:10272 > out.bin`);\n console.error(\"Echo usage: node ws-util.js echo port\");\n console.error(` node ws-util.js echo 10272 < out.bin`);\n}", "title": "" }, { "docid": "4ec511cff7cc7ded62351d572e1d77a2", "score": "0.51261425", "text": "consoleError(string) {\n if (!this.muteStream) {\n console.error(string)\n }\n }", "title": "" }, { "docid": "f4dc355b54cd04667cd9cdbd1cd1eb48", "score": "0.511354", "text": "function ansi (stream, options) {\n if (stream._ansicursor) {\n return stream._ansicursor\n } else {\n return stream._ansicursor = new Cursor(stream, options)\n }\n}", "title": "" }, { "docid": "f4dc355b54cd04667cd9cdbd1cd1eb48", "score": "0.511354", "text": "function ansi (stream, options) {\n if (stream._ansicursor) {\n return stream._ansicursor\n } else {\n return stream._ansicursor = new Cursor(stream, options)\n }\n}", "title": "" }, { "docid": "eb016cb86dd522d84c2ecdc05de9d922", "score": "0.5110127", "text": "function SpoolingConsole(log_level) {\n this.level = log_level;\n this.contents = [];\n}", "title": "" }, { "docid": "a10c0cf5e390c9d6598900a3a0224e31", "score": "0.5108915", "text": "console (level, ...params) {\n if (this._enabled.console > level) {\n return // ignore\n }\n const status = params.map(param => {\n if (typeof param === 'string') {\n return param\n }\n if (typeof param === 'object') {\n return JSON.stringify(param)\n }\n return param.toString()\n }).join(' ')\n this._out('console', level, { status })\n }", "title": "" }, { "docid": "bc2b1a10bf36a0d1e3a9927fed8d7072", "score": "0.51022553", "text": "resumeEvents () {\n\t\tif (this.process == null) {\n\t\t\treturn;\n\t\t}\n\t\tthis.process.stdout.resume ();\n\t\tthis.process.stderr.resume ();\n\t\tthis.isReadPaused = false;\n\t}", "title": "" }, { "docid": "62a03f06340cb7509f52318c18a3eb06", "score": "0.51002216", "text": "function gotStream(stream) {\n window.stream = stream; // make stream available to console\n video.srcObject = stream;\n video.play();\n\n // Refresh button list in case labels have become available\n return navigator.mediaDevices.enumerateDevices();\n }", "title": "" }, { "docid": "38e5ad486c1b13ccb10006f107e310a9", "score": "0.509796", "text": "function console_ext() {\n this._uid = _random__WEBPACK_IMPORTED_MODULE_0__[\"default\"].guid();\n this._level = LogLevel.info;\n this._class_levels = new _collections_Dictionary__WEBPACK_IMPORTED_MODULE_1__[\"Dictionary\"]();\n }", "title": "" }, { "docid": "d07d28d210c3f2faa6fef1de66f34455", "score": "0.5096107", "text": "get printf() {\n return console.log;\n }", "title": "" }, { "docid": "d07d28d210c3f2faa6fef1de66f34455", "score": "0.5096107", "text": "get printf() {\n return console.log;\n }", "title": "" }, { "docid": "722687d598a1db8f1dcb21dc4572fd56", "score": "0.50902975", "text": "function puts(str, no_newline){\n Console.puts(str, no_newline)\n}", "title": "" }, { "docid": "0170a64e2a6baadde8800f3f203a039b", "score": "0.50889885", "text": "function inspectorLog() {\n const stdout = console._stdout;\n console._stdout = nullStream;\n console.log.apply(console, arguments);\n console._stdout = stdout;\n}", "title": "" }, { "docid": "cbce60f99a4a466dbece0eef6c522113", "score": "0.5079524", "text": "constructor(globalConfig) {\n super();\n this._globalConfig = globalConfig;\n this._clear = '';\n this._out = process.stdout.write.bind(process.stdout);\n this._err = process.stderr.write.bind(process.stderr);\n this._status = new Status();\n this._wrapStdio(process.stdout);\n this._wrapStdio(process.stderr);\n this._status.onChange(() => {\n this._clearStatus();\n this._printStatus();\n });\n }", "title": "" }, { "docid": "3298e1148c42e1f349b15a0be76457ff", "score": "0.5079448", "text": "function SSConsoleIsReady() {\r\n if (SSPendingShifts() == -1) {\r\n __consoleIsWaiting__ = true;\r\n } else if (SSPendingShifts() > 0) {\r\n ShiftSpace.Console.showNotifier();\r\n }\r\n }", "title": "" }, { "docid": "9fc86cb8f45da970909937de6735a175", "score": "0.5073913", "text": "_exit (stream) {\n process.stdout.removeListener('resize', this._resize);\n process.stdin.removeAllListeners();\n process.stdin.setRawMode(this.isRaw);\n process.stdin.resume();\n stream.end();\n }", "title": "" }, { "docid": "3034506c687b3c92f44fb5e52f2fe755", "score": "0.50727445", "text": "function consoleSubstitute() {\n this.log = function() {return true;};\n this.debug = function() {return true;};\n this.info = function() {return true;};\n this.warn = function() {return true;};\n this.error = function() {return true;};\n this.time = function() {return true;};\n this.timeEnd = function() {return true;};\n this.profile = function() {return true;};\n this.profileEnd = function() {return true;};\n this.trace = function() {return true;};\n this.group = function() {return true;};\n this.groupEnd = function() {return true;};\n this.dir = function() {return true;};\n this.dirxml = function() {return true;};\n}", "title": "" }, { "docid": "dd4a4c68820d342a0bccba07199b15c7", "score": "0.5060356", "text": "function streamGui(res, act) {\n\tvar buffer = '', eventDelimIndex;\n\tres.on('data', function(chunk) {\n\t\tchunk = buffer + chunk;\n\t\t// Step through each event, as its been given\n\t\twhile ((eventDelimIndex = chunk.indexOf('\\r\\n\\r\\n')) !== -1) {\n\t\t\tvar e = chunk.slice(0, eventDelimIndex);\n\t\t\te = local.contentTypes.deserialize('text/event-stream', e);\n\t\t\tif (e.event == 'update') {\n\t\t\t\tact.setGui(e.data);\n\t\t\t}\n\t\t\tchunk = chunk.slice(eventDelimIndex+4);\n\t\t}\n\t\tbuffer = chunk;\n\t\tres.body = '';\n\t});\n}", "title": "" }, { "docid": "c67bd24221010363e318ba346c3152e3", "score": "0.5056102", "text": "function clearScreen(){\n process.stdout.write('\\033c'); // clears the console before displaying result [windows powershell users]\n console.log('\\033[2J'); // clears the console before displaying result [linux users... probably mac also. Does nothing on windows powershell] \n}", "title": "" }, { "docid": "ce568e6c4bb431c5233c7b65b2e3c25c", "score": "0.50547975", "text": "onReadStdout (callback) {\n\t\tif (typeof callback != \"function\") {\n\t\t\treturn;\n\t\t}\n\t\tthis.readStdoutCallback = callback;\n\t}", "title": "" }, { "docid": "8d41fdc4f0ea240df8a02c43d0ed0fb1", "score": "0.5050795", "text": "function Stream() {\n EventEmitter$1.call(this);\n}", "title": "" }, { "docid": "0faa25caf4f50b92e072c8269778a61d", "score": "0.50485176", "text": "function inspectorLog() {\n const stdout = console._stdout;\n console._stdout = nullStream;\n console.log.apply(console, arguments);\n console._stdout = stdout;\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5047802", "text": "function Stream() {\n EE.call(this);\n}", "title": "" } ]
de9afb95e0a1dc3989d8ad05db6ef12b
restarts the animation when the page has been resized
[ { "docid": "533a241f3ee8b0774e0fa9e907dfa3f4", "score": "0.0", "text": "function restartAnimation() {\r\n boundsX = $(insideNode).width() - $(\".bubble\").width() - borderWidth;\r\n boundsY = $(insideNode).height() - $(\".bubble\").height() - borderWidth;\r\n $(\".bubble\").stop(true); // stop the animations\r\n moveBubbles(); // restart the animations within the new bounds\r\n }", "title": "" } ]
[ { "docid": "2e36737925dc43d086b0acb941cc22e6", "score": "0.72330934", "text": "_recalcResize() {\n\n this._calcSizes();\n\n this._loopCount = 2;\n this._animEnd();\n\n }", "title": "" }, { "docid": "9732082208c1f35dd4260f20912bb80f", "score": "0.70999014", "text": "function windowResized() {\n\tsetup();\n}", "title": "" }, { "docid": "ef884cb9da3a881d0c27f305d944fadc", "score": "0.70741534", "text": "function resize() {\n if (!running) {\n running = true;\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(runCallbacks);\n } else {\n setTimeout(runCallbacks, 66);\n }\n }\n }", "title": "" }, { "docid": "af4e06b7a503012e7acd48fe26544fff", "score": "0.7065064", "text": "function resize() {\n\n if (!running) {\n running = true;\n\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(runCallbacks);\n } else {\n setTimeout(runCallbacks, 66);\n }\n }\n\n }", "title": "" }, { "docid": "a1e6030015261040952874720b691cdf", "score": "0.7063171", "text": "function performResize() {\n paused = true;\n reset();\n render();\n}", "title": "" }, { "docid": "c91758f198a98c94add013d2d04fbf03", "score": "0.7060946", "text": "function resize() {\n\n if (!running) {\n running = true;\n\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(runCallbacks);\n } else {\n setTimeout(runCallbacks, 120);\n }\n }\n\n }", "title": "" }, { "docid": "8415501b76dd97b412a807d1e72d3162", "score": "0.7046933", "text": "onWindowResize() {\n this.recalculate();\n }", "title": "" }, { "docid": "2c072a86f7fa7a85ae984f5b46fd74d6", "score": "0.7032264", "text": "function onResize() {\n\twindow.requestAnimationFrame(() => resized = true);\n}", "title": "" }, { "docid": "3927fd42df9415103222cd043b79c54a", "score": "0.70043916", "text": "function resize() {\n\n\t\tif ( ! running ) {\n\t\t\trunning = true;\n\n\t\t\tif (window.requestAnimationFrame) {\n\t\t\t\twindow.requestAnimationFrame(runCallbacks);\n\t\t\t} else {\n\t\t\t\tsetTimeout(runCallbacks, 66);\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "bbfd046b91f7e0a6a1d029257472c55a", "score": "0.6993252", "text": "function resize() {\n if (!running) {\n running = true;\n\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(runCallbacks);\n } else {\n setTimeout(runCallbacks, 66);\n }\n }\n }", "title": "" }, { "docid": "f7b094aff1c354720821756af1f79973", "score": "0.69926906", "text": "function resize() {\n\n if (!running) {\n running = true;\n\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(runCallbacks);\n } else {\n setTimeout(runCallbacks, 66);\n }\n }\n\n }", "title": "" }, { "docid": "3db8ebc49bc1bcc8f5b8b2a4d935892f", "score": "0.69721425", "text": "_onResize() {\n this.update();\n }", "title": "" }, { "docid": "61b46ad7162d48b79cf92b685613ce00", "score": "0.69630843", "text": "function resizeStuff() {} // Runs function once on window resize.", "title": "" }, { "docid": "9666beff90cfc7e83e9f3480bab31167", "score": "0.6933789", "text": "function resize () {\n // hold the update callback until resize end\n if (!running) {\n running = true\n\n window.requestAnimationFrame ? window.requestAnimationFrame(runCallbacks) : setTimeout(runCallbacks, 66)\n }\n }", "title": "" }, { "docid": "c6a4f6cae141572f31993f70e74f4809", "score": "0.6879123", "text": "_onResizeMe(e) {\n this._reflow();\n }", "title": "" }, { "docid": "c6a4f6cae141572f31993f70e74f4809", "score": "0.6879123", "text": "_onResizeMe(e) {\n this._reflow();\n }", "title": "" }, { "docid": "c6a4f6cae141572f31993f70e74f4809", "score": "0.6879123", "text": "_onResizeMe(e) {\n this._reflow();\n }", "title": "" }, { "docid": "40bc7fe1c138caa994378af02cbe1f2c", "score": "0.68764514", "text": "function resize() {\n let visuals = section.querySelector(\".learning-visuals\");\n let secondaryImages = section.querySelectorAll(\".learning-secondary\");\n let topRight = section.querySelector(\".top-right\");\n let left = section.querySelector(\".left\");\n let botRight = section.querySelector(\".bottom-right\");\n\n xDist = Math.min(0.29 * innerWidth, 275);\n\n // Animation has ran, so just set the values\n if (hasFired) {\n if (innerWidth > phoneBreakpoint) {\n setDesktopPos(topRight, left, botRight);\n } else {\n setMobilePos(topRight, left, botRight);\n }\n\n return;\n }\n\n // Animation hasn't ran, so set the animation up if necessary\n if (innerWidth > phoneBreakpoint && !hasFired) {\n if (introAnim) {\n introAnim.scrollTrigger.kill();\n introAnim.kill();\n }\n\n // let wasDesktop = true;\n\n setDesktopPos(topRight, left, botRight);\n\n introAnim = gsap.timeline({\n scrollTrigger: {\n trigger: visuals,\n start: \"center 70%\",\n once: true,\n onEnter: () => {\n hasFired = true;\n }\n }\n }).from(secondaryImages, {\n x: 0,\n y: 0,\n stagger: 0.1\n });\n } else if (!hasFired) {\n if (introAnim) {\n introAnim.scrollTrigger.kill();\n introAnim.kill();\n }\n\n // let wasPhone = true;\n\n setMobilePos(topRight, left, botRight);\n\n introAnim = gsap.timeline({\n scrollTrigger: {\n trigger: visuals,\n start: \"center 80%\",\n once: true,\n onEnter: () => {\n hasFired = true;\n }\n }\n }).from(secondaryImages, {\n x: 0,\n y: 0,\n stagger: 0.1\n });\n }\n}", "title": "" }, { "docid": "38eb07eb2c6685a00fec64aaf6ce8adb", "score": "0.6871791", "text": "function resize() {\r\n\r\n if (!running) {\r\n running = true;\r\n\r\n if (window.requestAnimationFrame) {\r\n window.requestAnimationFrame(runCallbacks);\r\n } else {\r\n setTimeout(runCallbacks, 200);\r\n }\r\n }\r\n\r\n }", "title": "" }, { "docid": "b5db2c4938aacd8d6f619d4e5603e930", "score": "0.6870165", "text": "onResize () {\n if (this._isDestroyed) return\n\n this.setWidths()\n\n clearTimeout(this.resizeTimeout)\n this.resizeTimeout = setTimeout(() => {\n this.callSlider()\n this.scrollIntoView()\n this.checkIcons()\n }, this.transitionTime)\n }", "title": "" }, { "docid": "09888c233c0d0c49532d03488829e311", "score": "0.68700683", "text": "resized() {\n if (this.resizeTimeout) {\n this.resizeTimeout = clearTimeout(this.resizeTimeout);\n }\n this.resizeTimeout = setTimeout(() => {\n this.width = this.offsetWidth;\n this.setFlippers();\n }, this.frameTime);\n }", "title": "" }, { "docid": "2a1d16cafb4a07fe4f5720099d3cbdf3", "score": "0.68229175", "text": "function resizeCall(){\n\t\tpageCalculations();\n\t\t$('.swiper-container').each(function(){\n\t\t\tswipers['swiper-'+$(this).attr('id')].reInit();\n\t\t});\n\t}", "title": "" }, { "docid": "8451e3aaaa8f08d9ab413252b92e05ba", "score": "0.6777708", "text": "function onResize() {\n requestAnimationFrame(resizeUpdate);\n}", "title": "" }, { "docid": "a911c116d7a9a93630e4c8dc22f15976", "score": "0.67593354", "text": "onResize() {}", "title": "" }, { "docid": "9ae38960008a82ec5ce60afeaaa3a9b1", "score": "0.67443806", "text": "function onResize() {\n\trender();\n}", "title": "" }, { "docid": "9ae38960008a82ec5ce60afeaaa3a9b1", "score": "0.67443806", "text": "function onResize() {\n\trender();\n}", "title": "" }, { "docid": "d5b21c341fa497d4b955581770710a19", "score": "0.6730245", "text": "function resized(){\n console.log(\"Resize was called\")\n if(is_loading){\n show_loading()\n }else{\n hide_loading()\n }\n}", "title": "" }, { "docid": "02a6b0e42d2e37d25cc80d0a246bd59e", "score": "0.6726749", "text": "function resizeHandler(){\n\t\tif ( self.switched() ){\n\t\t\tself.rebuild();\n\t\t}\n\t}", "title": "" }, { "docid": "ee581015b0f5105863803361429e0ee4", "score": "0.6725344", "text": "function doneResizing(){\n resizeHome();\n}", "title": "" }, { "docid": "212021900dccf40731a09f8cb9ea4741", "score": "0.67121285", "text": "function resizeCall() {\n pageCalculations();\n }", "title": "" }, { "docid": "dbf4edd2280f4149932eb600b05ad48c", "score": "0.6707716", "text": "function resizeCall(){\r\n\t\tpageCalculations();\r\n\t}", "title": "" }, { "docid": "f845cd156f11bc99550662278bac30a5", "score": "0.66935617", "text": "function onresize(w,h)\n{\n bang();\n refresh();\n}", "title": "" }, { "docid": "1d5c41f3f863358ab125aa106da8cff9", "score": "0.667566", "text": "function doOnWindowResize() {\r\n\t\t\tsetSizes();\r\n\t\t\t$root.css({\r\n\t\t\t\tmarginLeft: getPageMarginPosition(currentPage)\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "ad47876a03a84d592b5f297e0ddaf739", "score": "0.66607875", "text": "onResized(e){this.emit($e.RENDITION.RESIZED,{width:e.width,height:e.height}),this.location&&this.location.start&&this.display(this.location.start.cfi)}", "title": "" }, { "docid": "40ac36aac07ec0258a375770d97be4df", "score": "0.6643955", "text": "resizeHandler() {\n \n // update perPage number dependable of user value\n this.resolveSlidesNumber();\n \n // relcalculate currentSlide\n // prevent hiding items when browser width increases\n if (this.currentSlide + this.perPage > this.numSlides) {\n this.currentSlide = this.numSlides <= this.perPage ? 0 : this.numSlides - this.perPage;\n }\n \n this.updateWidth()\n this.disableTransition()\n this.slideToCurrent()\n\n requestAnimationFrame(()=>{\n requestAnimationFrame(()=>{\n this.enableTransition();\n })\n })\n }", "title": "" }, { "docid": "16f33377b173c0636c79e8e235a0fbfd", "score": "0.66320413", "text": "function initResizer(){\n\n$(window).resize(function(){\n \n \t//console.log(winW)\n winW = $(window).width();\n winH = $(window).height(); \n \tcenterPosX = winW/2-startingW/2;\n \t\n \t// set mobile variable\n \tif(winW<=652){\n\t\tmobile = true;\n\t} else {\n\t\tmobile = false;\n\t}\t\n\t\n\t// going from desktop to mobile\n\tif(mobile && !isMobile){\n\t\t$('#modules').css({'top':'','left':''});\n\t\t$('#headerBar').css('width','');\n\t\t$('#mobile-home').css('overflow','');\n\t\torigW = winW;\n\t\tmobileOpen();\n\t}\n\t\n\t// going from mobile to desktop\n\tif(!mobile && isMobile){\n\t\tif(activePage!=''){\n\t\t\t$('#headerBar').css('width','100%');\n\t\t} else {\n\t\t\tcenterPosY = winH/2-startingH/2;\n\t\t\tif(winH/2-startingH/2>-100){centerPosY = winH/2-startingH/2;}\n\t\t\t$('#modules').css({'top':centerPosY});\n\t\t}\n\t\tmobileClose();\n\t}\n\n \n // Homepage for desktop\n \n if(isHome && !mobile){\n \t \n \t// reset container first \t\n \t$('.contentSizer').css({'width':'100%','padding':'0'});\n \t\n \t// center module container \n\t if(winH/2-startingH/2>-100){centerPosY = winH/2-startingH/2;} // make sure top coordinate is a positive number\n\t TweenMax.set('#modules', {left:centerPosX, top:centerPosY, width:startingW});\n \n \t// if larger than 1200, scale modules \t\n \tif(winW>winBreak){\n \t\tif(winW<startW){\n \t\t\tmaxW = initSC-(startW-winW)/scFactor;\n \t\t\tTweenMax.set('#modules', {scaleX:maxW, scaleY:maxW});\t\t\t\n \t\t} else{\n \t\t\tmaxW = initSC-(startW-winW)/(scFactor*2);\n \t\t\tTweenMax.set('#modules', {scaleX:maxW, scaleY:maxW});\n \t\t}\n \t}\n\t\n \t// if smaller than 1200, remove parts and keep scale same\t \t\t\t\n \tif(winW<=winBreak){\n \t\tmaxW = initSC-(startW-winBreak)/scFactor;\n \t\tTweenMax.set('#modules', {scaleX:maxW, scaleY:maxW});\t\t\t\n \t}\n\t\n \t// resize content sizer to shrink modules \t\n \tif(winW<=1110 && winW>640){\t \t\n\t \t// shrink widths of each module to fit screen\t \t\t\n\t \t$('.module:not(.module-dummy)').each(function(i){\n\t\t\t\ttmpW = ((winW-24)*modPercents[i])/.44;\n\t\t\t\t$(this).width(tmpW);\n\t\t \t}) \n\t\t} else {\n\t\t\t$('.module:not(.module-dummy)').each(function(i){\n\t\t\t\t$(this).css('width','');\n\t\t\t});\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t//! Resize tier pages\n\t \t\t\n\telse {\n \n\t // center modules\t\t\t\n\t\tif(!mobile){\n\t\t\tTweenMax.set('#modules', {left:centerPosX, top:tierTop});\n\t\t}\n \n\t // resize module body to allow for scroll\t\t\n\t\tif(tierOpen){\t\t\t\n\t\t\t\n\t\t\t// responsive sizing down\t\n\t\t\tif(winW<zoomWidths[activePage]+20){\n\t\t\t\tnewW = winW-20;\n\t\t\t\t$('.module[data-num=\"'+activePage+'\"]').css('width',newW);\n\t\t\t} else {\n\t\t\t\t$('.module[data-num=\"'+activePage+'\"]').css('width',zoomWidths[activePage]);\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\t// additional tweaks\n\t\t\tif(activePage == 0){\n\t\t\t\tif(winW<940){\n\t\t\t\t\t$('#module-work').find('.thumbs-top').find('.contentBox>div').find('h2').css('line-height','35px');\t\n\t\t\t\t\tif($('#module-work').find('.thumbs-top').find('.contentBox>div').find('h2').height()>=70){\n\t\t\t\t\t\t$('#module-work').find('.thumbs-top').find('.contentBox>div').find('h2').css('line-height','16px')\n\t\t\t\t\t}\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$('#module-work').find('.thumbs-top').find('.contentBox>div').find('h2').css('line-height','40px');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('.thumb-info-contents').each(function(){\n\t\t\t\t\t$(this).css('margin-top',-$(this).height()/2);\n\t\t\t\t})\n\t\t\t\t\n\t\t\t\t// for tablet\n\t\t\t\tif(winW<zoomWidths[activePage]+20){\n\t\t\t\t\texpandW = winW-20;\n\t\t\t\t} else {\n\t\t\t\t\texpandW = zoomWidths[activePage];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// keep loader centered\n\t\t\t\tlH = $('.first-screen').height();\n\t\t\t\tif(lH>0){\n\t\t\t\t$('.project-loader').css({'height':lH});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// full number resizing to eliminate pixel shift\n\t\t\t\tintL = Math.round($('#module-work .module-body').width()*.67);\n\t\t\t\tintR = Math.round($('#module-work .module-body').width()*.32);\n\t\t\t\t$('#module-work .col-left').css('width',intL);\n\t\t\t\t$('#module-work .col-right').css({'width':intR});\n\t\t\t\t\n\t\t\t\t$('.thumb-box').each(function(){\n\t\t\t\t\tif(!$(this).hasClass('wide')){\n\t\t\t\t\t\tintW = Math.round($('#module-work .col-left').width()*.495);\n\t\t\t\t\t\t$(this).css('width',intW);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tif(!projectOpen){\n\t\t\t\t\t$('.thumbs-whitebg').css({'width':intW});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(projectOpen && $('#project-screens').height()>0){\n\t\t\t\t\t$('.thumbs-whitebg').height($('#project-screens').height());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// correction for old Safari\n\t\t\t\tif(isSafari5){\n\t\t\t\t\t$('.thumb-info').each(function(){\n\t\t\t\t\t\t$(this).css('height',$(this).parent().height());\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// set height for vert blocks\n\t\t\t\ttM = Number($('.thumb-box[data-num=\"1\"]').css('margin-bottom').split('px')[0]);\n\t\t\t\ttH = $('.thumb-box[data-num=\"1\"]').height()*2+Math.floor(tM);\n\t\t\t\t$('.thumb-box.tall').css({'height':tH})\n\t\t\t}\n\t\t\t\n\t\t\t// vertical sizing\n\t\t\tif(activePage == 1){ // Details\n\t\t\t tmpH = winH-183;\n\t\t\t if(tmpH>detailsH){tmpH = detailsH;}\n\t\t\t $('#module-details').find('.col-left').find('.dummylines').css({height:tmpH});\n\t\t\t if($('#scrollbar-about').find('.scrollbar').css('display') == 'block'){$('#scrollbar-about').find('.scrollbar').css('visibility','visible')}\n\t\t\t}\n\t\t\t\n\t\t\tif(activePage == 3){ // Thoughts\n\t\t\t\t$('.thought-row').each(function(i){\n\t\t\t\t\ttmpH = $(this).find('p').height()+20;\n\t\t\t\t\t$(this).css('height',tmpH);\n\t\t\t\t})\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//! Tablet tier resize\n\t\t\t// if tablet, adjust active tier section\n\t\t\tif(winW<1110){\t\t\t\n\t\t\t\t\n\t\t\t\tif(activePage == 0){ // Work\n\t\t\t\t\tif(winW<760){\n\t\t\t\t\t\t$('.thumb-box[data-id=\"94\"]').find('p').html('M&Ms Transformers');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('.thumb-box[data-id=\"94\"]').find('p').html('M&Ms Transformers Microsite');\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(activePage == 1){ // Details\n\t\t\t\t\tshortPct = ($('.skills').width()-185)/$('.skills').width()\n\t\t\t\t\t$('#module-details .meter-wrap').css('width',Math.ceil(shortPct*100)+'%');\n\t\t\t\t\t\n\t\t\t\t\tif(winW<905){\n\t\t\t\t\t\ttmpH = 20;\n\t\t\t\t\t\t$('#module-details').find('.col-left').find('p').each(function(i){\n\t\t\t\t\t\t\ttmpH += $(this).height();\n\t\t\t\t\t\t\tif(i>0){tmpH+=25;}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(tmpH>(winH-183)){tmpH = winH-183;}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('#module-details').find('.col-left').find('.dummylines').css({height:tmpH});\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(activePage == 3){ // Thoughts\t\t\t\t\t\n\t\t\t\t\t// shorten subheaders\n\t\t\t\t\tif(winW<1000){\n\t\t\t\t\t\tif(!subReplaced){\n\t\t\t\t\t\t\t$('.blog-header').each(function(i){\n\t\t\t\t\t\t\t\ttmpS = $(this).find('h3').attr('data-short');\n\t\t\t\t\t\t\t\ttmpS2 = $(this).find('h3').html();\n\t\t\t\t\t\t\t\t$(this).find('h3').html(tmpS).attr('data-short', tmpS2);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tsubReplaced = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(subReplaced){\n\t\t\t\t\t\t\t$('.blog-header').each(function(i){\n\t\t\t\t\t\t\t\ttmpS = $(this).find('h3').attr('data-short');\n\t\t\t\t\t\t\t\ttmpS2 = $(this).find('h3').html();\n\t\t\t\t\t\t\t\t$(this).find('h3').html(tmpS).attr('data-short', tmpS2);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tsubReplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// shorten long title\n\t\t\t\t\tif(winW<=840){\n\t\t\t\t\t\tif(!titleReplaced){\n\t\t\t\t\t\t\t$('.blog-header').each(function(i){\n\t\t\t\t\t\t\t\ttmpT = $(this).find('h2').attr('data-short');\n\t\t\t\t\t\t\t\tif(tmpT != ''){\n\t\t\t\t\t\t\t\t\ttmpT2 = $(this).find('h2').html();\n\t\t\t\t\t\t\t\t\t$(this).find('h2').html(tmpT).attr('data-short', tmpT2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\ttitleReplaced = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tTweenMax.set($('#module-thoughts').find('.dummylines[data-num=\"0\"]'), {width:'100%'})\n\t\t\t\t\t\tTweenMax.set($('#module-thoughts').find('.dummylines[data-num=\"1\"]'), {width:'0%'})\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(titleReplaced){\n\t\t\t\t\t\t\t$('.blog-header').each(function(i){\n\t\t\t\t\t\t\t\ttmpT = $(this).find('h2').attr('data-short');\n\t\t\t\t\t\t\t\tif(tmpT != ''){\n\t\t\t\t\t\t\t\t\ttmpT2 = $(this).find('h2').html();\n\t\t\t\t\t\t\t\t\t$(this).find('h2').html(tmpT).attr('data-short', tmpT2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\ttitleReplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!isIE9){\n\t\t\t\t\t\t\tTweenMax.set($('#module-thoughts').find('.dummylines'), {width:'49.5%'})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif(mobile){\n\t\t\t\tnewW = winW-20;\n\t\t\t\tnewX = zoomX-((winW-origW)*(Number(activePage)+1));\n\t\t\t\tif(activePage == ''){newX = 10;}\n\t\t\t\t$('.module').each(function(){\n\t\t\t\t\t$(this).width(newW);\n\t\t\t\t\t$('.contentSizer').css({'margin-left':newX});\n\t\t\t\t})\n\t\t\t\t\n\t\t\t\tadjustMobilePages();\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(!moving){\n\t\t\t\tsetPage();\n\t\t\t}\n\t\t}\n\t\n\t}\n\t\n\ttablet = false;\n\tif(winW<=1110){\n\t\ttablet = true;\n\t}\n\t\t\n// close window resizer\n})\n\n$(window).resize();\n\n}", "title": "" }, { "docid": "9b9b718b684ef1860455b0d34554a4dd", "score": "0.6630977", "text": "function windowResized() {\n for (var i = 0; i < divCounter; i++) {\n select(\".a\" + i).style(\"display\", \"none\"); //hide old boxes\n }\n background(255, 20, 40);\n setup();\n frameCount = 0;\n draw();\n}", "title": "" }, { "docid": "e0190ba7d2aaa4847ecfd63a49db65e4", "score": "0.66051024", "text": "static onResize() {\n Scene.active.onResize();\n }", "title": "" }, { "docid": "b0bbf9e5dcf13dc4ef90135f12ca21c2", "score": "0.6572093", "text": "function resize() {\n\n}", "title": "" }, { "docid": "6d6eb1d72e49e1838b45da83e8377a17", "score": "0.6571323", "text": "function windowResized(){\n setup();\n}", "title": "" }, { "docid": "fe0cfb94a9e4fb3a0dcf5a1ca9313fb8", "score": "0.65708053", "text": "function windowResized(){\r\n\t$setCanvasSize(boardSize);\r\n\t$setObjectScreenXY(weapons);\r\n\t$setObjectScreenXY(pieces);\r\n\t$setBoardScreenXY(squares);\r\n\tdrawSideBarInfo(turnFlag);\r\n\tcvsMoveScale.setAttribute(1, 2, 490);\r\n\tanimationFlags.drawBoard = true;\r\n\tanimationFlags.drawPieces = true;\r\n\tanimate();\r\n}", "title": "" }, { "docid": "f69ce69a1ba62dda51386acea5670d1e", "score": "0.6568459", "text": "function resize() {\n \n $pages.find('.infos').height(window.innerHeight);\n\n if($(window).width() > 500){\n $pages.find('.circle').css({'width':window.innerHeight/1.8, 'height':window.innerHeight/1.8});\n }\n \n\n Earth.resize();\n \n _controller.update(true);\n \n}", "title": "" }, { "docid": "13c693d15c96e327688180b0143a2ca8", "score": "0.6527277", "text": "onResize() {\n }", "title": "" }, { "docid": "13c693d15c96e327688180b0143a2ca8", "score": "0.6527277", "text": "onResize() {\n }", "title": "" }, { "docid": "aa0ce4c8c02885717b3db87a879c4bc6", "score": "0.6526916", "text": "resize() {\n this.redraw();\n }", "title": "" }, { "docid": "aa0ce4c8c02885717b3db87a879c4bc6", "score": "0.6526916", "text": "resize() {\n this.redraw();\n }", "title": "" }, { "docid": "1f29e6281fbe0c53e519dd1bb6b0d1f1", "score": "0.64915043", "text": "function onResize() {\n asyncDigestDebounced.add(checkWindowForRebuild);\n }", "title": "" }, { "docid": "2744067d6a2adfaffa99bd66cc183c92", "score": "0.6489438", "text": "function windowResized() {\n space.size(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "0f8c5927ddeff55ad9b66ebeed2c4fab", "score": "0.6455989", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n setupArray();\n}", "title": "" }, { "docid": "0233443b8376a9ed7589184d99873447", "score": "0.64457524", "text": "_onResize () {\n this._disabled = true\n this._debouncedEnable()\n if (!this._ticking) {\n window.requestAnimationFrame(this._update.bind(this))\n this._ticking = true\n }\n }", "title": "" }, { "docid": "264973ced25488efb56b8cbb09f7ef85", "score": "0.64451045", "text": "refresh() {\n this._recalcResize();\n }", "title": "" }, { "docid": "659d42f7e1ec03916af9aaa7d7000d42", "score": "0.6436882", "text": "function resize() {\n $timeout(setInitial);\n }", "title": "" }, { "docid": "edcd35373a575388c0fdb738daae3222", "score": "0.6433491", "text": "function _windowResized () {\n if (window.current_layout === 'palm') {\n _masonryDestroy();\n } else {\n _masonryInit();\n }\n }", "title": "" }, { "docid": "e5b02ed56bbbf222e1dcb27a9e23e55b", "score": "0.64312124", "text": "function resize()\n {\n if ( resizing )\n {\n clearTimeout( resizing );\n resizing = null;\n }\n resizing = setTimeout( done, 50 );\n }", "title": "" }, { "docid": "f77ac6f1faa3dd5f7c4bd67dbafc458a", "score": "0.6423124", "text": "function windowResized(){\r\n}", "title": "" }, { "docid": "b651a3c85a5a1c5d34d0b92ec6be4a39", "score": "0.64148504", "text": "function _resized() {\n\t\t\t\t_winHeight = $window.innerHeight + 'px';\n\n\t\t\t\tif (loading.active) {\n\t\t\t\t\t_$body.css({\n\t\t\t\t\t\theight: _winHeight\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "944d1ada51935bdc0ca16b32fbfd5343", "score": "0.6408815", "text": "_updateOnResize() {\n this._debouncedUpdate();\n }", "title": "" }, { "docid": "944d1ada51935bdc0ca16b32fbfd5343", "score": "0.6408815", "text": "_updateOnResize() {\n this._debouncedUpdate();\n }", "title": "" }, { "docid": "cf4f9772a69a3be4c946addd75c7304e", "score": "0.6398591", "text": "function viewportResized() {\n window.addEventListener('resize', function () {\n setViewportWidth();\n setNavBar();\n });\n}", "title": "" }, { "docid": "8fe43d79ca08c68fe9fd28c4733969ba", "score": "0.6393307", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n init();\n}", "title": "" }, { "docid": "dc47ba9fab7c6430a74367dfffb59176", "score": "0.6390371", "text": "_events() {\n $(window).on('resize.zf.interchange', Foundation.util.throttle(() => {\n this._reflow();\n }, 50));\n }", "title": "" }, { "docid": "2d8ea62e1f1e92b9715146b68ea5bec2", "score": "0.6380695", "text": "resize() {\n this.updateLayout(true);\n }", "title": "" }, { "docid": "ef86ae67d5a1e45eb3605b7716897cb5", "score": "0.6357586", "text": "function JoyLearningCurve() {\n\n resize();\n ScrollTrigger.addEventListener(\"refresh\", resize);\n\n}", "title": "" }, { "docid": "f1d341c1e54b13b7d4be3ab8d24bf2c9", "score": "0.6338073", "text": "function onResize() {\n\tMM.BC.log('onResize');\n \n\tif (!globals.initedUI)\n return;\n \n\tupdateDisplay();\n}", "title": "" }, { "docid": "2cc4a6b855af1f2e8591c480a745532b", "score": "0.63367957", "text": "function view_onSize() {\n resizeScrollarea();\n}", "title": "" }, { "docid": "373fc05db8a6c7189747db9d4f613c5b", "score": "0.6332645", "text": "playWinAnimation () {\r\n this.scaleUp()\r\n }", "title": "" }, { "docid": "88bb5780e5cdcb0168fe4881eb83acab", "score": "0.6319295", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n //reInit();\n}", "title": "" }, { "docid": "6845e78bbe2387c775db4d58215aee6f", "score": "0.63169473", "text": "function Resize() {}", "title": "" }, { "docid": "3babf93a8a0ae6a3a849cd1ad230c801", "score": "0.6313059", "text": "function windowResized() {\n if(loaded) {\n resizeCanvas(windowWidth, windowHeight);\n background(0);\n wheelSize = constrain(min(windowHeight, windowWidth), 0, 920) - 20;\n posX = windowWidth/2;\n posY = windowHeight/2;\n}\n}", "title": "" }, { "docid": "e20072f769d7284b37a08338248f398a", "score": "0.6311271", "text": "function resize() {\n debounce(\n bsScreenSize.config.debounce,\n $rootScope.$apply(function () {\n updateState();\n })\n );\n }", "title": "" }, { "docid": "f5f09af04ab7a560837e8e4770edd444", "score": "0.6306768", "text": "function resize() {\n\t\t\tsetMinHeights(); // Reset the minimum height of the site.\n\t\t\tif (leftActive) { // Left Slidebar is open whilst the window is resized.\n\t\t\t\topen('left'); // Running the open method will ensure the slidebar is the correct width for new screen size.\n\t\t\t} else if (rightActive) { // Right Slidebar is open whilst the window is resized.\n\t\t\t\topen('right'); // Running the open method will ensure the slidebar is the correct width for new screen size.\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "545d21d0693af0885906c62e455e0791", "score": "0.6294819", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n updateDistrictFrames();\n}", "title": "" }, { "docid": "d28b50210e9f1129a3075c69b4e6fb74", "score": "0.62915564", "text": "function onWindowResize() {\n let threeD = updateCamera(camera);\n\n updateRenderer(threeD);\n\n updateInfoToDrawBorders(stackHelper, threeD);\n }", "title": "" }, { "docid": "133347e57626286fd2b176b1c0bff1e3", "score": "0.6285857", "text": "function handleResize() {\n\n \n // 1. update height of step elements\n var stepH = Math.floor(window.innerHeight * 0.7);\n step.style(\"height\", stepH + \"px\");\n\n frame = d3.select(\".flourish-embed iframe\")\n if (frame.node() !== null) {\n var figureHeight = frame.node().getBoundingClientRect().height;\n var figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\n figure.style(\"height\", figureHeight + \"px\").style(\"top\", figureMarginTop + \"px\");\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }\n }", "title": "" }, { "docid": "9ff1b6bdd733e7a69f9874c565b6883e", "score": "0.62762445", "text": "Viewport_OnResized() {\n //this.UpdateScrollHeight();\n //this.RenderNodes();\n //this.BuildGroups();\n\n this.HideEditor(false);\n this.BuildGroups();\n }", "title": "" }, { "docid": "15d5ca7cb1f4fe22d5ff94d583068666", "score": "0.6264659", "text": "function onResize () {\n var height = window.innerHeight\n var width = window.innerWidth\n o.next({height, width})\n }", "title": "" }, { "docid": "2433459c5686fa1e5de48bbbdf5ba7dd", "score": "0.62629795", "text": "function startFit(){\n\t\tsetSize();\n\t\tif(!_re){\n\t\t\tswffit.addResizeEvent(setSize);\n\t\t\t_re = 1;\n\t\t}\n\t}", "title": "" }, { "docid": "91411ebcf6cd06ae5fff600abe6e36e8", "score": "0.62579197", "text": "resizeListeners(){clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}", "title": "" }, { "docid": "f47d6adee356bd417b530ba3d6717b1a", "score": "0.62464076", "text": "function windowResized() {\n sketch.resizeCanvas(window.innerWidth, window.innerHeight);\n }", "title": "" }, { "docid": "5200b6b2093160c3e655b172eb2c8cc2", "score": "0.62387586", "text": "function onWindowResize(event){\n adjustExampleView();\n }", "title": "" }, { "docid": "5200b6b2093160c3e655b172eb2c8cc2", "score": "0.62387586", "text": "function onWindowResize(event){\n adjustExampleView();\n }", "title": "" }, { "docid": "3102c291bab7626422f5f7bd2754c03e", "score": "0.6232666", "text": "function qodefOnWindowResize() {\n\n }", "title": "" }, { "docid": "dc0edc7d38aa88965829eff4a1321378", "score": "0.62185115", "text": "function onresize(w,h)\n{\n\trefresh();\n\tdraw();\n}", "title": "" }, { "docid": "234fc97fe0b5503ce9ed5717967932d6", "score": "0.6215124", "text": "_onResize()\n {\n let oldWidth = this.config.container.clientWidth;\n let oldHeight = this.config.container.clientHeight;\n\n window.addEventListener(\"resize\", () =>\n {\n if (oldWidth !== this.config.container.clientWidth || oldHeight !== this.config.container.clientHeight)\n {\n oldWidth = this.config.container.clientWidth;\n oldHeight = this.config.container.clientHeight;\n this._updateCanvasSize();\n this.drawWaveform();\n }\n });\n }", "title": "" }, { "docid": "628a1097a2822ae1df11485682b6f63d", "score": "0.62135947", "text": "function onresize(w,h)\n{\n\tdraw();\n\trefresh();\n}", "title": "" }, { "docid": "7a27372dfc5581498a753768543e2455", "score": "0.62105125", "text": "function ForceResize() {\n delayer.add(ResizeNow);\n}//single works 60%", "title": "" }, { "docid": "84eea3c4019dbdc5cccd25ca0908506e", "score": "0.6197495", "text": "function handleResize() {\n // 1. update height of step elements\n var stepHeight = Math.floor(window.innerHeight * 0.75);\n step.style('height', stepHeight + 'px');\n // 2. update width/height of graphic element\n var bodyWidth = d3.select('body').node().offsetWidth;\n var graphicMargin = 16 * 4;\n var textWidth = text.node().offsetWidth;\n var graphicWidth = container.node().offsetWidth - textWidth - graphicMargin;\n var graphicHeight = Math.floor(window.innerHeight * 0.95)\n var graphicMarginTop = Math.floor(graphicHeight / 2)\n graphic\n .style('width', graphicWidth + 'px')\n .style('height', graphicHeight + 'px')\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }", "title": "" }, { "docid": "80dda178d51915ca5496dabd73f00069", "score": "0.61944693", "text": "function onResize() {\n vars.width = vars.container.outerWidth();\n vars.height = vars.container.outerHeight();\n }", "title": "" }, { "docid": "045669d779c570fc790daac4d606f743", "score": "0.6191577", "text": "_resize() {\n\t\tthis.graphOptions.width = window.innerWidth * 0.7;\n\t\tthis.graphOptions.height = window.innerWidth * 0.5;\n\t\tthis.notifyPath('graphOptions.width');\n\t\tthis.notifyPath('graphOptions.height');\n\t}", "title": "" }, { "docid": "4edb101f5a55246409843ee06aeb8cd2", "score": "0.61912364", "text": "function mkdOnWindowResize() {\n\n }", "title": "" }, { "docid": "2db0bc6c6e02df3e673bd3bc8fb9fa89", "score": "0.6177391", "text": "function mkdOnWindowResize() {\n\n\t}", "title": "" }, { "docid": "39eb0ac3ebabac8b0153dcbe7463473c", "score": "0.6173608", "text": "function handleResize() {\n\t\t// 1. update height of step elements\n\t\tvar stepHeight = Math.floor(window.innerHeight * 0.75);\n\t\tstep.style('height', stepHeight + 'px');\n\t\t// 2. update width/height of graphic element\n\t\tvar bodyWidth = d3.select('body').node().offsetWidth;\n\t\tvar graphicMargin = 16 * 4;\n\t\tvar textWidth = text.node().offsetWidth;\n\t\tvar graphicWidth = container.node().offsetWidth - textWidth - graphicMargin;\n\t\t//var graphicHeight = Math.floor(window.innerHeight * 0.95)\n\t\tif (window.innerWidth >= 768) {\n var graphicHeight = Math.floor(window.innerHeight * 0.75)\n } else {\n var graphicHeight = Math.floor(window.innerHeight * 0.6)\n }\n\t\tvar graphicMarginTop = Math.floor(graphicHeight / 2)\n\t\tgraphic\n\t\t\t.style('width', graphicWidth + 'px')\n\t\t\t.style('height', graphicHeight + 'px')\n\t\t\t//.style('top', '200px')\n\t\tif (window.innerWidth >= 768) {\n\t\t\tgraphic.style('top', '20%')\n\t\t\t\t\t.style('left', '30%');\n\t\t} else {\n\t\t\tgraphic.style('top', '25%')\n\t\t\t\t\t.style('left', 0);\n\t\t}\n\t\t// 3. tell scrollama to update new element dimensions\n\t\tscroller.resize();\n\t}", "title": "" }, { "docid": "6cdd58bbea921fbe69fcb6fc3376e412", "score": "0.6162782", "text": "function windowResized(){\n\tresizeCanvas();\n}", "title": "" }, { "docid": "58f2439b0afc07d36933c0e118630d4c", "score": "0.61617917", "text": "function resize() {\n\t\t\troot.bar.position();\n\n\t\t\tif (root.overlay) {\n\t\t\t\troot.overlay.position();\n\t\t\t}\n\n\t\t\tif (settings.hideUnderWidth) {\n\t\t\t\tif ($window.width() < settings.hideUnderWidth) {\n\t\t\t\t\t$main.addClass(\"sb-vhide\");\n\t\t\t\t} else {\n\t\t\t\t\t$main.removeClass(\"sb-vhide\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1de90703374d27f630a0fedc653d26ce", "score": "0.61426187", "text": "function revelar()\n{\n $(function(){\n var tam = window.innerWidth;\n var tam1 = tam * .25;\n var tam2 = tam * .5;\n var tam3 = tam * .23;\n $('#buscarAlimentos').removeClass('invisible').animate({\n width: tam1\n }\n ,function(){\n $('#crearDietas').removeClass('invisible').animate({\n width: tam2\n }\n ,function(){\n $('#balanceoDietas').removeClass('invisible').animate({\n width: tam3\n });\n });\n });\n });\n}", "title": "" }, { "docid": "610c3086b215a678a85f2afaafb7adba", "score": "0.61420256", "text": "function restartAnimation() {\n setup();\n height = document.getElementById('animation').offsetHeight;\n elementsLength = Math.floor(height / (elementHeight + 1));\n focusedIndex = 0;\n comparedIndex = 1;\n max = elementsLength;\n functionsIndex = 0;\n frames = 0;\n swapped = false;\n if (needsScrambling) objects = scramble(max);\n needsSwapping = false;\n loop();\n}", "title": "" }, { "docid": "3e4bb9d395ce3ac480e5c68469e3d34e", "score": "0.61413103", "text": "function windowResized() {\n\tresizeCanvas(\n\t\tfloor(window.innerWidth * windowScale),\n\t\tfloor(window.innerHeight * windowScale)\n\t\t);\n\treset();\n}", "title": "" }, { "docid": "5bfd85a2ad6538b56e61897956e0be56", "score": "0.61375505", "text": "function windowResized(){\r\n\tvar breakpoint = getResponsiveBreakpoint();\r\n\tswitch(breakpoint){\r\n\t\tcase \"xs\":\r\n\t\t\telongateHeader();\r\n\t\t\tabbreviateHeader_xs();\r\n\t\t\tbreak;\r\n\t\tcase \"sm\":\r\n\t\t\telongateHeader();\r\n\t\t\tabbreviateHeader();\r\n\t\t\tif(_switchType == \"week\" && _header_top_div != null){\r\n\t\t\t\t_header_top_div.style = \"padding-left:28px;\";\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\telongateHeader();\r\n\t\t\tif(_switchType == \"week\" && _header_top_div != null){\r\n\t\t\t\t_header_top_div.style = \"padding-left:0px;\";\r\n\t\t\t}\r\n\t}\r\n\tensureBoxSize();\r\n\tclearEvents();\r\n\taddEvents();\r\n}", "title": "" }, { "docid": "e1b665ea7f28d8f8664d66d53e84e30c", "score": "0.6131806", "text": "redraw() {\r\n this.body.emitter.emit('setSize');\r\n this._redraw();\r\n }", "title": "" }, { "docid": "165f5a067bbac083aaeeaccd77a73252", "score": "0.61265665", "text": "function windowResized() {\n console.log(\"LA FENETRE A CHANGE DE TAILLE\");\n resizeCanvas(windowWidth, windowHeight);\n chouchou.dessiner(random(width),random(height));\n}", "title": "" }, { "docid": "5ee87779b1e52af3429387eebe756c9f", "score": "0.6124776", "text": "function windowResized() {\n // redefine the width and heights\n canvasWidth = window.innerWidth;\n canvasHeight = window.innerHeight;\n}", "title": "" } ]